@strapi/content-manager 0.0.0-next.39c0188c3aa01bec7b64b948211571d5159e811d → 0.0.0-next.3a1d87a9c3b1d4d89f741c6ecd7f501230fd8d76

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 (439) hide show
  1. package/dist/_chunks/CardDragPreview-C0QyJgRA.js +69 -0
  2. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -0
  3. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs +70 -0
  4. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -0
  5. package/dist/_chunks/ComponentConfigurationPage-DMxUlNOo.js +254 -0
  6. package/dist/_chunks/ComponentConfigurationPage-DMxUlNOo.js.map +1 -0
  7. package/dist/_chunks/ComponentConfigurationPage-baEkO-OV.mjs +236 -0
  8. package/dist/_chunks/ComponentConfigurationPage-baEkO-OV.mjs.map +1 -0
  9. package/dist/_chunks/ComponentIcon-CRbtQEUV.js +175 -0
  10. package/dist/_chunks/ComponentIcon-CRbtQEUV.js.map +1 -0
  11. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs +157 -0
  12. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -0
  13. package/dist/_chunks/EditConfigurationPage-CXxV7mKn.js +150 -0
  14. package/dist/_chunks/EditConfigurationPage-CXxV7mKn.js.map +1 -0
  15. package/dist/_chunks/EditConfigurationPage-YR8-4VCS.mjs +132 -0
  16. package/dist/_chunks/EditConfigurationPage-YR8-4VCS.mjs.map +1 -0
  17. package/dist/_chunks/EditViewPage-BfR6jAR6.js +209 -0
  18. package/dist/_chunks/EditViewPage-BfR6jAR6.js.map +1 -0
  19. package/dist/_chunks/EditViewPage-DFF7c27p.mjs +191 -0
  20. package/dist/_chunks/EditViewPage-DFF7c27p.mjs.map +1 -0
  21. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +50 -0
  22. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -0
  23. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +49 -0
  24. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -0
  25. package/dist/_chunks/Form-CjcMRP5A.js +778 -0
  26. package/dist/_chunks/Form-CjcMRP5A.js.map +1 -0
  27. package/dist/_chunks/Form-MSOSfGGN.mjs +758 -0
  28. package/dist/_chunks/Form-MSOSfGGN.mjs.map +1 -0
  29. package/dist/_chunks/History-BgZ7gVuF.js +1019 -0
  30. package/dist/_chunks/History-BgZ7gVuF.js.map +1 -0
  31. package/dist/_chunks/History-WOQNVho-.mjs +999 -0
  32. package/dist/_chunks/History-WOQNVho-.mjs.map +1 -0
  33. package/dist/_chunks/Input-BkKwZ6Qt.mjs +5585 -0
  34. package/dist/_chunks/Input-BkKwZ6Qt.mjs.map +1 -0
  35. package/dist/_chunks/Input-BwOibhc3.js +5617 -0
  36. package/dist/_chunks/Input-BwOibhc3.js.map +1 -0
  37. package/dist/_chunks/ListConfigurationPage-BeXfr6uW.mjs +633 -0
  38. package/dist/_chunks/ListConfigurationPage-BeXfr6uW.mjs.map +1 -0
  39. package/dist/_chunks/ListConfigurationPage-DnJ3nbwL.js +652 -0
  40. package/dist/_chunks/ListConfigurationPage-DnJ3nbwL.js.map +1 -0
  41. package/dist/_chunks/ListViewPage-CJFDudKl.js +877 -0
  42. package/dist/_chunks/ListViewPage-CJFDudKl.js.map +1 -0
  43. package/dist/_chunks/ListViewPage-VK2v44Q1.mjs +854 -0
  44. package/dist/_chunks/ListViewPage-VK2v44Q1.mjs.map +1 -0
  45. package/dist/_chunks/NoContentTypePage-T8ttty6K.mjs +51 -0
  46. package/dist/_chunks/NoContentTypePage-T8ttty6K.mjs.map +1 -0
  47. package/dist/_chunks/NoContentTypePage-en2PwWgI.js +51 -0
  48. package/dist/_chunks/NoContentTypePage-en2PwWgI.js.map +1 -0
  49. package/dist/_chunks/NoPermissionsPage-CcjILry3.js +23 -0
  50. package/dist/_chunks/NoPermissionsPage-CcjILry3.js.map +1 -0
  51. package/dist/_chunks/NoPermissionsPage-CokBHhhy.mjs +23 -0
  52. package/dist/_chunks/NoPermissionsPage-CokBHhhy.mjs.map +1 -0
  53. package/dist/_chunks/Preview-BF81YhRj.mjs +287 -0
  54. package/dist/_chunks/Preview-BF81YhRj.mjs.map +1 -0
  55. package/dist/_chunks/Preview-DgzAuzWQ.js +305 -0
  56. package/dist/_chunks/Preview-DgzAuzWQ.js.map +1 -0
  57. package/dist/_chunks/Relations-1O-JcM4t.js +747 -0
  58. package/dist/_chunks/Relations-1O-JcM4t.js.map +1 -0
  59. package/dist/_chunks/Relations-BncdhGCd.mjs +728 -0
  60. package/dist/_chunks/Relations-BncdhGCd.mjs.map +1 -0
  61. package/dist/_chunks/ar-BUUWXIYu.js +226 -0
  62. package/dist/{admin/chunks/ar-DckYq_WK.js.map → _chunks/ar-BUUWXIYu.js.map} +1 -1
  63. package/dist/_chunks/ar-CCEVvqGG.mjs +226 -0
  64. package/dist/_chunks/ar-CCEVvqGG.mjs.map +1 -0
  65. package/dist/_chunks/ca-5U32ON2v.mjs +201 -0
  66. package/dist/_chunks/ca-5U32ON2v.mjs.map +1 -0
  67. package/dist/_chunks/ca-Cmk45QO6.js +201 -0
  68. package/dist/{admin/chunks/de-CbImAUA5.js.map → _chunks/ca-Cmk45QO6.js.map} +1 -1
  69. package/dist/_chunks/cs-CM2aBUar.mjs +125 -0
  70. package/dist/_chunks/cs-CM2aBUar.mjs.map +1 -0
  71. package/dist/_chunks/cs-CkJy6B2v.js +125 -0
  72. package/dist/{admin/chunks/cs-C7OSYFQ7.js.map → _chunks/cs-CkJy6B2v.js.map} +1 -1
  73. package/dist/_chunks/de-C72KDNOl.mjs +199 -0
  74. package/dist/_chunks/de-C72KDNOl.mjs.map +1 -0
  75. package/dist/_chunks/de-CCEmbAah.js +199 -0
  76. package/dist/{admin/chunks/es-C8vLuvZL.js.map → _chunks/de-CCEmbAah.js.map} +1 -1
  77. package/dist/_chunks/en-BZaUty0m.mjs +311 -0
  78. package/dist/{admin/chunks/en-C1CjdAtC.js.map → _chunks/en-BZaUty0m.mjs.map} +1 -1
  79. package/dist/_chunks/en-CzCnBk4S.js +311 -0
  80. package/dist/{admin/chunks/en-LfhocNG2.js.map → _chunks/en-CzCnBk4S.js.map} +1 -1
  81. package/dist/_chunks/es-9K52xZIr.js +196 -0
  82. package/dist/{admin/chunks/de-5QRlDHyR.js.map → _chunks/es-9K52xZIr.js.map} +1 -1
  83. package/dist/_chunks/es-D34tqjMw.mjs +196 -0
  84. package/dist/_chunks/es-D34tqjMw.mjs.map +1 -0
  85. package/dist/_chunks/eu-CdALomew.mjs +202 -0
  86. package/dist/_chunks/eu-CdALomew.mjs.map +1 -0
  87. package/dist/_chunks/eu-VDH-3ovk.js +202 -0
  88. package/dist/_chunks/eu-VDH-3ovk.js.map +1 -0
  89. package/dist/_chunks/fr--pg5jUbt.mjs +216 -0
  90. package/dist/_chunks/fr--pg5jUbt.mjs.map +1 -0
  91. package/dist/_chunks/fr-B2Kyv8Z9.js +216 -0
  92. package/dist/_chunks/fr-B2Kyv8Z9.js.map +1 -0
  93. package/dist/_chunks/gu-BRmF601H.js +200 -0
  94. package/dist/_chunks/gu-BRmF601H.js.map +1 -0
  95. package/dist/_chunks/gu-CNpaMDpH.mjs +200 -0
  96. package/dist/_chunks/gu-CNpaMDpH.mjs.map +1 -0
  97. package/dist/_chunks/hi-CCJBptSq.js +200 -0
  98. package/dist/_chunks/hi-CCJBptSq.js.map +1 -0
  99. package/dist/_chunks/hi-Dwvd04m3.mjs +200 -0
  100. package/dist/_chunks/hi-Dwvd04m3.mjs.map +1 -0
  101. package/dist/{admin/chunks/hooks-D-sOYd1s.js → _chunks/hooks-BAaaKPS_.js} +3 -6
  102. package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -0
  103. package/dist/_chunks/hooks-E5u1mcgM.mjs +8 -0
  104. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +1 -0
  105. package/dist/_chunks/hu-CeYvaaO0.mjs +202 -0
  106. package/dist/_chunks/hu-CeYvaaO0.mjs.map +1 -0
  107. package/dist/_chunks/hu-sNV_yLYy.js +202 -0
  108. package/dist/_chunks/hu-sNV_yLYy.js.map +1 -0
  109. package/dist/_chunks/id-B5Ser98A.js +160 -0
  110. package/dist/{admin/chunks/it-BAHrwmYS.js.map → _chunks/id-B5Ser98A.js.map} +1 -1
  111. package/dist/_chunks/id-BtwA9WJT.mjs +160 -0
  112. package/dist/_chunks/id-BtwA9WJT.mjs.map +1 -0
  113. package/dist/_chunks/index-DiluOUp6.mjs +4423 -0
  114. package/dist/_chunks/index-DiluOUp6.mjs.map +1 -0
  115. package/dist/_chunks/index-EXJvmn4t.js +4442 -0
  116. package/dist/_chunks/index-EXJvmn4t.js.map +1 -0
  117. package/dist/_chunks/it-BrVPqaf1.mjs +162 -0
  118. package/dist/_chunks/it-BrVPqaf1.mjs.map +1 -0
  119. package/dist/_chunks/it-DkBIs7vD.js +162 -0
  120. package/dist/{admin/chunks/id-D7V5S1rB.js.map → _chunks/it-DkBIs7vD.js.map} +1 -1
  121. package/dist/_chunks/ja-7sfIbjxE.js +196 -0
  122. package/dist/{admin/chunks/it-CQFpa_Dc.js.map → _chunks/ja-7sfIbjxE.js.map} +1 -1
  123. package/dist/_chunks/ja-BHqhDq4V.mjs +196 -0
  124. package/dist/_chunks/ja-BHqhDq4V.mjs.map +1 -0
  125. package/dist/_chunks/ko-HVQRlfUI.mjs +195 -0
  126. package/dist/_chunks/ko-HVQRlfUI.mjs.map +1 -0
  127. package/dist/_chunks/ko-woFZPmLk.js +195 -0
  128. package/dist/{admin/chunks/es-DkoWSExG.js.map → _chunks/ko-woFZPmLk.js.map} +1 -1
  129. package/dist/_chunks/layout-4TbKVax8.js +488 -0
  130. package/dist/_chunks/layout-4TbKVax8.js.map +1 -0
  131. package/dist/_chunks/layout-mSwsYzxv.mjs +471 -0
  132. package/dist/_chunks/layout-mSwsYzxv.mjs.map +1 -0
  133. package/dist/_chunks/ml-BihZwQit.mjs +200 -0
  134. package/dist/_chunks/ml-BihZwQit.mjs.map +1 -0
  135. package/dist/_chunks/ml-C2W8N8k1.js +200 -0
  136. package/dist/_chunks/ml-C2W8N8k1.js.map +1 -0
  137. package/dist/_chunks/ms-BuFotyP_.js +144 -0
  138. package/dist/{admin/chunks/cs-BJFxwIWj.js.map → _chunks/ms-BuFotyP_.js.map} +1 -1
  139. package/dist/_chunks/ms-m_WjyWx7.mjs +144 -0
  140. package/dist/_chunks/ms-m_WjyWx7.mjs.map +1 -0
  141. package/dist/_chunks/nl-D4R9gHx5.mjs +202 -0
  142. package/dist/_chunks/nl-D4R9gHx5.mjs.map +1 -0
  143. package/dist/_chunks/nl-bbEOHChV.js +202 -0
  144. package/dist/_chunks/nl-bbEOHChV.js.map +1 -0
  145. package/dist/_chunks/objects-BcXOv6_9.js +47 -0
  146. package/dist/_chunks/objects-BcXOv6_9.js.map +1 -0
  147. package/dist/_chunks/objects-D6yBsdmx.mjs +45 -0
  148. package/dist/_chunks/objects-D6yBsdmx.mjs.map +1 -0
  149. package/dist/_chunks/pl-sbx9mSt_.mjs +199 -0
  150. package/dist/_chunks/pl-sbx9mSt_.mjs.map +1 -0
  151. package/dist/_chunks/pl-uzwG-hk7.js +199 -0
  152. package/dist/{admin/chunks/ca-DviY7mRj.js.map → _chunks/pl-uzwG-hk7.js.map} +1 -1
  153. package/dist/_chunks/pt-BR-BiOz37D9.js +201 -0
  154. package/dist/{admin/chunks/pt-BR-CcotyBGJ.js.map → _chunks/pt-BR-BiOz37D9.js.map} +1 -1
  155. package/dist/_chunks/pt-BR-C71iDxnh.mjs +201 -0
  156. package/dist/_chunks/pt-BR-C71iDxnh.mjs.map +1 -0
  157. package/dist/_chunks/pt-BsaFvS8-.mjs +95 -0
  158. package/dist/_chunks/pt-BsaFvS8-.mjs.map +1 -0
  159. package/dist/_chunks/pt-CeXQuq50.js +95 -0
  160. package/dist/_chunks/pt-CeXQuq50.js.map +1 -0
  161. package/dist/_chunks/relations--YOvQBqv.mjs +134 -0
  162. package/dist/_chunks/relations--YOvQBqv.mjs.map +1 -0
  163. package/dist/_chunks/relations-Ai6Izh7h.js +133 -0
  164. package/dist/_chunks/relations-Ai6Izh7h.js.map +1 -0
  165. package/dist/_chunks/ru-BE6A4Exp.mjs +231 -0
  166. package/dist/{admin/chunks/ar-DeQBSsfl.js.map → _chunks/ru-BE6A4Exp.mjs.map} +1 -1
  167. package/dist/_chunks/ru-BT3ybNny.js +231 -0
  168. package/dist/{admin/chunks/ru-CB4BUyQp.js.map → _chunks/ru-BT3ybNny.js.map} +1 -1
  169. package/dist/_chunks/sa-CcvkYInH.js +200 -0
  170. package/dist/_chunks/sa-CcvkYInH.js.map +1 -0
  171. package/dist/_chunks/sa-Dag0k-Z8.mjs +200 -0
  172. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +1 -0
  173. package/dist/_chunks/sk-BFg-R8qJ.mjs +202 -0
  174. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +1 -0
  175. package/dist/_chunks/sk-CvY09Xjv.js +202 -0
  176. package/dist/_chunks/sk-CvY09Xjv.js.map +1 -0
  177. package/dist/_chunks/sv-CUnfWGsh.mjs +202 -0
  178. package/dist/_chunks/sv-CUnfWGsh.mjs.map +1 -0
  179. package/dist/_chunks/sv-MYDuzgvT.js +202 -0
  180. package/dist/_chunks/sv-MYDuzgvT.js.map +1 -0
  181. package/dist/_chunks/th-BqbI8lIT.mjs +148 -0
  182. package/dist/_chunks/th-BqbI8lIT.mjs.map +1 -0
  183. package/dist/_chunks/th-D9_GfAjc.js +148 -0
  184. package/dist/{admin/chunks/ms-CvSC0OdG.js.map → _chunks/th-D9_GfAjc.js.map} +1 -1
  185. package/dist/_chunks/tr-CgeK3wJM.mjs +199 -0
  186. package/dist/_chunks/tr-CgeK3wJM.mjs.map +1 -0
  187. package/dist/_chunks/tr-D9UH-O_R.js +199 -0
  188. package/dist/_chunks/tr-D9UH-O_R.js.map +1 -0
  189. package/dist/_chunks/uk-C8EiqJY7.js +144 -0
  190. package/dist/{admin/chunks/ms-Bh09NFff.js.map → _chunks/uk-C8EiqJY7.js.map} +1 -1
  191. package/dist/_chunks/uk-CR-zDhAY.mjs +144 -0
  192. package/dist/_chunks/uk-CR-zDhAY.mjs.map +1 -0
  193. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js +245 -0
  194. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js.map +1 -0
  195. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs +228 -0
  196. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs.map +1 -0
  197. package/dist/_chunks/usePrev-CZGy2Vjf.mjs +29 -0
  198. package/dist/_chunks/usePrev-CZGy2Vjf.mjs.map +1 -0
  199. package/dist/_chunks/usePrev-D5J_2fEu.js +28 -0
  200. package/dist/_chunks/usePrev-D5J_2fEu.js.map +1 -0
  201. package/dist/_chunks/vi-CJlYDheJ.js +111 -0
  202. package/dist/{admin/chunks/vi-CvBGlTjr.js.map → _chunks/vi-CJlYDheJ.js.map} +1 -1
  203. package/dist/_chunks/vi-DUXIk_fw.mjs +111 -0
  204. package/dist/_chunks/vi-DUXIk_fw.mjs.map +1 -0
  205. package/dist/_chunks/zh-BWZspA60.mjs +209 -0
  206. package/dist/_chunks/zh-BWZspA60.mjs.map +1 -0
  207. package/dist/_chunks/zh-CQQfszqR.js +209 -0
  208. package/dist/{admin/chunks/ca-ClDTvatJ.js.map → _chunks/zh-CQQfszqR.js.map} +1 -1
  209. package/dist/_chunks/zh-Hans-9kOncHGw.js +952 -0
  210. package/dist/{admin/chunks/zh-Hans-CI0HKio3.js.map → _chunks/zh-Hans-9kOncHGw.js.map} +1 -1
  211. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +952 -0
  212. package/dist/{admin/chunks/zh-Hans-JVK9x7xr.js.map → _chunks/zh-Hans-BPQcRIyH.mjs.map} +1 -1
  213. package/dist/admin/index.js +4 -23
  214. package/dist/admin/index.js.map +1 -1
  215. package/dist/admin/index.mjs +13 -16
  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 +1 -2
  220. package/dist/admin/src/preview/components/PreviewHeader.d.ts +1 -2
  221. package/dist/admin/src/preview/index.d.ts +3 -2
  222. package/dist/server/index.js +4396 -5468
  223. package/dist/server/index.js.map +1 -1
  224. package/dist/server/index.mjs +4368 -5442
  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 +1 -0
  234. package/dist/shared/contracts/components.d.ts +1 -0
  235. package/dist/shared/contracts/content-types.d.ts +1 -0
  236. package/dist/shared/contracts/history-versions.d.ts +1 -0
  237. package/dist/shared/contracts/index.d.ts +1 -0
  238. package/dist/shared/contracts/init.d.ts +1 -0
  239. package/dist/shared/contracts/preview.d.ts +1 -0
  240. package/dist/shared/contracts/relations.d.ts +2 -1
  241. package/dist/shared/contracts/relations.d.ts.map +1 -1
  242. package/dist/shared/contracts/review-workflows.d.ts +1 -0
  243. package/dist/shared/contracts/single-types.d.ts +1 -0
  244. package/dist/shared/contracts/uid.d.ts +1 -0
  245. package/dist/shared/index.d.ts +1 -0
  246. package/dist/shared/index.js +24 -35
  247. package/dist/shared/index.js.map +1 -1
  248. package/dist/shared/index.mjs +25 -34
  249. package/dist/shared/index.mjs.map +1 -1
  250. package/package.json +10 -13
  251. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js +0 -80
  252. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js.map +0 -1
  253. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js +0 -82
  254. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js.map +0 -1
  255. package/dist/admin/chunks/ComponentConfigurationPage-Co2eC_-C.js +0 -276
  256. package/dist/admin/chunks/ComponentConfigurationPage-Co2eC_-C.js.map +0 -1
  257. package/dist/admin/chunks/ComponentConfigurationPage-Dj1bNvEF.js +0 -298
  258. package/dist/admin/chunks/ComponentConfigurationPage-Dj1bNvEF.js.map +0 -1
  259. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js +0 -153
  260. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js.map +0 -1
  261. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js +0 -176
  262. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js.map +0 -1
  263. package/dist/admin/chunks/EditConfigurationPage-Dm5woBp9.js +0 -180
  264. package/dist/admin/chunks/EditConfigurationPage-Dm5woBp9.js.map +0 -1
  265. package/dist/admin/chunks/EditConfigurationPage-zd9OLaVh.js +0 -158
  266. package/dist/admin/chunks/EditConfigurationPage-zd9OLaVh.js.map +0 -1
  267. package/dist/admin/chunks/EditViewPage-DsBKmSPb.js +0 -337
  268. package/dist/admin/chunks/EditViewPage-DsBKmSPb.js.map +0 -1
  269. package/dist/admin/chunks/EditViewPage-kAIaYTg0.js +0 -314
  270. package/dist/admin/chunks/EditViewPage-kAIaYTg0.js.map +0 -1
  271. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js +0 -56
  272. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js.map +0 -1
  273. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js +0 -58
  274. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js.map +0 -1
  275. package/dist/admin/chunks/Form-BO69oITe.js +0 -955
  276. package/dist/admin/chunks/Form-BO69oITe.js.map +0 -1
  277. package/dist/admin/chunks/Form-BPIhJKyf.js +0 -978
  278. package/dist/admin/chunks/Form-BPIhJKyf.js.map +0 -1
  279. package/dist/admin/chunks/History-BzvpM-Gw.js +0 -1357
  280. package/dist/admin/chunks/History-BzvpM-Gw.js.map +0 -1
  281. package/dist/admin/chunks/History-DBQ96jv2.js +0 -1380
  282. package/dist/admin/chunks/History-DBQ96jv2.js.map +0 -1
  283. package/dist/admin/chunks/Input-BlDcbhUC.js +0 -6755
  284. package/dist/admin/chunks/Input-BlDcbhUC.js.map +0 -1
  285. package/dist/admin/chunks/Input-Dh1MtWno.js +0 -6786
  286. package/dist/admin/chunks/Input-Dh1MtWno.js.map +0 -1
  287. package/dist/admin/chunks/ListConfigurationPage-8d3BsQIr.js +0 -818
  288. package/dist/admin/chunks/ListConfigurationPage-8d3BsQIr.js.map +0 -1
  289. package/dist/admin/chunks/ListConfigurationPage-DK0ARecn.js +0 -795
  290. package/dist/admin/chunks/ListConfigurationPage-DK0ARecn.js.map +0 -1
  291. package/dist/admin/chunks/ListViewPage-BF2q7N6W.js +0 -1132
  292. package/dist/admin/chunks/ListViewPage-BF2q7N6W.js.map +0 -1
  293. package/dist/admin/chunks/ListViewPage-CS1ED-vI.js +0 -1154
  294. package/dist/admin/chunks/ListViewPage-CS1ED-vI.js.map +0 -1
  295. package/dist/admin/chunks/NoContentTypePage-C5Qxz3I4.js +0 -59
  296. package/dist/admin/chunks/NoContentTypePage-C5Qxz3I4.js.map +0 -1
  297. package/dist/admin/chunks/NoContentTypePage-DjdXr1-j.js +0 -57
  298. package/dist/admin/chunks/NoContentTypePage-DjdXr1-j.js.map +0 -1
  299. package/dist/admin/chunks/NoPermissionsPage-BUwtKUEP.js +0 -36
  300. package/dist/admin/chunks/NoPermissionsPage-BUwtKUEP.js.map +0 -1
  301. package/dist/admin/chunks/NoPermissionsPage-C5dC0MtL.js +0 -38
  302. package/dist/admin/chunks/NoPermissionsPage-C5dC0MtL.js.map +0 -1
  303. package/dist/admin/chunks/Preview-C9kXTY6C.js +0 -531
  304. package/dist/admin/chunks/Preview-C9kXTY6C.js.map +0 -1
  305. package/dist/admin/chunks/Preview-DBvmhR7Q.js +0 -553
  306. package/dist/admin/chunks/Preview-DBvmhR7Q.js.map +0 -1
  307. package/dist/admin/chunks/Relations-Cn0atFpd.js +0 -827
  308. package/dist/admin/chunks/Relations-Cn0atFpd.js.map +0 -1
  309. package/dist/admin/chunks/Relations-XHxDKEvT.js +0 -853
  310. package/dist/admin/chunks/Relations-XHxDKEvT.js.map +0 -1
  311. package/dist/admin/chunks/ar-DckYq_WK.js +0 -222
  312. package/dist/admin/chunks/ar-DeQBSsfl.js +0 -227
  313. package/dist/admin/chunks/ca-ClDTvatJ.js +0 -202
  314. package/dist/admin/chunks/ca-DviY7mRj.js +0 -197
  315. package/dist/admin/chunks/cs-BJFxwIWj.js +0 -126
  316. package/dist/admin/chunks/cs-C7OSYFQ7.js +0 -122
  317. package/dist/admin/chunks/de-5QRlDHyR.js +0 -195
  318. package/dist/admin/chunks/de-CbImAUA5.js +0 -200
  319. package/dist/admin/chunks/en-C1CjdAtC.js +0 -313
  320. package/dist/admin/chunks/en-LfhocNG2.js +0 -308
  321. package/dist/admin/chunks/es-C8vLuvZL.js +0 -197
  322. package/dist/admin/chunks/es-DkoWSExG.js +0 -192
  323. package/dist/admin/chunks/eu-BG1xX7HK.js +0 -198
  324. package/dist/admin/chunks/eu-BG1xX7HK.js.map +0 -1
  325. package/dist/admin/chunks/eu-BJW3AvXu.js +0 -203
  326. package/dist/admin/chunks/eu-BJW3AvXu.js.map +0 -1
  327. package/dist/admin/chunks/fr-CFdRaRVj.js +0 -215
  328. package/dist/admin/chunks/fr-CFdRaRVj.js.map +0 -1
  329. package/dist/admin/chunks/fr-gQSilC7w.js +0 -220
  330. package/dist/admin/chunks/fr-gQSilC7w.js.map +0 -1
  331. package/dist/admin/chunks/gu-D5MMMXRs.js +0 -196
  332. package/dist/admin/chunks/gu-D5MMMXRs.js.map +0 -1
  333. package/dist/admin/chunks/gu-DPU4wyx7.js +0 -201
  334. package/dist/admin/chunks/gu-DPU4wyx7.js.map +0 -1
  335. package/dist/admin/chunks/hi-Dp4omeBb.js +0 -201
  336. package/dist/admin/chunks/hi-Dp4omeBb.js.map +0 -1
  337. package/dist/admin/chunks/hi-lp17SCjr.js +0 -196
  338. package/dist/admin/chunks/hi-lp17SCjr.js.map +0 -1
  339. package/dist/admin/chunks/hooks-D-sOYd1s.js.map +0 -1
  340. package/dist/admin/chunks/hooks-DMvik5y_.js +0 -7
  341. package/dist/admin/chunks/hooks-DMvik5y_.js.map +0 -1
  342. package/dist/admin/chunks/hu-CLka1U2C.js +0 -198
  343. package/dist/admin/chunks/hu-CLka1U2C.js.map +0 -1
  344. package/dist/admin/chunks/hu-CtFJuhTd.js +0 -203
  345. package/dist/admin/chunks/hu-CtFJuhTd.js.map +0 -1
  346. package/dist/admin/chunks/id-D7V5S1rB.js +0 -161
  347. package/dist/admin/chunks/id-USfY9m1g.js +0 -156
  348. package/dist/admin/chunks/id-USfY9m1g.js.map +0 -1
  349. package/dist/admin/chunks/index-BczuAULz.js +0 -5416
  350. package/dist/admin/chunks/index-BczuAULz.js.map +0 -1
  351. package/dist/admin/chunks/index-BkyR-Bnu.js +0 -5350
  352. package/dist/admin/chunks/index-BkyR-Bnu.js.map +0 -1
  353. package/dist/admin/chunks/it-BAHrwmYS.js +0 -158
  354. package/dist/admin/chunks/it-CQFpa_Dc.js +0 -163
  355. package/dist/admin/chunks/ja-BWKmBJFT.js +0 -192
  356. package/dist/admin/chunks/ja-BWKmBJFT.js.map +0 -1
  357. package/dist/admin/chunks/ja-jdQM-B79.js +0 -197
  358. package/dist/admin/chunks/ja-jdQM-B79.js.map +0 -1
  359. package/dist/admin/chunks/ko-CgADGBNt.js +0 -191
  360. package/dist/admin/chunks/ko-CgADGBNt.js.map +0 -1
  361. package/dist/admin/chunks/ko-k46sEyzt.js +0 -196
  362. package/dist/admin/chunks/ko-k46sEyzt.js.map +0 -1
  363. package/dist/admin/chunks/layout-DcDoRT8g.js +0 -618
  364. package/dist/admin/chunks/layout-DcDoRT8g.js.map +0 -1
  365. package/dist/admin/chunks/layout-fghBgRgX.js +0 -598
  366. package/dist/admin/chunks/layout-fghBgRgX.js.map +0 -1
  367. package/dist/admin/chunks/ml-CnhCfOn_.js +0 -196
  368. package/dist/admin/chunks/ml-CnhCfOn_.js.map +0 -1
  369. package/dist/admin/chunks/ml-DqxPwODx.js +0 -201
  370. package/dist/admin/chunks/ml-DqxPwODx.js.map +0 -1
  371. package/dist/admin/chunks/ms-Bh09NFff.js +0 -140
  372. package/dist/admin/chunks/ms-CvSC0OdG.js +0 -145
  373. package/dist/admin/chunks/nl-BEubhS8C.js +0 -203
  374. package/dist/admin/chunks/nl-BEubhS8C.js.map +0 -1
  375. package/dist/admin/chunks/nl-C8HYflTc.js +0 -198
  376. package/dist/admin/chunks/nl-C8HYflTc.js.map +0 -1
  377. package/dist/admin/chunks/objects-C3EebVVe.js +0 -76
  378. package/dist/admin/chunks/objects-C3EebVVe.js.map +0 -1
  379. package/dist/admin/chunks/objects-wl73iEma.js +0 -73
  380. package/dist/admin/chunks/objects-wl73iEma.js.map +0 -1
  381. package/dist/admin/chunks/pl-DWhGDzmM.js +0 -200
  382. package/dist/admin/chunks/pl-DWhGDzmM.js.map +0 -1
  383. package/dist/admin/chunks/pl-MFCZJZuZ.js +0 -195
  384. package/dist/admin/chunks/pl-MFCZJZuZ.js.map +0 -1
  385. package/dist/admin/chunks/pt-BR-CPtAXD-4.js +0 -202
  386. package/dist/admin/chunks/pt-BR-CPtAXD-4.js.map +0 -1
  387. package/dist/admin/chunks/pt-BR-CcotyBGJ.js +0 -197
  388. package/dist/admin/chunks/pt-BoPxN80n.js +0 -96
  389. package/dist/admin/chunks/pt-BoPxN80n.js.map +0 -1
  390. package/dist/admin/chunks/pt-HbmgeiYO.js +0 -93
  391. package/dist/admin/chunks/pt-HbmgeiYO.js.map +0 -1
  392. package/dist/admin/chunks/relations-CgaydhiM.js +0 -178
  393. package/dist/admin/chunks/relations-CgaydhiM.js.map +0 -1
  394. package/dist/admin/chunks/relations-DPVgU_rq.js +0 -173
  395. package/dist/admin/chunks/relations-DPVgU_rq.js.map +0 -1
  396. package/dist/admin/chunks/ru-C0op0ALG.js +0 -232
  397. package/dist/admin/chunks/ru-C0op0ALG.js.map +0 -1
  398. package/dist/admin/chunks/ru-CB4BUyQp.js +0 -230
  399. package/dist/admin/chunks/sa-B_FuPyMw.js +0 -201
  400. package/dist/admin/chunks/sa-B_FuPyMw.js.map +0 -1
  401. package/dist/admin/chunks/sa-n_aPA-pU.js +0 -196
  402. package/dist/admin/chunks/sa-n_aPA-pU.js.map +0 -1
  403. package/dist/admin/chunks/sk-D_iXML2C.js +0 -203
  404. package/dist/admin/chunks/sk-D_iXML2C.js.map +0 -1
  405. package/dist/admin/chunks/sk-tn_BDjE2.js +0 -198
  406. package/dist/admin/chunks/sk-tn_BDjE2.js.map +0 -1
  407. package/dist/admin/chunks/sv-BstBC1Yp.js +0 -203
  408. package/dist/admin/chunks/sv-BstBC1Yp.js.map +0 -1
  409. package/dist/admin/chunks/sv-cq4ZrQRd.js +0 -198
  410. package/dist/admin/chunks/sv-cq4ZrQRd.js.map +0 -1
  411. package/dist/admin/chunks/th-lXoOCqPC.js +0 -149
  412. package/dist/admin/chunks/th-lXoOCqPC.js.map +0 -1
  413. package/dist/admin/chunks/th-mUH7hEtc.js +0 -144
  414. package/dist/admin/chunks/th-mUH7hEtc.js.map +0 -1
  415. package/dist/admin/chunks/tr-CkS6sLIE.js +0 -200
  416. package/dist/admin/chunks/tr-CkS6sLIE.js.map +0 -1
  417. package/dist/admin/chunks/tr-Yt38daxh.js +0 -195
  418. package/dist/admin/chunks/tr-Yt38daxh.js.map +0 -1
  419. package/dist/admin/chunks/uk-B24MoTVg.js +0 -145
  420. package/dist/admin/chunks/uk-B24MoTVg.js.map +0 -1
  421. package/dist/admin/chunks/uk-Cpgmm7gE.js +0 -140
  422. package/dist/admin/chunks/uk-Cpgmm7gE.js.map +0 -1
  423. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js +0 -247
  424. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js.map +0 -1
  425. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js +0 -271
  426. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js.map +0 -1
  427. package/dist/admin/chunks/usePrev-Bjw2dhmq.js +0 -18
  428. package/dist/admin/chunks/usePrev-Bjw2dhmq.js.map +0 -1
  429. package/dist/admin/chunks/usePrev-DIYl-IAL.js +0 -21
  430. package/dist/admin/chunks/usePrev-DIYl-IAL.js.map +0 -1
  431. package/dist/admin/chunks/vi-BGr1X_HZ.js +0 -112
  432. package/dist/admin/chunks/vi-BGr1X_HZ.js.map +0 -1
  433. package/dist/admin/chunks/vi-CvBGlTjr.js +0 -108
  434. package/dist/admin/chunks/zh-BmF-sHaT.js +0 -205
  435. package/dist/admin/chunks/zh-BmF-sHaT.js.map +0 -1
  436. package/dist/admin/chunks/zh-DwFu_Kfj.js +0 -210
  437. package/dist/admin/chunks/zh-DwFu_Kfj.js.map +0 -1
  438. package/dist/admin/chunks/zh-Hans-CI0HKio3.js +0 -934
  439. package/dist/admin/chunks/zh-Hans-JVK9x7xr.js +0 -953
@@ -0,0 +1,999 @@
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-DiluOUp6.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-BkKwZ6Qt.mjs";
14
+ import { g as getRelationLabel } from "./relations--YOvQBqv.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-WOQNVho-.mjs.map