@strapi/admin 4.16.2 → 4.18.0

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.
Files changed (804) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +1 -1
  3. package/package.json +55 -41
  4. package/strapi-server.js +3 -3
  5. package/dist/_chunks/AuthenticatedApp-342bf22f.js +0 -1476
  6. package/dist/_chunks/AuthenticatedApp-342bf22f.js.map +0 -1
  7. package/dist/_chunks/AuthenticatedApp-bb31f306.mjs +0 -1450
  8. package/dist/_chunks/AuthenticatedApp-bb31f306.mjs.map +0 -1
  9. package/dist/_chunks/DragLayer-bff96835.mjs +0 -44
  10. package/dist/_chunks/DragLayer-bff96835.mjs.map +0 -1
  11. package/dist/_chunks/DragLayer-f07eee6c.js +0 -43
  12. package/dist/_chunks/DragLayer-f07eee6c.js.map +0 -1
  13. package/dist/_chunks/HomePage-0c7717c0.mjs +0 -49
  14. package/dist/_chunks/HomePage-0c7717c0.mjs.map +0 -1
  15. package/dist/_chunks/HomePage-175f79c7.js +0 -49
  16. package/dist/_chunks/HomePage-175f79c7.js.map +0 -1
  17. package/dist/_chunks/HomePage-246cc590.mjs +0 -542
  18. package/dist/_chunks/HomePage-246cc590.mjs.map +0 -1
  19. package/dist/_chunks/HomePage-6ff9e578.js +0 -563
  20. package/dist/_chunks/HomePage-6ff9e578.js.map +0 -1
  21. package/dist/_chunks/InstalledPluginsPage-170aff77.mjs +0 -134
  22. package/dist/_chunks/InstalledPluginsPage-170aff77.mjs.map +0 -1
  23. package/dist/_chunks/InstalledPluginsPage-3ae5dbb6.js +0 -153
  24. package/dist/_chunks/InstalledPluginsPage-3ae5dbb6.js.map +0 -1
  25. package/dist/_chunks/InternalErrorPage-040dc993.mjs +0 -41
  26. package/dist/_chunks/InternalErrorPage-040dc993.mjs.map +0 -1
  27. package/dist/_chunks/InternalErrorPage-d0e51ac2.js +0 -41
  28. package/dist/_chunks/InternalErrorPage-d0e51ac2.js.map +0 -1
  29. package/dist/_chunks/Layout-4b3e434a.js +0 -92
  30. package/dist/_chunks/Layout-4b3e434a.js.map +0 -1
  31. package/dist/_chunks/Layout-72fa2ace.mjs +0 -90
  32. package/dist/_chunks/Layout-72fa2ace.mjs.map +0 -1
  33. package/dist/_chunks/LimitsModal-203482b8.js +0 -84
  34. package/dist/_chunks/LimitsModal-203482b8.js.map +0 -1
  35. package/dist/_chunks/LimitsModal-da04700e.mjs +0 -82
  36. package/dist/_chunks/LimitsModal-da04700e.mjs.map +0 -1
  37. package/dist/_chunks/Login-576bbc11.js +0 -64
  38. package/dist/_chunks/Login-576bbc11.js.map +0 -1
  39. package/dist/_chunks/Login-d627bb0a.mjs +0 -62
  40. package/dist/_chunks/Login-d627bb0a.mjs.map +0 -1
  41. package/dist/_chunks/MarketplacePage-1cbfa8fd.mjs +0 -1011
  42. package/dist/_chunks/MarketplacePage-1cbfa8fd.mjs.map +0 -1
  43. package/dist/_chunks/MarketplacePage-e7cd973b.js +0 -1035
  44. package/dist/_chunks/MarketplacePage-e7cd973b.js.map +0 -1
  45. package/dist/_chunks/ProfilePage-52844daa.js +0 -665
  46. package/dist/_chunks/ProfilePage-52844daa.js.map +0 -1
  47. package/dist/_chunks/ProfilePage-ef400907.mjs +0 -642
  48. package/dist/_chunks/ProfilePage-ef400907.mjs.map +0 -1
  49. package/dist/_chunks/SSOProviders-62bfad92.mjs +0 -58
  50. package/dist/_chunks/SSOProviders-62bfad92.mjs.map +0 -1
  51. package/dist/_chunks/SSOProviders-b395a4e6.js +0 -59
  52. package/dist/_chunks/SSOProviders-b395a4e6.js.map +0 -1
  53. package/dist/_chunks/SalesPage-4a0a68fb.js +0 -51
  54. package/dist/_chunks/SalesPage-4a0a68fb.js.map +0 -1
  55. package/dist/_chunks/SalesPage-56bf9463.mjs +0 -48
  56. package/dist/_chunks/SalesPage-56bf9463.mjs.map +0 -1
  57. package/dist/_chunks/SalesPage-66f9ea32.js +0 -51
  58. package/dist/_chunks/SalesPage-66f9ea32.js.map +0 -1
  59. package/dist/_chunks/SalesPage-d0cdc1a7.js +0 -48
  60. package/dist/_chunks/SalesPage-d0cdc1a7.js.map +0 -1
  61. package/dist/_chunks/SalesPage-f9597ae7.mjs +0 -51
  62. package/dist/_chunks/SalesPage-f9597ae7.mjs.map +0 -1
  63. package/dist/_chunks/SalesPage-fceedf48.mjs +0 -51
  64. package/dist/_chunks/SalesPage-fceedf48.mjs.map +0 -1
  65. package/dist/_chunks/ar-21279f4c.js +0 -936
  66. package/dist/_chunks/ar-21279f4c.js.map +0 -1
  67. package/dist/_chunks/ar-62e5e2b3.mjs +0 -936
  68. package/dist/_chunks/ar-62e5e2b3.mjs.map +0 -1
  69. package/dist/_chunks/build-1026ce7c.mjs +0 -68
  70. package/dist/_chunks/build-1026ce7c.mjs.map +0 -1
  71. package/dist/_chunks/build-d99bcc06.js +0 -68
  72. package/dist/_chunks/build-d99bcc06.js.map +0 -1
  73. package/dist/_chunks/ca-d05fb350.js +0 -724
  74. package/dist/_chunks/ca-d05fb350.js.map +0 -1
  75. package/dist/_chunks/ca-e99de225.mjs +0 -724
  76. package/dist/_chunks/ca-e99de225.mjs.map +0 -1
  77. package/dist/_chunks/colors-c24a54f0.js +0 -33
  78. package/dist/_chunks/colors-c24a54f0.js.map +0 -1
  79. package/dist/_chunks/colors-e7489dd4.mjs +0 -34
  80. package/dist/_chunks/colors-e7489dd4.mjs.map +0 -1
  81. package/dist/_chunks/constants-2a8f4e41.mjs +0 -11
  82. package/dist/_chunks/constants-2a8f4e41.mjs.map +0 -1
  83. package/dist/_chunks/constants-40ffa931.js +0 -11
  84. package/dist/_chunks/constants-40ffa931.js.map +0 -1
  85. package/dist/_chunks/constants-4aca55b6.js +0 -85
  86. package/dist/_chunks/constants-4aca55b6.js.map +0 -1
  87. package/dist/_chunks/constants-64899732.js +0 -30
  88. package/dist/_chunks/constants-64899732.js.map +0 -1
  89. package/dist/_chunks/constants-6c68e9a0.js +0 -229
  90. package/dist/_chunks/constants-6c68e9a0.js.map +0 -1
  91. package/dist/_chunks/constants-6ecddc43.mjs +0 -111
  92. package/dist/_chunks/constants-6ecddc43.mjs.map +0 -1
  93. package/dist/_chunks/constants-74b8a935.mjs +0 -52
  94. package/dist/_chunks/constants-74b8a935.mjs.map +0 -1
  95. package/dist/_chunks/constants-7596f6f3.js +0 -132
  96. package/dist/_chunks/constants-7596f6f3.js.map +0 -1
  97. package/dist/_chunks/constants-8092eeb5.mjs +0 -59
  98. package/dist/_chunks/constants-8092eeb5.mjs.map +0 -1
  99. package/dist/_chunks/constants-85da8cc4.js +0 -58
  100. package/dist/_chunks/constants-85da8cc4.js.map +0 -1
  101. package/dist/_chunks/constants-a6fd64fc.mjs +0 -80
  102. package/dist/_chunks/constants-a6fd64fc.mjs.map +0 -1
  103. package/dist/_chunks/constants-a92ce583.mjs +0 -7
  104. package/dist/_chunks/constants-a92ce583.mjs.map +0 -1
  105. package/dist/_chunks/constants-ae0b83df.mjs +0 -227
  106. package/dist/_chunks/constants-ae0b83df.mjs.map +0 -1
  107. package/dist/_chunks/constants-c1f1f698.mjs +0 -85
  108. package/dist/_chunks/constants-c1f1f698.mjs.map +0 -1
  109. package/dist/_chunks/constants-d3dd8ed6.mjs +0 -7
  110. package/dist/_chunks/constants-d3dd8ed6.mjs.map +0 -1
  111. package/dist/_chunks/constants-d5d67ca8.js +0 -6
  112. package/dist/_chunks/constants-d5d67ca8.js.map +0 -1
  113. package/dist/_chunks/constants-da2542a3.js +0 -6
  114. package/dist/_chunks/constants-da2542a3.js.map +0 -1
  115. package/dist/_chunks/constants-ddd2d586.js +0 -82
  116. package/dist/_chunks/constants-ddd2d586.js.map +0 -1
  117. package/dist/_chunks/constants-def33545.mjs +0 -30
  118. package/dist/_chunks/constants-def33545.mjs.map +0 -1
  119. package/dist/_chunks/constants-e05f06d4.js +0 -52
  120. package/dist/_chunks/constants-e05f06d4.js.map +0 -1
  121. package/dist/_chunks/cs-2fa881a2.mjs +0 -291
  122. package/dist/_chunks/cs-2fa881a2.mjs.map +0 -1
  123. package/dist/_chunks/cs-eee75b10.js +0 -291
  124. package/dist/_chunks/cs-eee75b10.js.map +0 -1
  125. package/dist/_chunks/de-28f8bc28.mjs +0 -716
  126. package/dist/_chunks/de-28f8bc28.mjs.map +0 -1
  127. package/dist/_chunks/de-976cc986.js +0 -716
  128. package/dist/_chunks/de-976cc986.js.map +0 -1
  129. package/dist/_chunks/develop-72394876.mjs +0 -61
  130. package/dist/_chunks/develop-72394876.mjs.map +0 -1
  131. package/dist/_chunks/develop-da585b1e.js +0 -61
  132. package/dist/_chunks/develop-da585b1e.js.map +0 -1
  133. package/dist/_chunks/dk-0b759a56.mjs +0 -634
  134. package/dist/_chunks/dk-0b759a56.mjs.map +0 -1
  135. package/dist/_chunks/dk-6189917e.js +0 -634
  136. package/dist/_chunks/dk-6189917e.js.map +0 -1
  137. package/dist/_chunks/edit-29bdf5d6.js +0 -50
  138. package/dist/_chunks/edit-29bdf5d6.js.map +0 -1
  139. package/dist/_chunks/edit-923cefa0.mjs +0 -32
  140. package/dist/_chunks/edit-923cefa0.mjs.map +0 -1
  141. package/dist/_chunks/en-0e9e9327.js +0 -1022
  142. package/dist/_chunks/en-0e9e9327.js.map +0 -1
  143. package/dist/_chunks/en-e728accb.mjs +0 -1022
  144. package/dist/_chunks/en-e728accb.mjs.map +0 -1
  145. package/dist/_chunks/es-18b29db2.mjs +0 -796
  146. package/dist/_chunks/es-18b29db2.mjs.map +0 -1
  147. package/dist/_chunks/es-3ee0992a.js +0 -796
  148. package/dist/_chunks/es-3ee0992a.js.map +0 -1
  149. package/dist/_chunks/eu-8fd773c2.mjs +0 -832
  150. package/dist/_chunks/eu-8fd773c2.mjs.map +0 -1
  151. package/dist/_chunks/eu-be749f31.js +0 -832
  152. package/dist/_chunks/eu-be749f31.js.map +0 -1
  153. package/dist/_chunks/formatAPIErrors-b599cf27.js +0 -20
  154. package/dist/_chunks/formatAPIErrors-b599cf27.js.map +0 -1
  155. package/dist/_chunks/formatAPIErrors-db6ed675.mjs +0 -21
  156. package/dist/_chunks/formatAPIErrors-db6ed675.mjs.map +0 -1
  157. package/dist/_chunks/fr-29c84e1f.js +0 -762
  158. package/dist/_chunks/fr-29c84e1f.js.map +0 -1
  159. package/dist/_chunks/fr-f37df086.mjs +0 -762
  160. package/dist/_chunks/fr-f37df086.mjs.map +0 -1
  161. package/dist/_chunks/gu-377a4b46.js +0 -623
  162. package/dist/_chunks/gu-377a4b46.js.map +0 -1
  163. package/dist/_chunks/gu-69f0e13a.mjs +0 -623
  164. package/dist/_chunks/gu-69f0e13a.mjs.map +0 -1
  165. package/dist/_chunks/he-aec27352.js +0 -326
  166. package/dist/_chunks/he-aec27352.js.map +0 -1
  167. package/dist/_chunks/he-bd769d7e.mjs +0 -326
  168. package/dist/_chunks/he-bd769d7e.mjs.map +0 -1
  169. package/dist/_chunks/hi-1bdc7a46.js +0 -722
  170. package/dist/_chunks/hi-1bdc7a46.js.map +0 -1
  171. package/dist/_chunks/hi-d397a24b.mjs +0 -722
  172. package/dist/_chunks/hi-d397a24b.mjs.map +0 -1
  173. package/dist/_chunks/hu-e2c05f40.js +0 -832
  174. package/dist/_chunks/hu-e2c05f40.js.map +0 -1
  175. package/dist/_chunks/hu-eb88bd0c.mjs +0 -832
  176. package/dist/_chunks/hu-eb88bd0c.mjs.map +0 -1
  177. package/dist/_chunks/id-586df3a2.js +0 -448
  178. package/dist/_chunks/id-586df3a2.js.map +0 -1
  179. package/dist/_chunks/id-f47699e6.mjs +0 -448
  180. package/dist/_chunks/id-f47699e6.mjs.map +0 -1
  181. package/dist/_chunks/index-10a05917.mjs +0 -51
  182. package/dist/_chunks/index-10a05917.mjs.map +0 -1
  183. package/dist/_chunks/index-115d317b.mjs +0 -244
  184. package/dist/_chunks/index-115d317b.mjs.map +0 -1
  185. package/dist/_chunks/index-171715e4.js +0 -697
  186. package/dist/_chunks/index-171715e4.js.map +0 -1
  187. package/dist/_chunks/index-176cc121.mjs +0 -469
  188. package/dist/_chunks/index-176cc121.mjs.map +0 -1
  189. package/dist/_chunks/index-1bac5263.js +0 -338
  190. package/dist/_chunks/index-1bac5263.js.map +0 -1
  191. package/dist/_chunks/index-200c5a6a.js +0 -51
  192. package/dist/_chunks/index-200c5a6a.js.map +0 -1
  193. package/dist/_chunks/index-215b5421.mjs +0 -51
  194. package/dist/_chunks/index-215b5421.mjs.map +0 -1
  195. package/dist/_chunks/index-23401c29.js +0 -418
  196. package/dist/_chunks/index-23401c29.js.map +0 -1
  197. package/dist/_chunks/index-242c859c.js +0 -335
  198. package/dist/_chunks/index-242c859c.js.map +0 -1
  199. package/dist/_chunks/index-26fcb3ca.mjs +0 -1432
  200. package/dist/_chunks/index-26fcb3ca.mjs.map +0 -1
  201. package/dist/_chunks/index-28dd9303.mjs +0 -51
  202. package/dist/_chunks/index-28dd9303.mjs.map +0 -1
  203. package/dist/_chunks/index-296c14bf.mjs +0 -362
  204. package/dist/_chunks/index-296c14bf.mjs.map +0 -1
  205. package/dist/_chunks/index-2de06c32.js +0 -51
  206. package/dist/_chunks/index-2de06c32.js.map +0 -1
  207. package/dist/_chunks/index-2eb69b5d.mjs +0 -399
  208. package/dist/_chunks/index-2eb69b5d.mjs.map +0 -1
  209. package/dist/_chunks/index-2f61e3ae.js +0 -585
  210. package/dist/_chunks/index-2f61e3ae.js.map +0 -1
  211. package/dist/_chunks/index-308b73ba.mjs +0 -60
  212. package/dist/_chunks/index-308b73ba.mjs.map +0 -1
  213. package/dist/_chunks/index-34e41e15.js +0 -134
  214. package/dist/_chunks/index-34e41e15.js.map +0 -1
  215. package/dist/_chunks/index-38115cde.js +0 -66
  216. package/dist/_chunks/index-38115cde.js.map +0 -1
  217. package/dist/_chunks/index-383efae4.mjs +0 -55
  218. package/dist/_chunks/index-383efae4.mjs.map +0 -1
  219. package/dist/_chunks/index-3b426575.js +0 -47
  220. package/dist/_chunks/index-3b426575.js.map +0 -1
  221. package/dist/_chunks/index-47af1603.js +0 -253
  222. package/dist/_chunks/index-47af1603.js.map +0 -1
  223. package/dist/_chunks/index-49b7e6ff.mjs +0 -1266
  224. package/dist/_chunks/index-49b7e6ff.mjs.map +0 -1
  225. package/dist/_chunks/index-4d9b2cb9.js +0 -47
  226. package/dist/_chunks/index-4d9b2cb9.js.map +0 -1
  227. package/dist/_chunks/index-4de70b5d.js +0 -3404
  228. package/dist/_chunks/index-4de70b5d.js.map +0 -1
  229. package/dist/_chunks/index-59b1f604.js +0 -380
  230. package/dist/_chunks/index-59b1f604.js.map +0 -1
  231. package/dist/_chunks/index-5a5217e0.mjs +0 -308
  232. package/dist/_chunks/index-5a5217e0.mjs.map +0 -1
  233. package/dist/_chunks/index-5da07c41.js +0 -418
  234. package/dist/_chunks/index-5da07c41.js.map +0 -1
  235. package/dist/_chunks/index-600cb5dd.js +0 -51
  236. package/dist/_chunks/index-600cb5dd.js.map +0 -1
  237. package/dist/_chunks/index-608d8d10.mjs +0 -393
  238. package/dist/_chunks/index-608d8d10.mjs.map +0 -1
  239. package/dist/_chunks/index-74812118.mjs +0 -53
  240. package/dist/_chunks/index-74812118.mjs.map +0 -1
  241. package/dist/_chunks/index-7d578921.js +0 -847
  242. package/dist/_chunks/index-7d578921.js.map +0 -1
  243. package/dist/_chunks/index-8109fa91.mjs +0 -676
  244. package/dist/_chunks/index-8109fa91.mjs.map +0 -1
  245. package/dist/_chunks/index-82c7a120.js +0 -15401
  246. package/dist/_chunks/index-82c7a120.js.map +0 -1
  247. package/dist/_chunks/index-83d53962.js +0 -62
  248. package/dist/_chunks/index-83d53962.js.map +0 -1
  249. package/dist/_chunks/index-88298941.js +0 -54
  250. package/dist/_chunks/index-88298941.js.map +0 -1
  251. package/dist/_chunks/index-8933483b.mjs +0 -3374
  252. package/dist/_chunks/index-8933483b.mjs.map +0 -1
  253. package/dist/_chunks/index-91df57b1.mjs +0 -826
  254. package/dist/_chunks/index-91df57b1.mjs.map +0 -1
  255. package/dist/_chunks/index-973c363e.mjs +0 -63
  256. package/dist/_chunks/index-973c363e.mjs.map +0 -1
  257. package/dist/_chunks/index-989bbeec.mjs +0 -232
  258. package/dist/_chunks/index-989bbeec.mjs.map +0 -1
  259. package/dist/_chunks/index-9910dda4.js +0 -55
  260. package/dist/_chunks/index-9910dda4.js.map +0 -1
  261. package/dist/_chunks/index-9afb163a.js +0 -418
  262. package/dist/_chunks/index-9afb163a.js.map +0 -1
  263. package/dist/_chunks/index-9f61bef8.js +0 -51
  264. package/dist/_chunks/index-9f61bef8.js.map +0 -1
  265. package/dist/_chunks/index-ab31623a.mjs +0 -273
  266. package/dist/_chunks/index-ab31623a.mjs.map +0 -1
  267. package/dist/_chunks/index-ac85118a.mjs +0 -47
  268. package/dist/_chunks/index-ac85118a.mjs.map +0 -1
  269. package/dist/_chunks/index-ad8e55c0.mjs +0 -866
  270. package/dist/_chunks/index-ad8e55c0.mjs.map +0 -1
  271. package/dist/_chunks/index-aedeaf5a.js +0 -311
  272. package/dist/_chunks/index-aedeaf5a.js.map +0 -1
  273. package/dist/_chunks/index-bbac142a.js +0 -125
  274. package/dist/_chunks/index-bbac142a.js.map +0 -1
  275. package/dist/_chunks/index-bd18f803.mjs +0 -15320
  276. package/dist/_chunks/index-bd18f803.mjs.map +0 -1
  277. package/dist/_chunks/index-c8b8a2ee.mjs +0 -359
  278. package/dist/_chunks/index-c8b8a2ee.mjs.map +0 -1
  279. package/dist/_chunks/index-c97f5820.js +0 -1456
  280. package/dist/_chunks/index-c97f5820.js.map +0 -1
  281. package/dist/_chunks/index-cb6a72d2.mjs +0 -127
  282. package/dist/_chunks/index-cb6a72d2.mjs.map +0 -1
  283. package/dist/_chunks/index-cbc7c054.js +0 -266
  284. package/dist/_chunks/index-cbc7c054.js.map +0 -1
  285. package/dist/_chunks/index-ce5995cd.mjs +0 -132
  286. package/dist/_chunks/index-ce5995cd.mjs.map +0 -1
  287. package/dist/_chunks/index-d1152896.js +0 -294
  288. package/dist/_chunks/index-d1152896.js.map +0 -1
  289. package/dist/_chunks/index-d1dd825b.js +0 -365
  290. package/dist/_chunks/index-d1dd825b.js.map +0 -1
  291. package/dist/_chunks/index-d2d9df41.mjs +0 -270
  292. package/dist/_chunks/index-d2d9df41.mjs.map +0 -1
  293. package/dist/_chunks/index-d3e1fd86.js +0 -490
  294. package/dist/_chunks/index-d3e1fd86.js.map +0 -1
  295. package/dist/_chunks/index-d4517ac4.mjs +0 -582
  296. package/dist/_chunks/index-d4517ac4.mjs.map +0 -1
  297. package/dist/_chunks/index-d49fa655.js +0 -873
  298. package/dist/_chunks/index-d49fa655.js.map +0 -1
  299. package/dist/_chunks/index-d6694cab.mjs +0 -125
  300. package/dist/_chunks/index-d6694cab.mjs.map +0 -1
  301. package/dist/_chunks/index-e117c643.mjs +0 -55
  302. package/dist/_chunks/index-e117c643.mjs.map +0 -1
  303. package/dist/_chunks/index-e1b90981.mjs +0 -314
  304. package/dist/_chunks/index-e1b90981.mjs.map +0 -1
  305. package/dist/_chunks/index-e24df0bf.js +0 -403
  306. package/dist/_chunks/index-e24df0bf.js.map +0 -1
  307. package/dist/_chunks/index-e2d2f58e.mjs +0 -47
  308. package/dist/_chunks/index-e2d2f58e.mjs.map +0 -1
  309. package/dist/_chunks/index-e369d741.mjs +0 -383
  310. package/dist/_chunks/index-e369d741.mjs.map +0 -1
  311. package/dist/_chunks/index-e79b2b9e.mjs +0 -338
  312. package/dist/_chunks/index-e79b2b9e.mjs.map +0 -1
  313. package/dist/_chunks/index-ea18ff22.mjs +0 -51
  314. package/dist/_chunks/index-ea18ff22.mjs.map +0 -1
  315. package/dist/_chunks/index-eb67694f.mjs +0 -261
  316. package/dist/_chunks/index-eb67694f.mjs.map +0 -1
  317. package/dist/_chunks/index-ed3696ec.js +0 -272
  318. package/dist/_chunks/index-ed3696ec.js.map +0 -1
  319. package/dist/_chunks/index-ee1ea38b.js +0 -129
  320. package/dist/_chunks/index-ee1ea38b.js.map +0 -1
  321. package/dist/_chunks/index-efc967f5.js +0 -55
  322. package/dist/_chunks/index-efc967f5.js.map +0 -1
  323. package/dist/_chunks/index-fc700e52.js +0 -263
  324. package/dist/_chunks/index-fc700e52.js.map +0 -1
  325. package/dist/_chunks/index-fd4e5616.mjs +0 -412
  326. package/dist/_chunks/index-fd4e5616.mjs.map +0 -1
  327. package/dist/_chunks/index-ffd2f664.js +0 -1337
  328. package/dist/_chunks/index-ffd2f664.js.map +0 -1
  329. package/dist/_chunks/it-4006227c.mjs +0 -459
  330. package/dist/_chunks/it-4006227c.mjs.map +0 -1
  331. package/dist/_chunks/it-9c4295f1.js +0 -459
  332. package/dist/_chunks/it-9c4295f1.js.map +0 -1
  333. package/dist/_chunks/ja-db43ca3d.mjs +0 -633
  334. package/dist/_chunks/ja-db43ca3d.mjs.map +0 -1
  335. package/dist/_chunks/ja-eb74520f.js +0 -633
  336. package/dist/_chunks/ja-eb74520f.js.map +0 -1
  337. package/dist/_chunks/ko-18e71df4.js +0 -631
  338. package/dist/_chunks/ko-18e71df4.js.map +0 -1
  339. package/dist/_chunks/ko-a7826e25.mjs +0 -631
  340. package/dist/_chunks/ko-a7826e25.mjs.map +0 -1
  341. package/dist/_chunks/ml-90131768.mjs +0 -722
  342. package/dist/_chunks/ml-90131768.mjs.map +0 -1
  343. package/dist/_chunks/ml-c5199364.js +0 -722
  344. package/dist/_chunks/ml-c5199364.js.map +0 -1
  345. package/dist/_chunks/ms-bc514df6.js +0 -342
  346. package/dist/_chunks/ms-bc514df6.js.map +0 -1
  347. package/dist/_chunks/ms-f4f16a83.mjs +0 -342
  348. package/dist/_chunks/ms-f4f16a83.mjs.map +0 -1
  349. package/dist/_chunks/nl-887ce2c3.mjs +0 -828
  350. package/dist/_chunks/nl-887ce2c3.mjs.map +0 -1
  351. package/dist/_chunks/nl-f1aedbe2.js +0 -828
  352. package/dist/_chunks/nl-f1aedbe2.js.map +0 -1
  353. package/dist/_chunks/no-ec6c2927.js +0 -310
  354. package/dist/_chunks/no-ec6c2927.js.map +0 -1
  355. package/dist/_chunks/no-f0b02541.mjs +0 -310
  356. package/dist/_chunks/no-f0b02541.mjs.map +0 -1
  357. package/dist/_chunks/pl-9be86414.js +0 -721
  358. package/dist/_chunks/pl-9be86414.js.map +0 -1
  359. package/dist/_chunks/pl-9ccd35d9.mjs +0 -721
  360. package/dist/_chunks/pl-9ccd35d9.mjs.map +0 -1
  361. package/dist/_chunks/pt-4fcc08f1.js +0 -296
  362. package/dist/_chunks/pt-4fcc08f1.js.map +0 -1
  363. package/dist/_chunks/pt-8acb6ac1.mjs +0 -296
  364. package/dist/_chunks/pt-8acb6ac1.mjs.map +0 -1
  365. package/dist/_chunks/pt-BR-d43239e3.js +0 -794
  366. package/dist/_chunks/pt-BR-d43239e3.js.map +0 -1
  367. package/dist/_chunks/pt-BR-fd73cb13.mjs +0 -794
  368. package/dist/_chunks/pt-BR-fd73cb13.mjs.map +0 -1
  369. package/dist/_chunks/ru-9aad40c5.mjs +0 -993
  370. package/dist/_chunks/ru-9aad40c5.mjs.map +0 -1
  371. package/dist/_chunks/ru-c0293425.js +0 -993
  372. package/dist/_chunks/ru-c0293425.js.map +0 -1
  373. package/dist/_chunks/sa-6bf4c20e.mjs +0 -722
  374. package/dist/_chunks/sa-6bf4c20e.mjs.map +0 -1
  375. package/dist/_chunks/sa-8ffb7ca7.js +0 -722
  376. package/dist/_chunks/sa-8ffb7ca7.js.map +0 -1
  377. package/dist/_chunks/schema-260fec28.js +0 -514
  378. package/dist/_chunks/schema-260fec28.js.map +0 -1
  379. package/dist/_chunks/schema-6bd8bd85.mjs +0 -490
  380. package/dist/_chunks/schema-6bd8bd85.mjs.map +0 -1
  381. package/dist/_chunks/sk-58d31b17.mjs +0 -690
  382. package/dist/_chunks/sk-58d31b17.mjs.map +0 -1
  383. package/dist/_chunks/sk-a9308737.js +0 -690
  384. package/dist/_chunks/sk-a9308737.js.map +0 -1
  385. package/dist/_chunks/sv-0f5ffd1e.js +0 -827
  386. package/dist/_chunks/sv-0f5ffd1e.js.map +0 -1
  387. package/dist/_chunks/sv-d80ad633.mjs +0 -827
  388. package/dist/_chunks/sv-d80ad633.mjs.map +0 -1
  389. package/dist/_chunks/th-a53bbf7a.js +0 -430
  390. package/dist/_chunks/th-a53bbf7a.js.map +0 -1
  391. package/dist/_chunks/th-e72c6a22.mjs +0 -430
  392. package/dist/_chunks/th-e72c6a22.mjs.map +0 -1
  393. package/dist/_chunks/tr-b84a68b0.js +0 -785
  394. package/dist/_chunks/tr-b84a68b0.js.map +0 -1
  395. package/dist/_chunks/tr-e35ecfe8.mjs +0 -785
  396. package/dist/_chunks/tr-e35ecfe8.mjs.map +0 -1
  397. package/dist/_chunks/uk-de367ec1.mjs +0 -343
  398. package/dist/_chunks/uk-de367ec1.mjs.map +0 -1
  399. package/dist/_chunks/uk-e5226227.js +0 -343
  400. package/dist/_chunks/uk-e5226227.js.map +0 -1
  401. package/dist/_chunks/useAdminRolePermissions-603a2709.mjs +0 -2322
  402. package/dist/_chunks/useAdminRolePermissions-603a2709.mjs.map +0 -1
  403. package/dist/_chunks/useAdminRolePermissions-cb1a3ee2.js +0 -2337
  404. package/dist/_chunks/useAdminRolePermissions-cb1a3ee2.js.map +0 -1
  405. package/dist/_chunks/useAdminRoles-68d5d608.js +0 -62
  406. package/dist/_chunks/useAdminRoles-68d5d608.js.map +0 -1
  407. package/dist/_chunks/useAdminRoles-7ab5d521.mjs +0 -44
  408. package/dist/_chunks/useAdminRoles-7ab5d521.mjs.map +0 -1
  409. package/dist/_chunks/useAdminUsers-05d6b26a.js +0 -61
  410. package/dist/_chunks/useAdminUsers-05d6b26a.js.map +0 -1
  411. package/dist/_chunks/useAdminUsers-09f86a58.mjs +0 -43
  412. package/dist/_chunks/useAdminUsers-09f86a58.mjs.map +0 -1
  413. package/dist/_chunks/useContentTypes-53b449bb.mjs +0 -67
  414. package/dist/_chunks/useContentTypes-53b449bb.mjs.map +0 -1
  415. package/dist/_chunks/useContentTypes-7da293cc.js +0 -85
  416. package/dist/_chunks/useContentTypes-7da293cc.js.map +0 -1
  417. package/dist/_chunks/useDebounce-4712871e.js +0 -35
  418. package/dist/_chunks/useDebounce-4712871e.js.map +0 -1
  419. package/dist/_chunks/useDebounce-9364f340.mjs +0 -17
  420. package/dist/_chunks/useDebounce-9364f340.mjs.map +0 -1
  421. package/dist/_chunks/useLicenseLimitNotification-1fd756fa.mjs +0 -80
  422. package/dist/_chunks/useLicenseLimitNotification-1fd756fa.mjs.map +0 -1
  423. package/dist/_chunks/useLicenseLimitNotification-8a4d7fc1.js +0 -100
  424. package/dist/_chunks/useLicenseLimitNotification-8a4d7fc1.js.map +0 -1
  425. package/dist/_chunks/useLicenseLimits-13a102d3.mjs +0 -31
  426. package/dist/_chunks/useLicenseLimits-13a102d3.mjs.map +0 -1
  427. package/dist/_chunks/useLicenseLimits-81ef3cce.js +0 -49
  428. package/dist/_chunks/useLicenseLimits-81ef3cce.js.map +0 -1
  429. package/dist/_chunks/useReviewWorkflows-799e0305.js +0 -59
  430. package/dist/_chunks/useReviewWorkflows-799e0305.js.map +0 -1
  431. package/dist/_chunks/useReviewWorkflows-9e6b8986.mjs +0 -41
  432. package/dist/_chunks/useReviewWorkflows-9e6b8986.mjs.map +0 -1
  433. package/dist/_chunks/validateWorkflow-5693ea2d.js +0 -1124
  434. package/dist/_chunks/validateWorkflow-5693ea2d.js.map +0 -1
  435. package/dist/_chunks/validateWorkflow-7a2b6ab8.mjs +0 -1101
  436. package/dist/_chunks/validateWorkflow-7a2b6ab8.mjs.map +0 -1
  437. package/dist/_chunks/vi-096bccbb.mjs +0 -298
  438. package/dist/_chunks/vi-096bccbb.mjs.map +0 -1
  439. package/dist/_chunks/vi-c5fabb75.js +0 -298
  440. package/dist/_chunks/vi-c5fabb75.js.map +0 -1
  441. package/dist/_chunks/zh-24f618cb.js +0 -836
  442. package/dist/_chunks/zh-24f618cb.js.map +0 -1
  443. package/dist/_chunks/zh-Hans-35d2c374.js +0 -957
  444. package/dist/_chunks/zh-Hans-35d2c374.js.map +0 -1
  445. package/dist/_chunks/zh-Hans-ccf4be4b.mjs +0 -957
  446. package/dist/_chunks/zh-Hans-ccf4be4b.mjs.map +0 -1
  447. package/dist/_chunks/zh-ba29b2e1.mjs +0 -836
  448. package/dist/_chunks/zh-ba29b2e1.mjs.map +0 -1
  449. package/dist/admin/index.js +0 -34
  450. package/dist/admin/index.js.map +0 -1
  451. package/dist/admin/index.mjs +0 -34
  452. package/dist/admin/index.mjs.map +0 -1
  453. package/dist/admin/src/App.d.ts +0 -6
  454. package/dist/admin/src/StrapiApp.d.ts +0 -140
  455. package/dist/admin/src/components/AuthenticatedApp.d.ts +0 -2
  456. package/dist/admin/src/components/ConfigurationProvider.d.ts +0 -11
  457. package/dist/admin/src/components/DefaultDocument.d.ts +0 -5
  458. package/dist/admin/src/components/DragLayer.d.ts +0 -10
  459. package/dist/admin/src/components/GuidedTour/Homepage.d.ts +0 -2
  460. package/dist/admin/src/components/GuidedTour/Modal.d.ts +0 -2
  461. package/dist/admin/src/components/GuidedTour/Ornaments.d.ts +0 -13
  462. package/dist/admin/src/components/GuidedTour/Provider.d.ts +0 -6
  463. package/dist/admin/src/components/GuidedTour/constants.d.ts +0 -165
  464. package/dist/admin/src/components/LanguageProvider.d.ts +0 -19
  465. package/dist/admin/src/components/LeftMenu.d.ts +0 -5
  466. package/dist/admin/src/components/NoJavascript.d.ts +0 -7
  467. package/dist/admin/src/components/NpsSurvey.d.ts +0 -17
  468. package/dist/admin/src/components/Onboarding.d.ts +0 -2
  469. package/dist/admin/src/components/PluginsInitializer.d.ts +0 -5
  470. package/dist/admin/src/components/PrivateRoute.d.ts +0 -8
  471. package/dist/admin/src/components/Providers.d.ts +0 -13
  472. package/dist/admin/src/components/RBACProvider.d.ts +0 -27
  473. package/dist/admin/src/components/Theme.d.ts +0 -6
  474. package/dist/admin/src/components/ThemeToggleProvider.d.ts +0 -12
  475. package/dist/admin/src/components/UnauthenticatedLogo.d.ts +0 -2
  476. package/dist/admin/src/constants.d.ts +0 -195
  477. package/dist/admin/src/content-manager/components/BlocksInput/BlocksContent.d.ts +0 -5
  478. package/dist/admin/src/content-manager/components/BlocksInput/BlocksEditor.d.ts +0 -34
  479. package/dist/admin/src/content-manager/components/BlocksInput/BlocksInput.d.ts +0 -18
  480. package/dist/admin/src/content-manager/components/BlocksInput/BlocksToolbar.d.ts +0 -2
  481. package/dist/admin/src/content-manager/components/BlocksInput/hooks/useBlocksStore.d.ts +0 -32
  482. package/dist/admin/src/content-manager/components/BlocksInput/hooks/useModifiersStore.d.ts +0 -20
  483. package/dist/admin/src/content-manager/components/BlocksInput/plugins/withLinks.d.ts +0 -8
  484. package/dist/admin/src/content-manager/components/BlocksInput/plugins/withStrapiSchema.d.ts +0 -8
  485. package/dist/admin/src/content-manager/components/BlocksInput/tests/mock-schema.d.ts +0 -2
  486. package/dist/admin/src/content-manager/components/BlocksInput/utils/links.d.ts +0 -10
  487. package/dist/admin/src/content-manager/components/BlocksInput/utils/types.d.ts +0 -6
  488. package/dist/admin/src/contexts/admin.d.ts +0 -14
  489. package/dist/admin/src/contexts/apiTokenPermissions.d.ts +0 -36
  490. package/dist/admin/src/contexts/configuration.d.ts +0 -27
  491. package/dist/admin/src/contexts/themeToggle.d.ts +0 -22
  492. package/dist/admin/src/core/apis/Components.d.ts +0 -10
  493. package/dist/admin/src/core/apis/CustomFields.d.ts +0 -8
  494. package/dist/admin/src/core/apis/Fields.d.ts +0 -10
  495. package/dist/admin/src/core/apis/Middlewares.d.ts +0 -9
  496. package/dist/admin/src/core/apis/Plugin.d.ts +0 -19
  497. package/dist/admin/src/core/apis/Reducers.d.ts +0 -10
  498. package/dist/admin/src/core/store/configure.d.ts +0 -29
  499. package/dist/admin/src/core/store/hooks.d.ts +0 -37
  500. package/dist/admin/src/core/utils/basename.d.ts +0 -1
  501. package/dist/admin/src/core/utils/createHook.d.ts +0 -10
  502. package/dist/admin/src/hooks/__mocks__/useAdminUsers.d.ts +0 -2
  503. package/dist/admin/src/hooks/__mocks__/useContentTypes.d.ts +0 -2
  504. package/dist/admin/src/hooks/__mocks__/useSettingsMenu.d.ts +0 -2
  505. package/dist/admin/src/hooks/useAdminRoles.d.ts +0 -13
  506. package/dist/admin/src/hooks/useAdminUsers.d.ts +0 -19
  507. package/dist/admin/src/hooks/useContentTypes.d.ts +0 -7
  508. package/dist/admin/src/hooks/useDebounce.d.ts +0 -1
  509. package/dist/admin/src/hooks/useEnterprise.d.ts +0 -8
  510. package/dist/admin/src/hooks/useInjectReducer.d.ts +0 -10
  511. package/dist/admin/src/hooks/useLicenseLimitNotification.d.ts +0 -1
  512. package/dist/admin/src/hooks/useMenu.d.ts +0 -9
  513. package/dist/admin/src/hooks/useSettingsMenu.d.ts +0 -24
  514. package/dist/admin/src/index.d.ts +0 -3
  515. package/dist/admin/src/layouts/AppLayout.d.ts +0 -7
  516. package/dist/admin/src/layouts/UnauthenticatedLayout.d.ts +0 -11
  517. package/dist/admin/src/pages/Admin.d.ts +0 -7
  518. package/dist/admin/src/pages/Auth/AuthPage.d.ts +0 -6
  519. package/dist/admin/src/pages/Auth/components/FieldActionWrapper.d.ts +0 -3
  520. package/dist/admin/src/pages/Auth/components/ForgotPassword.d.ts +0 -3
  521. package/dist/admin/src/pages/Auth/components/ForgotPasswordSuccess.d.ts +0 -2
  522. package/dist/admin/src/pages/Auth/components/Login.d.ts +0 -8
  523. package/dist/admin/src/pages/Auth/components/Oops.d.ts +0 -2
  524. package/dist/admin/src/pages/Auth/components/Register.d.ts +0 -7
  525. package/dist/admin/src/pages/Auth/components/ResetPassword.d.ts +0 -3
  526. package/dist/admin/src/pages/Auth/constants.d.ts +0 -14
  527. package/dist/admin/src/pages/HomePage.d.ts +0 -3
  528. package/dist/admin/src/pages/InstalledPluginsPage.d.ts +0 -3
  529. package/dist/admin/src/pages/InternalErrorPage.d.ts +0 -7
  530. package/dist/admin/src/pages/Marketplace/MarketplacePage.d.ts +0 -19
  531. package/dist/admin/src/pages/Marketplace/components/NpmPackageCard.d.ts +0 -13
  532. package/dist/admin/src/pages/Marketplace/components/NpmPackagesFilters.d.ts +0 -13
  533. package/dist/admin/src/pages/Marketplace/components/NpmPackagesGrid.d.ts +0 -13
  534. package/dist/admin/src/pages/Marketplace/components/OfflineLayout.d.ts +0 -2
  535. package/dist/admin/src/pages/Marketplace/components/PageHeader.d.ts +0 -8
  536. package/dist/admin/src/pages/Marketplace/components/SortSelect.d.ts +0 -51
  537. package/dist/admin/src/pages/Marketplace/hooks/__mocks__/useNavigatorOnline.d.ts +0 -1
  538. package/dist/admin/src/pages/Marketplace/hooks/useMarketplaceData.d.ts +0 -92
  539. package/dist/admin/src/pages/Marketplace/hooks/useNavigatorOnline.d.ts +0 -5
  540. package/dist/admin/src/pages/NotFoundPage.d.ts +0 -1
  541. package/dist/admin/src/pages/ProfilePage.d.ts +0 -2
  542. package/dist/admin/src/pages/SettingsPage/hooks/useRegenerate.d.ts +0 -4
  543. package/dist/admin/src/pages/SettingsPage/pages/Roles/EditPage/hooks/usePermissionsDataManager.d.ts +0 -24
  544. package/dist/admin/src/pages/SettingsPage/pages/Roles/hooks/__mocks__/useAdminRolePermissions.d.ts +0 -2
  545. package/dist/admin/src/pages/SettingsPage/pages/Roles/hooks/useAdminRolePermissions.d.ts +0 -11
  546. package/dist/admin/src/pages/SettingsPage/utils/makeUniqueRoutes.d.ts +0 -6
  547. package/dist/admin/src/pages/UseCasePage.d.ts +0 -8
  548. package/dist/admin/src/reducer.d.ts +0 -21
  549. package/dist/admin/src/render.d.ts +0 -10
  550. package/dist/admin/src/selectors.d.ts +0 -21
  551. package/dist/admin/src/shared/components/InjectionZone.d.ts +0 -53
  552. package/dist/admin/src/shared/hooks/__mocks__/useInjectionZone.d.ts +0 -1
  553. package/dist/admin/src/shared/hooks/useInjectionZone.d.ts +0 -2
  554. package/dist/admin/src/translations/languageNativeNames.d.ts +0 -36
  555. package/dist/admin/src/types/permissions.d.ts +0 -17
  556. package/dist/admin/src/utils/createRoute.d.ts +0 -6
  557. package/dist/admin/src/utils/formatAPIErrors.d.ts +0 -6
  558. package/dist/admin/src/utils/getFullName.d.ts +0 -1
  559. package/dist/admin/src/utils/hashAdminUserEmail.d.ts +0 -6
  560. package/dist/cli.js +0 -48
  561. package/dist/cli.js.map +0 -1
  562. package/dist/cli.mjs +0 -48
  563. package/dist/cli.mjs.map +0 -1
  564. package/dist/ee/admin/src/constants.d.ts +0 -55
  565. package/dist/ee/admin/src/hooks/useLicenseLimitNotification.d.ts +0 -1
  566. package/dist/ee/admin/src/pages/AuthPage/components/Login.d.ts +0 -3
  567. package/dist/ee/admin/src/pages/AuthPage/components/Providers.d.ts +0 -2
  568. package/dist/ee/admin/src/pages/AuthPage/components/SSOProviders.d.ts +0 -8
  569. package/dist/ee/admin/src/pages/AuthPage/constants.d.ts +0 -3
  570. package/dist/ee/admin/src/pages/AuthResponse.d.ts +0 -2
  571. package/dist/ee/admin/src/pages/HomePage.d.ts +0 -1
  572. package/dist/shared/contracts/admin.d.ts +0 -23
  573. package/dist/shared/contracts/authentication.d.ts +0 -126
  574. package/dist/shared/contracts/providers.d.ts +0 -34
  575. package/dist/shared/contracts/roles.d.ts +0 -52
  576. package/dist/shared/contracts/shared.d.ts +0 -39
  577. package/dist/shared/contracts/user.d.ts +0 -40
  578. package/dist/shared/contracts/users.d.ts +0 -52
  579. package/dist/shared/schema.d.ts +0 -7
  580. package/ee/server/bootstrap.js +0 -41
  581. package/ee/server/config/admin-actions.js +0 -72
  582. package/ee/server/constants/default-stages.json +0 -18
  583. package/ee/server/constants/default-workflow.json +0 -3
  584. package/ee/server/constants/webhookEvents.js +0 -5
  585. package/ee/server/constants/workflows.js +0 -33
  586. package/ee/server/content-types/index.js +0 -9
  587. package/ee/server/content-types/workflow/index.js +0 -41
  588. package/ee/server/content-types/workflow-stage/index.js +0 -51
  589. package/ee/server/controllers/__tests__/stages.test.js +0 -174
  590. package/ee/server/controllers/admin.js +0 -50
  591. package/ee/server/controllers/audit-logs.js +0 -24
  592. package/ee/server/controllers/authentication/constants.js +0 -11
  593. package/ee/server/controllers/authentication/index.js +0 -11
  594. package/ee/server/controllers/authentication/middlewares.js +0 -117
  595. package/ee/server/controllers/authentication/utils.js +0 -23
  596. package/ee/server/controllers/authentication.js +0 -64
  597. package/ee/server/controllers/index.js +0 -12
  598. package/ee/server/controllers/role.js +0 -64
  599. package/ee/server/controllers/user.js +0 -110
  600. package/ee/server/controllers/workflows/assignees/index.js +0 -44
  601. package/ee/server/controllers/workflows/index.js +0 -188
  602. package/ee/server/controllers/workflows/stages/index.js +0 -189
  603. package/ee/server/destroy.js +0 -12
  604. package/ee/server/index.js +0 -11
  605. package/ee/server/middlewares/__tests__/review-workflows.test.js +0 -40
  606. package/ee/server/middlewares/review-workflows.js +0 -40
  607. package/ee/server/migrations/audit-logs-table.js +0 -45
  608. package/ee/server/migrations/review-workflows-content-types.js +0 -29
  609. package/ee/server/migrations/review-workflows-deleted-ct-in-workflows.js +0 -39
  610. package/ee/server/migrations/review-workflows-stage-attribute.js +0 -49
  611. package/ee/server/migrations/review-workflows-stages-color.js +0 -20
  612. package/ee/server/migrations/review-workflows-stages-roles.js +0 -68
  613. package/ee/server/migrations/review-workflows-workflow-name.js +0 -28
  614. package/ee/server/register.js +0 -40
  615. package/ee/server/routes/audit-logs.js +0 -43
  616. package/ee/server/routes/index.js +0 -8
  617. package/ee/server/routes/license-limit.js +0 -29
  618. package/ee/server/routes/review-workflows.js +0 -164
  619. package/ee/server/routes/sso.js +0 -69
  620. package/ee/server/routes/utils.js +0 -15
  621. package/ee/server/services/__tests__/assignees.test.js +0 -76
  622. package/ee/server/services/__tests__/audit-logs.test.js +0 -300
  623. package/ee/server/services/__tests__/passport.test.js +0 -95
  624. package/ee/server/services/__tests__/review-workflows-validation.test.js +0 -100
  625. package/ee/server/services/__tests__/review-workflows.test.js +0 -163
  626. package/ee/server/services/__tests__/sso.test.js +0 -117
  627. package/ee/server/services/__tests__/stages.test.js +0 -275
  628. package/ee/server/services/__tests__/workflows.test.js +0 -203
  629. package/ee/server/services/audit-logs.js +0 -236
  630. package/ee/server/services/auth.js +0 -75
  631. package/ee/server/services/index.js +0 -18
  632. package/ee/server/services/passport/provider-registry.js +0 -27
  633. package/ee/server/services/passport/sso.js +0 -37
  634. package/ee/server/services/passport.js +0 -46
  635. package/ee/server/services/review-workflows/__tests__/entity-service-decorator.test.js +0 -211
  636. package/ee/server/services/review-workflows/assignees.js +0 -54
  637. package/ee/server/services/review-workflows/entity-service-decorator.js +0 -101
  638. package/ee/server/services/review-workflows/metrics/__tests__/weekly-metrics.test.js +0 -65
  639. package/ee/server/services/review-workflows/metrics/index.js +0 -56
  640. package/ee/server/services/review-workflows/metrics/weekly-metrics.js +0 -76
  641. package/ee/server/services/review-workflows/review-workflows.js +0 -133
  642. package/ee/server/services/review-workflows/stage-permissions.js +0 -60
  643. package/ee/server/services/review-workflows/stages.js +0 -384
  644. package/ee/server/services/review-workflows/validation.js +0 -68
  645. package/ee/server/services/review-workflows/workflows/__tests__/content-types.test.js +0 -146
  646. package/ee/server/services/review-workflows/workflows/content-types.js +0 -89
  647. package/ee/server/services/review-workflows/workflows/index.js +0 -237
  648. package/ee/server/services/role.js +0 -24
  649. package/ee/server/services/seat-enforcement.js +0 -114
  650. package/ee/server/services/user.js +0 -234
  651. package/ee/server/utils/__tests__/persisted-tables.test.js +0 -38
  652. package/ee/server/utils/__tests__/sso-lock.test.js +0 -84
  653. package/ee/server/utils/index.js +0 -8
  654. package/ee/server/utils/persisted-tables.js +0 -139
  655. package/ee/server/utils/review-workflows.js +0 -39
  656. package/ee/server/utils/sso-lock.js +0 -42
  657. package/ee/server/validation/audit-logs.js +0 -18
  658. package/ee/server/validation/authentication.js +0 -36
  659. package/ee/server/validation/review-workflows.js +0 -92
  660. package/ee/server/validation/role.js +0 -68
  661. package/ee/server/validation/user.js +0 -27
  662. package/ee/strapi-server.js +0 -3
  663. package/server/bootstrap.js +0 -101
  664. package/server/config/admin-actions.js +0 -216
  665. package/server/config/admin-conditions.js +0 -26
  666. package/server/config/email-templates/forgot-password.js +0 -25
  667. package/server/config/index.js +0 -9
  668. package/server/config/settings.js +0 -9
  669. package/server/content-types/Permission.js +0 -64
  670. package/server/content-types/Role.js +0 -59
  671. package/server/content-types/User.js +0 -112
  672. package/server/content-types/api-token-permission.js +0 -36
  673. package/server/content-types/api-token.js +0 -76
  674. package/server/content-types/index.js +0 -11
  675. package/server/content-types/transfer-token-permission.js +0 -36
  676. package/server/content-types/transfer-token.js +0 -66
  677. package/server/controllers/__tests__/admin.test.js +0 -106
  678. package/server/controllers/__tests__/api-token.test.js +0 -496
  679. package/server/controllers/__tests__/content-api.test.js +0 -173
  680. package/server/controllers/__tests__/permission.test.js +0 -200
  681. package/server/controllers/__tests__/role.test.js +0 -201
  682. package/server/controllers/__tests__/transfer/token.test.js +0 -520
  683. package/server/controllers/__tests__/user.test.js +0 -326
  684. package/server/controllers/admin.js +0 -151
  685. package/server/controllers/api-token.js +0 -135
  686. package/server/controllers/authenticated-user.js +0 -52
  687. package/server/controllers/authentication.js +0 -172
  688. package/server/controllers/content-api.js +0 -15
  689. package/server/controllers/formatters/conditions.js +0 -12
  690. package/server/controllers/formatters/format-actions-by-sections.js +0 -40
  691. package/server/controllers/formatters/index.js +0 -9
  692. package/server/controllers/index.js +0 -14
  693. package/server/controllers/permission.js +0 -45
  694. package/server/controllers/role.js +0 -198
  695. package/server/controllers/transfer/index.js +0 -13
  696. package/server/controllers/transfer/runner.js +0 -28
  697. package/server/controllers/transfer/token.js +0 -131
  698. package/server/controllers/user.js +0 -141
  699. package/server/controllers/webhooks.js +0 -132
  700. package/server/destroy.js +0 -10
  701. package/server/domain/action/__tests__/action-domain.test.js +0 -230
  702. package/server/domain/action/__tests__/action-provider.test.js +0 -376
  703. package/server/domain/action/index.js +0 -142
  704. package/server/domain/action/provider.js +0 -83
  705. package/server/domain/condition/__tests__/condition-domain.test.js +0 -122
  706. package/server/domain/condition/__tests__/condition-provider.test.js +0 -156
  707. package/server/domain/condition/index.js +0 -92
  708. package/server/domain/condition/provider.js +0 -42
  709. package/server/domain/permission/__tests__/permission-domain.test.js +0 -285
  710. package/server/domain/permission/index.js +0 -156
  711. package/server/domain/user.js +0 -28
  712. package/server/index.js +0 -26
  713. package/server/middlewares/data-transfer.js +0 -29
  714. package/server/middlewares/index.js +0 -8
  715. package/server/middlewares/rateLimit.js +0 -47
  716. package/server/policies/hasPermissions.js +0 -38
  717. package/server/policies/index.js +0 -7
  718. package/server/policies/isAuthenticatedAdmin.js +0 -5
  719. package/server/policies/isTelemetryEnabled.js +0 -16
  720. package/server/register.js +0 -19
  721. package/server/routes/admin.js +0 -71
  722. package/server/routes/api-tokens.js +0 -70
  723. package/server/routes/authentication.js +0 -57
  724. package/server/routes/content-api.js +0 -20
  725. package/server/routes/index.js +0 -28
  726. package/server/routes/permissions.js +0 -20
  727. package/server/routes/roles.js +0 -107
  728. package/server/routes/serve-admin-panel.js +0 -71
  729. package/server/routes/transfer.js +0 -102
  730. package/server/routes/users.js +0 -88
  731. package/server/routes/webhooks.js +0 -81
  732. package/server/services/__tests__/action.test.js +0 -98
  733. package/server/services/__tests__/api-token.test.js +0 -980
  734. package/server/services/__tests__/auth.test.js +0 -319
  735. package/server/services/__tests__/content-type.test.js +0 -405
  736. package/server/services/__tests__/metrics.test.js +0 -65
  737. package/server/services/__tests__/passport.test.js +0 -90
  738. package/server/services/__tests__/permission.test.js +0 -177
  739. package/server/services/__tests__/permissions-manager-sanitize.test.js +0 -117
  740. package/server/services/__tests__/permissions-manager-validate.test.js +0 -119
  741. package/server/services/__tests__/permissions-manager.test.js +0 -318
  742. package/server/services/__tests__/permissions.section-builder.section.test.js +0 -136
  743. package/server/services/__tests__/project-settings.test.js +0 -397
  744. package/server/services/__tests__/role.test.js +0 -970
  745. package/server/services/__tests__/token.test.js +0 -217
  746. package/server/services/__tests__/transfer/token.test.js +0 -878
  747. package/server/services/__tests__/user.test.js +0 -786
  748. package/server/services/action.js +0 -35
  749. package/server/services/api-token.js +0 -453
  750. package/server/services/auth.js +0 -117
  751. package/server/services/condition.js +0 -14
  752. package/server/services/constants.js +0 -37
  753. package/server/services/content-type.js +0 -208
  754. package/server/services/index.js +0 -18
  755. package/server/services/metrics.js +0 -44
  756. package/server/services/passport/local-strategy.js +0 -28
  757. package/server/services/passport.js +0 -45
  758. package/server/services/permission/engine.js +0 -85
  759. package/server/services/permission/permissions-manager/index.js +0 -53
  760. package/server/services/permission/permissions-manager/query-builders.js +0 -72
  761. package/server/services/permission/permissions-manager/sanitize.js +0 -286
  762. package/server/services/permission/permissions-manager/validate.js +0 -218
  763. package/server/services/permission/queries.js +0 -190
  764. package/server/services/permission/sections-builder/builder.js +0 -84
  765. package/server/services/permission/sections-builder/handlers.js +0 -156
  766. package/server/services/permission/sections-builder/index.js +0 -50
  767. package/server/services/permission/sections-builder/section.js +0 -71
  768. package/server/services/permission/sections-builder/utils.js +0 -26
  769. package/server/services/permission.js +0 -33
  770. package/server/services/project-settings.js +0 -174
  771. package/server/services/role.js +0 -471
  772. package/server/services/token.js +0 -70
  773. package/server/services/transfer/index.js +0 -7
  774. package/server/services/transfer/permission.js +0 -22
  775. package/server/services/transfer/token.js +0 -449
  776. package/server/services/transfer/utils.js +0 -38
  777. package/server/services/user.js +0 -363
  778. package/server/strategies/__tests__/admin.test.js +0 -118
  779. package/server/strategies/__tests__/api-token.test.js +0 -364
  780. package/server/strategies/admin.js +0 -52
  781. package/server/strategies/api-token.js +0 -140
  782. package/server/strategies/data-transfer.js +0 -113
  783. package/server/strategies/index.js +0 -26
  784. package/server/utils/index.d.ts +0 -25
  785. package/server/utils/index.js +0 -9
  786. package/server/validation/__tests__/common-functions.test.js +0 -54
  787. package/server/validation/action-provider.js +0 -67
  788. package/server/validation/api-tokens.js +0 -32
  789. package/server/validation/authentication/forgot-password.js +0 -14
  790. package/server/validation/authentication/index.js +0 -19
  791. package/server/validation/authentication/register.js +0 -45
  792. package/server/validation/authentication/renew-token.js +0 -7
  793. package/server/validation/authentication/reset-password.js +0 -15
  794. package/server/validation/common-functions/check-fields-are-correctly-nested.js +0 -28
  795. package/server/validation/common-functions/check-fields-dont-have-duplicates.js +0 -17
  796. package/server/validation/common-functions/index.js +0 -9
  797. package/server/validation/common-validators.js +0 -209
  798. package/server/validation/permission.js +0 -53
  799. package/server/validation/policies/hasPermissions.js +0 -27
  800. package/server/validation/project-settings.js +0 -48
  801. package/server/validation/role.js +0 -59
  802. package/server/validation/transfer/index.js +0 -5
  803. package/server/validation/transfer/token.js +0 -42
  804. package/server/validation/user.js +0 -65
