@strapi/content-manager 0.0.0-experimental.a28002c793bc4de2a8b3c6c5b9c2336c5a6db7a9 → 0.0.0-experimental.a4161dd0ce4a6742074cbfc43734281e14a29baa

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 (431) hide show
  1. package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs +80 -0
  2. package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs.map +1 -0
  3. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js +82 -0
  4. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js.map +1 -0
  5. package/dist/admin/chunks/ComponentConfigurationPage-BdKTyTdt.mjs +276 -0
  6. package/dist/admin/chunks/ComponentConfigurationPage-BdKTyTdt.mjs.map +1 -0
  7. package/dist/admin/chunks/ComponentConfigurationPage-CDKJ1saA.js +298 -0
  8. package/dist/admin/chunks/ComponentConfigurationPage-CDKJ1saA.js.map +1 -0
  9. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs +153 -0
  10. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs.map +1 -0
  11. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js +176 -0
  12. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js.map +1 -0
  13. package/dist/admin/chunks/EditConfigurationPage-BW5fpvkO.js +180 -0
  14. package/dist/admin/chunks/EditConfigurationPage-BW5fpvkO.js.map +1 -0
  15. package/dist/admin/chunks/EditConfigurationPage-CaJ_CmJz.mjs +158 -0
  16. package/dist/admin/chunks/EditConfigurationPage-CaJ_CmJz.mjs.map +1 -0
  17. package/dist/admin/chunks/EditViewPage-BDekCXSy.mjs +315 -0
  18. package/dist/admin/chunks/EditViewPage-BDekCXSy.mjs.map +1 -0
  19. package/dist/admin/chunks/EditViewPage-CNacGhk_.js +338 -0
  20. package/dist/admin/chunks/EditViewPage-CNacGhk_.js.map +1 -0
  21. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs +56 -0
  22. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs.map +1 -0
  23. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js +58 -0
  24. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js.map +1 -0
  25. package/dist/admin/chunks/Form-2LZDIqUE.mjs +955 -0
  26. package/dist/admin/chunks/Form-2LZDIqUE.mjs.map +1 -0
  27. package/dist/admin/chunks/Form-CouVf26p.js +978 -0
  28. package/dist/admin/chunks/Form-CouVf26p.js.map +1 -0
  29. package/dist/admin/chunks/History-B7zZvnQF.mjs +1361 -0
  30. package/dist/admin/chunks/History-B7zZvnQF.mjs.map +1 -0
  31. package/dist/admin/chunks/History-Cv3uNjvV.js +1384 -0
  32. package/dist/admin/chunks/History-Cv3uNjvV.js.map +1 -0
  33. package/dist/admin/chunks/Input-BPTHgeyh.mjs +8671 -0
  34. package/dist/admin/chunks/Input-BPTHgeyh.mjs.map +1 -0
  35. package/dist/admin/chunks/Input-DPH5j7Yl.js +8706 -0
  36. package/dist/admin/chunks/Input-DPH5j7Yl.js.map +1 -0
  37. package/dist/admin/chunks/ListConfigurationPage-Cj1tt01r.js +818 -0
  38. package/dist/admin/chunks/ListConfigurationPage-Cj1tt01r.js.map +1 -0
  39. package/dist/admin/chunks/ListConfigurationPage-FS8YuoKF.mjs +795 -0
  40. package/dist/admin/chunks/ListConfigurationPage-FS8YuoKF.mjs.map +1 -0
  41. package/dist/admin/chunks/ListViewPage-BCmGmK7N.js +1154 -0
  42. package/dist/admin/chunks/ListViewPage-BCmGmK7N.js.map +1 -0
  43. package/dist/admin/chunks/ListViewPage-Xv5mmaJq.mjs +1132 -0
  44. package/dist/admin/chunks/ListViewPage-Xv5mmaJq.mjs.map +1 -0
  45. package/dist/admin/chunks/NoContentTypePage-Bbqw5ZV9.mjs +58 -0
  46. package/dist/admin/chunks/NoContentTypePage-Bbqw5ZV9.mjs.map +1 -0
  47. package/dist/admin/chunks/NoContentTypePage-DpvfQfhU.js +60 -0
  48. package/dist/admin/chunks/NoContentTypePage-DpvfQfhU.js.map +1 -0
  49. package/dist/admin/chunks/NoPermissionsPage-BYEkhBnk.js +39 -0
  50. package/dist/admin/chunks/NoPermissionsPage-BYEkhBnk.js.map +1 -0
  51. package/dist/admin/chunks/NoPermissionsPage-igrvpcW0.mjs +37 -0
  52. package/dist/admin/chunks/NoPermissionsPage-igrvpcW0.mjs.map +1 -0
  53. package/dist/admin/chunks/Preview-DR-9uYxZ.mjs +673 -0
  54. package/dist/admin/chunks/Preview-DR-9uYxZ.mjs.map +1 -0
  55. package/dist/admin/chunks/Preview-DlRltQbE.js +695 -0
  56. package/dist/admin/chunks/Preview-DlRltQbE.js.map +1 -0
  57. package/dist/admin/chunks/ar-DckYq_WK.mjs +222 -0
  58. package/dist/{_chunks/ar-CCEVvqGG.mjs.map → admin/chunks/ar-DckYq_WK.mjs.map} +1 -1
  59. package/dist/admin/chunks/ar-DeQBSsfl.js +227 -0
  60. package/dist/{_chunks/ru-BT3ybNny.js.map → admin/chunks/ar-DeQBSsfl.js.map} +1 -1
  61. package/dist/admin/chunks/ca-ClDTvatJ.js +202 -0
  62. package/dist/admin/chunks/ca-ClDTvatJ.js.map +1 -0
  63. package/dist/admin/chunks/ca-DviY7mRj.mjs +197 -0
  64. package/dist/admin/chunks/ca-DviY7mRj.mjs.map +1 -0
  65. package/dist/admin/chunks/cs-BJFxwIWj.js +126 -0
  66. package/dist/{_chunks/cs-CkJy6B2v.js.map → admin/chunks/cs-BJFxwIWj.js.map} +1 -1
  67. package/dist/admin/chunks/cs-C7OSYFQ7.mjs +122 -0
  68. package/dist/{_chunks/cs-CM2aBUar.mjs.map → admin/chunks/cs-C7OSYFQ7.mjs.map} +1 -1
  69. package/dist/admin/chunks/de-5QRlDHyR.mjs +195 -0
  70. package/dist/{_chunks/eu-CdALomew.mjs.map → admin/chunks/de-5QRlDHyR.mjs.map} +1 -1
  71. package/dist/admin/chunks/de-CbImAUA5.js +200 -0
  72. package/dist/{_chunks/gu-BRmF601H.js.map → admin/chunks/de-CbImAUA5.js.map} +1 -1
  73. package/dist/admin/chunks/en-CH__IC8g.js +316 -0
  74. package/dist/{_chunks/en-BzQmavmK.js.map → admin/chunks/en-CH__IC8g.js.map} +1 -1
  75. package/dist/admin/chunks/en-DBP0Gaid.mjs +311 -0
  76. package/dist/{_chunks/en-CSxLmrh1.mjs.map → admin/chunks/en-DBP0Gaid.mjs.map} +1 -1
  77. package/dist/admin/chunks/es-C8vLuvZL.js +197 -0
  78. package/dist/{_chunks/es-9K52xZIr.js.map → admin/chunks/es-C8vLuvZL.js.map} +1 -1
  79. package/dist/admin/chunks/es-DkoWSExG.mjs +192 -0
  80. package/dist/{_chunks/ja-BHqhDq4V.mjs.map → admin/chunks/es-DkoWSExG.mjs.map} +1 -1
  81. package/dist/admin/chunks/eu-BG1xX7HK.mjs +198 -0
  82. package/dist/admin/chunks/eu-BG1xX7HK.mjs.map +1 -0
  83. package/dist/admin/chunks/eu-BJW3AvXu.js +203 -0
  84. package/dist/admin/chunks/eu-BJW3AvXu.js.map +1 -0
  85. package/dist/admin/chunks/fr-CFdRaRVj.mjs +215 -0
  86. package/dist/admin/chunks/fr-CFdRaRVj.mjs.map +1 -0
  87. package/dist/admin/chunks/fr-gQSilC7w.js +220 -0
  88. package/dist/admin/chunks/fr-gQSilC7w.js.map +1 -0
  89. package/dist/admin/chunks/gu-D5MMMXRs.mjs +196 -0
  90. package/dist/admin/chunks/gu-D5MMMXRs.mjs.map +1 -0
  91. package/dist/admin/chunks/gu-DPU4wyx7.js +201 -0
  92. package/dist/{_chunks/eu-VDH-3ovk.js.map → admin/chunks/gu-DPU4wyx7.js.map} +1 -1
  93. package/dist/admin/chunks/hi-Dp4omeBb.js +201 -0
  94. package/dist/admin/chunks/hi-Dp4omeBb.js.map +1 -0
  95. package/dist/admin/chunks/hi-lp17SCjr.mjs +196 -0
  96. package/dist/admin/chunks/hi-lp17SCjr.mjs.map +1 -0
  97. package/dist/{_chunks/hooks-BAaaKPS_.js → admin/chunks/hooks-D-sOYd1s.js} +6 -3
  98. package/dist/admin/chunks/hooks-D-sOYd1s.js.map +1 -0
  99. package/dist/admin/chunks/hooks-DMvik5y_.mjs +7 -0
  100. package/dist/admin/chunks/hooks-DMvik5y_.mjs.map +1 -0
  101. package/dist/admin/chunks/hu-CLka1U2C.mjs +198 -0
  102. package/dist/admin/chunks/hu-CLka1U2C.mjs.map +1 -0
  103. package/dist/admin/chunks/hu-CtFJuhTd.js +203 -0
  104. package/dist/admin/chunks/hu-CtFJuhTd.js.map +1 -0
  105. package/dist/admin/chunks/id-D7V5S1rB.js +161 -0
  106. package/dist/{_chunks/it-DkBIs7vD.js.map → admin/chunks/id-D7V5S1rB.js.map} +1 -1
  107. package/dist/admin/chunks/id-USfY9m1g.mjs +156 -0
  108. package/dist/{_chunks/id-BtwA9WJT.mjs.map → admin/chunks/id-USfY9m1g.mjs.map} +1 -1
  109. package/dist/admin/chunks/index-CISU19oJ.js +5450 -0
  110. package/dist/admin/chunks/index-CISU19oJ.js.map +1 -0
  111. package/dist/admin/chunks/index-C_e5v8f7.mjs +5383 -0
  112. package/dist/admin/chunks/index-C_e5v8f7.mjs.map +1 -0
  113. package/dist/admin/chunks/it-BAHrwmYS.mjs +158 -0
  114. package/dist/{_chunks/it-BrVPqaf1.mjs.map → admin/chunks/it-BAHrwmYS.mjs.map} +1 -1
  115. package/dist/admin/chunks/it-CQFpa_Dc.js +163 -0
  116. package/dist/{_chunks/ko-woFZPmLk.js.map → admin/chunks/it-CQFpa_Dc.js.map} +1 -1
  117. package/dist/admin/chunks/ja-BWKmBJFT.mjs +192 -0
  118. package/dist/{_chunks/ko-HVQRlfUI.mjs.map → admin/chunks/ja-BWKmBJFT.mjs.map} +1 -1
  119. package/dist/admin/chunks/ja-jdQM-B79.js +197 -0
  120. package/dist/{_chunks/de-CCEmbAah.js.map → admin/chunks/ja-jdQM-B79.js.map} +1 -1
  121. package/dist/admin/chunks/ko-CgADGBNt.mjs +191 -0
  122. package/dist/{_chunks/es-D34tqjMw.mjs.map → admin/chunks/ko-CgADGBNt.mjs.map} +1 -1
  123. package/dist/admin/chunks/ko-k46sEyzt.js +196 -0
  124. package/dist/{_chunks/ja-7sfIbjxE.js.map → admin/chunks/ko-k46sEyzt.js.map} +1 -1
  125. package/dist/admin/chunks/layout-CajJum-G.js +692 -0
  126. package/dist/admin/chunks/layout-CajJum-G.js.map +1 -0
  127. package/dist/admin/chunks/layout-CrqscUTi.mjs +672 -0
  128. package/dist/admin/chunks/layout-CrqscUTi.mjs.map +1 -0
  129. package/dist/admin/chunks/ml-CnhCfOn_.mjs +196 -0
  130. package/dist/admin/chunks/ml-CnhCfOn_.mjs.map +1 -0
  131. package/dist/admin/chunks/ml-DqxPwODx.js +201 -0
  132. package/dist/admin/chunks/ml-DqxPwODx.js.map +1 -0
  133. package/dist/admin/chunks/ms-Bh09NFff.mjs +140 -0
  134. package/dist/{_chunks/ms-m_WjyWx7.mjs.map → admin/chunks/ms-Bh09NFff.mjs.map} +1 -1
  135. package/dist/admin/chunks/ms-CvSC0OdG.js +145 -0
  136. package/dist/{_chunks/ms-BuFotyP_.js.map → admin/chunks/ms-CvSC0OdG.js.map} +1 -1
  137. package/dist/admin/chunks/nl-BEubhS8C.js +203 -0
  138. package/dist/admin/chunks/nl-BEubhS8C.js.map +1 -0
  139. package/dist/admin/chunks/nl-C8HYflTc.mjs +198 -0
  140. package/dist/admin/chunks/nl-C8HYflTc.mjs.map +1 -0
  141. package/dist/admin/chunks/objects-BJTP843m.js +343 -0
  142. package/dist/admin/chunks/objects-BJTP843m.js.map +1 -0
  143. package/dist/admin/chunks/objects-D2z-IJgu.mjs +317 -0
  144. package/dist/admin/chunks/objects-D2z-IJgu.mjs.map +1 -0
  145. package/dist/admin/chunks/pl-DWhGDzmM.js +200 -0
  146. package/dist/{_chunks/ca-Cmk45QO6.js.map → admin/chunks/pl-DWhGDzmM.js.map} +1 -1
  147. package/dist/admin/chunks/pl-MFCZJZuZ.mjs +195 -0
  148. package/dist/{_chunks/ca-5U32ON2v.mjs.map → admin/chunks/pl-MFCZJZuZ.mjs.map} +1 -1
  149. package/dist/admin/chunks/pt-BR-CPtAXD-4.js +202 -0
  150. package/dist/{_chunks/pt-BR-BiOz37D9.js.map → admin/chunks/pt-BR-CPtAXD-4.js.map} +1 -1
  151. package/dist/admin/chunks/pt-BR-CcotyBGJ.mjs +197 -0
  152. package/dist/{_chunks/pt-BR-C71iDxnh.mjs.map → admin/chunks/pt-BR-CcotyBGJ.mjs.map} +1 -1
  153. package/dist/admin/chunks/pt-BoPxN80n.js +96 -0
  154. package/dist/admin/chunks/pt-BoPxN80n.js.map +1 -0
  155. package/dist/admin/chunks/pt-HbmgeiYO.mjs +93 -0
  156. package/dist/admin/chunks/pt-HbmgeiYO.mjs.map +1 -0
  157. package/dist/admin/chunks/ru-C0op0ALG.js +232 -0
  158. package/dist/admin/chunks/ru-C0op0ALG.js.map +1 -0
  159. package/dist/admin/chunks/ru-CB4BUyQp.mjs +230 -0
  160. package/dist/{_chunks/ru-BE6A4Exp.mjs.map → admin/chunks/ru-CB4BUyQp.mjs.map} +1 -1
  161. package/dist/admin/chunks/sa-B_FuPyMw.js +201 -0
  162. package/dist/admin/chunks/sa-B_FuPyMw.js.map +1 -0
  163. package/dist/admin/chunks/sa-n_aPA-pU.mjs +196 -0
  164. package/dist/admin/chunks/sa-n_aPA-pU.mjs.map +1 -0
  165. package/dist/admin/chunks/sk-D_iXML2C.js +203 -0
  166. package/dist/admin/chunks/sk-D_iXML2C.js.map +1 -0
  167. package/dist/admin/chunks/sk-tn_BDjE2.mjs +198 -0
  168. package/dist/admin/chunks/sk-tn_BDjE2.mjs.map +1 -0
  169. package/dist/admin/chunks/sv-BstBC1Yp.js +203 -0
  170. package/dist/admin/chunks/sv-BstBC1Yp.js.map +1 -0
  171. package/dist/admin/chunks/sv-cq4ZrQRd.mjs +198 -0
  172. package/dist/admin/chunks/sv-cq4ZrQRd.mjs.map +1 -0
  173. package/dist/admin/chunks/th-lXoOCqPC.js +149 -0
  174. package/dist/{_chunks/th-D9_GfAjc.js.map → admin/chunks/th-lXoOCqPC.js.map} +1 -1
  175. package/dist/admin/chunks/th-mUH7hEtc.mjs +144 -0
  176. package/dist/{_chunks/th-BqbI8lIT.mjs.map → admin/chunks/th-mUH7hEtc.mjs.map} +1 -1
  177. package/dist/admin/chunks/tr-CkS6sLIE.js +200 -0
  178. package/dist/admin/chunks/tr-CkS6sLIE.js.map +1 -0
  179. package/dist/admin/chunks/tr-Yt38daxh.mjs +195 -0
  180. package/dist/{_chunks/de-C72KDNOl.mjs.map → admin/chunks/tr-Yt38daxh.mjs.map} +1 -1
  181. package/dist/admin/chunks/uk-B24MoTVg.js +145 -0
  182. package/dist/{_chunks/uk-C8EiqJY7.js.map → admin/chunks/uk-B24MoTVg.js.map} +1 -1
  183. package/dist/admin/chunks/uk-Cpgmm7gE.mjs +140 -0
  184. package/dist/{_chunks/uk-CR-zDhAY.mjs.map → admin/chunks/uk-Cpgmm7gE.mjs.map} +1 -1
  185. package/dist/admin/chunks/usePrev-CHotxABl.js +194 -0
  186. package/dist/admin/chunks/usePrev-CHotxABl.js.map +1 -0
  187. package/dist/admin/chunks/usePrev-DF3ZO0z4.mjs +187 -0
  188. package/dist/admin/chunks/usePrev-DF3ZO0z4.mjs.map +1 -0
  189. package/dist/admin/chunks/vi-BGr1X_HZ.js +112 -0
  190. package/dist/{_chunks/vi-CJlYDheJ.js.map → admin/chunks/vi-BGr1X_HZ.js.map} +1 -1
  191. package/dist/admin/chunks/vi-CvBGlTjr.mjs +108 -0
  192. package/dist/{_chunks/vi-DUXIk_fw.mjs.map → admin/chunks/vi-CvBGlTjr.mjs.map} +1 -1
  193. package/dist/admin/chunks/zh-BmF-sHaT.mjs +205 -0
  194. package/dist/admin/chunks/zh-BmF-sHaT.mjs.map +1 -0
  195. package/dist/admin/chunks/zh-DwFu_Kfj.js +210 -0
  196. package/dist/admin/chunks/zh-DwFu_Kfj.js.map +1 -0
  197. package/dist/admin/chunks/zh-Hans-CI0HKio3.mjs +934 -0
  198. package/dist/{_chunks/zh-Hans-BPQcRIyH.mjs.map → admin/chunks/zh-Hans-CI0HKio3.mjs.map} +1 -1
  199. package/dist/admin/chunks/zh-Hans-JVK9x7xr.js +953 -0
  200. package/dist/{_chunks/zh-Hans-9kOncHGw.js.map → admin/chunks/zh-Hans-JVK9x7xr.js.map} +1 -1
  201. package/dist/admin/index.js +24 -4
  202. package/dist/admin/index.js.map +1 -1
  203. package/dist/admin/index.mjs +17 -13
  204. package/dist/admin/index.mjs.map +1 -1
  205. package/dist/admin/src/components/InjectionZone.d.ts +7 -1
  206. package/dist/admin/src/content-manager.d.ts +3 -0
  207. package/dist/admin/src/features/DocumentContext.d.ts +42 -0
  208. package/dist/admin/src/features/DocumentRBAC.d.ts +3 -2
  209. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  210. package/dist/admin/src/hooks/useDocument.d.ts +21 -4
  211. package/dist/admin/src/hooks/useDocumentActions.d.ts +1 -0
  212. package/dist/admin/src/index.d.ts +1 -0
  213. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +2 -1
  214. package/dist/admin/src/pages/EditView/components/EditorToolbarObserver.d.ts +11 -0
  215. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +49 -1
  216. package/dist/admin/src/pages/EditView/components/FormInputs/Relations/RelationModal.d.ts +10 -0
  217. package/dist/admin/src/pages/EditView/components/FormInputs/{Relations.d.ts → Relations/Relations.d.ts} +10 -3
  218. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.d.ts +1 -2
  219. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +32 -1
  220. package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +3 -3
  221. package/dist/admin/src/pages/EditView/utils/data.d.ts +1 -0
  222. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -1
  223. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -1
  224. package/dist/admin/src/preview/index.d.ts +2 -3
  225. package/dist/admin/src/preview/pages/Preview.d.ts +3 -1
  226. package/dist/server/index.js +5459 -4387
  227. package/dist/server/index.js.map +1 -1
  228. package/dist/server/index.mjs +5446 -4372
  229. package/dist/server/index.mjs.map +1 -1
  230. package/dist/server/src/controllers/utils/metadata.d.ts +1 -1
  231. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  232. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  233. package/dist/server/src/services/utils/count.d.ts +1 -1
  234. package/dist/server/src/services/utils/count.d.ts.map +1 -1
  235. package/dist/server/src/services/utils/populate.d.ts +1 -1
  236. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  237. package/dist/shared/contracts/collection-types.d.ts +0 -1
  238. package/dist/shared/contracts/components.d.ts +0 -1
  239. package/dist/shared/contracts/content-types.d.ts +0 -1
  240. package/dist/shared/contracts/history-versions.d.ts +0 -1
  241. package/dist/shared/contracts/index.d.ts +0 -1
  242. package/dist/shared/contracts/init.d.ts +0 -1
  243. package/dist/shared/contracts/preview.d.ts +0 -1
  244. package/dist/shared/contracts/relations.d.ts +1 -2
  245. package/dist/shared/contracts/relations.d.ts.map +1 -1
  246. package/dist/shared/contracts/review-workflows.d.ts +0 -1
  247. package/dist/shared/contracts/single-types.d.ts +0 -1
  248. package/dist/shared/contracts/uid.d.ts +0 -1
  249. package/dist/shared/index.d.ts +0 -1
  250. package/dist/shared/index.js +35 -24
  251. package/dist/shared/index.js.map +1 -1
  252. package/dist/shared/index.mjs +34 -25
  253. package/dist/shared/index.mjs.map +1 -1
  254. package/package.json +15 -12
  255. package/dist/_chunks/CardDragPreview-C0QyJgRA.js +0 -69
  256. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +0 -1
  257. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs +0 -70
  258. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +0 -1
  259. package/dist/_chunks/ComponentConfigurationPage-DquE3cSt.js +0 -254
  260. package/dist/_chunks/ComponentConfigurationPage-DquE3cSt.js.map +0 -1
  261. package/dist/_chunks/ComponentConfigurationPage-xgUutqCq.mjs +0 -236
  262. package/dist/_chunks/ComponentConfigurationPage-xgUutqCq.mjs.map +0 -1
  263. package/dist/_chunks/ComponentIcon-CRbtQEUV.js +0 -175
  264. package/dist/_chunks/ComponentIcon-CRbtQEUV.js.map +0 -1
  265. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs +0 -157
  266. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +0 -1
  267. package/dist/_chunks/EditConfigurationPage-BxxS_VjE.mjs +0 -132
  268. package/dist/_chunks/EditConfigurationPage-BxxS_VjE.mjs.map +0 -1
  269. package/dist/_chunks/EditConfigurationPage-DBZcYu4y.js +0 -150
  270. package/dist/_chunks/EditConfigurationPage-DBZcYu4y.js.map +0 -1
  271. package/dist/_chunks/EditViewPage-CxbLxtSZ.mjs +0 -254
  272. package/dist/_chunks/EditViewPage-CxbLxtSZ.mjs.map +0 -1
  273. package/dist/_chunks/EditViewPage-eVQAzqrX.js +0 -272
  274. package/dist/_chunks/EditViewPage-eVQAzqrX.js.map +0 -1
  275. package/dist/_chunks/Field-B1V9AyU1.js +0 -5655
  276. package/dist/_chunks/Field-B1V9AyU1.js.map +0 -1
  277. package/dist/_chunks/Field-CZwQcrmw.mjs +0 -5623
  278. package/dist/_chunks/Field-CZwQcrmw.mjs.map +0 -1
  279. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +0 -50
  280. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +0 -1
  281. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +0 -49
  282. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +0 -1
  283. package/dist/_chunks/Form-3kEYdc-J.mjs +0 -758
  284. package/dist/_chunks/Form-3kEYdc-J.mjs.map +0 -1
  285. package/dist/_chunks/Form-DDb5-H01.js +0 -778
  286. package/dist/_chunks/Form-DDb5-H01.js.map +0 -1
  287. package/dist/_chunks/History-COpTRR4s.js +0 -1019
  288. package/dist/_chunks/History-COpTRR4s.js.map +0 -1
  289. package/dist/_chunks/History-DXZrV891.mjs +0 -999
  290. package/dist/_chunks/History-DXZrV891.mjs.map +0 -1
  291. package/dist/_chunks/ListConfigurationPage-B1BlI0vS.mjs +0 -633
  292. package/dist/_chunks/ListConfigurationPage-B1BlI0vS.mjs.map +0 -1
  293. package/dist/_chunks/ListConfigurationPage-D5zn8EA8.js +0 -652
  294. package/dist/_chunks/ListConfigurationPage-D5zn8EA8.js.map +0 -1
  295. package/dist/_chunks/ListViewPage-CfHJAt9S.mjs +0 -851
  296. package/dist/_chunks/ListViewPage-CfHJAt9S.mjs.map +0 -1
  297. package/dist/_chunks/ListViewPage-OqGWxoXp.js +0 -874
  298. package/dist/_chunks/ListViewPage-OqGWxoXp.js.map +0 -1
  299. package/dist/_chunks/NoContentTypePage-B1vde0d2.mjs +0 -51
  300. package/dist/_chunks/NoContentTypePage-B1vde0d2.mjs.map +0 -1
  301. package/dist/_chunks/NoContentTypePage-BwuxzVhz.js +0 -51
  302. package/dist/_chunks/NoContentTypePage-BwuxzVhz.js.map +0 -1
  303. package/dist/_chunks/NoPermissionsPage-BZx6YZ0-.mjs +0 -23
  304. package/dist/_chunks/NoPermissionsPage-BZx6YZ0-.mjs.map +0 -1
  305. package/dist/_chunks/NoPermissionsPage-CM4q9eyp.js +0 -23
  306. package/dist/_chunks/NoPermissionsPage-CM4q9eyp.js.map +0 -1
  307. package/dist/_chunks/Preview-DZWvwEHg.js +0 -312
  308. package/dist/_chunks/Preview-DZWvwEHg.js.map +0 -1
  309. package/dist/_chunks/Preview-DeD_aLg6.mjs +0 -294
  310. package/dist/_chunks/Preview-DeD_aLg6.mjs.map +0 -1
  311. package/dist/_chunks/Relations-DXVAOSqj.js +0 -747
  312. package/dist/_chunks/Relations-DXVAOSqj.js.map +0 -1
  313. package/dist/_chunks/Relations-i1BqMPqp.mjs +0 -728
  314. package/dist/_chunks/Relations-i1BqMPqp.mjs.map +0 -1
  315. package/dist/_chunks/ar-BUUWXIYu.js +0 -226
  316. package/dist/_chunks/ar-BUUWXIYu.js.map +0 -1
  317. package/dist/_chunks/ar-CCEVvqGG.mjs +0 -226
  318. package/dist/_chunks/ca-5U32ON2v.mjs +0 -201
  319. package/dist/_chunks/ca-Cmk45QO6.js +0 -201
  320. package/dist/_chunks/cs-CM2aBUar.mjs +0 -125
  321. package/dist/_chunks/cs-CkJy6B2v.js +0 -125
  322. package/dist/_chunks/de-C72KDNOl.mjs +0 -199
  323. package/dist/_chunks/de-CCEmbAah.js +0 -199
  324. package/dist/_chunks/en-BzQmavmK.js +0 -310
  325. package/dist/_chunks/en-CSxLmrh1.mjs +0 -310
  326. package/dist/_chunks/es-9K52xZIr.js +0 -196
  327. package/dist/_chunks/es-D34tqjMw.mjs +0 -196
  328. package/dist/_chunks/eu-CdALomew.mjs +0 -202
  329. package/dist/_chunks/eu-VDH-3ovk.js +0 -202
  330. package/dist/_chunks/fr--pg5jUbt.mjs +0 -216
  331. package/dist/_chunks/fr--pg5jUbt.mjs.map +0 -1
  332. package/dist/_chunks/fr-B2Kyv8Z9.js +0 -216
  333. package/dist/_chunks/fr-B2Kyv8Z9.js.map +0 -1
  334. package/dist/_chunks/gu-BRmF601H.js +0 -200
  335. package/dist/_chunks/gu-CNpaMDpH.mjs +0 -200
  336. package/dist/_chunks/gu-CNpaMDpH.mjs.map +0 -1
  337. package/dist/_chunks/hi-CCJBptSq.js +0 -200
  338. package/dist/_chunks/hi-CCJBptSq.js.map +0 -1
  339. package/dist/_chunks/hi-Dwvd04m3.mjs +0 -200
  340. package/dist/_chunks/hi-Dwvd04m3.mjs.map +0 -1
  341. package/dist/_chunks/hooks-BAaaKPS_.js.map +0 -1
  342. package/dist/_chunks/hooks-E5u1mcgM.mjs +0 -8
  343. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +0 -1
  344. package/dist/_chunks/hu-CeYvaaO0.mjs +0 -202
  345. package/dist/_chunks/hu-CeYvaaO0.mjs.map +0 -1
  346. package/dist/_chunks/hu-sNV_yLYy.js +0 -202
  347. package/dist/_chunks/hu-sNV_yLYy.js.map +0 -1
  348. package/dist/_chunks/id-B5Ser98A.js +0 -160
  349. package/dist/_chunks/id-B5Ser98A.js.map +0 -1
  350. package/dist/_chunks/id-BtwA9WJT.mjs +0 -160
  351. package/dist/_chunks/index-D9vDl-4J.js +0 -4303
  352. package/dist/_chunks/index-D9vDl-4J.js.map +0 -1
  353. package/dist/_chunks/index-Rej95OkL.mjs +0 -4284
  354. package/dist/_chunks/index-Rej95OkL.mjs.map +0 -1
  355. package/dist/_chunks/it-BrVPqaf1.mjs +0 -162
  356. package/dist/_chunks/it-DkBIs7vD.js +0 -162
  357. package/dist/_chunks/ja-7sfIbjxE.js +0 -196
  358. package/dist/_chunks/ja-BHqhDq4V.mjs +0 -196
  359. package/dist/_chunks/ko-HVQRlfUI.mjs +0 -195
  360. package/dist/_chunks/ko-woFZPmLk.js +0 -195
  361. package/dist/_chunks/layout-B4X3h5C4.js +0 -488
  362. package/dist/_chunks/layout-B4X3h5C4.js.map +0 -1
  363. package/dist/_chunks/layout-CKw8rE38.mjs +0 -471
  364. package/dist/_chunks/layout-CKw8rE38.mjs.map +0 -1
  365. package/dist/_chunks/ml-BihZwQit.mjs +0 -200
  366. package/dist/_chunks/ml-BihZwQit.mjs.map +0 -1
  367. package/dist/_chunks/ml-C2W8N8k1.js +0 -200
  368. package/dist/_chunks/ml-C2W8N8k1.js.map +0 -1
  369. package/dist/_chunks/ms-BuFotyP_.js +0 -144
  370. package/dist/_chunks/ms-m_WjyWx7.mjs +0 -144
  371. package/dist/_chunks/nl-D4R9gHx5.mjs +0 -202
  372. package/dist/_chunks/nl-D4R9gHx5.mjs.map +0 -1
  373. package/dist/_chunks/nl-bbEOHChV.js +0 -202
  374. package/dist/_chunks/nl-bbEOHChV.js.map +0 -1
  375. package/dist/_chunks/objects-BcXOv6_9.js +0 -47
  376. package/dist/_chunks/objects-BcXOv6_9.js.map +0 -1
  377. package/dist/_chunks/objects-D6yBsdmx.mjs +0 -45
  378. package/dist/_chunks/objects-D6yBsdmx.mjs.map +0 -1
  379. package/dist/_chunks/pl-sbx9mSt_.mjs +0 -199
  380. package/dist/_chunks/pl-sbx9mSt_.mjs.map +0 -1
  381. package/dist/_chunks/pl-uzwG-hk7.js +0 -199
  382. package/dist/_chunks/pl-uzwG-hk7.js.map +0 -1
  383. package/dist/_chunks/pt-BR-BiOz37D9.js +0 -201
  384. package/dist/_chunks/pt-BR-C71iDxnh.mjs +0 -201
  385. package/dist/_chunks/pt-BsaFvS8-.mjs +0 -95
  386. package/dist/_chunks/pt-BsaFvS8-.mjs.map +0 -1
  387. package/dist/_chunks/pt-CeXQuq50.js +0 -95
  388. package/dist/_chunks/pt-CeXQuq50.js.map +0 -1
  389. package/dist/_chunks/relations-CvZ0Uu8l.js +0 -133
  390. package/dist/_chunks/relations-CvZ0Uu8l.js.map +0 -1
  391. package/dist/_chunks/relations-GpHbwwdj.mjs +0 -134
  392. package/dist/_chunks/relations-GpHbwwdj.mjs.map +0 -1
  393. package/dist/_chunks/ru-BE6A4Exp.mjs +0 -231
  394. package/dist/_chunks/ru-BT3ybNny.js +0 -231
  395. package/dist/_chunks/sa-CcvkYInH.js +0 -200
  396. package/dist/_chunks/sa-CcvkYInH.js.map +0 -1
  397. package/dist/_chunks/sa-Dag0k-Z8.mjs +0 -200
  398. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +0 -1
  399. package/dist/_chunks/sk-BFg-R8qJ.mjs +0 -202
  400. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +0 -1
  401. package/dist/_chunks/sk-CvY09Xjv.js +0 -202
  402. package/dist/_chunks/sk-CvY09Xjv.js.map +0 -1
  403. package/dist/_chunks/sv-CUnfWGsh.mjs +0 -202
  404. package/dist/_chunks/sv-CUnfWGsh.mjs.map +0 -1
  405. package/dist/_chunks/sv-MYDuzgvT.js +0 -202
  406. package/dist/_chunks/sv-MYDuzgvT.js.map +0 -1
  407. package/dist/_chunks/th-BqbI8lIT.mjs +0 -148
  408. package/dist/_chunks/th-D9_GfAjc.js +0 -148
  409. package/dist/_chunks/tr-CgeK3wJM.mjs +0 -199
  410. package/dist/_chunks/tr-CgeK3wJM.mjs.map +0 -1
  411. package/dist/_chunks/tr-D9UH-O_R.js +0 -199
  412. package/dist/_chunks/tr-D9UH-O_R.js.map +0 -1
  413. package/dist/_chunks/uk-C8EiqJY7.js +0 -144
  414. package/dist/_chunks/uk-CR-zDhAY.mjs +0 -144
  415. package/dist/_chunks/useDebounce-CtcjDB3L.js +0 -28
  416. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +0 -1
  417. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +0 -29
  418. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +0 -1
  419. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js +0 -245
  420. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js.map +0 -1
  421. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs +0 -228
  422. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs.map +0 -1
  423. package/dist/_chunks/vi-CJlYDheJ.js +0 -111
  424. package/dist/_chunks/vi-DUXIk_fw.mjs +0 -111
  425. package/dist/_chunks/zh-BWZspA60.mjs +0 -209
  426. package/dist/_chunks/zh-BWZspA60.mjs.map +0 -1
  427. package/dist/_chunks/zh-CQQfszqR.js +0 -209
  428. package/dist/_chunks/zh-CQQfszqR.js.map +0 -1
  429. package/dist/_chunks/zh-Hans-9kOncHGw.js +0 -952
  430. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +0 -952
  431. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +0 -49
