@strapi/content-manager 0.0.0-next.bffd3c1819cd08304e7d270e88b4973e9fcbc183 → 0.0.0-next.c22d1aa5024dc77092c3df7e990ad89dcd79e7b0

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 (442) hide show
  1. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js +80 -0
  2. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js.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-Co2eC_-C.js +276 -0
  6. package/dist/admin/chunks/ComponentConfigurationPage-Co2eC_-C.js.map +1 -0
  7. package/dist/admin/chunks/ComponentConfigurationPage-Dj1bNvEF.js +298 -0
  8. package/dist/admin/chunks/ComponentConfigurationPage-Dj1bNvEF.js.map +1 -0
  9. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js +153 -0
  10. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js.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-Dm5woBp9.js +180 -0
  14. package/dist/admin/chunks/EditConfigurationPage-Dm5woBp9.js.map +1 -0
  15. package/dist/admin/chunks/EditConfigurationPage-zd9OLaVh.js +158 -0
  16. package/dist/admin/chunks/EditConfigurationPage-zd9OLaVh.js.map +1 -0
  17. package/dist/admin/chunks/EditViewPage-DsBKmSPb.js +337 -0
  18. package/dist/admin/chunks/EditViewPage-DsBKmSPb.js.map +1 -0
  19. package/dist/admin/chunks/EditViewPage-kAIaYTg0.js +314 -0
  20. package/dist/admin/chunks/EditViewPage-kAIaYTg0.js.map +1 -0
  21. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js +56 -0
  22. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js.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-BO69oITe.js +955 -0
  26. package/dist/admin/chunks/Form-BO69oITe.js.map +1 -0
  27. package/dist/admin/chunks/Form-BPIhJKyf.js +978 -0
  28. package/dist/admin/chunks/Form-BPIhJKyf.js.map +1 -0
  29. package/dist/admin/chunks/History-BzvpM-Gw.js +1357 -0
  30. package/dist/admin/chunks/History-BzvpM-Gw.js.map +1 -0
  31. package/dist/admin/chunks/History-DBQ96jv2.js +1380 -0
  32. package/dist/admin/chunks/History-DBQ96jv2.js.map +1 -0
  33. package/dist/admin/chunks/Input-BlDcbhUC.js +6755 -0
  34. package/dist/admin/chunks/Input-BlDcbhUC.js.map +1 -0
  35. package/dist/admin/chunks/Input-Dh1MtWno.js +6786 -0
  36. package/dist/admin/chunks/Input-Dh1MtWno.js.map +1 -0
  37. package/dist/admin/chunks/ListConfigurationPage-8d3BsQIr.js +818 -0
  38. package/dist/admin/chunks/ListConfigurationPage-8d3BsQIr.js.map +1 -0
  39. package/dist/admin/chunks/ListConfigurationPage-DK0ARecn.js +795 -0
  40. package/dist/admin/chunks/ListConfigurationPage-DK0ARecn.js.map +1 -0
  41. package/dist/admin/chunks/ListViewPage-BF2q7N6W.js +1132 -0
  42. package/dist/admin/chunks/ListViewPage-BF2q7N6W.js.map +1 -0
  43. package/dist/admin/chunks/ListViewPage-CS1ED-vI.js +1154 -0
  44. package/dist/admin/chunks/ListViewPage-CS1ED-vI.js.map +1 -0
  45. package/dist/admin/chunks/NoContentTypePage-C5Qxz3I4.js +59 -0
  46. package/dist/admin/chunks/NoContentTypePage-C5Qxz3I4.js.map +1 -0
  47. package/dist/admin/chunks/NoContentTypePage-DjdXr1-j.js +57 -0
  48. package/dist/admin/chunks/NoContentTypePage-DjdXr1-j.js.map +1 -0
  49. package/dist/admin/chunks/NoPermissionsPage-BUwtKUEP.js +36 -0
  50. package/dist/admin/chunks/NoPermissionsPage-BUwtKUEP.js.map +1 -0
  51. package/dist/admin/chunks/NoPermissionsPage-C5dC0MtL.js +38 -0
  52. package/dist/admin/chunks/NoPermissionsPage-C5dC0MtL.js.map +1 -0
  53. package/dist/admin/chunks/Preview-C9kXTY6C.js +531 -0
  54. package/dist/admin/chunks/Preview-C9kXTY6C.js.map +1 -0
  55. package/dist/admin/chunks/Preview-DBvmhR7Q.js +553 -0
  56. package/dist/admin/chunks/Preview-DBvmhR7Q.js.map +1 -0
  57. package/dist/admin/chunks/Relations-Cn0atFpd.js +827 -0
  58. package/dist/admin/chunks/Relations-Cn0atFpd.js.map +1 -0
  59. package/dist/admin/chunks/Relations-XHxDKEvT.js +853 -0
  60. package/dist/admin/chunks/Relations-XHxDKEvT.js.map +1 -0
  61. package/dist/admin/chunks/ar-DckYq_WK.js +222 -0
  62. package/dist/admin/chunks/ar-DckYq_WK.js.map +1 -0
  63. package/dist/admin/chunks/ar-DeQBSsfl.js +227 -0
  64. package/dist/{_chunks/ru-BT3ybNny.js.map → admin/chunks/ar-DeQBSsfl.js.map} +1 -1
  65. package/dist/admin/chunks/ca-ClDTvatJ.js +202 -0
  66. package/dist/admin/chunks/ca-ClDTvatJ.js.map +1 -0
  67. package/dist/admin/chunks/ca-DviY7mRj.js +197 -0
  68. package/dist/{_chunks/de-CCEmbAah.js.map → admin/chunks/ca-DviY7mRj.js.map} +1 -1
  69. package/dist/admin/chunks/cs-BJFxwIWj.js +126 -0
  70. package/dist/{_chunks/ms-BuFotyP_.js.map → admin/chunks/cs-BJFxwIWj.js.map} +1 -1
  71. package/dist/admin/chunks/cs-C7OSYFQ7.js +122 -0
  72. package/dist/{_chunks/cs-CkJy6B2v.js.map → admin/chunks/cs-C7OSYFQ7.js.map} +1 -1
  73. package/dist/admin/chunks/de-5QRlDHyR.js +195 -0
  74. package/dist/{_chunks/ja-7sfIbjxE.js.map → admin/chunks/de-5QRlDHyR.js.map} +1 -1
  75. package/dist/admin/chunks/de-CbImAUA5.js +200 -0
  76. package/dist/{_chunks/gu-BRmF601H.js.map → admin/chunks/de-CbImAUA5.js.map} +1 -1
  77. package/dist/admin/chunks/en-C1CjdAtC.js +313 -0
  78. package/dist/{_chunks/en-D65uIF6Y.mjs.map → admin/chunks/en-C1CjdAtC.js.map} +1 -1
  79. package/dist/admin/chunks/en-LfhocNG2.js +308 -0
  80. package/dist/{_chunks/en-BR48D_RH.js.map → admin/chunks/en-LfhocNG2.js.map} +1 -1
  81. package/dist/admin/chunks/es-C8vLuvZL.js +197 -0
  82. package/dist/admin/chunks/es-C8vLuvZL.js.map +1 -0
  83. package/dist/admin/chunks/es-DkoWSExG.js +192 -0
  84. package/dist/{_chunks/ko-woFZPmLk.js.map → admin/chunks/es-DkoWSExG.js.map} +1 -1
  85. package/dist/admin/chunks/eu-BG1xX7HK.js +198 -0
  86. package/dist/admin/chunks/eu-BG1xX7HK.js.map +1 -0
  87. package/dist/admin/chunks/eu-BJW3AvXu.js +203 -0
  88. package/dist/admin/chunks/eu-BJW3AvXu.js.map +1 -0
  89. package/dist/admin/chunks/fr-CFdRaRVj.js +215 -0
  90. package/dist/admin/chunks/fr-CFdRaRVj.js.map +1 -0
  91. package/dist/admin/chunks/fr-gQSilC7w.js +220 -0
  92. package/dist/admin/chunks/fr-gQSilC7w.js.map +1 -0
  93. package/dist/admin/chunks/gu-D5MMMXRs.js +196 -0
  94. package/dist/admin/chunks/gu-D5MMMXRs.js.map +1 -0
  95. package/dist/admin/chunks/gu-DPU4wyx7.js +201 -0
  96. package/dist/{_chunks/eu-VDH-3ovk.js.map → admin/chunks/gu-DPU4wyx7.js.map} +1 -1
  97. package/dist/admin/chunks/hi-Dp4omeBb.js +201 -0
  98. package/dist/admin/chunks/hi-Dp4omeBb.js.map +1 -0
  99. package/dist/admin/chunks/hi-lp17SCjr.js +196 -0
  100. package/dist/admin/chunks/hi-lp17SCjr.js.map +1 -0
  101. package/dist/{_chunks/hooks-BAaaKPS_.js → admin/chunks/hooks-D-sOYd1s.js} +6 -3
  102. package/dist/admin/chunks/hooks-D-sOYd1s.js.map +1 -0
  103. package/dist/admin/chunks/hooks-DMvik5y_.js +7 -0
  104. package/dist/admin/chunks/hooks-DMvik5y_.js.map +1 -0
  105. package/dist/admin/chunks/hu-CLka1U2C.js +198 -0
  106. package/dist/admin/chunks/hu-CLka1U2C.js.map +1 -0
  107. package/dist/admin/chunks/hu-CtFJuhTd.js +203 -0
  108. package/dist/admin/chunks/hu-CtFJuhTd.js.map +1 -0
  109. package/dist/admin/chunks/id-D7V5S1rB.js +161 -0
  110. package/dist/{_chunks/it-DkBIs7vD.js.map → admin/chunks/id-D7V5S1rB.js.map} +1 -1
  111. package/dist/admin/chunks/id-USfY9m1g.js +156 -0
  112. package/dist/admin/chunks/id-USfY9m1g.js.map +1 -0
  113. package/dist/admin/chunks/index-BczuAULz.js +5416 -0
  114. package/dist/admin/chunks/index-BczuAULz.js.map +1 -0
  115. package/dist/admin/chunks/index-BkyR-Bnu.js +5350 -0
  116. package/dist/admin/chunks/index-BkyR-Bnu.js.map +1 -0
  117. package/dist/admin/chunks/it-BAHrwmYS.js +158 -0
  118. package/dist/admin/chunks/it-BAHrwmYS.js.map +1 -0
  119. package/dist/admin/chunks/it-CQFpa_Dc.js +163 -0
  120. package/dist/{_chunks/es-9K52xZIr.js.map → admin/chunks/it-CQFpa_Dc.js.map} +1 -1
  121. package/dist/admin/chunks/ja-BWKmBJFT.js +192 -0
  122. package/dist/admin/chunks/ja-BWKmBJFT.js.map +1 -0
  123. package/dist/admin/chunks/ja-jdQM-B79.js +197 -0
  124. package/dist/admin/chunks/ja-jdQM-B79.js.map +1 -0
  125. package/dist/admin/chunks/ko-CgADGBNt.js +191 -0
  126. package/dist/admin/chunks/ko-CgADGBNt.js.map +1 -0
  127. package/dist/admin/chunks/ko-k46sEyzt.js +196 -0
  128. package/dist/admin/chunks/ko-k46sEyzt.js.map +1 -0
  129. package/dist/admin/chunks/layout-DcDoRT8g.js +618 -0
  130. package/dist/admin/chunks/layout-DcDoRT8g.js.map +1 -0
  131. package/dist/admin/chunks/layout-fghBgRgX.js +598 -0
  132. package/dist/admin/chunks/layout-fghBgRgX.js.map +1 -0
  133. package/dist/admin/chunks/ml-CnhCfOn_.js +196 -0
  134. package/dist/admin/chunks/ml-CnhCfOn_.js.map +1 -0
  135. package/dist/admin/chunks/ml-DqxPwODx.js +201 -0
  136. package/dist/admin/chunks/ml-DqxPwODx.js.map +1 -0
  137. package/dist/admin/chunks/ms-Bh09NFff.js +140 -0
  138. package/dist/{_chunks/uk-C8EiqJY7.js.map → admin/chunks/ms-Bh09NFff.js.map} +1 -1
  139. package/dist/admin/chunks/ms-CvSC0OdG.js +145 -0
  140. package/dist/admin/chunks/ms-CvSC0OdG.js.map +1 -0
  141. package/dist/admin/chunks/nl-BEubhS8C.js +203 -0
  142. package/dist/admin/chunks/nl-BEubhS8C.js.map +1 -0
  143. package/dist/admin/chunks/nl-C8HYflTc.js +198 -0
  144. package/dist/admin/chunks/nl-C8HYflTc.js.map +1 -0
  145. package/dist/admin/chunks/objects-C3EebVVe.js +76 -0
  146. package/dist/admin/chunks/objects-C3EebVVe.js.map +1 -0
  147. package/dist/admin/chunks/objects-wl73iEma.js +73 -0
  148. package/dist/admin/chunks/objects-wl73iEma.js.map +1 -0
  149. package/dist/admin/chunks/pl-DWhGDzmM.js +200 -0
  150. package/dist/{_chunks/ca-Cmk45QO6.js.map → admin/chunks/pl-DWhGDzmM.js.map} +1 -1
  151. package/dist/admin/chunks/pl-MFCZJZuZ.js +195 -0
  152. package/dist/admin/chunks/pl-MFCZJZuZ.js.map +1 -0
  153. package/dist/admin/chunks/pt-BR-CPtAXD-4.js +202 -0
  154. package/dist/admin/chunks/pt-BR-CPtAXD-4.js.map +1 -0
  155. package/dist/admin/chunks/pt-BR-CcotyBGJ.js +197 -0
  156. package/dist/{_chunks/pt-BR-BiOz37D9.js.map → admin/chunks/pt-BR-CcotyBGJ.js.map} +1 -1
  157. package/dist/admin/chunks/pt-BoPxN80n.js +96 -0
  158. package/dist/admin/chunks/pt-BoPxN80n.js.map +1 -0
  159. package/dist/admin/chunks/pt-HbmgeiYO.js +93 -0
  160. package/dist/admin/chunks/pt-HbmgeiYO.js.map +1 -0
  161. package/dist/admin/chunks/relations-CgaydhiM.js +178 -0
  162. package/dist/admin/chunks/relations-CgaydhiM.js.map +1 -0
  163. package/dist/admin/chunks/relations-DPVgU_rq.js +173 -0
  164. package/dist/admin/chunks/relations-DPVgU_rq.js.map +1 -0
  165. package/dist/admin/chunks/ru-C0op0ALG.js +232 -0
  166. package/dist/admin/chunks/ru-C0op0ALG.js.map +1 -0
  167. package/dist/admin/chunks/ru-CB4BUyQp.js +230 -0
  168. package/dist/admin/chunks/ru-CB4BUyQp.js.map +1 -0
  169. package/dist/admin/chunks/sa-B_FuPyMw.js +201 -0
  170. package/dist/admin/chunks/sa-B_FuPyMw.js.map +1 -0
  171. package/dist/admin/chunks/sa-n_aPA-pU.js +196 -0
  172. package/dist/admin/chunks/sa-n_aPA-pU.js.map +1 -0
  173. package/dist/admin/chunks/sk-D_iXML2C.js +203 -0
  174. package/dist/admin/chunks/sk-D_iXML2C.js.map +1 -0
  175. package/dist/admin/chunks/sk-tn_BDjE2.js +198 -0
  176. package/dist/admin/chunks/sk-tn_BDjE2.js.map +1 -0
  177. package/dist/admin/chunks/sv-BstBC1Yp.js +203 -0
  178. package/dist/admin/chunks/sv-BstBC1Yp.js.map +1 -0
  179. package/dist/admin/chunks/sv-cq4ZrQRd.js +198 -0
  180. package/dist/admin/chunks/sv-cq4ZrQRd.js.map +1 -0
  181. package/dist/admin/chunks/th-lXoOCqPC.js +149 -0
  182. package/dist/{_chunks/th-D9_GfAjc.js.map → admin/chunks/th-lXoOCqPC.js.map} +1 -1
  183. package/dist/admin/chunks/th-mUH7hEtc.js +144 -0
  184. package/dist/admin/chunks/th-mUH7hEtc.js.map +1 -0
  185. package/dist/admin/chunks/tr-CkS6sLIE.js +200 -0
  186. package/dist/admin/chunks/tr-CkS6sLIE.js.map +1 -0
  187. package/dist/admin/chunks/tr-Yt38daxh.js +195 -0
  188. package/dist/admin/chunks/tr-Yt38daxh.js.map +1 -0
  189. package/dist/admin/chunks/uk-B24MoTVg.js +145 -0
  190. package/dist/admin/chunks/uk-B24MoTVg.js.map +1 -0
  191. package/dist/admin/chunks/uk-Cpgmm7gE.js +140 -0
  192. package/dist/admin/chunks/uk-Cpgmm7gE.js.map +1 -0
  193. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js +247 -0
  194. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js.map +1 -0
  195. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js +271 -0
  196. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js.map +1 -0
  197. package/dist/admin/chunks/usePrev-Bjw2dhmq.js +18 -0
  198. package/dist/admin/chunks/usePrev-Bjw2dhmq.js.map +1 -0
  199. package/dist/admin/chunks/usePrev-DIYl-IAL.js +21 -0
  200. package/dist/admin/chunks/usePrev-DIYl-IAL.js.map +1 -0
  201. package/dist/admin/chunks/vi-BGr1X_HZ.js +112 -0
  202. package/dist/admin/chunks/vi-BGr1X_HZ.js.map +1 -0
  203. package/dist/admin/chunks/vi-CvBGlTjr.js +108 -0
  204. package/dist/{_chunks/vi-CJlYDheJ.js.map → admin/chunks/vi-CvBGlTjr.js.map} +1 -1
  205. package/dist/admin/chunks/zh-BmF-sHaT.js +205 -0
  206. package/dist/admin/chunks/zh-BmF-sHaT.js.map +1 -0
  207. package/dist/admin/chunks/zh-DwFu_Kfj.js +210 -0
  208. package/dist/admin/chunks/zh-DwFu_Kfj.js.map +1 -0
  209. package/dist/admin/chunks/zh-Hans-CI0HKio3.js +934 -0
  210. package/dist/{_chunks/zh-Hans-9kOncHGw.js.map → admin/chunks/zh-Hans-CI0HKio3.js.map} +1 -1
  211. package/dist/admin/chunks/zh-Hans-JVK9x7xr.js +953 -0
  212. package/dist/{_chunks/zh-Hans-BPQcRIyH.mjs.map → admin/chunks/zh-Hans-JVK9x7xr.js.map} +1 -1
  213. package/dist/admin/index.js +23 -4
  214. package/dist/admin/index.js.map +1 -1
  215. package/dist/admin/index.mjs +16 -13
  216. package/dist/admin/index.mjs.map +1 -1
  217. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  218. package/dist/admin/src/hooks/useDocument.d.ts +2 -2
  219. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -1
  220. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -1
  221. package/dist/admin/src/preview/index.d.ts +2 -3
  222. package/dist/server/index.js +5459 -4387
  223. package/dist/server/index.js.map +1 -1
  224. package/dist/server/index.mjs +5446 -4372
  225. package/dist/server/index.mjs.map +1 -1
  226. package/dist/server/src/controllers/utils/metadata.d.ts +1 -1
  227. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  228. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  229. package/dist/server/src/services/utils/count.d.ts +1 -1
  230. package/dist/server/src/services/utils/count.d.ts.map +1 -1
  231. package/dist/server/src/services/utils/populate.d.ts +1 -1
  232. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  233. package/dist/shared/contracts/collection-types.d.ts +0 -1
  234. package/dist/shared/contracts/components.d.ts +0 -1
  235. package/dist/shared/contracts/content-types.d.ts +0 -1
  236. package/dist/shared/contracts/history-versions.d.ts +0 -1
  237. package/dist/shared/contracts/index.d.ts +0 -1
  238. package/dist/shared/contracts/init.d.ts +0 -1
  239. package/dist/shared/contracts/preview.d.ts +0 -1
  240. package/dist/shared/contracts/relations.d.ts +1 -2
  241. package/dist/shared/contracts/relations.d.ts.map +1 -1
  242. package/dist/shared/contracts/review-workflows.d.ts +0 -1
  243. package/dist/shared/contracts/single-types.d.ts +0 -1
  244. package/dist/shared/contracts/uid.d.ts +0 -1
  245. package/dist/shared/index.d.ts +0 -1
  246. package/dist/shared/index.js +35 -24
  247. package/dist/shared/index.js.map +1 -1
  248. package/dist/shared/index.mjs +34 -25
  249. package/dist/shared/index.mjs.map +1 -1
  250. package/package.json +13 -10
  251. package/dist/_chunks/CardDragPreview-C0QyJgRA.js +0 -69
  252. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +0 -1
  253. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs +0 -70
  254. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +0 -1
  255. package/dist/_chunks/ComponentConfigurationPage-9_4yUE9L.mjs +0 -236
  256. package/dist/_chunks/ComponentConfigurationPage-9_4yUE9L.mjs.map +0 -1
  257. package/dist/_chunks/ComponentConfigurationPage-DBSh-kET.js +0 -254
  258. package/dist/_chunks/ComponentConfigurationPage-DBSh-kET.js.map +0 -1
  259. package/dist/_chunks/ComponentIcon-CRbtQEUV.js +0 -175
  260. package/dist/_chunks/ComponentIcon-CRbtQEUV.js.map +0 -1
  261. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs +0 -157
  262. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +0 -1
  263. package/dist/_chunks/EditConfigurationPage-Bl_U2JgH.js +0 -150
  264. package/dist/_chunks/EditConfigurationPage-Bl_U2JgH.js.map +0 -1
  265. package/dist/_chunks/EditConfigurationPage-COe6hjPC.mjs +0 -132
  266. package/dist/_chunks/EditConfigurationPage-COe6hjPC.mjs.map +0 -1
  267. package/dist/_chunks/EditViewPage-D4yFJET6.js +0 -209
  268. package/dist/_chunks/EditViewPage-D4yFJET6.js.map +0 -1
  269. package/dist/_chunks/EditViewPage-DrmVmYN0.mjs +0 -191
  270. package/dist/_chunks/EditViewPage-DrmVmYN0.mjs.map +0 -1
  271. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +0 -50
  272. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +0 -1
  273. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +0 -49
  274. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +0 -1
  275. package/dist/_chunks/Form-C4rSaGsz.js +0 -778
  276. package/dist/_chunks/Form-C4rSaGsz.js.map +0 -1
  277. package/dist/_chunks/Form-DamaxNpG.mjs +0 -758
  278. package/dist/_chunks/Form-DamaxNpG.mjs.map +0 -1
  279. package/dist/_chunks/History-D1PreDSY.mjs +0 -999
  280. package/dist/_chunks/History-D1PreDSY.mjs.map +0 -1
  281. package/dist/_chunks/History-DTm8UCCQ.js +0 -1019
  282. package/dist/_chunks/History-DTm8UCCQ.js.map +0 -1
  283. package/dist/_chunks/Input-B7sapvBG.js +0 -5617
  284. package/dist/_chunks/Input-B7sapvBG.js.map +0 -1
  285. package/dist/_chunks/Input-CZ1YvjHR.mjs +0 -5585
  286. package/dist/_chunks/Input-CZ1YvjHR.mjs.map +0 -1
  287. package/dist/_chunks/ListConfigurationPage-Bbi32isk.mjs +0 -633
  288. package/dist/_chunks/ListConfigurationPage-Bbi32isk.mjs.map +0 -1
  289. package/dist/_chunks/ListConfigurationPage-ysFMjKI3.js +0 -652
  290. package/dist/_chunks/ListConfigurationPage-ysFMjKI3.js.map +0 -1
  291. package/dist/_chunks/ListViewPage-Bud_jBDQ.mjs +0 -854
  292. package/dist/_chunks/ListViewPage-Bud_jBDQ.mjs.map +0 -1
  293. package/dist/_chunks/ListViewPage-DTuuxU3n.js +0 -877
  294. package/dist/_chunks/ListViewPage-DTuuxU3n.js.map +0 -1
  295. package/dist/_chunks/NoContentTypePage-CL7VVeYs.js +0 -51
  296. package/dist/_chunks/NoContentTypePage-CL7VVeYs.js.map +0 -1
  297. package/dist/_chunks/NoContentTypePage-DVhkugsf.mjs +0 -51
  298. package/dist/_chunks/NoContentTypePage-DVhkugsf.mjs.map +0 -1
  299. package/dist/_chunks/NoPermissionsPage-CMdM-dCo.mjs +0 -23
  300. package/dist/_chunks/NoPermissionsPage-CMdM-dCo.mjs.map +0 -1
  301. package/dist/_chunks/NoPermissionsPage-v7I599vC.js +0 -23
  302. package/dist/_chunks/NoPermissionsPage-v7I599vC.js.map +0 -1
  303. package/dist/_chunks/Preview-BNuU0SuQ.mjs +0 -287
  304. package/dist/_chunks/Preview-BNuU0SuQ.mjs.map +0 -1
  305. package/dist/_chunks/Preview-Cxq-uI6D.js +0 -305
  306. package/dist/_chunks/Preview-Cxq-uI6D.js.map +0 -1
  307. package/dist/_chunks/Relations-C2Ahkrdg.mjs +0 -728
  308. package/dist/_chunks/Relations-C2Ahkrdg.mjs.map +0 -1
  309. package/dist/_chunks/Relations-CWS79QQn.js +0 -747
  310. package/dist/_chunks/Relations-CWS79QQn.js.map +0 -1
  311. package/dist/_chunks/ar-BUUWXIYu.js +0 -226
  312. package/dist/_chunks/ar-BUUWXIYu.js.map +0 -1
  313. package/dist/_chunks/ar-CCEVvqGG.mjs +0 -226
  314. package/dist/_chunks/ar-CCEVvqGG.mjs.map +0 -1
  315. package/dist/_chunks/ca-5U32ON2v.mjs +0 -201
  316. package/dist/_chunks/ca-5U32ON2v.mjs.map +0 -1
  317. package/dist/_chunks/ca-Cmk45QO6.js +0 -201
  318. package/dist/_chunks/cs-CM2aBUar.mjs +0 -125
  319. package/dist/_chunks/cs-CM2aBUar.mjs.map +0 -1
  320. package/dist/_chunks/cs-CkJy6B2v.js +0 -125
  321. package/dist/_chunks/de-C72KDNOl.mjs +0 -199
  322. package/dist/_chunks/de-C72KDNOl.mjs.map +0 -1
  323. package/dist/_chunks/de-CCEmbAah.js +0 -199
  324. package/dist/_chunks/en-BR48D_RH.js +0 -312
  325. package/dist/_chunks/en-D65uIF6Y.mjs +0 -312
  326. package/dist/_chunks/es-9K52xZIr.js +0 -196
  327. package/dist/_chunks/es-D34tqjMw.mjs +0 -196
  328. package/dist/_chunks/es-D34tqjMw.mjs.map +0 -1
  329. package/dist/_chunks/eu-CdALomew.mjs +0 -202
  330. package/dist/_chunks/eu-CdALomew.mjs.map +0 -1
  331. package/dist/_chunks/eu-VDH-3ovk.js +0 -202
  332. package/dist/_chunks/fr-C43IbhA_.js +0 -219
  333. package/dist/_chunks/fr-C43IbhA_.js.map +0 -1
  334. package/dist/_chunks/fr-DBseuRuB.mjs +0 -219
  335. package/dist/_chunks/fr-DBseuRuB.mjs.map +0 -1
  336. package/dist/_chunks/gu-BRmF601H.js +0 -200
  337. package/dist/_chunks/gu-CNpaMDpH.mjs +0 -200
  338. package/dist/_chunks/gu-CNpaMDpH.mjs.map +0 -1
  339. package/dist/_chunks/hi-CCJBptSq.js +0 -200
  340. package/dist/_chunks/hi-CCJBptSq.js.map +0 -1
  341. package/dist/_chunks/hi-Dwvd04m3.mjs +0 -200
  342. package/dist/_chunks/hi-Dwvd04m3.mjs.map +0 -1
  343. package/dist/_chunks/hooks-BAaaKPS_.js.map +0 -1
  344. package/dist/_chunks/hooks-E5u1mcgM.mjs +0 -8
  345. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +0 -1
  346. package/dist/_chunks/hu-CeYvaaO0.mjs +0 -202
  347. package/dist/_chunks/hu-CeYvaaO0.mjs.map +0 -1
  348. package/dist/_chunks/hu-sNV_yLYy.js +0 -202
  349. package/dist/_chunks/hu-sNV_yLYy.js.map +0 -1
  350. package/dist/_chunks/id-B5Ser98A.js +0 -160
  351. package/dist/_chunks/id-B5Ser98A.js.map +0 -1
  352. package/dist/_chunks/id-BtwA9WJT.mjs +0 -160
  353. package/dist/_chunks/id-BtwA9WJT.mjs.map +0 -1
  354. package/dist/_chunks/index-DQsvBb_N.js +0 -4500
  355. package/dist/_chunks/index-DQsvBb_N.js.map +0 -1
  356. package/dist/_chunks/index-ZKrsjv-2.mjs +0 -4481
  357. package/dist/_chunks/index-ZKrsjv-2.mjs.map +0 -1
  358. package/dist/_chunks/it-BrVPqaf1.mjs +0 -162
  359. package/dist/_chunks/it-BrVPqaf1.mjs.map +0 -1
  360. package/dist/_chunks/it-DkBIs7vD.js +0 -162
  361. package/dist/_chunks/ja-7sfIbjxE.js +0 -196
  362. package/dist/_chunks/ja-BHqhDq4V.mjs +0 -196
  363. package/dist/_chunks/ja-BHqhDq4V.mjs.map +0 -1
  364. package/dist/_chunks/ko-HVQRlfUI.mjs +0 -195
  365. package/dist/_chunks/ko-HVQRlfUI.mjs.map +0 -1
  366. package/dist/_chunks/ko-woFZPmLk.js +0 -195
  367. package/dist/_chunks/layout-Cl0NhlQB.js +0 -488
  368. package/dist/_chunks/layout-Cl0NhlQB.js.map +0 -1
  369. package/dist/_chunks/layout-fQk1rMk9.mjs +0 -471
  370. package/dist/_chunks/layout-fQk1rMk9.mjs.map +0 -1
  371. package/dist/_chunks/ml-BihZwQit.mjs +0 -200
  372. package/dist/_chunks/ml-BihZwQit.mjs.map +0 -1
  373. package/dist/_chunks/ml-C2W8N8k1.js +0 -200
  374. package/dist/_chunks/ml-C2W8N8k1.js.map +0 -1
  375. package/dist/_chunks/ms-BuFotyP_.js +0 -144
  376. package/dist/_chunks/ms-m_WjyWx7.mjs +0 -144
  377. package/dist/_chunks/ms-m_WjyWx7.mjs.map +0 -1
  378. package/dist/_chunks/nl-D4R9gHx5.mjs +0 -202
  379. package/dist/_chunks/nl-D4R9gHx5.mjs.map +0 -1
  380. package/dist/_chunks/nl-bbEOHChV.js +0 -202
  381. package/dist/_chunks/nl-bbEOHChV.js.map +0 -1
  382. package/dist/_chunks/objects-BcXOv6_9.js +0 -47
  383. package/dist/_chunks/objects-BcXOv6_9.js.map +0 -1
  384. package/dist/_chunks/objects-D6yBsdmx.mjs +0 -45
  385. package/dist/_chunks/objects-D6yBsdmx.mjs.map +0 -1
  386. package/dist/_chunks/pl-sbx9mSt_.mjs +0 -199
  387. package/dist/_chunks/pl-sbx9mSt_.mjs.map +0 -1
  388. package/dist/_chunks/pl-uzwG-hk7.js +0 -199
  389. package/dist/_chunks/pl-uzwG-hk7.js.map +0 -1
  390. package/dist/_chunks/pt-BR-BiOz37D9.js +0 -201
  391. package/dist/_chunks/pt-BR-C71iDxnh.mjs +0 -201
  392. package/dist/_chunks/pt-BR-C71iDxnh.mjs.map +0 -1
  393. package/dist/_chunks/pt-BsaFvS8-.mjs +0 -95
  394. package/dist/_chunks/pt-BsaFvS8-.mjs.map +0 -1
  395. package/dist/_chunks/pt-CeXQuq50.js +0 -95
  396. package/dist/_chunks/pt-CeXQuq50.js.map +0 -1
  397. package/dist/_chunks/relations-BRfBxVbX.js +0 -133
  398. package/dist/_chunks/relations-BRfBxVbX.js.map +0 -1
  399. package/dist/_chunks/relations-BakOFl_1.mjs +0 -134
  400. package/dist/_chunks/relations-BakOFl_1.mjs.map +0 -1
  401. package/dist/_chunks/ru-BE6A4Exp.mjs +0 -231
  402. package/dist/_chunks/ru-BE6A4Exp.mjs.map +0 -1
  403. package/dist/_chunks/ru-BT3ybNny.js +0 -231
  404. package/dist/_chunks/sa-CcvkYInH.js +0 -200
  405. package/dist/_chunks/sa-CcvkYInH.js.map +0 -1
  406. package/dist/_chunks/sa-Dag0k-Z8.mjs +0 -200
  407. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +0 -1
  408. package/dist/_chunks/sk-BFg-R8qJ.mjs +0 -202
  409. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +0 -1
  410. package/dist/_chunks/sk-CvY09Xjv.js +0 -202
  411. package/dist/_chunks/sk-CvY09Xjv.js.map +0 -1
  412. package/dist/_chunks/sv-CUnfWGsh.mjs +0 -202
  413. package/dist/_chunks/sv-CUnfWGsh.mjs.map +0 -1
  414. package/dist/_chunks/sv-MYDuzgvT.js +0 -202
  415. package/dist/_chunks/sv-MYDuzgvT.js.map +0 -1
  416. package/dist/_chunks/th-BqbI8lIT.mjs +0 -148
  417. package/dist/_chunks/th-BqbI8lIT.mjs.map +0 -1
  418. package/dist/_chunks/th-D9_GfAjc.js +0 -148
  419. package/dist/_chunks/tr-CgeK3wJM.mjs +0 -199
  420. package/dist/_chunks/tr-CgeK3wJM.mjs.map +0 -1
  421. package/dist/_chunks/tr-D9UH-O_R.js +0 -199
  422. package/dist/_chunks/tr-D9UH-O_R.js.map +0 -1
  423. package/dist/_chunks/uk-C8EiqJY7.js +0 -144
  424. package/dist/_chunks/uk-CR-zDhAY.mjs +0 -144
  425. package/dist/_chunks/uk-CR-zDhAY.mjs.map +0 -1
  426. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js +0 -245
  427. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js.map +0 -1
  428. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs +0 -228
  429. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs.map +0 -1
  430. package/dist/_chunks/usePrev-CZGy2Vjf.mjs +0 -29
  431. package/dist/_chunks/usePrev-CZGy2Vjf.mjs.map +0 -1
  432. package/dist/_chunks/usePrev-D5J_2fEu.js +0 -28
  433. package/dist/_chunks/usePrev-D5J_2fEu.js.map +0 -1
  434. package/dist/_chunks/vi-CJlYDheJ.js +0 -111
  435. package/dist/_chunks/vi-DUXIk_fw.mjs +0 -111
  436. package/dist/_chunks/vi-DUXIk_fw.mjs.map +0 -1
  437. package/dist/_chunks/zh-BWZspA60.mjs +0 -209
  438. package/dist/_chunks/zh-BWZspA60.mjs.map +0 -1
  439. package/dist/_chunks/zh-CQQfszqR.js +0 -209
  440. package/dist/_chunks/zh-CQQfszqR.js.map +0 -1
  441. package/dist/_chunks/zh-Hans-9kOncHGw.js +0 -952
  442. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +0 -952