@@ -1,3374 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { auth, useCallbackRef, translatedErrors, useFetchClient, useQuery, Form, useNotification, useAppInfo, usePersistentState, useTracking, useGuidedTour, useAPIErrorHandler, getYupInnerErrors, useFocusWhenNavigate, pxToRem, LoadingIndicatorPage, TrackingProvider, prefixFileUrlWithBackendUrl, GuidedTourProvider as GuidedTourProvider$1, StrapiAppProvider, LibraryProvider, CustomFieldsProvider, AutoReloadOverlayBlockerProvider, OverlayBlockerProvider, NotificationsProvider, RBACContext, getFetchClient } from "@strapi/helper-plugin";
3
- import { createRoot } from "react-dom/client";
4
- import { Box, Flex, SingleSelect, SingleSelectOption, FieldAction, TextInput, Main, Typography, Checkbox, Button, Field, Portal, IconButton, FieldLabel, VisuallyHidden, FieldInput, Textarea, Grid, GridItem, HeaderLayout, ContentLayout, EmptyStateLayout, LinkButton, Select, Option, TextButton, SkipToContent, DesignSystemProvider, lightTheme, darkTheme } from "@strapi/design-system";
5
- import invariant from "invariant";
6
- import isFunction from "lodash/isFunction";
7
- import merge from "lodash/merge";
8
- import pick from "lodash/pick";
9
- import { Helmet } from "react-helmet";
10
- import { useLocation, Route, Redirect, useHistory, NavLink, useRouteMatch, Switch, BrowserRouter } from "react-router-dom";
11
- import * as React from "react";
12
- import { IntlProvider, useIntl } from "react-intl";
13
- import { useDispatch, Provider, useSelector, useStore } from "react-redux";
14
- import { createContext } from "@radix-ui/react-context";
15
- import { Link } from "@strapi/design-system/v2";
16
- import { Eye, EyeStriked, Cross, ArrowRight, EmptyPictures } from "@strapi/icons";
17
- import { Formik, Form as Form$1 } from "formik";
18
- import camelCase from "lodash/camelCase";
19
- import { useMutation, useQuery as useQuery$1, QueryClient, QueryClientProvider } from "react-query";
20
- import styled, { useTheme, createGlobalStyle } from "styled-components";
21
- import * as yup from "yup";
22
- import { ValidationError } from "yup";
23
- import defaultsDeep from "lodash/defaultsDeep";
24
- import omit from "lodash/omit";
25
- import { parse } from "qs";
26
- import produce from "immer";
27
- import get from "lodash/get";
28
- import set from "lodash/set";
29
- import { createSelector, configureStore, combineReducers } from "@reduxjs/toolkit";
30
- const styles = `
31
- .strapi--root {
32
- position: absolute;
33
- top: 0;
34
- right: 0;
35
- left: 0;
36
- bottom: 0;
37
- background: #fff;
38
- }
39
-
40
- .strapi--no-js {
41
- position: absolute;
42
- top: 50%;
43
- left: 50%;
44
- transform: translate(-50%, -50%);
45
- text-align: center;
46
- font-family: helvetica, arial, sans-serif;
47
- }
48
- `;
49
- const NoJavascript = () => {
50
- return /* @__PURE__ */ jsx("noscript", { children: /* @__PURE__ */ jsx("div", { className: "strapi--root", children: /* @__PURE__ */ jsxs("div", { className: "strapi--no-js", children: [
51
- /* @__PURE__ */ jsx("style", { type: "text/css", children: styles }),
52
- /* @__PURE__ */ jsx("h1", { children: "JavaScript disabled" }),
53
- /* @__PURE__ */ jsxs("p", { children: [
54
- "Please ",
55
- /* @__PURE__ */ jsx("a", { href: "https://www.enable-javascript.com/", children: "enable JavaScript" }),
56
- " in your browser and reload the page to proceed."
57
- ] })
58
- ] }) }) });
59
- };
60
- const globalStyles = `
61
- html,
62
- body,
63
- #strapi {
64
- height: 100%;
65
- }
66
- body {
67
- margin: 0;
68
- -webkit-font-smoothing: antialiased;
69
- }
70
- `;
71
- const DefaultDocument = () => {
72
- return /* @__PURE__ */ jsxs("html", { lang: "en", children: [
73
- /* @__PURE__ */ jsxs("head", { children: [
74
- /* @__PURE__ */ jsx("meta", { charSet: "utf-8" }),
75
- /* @__PURE__ */ jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1, viewport-fit=cover" }),
76
- /* @__PURE__ */ jsx("meta", { name: "robots", content: "noindex" }),
77
- /* @__PURE__ */ jsx("meta", { name: "referrer", content: "same-origin" }),
78
- /* @__PURE__ */ jsx("title", { children: "Strapi Admin" }),
79
- /* @__PURE__ */ jsx("style", { children: globalStyles })
80
- ] }),
81
- /* @__PURE__ */ jsxs("body", { children: [
82
- /* @__PURE__ */ jsx("div", { id: "strapi" }),
83
- /* @__PURE__ */ jsx(NoJavascript, {})
84
- ] })
85
- ] });
86
- };
87
- const __variableDynamicImportRuntimeHelper = (glob, path) => {
88
- const v = glob[path];
89
- if (v) {
90
- return typeof v === "function" ? v() : Promise.resolve(v);
91
- }
92
- return new Promise((_, reject) => {
93
- (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(reject.bind(null, new Error("Unknown variable dynamic import: " + path)));
94
- });
95
- };
96
- const PrivateRoute = ({
97
- component: Component,
98
- path,
99
- ...rest
100
- }) => {
101
- const { pathname, search } = useLocation();
102
- return /* @__PURE__ */ jsx(
103
- Route,
104
- {
105
- path,
106
- render: (props) => auth.getToken() !== null ? /* @__PURE__ */ jsx(Component, { ...rest, ...props }) : /* @__PURE__ */ jsx(
107
- Redirect,
108
- {
109
- to: {
110
- pathname: "/auth/login",
111
- search: pathname !== "/" ? `?redirectTo=${encodeURIComponent(`${pathname}${search}`)}` : void 0
112
- }
113
- }
114
- )
115
- }
116
- );
117
- };
118
- const ADMIN_PERMISSIONS_CE = {
119
- contentManager: {
120
- main: [],
121
- collectionTypesConfigurations: [
122
- {
123
- action: "plugin::content-manager.collection-types.configure-view",
124
- subject: null
125
- }
126
- ],
127
- componentsConfigurations: [
128
- {
129
- action: "plugin::content-manager.components.configure-layout",
130
- subject: null
131
- }
132
- ],
133
- singleTypesConfigurations: [
134
- {
135
- action: "plugin::content-manager.single-types.configure-view",
136
- subject: null
137
- }
138
- ]
139
- },
140
- marketplace: {
141
- main: [{ action: "admin::marketplace.read", subject: null }],
142
- read: [{ action: "admin::marketplace.read", subject: null }]
143
- },
144
- settings: {
145
- roles: {
146
- main: [
147
- { action: "admin::roles.create", subject: null },
148
- { action: "admin::roles.update", subject: null },
149
- { action: "admin::roles.read", subject: null },
150
- { action: "admin::roles.delete", subject: null }
151
- ],
152
- create: [{ action: "admin::roles.create", subject: null }],
153
- delete: [{ action: "admin::roles.delete", subject: null }],
154
- read: [{ action: "admin::roles.read", subject: null }],
155
- update: [{ action: "admin::roles.update", subject: null }]
156
- },
157
- users: {
158
- main: [
159
- { action: "admin::users.create", subject: null },
160
- { action: "admin::users.read", subject: null },
161
- { action: "admin::users.update", subject: null },
162
- { action: "admin::users.delete", subject: null }
163
- ],
164
- create: [{ action: "admin::users.create", subject: null }],
165
- delete: [{ action: "admin::users.delete", subject: null }],
166
- read: [{ action: "admin::users.read", subject: null }],
167
- update: [{ action: "admin::users.update", subject: null }]
168
- },
169
- webhooks: {
170
- main: [
171
- { action: "admin::webhooks.create", subject: null },
172
- { action: "admin::webhooks.read", subject: null },
173
- { action: "admin::webhooks.update", subject: null },
174
- { action: "admin::webhooks.delete", subject: null }
175
- ],
176
- create: [{ action: "admin::webhooks.create", subject: null }],
177
- delete: [{ action: "admin::webhooks.delete", subject: null }],
178
- read: [
179
- { action: "admin::webhooks.read", subject: null },
180
- // NOTE: We need to check with the API
181
- { action: "admin::webhooks.update", subject: null },
182
- { action: "admin::webhooks.delete", subject: null }
183
- ],
184
- update: [{ action: "admin::webhooks.update", subject: null }]
185
- },
186
- "api-tokens": {
187
- main: [{ action: "admin::api-tokens.access", subject: null }],
188
- create: [{ action: "admin::api-tokens.create", subject: null }],
189
- delete: [{ action: "admin::api-tokens.delete", subject: null }],
190
- read: [{ action: "admin::api-tokens.read", subject: null }],
191
- update: [{ action: "admin::api-tokens.update", subject: null }],
192
- regenerate: [{ action: "admin::api-tokens.regenerate", subject: null }]
193
- },
194
- "transfer-tokens": {
195
- main: [{ action: "admin::transfer.tokens.access", subject: null }],
196
- create: [{ action: "admin::transfer.tokens.create", subject: null }],
197
- delete: [{ action: "admin::transfer.tokens.delete", subject: null }],
198
- read: [{ action: "admin::transfer.tokens.read", subject: null }],
199
- update: [{ action: "admin::transfer.tokens.update", subject: null }],
200
- regenerate: [{ action: "admin::transfer.tokens.regenerate", subject: null }]
201
- },
202
- "project-settings": {
203
- read: [{ action: "admin::project-settings.read", subject: null }],
204
- update: [{ action: "admin::project-settings.update", subject: null }]
205
- }
206
- }
207
- };
208
- const HOOKS = {
209
- /**
210
- * Hook that allows to mutate the displayed headers of the list view table
211
- * @constant
212
- * @type {string}
213
- */
214
- INJECT_COLUMN_IN_TABLE: "Admin/CM/pages/ListView/inject-column-in-table",
215
- /**
216
- * Hook that allows to mutate the CM's collection types links pre-set filters
217
- * @constant
218
- * @type {string}
219
- */
220
- MUTATE_COLLECTION_TYPES_LINKS: "Admin/CM/pages/App/mutate-collection-types-links",
221
- /**
222
- * Hook that allows to mutate the CM's edit view layout
223
- * @constant
224
- * @type {string}
225
- */
226
- MUTATE_EDIT_VIEW_LAYOUT: "Admin/CM/pages/EditView/mutate-edit-view-layout",
227
- /**
228
- * Hook that allows to mutate the CM's single types links pre-set filters
229
- * @constant
230
- * @type {string}
231
- */
232
- MUTATE_SINGLE_TYPES_LINKS: "Admin/CM/pages/App/mutate-single-types-links"
233
- };
234
- const ACTION_SET_APP_RUNTIME_STATUS = "StrapiAdmin/APP/SET_APP_RUNTIME_STATUS";
235
- const ACTION_SET_ADMIN_PERMISSIONS = "StrapiAdmin/App/SET_ADMIN_PERMISSIONS";
236
- const SETTINGS_LINKS_CE = () => ({
237
- global: [
238
- {
239
- intlLabel: { id: "Settings.application.title", defaultMessage: "Overview" },
240
- to: "/settings/application-infos",
241
- id: "000-application-infos"
242
- },
243
- {
244
- intlLabel: { id: "Settings.webhooks.title", defaultMessage: "Webhooks" },
245
- to: "/settings/webhooks",
246
- id: "webhooks"
247
- },
248
- {
249
- intlLabel: { id: "Settings.apiTokens.title", defaultMessage: "API Tokens" },
250
- to: "/settings/api-tokens?sort=name:ASC",
251
- id: "api-tokens"
252
- },
253
- {
254
- intlLabel: { id: "Settings.transferTokens.title", defaultMessage: "Transfer Tokens" },
255
- to: "/settings/transfer-tokens?sort=name:ASC",
256
- id: "transfer-tokens"
257
- },
258
- // If the Enterprise feature is not enabled and if the config doesn't disable it, we promote the Enterprise feature by displaying them in the settings menu.
259
- // Disable this by adding "promoteEE: false" to your `./config/admin.js` file
260
- ...!window.strapi.features.isEnabled(window.strapi.features.SSO) && window.strapi?.flags?.promoteEE ? [
261
- {
262
- intlLabel: { id: "Settings.sso.title", defaultMessage: "Single Sign-On" },
263
- to: "/settings/purchase-single-sign-on",
264
- id: "sso",
265
- lockIcon: true
266
- }
267
- ] : [],
268
- ...!window.strapi.features.isEnabled(window.strapi.features.REVIEW_WORKFLOWS) && window.strapi?.flags?.promoteEE ? [
269
- {
270
- intlLabel: {
271
- id: "Settings.review-workflows.page.title",
272
- defaultMessage: "Review Workflows"
273
- },
274
- to: "/settings/purchase-review-workflows",
275
- id: "review-workflows",
276
- lockIcon: true
277
- }
278
- ] : []
279
- ],
280
- admin: [
281
- {
282
- intlLabel: { id: "global.roles", defaultMessage: "Roles" },
283
- to: "/settings/roles",
284
- id: "roles"
285
- },
286
- {
287
- intlLabel: { id: "global.users", defaultMessage: "Users" },
288
- // Init the search params directly
289
- to: "/settings/users?pageSize=10&page=1&sort=firstname",
290
- id: "users"
291
- },
292
- ...!window.strapi.features.isEnabled(window.strapi.features.AUDIT_LOGS) && window.strapi?.flags?.promoteEE ? [
293
- {
294
- intlLabel: { id: "global.auditLogs", defaultMessage: "Audit Logs" },
295
- to: "/settings/purchase-audit-logs",
296
- id: "auditLogs",
297
- lockIcon: true
298
- }
299
- ] : []
300
- ]
301
- });
302
- const [ConfigurationContextProvider, useConfigurationContext] = createContext("ConfigurationContext");
303
- const useConfiguration = () => useConfigurationContext("useConfiguration");
304
- function isEnterprise() {
305
- return window.strapi.isEE;
306
- }
307
- const useEnterprise = (ceData, eeCallback, opts = {}) => {
308
- const { defaultValue = null, combine = (_ceData, eeData) => eeData, enabled = true } = opts;
309
- const eeCallbackRef = useCallbackRef(eeCallback);
310
- const combineCallbackRef = useCallbackRef(combine);
311
- const [{ data }, setData] = React.useState({
312
- data: isEnterprise() && enabled ? defaultValue : ceData
313
- });
314
- React.useEffect(() => {
315
- async function importEE() {
316
- const eeData = await eeCallbackRef();
317
- const combinedValue = combineCallbackRef(ceData, eeData);
318
- setData({ data: combinedValue ? combinedValue : eeData });
319
- }
320
- if (isEnterprise() && enabled) {
321
- importEE();
322
- }
323
- }, [ceData, eeCallbackRef, combineCallbackRef, enabled]);
324
- return data;
325
- };
326
- const [LocalesContextProvider, useLocalesContext] = createContext("LocalesContext");
327
- const useLocales = () => useLocalesContext("useLocales");
328
- const LANGUAGE_LOCAL_STORAGE_KEY = "strapi-admin-language";
329
- const LanguageProvider = ({ children, localeNames, messages }) => {
330
- const [{ locale }, dispatch] = React.useReducer(
331
- reducer$2,
332
- initialState$7,
333
- () => {
334
- const languageFromLocaleStorage = window.localStorage.getItem(LANGUAGE_LOCAL_STORAGE_KEY);
335
- if (languageFromLocaleStorage && localeNames[languageFromLocaleStorage]) {
336
- return {
337
- locale: languageFromLocaleStorage,
338
- localeNames
339
- };
340
- } else {
341
- return {
342
- locale: "en",
343
- localeNames
344
- };
345
- }
346
- }
347
- );
348
- React.useEffect(() => {
349
- window.localStorage.setItem(LANGUAGE_LOCAL_STORAGE_KEY, locale);
350
- document.documentElement.setAttribute("lang", locale);
351
- }, [locale]);
352
- const changeLocale = React.useCallback((locale2) => {
353
- dispatch({
354
- type: "CHANGE_LOCALE",
355
- locale: locale2
356
- });
357
- }, []);
358
- const appMessages = defaultsDeep(messages[locale], messages.en);
359
- return /* @__PURE__ */ jsx(IntlProvider, { locale, defaultLocale: "en", messages: appMessages, textComponent: "span", children: /* @__PURE__ */ jsx(LocalesContextProvider, { changeLocale, localeNames, children }) });
360
- };
361
- const initialState$7 = {
362
- localeNames: { en: "English" },
363
- locale: "en"
364
- };
365
- const reducer$2 = (state = initialState$7, action) => {
366
- switch (action.type) {
367
- case "CHANGE_LOCALE": {
368
- const { locale } = action;
369
- if (!state.localeNames[locale]) {
370
- return state;
371
- }
372
- return { ...state, locale };
373
- }
374
- default: {
375
- return state;
376
- }
377
- }
378
- };
379
- const Img = styled.img`
380
- height: ${72 / 16}rem;
381
- `;
382
- const Logo = () => {
383
- const {
384
- logos: { auth: auth2 }
385
- } = useConfiguration();
386
- return /* @__PURE__ */ jsx(Img, { src: auth2?.custom ?? auth2.default, "aria-hidden": true, alt: "" });
387
- };
388
- const Wrapper = styled(Box)`
389
- margin: 0 auto;
390
- width: 552px;
391
- `;
392
- const Column = styled(Flex)`
393
- flex-direction: column;
394
- `;
395
- const LocaleToggle = () => {
396
- const { changeLocale, localeNames } = useLocales();
397
- const { formatMessage, locale } = useIntl();
398
- return /* @__PURE__ */ jsx(
399
- SingleSelect,
400
- {
401
- "aria-label": formatMessage({
402
- id: "global.localeToggle.label",
403
- defaultMessage: "Select interface language"
404
- }),
405
- value: locale,
406
- onChange: (language) => {
407
- changeLocale(language);
408
- },
409
- children: Object.entries(localeNames).map(([language, name]) => /* @__PURE__ */ jsx(SingleSelectOption, { value: language, children: name }, language))
410
- }
411
- );
412
- };
413
- const LayoutContent = ({ children }) => /* @__PURE__ */ jsx(
414
- Wrapper,
415
- {
416
- shadow: "tableShadow",
417
- hasRadius: true,
418
- paddingTop: 9,
419
- paddingBottom: 9,
420
- paddingLeft: 10,
421
- paddingRight: 10,
422
- background: "neutral0",
423
- children
424
- }
425
- );
426
- const UnauthenticatedLayout = ({ children }) => {
427
- return /* @__PURE__ */ jsxs("div", { children: [
428
- /* @__PURE__ */ jsx(Flex, { as: "header", justifyContent: "flex-end", children: /* @__PURE__ */ jsx(Box, { paddingTop: 6, paddingRight: 8, children: /* @__PURE__ */ jsx(LocaleToggle, {}) }) }),
429
- /* @__PURE__ */ jsx(Box, { paddingTop: 2, paddingBottom: 11, children })
430
- ] });
431
- };
432
- const FieldActionWrapper = styled(FieldAction)`
433
- svg {
434
- height: 1rem;
435
- width: 1rem;
436
- path {
437
- fill: ${({ theme }) => theme.colors.neutral600};
438
- }
439
- }
440
- `;
441
- const LOGIN_SCHEMA = yup.object().shape({
442
- email: yup.string().email(translatedErrors.email).required(translatedErrors.required),
443
- password: yup.string().required(translatedErrors.required),
444
- rememberMe: yup.bool().nullable()
445
- });
446
- const Login = ({ children }) => {
447
- const [apiError, setApiError] = React.useState();
448
- const [passwordShown, setPasswordShown] = React.useState(false);
449
- const { formatMessage } = useIntl();
450
- const { post } = useFetchClient();
451
- const { changeLocale } = useLocales();
452
- const query = useQuery();
453
- const { push } = useHistory();
454
- const mutation = useMutation(
455
- async (body) => {
456
- const {
457
- data: { data }
458
- } = await post("/admin/login", body);
459
- return { ...data, rememberMe: body.rememberMe };
460
- },
461
- {
462
- onSuccess(data) {
463
- if (data) {
464
- const { token, user } = data;
465
- if (user.preferedLanguage) {
466
- changeLocale(user.preferedLanguage);
467
- }
468
- auth.setToken(token, data.rememberMe);
469
- auth.setUserInfo(user, data.rememberMe);
470
- const redirectTo = query.get("redirectTo");
471
- const redirectUrl = redirectTo ? decodeURIComponent(redirectTo) : "/";
472
- push(redirectUrl);
473
- }
474
- },
475
- onError(err) {
476
- const message = err.response?.data?.error?.message ?? "Something went wrong";
477
- if (camelCase(message).toLowerCase() === "usernotactive") {
478
- push("/auth/oops");
479
- return;
480
- }
481
- setApiError(message);
482
- }
483
- }
484
- );
485
- return /* @__PURE__ */ jsx(UnauthenticatedLayout, { children: /* @__PURE__ */ jsxs(Main, { children: [
486
- /* @__PURE__ */ jsxs(LayoutContent, { children: [
487
- /* @__PURE__ */ jsxs(Column, { children: [
488
- /* @__PURE__ */ jsx(Logo, {}),
489
- /* @__PURE__ */ jsx(Box, { paddingTop: 6, paddingBottom: 1, children: /* @__PURE__ */ jsx(Typography, { variant: "alpha", as: "h1", children: formatMessage({
490
- id: "Auth.form.welcome.title",
491
- defaultMessage: "Welcome!"
492
- }) }) }),
493
- /* @__PURE__ */ jsx(Box, { paddingBottom: 7, children: /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage({
494
- id: "Auth.form.welcome.subtitle",
495
- defaultMessage: "Log in to your Strapi account"
496
- }) }) }),
497
- mutation.isError && apiError ? /* @__PURE__ */ jsx(Typography, { id: "global-form-error", role: "alert", tabIndex: -1, textColor: "danger600", children: apiError }) : null
498
- ] }),
499
- /* @__PURE__ */ jsx(
500
- Formik,
501
- {
502
- enableReinitialize: true,
503
- initialValues: {
504
- email: "",
505
- password: "",
506
- rememberMe: false
507
- },
508
- onSubmit: (values) => {
509
- mutation.mutate(values);
510
- },
511
- validationSchema: LOGIN_SCHEMA,
512
- validateOnChange: false,
513
- children: ({ values, errors, handleChange }) => /* @__PURE__ */ jsx(Form, { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
514
- /* @__PURE__ */ jsx(
515
- TextInput,
516
- {
517
- error: errors.email ? formatMessage({
518
- id: errors.email,
519
- defaultMessage: "This value is required."
520
- }) : "",
521
- value: values.email,
522
- onChange: handleChange,
523
- label: formatMessage({ id: "Auth.form.email.label", defaultMessage: "Email" }),
524
- placeholder: formatMessage({
525
- id: "Auth.form.email.placeholder",
526
- defaultMessage: "kai@doe.com"
527
- }),
528
- name: "email",
529
- required: true
530
- }
531
- ),
532
- /* @__PURE__ */ jsx(
533
- PasswordInput$2,
534
- {
535
- error: errors.password ? formatMessage({
536
- id: errors.password,
537
- defaultMessage: "This value is required."
538
- }) : "",
539
- onChange: handleChange,
540
- value: values.password,
541
- label: formatMessage({
542
- id: "global.password",
543
- defaultMessage: "Password"
544
- }),
545
- name: "password",
546
- type: passwordShown ? "text" : "password",
547
- endAction: /* @__PURE__ */ jsx(
548
- FieldActionWrapper,
549
- {
550
- onClick: (e) => {
551
- e.stopPropagation();
552
- setPasswordShown((prev) => !prev);
553
- },
554
- label: formatMessage(
555
- passwordShown ? {
556
- id: "Auth.form.password.show-password",
557
- defaultMessage: "Show password"
558
- } : {
559
- id: "Auth.form.password.hide-password",
560
- defaultMessage: "Hide password"
561
- }
562
- ),
563
- children: passwordShown ? /* @__PURE__ */ jsx(Eye, {}) : /* @__PURE__ */ jsx(EyeStriked, {})
564
- }
565
- ),
566
- required: true
567
- }
568
- ),
569
- /* @__PURE__ */ jsx(
570
- Checkbox,
571
- {
572
- onValueChange: (checked) => {
573
- handleChange({ target: { value: checked, name: "rememberMe" } });
574
- },
575
- value: values.rememberMe,
576
- "aria-label": "rememberMe",
577
- name: "rememberMe",
578
- children: formatMessage({
579
- id: "Auth.form.rememberMe.label",
580
- defaultMessage: "Remember me"
581
- })
582
- }
583
- ),
584
- /* @__PURE__ */ jsx(Button, { fullWidth: true, type: "submit", children: formatMessage({ id: "Auth.form.button.login", defaultMessage: "Login" }) })
585
- ] }) })
586
- }
587
- ),
588
- children
589
- ] }),
590
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsx(Link, { as: NavLink, to: "/auth/forgot-password", children: formatMessage({
591
- id: "Auth.link.forgot-password",
592
- defaultMessage: "Forgot your password?"
593
- }) }) }) })
594
- ] }) });
595
- };
596
- const PasswordInput$2 = styled(TextInput)`
597
- ::-ms-reveal {
598
- display: none;
599
- }
600
- `;
601
- const ForgotPassword = () => {
602
- const { push } = useHistory();
603
- const { post } = useFetchClient();
604
- const { formatMessage } = useIntl();
605
- const { mutate, isError } = useMutation(
606
- async (body) => {
607
- await post("/admin/forgot-password", body);
608
- },
609
- {
610
- onSuccess() {
611
- push("/auth/forgot-password-success");
612
- }
613
- }
614
- );
615
- return /* @__PURE__ */ jsx(UnauthenticatedLayout, { children: /* @__PURE__ */ jsxs(Main, { children: [
616
- /* @__PURE__ */ jsxs(LayoutContent, { children: [
617
- /* @__PURE__ */ jsxs(Column, { children: [
618
- /* @__PURE__ */ jsx(Logo, {}),
619
- /* @__PURE__ */ jsx(Box, { paddingTop: 6, paddingBottom: 7, children: /* @__PURE__ */ jsx(Typography, { as: "h1", variant: "alpha", children: formatMessage({
620
- id: "Auth.form.button.password-recovery",
621
- defaultMessage: "Password Recovery"
622
- }) }) }),
623
- isError ? /* @__PURE__ */ jsx(Typography, { id: "global-form-error", role: "alert", tabIndex: -1, textColor: "danger600", children: formatMessage({
624
- id: "notification.error",
625
- defaultMessage: "An error occurred"
626
- }) }) : null
627
- ] }),
628
- /* @__PURE__ */ jsx(
629
- Formik,
630
- {
631
- enableReinitialize: true,
632
- initialValues: {
633
- email: ""
634
- },
635
- onSubmit: (values) => {
636
- mutate(values);
637
- },
638
- validationSchema: yup.object().shape({
639
- email: yup.string().email(translatedErrors.email).required(translatedErrors.required)
640
- }),
641
- validateOnChange: false,
642
- children: ({ values, errors, handleChange }) => /* @__PURE__ */ jsx(Form, { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
643
- /* @__PURE__ */ jsx(
644
- TextInput,
645
- {
646
- error: errors.email ? formatMessage({
647
- id: errors.email,
648
- defaultMessage: "This email is invalid."
649
- }) : "",
650
- value: values.email,
651
- onChange: handleChange,
652
- label: formatMessage({ id: "Auth.form.email.label", defaultMessage: "Email" }),
653
- placeholder: formatMessage({
654
- id: "Auth.form.email.placeholder",
655
- defaultMessage: "kai@doe.com"
656
- }),
657
- name: "email",
658
- required: true
659
- }
660
- ),
661
- /* @__PURE__ */ jsx(Button, { type: "submit", fullWidth: true, children: formatMessage({
662
- id: "Auth.form.button.forgot-password",
663
- defaultMessage: "Send Email"
664
- }) })
665
- ] }) })
666
- }
667
- )
668
- ] }),
669
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsx(Link, { as: NavLink, to: "/auth/login", children: formatMessage({ id: "Auth.link.ready", defaultMessage: "Ready to sign in?" }) }) }) })
670
- ] }) });
671
- };
672
- const ForgotPasswordSuccess = () => {
673
- const { formatMessage } = useIntl();
674
- return /* @__PURE__ */ jsx(UnauthenticatedLayout, { children: /* @__PURE__ */ jsxs(Main, { children: [
675
- /* @__PURE__ */ jsx(LayoutContent, { children: /* @__PURE__ */ jsxs(Column, { children: [
676
- /* @__PURE__ */ jsx(Logo, {}),
677
- /* @__PURE__ */ jsx(Box, { paddingTop: 6, paddingBottom: 7, children: /* @__PURE__ */ jsx(Typography, { as: "h1", variant: "alpha", children: formatMessage({
678
- id: "app.containers.AuthPage.ForgotPasswordSuccess.title",
679
- defaultMessage: "Email sent"
680
- }) }) }),
681
- /* @__PURE__ */ jsx(Typography, { children: formatMessage({
682
- id: "app.containers.AuthPage.ForgotPasswordSuccess.text.email",
683
- defaultMessage: "It can take a few minutes to receive your password recovery link."
684
- }) }),
685
- /* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsx(Typography, { children: formatMessage({
686
- id: "app.containers.AuthPage.ForgotPasswordSuccess.text.contact-admin",
687
- defaultMessage: "If you do not receive this link, please contact your administrator."
688
- }) }) })
689
- ] }) }),
690
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsx(Link, { as: NavLink, to: "/auth/login", children: formatMessage({ id: "Auth.link.signin", defaultMessage: "Sign in" }) }) }) })
691
- ] }) });
692
- };
693
- const Oops = () => {
694
- const { formatMessage } = useIntl();
695
- const query = useQuery();
696
- const message = query.get("info") || formatMessage({
697
- id: "Auth.components.Oops.text",
698
- defaultMessage: "Your account has been suspended."
699
- });
700
- return /* @__PURE__ */ jsx(UnauthenticatedLayout, { children: /* @__PURE__ */ jsxs(Main, { children: [
701
- /* @__PURE__ */ jsx(LayoutContent, { children: /* @__PURE__ */ jsxs(Column, { children: [
702
- /* @__PURE__ */ jsx(Logo, {}),
703
- /* @__PURE__ */ jsx(Box, { paddingTop: 6, paddingBottom: 7, children: /* @__PURE__ */ jsx(Typography, { as: "h1", variant: "alpha", children: formatMessage({ id: "Auth.components.Oops.title", defaultMessage: "Oops..." }) }) }),
704
- /* @__PURE__ */ jsx(Typography, { children: message }),
705
- /* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsx(Typography, { children: formatMessage({
706
- id: "Auth.components.Oops.text.admin",
707
- defaultMessage: "If this is a mistake, please contact your administrator."
708
- }) }) })
709
- ] }) }),
710
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsx(Link, { as: NavLink, to: "/auth/login", children: formatMessage({ id: "Auth.link.signin", defaultMessage: "Sign in" }) }) }) })
711
- ] }) });
712
- };
713
- const FieldWrapper = styled(Field)`
714
- height: ${32 / 16}rem;
715
- width: ${32 / 16}rem;
716
-
717
- > label,
718
- ~ input {
719
- display: block;
720
- position: absolute;
721
- top: 0;
722
- left: 0;
723
- right: 0;
724
- bottom: 0;
725
- }
726
-
727
- > label {
728
- color: inherit;
729
- cursor: pointer;
730
- padding: ${({ theme }) => theme.spaces[2]};
731
- text-align: center;
732
- vertical-align: middle;
733
- }
734
-
735
- &:hover,
736
- &:focus-within {
737
- background-color: ${({ theme }) => theme.colors.neutral0};
738
- }
739
-
740
- &:active,
741
- &.selected {
742
- color: ${({ theme }) => theme.colors.primary700};
743
- background-color: ${({ theme }) => theme.colors.neutral0};
744
- border-color: ${({ theme }) => theme.colors.primary700};
745
- }
746
- `;
747
- const delays = {
748
- postResponse: 90 * 24 * 60 * 60 * 1e3,
749
- // 90 days in ms
750
- postFirstDismissal: 7 * 24 * 60 * 60 * 1e3,
751
- // 7 days in ms
752
- postSubsequentDismissal: 90 * 24 * 60 * 60 * 1e3,
753
- // 90 days in ms
754
- display: 5 * 60 * 1e3
755
- // 5 minutes in ms
756
- };
757
- const ratingArray = [...Array(11).keys()];
758
- const checkIfShouldShowSurvey = (settings) => {
759
- const { enabled, lastResponseDate, firstDismissalDate, lastDismissalDate } = settings;
760
- if (window.strapi.flags.nps === false) {
761
- return false;
762
- }
763
- if (enabled === false) {
764
- return false;
765
- }
766
- if (lastResponseDate) {
767
- const timeSinceLastResponse = Date.now() - new Date(lastResponseDate).getTime();
768
- if (timeSinceLastResponse >= delays.postResponse) {
769
- return true;
770
- }
771
- return false;
772
- }
773
- if (lastDismissalDate) {
774
- const timeSinceLastDismissal = Date.now() - new Date(lastDismissalDate).getTime();
775
- if (timeSinceLastDismissal >= delays.postSubsequentDismissal) {
776
- return true;
777
- }
778
- return false;
779
- }
780
- if (firstDismissalDate) {
781
- const timeSinceFirstDismissal = Date.now() - new Date(firstDismissalDate).getTime();
782
- if (timeSinceFirstDismissal >= delays.postFirstDismissal) {
783
- return true;
784
- }
785
- return false;
786
- }
787
- return true;
788
- };
789
- const NpsSurvey = () => {
790
- const theme = useTheme();
791
- const { formatMessage } = useIntl();
792
- const { npsSurveySettings, setNpsSurveySettings } = useNpsSurveySettings();
793
- const [isFeedbackResponse, setIsFeedbackResponse] = React.useState(false);
794
- const toggleNotification = useNotification();
795
- const { currentEnvironment, strapiVersion } = useAppInfo();
796
- const { mutate, isLoading } = useMutation(
797
- async (form) => {
798
- const res = await fetch("https://analytics.strapi.io/submit-nps", {
799
- method: "POST",
800
- headers: {
801
- "Content-Type": "application/json"
802
- },
803
- body: JSON.stringify(form)
804
- });
805
- if (!res.ok) {
806
- throw new Error("Failed to submit NPS survey");
807
- }
808
- return res;
809
- },
810
- {
811
- onSuccess() {
812
- setNpsSurveySettings((settings) => ({
813
- ...settings,
814
- lastResponseDate: (/* @__PURE__ */ new Date()).toString(),
815
- firstDismissalDate: null,
816
- lastDismissalDate: null
817
- }));
818
- setIsFeedbackResponse(true);
819
- setTimeout(() => {
820
- setSurveyIsShown(false);
821
- }, 3e3);
822
- },
823
- onError() {
824
- toggleNotification({
825
- type: "warning",
826
- message: formatMessage({ id: "notification.error", defaultMessage: "An error occurred" })
827
- });
828
- }
829
- }
830
- );
831
- const [surveyIsShown, setSurveyIsShown] = React.useState(
832
- checkIfShouldShowSurvey(npsSurveySettings)
833
- );
834
- const [displaySurvey, setDisplaySurvey] = React.useState(false);
835
- React.useEffect(() => {
836
- const displayTime = setTimeout(() => {
837
- setDisplaySurvey(true);
838
- }, delays.display);
839
- return () => {
840
- clearTimeout(displayTime);
841
- };
842
- }, []);
843
- if (!displaySurvey) {
844
- return null;
845
- }
846
- if (!surveyIsShown) {
847
- return null;
848
- }
849
- const handleSubmitResponse = ({
850
- npsSurveyRating,
851
- npsSurveyFeedback
852
- }) => {
853
- const userInfo = auth.getUserInfo();
854
- mutate({
855
- email: typeof userInfo === "object" && userInfo !== null ? userInfo.email : "",
856
- rating: npsSurveyRating,
857
- comment: npsSurveyFeedback,
858
- environment: currentEnvironment,
859
- version: strapiVersion ?? void 0,
860
- license: window.strapi.projectType
861
- });
862
- };
863
- const handleDismiss = () => {
864
- setNpsSurveySettings((settings) => {
865
- const nextSettings = {
866
- ...settings,
867
- lastResponseDate: null
868
- };
869
- if (settings.firstDismissalDate) {
870
- nextSettings.lastDismissalDate = (/* @__PURE__ */ new Date()).toString();
871
- } else {
872
- nextSettings.firstDismissalDate = (/* @__PURE__ */ new Date()).toString();
873
- }
874
- return nextSettings;
875
- });
876
- setSurveyIsShown(false);
877
- };
878
- return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
879
- Formik,
880
- {
881
- initialValues: { npsSurveyFeedback: "", npsSurveyRating: null },
882
- onSubmit: handleSubmitResponse,
883
- validationSchema: yup.object({
884
- npsSurveyFeedback: yup.string(),
885
- npsSurveyRating: yup.number().required()
886
- }),
887
- children: ({ values, handleChange, setFieldValue }) => /* @__PURE__ */ jsx(Form$1, { name: "npsSurveyForm", children: /* @__PURE__ */ jsx(
888
- Flex,
889
- {
890
- hasRadius: true,
891
- direction: "column",
892
- padding: 4,
893
- borderColor: "primary200",
894
- background: "neutral0",
895
- shadow: "popupShadow",
896
- position: "fixed",
897
- bottom: 0,
898
- left: "50%",
899
- transform: "translateX(-50%)",
900
- zIndex: theme.zIndices[2],
901
- width: "50%",
902
- children: isFeedbackResponse ? /* @__PURE__ */ jsx(Typography, { fontWeight: "semiBold", children: formatMessage({
903
- id: "app.components.NpsSurvey.feedback-response",
904
- defaultMessage: "Thank you very much for your feedback!"
905
- }) }) : /* @__PURE__ */ jsxs(Box, { as: "fieldset", width: "100%", children: [
906
- /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", width: "100%", children: [
907
- /* @__PURE__ */ jsx(Box, { marginLeft: "auto", marginRight: "auto", children: /* @__PURE__ */ jsx(Typography, { fontWeight: "semiBold", as: "legend", children: formatMessage({
908
- id: "app.components.NpsSurvey.banner-title",
909
- defaultMessage: "How likely are you to recommend Strapi to a friend or colleague?"
910
- }) }) }),
911
- /* @__PURE__ */ jsx(
912
- IconButton,
913
- {
914
- onClick: handleDismiss,
915
- "aria-label": formatMessage({
916
- id: "app.components.NpsSurvey.dismiss-survey-label",
917
- defaultMessage: "Dismiss survey"
918
- }),
919
- icon: /* @__PURE__ */ jsx(Cross, {})
920
- }
921
- )
922
- ] }),
923
- /* @__PURE__ */ jsxs(Flex, { gap: 2, marginTop: 2, marginBottom: 2, justifyContent: "center", children: [
924
- /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: formatMessage({
925
- id: "app.components.NpsSurvey.no-recommendation",
926
- defaultMessage: "Not at all likely"
927
- }) }),
928
- ratingArray.map((number) => {
929
- return /* @__PURE__ */ jsx(
930
- FieldWrapper,
931
- {
932
- className: values.npsSurveyRating === number ? "selected" : void 0,
933
- hasRadius: true,
934
- background: "primary100",
935
- borderColor: "primary200",
936
- color: "primary600",
937
- position: "relative",
938
- cursor: "pointer",
939
- children: /* @__PURE__ */ jsxs(FieldLabel, { htmlFor: `nps-survey-rating-${number}-input`, children: [
940
- /* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx(
941
- FieldInput,
942
- {
943
- type: "radio",
944
- id: `nps-survey-rating-${number}-input`,
945
- name: "npsSurveyRating",
946
- checked: values.npsSurveyRating === number,
947
- onChange: (e) => setFieldValue("npsSurveyRating", parseInt(e.target.value, 10)),
948
- value: number
949
- }
950
- ) }),
951
- number
952
- ] })
953
- },
954
- number
955
- );
956
- }),
957
- /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: formatMessage({
958
- id: "app.components.NpsSurvey.happy-to-recommend",
959
- defaultMessage: "Extremely likely"
960
- }) })
961
- ] }),
962
- values.npsSurveyRating !== null && /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
963
- /* @__PURE__ */ jsx(Box, { marginTop: 2, children: /* @__PURE__ */ jsx(FieldLabel, { htmlFor: "npsSurveyFeedback", fontWeight: "semiBold", fontSize: 2, children: formatMessage({
964
- id: "app.components.NpsSurvey.feedback-question",
965
- defaultMessage: "Do you have any suggestion for improvements?"
966
- }) }) }),
967
- /* @__PURE__ */ jsx(Box, { width: "62%", marginTop: 3, marginBottom: 4, children: /* @__PURE__ */ jsx(
968
- Textarea,
969
- {
970
- id: "npsSurveyFeedback",
971
- width: "100%",
972
- onChange: handleChange,
973
- children: values.npsSurveyFeedback
974
- }
975
- ) }),
976
- /* @__PURE__ */ jsx(Button, { marginBottom: 2, type: "submit", loading: isLoading, children: formatMessage({
977
- id: "app.components.NpsSurvey.submit-feedback",
978
- defaultMessage: "Submit Feedback"
979
- }) })
980
- ] })
981
- ] })
982
- }
983
- ) })
984
- }
985
- ) });
986
- };
987
- function useNpsSurveySettings() {
988
- const [npsSurveySettings, setNpsSurveySettings] = usePersistentState(
989
- "STRAPI_NPS_SURVEY_SETTINGS",
990
- {
991
- enabled: true,
992
- lastResponseDate: null,
993
- firstDismissalDate: null,
994
- lastDismissalDate: null
995
- }
996
- );
997
- return { npsSurveySettings, setNpsSurveySettings };
998
- }
999
- const REGISTER_USER_SCHEMA = yup.object().shape({
1000
- firstname: yup.string().trim().required(translatedErrors.required),
1001
- lastname: yup.string().nullable(),
1002
- password: yup.string().min(8, translatedErrors.minLength).matches(/[a-z]/, "components.Input.error.contain.lowercase").matches(/[A-Z]/, "components.Input.error.contain.uppercase").matches(/\d/, "components.Input.error.contain.number").required(translatedErrors.required),
1003
- confirmPassword: yup.string().oneOf([yup.ref("password"), null], "components.Input.error.password.noMatch").required(translatedErrors.required),
1004
- registrationToken: yup.string().required(translatedErrors.required)
1005
- });
1006
- const REGISTER_ADMIN_SCHEMA = yup.object().shape({
1007
- firstname: yup.string().trim().required(translatedErrors.required),
1008
- lastname: yup.string().nullable(),
1009
- password: yup.string().min(8, translatedErrors.minLength).matches(/[a-z]/, "components.Input.error.contain.lowercase").matches(/[A-Z]/, "components.Input.error.contain.uppercase").matches(/\d/, "components.Input.error.contain.number").required(translatedErrors.required),
1010
- email: yup.string().email(translatedErrors.email).strict().lowercase(translatedErrors.lowercase).required(translatedErrors.required),
1011
- confirmPassword: yup.string().oneOf([yup.ref("password"), null], "components.Input.error.password.noMatch").required(translatedErrors.required)
1012
- });
1013
- const Register = ({ hasAdmin }) => {
1014
- const toggleNotification = useNotification();
1015
- const { push } = useHistory();
1016
- const [passwordShown, setPasswordShown] = React.useState(false);
1017
- const [confirmPasswordShown, setConfirmPasswordShown] = React.useState(false);
1018
- const [submitCount, setSubmitCount] = React.useState(0);
1019
- const [apiError, setApiError] = React.useState();
1020
- const { trackUsage } = useTracking();
1021
- const { formatMessage } = useIntl();
1022
- const { setSkipped } = useGuidedTour();
1023
- const query = useQuery();
1024
- const match = useRouteMatch(
1025
- "/auth/:authType"
1026
- );
1027
- const { formatAPIError } = useAPIErrorHandler();
1028
- const { get: get2, post } = useFetchClient();
1029
- const { setNpsSurveySettings } = useNpsSurveySettings();
1030
- const registrationToken = query.get("registrationToken");
1031
- const { data: userInfo } = useQuery$1({
1032
- queryKey: ["admin", "registration-info", registrationToken],
1033
- async queryFn() {
1034
- const {
1035
- data: { data }
1036
- } = await get2(`/admin/registration-info`, {
1037
- params: {
1038
- registrationToken
1039
- }
1040
- });
1041
- return data;
1042
- },
1043
- enabled: !!registrationToken,
1044
- initialData: {},
1045
- onError(err) {
1046
- const message = formatAPIError(err);
1047
- toggleNotification({
1048
- type: "warning",
1049
- message
1050
- });
1051
- push(`/auth/oops?info=${encodeURIComponent(message)}`);
1052
- }
1053
- });
1054
- const registerAdminMutation = useMutation(
1055
- async (body) => {
1056
- const { news, ...restBody } = body;
1057
- const { data } = await post("/admin/register-admin", restBody);
1058
- return { ...data.data, news };
1059
- },
1060
- {
1061
- onSuccess(data) {
1062
- const { token, user, news } = data;
1063
- auth.setToken(token, false);
1064
- auth.setUserInfo(user, false);
1065
- const { roles } = user;
1066
- if (roles) {
1067
- const isUserSuperAdmin = roles.find(({ code }) => code === "strapi-super-admin");
1068
- if (isUserSuperAdmin) {
1069
- auth.set(false, "GUIDED_TOUR_SKIPPED", true);
1070
- setSkipped(false);
1071
- trackUsage("didLaunchGuidedtour");
1072
- }
1073
- }
1074
- if (news) {
1075
- setNpsSurveySettings((s) => ({ ...s, enabled: true }));
1076
- push({
1077
- pathname: "/usecase",
1078
- search: `?hasAdmin=${true}`
1079
- });
1080
- } else {
1081
- push("/");
1082
- }
1083
- },
1084
- onError(err) {
1085
- trackUsage("didNotCreateFirstAdmin");
1086
- const error = formatAPIError(err);
1087
- setApiError(error);
1088
- }
1089
- }
1090
- );
1091
- const registerUserMutation = useMutation(
1092
- async (body) => {
1093
- const { news, ...restBody } = body;
1094
- const { data } = await post("/admin/register", restBody);
1095
- return { ...data.data, news };
1096
- },
1097
- {
1098
- onSuccess(data) {
1099
- const { token, user, news } = data;
1100
- auth.setToken(token, false);
1101
- auth.setUserInfo(user, false);
1102
- if (news) {
1103
- setNpsSurveySettings((s) => ({ ...s, enabled: true }));
1104
- push({
1105
- pathname: "/usecase",
1106
- search: `?hasAdmin=${hasAdmin}`
1107
- });
1108
- } else {
1109
- push("/");
1110
- }
1111
- },
1112
- onError(err) {
1113
- trackUsage("didNotCreateFirstAdmin");
1114
- const error = formatAPIError(err);
1115
- setApiError(error);
1116
- }
1117
- }
1118
- );
1119
- if (!match || match.params.authType !== "register" && match.params.authType !== "register-admin") {
1120
- return /* @__PURE__ */ jsx(Redirect, { to: "/" });
1121
- }
1122
- const isAdminRegistration = match.params.authType === "register-admin";
1123
- const schema = isAdminRegistration ? REGISTER_ADMIN_SCHEMA : REGISTER_USER_SCHEMA;
1124
- return /* @__PURE__ */ jsx(UnauthenticatedLayout, { children: /* @__PURE__ */ jsxs(LayoutContent, { children: [
1125
- /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", gap: 3, children: [
1126
- /* @__PURE__ */ jsx(Logo, {}),
1127
- /* @__PURE__ */ jsx(Typography, { as: "h1", variant: "alpha", textAlign: "center", children: formatMessage({
1128
- id: "Auth.form.welcome.title",
1129
- defaultMessage: "Welcome to Strapi!"
1130
- }) }),
1131
- /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", textAlign: "center", children: formatMessage({
1132
- id: "Auth.form.register.subtitle",
1133
- defaultMessage: "Credentials are only used to authenticate in Strapi. All saved data will be stored in your database."
1134
- }) }),
1135
- apiError ? /* @__PURE__ */ jsx(Typography, { id: "global-form-error", role: "alert", tabIndex: -1, textColor: "danger600", children: apiError }) : null
1136
- ] }),
1137
- /* @__PURE__ */ jsx(
1138
- Formik,
1139
- {
1140
- enableReinitialize: true,
1141
- initialValues: {
1142
- firstname: userInfo?.firstname || "",
1143
- lastname: userInfo?.lastname || "",
1144
- email: userInfo?.email || "",
1145
- password: "",
1146
- confirmPassword: "",
1147
- registrationToken: registrationToken || void 0,
1148
- news: false
1149
- },
1150
- onSubmit: async (data, formik) => {
1151
- const normalizedData = normalizeData(data);
1152
- try {
1153
- await schema.validate(normalizedData, { abortEarly: false });
1154
- if (submitCount > 0 && isAdminRegistration) {
1155
- trackUsage("didSubmitWithErrorsFirstAdmin", { count: submitCount.toString() });
1156
- }
1157
- if (normalizedData.registrationToken) {
1158
- registerUserMutation.mutate({
1159
- userInfo: omit(normalizedData, [
1160
- "registrationToken",
1161
- "confirmPassword",
1162
- "email",
1163
- "news"
1164
- ]),
1165
- registrationToken: normalizedData.registrationToken,
1166
- news: normalizedData.news
1167
- });
1168
- } else {
1169
- registerAdminMutation.mutate(
1170
- omit(normalizedData, ["registrationToken", "confirmPassword"])
1171
- );
1172
- }
1173
- } catch (err) {
1174
- if (err instanceof ValidationError) {
1175
- const errors = getYupInnerErrors(err);
1176
- formik.setErrors(errors);
1177
- }
1178
- setSubmitCount(submitCount + 1);
1179
- }
1180
- },
1181
- validateOnChange: false,
1182
- children: ({ values, errors, handleChange }) => {
1183
- return /* @__PURE__ */ jsx(Form, { children: /* @__PURE__ */ jsx(Main, { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 6, marginTop: 7, children: [
1184
- /* @__PURE__ */ jsxs(Grid, { gap: 4, children: [
1185
- /* @__PURE__ */ jsx(GridItem, { col: 6, children: /* @__PURE__ */ jsx(
1186
- TextInput,
1187
- {
1188
- name: "firstname",
1189
- required: true,
1190
- value: values.firstname,
1191
- error: errors.firstname ? formatMessage(errors.firstname) : void 0,
1192
- onChange: handleChange,
1193
- label: formatMessage({
1194
- id: "Auth.form.firstname.label",
1195
- defaultMessage: "Firstname"
1196
- })
1197
- }
1198
- ) }),
1199
- /* @__PURE__ */ jsx(GridItem, { col: 6, children: /* @__PURE__ */ jsx(
1200
- TextInput,
1201
- {
1202
- name: "lastname",
1203
- value: values.lastname,
1204
- onChange: handleChange,
1205
- label: formatMessage({
1206
- id: "Auth.form.lastname.label",
1207
- defaultMessage: "Lastname"
1208
- })
1209
- }
1210
- ) })
1211
- ] }),
1212
- /* @__PURE__ */ jsx(
1213
- TextInput,
1214
- {
1215
- name: "email",
1216
- disabled: !isAdminRegistration,
1217
- value: values.email,
1218
- onChange: handleChange,
1219
- error: errors.email ? formatMessage(errors.email) : void 0,
1220
- required: true,
1221
- label: formatMessage({
1222
- id: "Auth.form.email.label",
1223
- defaultMessage: "Email"
1224
- }),
1225
- type: "email"
1226
- }
1227
- ),
1228
- /* @__PURE__ */ jsx(
1229
- PasswordInput$1,
1230
- {
1231
- name: "password",
1232
- onChange: handleChange,
1233
- value: values.password,
1234
- error: errors.password ? formatMessage(errors.password) : void 0,
1235
- endAction: /* @__PURE__ */ jsx(
1236
- FieldActionWrapper,
1237
- {
1238
- onClick: (e) => {
1239
- e.preventDefault();
1240
- setPasswordShown((prev) => !prev);
1241
- },
1242
- label: formatMessage(
1243
- passwordShown ? {
1244
- id: "Auth.form.password.show-password",
1245
- defaultMessage: "Show password"
1246
- } : {
1247
- id: "Auth.form.password.hide-password",
1248
- defaultMessage: "Hide password"
1249
- }
1250
- ),
1251
- children: passwordShown ? /* @__PURE__ */ jsx(Eye, {}) : /* @__PURE__ */ jsx(EyeStriked, {})
1252
- }
1253
- ),
1254
- hint: formatMessage({
1255
- id: "Auth.form.password.hint",
1256
- defaultMessage: "Must be at least 8 characters, 1 uppercase, 1 lowercase & 1 number"
1257
- }),
1258
- required: true,
1259
- label: formatMessage({
1260
- id: "global.password",
1261
- defaultMessage: "Password"
1262
- }),
1263
- type: passwordShown ? "text" : "password"
1264
- }
1265
- ),
1266
- /* @__PURE__ */ jsx(
1267
- PasswordInput$1,
1268
- {
1269
- name: "confirmPassword",
1270
- onChange: handleChange,
1271
- value: values.confirmPassword,
1272
- error: errors.confirmPassword ? formatMessage(errors.confirmPassword) : void 0,
1273
- endAction: /* @__PURE__ */ jsx(
1274
- FieldActionWrapper,
1275
- {
1276
- onClick: (e) => {
1277
- e.preventDefault();
1278
- setConfirmPasswordShown((prev) => !prev);
1279
- },
1280
- label: formatMessage(
1281
- confirmPasswordShown ? {
1282
- id: "Auth.form.password.show-password",
1283
- defaultMessage: "Show password"
1284
- } : {
1285
- id: "Auth.form.password.hide-password",
1286
- defaultMessage: "Hide password"
1287
- }
1288
- ),
1289
- children: confirmPasswordShown ? /* @__PURE__ */ jsx(Eye, {}) : /* @__PURE__ */ jsx(EyeStriked, {})
1290
- }
1291
- ),
1292
- required: true,
1293
- label: formatMessage({
1294
- id: "Auth.form.confirmPassword.label",
1295
- defaultMessage: "Confirm Password"
1296
- }),
1297
- type: confirmPasswordShown ? "text" : "password"
1298
- }
1299
- ),
1300
- /* @__PURE__ */ jsx(
1301
- Checkbox,
1302
- {
1303
- onValueChange: (checked) => {
1304
- handleChange({ target: { value: checked, name: "news" } });
1305
- },
1306
- value: values.news,
1307
- name: "news",
1308
- "aria-label": "news",
1309
- children: formatMessage(
1310
- {
1311
- id: "Auth.form.register.news.label",
1312
- defaultMessage: "Keep me updated about new features & upcoming improvements (by doing this you accept the {terms} and the {policy})."
1313
- },
1314
- {
1315
- terms: /* @__PURE__ */ jsx(A, { target: "_blank", href: "https://strapi.io/terms", rel: "noreferrer", children: formatMessage({
1316
- id: "Auth.privacy-policy-agreement.terms",
1317
- defaultMessage: "terms"
1318
- }) }),
1319
- policy: /* @__PURE__ */ jsx(A, { target: "_blank", href: "https://strapi.io/privacy", rel: "noreferrer", children: formatMessage({
1320
- id: "Auth.privacy-policy-agreement.policy",
1321
- defaultMessage: "policy"
1322
- }) })
1323
- }
1324
- )
1325
- }
1326
- ),
1327
- /* @__PURE__ */ jsx(Button, { fullWidth: true, size: "L", type: "submit", children: formatMessage({
1328
- id: "Auth.form.button.register",
1329
- defaultMessage: "Let's start"
1330
- }) })
1331
- ] }) }) });
1332
- }
1333
- }
1334
- ),
1335
- match?.params.authType === "register" && /* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Link, { as: NavLink, to: "/auth/login", children: formatMessage({
1336
- id: "Auth.link.signin.account",
1337
- defaultMessage: "Already have an account?"
1338
- }) }) }) })
1339
- ] }) });
1340
- };
1341
- function normalizeData(data) {
1342
- return Object.entries(data).reduce(
1343
- (acc, [key, value]) => {
1344
- if (!["password", "confirmPassword"].includes(key) && typeof value === "string") {
1345
- acc[key] = value.trim();
1346
- if (key === "lastname") {
1347
- acc[key] = value || void 0;
1348
- }
1349
- } else {
1350
- acc[key] = value;
1351
- }
1352
- return acc;
1353
- },
1354
- {}
1355
- );
1356
- }
1357
- const A = styled.a`
1358
- color: ${({ theme }) => theme.colors.primary600};
1359
- `;
1360
- const PasswordInput$1 = styled(TextInput)`
1361
- ::-ms-reveal {
1362
- display: none;
1363
- }
1364
- `;
1365
- const RESET_PASSWORD_SCHEMA = yup.object().shape({
1366
- password: yup.string().min(8, translatedErrors.minLength).matches(/[a-z]/, "components.Input.error.contain.lowercase").matches(/[A-Z]/, "components.Input.error.contain.uppercase").matches(/\d/, "components.Input.error.contain.number").required(translatedErrors.required),
1367
- confirmPassword: yup.string().oneOf([yup.ref("password"), null], "components.Input.error.password.noMatch").required(translatedErrors.required)
1368
- });
1369
- const ResetPassword = () => {
1370
- const [passwordShown, setPasswordShown] = React.useState(false);
1371
- const [confirmPasswordShown, setConfirmPasswordShown] = React.useState(false);
1372
- const { formatMessage } = useIntl();
1373
- const { post } = useFetchClient();
1374
- const { push } = useHistory();
1375
- const query = useQuery();
1376
- const { mutate, isError } = useMutation(
1377
- async (body) => {
1378
- const {
1379
- data: { data }
1380
- } = await post("/admin/reset-password", {
1381
- ...body,
1382
- resetPasswordToken: query.get("code")
1383
- });
1384
- return data;
1385
- },
1386
- {
1387
- onSuccess(data) {
1388
- if (data) {
1389
- const { token, user } = data;
1390
- auth.setToken(token, false);
1391
- auth.setUserInfo(user, false);
1392
- push("/");
1393
- }
1394
- }
1395
- }
1396
- );
1397
- return /* @__PURE__ */ jsx(UnauthenticatedLayout, { children: /* @__PURE__ */ jsxs(Main, { children: [
1398
- /* @__PURE__ */ jsxs(LayoutContent, { children: [
1399
- /* @__PURE__ */ jsxs(Column, { children: [
1400
- /* @__PURE__ */ jsx(Logo, {}),
1401
- /* @__PURE__ */ jsx(Box, { paddingTop: 6, paddingBottom: 7, children: /* @__PURE__ */ jsx(Typography, { as: "h1", variant: "alpha", children: formatMessage({
1402
- id: "global.reset-password",
1403
- defaultMessage: "Reset password"
1404
- }) }) }),
1405
- isError ? /* @__PURE__ */ jsx(Typography, { id: "global-form-error", role: "alert", tabIndex: -1, textColor: "danger600", children: formatMessage({
1406
- id: "notification.error",
1407
- defaultMessage: "An error occurred"
1408
- }) }) : null
1409
- ] }),
1410
- /* @__PURE__ */ jsx(
1411
- Formik,
1412
- {
1413
- enableReinitialize: true,
1414
- initialValues: {
1415
- password: "",
1416
- confirmPassword: ""
1417
- },
1418
- onSubmit: (values) => {
1419
- mutate({ password: values.password });
1420
- },
1421
- validationSchema: RESET_PASSWORD_SCHEMA,
1422
- validateOnChange: false,
1423
- children: ({ values, errors, handleChange }) => /* @__PURE__ */ jsx(Form, { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
1424
- /* @__PURE__ */ jsx(
1425
- PasswordInput,
1426
- {
1427
- name: "password",
1428
- onChange: handleChange,
1429
- value: values.password,
1430
- error: errors.password ? formatMessage(
1431
- {
1432
- id: errors.password,
1433
- defaultMessage: "This field is required."
1434
- },
1435
- {
1436
- min: 8
1437
- }
1438
- ) : void 0,
1439
- endAction: /* @__PURE__ */ jsx(
1440
- FieldActionWrapper,
1441
- {
1442
- onClick: (e) => {
1443
- e.preventDefault();
1444
- setPasswordShown((prev) => !prev);
1445
- },
1446
- label: formatMessage(
1447
- passwordShown ? {
1448
- id: "Auth.form.password.show-password",
1449
- defaultMessage: "Show password"
1450
- } : {
1451
- id: "Auth.form.password.hide-password",
1452
- defaultMessage: "Hide password"
1453
- }
1454
- ),
1455
- children: passwordShown ? /* @__PURE__ */ jsx(Eye, {}) : /* @__PURE__ */ jsx(EyeStriked, {})
1456
- }
1457
- ),
1458
- hint: formatMessage({
1459
- id: "Auth.form.password.hint",
1460
- defaultMessage: "Password must contain at least 8 characters, 1 uppercase, 1 lowercase and 1 number"
1461
- }),
1462
- required: true,
1463
- label: formatMessage({
1464
- id: "global.password",
1465
- defaultMessage: "Password"
1466
- }),
1467
- type: passwordShown ? "text" : "password"
1468
- }
1469
- ),
1470
- /* @__PURE__ */ jsx(
1471
- PasswordInput,
1472
- {
1473
- name: "confirmPassword",
1474
- onChange: handleChange,
1475
- value: values.confirmPassword,
1476
- error: errors.confirmPassword ? formatMessage({
1477
- id: errors.confirmPassword,
1478
- defaultMessage: "This value is required."
1479
- }) : void 0,
1480
- endAction: /* @__PURE__ */ jsx(
1481
- FieldActionWrapper,
1482
- {
1483
- onClick: (e) => {
1484
- e.preventDefault();
1485
- setConfirmPasswordShown((prev) => !prev);
1486
- },
1487
- label: formatMessage(
1488
- passwordShown ? {
1489
- id: "Auth.form.password.show-password",
1490
- defaultMessage: "Show password"
1491
- } : {
1492
- id: "Auth.form.password.hide-password",
1493
- defaultMessage: "Hide password"
1494
- }
1495
- ),
1496
- children: confirmPasswordShown ? /* @__PURE__ */ jsx(Eye, {}) : /* @__PURE__ */ jsx(EyeStriked, {})
1497
- }
1498
- ),
1499
- required: true,
1500
- label: formatMessage({
1501
- id: "Auth.form.confirmPassword.label",
1502
- defaultMessage: "Confirm Password"
1503
- }),
1504
- type: confirmPasswordShown ? "text" : "password"
1505
- }
1506
- ),
1507
- /* @__PURE__ */ jsx(Button, { fullWidth: true, type: "submit", children: formatMessage({
1508
- id: "global.change-password",
1509
- defaultMessage: "Change password"
1510
- }) })
1511
- ] }) })
1512
- }
1513
- )
1514
- ] }),
1515
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsx(Link, { as: NavLink, to: "/auth/login", children: formatMessage({ id: "Auth.link.ready", defaultMessage: "Ready to sign in?" }) }) }) })
1516
- ] }) });
1517
- };
1518
- const PasswordInput = styled(TextInput)`
1519
- ::-ms-reveal {
1520
- display: none;
1521
- }
1522
- `;
1523
- const FORMS = {
1524
- "forgot-password": ForgotPassword,
1525
- "forgot-password-success": ForgotPasswordSuccess,
1526
- // the `Component` attribute is set after all forms and CE/EE components are loaded, but since we
1527
- // are here outside of a React component we can not use the hook directly
1528
- login: () => null,
1529
- oops: Oops,
1530
- register: Register,
1531
- "register-admin": Register,
1532
- "reset-password": ResetPassword,
1533
- providers: () => null
1534
- };
1535
- const AuthPage = ({ hasAdmin }) => {
1536
- const {
1537
- location: { search }
1538
- } = useHistory();
1539
- const match = useRouteMatch("/auth/:authType");
1540
- const authType = match?.params.authType;
1541
- const Login$1 = useEnterprise(
1542
- Login,
1543
- async () => (await import("./Login-d627bb0a.mjs")).LoginEE
1544
- );
1545
- const forms = useEnterprise(
1546
- FORMS,
1547
- async () => (await import("./constants-a6fd64fc.mjs")).FORMS,
1548
- {
1549
- combine(ceForms, eeForms) {
1550
- return {
1551
- ...ceForms,
1552
- ...eeForms
1553
- };
1554
- },
1555
- defaultValue: FORMS
1556
- }
1557
- );
1558
- if (!authType || !forms) {
1559
- return /* @__PURE__ */ jsx(Redirect, { to: "/" });
1560
- }
1561
- const Component = forms[authType];
1562
- if (!Component || hasAdmin && authType === "register-admin" || auth.getToken()) {
1563
- return /* @__PURE__ */ jsx(Redirect, { to: "/" });
1564
- }
1565
- if (!hasAdmin && authType !== "register-admin") {
1566
- return /* @__PURE__ */ jsx(
1567
- Redirect,
1568
- {
1569
- to: {
1570
- pathname: "/auth/register-admin",
1571
- // Forward the `?redirectTo` from /auth/login
1572
- // /abc => /auth/login?redirectTo=%2Fabc => /auth/register-admin?redirectTo=%2Fabc
1573
- search
1574
- }
1575
- }
1576
- );
1577
- }
1578
- if (Login$1 && authType === "login") {
1579
- return /* @__PURE__ */ jsx(Login$1, {});
1580
- } else if (authType === "login" && !Login$1) {
1581
- return null;
1582
- }
1583
- return /* @__PURE__ */ jsx(Component, { hasAdmin });
1584
- };
1585
- const NotFoundPage = () => {
1586
- const { formatMessage } = useIntl();
1587
- useFocusWhenNavigate();
1588
- return /* @__PURE__ */ jsxs(Main, { labelledBy: "title", children: [
1589
- /* @__PURE__ */ jsx(
1590
- HeaderLayout,
1591
- {
1592
- id: "title",
1593
- title: formatMessage({
1594
- id: "content-manager.pageNotFound",
1595
- defaultMessage: "Page not found"
1596
- })
1597
- }
1598
- ),
1599
- /* @__PURE__ */ jsx(ContentLayout, { children: /* @__PURE__ */ jsx(
1600
- EmptyStateLayout,
1601
- {
1602
- action: /* @__PURE__ */ jsx(LinkButton, { variant: "secondary", endIcon: /* @__PURE__ */ jsx(ArrowRight, {}), to: "/", children: formatMessage({
1603
- id: "app.components.NotFoundPage.back",
1604
- defaultMessage: "Back to homepage"
1605
- }) }),
1606
- content: formatMessage({
1607
- id: "app.page.not.found",
1608
- defaultMessage: "Oops! We can't seem to find the page you're looging for..."
1609
- }),
1610
- hasRadius: true,
1611
- icon: /* @__PURE__ */ jsx(EmptyPictures, { width: "10rem" }),
1612
- shadow: "tableShadow"
1613
- }
1614
- ) })
1615
- ] });
1616
- };
1617
- const NotFoundPage$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1618
- __proto__: null,
1619
- NotFoundPage
1620
- }, Symbol.toStringTag, { value: "Module" }));
1621
- const options = [
1622
- {
1623
- intlLabel: {
1624
- id: "Usecase.front-end",
1625
- defaultMessage: "Front-end developer"
1626
- },
1627
- value: "front_end_developer"
1628
- },
1629
- {
1630
- intlLabel: {
1631
- id: "Usecase.back-end",
1632
- defaultMessage: "Back-end developer"
1633
- },
1634
- value: "back_end_developer"
1635
- },
1636
- {
1637
- intlLabel: {
1638
- id: "Usecase.full-stack",
1639
- defaultMessage: "Full-stack developer"
1640
- },
1641
- value: "full_stack_developer"
1642
- },
1643
- {
1644
- intlLabel: {
1645
- id: "global.content-manager",
1646
- defaultMessage: "Content Manager"
1647
- },
1648
- value: "content_manager"
1649
- },
1650
- {
1651
- intlLabel: {
1652
- id: "Usecase.content-creator",
1653
- defaultMessage: "Content Creator"
1654
- },
1655
- value: "content_creator"
1656
- },
1657
- {
1658
- intlLabel: {
1659
- id: "Usecase.other",
1660
- defaultMessage: "Other"
1661
- },
1662
- value: "other"
1663
- }
1664
- ];
1665
- const TypographyCenter = styled(Typography)`
1666
- text-align: center;
1667
- `;
1668
- const UseCasePage = () => {
1669
- const toggleNotification = useNotification();
1670
- const { push, location } = useHistory();
1671
- const { formatMessage } = useIntl();
1672
- const [role, setRole] = React.useState(null);
1673
- const [otherRole, setOtherRole] = React.useState("");
1674
- const { post } = useFetchClient();
1675
- const { firstname, email } = auth.get("userInfo") ?? {};
1676
- const { hasAdmin } = parse(location?.search, { ignoreQueryPrefix: true });
1677
- const isOther = role === "other";
1678
- const handleSubmit = async (event, skipPersona) => {
1679
- event.preventDefault();
1680
- try {
1681
- await post("https://analytics.strapi.io/register", {
1682
- email,
1683
- username: firstname,
1684
- firstAdmin: Boolean(!hasAdmin),
1685
- persona: {
1686
- role: skipPersona ? void 0 : role,
1687
- otherRole: skipPersona ? void 0 : otherRole
1688
- }
1689
- });
1690
- toggleNotification({
1691
- type: "success",
1692
- message: {
1693
- id: "Usecase.notification.success.project-created",
1694
- defaultMessage: "Project has been successfully created"
1695
- }
1696
- });
1697
- push("/");
1698
- } catch (err) {
1699
- }
1700
- };
1701
- return /* @__PURE__ */ jsx(UnauthenticatedLayout, { children: /* @__PURE__ */ jsxs(Main, { labelledBy: "usecase-title", children: [
1702
- /* @__PURE__ */ jsx(LayoutContent, { children: /* @__PURE__ */ jsxs("form", { onSubmit: (e) => handleSubmit(e, false), children: [
1703
- /* @__PURE__ */ jsxs(Flex, { direction: "column", paddingBottom: 7, children: [
1704
- /* @__PURE__ */ jsx(Logo, {}),
1705
- /* @__PURE__ */ jsx(Box, { paddingTop: 6, paddingBottom: 1, width: pxToRem(250), children: /* @__PURE__ */ jsx(TypographyCenter, { variant: "alpha", as: "h1", id: "usecase-title", children: formatMessage({
1706
- id: "Usecase.title",
1707
- defaultMessage: "Tell us a bit more about yourself"
1708
- }) }) })
1709
- ] }),
1710
- /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
1711
- /* @__PURE__ */ jsx(
1712
- Select,
1713
- {
1714
- id: "usecase",
1715
- "data-testid": "usecase",
1716
- label: formatMessage({
1717
- id: "Usecase.input.work-type",
1718
- defaultMessage: "What type of work do you do?"
1719
- }),
1720
- onChange: (value) => setRole(value),
1721
- value: role,
1722
- children: options.map(({ intlLabel, value }) => /* @__PURE__ */ jsx(Option, { value, children: formatMessage(intlLabel) }, value))
1723
- }
1724
- ),
1725
- isOther && /* @__PURE__ */ jsx(
1726
- TextInput,
1727
- {
1728
- name: "other",
1729
- label: formatMessage({ id: "Usecase.other", defaultMessage: "Other" }),
1730
- value: otherRole,
1731
- onChange: (e) => setOtherRole(e.target.value),
1732
- "data-testid": "other"
1733
- }
1734
- ),
1735
- /* @__PURE__ */ jsx(Button, { type: "submit", size: "L", fullWidth: true, disabled: !role, children: formatMessage({ id: "global.finish", defaultMessage: "Finish" }) })
1736
- ] })
1737
- ] }) }),
1738
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsx(TextButton, { onClick: (event) => handleSubmit(event, true), children: formatMessage({
1739
- id: "Usecase.button.skip",
1740
- defaultMessage: "Skip this question"
1741
- }) }) }) })
1742
- ] }) });
1743
- };
1744
- const LazyCompo = ({ loadComponent }) => {
1745
- const [Compo, setCompo] = React.useState(null);
1746
- React.useEffect(() => {
1747
- const loadCompo = async () => {
1748
- try {
1749
- const loadedCompo = await loadComponent();
1750
- if (typeof loadedCompo === "function") {
1751
- setCompo(() => loadedCompo);
1752
- } else if (loadedCompo.default) {
1753
- setCompo(() => loadedCompo.default);
1754
- }
1755
- } catch (err) {
1756
- }
1757
- };
1758
- loadCompo();
1759
- }, [loadComponent]);
1760
- if (Compo) {
1761
- return /* @__PURE__ */ jsx(Compo, {});
1762
- }
1763
- return /* @__PURE__ */ jsx(LoadingIndicatorPage, {});
1764
- };
1765
- const createRoute = (loadComponent, to, exact = false) => {
1766
- return /* @__PURE__ */ jsx(
1767
- Route,
1768
- {
1769
- render: () => /* @__PURE__ */ jsx(LazyCompo, { loadComponent }),
1770
- path: to,
1771
- exact: exact || false
1772
- },
1773
- to
1774
- );
1775
- };
1776
- const ROUTES_CE = null;
1777
- const AuthenticatedApp = React.lazy(
1778
- () => import("./AuthenticatedApp-bb31f306.mjs").then((n) => n.A).then((mod) => ({ default: mod.AuthenticatedApp }))
1779
- );
1780
- const App = () => {
1781
- const adminPermissions = useEnterprise(
1782
- ADMIN_PERMISSIONS_CE,
1783
- async () => (await import("./constants-6ecddc43.mjs")).ADMIN_PERMISSIONS_EE,
1784
- {
1785
- combine(cePermissions, eePermissions) {
1786
- return merge({}, cePermissions, eePermissions);
1787
- },
1788
- defaultValue: ADMIN_PERMISSIONS_CE
1789
- }
1790
- );
1791
- const routes = useEnterprise(
1792
- ROUTES_CE,
1793
- async () => (await import("./constants-6ecddc43.mjs")).ROUTES_EE,
1794
- {
1795
- defaultValue: []
1796
- }
1797
- );
1798
- const toggleNotification = useNotification();
1799
- const { updateProjectSettings } = useConfiguration();
1800
- const { formatMessage } = useIntl();
1801
- const [{ isLoading, hasAdmin, uuid, deviceId }, setState] = React.useState({
1802
- isLoading: true,
1803
- deviceId: void 0,
1804
- hasAdmin: false,
1805
- uuid: false
1806
- });
1807
- const dispatch = useDispatch();
1808
- const appInfo = useAppInfo();
1809
- const { get: get2, post } = useFetchClient();
1810
- const authRoutes = React.useMemo(() => {
1811
- if (!routes) {
1812
- return null;
1813
- }
1814
- return routes.map(({ to, Component, exact }) => createRoute(Component, to, exact));
1815
- }, [routes]);
1816
- const [telemetryProperties, setTelemetryProperties] = React.useState(void 0);
1817
- React.useEffect(() => {
1818
- dispatch({ type: ACTION_SET_ADMIN_PERMISSIONS, payload: adminPermissions });
1819
- }, [adminPermissions, dispatch]);
1820
- React.useEffect(() => {
1821
- const currentToken = auth.getToken();
1822
- const renewToken = async () => {
1823
- try {
1824
- const {
1825
- data: {
1826
- data: { token }
1827
- }
1828
- } = await post("/admin/renew-token", { token: currentToken });
1829
- auth.updateToken(token);
1830
- } catch (err) {
1831
- auth.clearAppStorage();
1832
- window.location.reload();
1833
- }
1834
- };
1835
- if (currentToken) {
1836
- renewToken();
1837
- }
1838
- }, [post]);
1839
- React.useEffect(() => {
1840
- const getData = async () => {
1841
- try {
1842
- const {
1843
- data: {
1844
- data: { hasAdmin: hasAdmin2, uuid: uuid2, menuLogo, authLogo }
1845
- }
1846
- } = await get2(`/admin/init`);
1847
- updateProjectSettings({
1848
- menuLogo: prefixFileUrlWithBackendUrl(menuLogo),
1849
- authLogo: prefixFileUrlWithBackendUrl(authLogo)
1850
- });
1851
- if (uuid2) {
1852
- const {
1853
- data: { data: properties }
1854
- } = await get2(`/admin/telemetry-properties`, {
1855
- // NOTE: needed because the interceptors of the fetchClient redirect to /login when receive a 401 and it would end up in an infinite loop when the user doesn't have a session.
1856
- validateStatus: (status) => status < 500
1857
- });
1858
- setTelemetryProperties(properties);
1859
- try {
1860
- const event = "didInitializeAdministration";
1861
- await post(
1862
- "https://analytics.strapi.io/api/v2/track",
1863
- {
1864
- // This event is anonymous
1865
- event,
1866
- userId: "",
1867
- deviceId,
1868
- eventPropeties: {},
1869
- userProperties: { environment: appInfo.currentEnvironment },
1870
- groupProperties: { ...properties, projectId: uuid2 }
1871
- },
1872
- {
1873
- headers: {
1874
- "X-Strapi-Event": event
1875
- }
1876
- }
1877
- );
1878
- } catch (e) {
1879
- }
1880
- }
1881
- setState({ isLoading: false, hasAdmin: hasAdmin2, uuid: uuid2, deviceId });
1882
- } catch (err) {
1883
- toggleNotification({
1884
- type: "warning",
1885
- message: { id: "app.containers.App.notification.error.init" }
1886
- });
1887
- }
1888
- };
1889
- getData();
1890
- }, [toggleNotification, updateProjectSettings]);
1891
- const trackingInfo = React.useMemo(
1892
- () => ({
1893
- uuid,
1894
- telemetryProperties,
1895
- deviceId
1896
- }),
1897
- [uuid, telemetryProperties, deviceId]
1898
- );
1899
- if (isLoading) {
1900
- return /* @__PURE__ */ jsx(LoadingIndicatorPage, {});
1901
- }
1902
- return /* @__PURE__ */ jsxs(React.Suspense, { fallback: /* @__PURE__ */ jsx(LoadingIndicatorPage, {}), children: [
1903
- /* @__PURE__ */ jsx(SkipToContent, { children: formatMessage({ id: "skipToContent", defaultMessage: "Skip to content" }) }),
1904
- /* @__PURE__ */ jsx(TrackingProvider, { value: trackingInfo, children: /* @__PURE__ */ jsxs(Switch, { children: [
1905
- authRoutes,
1906
- /* @__PURE__ */ jsx(
1907
- Route,
1908
- {
1909
- path: "/auth/:authType",
1910
- render: (routerProps) => /* @__PURE__ */ jsx(AuthPage, { ...routerProps, hasAdmin }),
1911
- exact: true
1912
- }
1913
- ),
1914
- /* @__PURE__ */ jsx(PrivateRoute, { path: "/usecase", component: UseCasePage }),
1915
- /* @__PURE__ */ jsx(PrivateRoute, { path: "/", component: AuthenticatedApp }),
1916
- /* @__PURE__ */ jsx(Route, { path: "", component: NotFoundPage })
1917
- ] }) })
1918
- ] });
1919
- };
1920
- const StrapiLogo = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAwIiBoZWlnaHQ9IjgwMCIgdmlld0JveD0iMCAwIDgwMCA4MDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8cGF0aCBkPSJNMzkgMjgyYzAtMTE4IDAtMTc2LjkgMzYuNi0yMTMuNUMxMTIuMiAzMiAxNzEuMSAzMiAyODguOSAzMmgyMjEuMmMxMTcuOCAwIDE3Ni43IDAgMjEzLjMgMzYuNkM3NjAgMTA1LjIgNzYwIDE2NC4xIDc2MCAyODEuOXYyMjEuMmMwIDExNy44IDAgMTc2LjctMzYuNiAyMTMuM0M2ODYuOCA3NTMgNjI3LjkgNzUzIDUxMC4xIDc1M0gyODguOWMtMTE3LjggMC0xNzYuNyAwLTIxMy4zLTM2LjZDMzkgNjc5LjggMzkgNjIwLjkgMzkgNTAzLjFWMjgxLjlaIiBmaWxsPSIjNDk0NUZGIi8+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTUzNi40IDI1MC43SDI5My43djEyMy44aDEyMy44djEyMy43aDEyMy44VjI1NS41YzAtMi42LTIuMi00LjgtNC45LTQuOFoiIGZpbGw9IiNmZmYiLz4KICAgIDxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik00MTIuNyAzNzQuNWg0Ljh2NC44aC00Ljh6Ii8+CiAgICA8cGF0aCBkPSJNMjkzLjggMzc0LjVoMTE5YzIuNiAwIDQuOCAyLjEgNC44IDQuOHYxMTloLTExOWE0LjggNC44IDAgMCAxLTQuOC00Ljl2LTExOVoiIGZpbGw9IiM5NTkzRkYiLz4KICAgIDxwYXRoIGQ9Ik00MTcuNSA0OTguMmgxMjMuOEw0MjEuNiA2MThhMi40IDIuNCAwIDAgMS00LTEuN3YtMTE4Wk0yOTMuOCAzNzQuNWgtMTE4YTIuNCAyLjQgMCAwIDEtMS43LTQuMWwxMTkuNy0xMTkuN3YxMjMuOFoiIGZpbGw9IiM5NTkzRkYiLz4KPC9zdmc+Cg==";
1921
- const [AdminContextProvider, useAdminContext] = createContext("AdminContext");
1922
- const useAdmin = () => useAdminContext("useAdmin");
1923
- const ConfigurationProvider = ({
1924
- children,
1925
- authLogo: defaultAuthLogo,
1926
- menuLogo: defaultMenuLogo,
1927
- showReleaseNotification = false,
1928
- showTutorials = false
1929
- }) => {
1930
- const [{ menuLogo, authLogo }, setLogos] = React.useState({
1931
- menuLogo: null,
1932
- authLogo: null
1933
- });
1934
- const updateProjectSettings = React.useCallback(
1935
- ({ menuLogo: menuLogo2, authLogo: authLogo2 }) => {
1936
- setLogos({
1937
- menuLogo: menuLogo2 || defaultMenuLogo,
1938
- authLogo: authLogo2 || defaultAuthLogo
1939
- });
1940
- },
1941
- [defaultAuthLogo, defaultMenuLogo]
1942
- );
1943
- return /* @__PURE__ */ jsx(
1944
- ConfigurationContextProvider,
1945
- {
1946
- updateProjectSettings,
1947
- showReleaseNotification,
1948
- showTutorials,
1949
- logos: {
1950
- menu: { custom: menuLogo, default: defaultMenuLogo },
1951
- auth: { custom: authLogo, default: defaultAuthLogo }
1952
- },
1953
- children
1954
- }
1955
- );
1956
- };
1957
- const GuidedTourProvider = ({ children }) => {
1958
- const [{ currentStep, guidedTourState, isGuidedTourVisible, isSkipped }, dispatch] = React.useReducer(reducer$1, initialState$6, initialiseState);
1959
- const setCurrentStep = (step) => {
1960
- if (step !== null) {
1961
- const isStepAlreadyDone = get(guidedTourState, step);
1962
- const [sectionName, stepName] = step.split(".");
1963
- const sectionArray = Object.entries(guidedTourState[sectionName]);
1964
- const currentStepIndex = sectionArray.findIndex(([key]) => key === stepName);
1965
- const previousSteps = sectionArray.slice(0, currentStepIndex);
1966
- const isStepToShow = previousSteps.every(([, sectionValue]) => sectionValue);
1967
- if (isStepAlreadyDone || isSkipped || !isStepToShow) {
1968
- return null;
1969
- }
1970
- }
1971
- auth.set(null, "GUIDED_TOUR_CURRENT_STEP", true);
1972
- return dispatch({
1973
- type: "SET_CURRENT_STEP",
1974
- step
1975
- });
1976
- };
1977
- const setGuidedTourVisibility = (value) => {
1978
- dispatch({
1979
- type: "SET_GUIDED_TOUR_VISIBILITY",
1980
- value
1981
- });
1982
- };
1983
- const setStepState = (currentStep2, value) => {
1984
- addCompletedStep(currentStep2);
1985
- dispatch({
1986
- type: "SET_STEP_STATE",
1987
- currentStep: currentStep2,
1988
- value
1989
- });
1990
- };
1991
- const startSection = (sectionName) => {
1992
- const sectionSteps = guidedTourState[sectionName];
1993
- if (sectionSteps) {
1994
- const guidedTourArray = Object.entries(guidedTourState);
1995
- const currentSectionIndex = guidedTourArray.findIndex(([key]) => key === sectionName);
1996
- const previousSections = guidedTourArray.slice(0, currentSectionIndex);
1997
- const isSectionToShow = previousSections.every(
1998
- ([, sectionValue]) => Object.values(sectionValue).every(Boolean)
1999
- );
2000
- const [firstStep] = Object.keys(sectionSteps);
2001
- const isFirstStepDone = sectionSteps[firstStep];
2002
- if (isSectionToShow && !currentStep && !isFirstStepDone) {
2003
- setCurrentStep(`${sectionName}.${firstStep}`);
2004
- }
2005
- }
2006
- };
2007
- const setSkipped = (value) => {
2008
- auth.set(value, "GUIDED_TOUR_SKIPPED", true);
2009
- dispatch({
2010
- type: "SET_SKIPPED",
2011
- value
2012
- });
2013
- };
2014
- return /* @__PURE__ */ jsx(
2015
- GuidedTourProvider$1,
2016
- {
2017
- guidedTourState,
2018
- currentStep,
2019
- setCurrentStep,
2020
- setGuidedTourVisibility,
2021
- setSkipped,
2022
- setStepState,
2023
- startSection,
2024
- isGuidedTourVisible,
2025
- isSkipped,
2026
- children
2027
- }
2028
- );
2029
- };
2030
- const initialState$6 = {
2031
- currentStep: null,
2032
- guidedTourState: {
2033
- contentTypeBuilder: {
2034
- create: false,
2035
- success: false
2036
- },
2037
- contentManager: {
2038
- create: false,
2039
- success: false
2040
- },
2041
- apiTokens: {
2042
- create: false,
2043
- success: false
2044
- }
2045
- },
2046
- isGuidedTourVisible: false,
2047
- isSkipped: false
2048
- };
2049
- const reducer$1 = (state = initialState$6, action) => produce(state, (draftState) => {
2050
- switch (action.type) {
2051
- case "SET_CURRENT_STEP": {
2052
- draftState.currentStep = action.step;
2053
- break;
2054
- }
2055
- case "SET_STEP_STATE": {
2056
- const [section, step] = action.currentStep.split(".");
2057
- draftState.guidedTourState[section][step] = action.value;
2058
- break;
2059
- }
2060
- case "SET_SKIPPED": {
2061
- draftState.isSkipped = action.value;
2062
- break;
2063
- }
2064
- case "SET_GUIDED_TOUR_VISIBILITY": {
2065
- draftState.isGuidedTourVisible = action.value;
2066
- break;
2067
- }
2068
- default: {
2069
- return draftState;
2070
- }
2071
- }
2072
- });
2073
- const initialiseState = (initialState2) => {
2074
- const copyInitialState = { ...initialState2 };
2075
- const guidedTourLocaleStorage = auth.get("GUIDED_TOUR_COMPLETED_STEPS");
2076
- const currentStepLocaleStorage = auth.get("GUIDED_TOUR_CURRENT_STEP");
2077
- const skippedLocaleStorage = auth.get("GUIDED_TOUR_SKIPPED");
2078
- if (Array.isArray(guidedTourLocaleStorage)) {
2079
- guidedTourLocaleStorage.forEach((step) => {
2080
- const [sectionName, stepName] = step.split(".");
2081
- set(copyInitialState, ["guidedTourState", sectionName, stepName], true);
2082
- });
2083
- }
2084
- if (currentStepLocaleStorage) {
2085
- const [sectionName, stepName] = currentStepLocaleStorage.split(".");
2086
- set(copyInitialState, ["guidedTourState", sectionName, stepName], true);
2087
- addCompletedStep(currentStepLocaleStorage);
2088
- auth.set(null, "GUIDED_TOUR_CURRENT_STEP", true);
2089
- }
2090
- if (skippedLocaleStorage !== null) {
2091
- set(copyInitialState, "isSkipped", skippedLocaleStorage);
2092
- }
2093
- return copyInitialState;
2094
- };
2095
- const addCompletedStep = (completedStep) => {
2096
- const currentSteps = auth.get("GUIDED_TOUR_COMPLETED_STEPS") ?? [];
2097
- if (!Array.isArray(currentSteps)) {
2098
- return;
2099
- }
2100
- const isAlreadyStored = currentSteps.includes(completedStep);
2101
- if (isAlreadyStored) {
2102
- return;
2103
- }
2104
- auth.set([...currentSteps, completedStep], "GUIDED_TOUR_COMPLETED_STEPS", true);
2105
- };
2106
- const [ThemeToggleContextProvider, useThemeToggleContext] = createContext("ThemeToggleContext");
2107
- const useThemeToggle = () => useThemeToggleContext("useThemeToggle");
2108
- const Theme = ({ children }) => {
2109
- const { currentTheme, themes, systemTheme } = useThemeToggle();
2110
- const { locale } = useIntl();
2111
- const computedThemeName = currentTheme === "system" ? systemTheme : currentTheme;
2112
- return /* @__PURE__ */ jsxs(
2113
- DesignSystemProvider,
2114
- {
2115
- locale,
2116
- theme: themes?.[computedThemeName || "light"],
2117
- children: [
2118
- children,
2119
- /* @__PURE__ */ jsx(GlobalStyle, {})
2120
- ]
2121
- }
2122
- );
2123
- };
2124
- const GlobalStyle = createGlobalStyle`
2125
- body {
2126
- background: ${({ theme }) => theme.colors.neutral100};
2127
- }
2128
- `;
2129
- const THEME_KEY = "STRAPI_THEME";
2130
- const getDefaultTheme = () => {
2131
- const persistedTheme = localStorage.getItem(THEME_KEY);
2132
- return persistedTheme || "system";
2133
- };
2134
- const ThemeToggleProvider = ({ children, themes }) => {
2135
- const [currentTheme, setCurrentTheme] = React.useState(getDefaultTheme());
2136
- const [systemTheme, setSystemTheme] = React.useState();
2137
- const handleChangeTheme = React.useCallback(
2138
- (nextTheme) => {
2139
- setCurrentTheme(nextTheme);
2140
- localStorage.setItem(THEME_KEY, nextTheme);
2141
- },
2142
- [setCurrentTheme]
2143
- );
2144
- React.useEffect(() => {
2145
- const themeWatcher = window.matchMedia("(prefers-color-scheme: dark)");
2146
- setSystemTheme(themeWatcher.matches ? "dark" : "light");
2147
- const listener = (event) => {
2148
- setSystemTheme(event.matches ? "dark" : "light");
2149
- };
2150
- themeWatcher.addEventListener("change", listener);
2151
- return () => {
2152
- themeWatcher.removeEventListener("change", listener);
2153
- };
2154
- }, []);
2155
- return /* @__PURE__ */ jsx(
2156
- ThemeToggleContextProvider,
2157
- {
2158
- currentTheme,
2159
- onChangeTheme: handleChangeTheme,
2160
- themes,
2161
- systemTheme,
2162
- children
2163
- }
2164
- );
2165
- };
2166
- const queryClient = new QueryClient({
2167
- defaultOptions: {
2168
- queries: {
2169
- refetchOnWindowFocus: false
2170
- }
2171
- }
2172
- });
2173
- const Providers = ({
2174
- authLogo,
2175
- children,
2176
- components,
2177
- customFields,
2178
- fields,
2179
- getAdminInjectedComponents,
2180
- getPlugin,
2181
- localeNames,
2182
- menu,
2183
- menuLogo,
2184
- messages,
2185
- plugins,
2186
- runHookParallel,
2187
- runHookSeries,
2188
- runHookWaterfall,
2189
- settings,
2190
- showReleaseNotification,
2191
- showTutorials,
2192
- store,
2193
- themes
2194
- }) => {
2195
- return /* @__PURE__ */ jsx(LanguageProvider, { messages, localeNames, children: /* @__PURE__ */ jsx(ThemeToggleProvider, { themes, children: /* @__PURE__ */ jsx(Theme, { children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(Provider, { store, children: /* @__PURE__ */ jsx(AdminContextProvider, { getAdminInjectedComponents, children: /* @__PURE__ */ jsx(
2196
- ConfigurationProvider,
2197
- {
2198
- authLogo,
2199
- menuLogo,
2200
- showReleaseNotification,
2201
- showTutorials,
2202
- children: /* @__PURE__ */ jsx(
2203
- StrapiAppProvider,
2204
- {
2205
- getPlugin,
2206
- menu,
2207
- plugins,
2208
- runHookParallel,
2209
- runHookWaterfall,
2210
- runHookSeries,
2211
- settings,
2212
- children: /* @__PURE__ */ jsx(LibraryProvider, { components, fields, children: /* @__PURE__ */ jsx(CustomFieldsProvider, { customFields, children: /* @__PURE__ */ jsx(AutoReloadOverlayBlockerProvider, { children: /* @__PURE__ */ jsx(OverlayBlockerProvider, { children: /* @__PURE__ */ jsx(GuidedTourProvider, { children: /* @__PURE__ */ jsx(NotificationsProvider, { children }) }) }) }) }) })
2213
- }
2214
- )
2215
- }
2216
- ) }) }) }) }) }) });
2217
- };
2218
- class Components {
2219
- components;
2220
- constructor() {
2221
- this.components = {};
2222
- }
2223
- add(component) {
2224
- const { name, Component } = component;
2225
- invariant(Component, "A Component must be provided");
2226
- invariant(name, "A name must be provided");
2227
- invariant(this.components[name] === void 0, "A similar field already exists");
2228
- this.components[name] = Component;
2229
- }
2230
- }
2231
- const ALLOWED_TYPES = [
2232
- "biginteger",
2233
- "boolean",
2234
- "date",
2235
- "datetime",
2236
- "decimal",
2237
- "email",
2238
- "enumeration",
2239
- "float",
2240
- "integer",
2241
- "json",
2242
- "password",
2243
- "richtext",
2244
- "string",
2245
- "text",
2246
- "time",
2247
- "uid"
2248
- ];
2249
- const ALLOWED_ROOT_LEVEL_OPTIONS = [
2250
- "min",
2251
- "minLength",
2252
- "max",
2253
- "maxLength",
2254
- "required",
2255
- "regex",
2256
- "enum",
2257
- "unique",
2258
- "private",
2259
- "default"
2260
- ];
2261
- class CustomFields {
2262
- customFields;
2263
- constructor() {
2264
- this.customFields = {};
2265
- }
2266
- register(customFields) {
2267
- if (Array.isArray(customFields)) {
2268
- customFields.forEach((customField) => {
2269
- this.register(customField);
2270
- });
2271
- } else {
2272
- const { name, pluginId, type, intlLabel, intlDescription, components, options: options2 } = customFields;
2273
- invariant(name, "A name must be provided");
2274
- invariant(type, "A type must be provided");
2275
- invariant(intlLabel, "An intlLabel must be provided");
2276
- invariant(intlDescription, "An intlDescription must be provided");
2277
- invariant(components, "A components object must be provided");
2278
- invariant(components.Input, "An Input component must be provided");
2279
- invariant(
2280
- ALLOWED_TYPES.includes(type),
2281
- `Custom field type: '${type}' is not a valid Strapi type or it can't be used with a Custom Field`
2282
- );
2283
- const isValidObjectKey = /^(?![0-9])[a-zA-Z0-9$_-]+$/g;
2284
- invariant(
2285
- isValidObjectKey.test(name),
2286
- `Custom field name: '${name}' is not a valid object key`
2287
- );
2288
- const allFormOptions = [...options2?.base || [], ...options2?.advanced || []];
2289
- if (allFormOptions.length) {
2290
- const optionPathValidations = allFormOptions.reduce(optionsValidationReducer, []);
2291
- optionPathValidations.forEach(({ isValidOptionPath, errorMessage }) => {
2292
- invariant(isValidOptionPath, errorMessage);
2293
- });
2294
- }
2295
- const uid = pluginId ? `plugin::${pluginId}.${name}` : `global::${name}`;
2296
- const uidAlreadyUsed = Object.prototype.hasOwnProperty.call(this.customFields, uid);
2297
- invariant(!uidAlreadyUsed, `Custom field: '${uid}' has already been registered`);
2298
- this.customFields[uid] = customFields;
2299
- }
2300
- }
2301
- getAll() {
2302
- return this.customFields;
2303
- }
2304
- get(uid) {
2305
- return this.customFields[uid];
2306
- }
2307
- }
2308
- const optionsValidationReducer = (acc, option) => {
2309
- if ("items" in option) {
2310
- return option.items.reduce(optionsValidationReducer, acc);
2311
- }
2312
- if (!option.name) {
2313
- acc.push({
2314
- isValidOptionPath: false,
2315
- errorMessage: "The 'name' property is required on an options object"
2316
- });
2317
- } else {
2318
- acc.push({
2319
- isValidOptionPath: option.name.startsWith("options") || ALLOWED_ROOT_LEVEL_OPTIONS.includes(option.name),
2320
- errorMessage: `'${option.name}' must be prefixed with 'options.'`
2321
- });
2322
- }
2323
- return acc;
2324
- };
2325
- class Fields {
2326
- fields;
2327
- constructor() {
2328
- this.fields = {};
2329
- }
2330
- add(field) {
2331
- const { type, Component } = field;
2332
- invariant(Component, "A Component must be provided");
2333
- invariant(type, "A type must be provided");
2334
- this.fields[type] = Component;
2335
- }
2336
- }
2337
- class Middlewares {
2338
- middlewares;
2339
- constructor() {
2340
- this.middlewares = [];
2341
- }
2342
- add(middleware) {
2343
- this.middlewares.push(middleware);
2344
- }
2345
- }
2346
- class Plugin {
2347
- apis;
2348
- initializer;
2349
- injectionZones;
2350
- isReady;
2351
- name;
2352
- pluginId;
2353
- constructor(pluginConf) {
2354
- this.apis = pluginConf.apis || {};
2355
- this.initializer = pluginConf.initializer || null;
2356
- this.injectionZones = pluginConf.injectionZones || {};
2357
- this.isReady = pluginConf.isReady !== void 0 ? pluginConf.isReady : true;
2358
- this.name = pluginConf.name;
2359
- this.pluginId = pluginConf.id;
2360
- }
2361
- getInjectedComponents(containerName, blockName) {
2362
- try {
2363
- return this.injectionZones[containerName][blockName] || [];
2364
- } catch (err) {
2365
- console.error("Cannot get injected component", err);
2366
- return [];
2367
- }
2368
- }
2369
- injectComponent(containerName, blockName, component) {
2370
- try {
2371
- this.injectionZones[containerName][blockName].push(component);
2372
- } catch (err) {
2373
- console.error("Cannot inject component", err);
2374
- }
2375
- }
2376
- }
2377
- class Reducers {
2378
- reducers;
2379
- constructor({ appReducers = {} } = {}) {
2380
- this.reducers = { ...appReducers };
2381
- }
2382
- add(reducerName, reducer2) {
2383
- this.reducers[reducerName] = reducer2;
2384
- }
2385
- }
2386
- const useTypedDispatch = useDispatch;
2387
- const useTypedStore = useStore;
2388
- const useTypedSelector = useSelector;
2389
- const createTypedSelector = (selector) => createSelector((state) => state, selector);
2390
- const RBACProvider = ({ children, permissions, refetchPermissions }) => {
2391
- const allPermissions = useTypedSelector((state) => state.rbacProvider.allPermissions);
2392
- const dispatch = useTypedDispatch();
2393
- React.useEffect(() => {
2394
- dispatch(setPermissionsAction(permissions));
2395
- return () => {
2396
- dispatch(resetStoreAction());
2397
- };
2398
- }, [permissions, dispatch]);
2399
- if (!allPermissions) {
2400
- return /* @__PURE__ */ jsx(LoadingIndicatorPage, {});
2401
- }
2402
- return /* @__PURE__ */ jsx(RBACContext.Provider, { value: { allPermissions, refetchPermissions }, children });
2403
- };
2404
- const initialState$5 = {
2405
- allPermissions: null,
2406
- collectionTypesRelatedPermissions: {}
2407
- };
2408
- const RESET_STORE = "StrapiAdmin/RBACProvider/RESET_STORE";
2409
- const SET_PERMISSIONS$1 = "StrapiAdmin/RBACProvider/SET_PERMISSIONS";
2410
- const resetStoreAction = () => ({ type: RESET_STORE });
2411
- const setPermissionsAction = (permissions) => ({
2412
- type: SET_PERMISSIONS$1,
2413
- permissions
2414
- });
2415
- const RBACReducer = (state = initialState$5, action) => produce(state, (draftState) => {
2416
- switch (action.type) {
2417
- case SET_PERMISSIONS$1: {
2418
- draftState.allPermissions = action.permissions;
2419
- draftState.collectionTypesRelatedPermissions = action.permissions.filter((perm) => perm.subject).reduce((acc, current) => {
2420
- const { subject, action: action2 } = current;
2421
- if (!subject)
2422
- return acc;
2423
- if (!acc[subject]) {
2424
- acc[subject] = {};
2425
- }
2426
- acc[subject] = acc[subject][action2] ? { ...acc[subject], [action2]: [...acc[subject][action2], current] } : { ...acc[subject], [action2]: [current] };
2427
- return acc;
2428
- }, {});
2429
- break;
2430
- }
2431
- case RESET_STORE: {
2432
- return initialState$5;
2433
- }
2434
- default:
2435
- return state;
2436
- }
2437
- });
2438
- const SET_PERMISSIONS = "ContentManager/RBACManager/SET_PERMISSIONS";
2439
- const RESET_PERMISSIONS = "ContentManager/RBACManager/RESET_PERMISSIONS";
2440
- const initialState$4 = {
2441
- permissions: null
2442
- };
2443
- const rbacManagerReducer = (state = initialState$4, action) => (
2444
- // eslint-disable-next-line consistent-return
2445
- produce(state, (draftState) => {
2446
- switch (action.type) {
2447
- case SET_PERMISSIONS: {
2448
- draftState.permissions = Object.entries(action.permissions).reduce((acc, current) => {
2449
- return [...acc, ...current[1]];
2450
- }, []);
2451
- break;
2452
- }
2453
- case RESET_PERMISSIONS: {
2454
- draftState.permissions = null;
2455
- break;
2456
- }
2457
- default:
2458
- return draftState;
2459
- }
2460
- })
2461
- );
2462
- const GET_INIT_DATA = "ContentManager/App/GET_INIT_DATA";
2463
- const RESET_INIT_DATA = "ContentManager/App/RESET_INIT_DATA";
2464
- const SET_INIT_DATA = "ContentManager/App/SET_INIT_DATA";
2465
- const initialState$3 = {
2466
- components: [],
2467
- status: "loading",
2468
- models: [],
2469
- collectionTypeLinks: [],
2470
- singleTypeLinks: []
2471
- };
2472
- const mainReducer = (state = initialState$3, action) => produce(state, (draftState) => {
2473
- switch (action.type) {
2474
- case GET_INIT_DATA: {
2475
- draftState.status = "loading";
2476
- break;
2477
- }
2478
- case RESET_INIT_DATA: {
2479
- return initialState$3;
2480
- }
2481
- case SET_INIT_DATA: {
2482
- draftState.collectionTypeLinks = action.data.authorizedCollectionTypeLinks.filter(
2483
- ({ isDisplayed }) => isDisplayed
2484
- );
2485
- draftState.singleTypeLinks = action.data.authorizedSingleTypeLinks.filter(
2486
- ({ isDisplayed }) => isDisplayed
2487
- );
2488
- draftState.components = action.data.components;
2489
- draftState.models = action.data.contentTypeSchemas;
2490
- draftState.fieldSizes = action.data.fieldSizes;
2491
- draftState.status = "resolved";
2492
- break;
2493
- }
2494
- default:
2495
- return draftState;
2496
- }
2497
- });
2498
- const SET_LAYOUT = "ContentManager/EditViewLayoutManager/SET_LAYOUT";
2499
- const RESET_PROPS$2 = "ContentManager/EditViewLayoutManager/RESET_PROPS";
2500
- const initialState$2 = {
2501
- currentLayout: null
2502
- };
2503
- const editViewManagerReducer = (state = initialState$2, action) => (
2504
- // eslint-disable-next-line consistent-return
2505
- produce(state, (draftState) => {
2506
- switch (action.type) {
2507
- case RESET_PROPS$2: {
2508
- draftState.currentLayout = null;
2509
- break;
2510
- }
2511
- case SET_LAYOUT: {
2512
- draftState.currentLayout = action.layout;
2513
- break;
2514
- }
2515
- default:
2516
- return draftState;
2517
- }
2518
- })
2519
- );
2520
- const GET_DATA$1 = "ContentManager/ListView/GET_DATA";
2521
- const GET_DATA_SUCCEEDED$1 = "ContentManager/ListView/GET_DATA_SUCCEEDED";
2522
- const RESET_PROPS$1 = "ContentManager/ListView/RESET_PROPS";
2523
- const ON_CHANGE_LIST_HEADERS = "ContentManager/ListView/ON_CHANGE_LIST_HEADERS ";
2524
- const ON_RESET_LIST_HEADERS = "ContentManager/ListView/ON_RESET_LIST_HEADERS ";
2525
- const SET_LIST_LAYOUT = "ContentManager/ListView/SET_LIST_LAYOUT ";
2526
- const initialState$1 = {
2527
- data: [],
2528
- isLoading: true,
2529
- contentType: {},
2530
- components: [],
2531
- initialDisplayedHeaders: [],
2532
- displayedHeaders: [],
2533
- pagination: {
2534
- total: 0
2535
- }
2536
- };
2537
- const listViewReducer = (state = initialState$1, action) => (
2538
- // eslint-disable-next-line consistent-return
2539
- produce(state, (draftState) => {
2540
- switch (action.type) {
2541
- case GET_DATA$1: {
2542
- return {
2543
- ...initialState$1,
2544
- contentType: state.contentType,
2545
- components: state.components,
2546
- initialDisplayedHeaders: state.initialDisplayedHeaders,
2547
- displayedHeaders: state.displayedHeaders
2548
- };
2549
- }
2550
- case GET_DATA_SUCCEEDED$1: {
2551
- draftState.pagination = action.pagination;
2552
- draftState.data = action.data;
2553
- draftState.isLoading = false;
2554
- break;
2555
- }
2556
- case ON_CHANGE_LIST_HEADERS: {
2557
- const {
2558
- target: { name, value }
2559
- } = action;
2560
- if (!value) {
2561
- const { metadatas, attributes, uid } = state.contentType;
2562
- const metas = metadatas[name].list;
2563
- const header = {
2564
- name,
2565
- fieldSchema: attributes[name],
2566
- metadatas: metas,
2567
- key: `__${name}_key__`
2568
- };
2569
- switch (attributes[name].type) {
2570
- case "component": {
2571
- const componentName = attributes[name].component;
2572
- const mainFieldName = get(
2573
- state,
2574
- ["components", componentName, "settings", "mainField"],
2575
- null
2576
- );
2577
- const mainFieldAttribute = get(state, [
2578
- "components",
2579
- componentName,
2580
- "attributes",
2581
- mainFieldName
2582
- ]);
2583
- draftState.displayedHeaders.push({
2584
- ...header,
2585
- metadatas: {
2586
- ...metas,
2587
- mainField: {
2588
- ...mainFieldAttribute,
2589
- name: mainFieldName
2590
- }
2591
- }
2592
- });
2593
- break;
2594
- }
2595
- case "relation":
2596
- draftState.displayedHeaders.push({
2597
- ...header,
2598
- queryInfos: {
2599
- defaultParams: {},
2600
- endPoint: `collection-types/${uid}`
2601
- }
2602
- });
2603
- break;
2604
- default:
2605
- draftState.displayedHeaders.push(header);
2606
- }
2607
- } else {
2608
- draftState.displayedHeaders = state.displayedHeaders.filter(
2609
- (header) => header.name !== name
2610
- );
2611
- }
2612
- break;
2613
- }
2614
- case ON_RESET_LIST_HEADERS: {
2615
- draftState.displayedHeaders = state.initialDisplayedHeaders;
2616
- break;
2617
- }
2618
- case RESET_PROPS$1: {
2619
- return initialState$1;
2620
- }
2621
- case SET_LIST_LAYOUT: {
2622
- const { contentType, components, displayedHeaders } = action;
2623
- draftState.contentType = contentType;
2624
- draftState.components = components;
2625
- draftState.displayedHeaders = displayedHeaders;
2626
- draftState.initialDisplayedHeaders = displayedHeaders;
2627
- break;
2628
- }
2629
- default:
2630
- return draftState;
2631
- }
2632
- })
2633
- );
2634
- const GET_DATA = "ContentManager/CrudReducer/GET_DATA";
2635
- const GET_DATA_SUCCEEDED = "ContentManager/CrudReducer/GET_DATA_SUCCEEDED";
2636
- const INIT_FORM = "ContentManager/CrudReducer/INIT_FORM";
2637
- const RESET_PROPS = "ContentManager/CrudReducer/RESET_PROPS";
2638
- const SET_DATA_STRUCTURES = "ContentManager/CrudReducer/SET_DATA_STRUCTURES";
2639
- const SET_STATUS = "ContentManager/CrudReducer/SET_STATUS";
2640
- const SUBMIT_SUCCEEDED = "ContentManager/CrudReducer/SUBMIT_SUCCEEDED";
2641
- const CLEAR_SET_MODIFIED_DATA_ONLY = "ContentManager/CrudReducer/CLEAR_SET_MODIFIED_DATA_ONLY";
2642
- const crudInitialState = {
2643
- componentsDataStructure: {},
2644
- contentTypeDataStructure: {},
2645
- isLoading: true,
2646
- data: null,
2647
- status: "resolved",
2648
- setModifiedDataOnly: false
2649
- };
2650
- const crudReducer = (state = crudInitialState, action) => produce(state, (draftState) => {
2651
- switch (action.type) {
2652
- case GET_DATA: {
2653
- draftState.isLoading = true;
2654
- draftState.data = null;
2655
- break;
2656
- }
2657
- case GET_DATA_SUCCEEDED: {
2658
- draftState.isLoading = false;
2659
- draftState.data = action.data;
2660
- draftState.setModifiedDataOnly = action.setModifiedDataOnly ?? false;
2661
- break;
2662
- }
2663
- case INIT_FORM: {
2664
- if (action.data) {
2665
- draftState.isLoading = false;
2666
- draftState.data = action.data;
2667
- break;
2668
- }
2669
- draftState.isLoading = false;
2670
- draftState.data = state.contentTypeDataStructure;
2671
- break;
2672
- }
2673
- case RESET_PROPS: {
2674
- return crudInitialState;
2675
- }
2676
- case SET_DATA_STRUCTURES: {
2677
- draftState.componentsDataStructure = action.componentsDataStructure;
2678
- draftState.contentTypeDataStructure = action.contentTypeDataStructure;
2679
- break;
2680
- }
2681
- case SET_STATUS: {
2682
- draftState.status = action.status;
2683
- break;
2684
- }
2685
- case SUBMIT_SUCCEEDED: {
2686
- draftState.data = action.data;
2687
- break;
2688
- }
2689
- case CLEAR_SET_MODIFIED_DATA_ONLY: {
2690
- draftState.setModifiedDataOnly = false;
2691
- break;
2692
- }
2693
- default:
2694
- return draftState;
2695
- }
2696
- });
2697
- const initialState = {
2698
- permissions: {},
2699
- status: "init"
2700
- };
2701
- const reducer = (state = initialState, action) => (
2702
- /* eslint-disable-next-line consistent-return */
2703
- produce(state, (draftState) => {
2704
- switch (action.type) {
2705
- case ACTION_SET_APP_RUNTIME_STATUS: {
2706
- draftState.status = "runtime";
2707
- break;
2708
- }
2709
- case ACTION_SET_ADMIN_PERMISSIONS: {
2710
- draftState.permissions = action.payload;
2711
- break;
2712
- }
2713
- default:
2714
- return draftState;
2715
- }
2716
- })
2717
- );
2718
- const staticReducers = {
2719
- admin_app: reducer,
2720
- rbacProvider: RBACReducer,
2721
- "content-manager_app": mainReducer,
2722
- "content-manager_listView": listViewReducer,
2723
- "content-manager_rbacManager": rbacManagerReducer,
2724
- "content-manager_editViewLayoutManager": editViewManagerReducer,
2725
- "content-manager_editViewCrudReducer": crudReducer
2726
- };
2727
- const injectReducerStoreEnhancer = (appReducers) => (next) => (...args) => {
2728
- const store = next(...args);
2729
- const asyncReducers = {};
2730
- return {
2731
- ...store,
2732
- asyncReducers,
2733
- injectReducer: (key, asyncReducer) => {
2734
- asyncReducers[key] = asyncReducer;
2735
- store.replaceReducer(
2736
- // @ts-expect-error we dynamically add reducers which makes the types uncomfortable.
2737
- combineReducers({
2738
- ...appReducers,
2739
- ...asyncReducers
2740
- })
2741
- );
2742
- }
2743
- };
2744
- };
2745
- const configureStoreImpl = (appMiddlewares = [], injectedReducers = {}) => {
2746
- const coreReducers = { ...staticReducers, ...injectedReducers };
2747
- const store = configureStore({
2748
- reducer: coreReducers,
2749
- devTools: process.env.NODE_ENV !== "production",
2750
- middleware: (getDefaultMiddleware) => [
2751
- ...getDefaultMiddleware(),
2752
- ...appMiddlewares.map((m) => m())
2753
- ],
2754
- enhancers: [injectReducerStoreEnhancer(coreReducers)]
2755
- });
2756
- return store;
2757
- };
2758
- const getBasename = () => (process.env.ADMIN_PATH ?? "").replace(window.location.origin, "");
2759
- const createHook = () => {
2760
- const _handlers = [];
2761
- return {
2762
- register(fn) {
2763
- _handlers.push(fn);
2764
- },
2765
- delete(handler) {
2766
- _handlers.splice(_handlers.indexOf(handler), 1);
2767
- },
2768
- runWaterfall(args, store) {
2769
- return _handlers.reduce((acc, fn) => fn(acc, store), args);
2770
- },
2771
- async runWaterfallAsync(args, store) {
2772
- let result = args;
2773
- for (const fn of _handlers) {
2774
- result = await fn(result, store);
2775
- }
2776
- return result;
2777
- },
2778
- runSeries(...args) {
2779
- return _handlers.map((fn) => fn(...args));
2780
- },
2781
- async runSeriesAsync(...args) {
2782
- const result = [];
2783
- for (const fn of _handlers) {
2784
- result.push(await fn(...args));
2785
- }
2786
- return result;
2787
- },
2788
- runParallel(...args) {
2789
- return Promise.all(
2790
- _handlers.map((fn) => {
2791
- return fn(...args);
2792
- })
2793
- );
2794
- }
2795
- };
2796
- };
2797
- const useInjectionZone = (area) => {
2798
- const { getAdminInjectedComponents } = useAdmin();
2799
- const [moduleName, page, position] = area.split(".");
2800
- return getAdminInjectedComponents(moduleName, page, position);
2801
- };
2802
- const INJECTION_ZONES = {
2803
- admin: {
2804
- // Temporary injection zone, support for the react-tour plugin in foodadvisor
2805
- tutorials: {
2806
- links: []
2807
- }
2808
- },
2809
- contentManager: {
2810
- editView: { informations: [], "right-links": [] },
2811
- listView: {
2812
- actions: [],
2813
- deleteModalAdditionalInfos: [],
2814
- publishModalAdditionalInfos: [],
2815
- unpublishModalAdditionalInfos: []
2816
- }
2817
- }
2818
- };
2819
- const InjectionZone = ({ area, ...props }) => {
2820
- const components = useInjectionZone(area);
2821
- return components.map((component) => /* @__PURE__ */ jsx(component.Component, { ...props }, component.name));
2822
- };
2823
- const languageNativeNames = {
2824
- ar: "العربية",
2825
- ca: "Català",
2826
- cs: "Čeština",
2827
- de: "Deutsch",
2828
- dk: "Dansk",
2829
- en: "English",
2830
- es: "Español",
2831
- eu: "Euskara",
2832
- fr: "Français",
2833
- gu: "Gujarati",
2834
- he: "עברית",
2835
- hu: "Magyar",
2836
- id: "Indonesian",
2837
- it: "Italiano",
2838
- ja: "日本語",
2839
- ko: "한국어",
2840
- ml: "Malayalam",
2841
- ms: "Melayu",
2842
- nl: "Nederlands",
2843
- no: "Norwegian",
2844
- pl: "Polski",
2845
- "pt-BR": "Português (Brasil)",
2846
- pt: "Português (Portugal)",
2847
- ru: "Русский",
2848
- sk: "Slovenčina",
2849
- sv: "Swedish",
2850
- th: "ไทย",
2851
- tr: "Türkçe",
2852
- uk: "Українська",
2853
- vi: "Tiếng Việt",
2854
- "zh-Hans": "中文 (简体)",
2855
- zh: "中文 (繁體)",
2856
- sa: "संस्कृत",
2857
- hi: "हिन्दी"
2858
- };
2859
- const {
2860
- INJECT_COLUMN_IN_TABLE,
2861
- MUTATE_COLLECTION_TYPES_LINKS,
2862
- MUTATE_EDIT_VIEW_LAYOUT,
2863
- MUTATE_SINGLE_TYPES_LINKS
2864
- } = HOOKS;
2865
- class StrapiApp {
2866
- admin;
2867
- appPlugins;
2868
- configurations;
2869
- customBootstrapConfiguration;
2870
- customConfigurations;
2871
- customFields;
2872
- hooksDict;
2873
- library;
2874
- menu;
2875
- middlewares;
2876
- plugins;
2877
- reducers;
2878
- settings;
2879
- translations;
2880
- constructor({ adminConfig, appPlugins } = {}) {
2881
- this.customConfigurations = adminConfig?.config ?? {};
2882
- this.customBootstrapConfiguration = adminConfig?.bootstrap;
2883
- this.configurations = {
2884
- authLogo: StrapiLogo,
2885
- head: { favicon: "" },
2886
- locales: ["en"],
2887
- menuLogo: StrapiLogo,
2888
- notifications: { releases: true },
2889
- themes: { light: lightTheme, dark: darkTheme },
2890
- translations: {},
2891
- tutorials: true
2892
- };
2893
- this.appPlugins = appPlugins || {};
2894
- this.library = {
2895
- components: new Components(),
2896
- fields: new Fields()
2897
- };
2898
- this.middlewares = new Middlewares();
2899
- this.plugins = {};
2900
- this.reducers = new Reducers();
2901
- this.translations = {};
2902
- this.hooksDict = {};
2903
- this.admin = {
2904
- injectionZones: INJECTION_ZONES
2905
- };
2906
- this.customFields = new CustomFields();
2907
- this.menu = [];
2908
- this.settings = {
2909
- global: {
2910
- id: "global",
2911
- intlLabel: {
2912
- id: "Settings.global",
2913
- defaultMessage: "Global Settings"
2914
- },
2915
- links: []
2916
- }
2917
- };
2918
- }
2919
- addComponents = (components) => {
2920
- if (Array.isArray(components)) {
2921
- components.map((compo) => this.library.components.add(compo));
2922
- } else {
2923
- this.library.components.add(components);
2924
- }
2925
- };
2926
- addCorePluginMenuLink = (link) => {
2927
- const stringifiedLink = JSON.stringify(link);
2928
- invariant(link.to, `link.to should be defined for ${stringifiedLink}`);
2929
- invariant(
2930
- typeof link.to === "string",
2931
- `Expected link.to to be a string instead received ${typeof link.to}`
2932
- );
2933
- invariant(
2934
- ["/plugins/content-type-builder", "/plugins/upload"].includes(link.to),
2935
- "This method is not available for your plugin"
2936
- );
2937
- invariant(
2938
- link.intlLabel?.id && link.intlLabel?.defaultMessage,
2939
- `link.intlLabel.id & link.intlLabel.defaultMessage for ${stringifiedLink}`
2940
- );
2941
- this.menu.push(link);
2942
- };
2943
- addFields = (fields) => {
2944
- if (Array.isArray(fields)) {
2945
- fields.map((field) => this.library.fields.add(field));
2946
- } else {
2947
- this.library.fields.add(fields);
2948
- }
2949
- };
2950
- addMenuLink = (link) => {
2951
- const stringifiedLink = JSON.stringify(link);
2952
- invariant(link.to, `link.to should be defined for ${stringifiedLink}`);
2953
- invariant(
2954
- typeof link.to === "string",
2955
- `Expected link.to to be a string instead received ${typeof link.to}`
2956
- );
2957
- invariant(
2958
- link.intlLabel?.id && link.intlLabel?.defaultMessage,
2959
- `link.intlLabel.id & link.intlLabel.defaultMessage for ${stringifiedLink}`
2960
- );
2961
- invariant(
2962
- link.Component && typeof link.Component === "function",
2963
- `link.Component should be a valid React Component`
2964
- );
2965
- invariant(
2966
- link.icon && typeof link.icon === "function",
2967
- `link.Icon should be a valid React Component`
2968
- );
2969
- this.menu.push(link);
2970
- };
2971
- addMiddlewares = (middlewares) => {
2972
- middlewares.forEach((middleware) => {
2973
- this.middlewares.add(middleware);
2974
- });
2975
- };
2976
- addReducers = (reducers) => {
2977
- Object.keys(reducers).forEach((reducerName) => {
2978
- this.reducers.add(reducerName, reducers[reducerName]);
2979
- });
2980
- };
2981
- addSettingsLink = (sectionId, link) => {
2982
- invariant(this.settings[sectionId], "The section does not exist");
2983
- const stringifiedLink = JSON.stringify(link);
2984
- invariant(link.id, `link.id should be defined for ${stringifiedLink}`);
2985
- invariant(
2986
- link.intlLabel?.id && link.intlLabel?.defaultMessage,
2987
- `link.intlLabel.id & link.intlLabel.defaultMessage for ${stringifiedLink}`
2988
- );
2989
- invariant(link.to, `link.to should be defined for ${stringifiedLink}`);
2990
- invariant(
2991
- link.Component && typeof link.Component === "function",
2992
- `link.Component should be a valid React Component`
2993
- );
2994
- this.settings[sectionId].links.push(link);
2995
- };
2996
- addSettingsLinks = (sectionId, links) => {
2997
- invariant(this.settings[sectionId], "The section does not exist");
2998
- invariant(Array.isArray(links), "TypeError expected links to be an array");
2999
- links.forEach((link) => {
3000
- this.addSettingsLink(sectionId, link);
3001
- });
3002
- };
3003
- async bootstrap() {
3004
- Object.keys(this.appPlugins).forEach((plugin) => {
3005
- const bootstrap = this.appPlugins[plugin].bootstrap;
3006
- if (bootstrap) {
3007
- bootstrap({
3008
- addSettingsLink: this.addSettingsLink,
3009
- addSettingsLinks: this.addSettingsLinks,
3010
- getPlugin: this.getPlugin,
3011
- injectContentManagerComponent: this.injectContentManagerComponent,
3012
- injectAdminComponent: this.injectAdminComponent,
3013
- registerHook: this.registerHook
3014
- });
3015
- }
3016
- });
3017
- if (isFunction(this.customBootstrapConfiguration)) {
3018
- this.customBootstrapConfiguration({
3019
- addComponents: this.addComponents,
3020
- addFields: this.addFields,
3021
- addMenuLink: this.addMenuLink,
3022
- addReducers: this.addReducers,
3023
- addSettingsLink: this.addSettingsLink,
3024
- addSettingsLinks: this.addSettingsLinks,
3025
- getPlugin: this.getPlugin,
3026
- injectContentManagerComponent: this.injectContentManagerComponent,
3027
- injectAdminComponent: this.injectAdminComponent,
3028
- registerHook: this.registerHook
3029
- });
3030
- }
3031
- }
3032
- bootstrapAdmin = async () => {
3033
- await this.createCustomConfigurations();
3034
- this.createHook(INJECT_COLUMN_IN_TABLE);
3035
- this.createHook(MUTATE_COLLECTION_TYPES_LINKS);
3036
- this.createHook(MUTATE_SINGLE_TYPES_LINKS);
3037
- this.createHook(MUTATE_EDIT_VIEW_LAYOUT);
3038
- return Promise.resolve();
3039
- };
3040
- createCustomConfigurations = async () => {
3041
- if (this.customConfigurations?.locales) {
3042
- this.configurations.locales = [
3043
- "en",
3044
- ...this.customConfigurations.locales?.filter((loc) => loc !== "en") || []
3045
- ];
3046
- }
3047
- if (this.customConfigurations?.auth?.logo) {
3048
- this.configurations.authLogo = this.customConfigurations.auth.logo;
3049
- }
3050
- if (this.customConfigurations?.menu?.logo) {
3051
- this.configurations.menuLogo = this.customConfigurations.menu.logo;
3052
- }
3053
- if (this.customConfigurations?.head?.favicon) {
3054
- this.configurations.head.favicon = this.customConfigurations.head.favicon;
3055
- }
3056
- if (this.customConfigurations?.theme) {
3057
- const darkTheme2 = this.customConfigurations.theme.dark;
3058
- const lightTheme2 = this.customConfigurations.theme.light;
3059
- if (!darkTheme2 && !lightTheme2) {
3060
- console.warn(
3061
- `[deprecated] In future versions, Strapi will stop supporting this theme customization syntax. The theme configuration accepts a light and a dark key to customize each theme separately. See https://docs.strapi.io/developer-docs/latest/development/admin-customization.html#theme-extension.`
3062
- );
3063
- merge(this.configurations.themes.light, this.customConfigurations.theme);
3064
- }
3065
- if (lightTheme2)
3066
- merge(this.configurations.themes.light, lightTheme2);
3067
- if (darkTheme2)
3068
- merge(this.configurations.themes.dark, darkTheme2);
3069
- }
3070
- if (this.customConfigurations?.notifications?.releases !== void 0) {
3071
- this.configurations.notifications.releases = this.customConfigurations.notifications.releases;
3072
- }
3073
- if (this.customConfigurations?.tutorials !== void 0) {
3074
- this.configurations.tutorials = this.customConfigurations.tutorials;
3075
- }
3076
- };
3077
- createHook = (name) => {
3078
- this.hooksDict[name] = createHook();
3079
- };
3080
- createSettingSection = (section, links) => {
3081
- invariant(section.id, "section.id should be defined");
3082
- invariant(
3083
- section.intlLabel?.id && section.intlLabel?.defaultMessage,
3084
- "section.intlLabel should be defined"
3085
- );
3086
- invariant(Array.isArray(links), "TypeError expected links to be an array");
3087
- invariant(this.settings[section.id] === void 0, "A similar section already exists");
3088
- this.settings[section.id] = { ...section, links: [] };
3089
- links.forEach((link) => {
3090
- this.addSettingsLink(section.id, link);
3091
- });
3092
- };
3093
- createStore = () => {
3094
- const store = configureStoreImpl(this.middlewares.middlewares, this.reducers.reducers);
3095
- return store;
3096
- };
3097
- getAdminInjectedComponents = (moduleName, containerName, blockName) => {
3098
- try {
3099
- return this.admin.injectionZones[moduleName][containerName][blockName] || [];
3100
- } catch (err) {
3101
- console.error("Cannot get injected component", err);
3102
- return [];
3103
- }
3104
- };
3105
- getPlugin = (pluginId) => {
3106
- return this.plugins[pluginId];
3107
- };
3108
- async initialize() {
3109
- Object.keys(this.appPlugins).forEach((plugin) => {
3110
- this.appPlugins[plugin].register(this);
3111
- });
3112
- }
3113
- injectContentManagerComponent = (containerName, blockName, component) => {
3114
- invariant(
3115
- this.admin.injectionZones.contentManager[containerName]?.[blockName],
3116
- `The ${containerName} ${String(blockName)} zone is not defined in the content manager`
3117
- );
3118
- invariant(component, "A Component must be provided");
3119
- this.admin.injectionZones.contentManager[containerName][blockName].push(component);
3120
- };
3121
- injectAdminComponent = (containerName, blockName, component) => {
3122
- invariant(
3123
- this.admin.injectionZones.admin[containerName]?.[blockName],
3124
- `The ${containerName} ${String(blockName)} zone is not defined in the admin`
3125
- );
3126
- invariant(component, "A Component must be provided");
3127
- this.admin.injectionZones.admin[containerName][blockName].push(component);
3128
- };
3129
- /**
3130
- * Load the admin translations
3131
- * @returns {Object} The imported admin translations
3132
- */
3133
- async loadAdminTrads() {
3134
- const arrayOfPromises = this.configurations.locales.map((locale) => {
3135
- return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => import("./ar-62e5e2b3.mjs"), "./translations/ca.json": () => import("./ca-e99de225.mjs"), "./translations/cs.json": () => import("./cs-2fa881a2.mjs"), "./translations/de.json": () => import("./de-28f8bc28.mjs"), "./translations/dk.json": () => import("./dk-0b759a56.mjs"), "./translations/en.json": () => import("./en-e728accb.mjs"), "./translations/es.json": () => import("./es-18b29db2.mjs"), "./translations/eu.json": () => import("./eu-8fd773c2.mjs"), "./translations/fr.json": () => import("./fr-f37df086.mjs"), "./translations/gu.json": () => import("./gu-69f0e13a.mjs"), "./translations/he.json": () => import("./he-bd769d7e.mjs"), "./translations/hi.json": () => import("./hi-d397a24b.mjs"), "./translations/hu.json": () => import("./hu-eb88bd0c.mjs"), "./translations/id.json": () => import("./id-f47699e6.mjs"), "./translations/it.json": () => import("./it-4006227c.mjs"), "./translations/ja.json": () => import("./ja-db43ca3d.mjs"), "./translations/ko.json": () => import("./ko-a7826e25.mjs"), "./translations/ml.json": () => import("./ml-90131768.mjs"), "./translations/ms.json": () => import("./ms-f4f16a83.mjs"), "./translations/nl.json": () => import("./nl-887ce2c3.mjs"), "./translations/no.json": () => import("./no-f0b02541.mjs"), "./translations/pl.json": () => import("./pl-9ccd35d9.mjs"), "./translations/pt-BR.json": () => import("./pt-BR-fd73cb13.mjs"), "./translations/pt.json": () => import("./pt-8acb6ac1.mjs"), "./translations/ru.json": () => import("./ru-9aad40c5.mjs"), "./translations/sa.json": () => import("./sa-6bf4c20e.mjs"), "./translations/sk.json": () => import("./sk-58d31b17.mjs"), "./translations/sv.json": () => import("./sv-d80ad633.mjs"), "./translations/th.json": () => import("./th-e72c6a22.mjs"), "./translations/tr.json": () => import("./tr-e35ecfe8.mjs"), "./translations/uk.json": () => import("./uk-de367ec1.mjs"), "./translations/vi.json": () => import("./vi-096bccbb.mjs"), "./translations/zh-Hans.json": () => import("./zh-Hans-ccf4be4b.mjs"), "./translations/zh.json": () => import("./zh-ba29b2e1.mjs") }), `./translations/${locale}.json`).then(({ default: data }) => {
3136
- return { data, locale };
3137
- }).catch(() => {
3138
- return { data: null, locale };
3139
- });
3140
- });
3141
- const adminLocales = await Promise.all(arrayOfPromises);
3142
- const translations = adminLocales.reduce(
3143
- (acc, current) => {
3144
- if (current.data) {
3145
- acc[current.locale] = current.data;
3146
- }
3147
- return acc;
3148
- },
3149
- {}
3150
- );
3151
- return translations;
3152
- }
3153
- /**
3154
- * Load the application's translations and merged the custom translations
3155
- * with the default ones.
3156
- *
3157
- */
3158
- async loadTrads() {
3159
- const adminTranslations = await this.loadAdminTrads();
3160
- const arrayOfPromises = Object.keys(this.appPlugins).map((plugin) => {
3161
- const registerTrads = this.appPlugins[plugin].registerTrads;
3162
- if (registerTrads) {
3163
- return registerTrads({ locales: this.configurations.locales });
3164
- }
3165
- return null;
3166
- }).filter((a) => a);
3167
- const pluginsTrads = await Promise.all(arrayOfPromises);
3168
- const mergedTrads = pluginsTrads.reduce(
3169
- (acc, currentPluginTrads) => {
3170
- const pluginTrads = currentPluginTrads.reduce(
3171
- (acc1, current) => {
3172
- acc1[current.locale] = current.data;
3173
- return acc1;
3174
- },
3175
- {}
3176
- );
3177
- Object.keys(pluginTrads).forEach((locale) => {
3178
- acc[locale] = { ...acc[locale], ...pluginTrads[locale] };
3179
- });
3180
- return acc;
3181
- },
3182
- {}
3183
- );
3184
- const translations = this.configurations.locales.reduce((acc, current) => {
3185
- acc[current] = {
3186
- ...adminTranslations[current],
3187
- ...mergedTrads[current] || {},
3188
- ...this.customConfigurations?.translations?.[current] ?? {}
3189
- };
3190
- return acc;
3191
- }, {});
3192
- this.configurations.translations = translations;
3193
- return Promise.resolve();
3194
- }
3195
- registerHook = (name, fn) => {
3196
- invariant(
3197
- this.hooksDict[name],
3198
- `The hook ${name} is not defined. You are trying to register a hook that does not exist in the application.`
3199
- );
3200
- this.hooksDict[name].register(fn);
3201
- };
3202
- registerPlugin = (pluginConf) => {
3203
- const plugin = new Plugin(pluginConf);
3204
- this.plugins[plugin.pluginId] = plugin;
3205
- };
3206
- runHookSeries = (name, asynchronous = false) => asynchronous ? this.hooksDict[name].runSeriesAsync() : this.hooksDict[name].runSeries();
3207
- runHookWaterfall = (name, initialValue, asynchronous = false, store) => {
3208
- return asynchronous ? this.hooksDict[name].runWaterfallAsync(initialValue, store) : this.hooksDict[name].runWaterfall(initialValue, store);
3209
- };
3210
- runHookParallel = (name) => this.hooksDict[name].runParallel();
3211
- render() {
3212
- const store = this.createStore();
3213
- const localeNames = pick(languageNativeNames, this.configurations.locales || []);
3214
- const {
3215
- components: { components },
3216
- fields: { fields }
3217
- } = this.library;
3218
- return /* @__PURE__ */ jsxs(
3219
- Providers,
3220
- {
3221
- authLogo: this.configurations.authLogo,
3222
- components,
3223
- fields,
3224
- customFields: this.customFields,
3225
- localeNames,
3226
- getAdminInjectedComponents: this.getAdminInjectedComponents,
3227
- getPlugin: this.getPlugin,
3228
- messages: this.configurations.translations,
3229
- menu: this.menu,
3230
- menuLogo: this.configurations.menuLogo,
3231
- plugins: this.plugins,
3232
- runHookParallel: this.runHookParallel,
3233
- runHookWaterfall: (name, initialValue, async = false) => {
3234
- return this.runHookWaterfall(name, initialValue, async, store);
3235
- },
3236
- runHookSeries: this.runHookSeries,
3237
- themes: this.configurations.themes,
3238
- settings: this.settings,
3239
- showTutorials: this.configurations.tutorials,
3240
- showReleaseNotification: this.configurations.notifications.releases,
3241
- store,
3242
- children: [
3243
- /* @__PURE__ */ jsx(
3244
- Helmet,
3245
- {
3246
- htmlAttributes: { lang: localStorage.getItem(LANGUAGE_LOCAL_STORAGE_KEY) || "en" }
3247
- }
3248
- ),
3249
- /* @__PURE__ */ jsx(BrowserRouter, { basename: getBasename(), children: /* @__PURE__ */ jsx(App, {}) })
3250
- ]
3251
- }
3252
- );
3253
- }
3254
- }
3255
- const renderAdmin = async (mountNode, { plugins, customisations, features }) => {
3256
- if (!mountNode) {
3257
- throw new Error("[@strapi/admin]: Could not find the root element to mount the admin app");
3258
- }
3259
- window.strapi = {
3260
- /**
3261
- * This ENV variable is passed from the strapi instance, by default no url is set
3262
- * in the config and therefore the instance returns you an empty string so URLs are relative.
3263
- *
3264
- * To ensure that the backendURL is always set, we use the window.location.origin as a fallback.
3265
- */
3266
- backendURL: process.env.STRAPI_ADMIN_BACKEND_URL || window.location.origin,
3267
- isEE: false,
3268
- telemetryDisabled: process.env.STRAPI_TELEMETRY_DISABLED === "true" ? true : false,
3269
- future: {
3270
- isEnabled: (name) => {
3271
- return features?.future?.[name] === true;
3272
- }
3273
- },
3274
- // @ts-expect-error – there's pollution from the global scope of Node.
3275
- features: {
3276
- SSO: "sso",
3277
- AUDIT_LOGS: "audit-logs",
3278
- REVIEW_WORKFLOWS: "review-workflows",
3279
- /**
3280
- * If we don't get the license then we know it's not EE
3281
- * so no feature is enabled.
3282
- */
3283
- isEnabled: () => false
3284
- },
3285
- projectType: "Community",
3286
- flags: {
3287
- nps: false,
3288
- promoteEE: true
3289
- }
3290
- };
3291
- const { get: get2 } = getFetchClient();
3292
- try {
3293
- const {
3294
- data: {
3295
- data: { isEE, features: features2, flags }
3296
- }
3297
- } = await get2("/admin/project-type");
3298
- window.strapi.isEE = isEE;
3299
- window.strapi.flags = flags;
3300
- window.strapi.features = {
3301
- ...window.strapi.features,
3302
- isEnabled: (featureName) => features2.some((feature) => feature.name === featureName)
3303
- };
3304
- window.strapi.projectType = isEE ? "Enterprise" : "Community";
3305
- } catch (err) {
3306
- console.error(err);
3307
- }
3308
- const app = new StrapiApp({
3309
- adminConfig: customisations,
3310
- appPlugins: plugins
3311
- });
3312
- await app.bootstrapAdmin();
3313
- await app.initialize();
3314
- await app.bootstrap();
3315
- await app.loadTrads();
3316
- createRoot(mountNode).render(app.render());
3317
- if (typeof module !== "undefined" && module && "hot" in module && typeof module.hot === "object" && module.hot !== null && "accept" in module.hot && typeof module.hot.accept === "function") {
3318
- module.hot.accept();
3319
- }
3320
- };
3321
- export {
3322
- ACTION_SET_APP_RUNTIME_STATUS as A,
3323
- crudInitialState as B,
3324
- Column as C,
3325
- RESET_INIT_DATA as D,
3326
- GET_INIT_DATA as E,
3327
- SET_INIT_DATA as F,
3328
- GET_DATA as G,
3329
- HOOKS as H,
3330
- INIT_FORM as I,
3331
- initialState$3 as J,
3332
- StrapiLogo as K,
3333
- Login as L,
3334
- useLocales as M,
3335
- NpsSurvey as N,
3336
- ON_RESET_LIST_HEADERS as O,
3337
- useThemeToggle as P,
3338
- SETTINGS_LINKS_CE as Q,
3339
- RBACProvider as R,
3340
- SET_PERMISSIONS as S,
3341
- getBasename as T,
3342
- UnauthenticatedLayout as U,
3343
- useTypedStore as V,
3344
- DefaultDocument as W,
3345
- renderAdmin as X,
3346
- NotFoundPage$1 as Y,
3347
- useTypedDispatch as a,
3348
- useTypedSelector as b,
3349
- createTypedSelector as c,
3350
- createRoute as d,
3351
- LayoutContent as e,
3352
- Logo as f,
3353
- RESET_PERMISSIONS as g,
3354
- RESET_PROPS$2 as h,
3355
- SET_LAYOUT as i,
3356
- RESET_PROPS as j,
3357
- SET_DATA_STRUCTURES as k,
3358
- SET_STATUS as l,
3359
- SUBMIT_SUCCEEDED as m,
3360
- GET_DATA_SUCCEEDED as n,
3361
- CLEAR_SET_MODIFIED_DATA_ONLY as o,
3362
- useEnterprise as p,
3363
- InjectionZone as q,
3364
- GET_DATA$1 as r,
3365
- GET_DATA_SUCCEEDED$1 as s,
3366
- RESET_PROPS$1 as t,
3367
- useConfiguration as u,
3368
- SET_LIST_LAYOUT as v,
3369
- ON_CHANGE_LIST_HEADERS as w,
3370
- useInjectionZone as x,
3371
- initialState$1 as y,
3372
- crudReducer as z
3373
- };
3374
- //# sourceMappingURL=index-8933483b.mjs.map