@@ -0,0 +1,1384 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var strapiAdmin = require('@strapi/admin/strapi-admin');
6
+ var designSystem = require('@strapi/design-system');
7
+ var qs = require('qs');
8
+ var reactIntl = require('react-intl');
9
+ var reactRouterDom = require('react-router-dom');
10
+ var index = require('./index-CISU19oJ.js');
11
+ var Input = require('./Input-DPH5j7Yl.js');
12
+ var pipe = require('lodash/fp/pipe');
13
+ var hooks = require('./hooks-D-sOYd1s.js');
14
+ var Icons = require('@strapi/icons');
15
+ var styledComponents = require('styled-components');
16
+ var usePrev = require('./usePrev-CHotxABl.js');
17
+ require('lodash/fp/mapValues');
18
+ require('yup');
19
+ require('fractional-indexing');
20
+ require('date-fns');
21
+ require('@reduxjs/toolkit');
22
+ require('prismjs');
23
+ require('slate');
24
+ require('slate-history');
25
+ require('slate-react');
26
+ require('prismjs/themes/prism-solarizedlight.css');
27
+ require('prismjs/components/prism-asmatmel');
28
+ require('prismjs/components/prism-bash');
29
+ require('prismjs/components/prism-basic');
30
+ require('prismjs/components/prism-c');
31
+ require('prismjs/components/prism-clojure');
32
+ require('prismjs/components/prism-cobol');
33
+ require('prismjs/components/prism-cpp');
34
+ require('prismjs/components/prism-csharp');
35
+ require('prismjs/components/prism-dart');
36
+ require('prismjs/components/prism-docker');
37
+ require('prismjs/components/prism-elixir');
38
+ require('prismjs/components/prism-erlang');
39
+ require('prismjs/components/prism-fortran');
40
+ require('prismjs/components/prism-fsharp');
41
+ require('prismjs/components/prism-go');
42
+ require('prismjs/components/prism-graphql');
43
+ require('prismjs/components/prism-groovy');
44
+ require('prismjs/components/prism-haskell');
45
+ require('prismjs/components/prism-haxe');
46
+ require('prismjs/components/prism-ini');
47
+ require('prismjs/components/prism-java');
48
+ require('prismjs/components/prism-javascript');
49
+ require('prismjs/components/prism-jsx');
50
+ require('prismjs/components/prism-json');
51
+ require('prismjs/components/prism-julia');
52
+ require('prismjs/components/prism-kotlin');
53
+ require('prismjs/components/prism-latex');
54
+ require('prismjs/components/prism-lua');
55
+ require('prismjs/components/prism-markdown');
56
+ require('prismjs/components/prism-matlab');
57
+ require('prismjs/components/prism-makefile');
58
+ require('prismjs/components/prism-objectivec');
59
+ require('prismjs/components/prism-perl');
60
+ require('prismjs/components/prism-php');
61
+ require('prismjs/components/prism-powershell');
62
+ require('prismjs/components/prism-python');
63
+ require('prismjs/components/prism-r');
64
+ require('prismjs/components/prism-ruby');
65
+ require('prismjs/components/prism-rust');
66
+ require('prismjs/components/prism-sas');
67
+ require('prismjs/components/prism-scala');
68
+ require('prismjs/components/prism-scheme');
69
+ require('prismjs/components/prism-sql');
70
+ require('prismjs/components/prism-stata');
71
+ require('prismjs/components/prism-swift');
72
+ require('prismjs/components/prism-typescript');
73
+ require('prismjs/components/prism-tsx');
74
+ require('prismjs/components/prism-vbnet');
75
+ require('prismjs/components/prism-yaml');
76
+ require('./objects-BJTP843m.js');
77
+ require('react-dnd');
78
+ require('lodash/clone');
79
+ require('lodash/toPath');
80
+ require('@radix-ui/react-toolbar');
81
+ require('react-dnd-html5-backend');
82
+ require('./ComponentIcon-C-EjOUPA.js');
83
+ require('@strapi/icons/symbols');
84
+ require('react-window');
85
+ require('codemirror5');
86
+ require('sanitize-html');
87
+ require('highlight.js');
88
+ require('markdown-it');
89
+ require('markdown-it-abbr');
90
+ require('markdown-it-container');
91
+ require('markdown-it-deflist');
92
+ require('markdown-it-emoji');
93
+ require('markdown-it-footnote');
94
+ require('markdown-it-ins');
95
+ require('markdown-it-mark');
96
+ require('markdown-it-sub');
97
+ require('markdown-it-sup');
98
+ require('highlight.js/styles/solarized-dark.css');
99
+ require('codemirror5/addon/display/placeholder');
100
+ require('react-redux');
101
+
102
+ function _interopNamespaceDefault(e) {
103
+ var n = Object.create(null);
104
+ if (e) {
105
+ Object.keys(e).forEach(function (k) {
106
+ if (k !== 'default') {
107
+ var d = Object.getOwnPropertyDescriptor(e, k);
108
+ Object.defineProperty(n, k, d.get ? d : {
109
+ enumerable: true,
110
+ get: function () { return e[k]; }
111
+ });
112
+ }
113
+ });
114
+ }
115
+ n.default = e;
116
+ return Object.freeze(n);
117
+ }
118
+
119
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
120
+
121
+ const StyledAlert = styledComponents.styled(designSystem.Alert).attrs({
122
+ closeLabel: 'Close',
123
+ onClose: ()=>{},
124
+ shadow: 'none'
125
+ })`
126
+ button {
127
+ display: none;
128
+ }
129
+ `;
130
+ /* -------------------------------------------------------------------------------------------------
131
+ * CustomRelationInput
132
+ * -----------------------------------------------------------------------------------------------*/ const LinkEllipsis = styledComponents.styled(designSystem.Link)`
133
+ display: block;
134
+
135
+ & > span {
136
+ white-space: nowrap;
137
+ overflow: hidden;
138
+ text-overflow: ellipsis;
139
+ display: block;
140
+ }
141
+ `;
142
+ const CustomRelationInput = (props)=>{
143
+ const { formatMessage } = reactIntl.useIntl();
144
+ const field = strapiAdmin.useField(props.name);
145
+ /**
146
+ * Ideally the server would return the correct shape, however, for admin user relations
147
+ * it sanitizes everything out when it finds an object for the relation value.
148
+ */ let formattedFieldValue;
149
+ if (field) {
150
+ formattedFieldValue = Array.isArray(field.value) ? {
151
+ results: field.value,
152
+ meta: {
153
+ missingCount: 0
154
+ }
155
+ } : field.value;
156
+ }
157
+ if (!formattedFieldValue || formattedFieldValue.results.length === 0 && formattedFieldValue.meta.missingCount === 0) {
158
+ return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
159
+ children: [
160
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
161
+ action: props.labelAction,
162
+ children: props.label
163
+ }),
164
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
165
+ marginTop: 1,
166
+ children: /*#__PURE__*/ jsxRuntime.jsx(StyledAlert, {
167
+ variant: "default",
168
+ children: formatMessage({
169
+ id: 'content-manager.history.content.no-relations',
170
+ defaultMessage: 'No relations.'
171
+ })
172
+ })
173
+ })
174
+ ]
175
+ });
176
+ }
177
+ const { results, meta } = formattedFieldValue;
178
+ return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Box, {
179
+ children: [
180
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
181
+ children: props.label
182
+ }),
183
+ results.length > 0 && /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
184
+ direction: "column",
185
+ gap: 2,
186
+ marginTop: 1,
187
+ alignItems: "stretch",
188
+ children: results.map((relationData)=>{
189
+ // @ts-expect-error - targetModel does exist on the attribute. But it's not typed.
190
+ const { targetModel } = props.attribute;
191
+ const href = `../${index.COLLECTION_TYPES}/${targetModel}/${relationData.documentId}`;
192
+ const label = usePrev.getRelationLabel(relationData, props.mainField);
193
+ const isAdminUserRelation = targetModel === 'admin::user';
194
+ return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
195
+ paddingTop: 2,
196
+ paddingBottom: 2,
197
+ paddingLeft: 4,
198
+ paddingRight: 4,
199
+ hasRadius: true,
200
+ borderColor: "neutral200",
201
+ background: "neutral150",
202
+ justifyContent: "space-between",
203
+ children: [
204
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
205
+ minWidth: 0,
206
+ paddingTop: 1,
207
+ paddingBottom: 1,
208
+ paddingRight: 4,
209
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Tooltip, {
210
+ label: label,
211
+ children: isAdminUserRelation ? /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
212
+ children: label
213
+ }) : /*#__PURE__*/ jsxRuntime.jsx(LinkEllipsis, {
214
+ tag: reactRouterDom.NavLink,
215
+ to: href,
216
+ children: label
217
+ })
218
+ })
219
+ }),
220
+ /*#__PURE__*/ jsxRuntime.jsx(index.DocumentStatus, {
221
+ status: relationData.status
222
+ })
223
+ ]
224
+ }, relationData.documentId ?? relationData.id);
225
+ })
226
+ }),
227
+ meta.missingCount > 0 && /* @ts-expect-error – we dont need closeLabel */ /*#__PURE__*/ jsxRuntime.jsx(StyledAlert, {
228
+ marginTop: 1,
229
+ variant: "warning",
230
+ title: formatMessage({
231
+ id: 'content-manager.history.content.missing-relations.title',
232
+ defaultMessage: '{number, plural, =1 {Missing relation} other {{number} missing relations}}'
233
+ }, {
234
+ number: meta.missingCount
235
+ }),
236
+ children: formatMessage({
237
+ id: 'content-manager.history.content.missing-relations.message',
238
+ defaultMessage: "{number, plural, =1 {It has} other {They have}} been deleted and can't be restored."
239
+ }, {
240
+ number: meta.missingCount
241
+ })
242
+ })
243
+ ]
244
+ });
245
+ };
246
+ /* -------------------------------------------------------------------------------------------------
247
+ * CustomMediaInput
248
+ * -----------------------------------------------------------------------------------------------*/ // Create an object with value at key path (i.e. 'a.b.c')
249
+ const createInitialValuesForPath = (keyPath, value)=>{
250
+ const keys = keyPath.split('.');
251
+ // The root level object
252
+ const root = {};
253
+ // Make the first node the root
254
+ let node = root;
255
+ keys.forEach((key, index)=>{
256
+ // Skip prototype pollution keys
257
+ if (key === '__proto__' || key === 'constructor') return;
258
+ // If it's the last key, set the node value
259
+ if (index === keys.length - 1) {
260
+ node[key] = value;
261
+ } else {
262
+ // Ensure the key exists and is an object
263
+ node[key] = node[key] || {};
264
+ }
265
+ // Traverse down the tree
266
+ node = node[key];
267
+ });
268
+ return root;
269
+ };
270
+ const CustomMediaInput = (props)=>{
271
+ const { value } = strapiAdmin.useField(props.name);
272
+ const results = value?.results ?? [];
273
+ const meta = value?.meta ?? {
274
+ missingCount: 0
275
+ };
276
+ const { formatMessage } = reactIntl.useIntl();
277
+ const fields = strapiAdmin.useStrapiApp('CustomMediaInput', (state)=>state.fields);
278
+ const MediaLibrary = fields.media;
279
+ return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
280
+ direction: "column",
281
+ gap: 2,
282
+ alignItems: "stretch",
283
+ children: [
284
+ /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Form, {
285
+ method: "PUT",
286
+ disabled: true,
287
+ initialValues: createInitialValuesForPath(props.name, results),
288
+ children: /*#__PURE__*/ jsxRuntime.jsx(MediaLibrary, {
289
+ ...props,
290
+ disabled: true,
291
+ multiple: results.length > 1
292
+ })
293
+ }),
294
+ meta.missingCount > 0 && /*#__PURE__*/ jsxRuntime.jsx(StyledAlert, {
295
+ variant: "warning",
296
+ closeLabel: "Close",
297
+ onClose: ()=>{},
298
+ title: formatMessage({
299
+ id: 'content-manager.history.content.missing-assets.title',
300
+ defaultMessage: '{number, plural, =1 {Missing asset} other {{number} missing assets}}'
301
+ }, {
302
+ number: meta.missingCount
303
+ }),
304
+ children: formatMessage({
305
+ id: 'content-manager.history.content.missing-assets.message',
306
+ defaultMessage: "{number, plural, =1 {It has} other {They have}} been deleted in the Media Library and can't be restored."
307
+ }, {
308
+ number: meta.missingCount
309
+ })
310
+ })
311
+ ]
312
+ });
313
+ };
314
+ /**
315
+ * Checks if the i18n plugin added a label action to the field and modifies it
316
+ * to adapt the wording for the history page.
317
+ */ const getLabelAction = (labelAction)=>{
318
+ if (!/*#__PURE__*/ React__namespace.isValidElement(labelAction)) {
319
+ return labelAction;
320
+ }
321
+ // TODO: find a better way to do this rather than access internals
322
+ const labelActionTitleId = labelAction.props.title.id;
323
+ if (labelActionTitleId === 'i18n.Field.localized') {
324
+ return /*#__PURE__*/ React__namespace.cloneElement(labelAction, {
325
+ ...labelAction.props,
326
+ title: {
327
+ id: 'history.content.localized',
328
+ defaultMessage: 'This value is specific to this locale. If you restore this version, the content will not be replaced for other locales.'
329
+ }
330
+ });
331
+ }
332
+ if (labelActionTitleId === 'i18n.Field.not-localized') {
333
+ return /*#__PURE__*/ React__namespace.cloneElement(labelAction, {
334
+ ...labelAction.props,
335
+ title: {
336
+ id: 'history.content.not-localized',
337
+ defaultMessage: 'This value is common to all locales. If you restore this version and save the changes, the content will be replaced for all locales.'
338
+ }
339
+ });
340
+ }
341
+ // Label action is unrelated to i18n, don't touch it.
342
+ return labelAction;
343
+ };
344
+ /**
345
+ * @internal
346
+ *
347
+ * @description An abstraction around the regular form input renderer designed specifically
348
+ * to be used on the History page in the content-manager. It understands how to render specific
349
+ * inputs within the context of a history version (i.e. relations, media, ignored RBAC, etc...)
350
+ */ const VersionInputRenderer = ({ visible, hint: providedHint, shouldIgnoreRBAC = false, labelAction, ...props })=>{
351
+ const customLabelAction = getLabelAction(labelAction);
352
+ const { formatMessage } = reactIntl.useIntl();
353
+ const version = useHistoryContext('VersionContent', (state)=>state.selectedVersion);
354
+ const configuration = useHistoryContext('VersionContent', (state)=>state.configuration);
355
+ const fieldSizes = hooks.useTypedSelector((state)=>state['content-manager'].app.fieldSizes);
356
+ const { id, components } = index.useDoc();
357
+ const isFormDisabled = strapiAdmin.useForm('InputRenderer', (state)=>state.disabled);
358
+ const isInDynamicZone = Input.useDynamicZone('isInDynamicZone', (state)=>state.isInDynamicZone);
359
+ const canCreateFields = index.useDocumentRBAC('InputRenderer', (rbac)=>rbac.canCreateFields);
360
+ const canReadFields = index.useDocumentRBAC('InputRenderer', (rbac)=>rbac.canReadFields);
361
+ const canUpdateFields = index.useDocumentRBAC('InputRenderer', (rbac)=>rbac.canUpdateFields);
362
+ const canUserAction = index.useDocumentRBAC('InputRenderer', (rbac)=>rbac.canUserAction);
363
+ const editableFields = id ? canUpdateFields : canCreateFields;
364
+ const readableFields = id ? canReadFields : canCreateFields;
365
+ /**
366
+ * Component fields are always readable and editable,
367
+ * however the fields within them may not be.
368
+ */ const canUserReadField = canUserAction(props.name, readableFields, props.type);
369
+ const canUserEditField = canUserAction(props.name, editableFields, props.type);
370
+ const fields = strapiAdmin.useStrapiApp('InputRenderer', (app)=>app.fields);
371
+ const { lazyComponentStore } = Input.useLazyComponents(attributeHasCustomFieldProperty(props.attribute) ? [
372
+ props.attribute.customField
373
+ ] : undefined);
374
+ const hint = Input.useFieldHint(providedHint, props.attribute);
375
+ const { edit: { components: componentsLayout } } = index.useDocLayout();
376
+ if (!visible) {
377
+ return null;
378
+ }
379
+ /**
380
+ * Don't render the field if the user can't read it.
381
+ */ if (!shouldIgnoreRBAC && !canUserReadField && !isInDynamicZone) {
382
+ return /*#__PURE__*/ jsxRuntime.jsx(Input.NotAllowedInput, {
383
+ hint: hint,
384
+ ...props
385
+ });
386
+ }
387
+ const fieldIsDisabled = !canUserEditField && !isInDynamicZone || props.disabled || isFormDisabled;
388
+ /**
389
+ * Attributes found on the current content-type schema cannot be restored. We handle
390
+ * this by displaying a warning alert to the user instead of the input for that field type.
391
+ */ const addedAttributes = version.meta.unknownAttributes.added;
392
+ if (Object.keys(addedAttributes).includes(props.name)) {
393
+ return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
394
+ direction: "column",
395
+ alignItems: "flex-start",
396
+ gap: 1,
397
+ children: [
398
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
399
+ children: props.label
400
+ }),
401
+ /*#__PURE__*/ jsxRuntime.jsx(StyledAlert, {
402
+ width: "100%",
403
+ closeLabel: "Close",
404
+ onClose: ()=>{},
405
+ variant: "warning",
406
+ title: formatMessage({
407
+ id: 'content-manager.history.content.new-field.title',
408
+ defaultMessage: 'New field'
409
+ }),
410
+ children: formatMessage({
411
+ id: 'content-manager.history.content.new-field.message',
412
+ defaultMessage: "This field didn't exist when this version was saved. If you restore this version, it will be empty."
413
+ })
414
+ })
415
+ ]
416
+ });
417
+ }
418
+ /**
419
+ * Because a custom field has a unique prop but the type could be confused with either
420
+ * the useField hook or the type of the field we need to handle it separately and first.
421
+ */ if (attributeHasCustomFieldProperty(props.attribute)) {
422
+ const CustomInput = lazyComponentStore[props.attribute.customField];
423
+ if (CustomInput) {
424
+ return /*#__PURE__*/ jsxRuntime.jsx(CustomInput, {
425
+ ...props,
426
+ // @ts-expect-error – TODO: fix this type error in the useLazyComponents hook.
427
+ hint: hint,
428
+ labelAction: customLabelAction,
429
+ disabled: fieldIsDisabled
430
+ });
431
+ }
432
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.InputRenderer, {
433
+ ...props,
434
+ hint: hint,
435
+ labelAction: customLabelAction,
436
+ // @ts-expect-error – this workaround lets us display that the custom field is missing.
437
+ type: props.attribute.customField,
438
+ disabled: fieldIsDisabled
439
+ });
440
+ }
441
+ /**
442
+ * Since media fields use a custom input via the upload plugin provided by the useLibrary hook,
443
+ * we need to handle the them before other custom inputs coming from the useLibrary hook.
444
+ */ if (props.type === 'media') {
445
+ return /*#__PURE__*/ jsxRuntime.jsx(CustomMediaInput, {
446
+ ...props,
447
+ labelAction: customLabelAction,
448
+ disabled: fieldIsDisabled
449
+ });
450
+ }
451
+ /**
452
+ * This is where we handle ONLY the fields from the `useLibrary` hook.
453
+ */ const addedInputTypes = Object.keys(fields);
454
+ if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {
455
+ const CustomInput = fields[props.type];
456
+ return /*#__PURE__*/ jsxRuntime.jsx(CustomInput, {
457
+ ...props,
458
+ // @ts-expect-error – TODO: fix this type error in the useLibrary hook.
459
+ hint: hint,
460
+ labelAction: customLabelAction,
461
+ disabled: fieldIsDisabled
462
+ });
463
+ }
464
+ /**
465
+ * These include the content-manager specific fields, failing that we fall back
466
+ * to the more generic form input renderer.
467
+ */ switch(props.type){
468
+ case 'blocks':
469
+ return /*#__PURE__*/ jsxRuntime.jsx(Input.MemoizedBlocksInput, {
470
+ ...props,
471
+ hint: hint,
472
+ type: props.type,
473
+ disabled: fieldIsDisabled
474
+ });
475
+ case 'component':
476
+ const { layout } = componentsLayout[props.attribute.component];
477
+ // Components can only have one panel, so only save the first layout item
478
+ const [remainingFieldsLayout] = getRemaingFieldsLayout({
479
+ layout: [
480
+ layout
481
+ ],
482
+ metadatas: configuration.components[props.attribute.component].metadatas,
483
+ fieldSizes,
484
+ schemaAttributes: components[props.attribute.component].attributes
485
+ });
486
+ return /*#__PURE__*/ jsxRuntime.jsx(Input.MemoizedComponentInput, {
487
+ ...props,
488
+ layout: [
489
+ ...layout,
490
+ ...remainingFieldsLayout || []
491
+ ],
492
+ hint: hint,
493
+ labelAction: customLabelAction,
494
+ disabled: fieldIsDisabled,
495
+ children: (inputProps)=>/*#__PURE__*/ jsxRuntime.jsx(VersionInputRenderer, {
496
+ ...inputProps,
497
+ shouldIgnoreRBAC: true
498
+ })
499
+ });
500
+ case 'dynamiczone':
501
+ return /*#__PURE__*/ jsxRuntime.jsx(Input.DynamicZone, {
502
+ ...props,
503
+ hint: hint,
504
+ labelAction: customLabelAction,
505
+ disabled: fieldIsDisabled,
506
+ children: (inputProps)=>/*#__PURE__*/ jsxRuntime.jsx(VersionInputRenderer, {
507
+ ...inputProps,
508
+ shouldIgnoreRBAC: true
509
+ })
510
+ });
511
+ case 'relation':
512
+ return /*#__PURE__*/ jsxRuntime.jsx(CustomRelationInput, {
513
+ ...props,
514
+ hint: hint,
515
+ labelAction: customLabelAction,
516
+ disabled: fieldIsDisabled
517
+ });
518
+ case 'richtext':
519
+ return /*#__PURE__*/ jsxRuntime.jsx(Input.MemoizedWysiwyg, {
520
+ ...props,
521
+ hint: hint,
522
+ type: props.type,
523
+ labelAction: customLabelAction,
524
+ disabled: fieldIsDisabled
525
+ });
526
+ case 'uid':
527
+ return /*#__PURE__*/ jsxRuntime.jsx(Input.MemoizedUIDInput, {
528
+ ...props,
529
+ hint: hint,
530
+ type: props.type,
531
+ labelAction: customLabelAction,
532
+ disabled: fieldIsDisabled
533
+ });
534
+ /**
535
+ * Enumerations are a special case because they require options.
536
+ */ case 'enumeration':
537
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.InputRenderer, {
538
+ ...props,
539
+ hint: hint,
540
+ labelAction: customLabelAction,
541
+ options: props.attribute.enum.map((value)=>({
542
+ value
543
+ })),
544
+ // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!
545
+ type: props.customField ? 'custom-field' : props.type,
546
+ disabled: fieldIsDisabled
547
+ });
548
+ default:
549
+ // These props are not needed for the generic form input renderer.
550
+ const { unique: _unique, mainField: _mainField, ...restProps } = props;
551
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.InputRenderer, {
552
+ ...restProps,
553
+ hint: hint,
554
+ labelAction: customLabelAction,
555
+ // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!
556
+ type: props.customField ? 'custom-field' : props.type,
557
+ disabled: fieldIsDisabled
558
+ });
559
+ }
560
+ };
561
+ const attributeHasCustomFieldProperty = (attribute)=>'customField' in attribute && typeof attribute.customField === 'string';
562
+
563
+ const createLayoutFromFields = (fields)=>{
564
+ return fields.reduce((rows, field)=>{
565
+ if (field.type === 'dynamiczone') {
566
+ // Dynamic zones take up all the columns in a row
567
+ rows.push([
568
+ field
569
+ ]);
570
+ return rows;
571
+ }
572
+ if (!rows[rows.length - 1]) {
573
+ // Create a new row if there isn't one available
574
+ rows.push([]);
575
+ }
576
+ // Push fields to the current row, they wrap and handle their own column size
577
+ rows[rows.length - 1].push(field);
578
+ return rows;
579
+ }, [])// Map the rows to panels
580
+ .map((row)=>[
581
+ row
582
+ ]);
583
+ };
584
+ /**
585
+ * Build a layout for the fields that are were deleted from the edit view layout
586
+ * via the configure the view page. This layout will be merged with the main one.
587
+ * Those fields would be restored if the user restores the history version, which is why it's
588
+ * important to show them, even if they're not in the normal layout.
589
+ */ function getRemaingFieldsLayout({ layout, metadatas, schemaAttributes, fieldSizes }) {
590
+ const fieldsInLayout = layout.flatMap((panel)=>panel.flatMap((row)=>row.flatMap((field)=>field.name)));
591
+ const remainingFields = Object.entries(metadatas).reduce((currentRemainingFields, [name, field])=>{
592
+ // Make sure we do not fields that are not visible, e.g. "id"
593
+ if (!fieldsInLayout.includes(name) && field.edit.visible === true) {
594
+ const attribute = schemaAttributes[name];
595
+ // @ts-expect-error not sure why attribute causes type error
596
+ currentRemainingFields.push({
597
+ attribute,
598
+ type: attribute.type,
599
+ visible: true,
600
+ disabled: true,
601
+ label: field.edit.label || name,
602
+ name: name,
603
+ size: fieldSizes[attribute.type].default ?? 12
604
+ });
605
+ }
606
+ return currentRemainingFields;
607
+ }, []);
608
+ return createLayoutFromFields(remainingFields);
609
+ }
610
+ /* -------------------------------------------------------------------------------------------------
611
+ * FormPanel
612
+ * -----------------------------------------------------------------------------------------------*/ const FormPanel = ({ panel })=>{
613
+ if (panel.some((row)=>row.some((field)=>field.type === 'dynamiczone'))) {
614
+ const [row] = panel;
615
+ const [field] = row;
616
+ return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Root, {
617
+ gap: 4,
618
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Item, {
619
+ col: 12,
620
+ s: 12,
621
+ xs: 12,
622
+ direction: "column",
623
+ alignItems: "stretch",
624
+ children: /*#__PURE__*/ jsxRuntime.jsx(VersionInputRenderer, {
625
+ ...field
626
+ })
627
+ })
628
+ }, field.name);
629
+ }
630
+ return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
631
+ hasRadius: true,
632
+ background: "neutral0",
633
+ shadow: "tableShadow",
634
+ paddingLeft: 6,
635
+ paddingRight: 6,
636
+ paddingTop: 6,
637
+ paddingBottom: 6,
638
+ borderColor: "neutral150",
639
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
640
+ direction: "column",
641
+ alignItems: "stretch",
642
+ gap: 6,
643
+ children: panel.map((row, gridRowIndex)=>/*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Root, {
644
+ gap: 4,
645
+ children: row.map(({ size, ...field })=>{
646
+ return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Item, {
647
+ col: size,
648
+ s: 12,
649
+ xs: 12,
650
+ direction: "column",
651
+ alignItems: "stretch",
652
+ children: /*#__PURE__*/ jsxRuntime.jsx(VersionInputRenderer, {
653
+ ...field
654
+ })
655
+ }, field.name);
656
+ })
657
+ }, gridRowIndex))
658
+ })
659
+ });
660
+ };
661
+ const VersionContent = ()=>{
662
+ const { formatMessage } = reactIntl.useIntl();
663
+ const { fieldSizes } = hooks.useTypedSelector((state)=>state['content-manager'].app);
664
+ const version = useHistoryContext('VersionContent', (state)=>state.selectedVersion);
665
+ const layout = useHistoryContext('VersionContent', (state)=>state.layout);
666
+ const configuration = useHistoryContext('VersionContent', (state)=>state.configuration);
667
+ const schema = useHistoryContext('VersionContent', (state)=>state.schema);
668
+ // Build a layout for the unknown fields section
669
+ const removedAttributes = version.meta.unknownAttributes.removed;
670
+ const removedAttributesAsFields = Object.entries(removedAttributes).map(([attributeName, attribute])=>{
671
+ const field = {
672
+ attribute,
673
+ shouldIgnoreRBAC: true,
674
+ type: attribute.type,
675
+ visible: true,
676
+ disabled: true,
677
+ label: attributeName,
678
+ name: attributeName,
679
+ size: fieldSizes[attribute.type].default ?? 12
680
+ };
681
+ return field;
682
+ });
683
+ const unknownFieldsLayout = createLayoutFromFields(removedAttributesAsFields);
684
+ // Build a layout for the fields that are were deleted from the layout
685
+ const remainingFieldsLayout = getRemaingFieldsLayout({
686
+ metadatas: configuration.contentType.metadatas,
687
+ layout,
688
+ schemaAttributes: schema.attributes,
689
+ fieldSizes
690
+ });
691
+ const { components } = index.useDoc();
692
+ /**
693
+ * Transform the data before passing it to the form so that each field
694
+ * has a uniquely generated key
695
+ */ const transformedData = React__namespace.useMemo(()=>{
696
+ const transform = (schemaAttributes, components = {})=>(document)=>{
697
+ const schema = {
698
+ attributes: schemaAttributes
699
+ };
700
+ const transformations = pipe(index.removeFieldsThatDontExistOnSchema(schema), index.prepareTempKeys(schema, components));
701
+ return transformations(document);
702
+ };
703
+ return transform(version.schema, components)(version.data);
704
+ }, [
705
+ components,
706
+ version.data,
707
+ version.schema
708
+ ]);
709
+ return /*#__PURE__*/ jsxRuntime.jsxs(strapiAdmin.Layouts.Content, {
710
+ children: [
711
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
712
+ paddingBottom: 8,
713
+ children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Form, {
714
+ disabled: true,
715
+ method: "PUT",
716
+ initialValues: transformedData,
717
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
718
+ direction: "column",
719
+ alignItems: "stretch",
720
+ gap: 6,
721
+ position: "relative",
722
+ children: [
723
+ ...layout,
724
+ ...remainingFieldsLayout
725
+ ].map((panel, index)=>{
726
+ return /*#__PURE__*/ jsxRuntime.jsx(FormPanel, {
727
+ panel: panel
728
+ }, index);
729
+ })
730
+ })
731
+ })
732
+ }),
733
+ removedAttributesAsFields.length > 0 && /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
734
+ children: [
735
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Divider, {}),
736
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Box, {
737
+ paddingTop: 8,
738
+ children: [
739
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
740
+ direction: "column",
741
+ alignItems: "flex-start",
742
+ paddingBottom: 6,
743
+ gap: 1,
744
+ children: [
745
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
746
+ variant: "delta",
747
+ children: formatMessage({
748
+ id: 'content-manager.history.content.unknown-fields.title',
749
+ defaultMessage: 'Unknown fields'
750
+ })
751
+ }),
752
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
753
+ variant: "pi",
754
+ children: formatMessage({
755
+ id: 'content-manager.history.content.unknown-fields.message',
756
+ defaultMessage: 'These fields have been deleted or renamed in the Content-Type Builder. <b>These fields will not be restored.</b>'
757
+ }, {
758
+ b: (chunks)=>/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
759
+ variant: "pi",
760
+ fontWeight: "bold",
761
+ children: chunks
762
+ })
763
+ })
764
+ })
765
+ ]
766
+ }),
767
+ /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Form, {
768
+ disabled: true,
769
+ method: "PUT",
770
+ initialValues: version.data,
771
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
772
+ direction: "column",
773
+ alignItems: "stretch",
774
+ gap: 6,
775
+ position: "relative",
776
+ children: unknownFieldsLayout.map((panel, index)=>{
777
+ return /*#__PURE__*/ jsxRuntime.jsx(FormPanel, {
778
+ panel: panel
779
+ }, index);
780
+ })
781
+ })
782
+ })
783
+ ]
784
+ })
785
+ ]
786
+ })
787
+ ]
788
+ });
789
+ };
790
+
791
+ const historyVersionsApi = index.contentManagerApi.injectEndpoints({
792
+ endpoints: (builder)=>({
793
+ getHistoryVersions: builder.query({
794
+ query (params) {
795
+ return {
796
+ url: `/content-manager/history-versions`,
797
+ method: 'GET',
798
+ config: {
799
+ params
800
+ }
801
+ };
802
+ },
803
+ providesTags: [
804
+ 'HistoryVersion'
805
+ ]
806
+ }),
807
+ restoreVersion: builder.mutation({
808
+ query ({ params, body }) {
809
+ return {
810
+ url: `/content-manager/history-versions/${params.versionId}/restore`,
811
+ method: 'PUT',
812
+ data: body
813
+ };
814
+ },
815
+ invalidatesTags: (_res, _error, { documentId, collectionType, params })=>{
816
+ return [
817
+ 'HistoryVersion',
818
+ {
819
+ type: 'Document',
820
+ id: collectionType === index.COLLECTION_TYPES ? `${params.contentType}_${documentId}` : params.contentType
821
+ }
822
+ ];
823
+ }
824
+ })
825
+ })
826
+ });
827
+ const { useGetHistoryVersionsQuery, useRestoreVersionMutation } = historyVersionsApi;
828
+
829
+ const VersionHeader = ({ headerId })=>{
830
+ const [isConfirmDialogOpen, setIsConfirmDialogOpen] = React__namespace.useState(false);
831
+ const navigate = reactRouterDom.useNavigate();
832
+ const { formatMessage, formatDate } = reactIntl.useIntl();
833
+ const { trackUsage } = strapiAdmin.useTracking();
834
+ const { toggleNotification } = strapiAdmin.useNotification();
835
+ const [{ query }] = strapiAdmin.useQueryParams();
836
+ const { collectionType, slug } = reactRouterDom.useParams();
837
+ const [restoreVersion, { isLoading }] = useRestoreVersionMutation();
838
+ const { allowedActions } = strapiAdmin.useRBAC(index.PERMISSIONS.map((action)=>({
839
+ action,
840
+ subject: slug
841
+ })));
842
+ const version = useHistoryContext('VersionHeader', (state)=>state.selectedVersion);
843
+ const mainField = useHistoryContext('VersionHeader', (state)=>state.mainField);
844
+ const schema = useHistoryContext('VersionHeader', (state)=>state.schema);
845
+ const isCurrentVersion = useHistoryContext('VersionHeader', (state)=>state.page === 1 && state.versions.data[0].id === state.selectedVersion.id);
846
+ const mainFieldValue = version.data[mainField];
847
+ const getNextNavigation = ()=>{
848
+ const pluginsQueryParams = qs.stringify({
849
+ plugins: query.plugins
850
+ }, {
851
+ encode: false
852
+ });
853
+ return {
854
+ pathname: '..',
855
+ search: pluginsQueryParams
856
+ };
857
+ };
858
+ const handleRestore = async ()=>{
859
+ try {
860
+ const response = await restoreVersion({
861
+ documentId: version.relatedDocumentId,
862
+ collectionType,
863
+ params: {
864
+ versionId: version.id,
865
+ contentType: version.contentType
866
+ },
867
+ body: {
868
+ contentType: version.contentType
869
+ }
870
+ });
871
+ if ('data' in response) {
872
+ navigate(getNextNavigation(), {
873
+ relative: 'path'
874
+ });
875
+ toggleNotification({
876
+ type: 'success',
877
+ title: formatMessage({
878
+ id: 'content-manager.restore.success.title',
879
+ defaultMessage: 'Version restored.'
880
+ }),
881
+ message: formatMessage({
882
+ id: 'content-manager.restore.success.message',
883
+ defaultMessage: 'A past version of the content was restored.'
884
+ })
885
+ });
886
+ trackUsage('didRestoreHistoryVersion');
887
+ }
888
+ if ('error' in response) {
889
+ toggleNotification({
890
+ type: 'danger',
891
+ message: formatMessage({
892
+ id: 'content-manager.history.restore.error.message',
893
+ defaultMessage: 'Could not restore version.'
894
+ })
895
+ });
896
+ }
897
+ } catch (error) {
898
+ toggleNotification({
899
+ type: 'danger',
900
+ message: formatMessage({
901
+ id: 'notification.error',
902
+ defaultMessage: 'An error occurred'
903
+ })
904
+ });
905
+ }
906
+ };
907
+ return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Dialog.Root, {
908
+ open: isConfirmDialogOpen,
909
+ onOpenChange: setIsConfirmDialogOpen,
910
+ children: [
911
+ /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Layouts.BaseHeader, {
912
+ id: headerId,
913
+ title: formatDate(new Date(version.createdAt), {
914
+ year: 'numeric',
915
+ month: 'numeric',
916
+ day: 'numeric',
917
+ hour: 'numeric',
918
+ minute: 'numeric'
919
+ }),
920
+ subtitle: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
921
+ variant: "epsilon",
922
+ textColor: "neutral600",
923
+ children: formatMessage({
924
+ id: 'content-manager.history.version.subtitle',
925
+ defaultMessage: '{hasLocale, select, true {{subtitle}, in {locale}} other {{subtitle}}}'
926
+ }, {
927
+ hasLocale: Boolean(version.locale),
928
+ subtitle: `${mainFieldValue || ''} (${schema.info.singularName})`.trim(),
929
+ locale: version.locale?.name
930
+ })
931
+ }),
932
+ navigationAction: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Link, {
933
+ startIcon: /*#__PURE__*/ jsxRuntime.jsx(Icons.ArrowLeft, {}),
934
+ tag: reactRouterDom.NavLink,
935
+ to: getNextNavigation(),
936
+ relative: "path",
937
+ isExternal: false,
938
+ children: formatMessage({
939
+ id: 'global.back',
940
+ defaultMessage: 'Back'
941
+ })
942
+ }),
943
+ sticky: false,
944
+ primaryAction: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Dialog.Trigger, {
945
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Button, {
946
+ disabled: !allowedActions.canUpdate || isCurrentVersion,
947
+ onClick: ()=>{
948
+ setIsConfirmDialogOpen(true);
949
+ },
950
+ children: formatMessage({
951
+ id: 'content-manager.history.restore.confirm.button',
952
+ defaultMessage: 'Restore'
953
+ })
954
+ })
955
+ })
956
+ }),
957
+ /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.ConfirmDialog, {
958
+ onConfirm: handleRestore,
959
+ endAction: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Button, {
960
+ variant: "secondary",
961
+ onClick: handleRestore,
962
+ loading: isLoading,
963
+ children: formatMessage({
964
+ id: 'content-manager.history.restore.confirm.button',
965
+ defaultMessage: 'Restore'
966
+ })
967
+ }),
968
+ children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
969
+ direction: "column",
970
+ alignItems: "center",
971
+ justifyContent: "center",
972
+ gap: 2,
973
+ textAlign: "center",
974
+ children: [
975
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
976
+ justifyContent: "center",
977
+ children: /*#__PURE__*/ jsxRuntime.jsx(Icons.WarningCircle, {
978
+ width: "24px",
979
+ height: "24px",
980
+ fill: "danger600"
981
+ })
982
+ }),
983
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
984
+ children: formatMessage({
985
+ id: 'content-manager.history.restore.confirm.title',
986
+ defaultMessage: 'Are you sure you want to restore this version?'
987
+ })
988
+ }),
989
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
990
+ children: formatMessage({
991
+ id: 'content-manager.history.restore.confirm.message',
992
+ defaultMessage: "{isDraft, select, true {The restored content will override your draft.} other {The restored content won't be published, it will override the draft and be saved as pending changes. You'll be able to publish the changes at anytime.}}"
993
+ }, {
994
+ isDraft: version.status === 'draft'
995
+ })
996
+ })
997
+ ]
998
+ })
999
+ })
1000
+ ]
1001
+ });
1002
+ };
1003
+
1004
+ /* -------------------------------------------------------------------------------------------------
1005
+ * BlueText
1006
+ * -----------------------------------------------------------------------------------------------*/ const BlueText = (children)=>/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
1007
+ textColor: "primary600",
1008
+ variant: "pi",
1009
+ children: children
1010
+ });
1011
+ const VersionCard = ({ version, isCurrent })=>{
1012
+ const { formatDate, formatMessage } = reactIntl.useIntl();
1013
+ const [{ query }] = strapiAdmin.useQueryParams();
1014
+ const isActive = query.id === version.id.toString();
1015
+ const author = version.createdBy && index.getDisplayName(version.createdBy);
1016
+ return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
1017
+ direction: "column",
1018
+ alignItems: "flex-start",
1019
+ gap: 3,
1020
+ hasRadius: true,
1021
+ borderWidth: "1px",
1022
+ borderStyle: "solid",
1023
+ borderColor: isActive ? 'primary600' : 'neutral200',
1024
+ color: "neutral800",
1025
+ padding: 5,
1026
+ tag: reactRouterDom.Link,
1027
+ to: `?${qs.stringify({
1028
+ ...query,
1029
+ id: version.id
1030
+ })}`,
1031
+ style: {
1032
+ textDecoration: 'none'
1033
+ },
1034
+ children: [
1035
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
1036
+ direction: "column",
1037
+ gap: 1,
1038
+ alignItems: "flex-start",
1039
+ children: [
1040
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
1041
+ tag: "h3",
1042
+ fontWeight: "semiBold",
1043
+ children: formatDate(version.createdAt, {
1044
+ day: 'numeric',
1045
+ month: 'numeric',
1046
+ year: 'numeric',
1047
+ hour: '2-digit',
1048
+ minute: '2-digit'
1049
+ })
1050
+ }),
1051
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
1052
+ tag: "p",
1053
+ variant: "pi",
1054
+ textColor: "neutral600",
1055
+ children: formatMessage({
1056
+ id: 'content-manager.history.sidebar.versionDescription',
1057
+ defaultMessage: '{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}'
1058
+ }, {
1059
+ distanceToNow: /*#__PURE__*/ jsxRuntime.jsx(index.RelativeTime, {
1060
+ timestamp: new Date(version.createdAt)
1061
+ }),
1062
+ author,
1063
+ isAnonymous: !Boolean(version.createdBy),
1064
+ isCurrent,
1065
+ b: BlueText
1066
+ })
1067
+ })
1068
+ ]
1069
+ }),
1070
+ version.status && /*#__PURE__*/ jsxRuntime.jsx(index.DocumentStatus, {
1071
+ status: version.status,
1072
+ size: "XS"
1073
+ })
1074
+ ]
1075
+ });
1076
+ };
1077
+ const PaginationButton = ({ page, children })=>{
1078
+ const [{ query }] = strapiAdmin.useQueryParams();
1079
+ // Remove the id from the pagination link, so that the history page can redirect
1080
+ // to the id of the first history version in the new page once it's loaded
1081
+ const { id: _id, ...queryRest } = query;
1082
+ return /*#__PURE__*/ jsxRuntime.jsx(reactRouterDom.Link, {
1083
+ to: {
1084
+ search: qs.stringify({
1085
+ ...queryRest,
1086
+ page
1087
+ })
1088
+ },
1089
+ style: {
1090
+ textDecoration: 'none'
1091
+ },
1092
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
1093
+ variant: "omega",
1094
+ textColor: "primary600",
1095
+ children: children
1096
+ })
1097
+ });
1098
+ };
1099
+ /* -------------------------------------------------------------------------------------------------
1100
+ * VersionsList
1101
+ * -----------------------------------------------------------------------------------------------*/ const VersionsList = ()=>{
1102
+ const { formatMessage } = reactIntl.useIntl();
1103
+ const { versions, page } = useHistoryContext('VersionsList', (state)=>({
1104
+ versions: state.versions,
1105
+ page: state.page
1106
+ }));
1107
+ return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
1108
+ shrink: 0,
1109
+ direction: "column",
1110
+ alignItems: "stretch",
1111
+ width: "320px",
1112
+ height: "100vh",
1113
+ background: "neutral0",
1114
+ borderColor: "neutral200",
1115
+ borderWidth: "0 0 0 1px",
1116
+ borderStyle: "solid",
1117
+ tag: "aside",
1118
+ children: [
1119
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
1120
+ direction: "row",
1121
+ justifyContent: "space-between",
1122
+ padding: 4,
1123
+ borderColor: "neutral200",
1124
+ borderWidth: "0 0 1px",
1125
+ borderStyle: "solid",
1126
+ tag: "header",
1127
+ children: [
1128
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
1129
+ tag: "h2",
1130
+ variant: "omega",
1131
+ fontWeight: "semiBold",
1132
+ children: formatMessage({
1133
+ id: 'content-manager.history.sidebar.title',
1134
+ defaultMessage: 'Versions'
1135
+ })
1136
+ }),
1137
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
1138
+ background: "neutral150",
1139
+ hasRadius: true,
1140
+ padding: 1,
1141
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
1142
+ variant: "sigma",
1143
+ textColor: "neutral600",
1144
+ children: versions.meta.pagination.total
1145
+ })
1146
+ })
1147
+ ]
1148
+ }),
1149
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Box, {
1150
+ flex: 1,
1151
+ overflow: "auto",
1152
+ children: [
1153
+ versions.meta.pagination.page > 1 && /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
1154
+ paddingTop: 4,
1155
+ textAlign: "center",
1156
+ children: /*#__PURE__*/ jsxRuntime.jsx(PaginationButton, {
1157
+ page: page - 1,
1158
+ children: formatMessage({
1159
+ id: 'content-manager.history.sidebar.show-newer',
1160
+ defaultMessage: 'Show newer versions'
1161
+ })
1162
+ })
1163
+ }),
1164
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
1165
+ direction: "column",
1166
+ gap: 3,
1167
+ padding: 4,
1168
+ tag: "ul",
1169
+ alignItems: "stretch",
1170
+ children: versions.data.map((version, index)=>/*#__PURE__*/ jsxRuntime.jsx("li", {
1171
+ "aria-label": formatMessage({
1172
+ id: 'content-manager.history.sidebar.title.version-card.aria-label',
1173
+ defaultMessage: 'Version card'
1174
+ }),
1175
+ children: /*#__PURE__*/ jsxRuntime.jsx(VersionCard, {
1176
+ version: version,
1177
+ isCurrent: page === 1 && index === 0
1178
+ })
1179
+ }, version.id))
1180
+ }),
1181
+ versions.meta.pagination.page < versions.meta.pagination.pageCount && /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
1182
+ paddingBottom: 4,
1183
+ textAlign: "center",
1184
+ children: /*#__PURE__*/ jsxRuntime.jsx(PaginationButton, {
1185
+ page: page + 1,
1186
+ children: formatMessage({
1187
+ id: 'content-manager.history.sidebar.show-older',
1188
+ defaultMessage: 'Show older versions'
1189
+ })
1190
+ })
1191
+ })
1192
+ ]
1193
+ })
1194
+ ]
1195
+ });
1196
+ };
1197
+
1198
+ const [HistoryProvider, useHistoryContext] = strapiAdmin.createContext('HistoryPage');
1199
+ /* -------------------------------------------------------------------------------------------------
1200
+ * HistoryPage
1201
+ * -----------------------------------------------------------------------------------------------*/ const HistoryPage = ()=>{
1202
+ const headerId = React__namespace.useId();
1203
+ const { formatMessage } = reactIntl.useIntl();
1204
+ const { slug, id: documentId, collectionType } = reactRouterDom.useParams();
1205
+ const { isLoading: isLoadingDocument, schema } = index.useDocument({
1206
+ collectionType: collectionType,
1207
+ model: slug
1208
+ });
1209
+ const { isLoading: isLoadingLayout, edit: { layout, settings: { displayName, mainField } } } = index.useDocumentLayout(slug);
1210
+ const { data: configuration, isLoading: isLoadingConfiguration } = index.useGetContentTypeConfigurationQuery(slug);
1211
+ // Parse state from query params
1212
+ const [{ query }] = strapiAdmin.useQueryParams();
1213
+ const { id: selectedVersionId, ...queryWithoutId } = query;
1214
+ const validQueryParamsWithoutId = index.buildValidParams(queryWithoutId);
1215
+ const page = validQueryParamsWithoutId.page ? Number(validQueryParamsWithoutId.page) : 1;
1216
+ const versionsResponse = useGetHistoryVersionsQuery({
1217
+ contentType: slug,
1218
+ ...documentId ? {
1219
+ documentId
1220
+ } : {},
1221
+ // Omit id since it's not needed by the endpoint and caused extra refetches
1222
+ ...validQueryParamsWithoutId
1223
+ }, {
1224
+ refetchOnMountOrArgChange: true
1225
+ });
1226
+ /**
1227
+ * When the page is first mounted, if there's already data in the cache, RTK has a fullfilled
1228
+ * status for the first render, right before it triggers a new request. This means the code
1229
+ * briefly reaches the part that redirects to the first history version (if none is set).
1230
+ * But since that data is stale, that means auto-selecting a version that may not be the most
1231
+ * recent. To avoid this, we identify through requestId if the query is stale despite the
1232
+ * fullfilled status, and show the loader in that case.
1233
+ * This means we essentially don't want cache. We always refetch when the page mounts, and
1234
+ * we always show the loader until we have the most recent data. That's fine for this page.
1235
+ */ const initialRequestId = React__namespace.useRef(versionsResponse.requestId);
1236
+ const isStaleRequest = versionsResponse.requestId === initialRequestId.current;
1237
+ /**
1238
+ * Ensure that we have the necessary data to render the page:
1239
+ * - slug for single types
1240
+ * - slug _and_ documentId for collection types
1241
+ */ if (!slug || collectionType === index.COLLECTION_TYPES && !documentId) {
1242
+ return /*#__PURE__*/ jsxRuntime.jsx(reactRouterDom.Navigate, {
1243
+ to: "/content-manager"
1244
+ });
1245
+ }
1246
+ if (isLoadingDocument || isLoadingLayout || versionsResponse.isFetching || isStaleRequest || isLoadingConfiguration) {
1247
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
1248
+ }
1249
+ // It was a success, handle empty data
1250
+ if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {
1251
+ return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
1252
+ children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.NoData, {
1253
+ action: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Link, {
1254
+ tag: reactRouterDom.NavLink,
1255
+ to: `/content-manager/${collectionType}/${slug}${documentId ? `/${documentId}` : ''}`,
1256
+ children: formatMessage({
1257
+ id: 'global.back',
1258
+ defaultMessage: 'Back'
1259
+ })
1260
+ })
1261
+ })
1262
+ });
1263
+ }
1264
+ // We have data, handle selected version
1265
+ if (versionsResponse.data?.data?.length && !selectedVersionId) {
1266
+ return /*#__PURE__*/ jsxRuntime.jsx(reactRouterDom.Navigate, {
1267
+ to: {
1268
+ search: qs.stringify({
1269
+ ...query,
1270
+ id: versionsResponse.data.data[0].id
1271
+ })
1272
+ },
1273
+ replace: true
1274
+ });
1275
+ }
1276
+ const selectedVersion = versionsResponse.data?.data?.find((version)=>version.id.toString() === selectedVersionId);
1277
+ if (versionsResponse.isError || !layout || !schema || !selectedVersion || !configuration || // This should not happen as it's covered by versionsResponse.isError, but we need it for TS
1278
+ versionsResponse.data.error) {
1279
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
1280
+ }
1281
+ return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
1282
+ children: [
1283
+ /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Title, {
1284
+ children: formatMessage({
1285
+ id: 'content-manager.history.page-title',
1286
+ defaultMessage: '{contentType} history'
1287
+ }, {
1288
+ contentType: displayName
1289
+ })
1290
+ }),
1291
+ /*#__PURE__*/ jsxRuntime.jsx(HistoryProvider, {
1292
+ contentType: slug,
1293
+ id: documentId,
1294
+ schema: schema,
1295
+ layout: layout,
1296
+ configuration: configuration,
1297
+ selectedVersion: selectedVersion,
1298
+ versions: versionsResponse.data,
1299
+ page: page,
1300
+ mainField: mainField,
1301
+ children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
1302
+ direction: "row",
1303
+ alignItems: "flex-start",
1304
+ children: [
1305
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Main, {
1306
+ grow: 1,
1307
+ height: "100vh",
1308
+ background: "neutral100",
1309
+ paddingBottom: 6,
1310
+ overflow: "auto",
1311
+ labelledBy: headerId,
1312
+ children: [
1313
+ /*#__PURE__*/ jsxRuntime.jsx(VersionHeader, {
1314
+ headerId: headerId
1315
+ }),
1316
+ /*#__PURE__*/ jsxRuntime.jsx(Input.DocumentContextProvider, {
1317
+ initialDocument: {
1318
+ documentId: documentId || '',
1319
+ model: slug,
1320
+ collectionType: collectionType || ''
1321
+ },
1322
+ children: /*#__PURE__*/ jsxRuntime.jsx(VersionContent, {})
1323
+ })
1324
+ ]
1325
+ }),
1326
+ /*#__PURE__*/ jsxRuntime.jsx(VersionsList, {})
1327
+ ]
1328
+ })
1329
+ })
1330
+ ]
1331
+ });
1332
+ };
1333
+ /* -------------------------------------------------------------------------------------------------
1334
+ * ProtectedHistoryPage
1335
+ * -----------------------------------------------------------------------------------------------*/ const ProtectedHistoryPageImpl = ()=>{
1336
+ const { slug } = reactRouterDom.useParams();
1337
+ const { permissions = [], isLoading, error } = strapiAdmin.useRBAC(index.PERMISSIONS.map((action)=>({
1338
+ action,
1339
+ subject: slug
1340
+ })));
1341
+ if (isLoading) {
1342
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
1343
+ }
1344
+ if (error || !slug) {
1345
+ return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
1346
+ height: "100vh",
1347
+ width: "100vw",
1348
+ position: "fixed",
1349
+ top: 0,
1350
+ left: 0,
1351
+ zIndex: 2,
1352
+ background: "neutral0",
1353
+ children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Error, {})
1354
+ });
1355
+ }
1356
+ return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
1357
+ height: "100vh",
1358
+ width: "100vw",
1359
+ position: "fixed",
1360
+ top: 0,
1361
+ left: 0,
1362
+ zIndex: 2,
1363
+ background: "neutral0",
1364
+ children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Protect, {
1365
+ permissions: permissions,
1366
+ children: ({ permissions })=>/*#__PURE__*/ jsxRuntime.jsx(index.DocumentRBAC, {
1367
+ permissions: permissions,
1368
+ children: /*#__PURE__*/ jsxRuntime.jsx(HistoryPage, {})
1369
+ })
1370
+ })
1371
+ });
1372
+ };
1373
+ const ProtectedHistoryPage = ()=>{
1374
+ return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Portal, {
1375
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.FocusTrap, {
1376
+ children: /*#__PURE__*/ jsxRuntime.jsx(ProtectedHistoryPageImpl, {})
1377
+ })
1378
+ });
1379
+ };
1380
+
1381
+ exports.HistoryProvider = HistoryProvider;
1382
+ exports.ProtectedHistoryPage = ProtectedHistoryPage;
1383
+ exports.useHistoryContext = useHistoryContext;
1384
+ //# sourceMappingURL=History-Cv3uNjvV.js.map