@@ -1,999 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import { useForm, useStrapiApp, InputRenderer, useField, Form, Layouts, useTracking, useNotification, useQueryParams, useRBAC, ConfirmDialog, createContext, Page } from "@strapi/admin/strapi-admin";
4
- import { Alert, Link, Flex, Field, Box, Tooltip, Typography, Divider, Grid, Dialog, Button, Portal, FocusTrap, Main } from "@strapi/design-system";
5
- import { stringify } from "qs";
6
- import { useIntl } from "react-intl";
7
- import { NavLink, useNavigate, useParams, Link as Link$1, Navigate } from "react-router-dom";
8
- import { c as useDoc, f as useDocumentRBAC, m as useDocLayout, C as COLLECTION_TYPES, D as DocumentStatus, K as removeFieldsThatDontExistOnSchema, L as prepareTempKeys, e as contentManagerApi, k as PERMISSIONS, v as getDisplayName, R as RelativeTime, l as DocumentRBAC, M as useDocument, h as useDocumentLayout, p as useGetContentTypeConfigurationQuery, d as buildValidParams } from "./index-ZKrsjv-2.mjs";
9
- import pipe from "lodash/fp/pipe";
10
- import { u as useTypedSelector } from "./hooks-E5u1mcgM.mjs";
11
- import { ArrowLeft, WarningCircle } from "@strapi/icons";
12
- import { styled } from "styled-components";
13
- import { a as useDynamicZone, u as useLazyComponents, b as useFieldHint, N as NotAllowedInput, M as MemoizedUIDInput, c as MemoizedWysiwyg, D as DynamicZone, d as MemoizedComponentInput, e as MemoizedBlocksInput } from "./Input-CZ1YvjHR.mjs";
14
- import { g as getRelationLabel } from "./relations-BakOFl_1.mjs";
15
- const StyledAlert = styled(Alert).attrs({ closeLabel: "Close", onClose: () => {
16
- }, shadow: "none" })`
17
- button {
18
- display: none;
19
- }
20
- `;
21
- const LinkEllipsis = styled(Link)`
22
- display: block;
23
-
24
- & > span {
25
- white-space: nowrap;
26
- overflow: hidden;
27
- text-overflow: ellipsis;
28
- display: block;
29
- }
30
- `;
31
- const CustomRelationInput = (props) => {
32
- const { formatMessage } = useIntl();
33
- const field = useField(props.name);
34
- let formattedFieldValue;
35
- if (field) {
36
- formattedFieldValue = Array.isArray(field.value) ? { results: field.value, meta: { missingCount: 0 } } : field.value;
37
- }
38
- if (!formattedFieldValue || formattedFieldValue.results.length === 0 && formattedFieldValue.meta.missingCount === 0) {
39
- return /* @__PURE__ */ jsxs(Fragment, { children: [
40
- /* @__PURE__ */ jsx(Field.Label, { action: props.labelAction, children: props.label }),
41
- /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(StyledAlert, { variant: "default", children: formatMessage({
42
- id: "content-manager.history.content.no-relations",
43
- defaultMessage: "No relations."
44
- }) }) })
45
- ] });
46
- }
47
- const { results, meta } = formattedFieldValue;
48
- return /* @__PURE__ */ jsxs(Box, { children: [
49
- /* @__PURE__ */ jsx(Field.Label, { children: props.label }),
50
- results.length > 0 && /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 2, marginTop: 1, alignItems: "stretch", children: results.map((relationData) => {
51
- const { targetModel } = props.attribute;
52
- const href = `../${COLLECTION_TYPES}/${targetModel}/${relationData.documentId}`;
53
- const label = getRelationLabel(relationData, props.mainField);
54
- const isAdminUserRelation = targetModel === "admin::user";
55
- return /* @__PURE__ */ jsxs(
56
- Flex,
57
- {
58
- paddingTop: 2,
59
- paddingBottom: 2,
60
- paddingLeft: 4,
61
- paddingRight: 4,
62
- hasRadius: true,
63
- borderColor: "neutral200",
64
- background: "neutral150",
65
- justifyContent: "space-between",
66
- children: [
67
- /* @__PURE__ */ jsx(Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsx(Tooltip, { label, children: isAdminUserRelation ? /* @__PURE__ */ jsx(Typography, { children: label }) : /* @__PURE__ */ jsx(LinkEllipsis, { tag: NavLink, to: href, children: label }) }) }),
68
- /* @__PURE__ */ jsx(DocumentStatus, { status: relationData.status })
69
- ]
70
- },
71
- relationData.documentId ?? relationData.id
72
- );
73
- }) }),
74
- meta.missingCount > 0 && /* @ts-expect-error – we dont need closeLabel */
75
- /* @__PURE__ */ jsx(
76
- StyledAlert,
77
- {
78
- marginTop: 1,
79
- variant: "warning",
80
- title: formatMessage(
81
- {
82
- id: "content-manager.history.content.missing-relations.title",
83
- defaultMessage: "{number, plural, =1 {Missing relation} other {{number} missing relations}}"
84
- },
85
- { number: meta.missingCount }
86
- ),
87
- children: formatMessage(
88
- {
89
- id: "content-manager.history.content.missing-relations.message",
90
- defaultMessage: "{number, plural, =1 {It has} other {They have}} been deleted and can't be restored."
91
- },
92
- { number: meta.missingCount }
93
- )
94
- }
95
- )
96
- ] });
97
- };
98
- const createInitialValuesForPath = (keyPath, value) => {
99
- const keys = keyPath.split(".");
100
- const root = {};
101
- let node = root;
102
- keys.forEach((key, index) => {
103
- if (key === "__proto__" || key === "constructor") return;
104
- if (index === keys.length - 1) {
105
- node[key] = value;
106
- } else {
107
- node[key] = node[key] || {};
108
- }
109
- node = node[key];
110
- });
111
- return root;
112
- };
113
- const CustomMediaInput = (props) => {
114
- const { value } = useField(props.name);
115
- const results = value?.results ?? [];
116
- const meta = value?.meta ?? { missingCount: 0 };
117
- const { formatMessage } = useIntl();
118
- const fields = useStrapiApp("CustomMediaInput", (state) => state.fields);
119
- const MediaLibrary = fields.media;
120
- return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, alignItems: "stretch", children: [
121
- /* @__PURE__ */ jsx(
122
- Form,
123
- {
124
- method: "PUT",
125
- disabled: true,
126
- initialValues: createInitialValuesForPath(props.name, results),
127
- children: /* @__PURE__ */ jsx(MediaLibrary, { ...props, disabled: true, multiple: results.length > 1 })
128
- }
129
- ),
130
- meta.missingCount > 0 && /* @__PURE__ */ jsx(
131
- StyledAlert,
132
- {
133
- variant: "warning",
134
- closeLabel: "Close",
135
- onClose: () => {
136
- },
137
- title: formatMessage(
138
- {
139
- id: "content-manager.history.content.missing-assets.title",
140
- defaultMessage: "{number, plural, =1 {Missing asset} other {{number} missing assets}}"
141
- },
142
- { number: meta.missingCount }
143
- ),
144
- children: formatMessage(
145
- {
146
- id: "content-manager.history.content.missing-assets.message",
147
- defaultMessage: "{number, plural, =1 {It has} other {They have}} been deleted in the Media Library and can't be restored."
148
- },
149
- { number: meta.missingCount }
150
- )
151
- }
152
- )
153
- ] });
154
- };
155
- const getLabelAction = (labelAction) => {
156
- if (!React.isValidElement(labelAction)) {
157
- return labelAction;
158
- }
159
- const labelActionTitleId = labelAction.props.title.id;
160
- if (labelActionTitleId === "i18n.Field.localized") {
161
- return React.cloneElement(labelAction, {
162
- ...labelAction.props,
163
- title: {
164
- id: "history.content.localized",
165
- defaultMessage: "This value is specific to this locale. If you restore this version, the content will not be replaced for other locales."
166
- }
167
- });
168
- }
169
- if (labelActionTitleId === "i18n.Field.not-localized") {
170
- return React.cloneElement(labelAction, {
171
- ...labelAction.props,
172
- title: {
173
- id: "history.content.not-localized",
174
- 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."
175
- }
176
- });
177
- }
178
- return labelAction;
179
- };
180
- const VersionInputRenderer = ({
181
- visible,
182
- hint: providedHint,
183
- shouldIgnoreRBAC = false,
184
- labelAction,
185
- ...props
186
- }) => {
187
- const customLabelAction = getLabelAction(labelAction);
188
- const { formatMessage } = useIntl();
189
- const version = useHistoryContext("VersionContent", (state) => state.selectedVersion);
190
- const configuration = useHistoryContext("VersionContent", (state) => state.configuration);
191
- const fieldSizes = useTypedSelector((state) => state["content-manager"].app.fieldSizes);
192
- const { id, components } = useDoc();
193
- const isFormDisabled = useForm("InputRenderer", (state) => state.disabled);
194
- const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
195
- const canCreateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
196
- const canReadFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
197
- const canUpdateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
198
- const canUserAction = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
199
- const editableFields = id ? canUpdateFields : canCreateFields;
200
- const readableFields = id ? canReadFields : canCreateFields;
201
- const canUserReadField = canUserAction(props.name, readableFields, props.type);
202
- const canUserEditField = canUserAction(props.name, editableFields, props.type);
203
- const fields = useStrapiApp("InputRenderer", (app) => app.fields);
204
- const { lazyComponentStore } = useLazyComponents(
205
- attributeHasCustomFieldProperty(props.attribute) ? [props.attribute.customField] : void 0
206
- );
207
- const hint = useFieldHint(providedHint, props.attribute);
208
- const {
209
- edit: { components: componentsLayout }
210
- } = useDocLayout();
211
- if (!visible) {
212
- return null;
213
- }
214
- if (!shouldIgnoreRBAC && !canUserReadField && !isInDynamicZone) {
215
- return /* @__PURE__ */ jsx(NotAllowedInput, { hint, ...props });
216
- }
217
- const fieldIsDisabled = !canUserEditField && !isInDynamicZone || props.disabled || isFormDisabled;
218
- const addedAttributes = version.meta.unknownAttributes.added;
219
- if (Object.keys(addedAttributes).includes(props.name)) {
220
- return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", gap: 1, children: [
221
- /* @__PURE__ */ jsx(Field.Label, { children: props.label }),
222
- /* @__PURE__ */ jsx(
223
- StyledAlert,
224
- {
225
- width: "100%",
226
- closeLabel: "Close",
227
- onClose: () => {
228
- },
229
- variant: "warning",
230
- title: formatMessage({
231
- id: "content-manager.history.content.new-field.title",
232
- defaultMessage: "New field"
233
- }),
234
- children: formatMessage({
235
- id: "content-manager.history.content.new-field.message",
236
- defaultMessage: "This field didn't exist when this version was saved. If you restore this version, it will be empty."
237
- })
238
- }
239
- )
240
- ] });
241
- }
242
- if (attributeHasCustomFieldProperty(props.attribute)) {
243
- const CustomInput = lazyComponentStore[props.attribute.customField];
244
- if (CustomInput) {
245
- return /* @__PURE__ */ jsx(
246
- CustomInput,
247
- {
248
- ...props,
249
- hint,
250
- labelAction: customLabelAction,
251
- disabled: fieldIsDisabled
252
- }
253
- );
254
- }
255
- return /* @__PURE__ */ jsx(
256
- InputRenderer,
257
- {
258
- ...props,
259
- hint,
260
- labelAction: customLabelAction,
261
- type: props.attribute.customField,
262
- disabled: fieldIsDisabled
263
- }
264
- );
265
- }
266
- if (props.type === "media") {
267
- return /* @__PURE__ */ jsx(CustomMediaInput, { ...props, labelAction: customLabelAction, disabled: fieldIsDisabled });
268
- }
269
- const addedInputTypes = Object.keys(fields);
270
- if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {
271
- const CustomInput = fields[props.type];
272
- return /* @__PURE__ */ jsx(
273
- CustomInput,
274
- {
275
- ...props,
276
- hint,
277
- labelAction: customLabelAction,
278
- disabled: fieldIsDisabled
279
- }
280
- );
281
- }
282
- switch (props.type) {
283
- case "blocks":
284
- return /* @__PURE__ */ jsx(MemoizedBlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
285
- case "component":
286
- const { layout } = componentsLayout[props.attribute.component];
287
- const [remainingFieldsLayout] = getRemaingFieldsLayout({
288
- layout: [layout],
289
- metadatas: configuration.components[props.attribute.component].metadatas,
290
- fieldSizes,
291
- schemaAttributes: components[props.attribute.component].attributes
292
- });
293
- return /* @__PURE__ */ jsx(
294
- MemoizedComponentInput,
295
- {
296
- ...props,
297
- layout: [...layout, ...remainingFieldsLayout || []],
298
- hint,
299
- labelAction: customLabelAction,
300
- disabled: fieldIsDisabled,
301
- children: (inputProps) => /* @__PURE__ */ jsx(VersionInputRenderer, { ...inputProps, shouldIgnoreRBAC: true })
302
- }
303
- );
304
- case "dynamiczone":
305
- return /* @__PURE__ */ jsx(
306
- DynamicZone,
307
- {
308
- ...props,
309
- hint,
310
- labelAction: customLabelAction,
311
- disabled: fieldIsDisabled,
312
- children: (inputProps) => /* @__PURE__ */ jsx(VersionInputRenderer, { ...inputProps, shouldIgnoreRBAC: true })
313
- }
314
- );
315
- case "relation":
316
- return /* @__PURE__ */ jsx(
317
- CustomRelationInput,
318
- {
319
- ...props,
320
- hint,
321
- labelAction: customLabelAction,
322
- disabled: fieldIsDisabled
323
- }
324
- );
325
- case "richtext":
326
- return /* @__PURE__ */ jsx(
327
- MemoizedWysiwyg,
328
- {
329
- ...props,
330
- hint,
331
- type: props.type,
332
- labelAction: customLabelAction,
333
- disabled: fieldIsDisabled
334
- }
335
- );
336
- case "uid":
337
- return /* @__PURE__ */ jsx(
338
- MemoizedUIDInput,
339
- {
340
- ...props,
341
- hint,
342
- type: props.type,
343
- labelAction: customLabelAction,
344
- disabled: fieldIsDisabled
345
- }
346
- );
347
- case "enumeration":
348
- return /* @__PURE__ */ jsx(
349
- InputRenderer,
350
- {
351
- ...props,
352
- hint,
353
- labelAction: customLabelAction,
354
- options: props.attribute.enum.map((value) => ({ value })),
355
- type: props.customField ? "custom-field" : props.type,
356
- disabled: fieldIsDisabled
357
- }
358
- );
359
- default:
360
- const { unique: _unique, mainField: _mainField, ...restProps } = props;
361
- return /* @__PURE__ */ jsx(
362
- InputRenderer,
363
- {
364
- ...restProps,
365
- hint,
366
- labelAction: customLabelAction,
367
- type: props.customField ? "custom-field" : props.type,
368
- disabled: fieldIsDisabled
369
- }
370
- );
371
- }
372
- };
373
- const attributeHasCustomFieldProperty = (attribute) => "customField" in attribute && typeof attribute.customField === "string";
374
- const createLayoutFromFields = (fields) => {
375
- return fields.reduce((rows, field) => {
376
- if (field.type === "dynamiczone") {
377
- rows.push([field]);
378
- return rows;
379
- }
380
- if (!rows[rows.length - 1]) {
381
- rows.push([]);
382
- }
383
- rows[rows.length - 1].push(field);
384
- return rows;
385
- }, []).map((row) => [row]);
386
- };
387
- function getRemaingFieldsLayout({
388
- layout,
389
- metadatas,
390
- schemaAttributes,
391
- fieldSizes
392
- }) {
393
- const fieldsInLayout = layout.flatMap(
394
- (panel) => panel.flatMap((row) => row.flatMap((field) => field.name))
395
- );
396
- const remainingFields = Object.entries(metadatas).reduce(
397
- (currentRemainingFields, [name, field]) => {
398
- if (!fieldsInLayout.includes(name) && field.edit.visible === true) {
399
- const attribute = schemaAttributes[name];
400
- currentRemainingFields.push({
401
- attribute,
402
- type: attribute.type,
403
- visible: true,
404
- disabled: true,
405
- label: field.edit.label || name,
406
- name,
407
- size: fieldSizes[attribute.type].default ?? 12
408
- });
409
- }
410
- return currentRemainingFields;
411
- },
412
- []
413
- );
414
- return createLayoutFromFields(remainingFields);
415
- }
416
- const FormPanel = ({ panel }) => {
417
- if (panel.some((row) => row.some((field) => field.type === "dynamiczone"))) {
418
- const [row] = panel;
419
- const [field] = row;
420
- return /* @__PURE__ */ jsx(Grid.Root, { gap: 4, children: /* @__PURE__ */ jsx(Grid.Item, { col: 12, s: 12, xs: 12, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsx(VersionInputRenderer, { ...field }) }) }, field.name);
421
- }
422
- return /* @__PURE__ */ jsx(
423
- Box,
424
- {
425
- hasRadius: true,
426
- background: "neutral0",
427
- shadow: "tableShadow",
428
- paddingLeft: 6,
429
- paddingRight: 6,
430
- paddingTop: 6,
431
- paddingBottom: 6,
432
- borderColor: "neutral150",
433
- children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsx(Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
434
- return /* @__PURE__ */ jsx(
435
- Grid.Item,
436
- {
437
- col: size,
438
- s: 12,
439
- xs: 12,
440
- direction: "column",
441
- alignItems: "stretch",
442
- children: /* @__PURE__ */ jsx(VersionInputRenderer, { ...field })
443
- },
444
- field.name
445
- );
446
- }) }, gridRowIndex)) })
447
- }
448
- );
449
- };
450
- const VersionContent = () => {
451
- const { formatMessage } = useIntl();
452
- const { fieldSizes } = useTypedSelector((state) => state["content-manager"].app);
453
- const version = useHistoryContext("VersionContent", (state) => state.selectedVersion);
454
- const layout = useHistoryContext("VersionContent", (state) => state.layout);
455
- const configuration = useHistoryContext("VersionContent", (state) => state.configuration);
456
- const schema = useHistoryContext("VersionContent", (state) => state.schema);
457
- const removedAttributes = version.meta.unknownAttributes.removed;
458
- const removedAttributesAsFields = Object.entries(removedAttributes).map(
459
- ([attributeName, attribute]) => {
460
- const field = {
461
- attribute,
462
- shouldIgnoreRBAC: true,
463
- type: attribute.type,
464
- visible: true,
465
- disabled: true,
466
- label: attributeName,
467
- name: attributeName,
468
- size: fieldSizes[attribute.type].default ?? 12
469
- };
470
- return field;
471
- }
472
- );
473
- const unknownFieldsLayout = createLayoutFromFields(removedAttributesAsFields);
474
- const remainingFieldsLayout = getRemaingFieldsLayout({
475
- metadatas: configuration.contentType.metadatas,
476
- layout,
477
- schemaAttributes: schema.attributes,
478
- fieldSizes
479
- });
480
- const { components } = useDoc();
481
- const transformedData = React.useMemo(() => {
482
- const transform = (schemaAttributes, components2 = {}) => (document) => {
483
- const schema2 = { attributes: schemaAttributes };
484
- const transformations = pipe(
485
- removeFieldsThatDontExistOnSchema(schema2),
486
- prepareTempKeys(schema2, components2)
487
- );
488
- return transformations(document);
489
- };
490
- return transform(version.schema, components)(version.data);
491
- }, [components, version.data, version.schema]);
492
- return /* @__PURE__ */ jsxs(Layouts.Content, { children: [
493
- /* @__PURE__ */ jsx(Box, { paddingBottom: 8, children: /* @__PURE__ */ jsx(Form, { disabled: true, method: "PUT", initialValues: transformedData, children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, position: "relative", children: [...layout, ...remainingFieldsLayout].map((panel, index) => {
494
- return /* @__PURE__ */ jsx(FormPanel, { panel }, index);
495
- }) }) }) }),
496
- removedAttributesAsFields.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
497
- /* @__PURE__ */ jsx(Divider, {}),
498
- /* @__PURE__ */ jsxs(Box, { paddingTop: 8, children: [
499
- /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingBottom: 6, gap: 1, children: [
500
- /* @__PURE__ */ jsx(Typography, { variant: "delta", children: formatMessage({
501
- id: "content-manager.history.content.unknown-fields.title",
502
- defaultMessage: "Unknown fields"
503
- }) }),
504
- /* @__PURE__ */ jsx(Typography, { variant: "pi", children: formatMessage(
505
- {
506
- id: "content-manager.history.content.unknown-fields.message",
507
- defaultMessage: "These fields have been deleted or renamed in the Content-Type Builder. <b>These fields will not be restored.</b>"
508
- },
509
- {
510
- b: (chunks) => /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: chunks })
511
- }
512
- ) })
513
- ] }),
514
- /* @__PURE__ */ jsx(Form, { disabled: true, method: "PUT", initialValues: version.data, children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, position: "relative", children: unknownFieldsLayout.map((panel, index) => {
515
- return /* @__PURE__ */ jsx(FormPanel, { panel }, index);
516
- }) }) })
517
- ] })
518
- ] })
519
- ] });
520
- };
521
- const historyVersionsApi = contentManagerApi.injectEndpoints({
522
- endpoints: (builder) => ({
523
- getHistoryVersions: builder.query({
524
- query(params) {
525
- return {
526
- url: `/content-manager/history-versions`,
527
- method: "GET",
528
- config: {
529
- params
530
- }
531
- };
532
- },
533
- providesTags: ["HistoryVersion"]
534
- }),
535
- restoreVersion: builder.mutation({
536
- query({ params, body }) {
537
- return {
538
- url: `/content-manager/history-versions/${params.versionId}/restore`,
539
- method: "PUT",
540
- data: body
541
- };
542
- },
543
- invalidatesTags: (_res, _error, { documentId, collectionType, params }) => {
544
- return [
545
- "HistoryVersion",
546
- {
547
- type: "Document",
548
- id: collectionType === COLLECTION_TYPES ? `${params.contentType}_${documentId}` : params.contentType
549
- }
550
- ];
551
- }
552
- })
553
- })
554
- });
555
- const { useGetHistoryVersionsQuery, useRestoreVersionMutation } = historyVersionsApi;
556
- const VersionHeader = ({ headerId }) => {
557
- const [isConfirmDialogOpen, setIsConfirmDialogOpen] = React.useState(false);
558
- const navigate = useNavigate();
559
- const { formatMessage, formatDate } = useIntl();
560
- const { trackUsage } = useTracking();
561
- const { toggleNotification } = useNotification();
562
- const [{ query }] = useQueryParams();
563
- const { collectionType, slug } = useParams();
564
- const [restoreVersion, { isLoading }] = useRestoreVersionMutation();
565
- const { allowedActions } = useRBAC(PERMISSIONS.map((action) => ({ action, subject: slug })));
566
- const version = useHistoryContext("VersionHeader", (state) => state.selectedVersion);
567
- const mainField = useHistoryContext("VersionHeader", (state) => state.mainField);
568
- const schema = useHistoryContext("VersionHeader", (state) => state.schema);
569
- const isCurrentVersion = useHistoryContext(
570
- "VersionHeader",
571
- (state) => state.page === 1 && state.versions.data[0].id === state.selectedVersion.id
572
- );
573
- const mainFieldValue = version.data[mainField];
574
- const getNextNavigation = () => {
575
- const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
576
- return {
577
- pathname: "..",
578
- search: pluginsQueryParams
579
- };
580
- };
581
- const handleRestore = async () => {
582
- try {
583
- const response = await restoreVersion({
584
- documentId: version.relatedDocumentId,
585
- collectionType,
586
- params: {
587
- versionId: version.id,
588
- contentType: version.contentType
589
- },
590
- body: { contentType: version.contentType }
591
- });
592
- if ("data" in response) {
593
- navigate(getNextNavigation(), { relative: "path" });
594
- toggleNotification({
595
- type: "success",
596
- title: formatMessage({
597
- id: "content-manager.restore.success.title",
598
- defaultMessage: "Version restored."
599
- }),
600
- message: formatMessage({
601
- id: "content-manager.restore.success.message",
602
- defaultMessage: "A past version of the content was restored."
603
- })
604
- });
605
- trackUsage("didRestoreHistoryVersion");
606
- }
607
- if ("error" in response) {
608
- toggleNotification({
609
- type: "danger",
610
- message: formatMessage({
611
- id: "content-manager.history.restore.error.message",
612
- defaultMessage: "Could not restore version."
613
- })
614
- });
615
- }
616
- } catch (error) {
617
- toggleNotification({
618
- type: "danger",
619
- message: formatMessage({ id: "notification.error", defaultMessage: "An error occurred" })
620
- });
621
- }
622
- };
623
- return /* @__PURE__ */ jsxs(Dialog.Root, { open: isConfirmDialogOpen, onOpenChange: setIsConfirmDialogOpen, children: [
624
- /* @__PURE__ */ jsx(
625
- Layouts.BaseHeader,
626
- {
627
- id: headerId,
628
- title: formatDate(new Date(version.createdAt), {
629
- year: "numeric",
630
- month: "numeric",
631
- day: "numeric",
632
- hour: "numeric",
633
- minute: "numeric"
634
- }),
635
- subtitle: /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage(
636
- {
637
- id: "content-manager.history.version.subtitle",
638
- defaultMessage: "{hasLocale, select, true {{subtitle}, in {locale}} other {{subtitle}}}"
639
- },
640
- {
641
- hasLocale: Boolean(version.locale),
642
- subtitle: `${mainFieldValue || ""} (${schema.info.singularName})`.trim(),
643
- locale: version.locale?.name
644
- }
645
- ) }),
646
- navigationAction: /* @__PURE__ */ jsx(
647
- Link,
648
- {
649
- startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}),
650
- tag: NavLink,
651
- to: getNextNavigation(),
652
- relative: "path",
653
- isExternal: false,
654
- children: formatMessage({
655
- id: "global.back",
656
- defaultMessage: "Back"
657
- })
658
- }
659
- ),
660
- sticky: false,
661
- primaryAction: /* @__PURE__ */ jsx(Dialog.Trigger, { children: /* @__PURE__ */ jsx(
662
- Button,
663
- {
664
- disabled: !allowedActions.canUpdate || isCurrentVersion,
665
- onClick: () => {
666
- setIsConfirmDialogOpen(true);
667
- },
668
- children: formatMessage({
669
- id: "content-manager.history.restore.confirm.button",
670
- defaultMessage: "Restore"
671
- })
672
- }
673
- ) })
674
- }
675
- ),
676
- /* @__PURE__ */ jsx(
677
- ConfirmDialog,
678
- {
679
- onConfirm: handleRestore,
680
- endAction: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: handleRestore, loading: isLoading, children: formatMessage({
681
- id: "content-manager.history.restore.confirm.button",
682
- defaultMessage: "Restore"
683
- }) }),
684
- children: /* @__PURE__ */ jsxs(
685
- Flex,
686
- {
687
- direction: "column",
688
- alignItems: "center",
689
- justifyContent: "center",
690
- gap: 2,
691
- textAlign: "center",
692
- children: [
693
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
694
- /* @__PURE__ */ jsx(Typography, { children: formatMessage({
695
- id: "content-manager.history.restore.confirm.title",
696
- defaultMessage: "Are you sure you want to restore this version?"
697
- }) }),
698
- /* @__PURE__ */ jsx(Typography, { children: formatMessage(
699
- {
700
- id: "content-manager.history.restore.confirm.message",
701
- 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.}}"
702
- },
703
- {
704
- isDraft: version.status === "draft"
705
- }
706
- ) })
707
- ]
708
- }
709
- )
710
- }
711
- )
712
- ] });
713
- };
714
- const BlueText = (children) => /* @__PURE__ */ jsx(Typography, { textColor: "primary600", variant: "pi", children });
715
- const VersionCard = ({ version, isCurrent }) => {
716
- const { formatDate, formatMessage } = useIntl();
717
- const [{ query }] = useQueryParams();
718
- const isActive = query.id === version.id.toString();
719
- const author = version.createdBy && getDisplayName(version.createdBy);
720
- return /* @__PURE__ */ jsxs(
721
- Flex,
722
- {
723
- direction: "column",
724
- alignItems: "flex-start",
725
- gap: 3,
726
- hasRadius: true,
727
- borderWidth: "1px",
728
- borderStyle: "solid",
729
- borderColor: isActive ? "primary600" : "neutral200",
730
- color: "neutral800",
731
- padding: 5,
732
- tag: Link$1,
733
- to: `?${stringify({ ...query, id: version.id })}`,
734
- style: { textDecoration: "none" },
735
- children: [
736
- /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, alignItems: "flex-start", children: [
737
- /* @__PURE__ */ jsx(Typography, { tag: "h3", fontWeight: "semiBold", children: formatDate(version.createdAt, {
738
- day: "numeric",
739
- month: "numeric",
740
- year: "numeric",
741
- hour: "2-digit",
742
- minute: "2-digit"
743
- }) }),
744
- /* @__PURE__ */ jsx(Typography, { tag: "p", variant: "pi", textColor: "neutral600", children: formatMessage(
745
- {
746
- id: "content-manager.history.sidebar.versionDescription",
747
- defaultMessage: "{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}"
748
- },
749
- {
750
- distanceToNow: /* @__PURE__ */ jsx(RelativeTime, { timestamp: new Date(version.createdAt) }),
751
- author,
752
- isAnonymous: !Boolean(version.createdBy),
753
- isCurrent,
754
- b: BlueText
755
- }
756
- ) })
757
- ] }),
758
- version.status && /* @__PURE__ */ jsx(DocumentStatus, { status: version.status, size: "XS" })
759
- ]
760
- }
761
- );
762
- };
763
- const PaginationButton = ({ page, children }) => {
764
- const [{ query }] = useQueryParams();
765
- const { id: _id, ...queryRest } = query;
766
- return /* @__PURE__ */ jsx(Link$1, { to: { search: stringify({ ...queryRest, page }) }, style: { textDecoration: "none" }, children: /* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "primary600", children }) });
767
- };
768
- const VersionsList = () => {
769
- const { formatMessage } = useIntl();
770
- const { versions, page } = useHistoryContext("VersionsList", (state) => ({
771
- versions: state.versions,
772
- page: state.page
773
- }));
774
- return /* @__PURE__ */ jsxs(
775
- Flex,
776
- {
777
- shrink: 0,
778
- direction: "column",
779
- alignItems: "stretch",
780
- width: "320px",
781
- height: "100vh",
782
- background: "neutral0",
783
- borderColor: "neutral200",
784
- borderWidth: "0 0 0 1px",
785
- borderStyle: "solid",
786
- tag: "aside",
787
- children: [
788
- /* @__PURE__ */ jsxs(
789
- Flex,
790
- {
791
- direction: "row",
792
- justifyContent: "space-between",
793
- padding: 4,
794
- borderColor: "neutral200",
795
- borderWidth: "0 0 1px",
796
- borderStyle: "solid",
797
- tag: "header",
798
- children: [
799
- /* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "omega", fontWeight: "semiBold", children: formatMessage({
800
- id: "content-manager.history.sidebar.title",
801
- defaultMessage: "Versions"
802
- }) }),
803
- /* @__PURE__ */ jsx(Box, { background: "neutral150", hasRadius: true, padding: 1, children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", children: versions.meta.pagination.total }) })
804
- ]
805
- }
806
- ),
807
- /* @__PURE__ */ jsxs(Box, { flex: 1, overflow: "auto", children: [
808
- versions.meta.pagination.page > 1 && /* @__PURE__ */ jsx(Box, { paddingTop: 4, textAlign: "center", children: /* @__PURE__ */ jsx(PaginationButton, { page: page - 1, children: formatMessage({
809
- id: "content-manager.history.sidebar.show-newer",
810
- defaultMessage: "Show newer versions"
811
- }) }) }),
812
- /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 3, padding: 4, tag: "ul", alignItems: "stretch", children: versions.data.map((version, index) => /* @__PURE__ */ jsx(
813
- "li",
814
- {
815
- "aria-label": formatMessage({
816
- id: "content-manager.history.sidebar.title.version-card.aria-label",
817
- defaultMessage: "Version card"
818
- }),
819
- children: /* @__PURE__ */ jsx(VersionCard, { version, isCurrent: page === 1 && index === 0 })
820
- },
821
- version.id
822
- )) }),
823
- versions.meta.pagination.page < versions.meta.pagination.pageCount && /* @__PURE__ */ jsx(Box, { paddingBottom: 4, textAlign: "center", children: /* @__PURE__ */ jsx(PaginationButton, { page: page + 1, children: formatMessage({
824
- id: "content-manager.history.sidebar.show-older",
825
- defaultMessage: "Show older versions"
826
- }) }) })
827
- ] })
828
- ]
829
- }
830
- );
831
- };
832
- const [HistoryProvider, useHistoryContext] = createContext("HistoryPage");
833
- const HistoryPage = () => {
834
- const headerId = React.useId();
835
- const { formatMessage } = useIntl();
836
- const {
837
- slug,
838
- id: documentId,
839
- collectionType
840
- } = useParams();
841
- const { isLoading: isLoadingDocument, schema } = useDocument({
842
- collectionType,
843
- model: slug
844
- });
845
- const {
846
- isLoading: isLoadingLayout,
847
- edit: {
848
- layout,
849
- settings: { displayName, mainField }
850
- }
851
- } = useDocumentLayout(slug);
852
- const { data: configuration, isLoading: isLoadingConfiguration } = useGetContentTypeConfigurationQuery(slug);
853
- const [{ query }] = useQueryParams();
854
- const { id: selectedVersionId, ...queryWithoutId } = query;
855
- const validQueryParamsWithoutId = buildValidParams(queryWithoutId);
856
- const page = validQueryParamsWithoutId.page ? Number(validQueryParamsWithoutId.page) : 1;
857
- const versionsResponse = useGetHistoryVersionsQuery(
858
- {
859
- contentType: slug,
860
- ...documentId ? { documentId } : {},
861
- // Omit id since it's not needed by the endpoint and caused extra refetches
862
- ...validQueryParamsWithoutId
863
- },
864
- { refetchOnMountOrArgChange: true }
865
- );
866
- const initialRequestId = React.useRef(versionsResponse.requestId);
867
- const isStaleRequest = versionsResponse.requestId === initialRequestId.current;
868
- if (!slug || collectionType === COLLECTION_TYPES && !documentId) {
869
- return /* @__PURE__ */ jsx(Navigate, { to: "/content-manager" });
870
- }
871
- if (isLoadingDocument || isLoadingLayout || versionsResponse.isFetching || isStaleRequest || isLoadingConfiguration) {
872
- return /* @__PURE__ */ jsx(Page.Loading, {});
873
- }
874
- if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {
875
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
876
- Page.NoData,
877
- {
878
- action: /* @__PURE__ */ jsx(
879
- Link,
880
- {
881
- tag: NavLink,
882
- to: `/content-manager/${collectionType}/${slug}${documentId ? `/${documentId}` : ""}`,
883
- children: formatMessage({
884
- id: "global.back",
885
- defaultMessage: "Back"
886
- })
887
- }
888
- )
889
- }
890
- ) });
891
- }
892
- if (versionsResponse.data?.data?.length && !selectedVersionId) {
893
- return /* @__PURE__ */ jsx(
894
- Navigate,
895
- {
896
- to: { search: stringify({ ...query, id: versionsResponse.data.data[0].id }) },
897
- replace: true
898
- }
899
- );
900
- }
901
- const selectedVersion = versionsResponse.data?.data?.find(
902
- (version) => version.id.toString() === selectedVersionId
903
- );
904
- if (versionsResponse.isError || !layout || !schema || !selectedVersion || !configuration || // This should not happen as it's covered by versionsResponse.isError, but we need it for TS
905
- versionsResponse.data.error) {
906
- return /* @__PURE__ */ jsx(Page.Error, {});
907
- }
908
- return /* @__PURE__ */ jsxs(Fragment, { children: [
909
- /* @__PURE__ */ jsx(Page.Title, { children: formatMessage(
910
- {
911
- id: "content-manager.history.page-title",
912
- defaultMessage: "{contentType} history"
913
- },
914
- {
915
- contentType: displayName
916
- }
917
- ) }),
918
- /* @__PURE__ */ jsx(
919
- HistoryProvider,
920
- {
921
- contentType: slug,
922
- id: documentId,
923
- schema,
924
- layout,
925
- configuration,
926
- selectedVersion,
927
- versions: versionsResponse.data,
928
- page,
929
- mainField,
930
- children: /* @__PURE__ */ jsxs(Flex, { direction: "row", alignItems: "flex-start", children: [
931
- /* @__PURE__ */ jsxs(
932
- Main,
933
- {
934
- grow: 1,
935
- height: "100vh",
936
- background: "neutral100",
937
- paddingBottom: 6,
938
- overflow: "auto",
939
- labelledBy: headerId,
940
- children: [
941
- /* @__PURE__ */ jsx(VersionHeader, { headerId }),
942
- /* @__PURE__ */ jsx(VersionContent, {})
943
- ]
944
- }
945
- ),
946
- /* @__PURE__ */ jsx(VersionsList, {})
947
- ] })
948
- }
949
- )
950
- ] });
951
- };
952
- const ProtectedHistoryPageImpl = () => {
953
- const { slug } = useParams();
954
- const {
955
- permissions = [],
956
- isLoading,
957
- error
958
- } = useRBAC(PERMISSIONS.map((action) => ({ action, subject: slug })));
959
- if (isLoading) {
960
- return /* @__PURE__ */ jsx(Page.Loading, {});
961
- }
962
- if (error || !slug) {
963
- return /* @__PURE__ */ jsx(
964
- Box,
965
- {
966
- height: "100vh",
967
- width: "100vw",
968
- position: "fixed",
969
- top: 0,
970
- left: 0,
971
- zIndex: 2,
972
- background: "neutral0",
973
- children: /* @__PURE__ */ jsx(Page.Error, {})
974
- }
975
- );
976
- }
977
- return /* @__PURE__ */ jsx(
978
- Box,
979
- {
980
- height: "100vh",
981
- width: "100vw",
982
- position: "fixed",
983
- top: 0,
984
- left: 0,
985
- zIndex: 2,
986
- background: "neutral0",
987
- children: /* @__PURE__ */ jsx(Page.Protect, { permissions, children: ({ permissions: permissions2 }) => /* @__PURE__ */ jsx(DocumentRBAC, { permissions: permissions2, children: /* @__PURE__ */ jsx(HistoryPage, {}) }) })
988
- }
989
- );
990
- };
991
- const ProtectedHistoryPage = () => {
992
- return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(FocusTrap, { children: /* @__PURE__ */ jsx(ProtectedHistoryPageImpl, {}) }) });
993
- };
994
- export {
995
- HistoryProvider,
996
- ProtectedHistoryPage,
997
- useHistoryContext
998
- };
999
- //# sourceMappingURL=History-D1PreDSY.mjs.map