@strapi/content-manager 0.0.0-experimental.d042f6a350fa3a48d61e7c56875e2a0a7ba3c8f5 → 0.0.0-experimental.d1602f22dc638a4c3c5084965fd6126fff5e9d4f

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 (444) 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-DXwOtpq1.js +298 -0
  6. package/dist/admin/chunks/ComponentConfigurationPage-DXwOtpq1.js.map +1 -0
  7. package/dist/admin/chunks/ComponentConfigurationPage-DhYZp4nN.js +276 -0
  8. package/dist/admin/chunks/ComponentConfigurationPage-DhYZp4nN.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-D0Ng758X.js +180 -0
  14. package/dist/admin/chunks/EditConfigurationPage-D0Ng758X.js.map +1 -0
  15. package/dist/admin/chunks/EditConfigurationPage-DDuPch5d.js +158 -0
  16. package/dist/admin/chunks/EditConfigurationPage-DDuPch5d.js.map +1 -0
  17. package/dist/admin/chunks/EditViewPage-jCZnUuCR.js +265 -0
  18. package/dist/admin/chunks/EditViewPage-jCZnUuCR.js.map +1 -0
  19. package/dist/admin/chunks/EditViewPage-zSnDwLz3.js +288 -0
  20. package/dist/admin/chunks/EditViewPage-zSnDwLz3.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-BEqiuSvQ.js +978 -0
  26. package/dist/admin/chunks/Form-BEqiuSvQ.js.map +1 -0
  27. package/dist/admin/chunks/Form-CZmB6JIg.js +955 -0
  28. package/dist/admin/chunks/Form-CZmB6JIg.js.map +1 -0
  29. package/dist/admin/chunks/History-BlLKDZSw.js +1331 -0
  30. package/dist/admin/chunks/History-BlLKDZSw.js.map +1 -0
  31. package/dist/admin/chunks/History-CPYXgxkS.js +1308 -0
  32. package/dist/admin/chunks/History-CPYXgxkS.js.map +1 -0
  33. package/dist/admin/chunks/Input-CLX3C5DI.js +6711 -0
  34. package/dist/admin/chunks/Input-CLX3C5DI.js.map +1 -0
  35. package/dist/admin/chunks/Input-DiR2Xfa7.js +6742 -0
  36. package/dist/admin/chunks/Input-DiR2Xfa7.js.map +1 -0
  37. package/dist/admin/chunks/ListConfigurationPage-CNvotSqe.js +795 -0
  38. package/dist/admin/chunks/ListConfigurationPage-CNvotSqe.js.map +1 -0
  39. package/dist/admin/chunks/ListConfigurationPage-DdTp-HxB.js +818 -0
  40. package/dist/admin/chunks/ListConfigurationPage-DdTp-HxB.js.map +1 -0
  41. package/dist/admin/chunks/ListViewPage-BtXYjEYz.js +1154 -0
  42. package/dist/admin/chunks/ListViewPage-BtXYjEYz.js.map +1 -0
  43. package/dist/admin/chunks/ListViewPage-MJNfQTp-.js +1132 -0
  44. package/dist/admin/chunks/ListViewPage-MJNfQTp-.js.map +1 -0
  45. package/dist/admin/chunks/NoContentTypePage-BJrZvYPY.js +57 -0
  46. package/dist/admin/chunks/NoContentTypePage-BJrZvYPY.js.map +1 -0
  47. package/dist/admin/chunks/NoContentTypePage-CVvVpwj4.js +59 -0
  48. package/dist/admin/chunks/NoContentTypePage-CVvVpwj4.js.map +1 -0
  49. package/dist/admin/chunks/NoPermissionsPage-BulvG4hB.js +36 -0
  50. package/dist/admin/chunks/NoPermissionsPage-BulvG4hB.js.map +1 -0
  51. package/dist/admin/chunks/NoPermissionsPage-C5yWg70d.js +38 -0
  52. package/dist/admin/chunks/NoPermissionsPage-C5yWg70d.js.map +1 -0
  53. package/dist/admin/chunks/Preview-DEuQgQg2.js +482 -0
  54. package/dist/admin/chunks/Preview-DEuQgQg2.js.map +1 -0
  55. package/dist/admin/chunks/Preview-H74FQ9Cq.js +504 -0
  56. package/dist/admin/chunks/Preview-H74FQ9Cq.js.map +1 -0
  57. package/dist/admin/chunks/Relations-C8jbZPVK.js +827 -0
  58. package/dist/admin/chunks/Relations-C8jbZPVK.js.map +1 -0
  59. package/dist/admin/chunks/Relations-mxOUS7TJ.js +853 -0
  60. package/dist/admin/chunks/Relations-mxOUS7TJ.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-BRlRBRLb.js +5350 -0
  114. package/dist/admin/chunks/index-BRlRBRLb.js.map +1 -0
  115. package/dist/admin/chunks/index-ZIwOPk6p.js +5416 -0
  116. package/dist/admin/chunks/index-ZIwOPk6p.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-B3-guCPG.js +598 -0
  130. package/dist/admin/chunks/layout-B3-guCPG.js.map +1 -0
  131. package/dist/admin/chunks/layout-ameRNiAM.js +618 -0
  132. package/dist/admin/chunks/layout-ameRNiAM.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-CmoFVrKj.js +178 -0
  162. package/dist/admin/chunks/relations-CmoFVrKj.js.map +1 -0
  163. package/dist/admin/chunks/relations-DYQAaXwZ.js +173 -0
  164. package/dist/admin/chunks/relations-DYQAaXwZ.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/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +0 -1
  220. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +0 -49
  221. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -1
  222. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -1
  223. package/dist/admin/src/preview/index.d.ts +2 -3
  224. package/dist/server/index.js +5459 -4387
  225. package/dist/server/index.js.map +1 -1
  226. package/dist/server/index.mjs +5446 -4372
  227. package/dist/server/index.mjs.map +1 -1
  228. package/dist/server/src/controllers/utils/metadata.d.ts +1 -1
  229. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  230. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  231. package/dist/server/src/services/utils/count.d.ts +1 -1
  232. package/dist/server/src/services/utils/count.d.ts.map +1 -1
  233. package/dist/server/src/services/utils/populate.d.ts +1 -1
  234. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  235. package/dist/shared/contracts/collection-types.d.ts +0 -1
  236. package/dist/shared/contracts/components.d.ts +0 -1
  237. package/dist/shared/contracts/content-types.d.ts +0 -1
  238. package/dist/shared/contracts/history-versions.d.ts +0 -1
  239. package/dist/shared/contracts/index.d.ts +0 -1
  240. package/dist/shared/contracts/init.d.ts +0 -1
  241. package/dist/shared/contracts/preview.d.ts +0 -1
  242. package/dist/shared/contracts/relations.d.ts +1 -2
  243. package/dist/shared/contracts/relations.d.ts.map +1 -1
  244. package/dist/shared/contracts/review-workflows.d.ts +0 -1
  245. package/dist/shared/contracts/single-types.d.ts +0 -1
  246. package/dist/shared/contracts/uid.d.ts +0 -1
  247. package/dist/shared/index.d.ts +0 -1
  248. package/dist/shared/index.js +35 -24
  249. package/dist/shared/index.js.map +1 -1
  250. package/dist/shared/index.mjs +34 -25
  251. package/dist/shared/index.mjs.map +1 -1
  252. package/package.json +13 -10
  253. package/dist/_chunks/CardDragPreview-C0QyJgRA.js +0 -69
  254. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +0 -1
  255. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs +0 -70
  256. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +0 -1
  257. package/dist/_chunks/ComponentConfigurationPage-9_4yUE9L.mjs +0 -236
  258. package/dist/_chunks/ComponentConfigurationPage-9_4yUE9L.mjs.map +0 -1
  259. package/dist/_chunks/ComponentConfigurationPage-DBSh-kET.js +0 -254
  260. package/dist/_chunks/ComponentConfigurationPage-DBSh-kET.js.map +0 -1
  261. package/dist/_chunks/ComponentIcon-CRbtQEUV.js +0 -175
  262. package/dist/_chunks/ComponentIcon-CRbtQEUV.js.map +0 -1
  263. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs +0 -157
  264. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +0 -1
  265. package/dist/_chunks/EditConfigurationPage-Bl_U2JgH.js +0 -150
  266. package/dist/_chunks/EditConfigurationPage-Bl_U2JgH.js.map +0 -1
  267. package/dist/_chunks/EditConfigurationPage-COe6hjPC.mjs +0 -132
  268. package/dist/_chunks/EditConfigurationPage-COe6hjPC.mjs.map +0 -1
  269. package/dist/_chunks/EditViewPage-D4yFJET6.js +0 -209
  270. package/dist/_chunks/EditViewPage-D4yFJET6.js.map +0 -1
  271. package/dist/_chunks/EditViewPage-DrmVmYN0.mjs +0 -191
  272. package/dist/_chunks/EditViewPage-DrmVmYN0.mjs.map +0 -1
  273. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +0 -50
  274. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +0 -1
  275. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +0 -49
  276. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +0 -1
  277. package/dist/_chunks/Form-C4rSaGsz.js +0 -778
  278. package/dist/_chunks/Form-C4rSaGsz.js.map +0 -1
  279. package/dist/_chunks/Form-DamaxNpG.mjs +0 -758
  280. package/dist/_chunks/Form-DamaxNpG.mjs.map +0 -1
  281. package/dist/_chunks/History-D1PreDSY.mjs +0 -999
  282. package/dist/_chunks/History-D1PreDSY.mjs.map +0 -1
  283. package/dist/_chunks/History-DTm8UCCQ.js +0 -1019
  284. package/dist/_chunks/History-DTm8UCCQ.js.map +0 -1
  285. package/dist/_chunks/Input-B7sapvBG.js +0 -5617
  286. package/dist/_chunks/Input-B7sapvBG.js.map +0 -1
  287. package/dist/_chunks/Input-CZ1YvjHR.mjs +0 -5585
  288. package/dist/_chunks/Input-CZ1YvjHR.mjs.map +0 -1
  289. package/dist/_chunks/ListConfigurationPage-Bbi32isk.mjs +0 -633
  290. package/dist/_chunks/ListConfigurationPage-Bbi32isk.mjs.map +0 -1
  291. package/dist/_chunks/ListConfigurationPage-ysFMjKI3.js +0 -652
  292. package/dist/_chunks/ListConfigurationPage-ysFMjKI3.js.map +0 -1
  293. package/dist/_chunks/ListViewPage-Bud_jBDQ.mjs +0 -854
  294. package/dist/_chunks/ListViewPage-Bud_jBDQ.mjs.map +0 -1
  295. package/dist/_chunks/ListViewPage-DTuuxU3n.js +0 -877
  296. package/dist/_chunks/ListViewPage-DTuuxU3n.js.map +0 -1
  297. package/dist/_chunks/NoContentTypePage-CL7VVeYs.js +0 -51
  298. package/dist/_chunks/NoContentTypePage-CL7VVeYs.js.map +0 -1
  299. package/dist/_chunks/NoContentTypePage-DVhkugsf.mjs +0 -51
  300. package/dist/_chunks/NoContentTypePage-DVhkugsf.mjs.map +0 -1
  301. package/dist/_chunks/NoPermissionsPage-CMdM-dCo.mjs +0 -23
  302. package/dist/_chunks/NoPermissionsPage-CMdM-dCo.mjs.map +0 -1
  303. package/dist/_chunks/NoPermissionsPage-v7I599vC.js +0 -23
  304. package/dist/_chunks/NoPermissionsPage-v7I599vC.js.map +0 -1
  305. package/dist/_chunks/Preview-BNuU0SuQ.mjs +0 -287
  306. package/dist/_chunks/Preview-BNuU0SuQ.mjs.map +0 -1
  307. package/dist/_chunks/Preview-Cxq-uI6D.js +0 -305
  308. package/dist/_chunks/Preview-Cxq-uI6D.js.map +0 -1
  309. package/dist/_chunks/Relations-C2Ahkrdg.mjs +0 -728
  310. package/dist/_chunks/Relations-C2Ahkrdg.mjs.map +0 -1
  311. package/dist/_chunks/Relations-CWS79QQn.js +0 -747
  312. package/dist/_chunks/Relations-CWS79QQn.js.map +0 -1
  313. package/dist/_chunks/ar-BUUWXIYu.js +0 -226
  314. package/dist/_chunks/ar-BUUWXIYu.js.map +0 -1
  315. package/dist/_chunks/ar-CCEVvqGG.mjs +0 -226
  316. package/dist/_chunks/ar-CCEVvqGG.mjs.map +0 -1
  317. package/dist/_chunks/ca-5U32ON2v.mjs +0 -201
  318. package/dist/_chunks/ca-5U32ON2v.mjs.map +0 -1
  319. package/dist/_chunks/ca-Cmk45QO6.js +0 -201
  320. package/dist/_chunks/cs-CM2aBUar.mjs +0 -125
  321. package/dist/_chunks/cs-CM2aBUar.mjs.map +0 -1
  322. package/dist/_chunks/cs-CkJy6B2v.js +0 -125
  323. package/dist/_chunks/de-C72KDNOl.mjs +0 -199
  324. package/dist/_chunks/de-C72KDNOl.mjs.map +0 -1
  325. package/dist/_chunks/de-CCEmbAah.js +0 -199
  326. package/dist/_chunks/en-BR48D_RH.js +0 -312
  327. package/dist/_chunks/en-D65uIF6Y.mjs +0 -312
  328. package/dist/_chunks/es-9K52xZIr.js +0 -196
  329. package/dist/_chunks/es-D34tqjMw.mjs +0 -196
  330. package/dist/_chunks/es-D34tqjMw.mjs.map +0 -1
  331. package/dist/_chunks/eu-CdALomew.mjs +0 -202
  332. package/dist/_chunks/eu-CdALomew.mjs.map +0 -1
  333. package/dist/_chunks/eu-VDH-3ovk.js +0 -202
  334. package/dist/_chunks/fr-C43IbhA_.js +0 -219
  335. package/dist/_chunks/fr-C43IbhA_.js.map +0 -1
  336. package/dist/_chunks/fr-DBseuRuB.mjs +0 -219
  337. package/dist/_chunks/fr-DBseuRuB.mjs.map +0 -1
  338. package/dist/_chunks/gu-BRmF601H.js +0 -200
  339. package/dist/_chunks/gu-CNpaMDpH.mjs +0 -200
  340. package/dist/_chunks/gu-CNpaMDpH.mjs.map +0 -1
  341. package/dist/_chunks/hi-CCJBptSq.js +0 -200
  342. package/dist/_chunks/hi-CCJBptSq.js.map +0 -1
  343. package/dist/_chunks/hi-Dwvd04m3.mjs +0 -200
  344. package/dist/_chunks/hi-Dwvd04m3.mjs.map +0 -1
  345. package/dist/_chunks/hooks-BAaaKPS_.js.map +0 -1
  346. package/dist/_chunks/hooks-E5u1mcgM.mjs +0 -8
  347. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +0 -1
  348. package/dist/_chunks/hu-CeYvaaO0.mjs +0 -202
  349. package/dist/_chunks/hu-CeYvaaO0.mjs.map +0 -1
  350. package/dist/_chunks/hu-sNV_yLYy.js +0 -202
  351. package/dist/_chunks/hu-sNV_yLYy.js.map +0 -1
  352. package/dist/_chunks/id-B5Ser98A.js +0 -160
  353. package/dist/_chunks/id-B5Ser98A.js.map +0 -1
  354. package/dist/_chunks/id-BtwA9WJT.mjs +0 -160
  355. package/dist/_chunks/id-BtwA9WJT.mjs.map +0 -1
  356. package/dist/_chunks/index-DQsvBb_N.js +0 -4500
  357. package/dist/_chunks/index-DQsvBb_N.js.map +0 -1
  358. package/dist/_chunks/index-ZKrsjv-2.mjs +0 -4481
  359. package/dist/_chunks/index-ZKrsjv-2.mjs.map +0 -1
  360. package/dist/_chunks/it-BrVPqaf1.mjs +0 -162
  361. package/dist/_chunks/it-BrVPqaf1.mjs.map +0 -1
  362. package/dist/_chunks/it-DkBIs7vD.js +0 -162
  363. package/dist/_chunks/ja-7sfIbjxE.js +0 -196
  364. package/dist/_chunks/ja-BHqhDq4V.mjs +0 -196
  365. package/dist/_chunks/ja-BHqhDq4V.mjs.map +0 -1
  366. package/dist/_chunks/ko-HVQRlfUI.mjs +0 -195
  367. package/dist/_chunks/ko-HVQRlfUI.mjs.map +0 -1
  368. package/dist/_chunks/ko-woFZPmLk.js +0 -195
  369. package/dist/_chunks/layout-Cl0NhlQB.js +0 -488
  370. package/dist/_chunks/layout-Cl0NhlQB.js.map +0 -1
  371. package/dist/_chunks/layout-fQk1rMk9.mjs +0 -471
  372. package/dist/_chunks/layout-fQk1rMk9.mjs.map +0 -1
  373. package/dist/_chunks/ml-BihZwQit.mjs +0 -200
  374. package/dist/_chunks/ml-BihZwQit.mjs.map +0 -1
  375. package/dist/_chunks/ml-C2W8N8k1.js +0 -200
  376. package/dist/_chunks/ml-C2W8N8k1.js.map +0 -1
  377. package/dist/_chunks/ms-BuFotyP_.js +0 -144
  378. package/dist/_chunks/ms-m_WjyWx7.mjs +0 -144
  379. package/dist/_chunks/ms-m_WjyWx7.mjs.map +0 -1
  380. package/dist/_chunks/nl-D4R9gHx5.mjs +0 -202
  381. package/dist/_chunks/nl-D4R9gHx5.mjs.map +0 -1
  382. package/dist/_chunks/nl-bbEOHChV.js +0 -202
  383. package/dist/_chunks/nl-bbEOHChV.js.map +0 -1
  384. package/dist/_chunks/objects-BcXOv6_9.js +0 -47
  385. package/dist/_chunks/objects-BcXOv6_9.js.map +0 -1
  386. package/dist/_chunks/objects-D6yBsdmx.mjs +0 -45
  387. package/dist/_chunks/objects-D6yBsdmx.mjs.map +0 -1
  388. package/dist/_chunks/pl-sbx9mSt_.mjs +0 -199
  389. package/dist/_chunks/pl-sbx9mSt_.mjs.map +0 -1
  390. package/dist/_chunks/pl-uzwG-hk7.js +0 -199
  391. package/dist/_chunks/pl-uzwG-hk7.js.map +0 -1
  392. package/dist/_chunks/pt-BR-BiOz37D9.js +0 -201
  393. package/dist/_chunks/pt-BR-C71iDxnh.mjs +0 -201
  394. package/dist/_chunks/pt-BR-C71iDxnh.mjs.map +0 -1
  395. package/dist/_chunks/pt-BsaFvS8-.mjs +0 -95
  396. package/dist/_chunks/pt-BsaFvS8-.mjs.map +0 -1
  397. package/dist/_chunks/pt-CeXQuq50.js +0 -95
  398. package/dist/_chunks/pt-CeXQuq50.js.map +0 -1
  399. package/dist/_chunks/relations-BRfBxVbX.js +0 -133
  400. package/dist/_chunks/relations-BRfBxVbX.js.map +0 -1
  401. package/dist/_chunks/relations-BakOFl_1.mjs +0 -134
  402. package/dist/_chunks/relations-BakOFl_1.mjs.map +0 -1
  403. package/dist/_chunks/ru-BE6A4Exp.mjs +0 -231
  404. package/dist/_chunks/ru-BE6A4Exp.mjs.map +0 -1
  405. package/dist/_chunks/ru-BT3ybNny.js +0 -231
  406. package/dist/_chunks/sa-CcvkYInH.js +0 -200
  407. package/dist/_chunks/sa-CcvkYInH.js.map +0 -1
  408. package/dist/_chunks/sa-Dag0k-Z8.mjs +0 -200
  409. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +0 -1
  410. package/dist/_chunks/sk-BFg-R8qJ.mjs +0 -202
  411. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +0 -1
  412. package/dist/_chunks/sk-CvY09Xjv.js +0 -202
  413. package/dist/_chunks/sk-CvY09Xjv.js.map +0 -1
  414. package/dist/_chunks/sv-CUnfWGsh.mjs +0 -202
  415. package/dist/_chunks/sv-CUnfWGsh.mjs.map +0 -1
  416. package/dist/_chunks/sv-MYDuzgvT.js +0 -202
  417. package/dist/_chunks/sv-MYDuzgvT.js.map +0 -1
  418. package/dist/_chunks/th-BqbI8lIT.mjs +0 -148
  419. package/dist/_chunks/th-BqbI8lIT.mjs.map +0 -1
  420. package/dist/_chunks/th-D9_GfAjc.js +0 -148
  421. package/dist/_chunks/tr-CgeK3wJM.mjs +0 -199
  422. package/dist/_chunks/tr-CgeK3wJM.mjs.map +0 -1
  423. package/dist/_chunks/tr-D9UH-O_R.js +0 -199
  424. package/dist/_chunks/tr-D9UH-O_R.js.map +0 -1
  425. package/dist/_chunks/uk-C8EiqJY7.js +0 -144
  426. package/dist/_chunks/uk-CR-zDhAY.mjs +0 -144
  427. package/dist/_chunks/uk-CR-zDhAY.mjs.map +0 -1
  428. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js +0 -245
  429. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js.map +0 -1
  430. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs +0 -228
  431. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs.map +0 -1
  432. package/dist/_chunks/usePrev-CZGy2Vjf.mjs +0 -29
  433. package/dist/_chunks/usePrev-CZGy2Vjf.mjs.map +0 -1
  434. package/dist/_chunks/usePrev-D5J_2fEu.js +0 -28
  435. package/dist/_chunks/usePrev-D5J_2fEu.js.map +0 -1
  436. package/dist/_chunks/vi-CJlYDheJ.js +0 -111
  437. package/dist/_chunks/vi-DUXIk_fw.mjs +0 -111
  438. package/dist/_chunks/vi-DUXIk_fw.mjs.map +0 -1
  439. package/dist/_chunks/zh-BWZspA60.mjs +0 -209
  440. package/dist/_chunks/zh-BWZspA60.mjs.map +0 -1
  441. package/dist/_chunks/zh-CQQfszqR.js +0 -209
  442. package/dist/_chunks/zh-CQQfszqR.js.map +0 -1
  443. package/dist/_chunks/zh-Hans-9kOncHGw.js +0 -952
  444. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +0 -952
@@ -0,0 +1,265 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { useQueryParams, useNotification, Page, Form, Blocker, useRBAC } from '@strapi/admin/strapi-admin';
4
+ import { Main, Tabs, Grid } from '@strapi/design-system';
5
+ import { useIntl } from 'react-intl';
6
+ import { useLocation, useParams } from 'react-router-dom';
7
+ import { styled } from 'styled-components';
8
+ import { c as useDoc, f as useDocumentRBAC, h as useDocumentLayout, i as createYupSchema, j as Header, g as getTranslation, P as Panels, k as PERMISSIONS, l as DocumentRBAC, S as SINGLE_TYPES } from './index-BRlRBRLb.js';
9
+ import { u as useLazyComponents, F as FormLayout } from './Input-CLX3C5DI.js';
10
+ import '@strapi/icons';
11
+ import 'lodash/fp/mapValues';
12
+ import 'yup';
13
+ import 'fractional-indexing';
14
+ import 'lodash/fp/pipe';
15
+ import 'qs';
16
+ import 'date-fns';
17
+ import '@reduxjs/toolkit';
18
+ import 'slate';
19
+ import 'slate-history';
20
+ import 'slate-react';
21
+ import 'prismjs';
22
+ import 'prismjs/themes/prism-solarizedlight.css';
23
+ import './usePrev-Bjw2dhmq.js';
24
+ import './useDragAndDrop-HYwNDExe.js';
25
+ import 'react-dnd';
26
+ import '@radix-ui/react-toolbar';
27
+ import 'react-dnd-html5-backend';
28
+ import './objects-wl73iEma.js';
29
+ import 'lodash/clone';
30
+ import 'lodash/toPath';
31
+ import './Relations-C8jbZPVK.js';
32
+ import 'react-window';
33
+ import './relations-DYQAaXwZ.js';
34
+ import './ComponentIcon-BZcTc4rj.js';
35
+ import '@strapi/icons/symbols';
36
+ import 'codemirror5';
37
+ import 'sanitize-html';
38
+ import 'highlight.js';
39
+ import 'markdown-it';
40
+ import 'markdown-it-abbr';
41
+ import 'markdown-it-container';
42
+ import 'markdown-it-deflist';
43
+ import 'markdown-it-emoji';
44
+ import 'markdown-it-footnote';
45
+ import 'markdown-it-ins';
46
+ import 'markdown-it-mark';
47
+ import 'markdown-it-sub';
48
+ import 'markdown-it-sup';
49
+ import 'highlight.js/styles/solarized-dark.css';
50
+ import 'codemirror5/addon/display/placeholder';
51
+
52
+ const useOnce = (effect)=>React.useEffect(effect, emptyDeps);
53
+ const emptyDeps = [];
54
+
55
+ /* -------------------------------------------------------------------------------------------------
56
+ * EditViewPage
57
+ * -----------------------------------------------------------------------------------------------*/ const EditViewPage = ()=>{
58
+ const location = useLocation();
59
+ const [{ query: { status } }, setQuery] = useQueryParams({
60
+ status: 'draft'
61
+ });
62
+ const { formatMessage } = useIntl();
63
+ const { toggleNotification } = useNotification();
64
+ const { document, meta, isLoading: isLoadingDocument, schema, components, collectionType, id, model, hasError, getTitle, getInitialFormValues } = useDoc();
65
+ const hasDraftAndPublished = schema?.options?.draftAndPublish ?? false;
66
+ useOnce(()=>{
67
+ /**
68
+ * We only ever want to fire the notification once otherwise
69
+ * whenever the app re-renders it'll pop up regardless of
70
+ * what we do because the state comes from react-router-dom
71
+ */ if (location?.state && 'error' in location.state) {
72
+ toggleNotification({
73
+ type: 'danger',
74
+ message: location.state.error,
75
+ timeout: 5000
76
+ });
77
+ }
78
+ });
79
+ const isLoadingActionsRBAC = useDocumentRBAC('EditViewPage', (state)=>state.isLoading);
80
+ const isSingleType = collectionType === SINGLE_TYPES;
81
+ /**
82
+ * single-types don't current have an id, but because they're a singleton
83
+ * we can simply use the update operation to continuously update the same
84
+ * document with varying params.
85
+ */ const isCreatingDocument = !id && !isSingleType;
86
+ const { isLoading: isLoadingLayout, edit: { layout, settings: { mainField } } } = useDocumentLayout(model);
87
+ const { isLazyLoading } = useLazyComponents([]);
88
+ const isLoading = isLoadingActionsRBAC || isLoadingDocument || isLoadingLayout || isLazyLoading;
89
+ const initialValues = getInitialFormValues(isCreatingDocument);
90
+ if (hasError) {
91
+ return /*#__PURE__*/ jsx(Page.Error, {});
92
+ }
93
+ if (isLoading && !document?.documentId) {
94
+ return /*#__PURE__*/ jsx(Page.Loading, {});
95
+ }
96
+ if (!initialValues) {
97
+ return /*#__PURE__*/ jsx(Page.Error, {});
98
+ }
99
+ const handleTabChange = (status)=>{
100
+ if (status === 'published' || status === 'draft') {
101
+ setQuery({
102
+ status
103
+ }, 'push', true);
104
+ }
105
+ };
106
+ const validateSync = (values, options)=>{
107
+ const yupSchema = createYupSchema(schema?.attributes, components, {
108
+ status,
109
+ ...options
110
+ });
111
+ return yupSchema.validateSync(values, {
112
+ abortEarly: false
113
+ });
114
+ };
115
+ return /*#__PURE__*/ jsxs(Main, {
116
+ paddingLeft: 10,
117
+ paddingRight: 10,
118
+ children: [
119
+ /*#__PURE__*/ jsx(Page.Title, {
120
+ children: getTitle(mainField)
121
+ }),
122
+ /*#__PURE__*/ jsx(Form, {
123
+ disabled: hasDraftAndPublished && status === 'published',
124
+ initialValues: initialValues,
125
+ method: isCreatingDocument ? 'POST' : 'PUT',
126
+ validate: (values, options)=>{
127
+ const yupSchema = createYupSchema(schema?.attributes, components, {
128
+ status,
129
+ ...options
130
+ });
131
+ return yupSchema.validate(values, {
132
+ abortEarly: false
133
+ });
134
+ },
135
+ initialErrors: location?.state?.forceValidation ? validateSync(initialValues, {}) : {},
136
+ children: ({ resetForm })=>/*#__PURE__*/ jsxs(Fragment, {
137
+ children: [
138
+ /*#__PURE__*/ jsx(Header, {
139
+ isCreating: isCreatingDocument,
140
+ status: hasDraftAndPublished ? getDocumentStatus(document, meta) : undefined,
141
+ title: getTitle(mainField)
142
+ }),
143
+ /*#__PURE__*/ jsxs(Tabs.Root, {
144
+ variant: "simple",
145
+ value: status,
146
+ onValueChange: handleTabChange,
147
+ children: [
148
+ /*#__PURE__*/ jsx(Tabs.List, {
149
+ "aria-label": formatMessage({
150
+ id: getTranslation('containers.edit.tabs.label'),
151
+ defaultMessage: 'Document status'
152
+ }),
153
+ children: hasDraftAndPublished ? /*#__PURE__*/ jsxs(Fragment, {
154
+ children: [
155
+ /*#__PURE__*/ jsx(StatusTab, {
156
+ value: "draft",
157
+ children: formatMessage({
158
+ id: getTranslation('containers.edit.tabs.draft'),
159
+ defaultMessage: 'draft'
160
+ })
161
+ }),
162
+ /*#__PURE__*/ jsx(StatusTab, {
163
+ disabled: !meta || meta.availableStatus.length === 0,
164
+ value: "published",
165
+ children: formatMessage({
166
+ id: getTranslation('containers.edit.tabs.published'),
167
+ defaultMessage: 'published'
168
+ })
169
+ })
170
+ ]
171
+ }) : null
172
+ }),
173
+ /*#__PURE__*/ jsxs(Grid.Root, {
174
+ paddingTop: 8,
175
+ gap: 4,
176
+ children: [
177
+ /*#__PURE__*/ jsxs(Grid.Item, {
178
+ col: 9,
179
+ s: 12,
180
+ direction: "column",
181
+ alignItems: "stretch",
182
+ children: [
183
+ /*#__PURE__*/ jsx(Tabs.Content, {
184
+ value: "draft",
185
+ children: /*#__PURE__*/ jsx(FormLayout, {
186
+ layout: layout
187
+ })
188
+ }),
189
+ /*#__PURE__*/ jsx(Tabs.Content, {
190
+ value: "published",
191
+ children: /*#__PURE__*/ jsx(FormLayout, {
192
+ layout: layout
193
+ })
194
+ })
195
+ ]
196
+ }),
197
+ /*#__PURE__*/ jsx(Grid.Item, {
198
+ col: 3,
199
+ s: 12,
200
+ direction: "column",
201
+ alignItems: "stretch",
202
+ children: /*#__PURE__*/ jsx(Panels, {})
203
+ })
204
+ ]
205
+ })
206
+ ]
207
+ }),
208
+ /*#__PURE__*/ jsx(Blocker, {
209
+ // We reset the form to the published version to avoid errors like – https://strapi-inc.atlassian.net/browse/CONTENT-2284
210
+ onProceed: resetForm
211
+ })
212
+ ]
213
+ })
214
+ })
215
+ ]
216
+ });
217
+ };
218
+ const StatusTab = styled(Tabs.Trigger)`
219
+ text-transform: uppercase;
220
+ `;
221
+ /**
222
+ * @internal
223
+ * @description Returns the status of the document where its latest state takes priority,
224
+ * this typically will be "published" unless a user has edited their draft in which we should
225
+ * display "modified".
226
+ */ const getDocumentStatus = (document, meta)=>{
227
+ const docStatus = document?.status;
228
+ const statuses = meta?.availableStatus ?? [];
229
+ /**
230
+ * Creating an entry
231
+ */ if (!docStatus) {
232
+ return 'draft';
233
+ }
234
+ /**
235
+ * We're viewing a draft, but the document could have a published version
236
+ */ if (docStatus === 'draft' && statuses.find((doc)=>doc.publishedAt !== null)) {
237
+ return 'published';
238
+ }
239
+ return docStatus;
240
+ };
241
+ /* -------------------------------------------------------------------------------------------------
242
+ * ProtectedEditViewPage
243
+ * -----------------------------------------------------------------------------------------------*/ const ProtectedEditViewPage = ()=>{
244
+ const { slug = '' } = useParams();
245
+ const { permissions = [], isLoading, error } = useRBAC(PERMISSIONS.map((action)=>({
246
+ action,
247
+ subject: slug
248
+ })));
249
+ if (isLoading) {
250
+ return /*#__PURE__*/ jsx(Page.Loading, {});
251
+ }
252
+ if (error || !slug) {
253
+ return /*#__PURE__*/ jsx(Page.Error, {});
254
+ }
255
+ return /*#__PURE__*/ jsx(Page.Protect, {
256
+ permissions: permissions,
257
+ children: ({ permissions })=>/*#__PURE__*/ jsx(DocumentRBAC, {
258
+ permissions: permissions,
259
+ children: /*#__PURE__*/ jsx(EditViewPage, {})
260
+ })
261
+ });
262
+ };
263
+
264
+ export { EditViewPage, ProtectedEditViewPage, getDocumentStatus };
265
+ //# sourceMappingURL=EditViewPage-jCZnUuCR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditViewPage-jCZnUuCR.js","sources":["../../../admin/src/hooks/useOnce.ts","../../../admin/src/pages/EditView/EditViewPage.tsx"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\nimport * as React from 'react';\n\nexport const useOnce = (effect: React.EffectCallback) => React.useEffect(effect, emptyDeps);\n\nconst emptyDeps: React.DependencyList = [];\n","import * as React from 'react';\n\nimport {\n Page,\n Blocker,\n Form,\n useRBAC,\n useNotification,\n useQueryParams,\n} from '@strapi/admin/strapi-admin';\nimport { Grid, Main, Tabs } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { useLocation, useParams } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { SINGLE_TYPES } from '../../constants/collections';\nimport { PERMISSIONS } from '../../constants/plugin';\nimport { DocumentRBAC, useDocumentRBAC } from '../../features/DocumentRBAC';\nimport { type UseDocument, useDoc } from '../../hooks/useDocument';\nimport { useDocumentLayout } from '../../hooks/useDocumentLayout';\nimport { useLazyComponents } from '../../hooks/useLazyComponents';\nimport { useOnce } from '../../hooks/useOnce';\nimport { getTranslation } from '../../utils/translations';\nimport { createYupSchema } from '../../utils/validation';\n\nimport { FormLayout } from './components/FormLayout';\nimport { Header } from './components/Header';\nimport { Panels } from './components/Panels';\nimport { transformDocument } from './utils/data';\nimport { createDefaultForm } from './utils/forms';\n\n/* -------------------------------------------------------------------------------------------------\n * EditViewPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst EditViewPage = () => {\n const location = useLocation();\n const [\n {\n query: { status },\n },\n setQuery,\n ] = useQueryParams<{ status: 'draft' | 'published' }>({\n status: 'draft',\n });\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n\n const {\n document,\n meta,\n isLoading: isLoadingDocument,\n schema,\n components,\n collectionType,\n id,\n model,\n hasError,\n getTitle,\n getInitialFormValues,\n } = useDoc();\n\n const hasDraftAndPublished = schema?.options?.draftAndPublish ?? false;\n\n useOnce(() => {\n /**\n * We only ever want to fire the notification once otherwise\n * whenever the app re-renders it'll pop up regardless of\n * what we do because the state comes from react-router-dom\n */\n if (location?.state && 'error' in location.state) {\n toggleNotification({\n type: 'danger',\n message: location.state.error,\n timeout: 5000,\n });\n }\n });\n\n const isLoadingActionsRBAC = useDocumentRBAC('EditViewPage', (state) => state.isLoading);\n\n const isSingleType = collectionType === SINGLE_TYPES;\n\n /**\n * single-types don't current have an id, but because they're a singleton\n * we can simply use the update operation to continuously update the same\n * document with varying params.\n */\n const isCreatingDocument = !id && !isSingleType;\n\n const {\n isLoading: isLoadingLayout,\n edit: {\n layout,\n settings: { mainField },\n },\n } = useDocumentLayout(model);\n\n const { isLazyLoading } = useLazyComponents([]);\n\n const isLoading = isLoadingActionsRBAC || isLoadingDocument || isLoadingLayout || isLazyLoading;\n\n const initialValues = getInitialFormValues(isCreatingDocument);\n\n if (hasError) {\n return <Page.Error />;\n }\n\n if (isLoading && !document?.documentId) {\n return <Page.Loading />;\n }\n\n if (!initialValues) {\n return <Page.Error />;\n }\n\n const handleTabChange = (status: string) => {\n if (status === 'published' || status === 'draft') {\n setQuery({ status }, 'push', true);\n }\n };\n\n const validateSync = (values: Record<string, unknown>, options: Record<string, string>) => {\n const yupSchema = createYupSchema(schema?.attributes, components, {\n status,\n ...options,\n });\n\n return yupSchema.validateSync(values, { abortEarly: false });\n };\n\n return (\n <Main paddingLeft={10} paddingRight={10}>\n <Page.Title>{getTitle(mainField)}</Page.Title>\n <Form\n disabled={hasDraftAndPublished && status === 'published'}\n initialValues={initialValues}\n method={isCreatingDocument ? 'POST' : 'PUT'}\n validate={(values: Record<string, unknown>, options: Record<string, string>) => {\n const yupSchema = createYupSchema(schema?.attributes, components, {\n status,\n ...options,\n });\n\n return yupSchema.validate(values, { abortEarly: false });\n }}\n initialErrors={location?.state?.forceValidation ? validateSync(initialValues, {}) : {}}\n >\n {({ resetForm }) => (\n <>\n <Header\n isCreating={isCreatingDocument}\n status={hasDraftAndPublished ? getDocumentStatus(document, meta) : undefined}\n title={getTitle(mainField)}\n />\n <Tabs.Root variant=\"simple\" value={status} onValueChange={handleTabChange}>\n <Tabs.List\n aria-label={formatMessage({\n id: getTranslation('containers.edit.tabs.label'),\n defaultMessage: 'Document status',\n })}\n >\n {hasDraftAndPublished ? (\n <>\n <StatusTab value=\"draft\">\n {formatMessage({\n id: getTranslation('containers.edit.tabs.draft'),\n defaultMessage: 'draft',\n })}\n </StatusTab>\n <StatusTab\n disabled={!meta || meta.availableStatus.length === 0}\n value=\"published\"\n >\n {formatMessage({\n id: getTranslation('containers.edit.tabs.published'),\n defaultMessage: 'published',\n })}\n </StatusTab>\n </>\n ) : null}\n </Tabs.List>\n <Grid.Root paddingTop={8} gap={4}>\n <Grid.Item col={9} s={12} direction=\"column\" alignItems=\"stretch\">\n <Tabs.Content value=\"draft\">\n <FormLayout layout={layout} />\n </Tabs.Content>\n <Tabs.Content value=\"published\">\n <FormLayout layout={layout} />\n </Tabs.Content>\n </Grid.Item>\n <Grid.Item col={3} s={12} direction=\"column\" alignItems=\"stretch\">\n <Panels />\n </Grid.Item>\n </Grid.Root>\n </Tabs.Root>\n <Blocker\n // We reset the form to the published version to avoid errors like – https://strapi-inc.atlassian.net/browse/CONTENT-2284\n onProceed={resetForm}\n />\n </>\n )}\n </Form>\n </Main>\n );\n};\n\nconst StatusTab = styled(Tabs.Trigger)`\n text-transform: uppercase;\n`;\n\n/**\n * @internal\n * @description Returns the status of the document where its latest state takes priority,\n * this typically will be \"published\" unless a user has edited their draft in which we should\n * display \"modified\".\n */\nconst getDocumentStatus = (\n document: ReturnType<UseDocument>['document'],\n meta: ReturnType<UseDocument>['meta']\n): 'draft' | 'published' | 'modified' => {\n const docStatus = document?.status;\n const statuses = meta?.availableStatus ?? [];\n\n /**\n * Creating an entry\n */\n if (!docStatus) {\n return 'draft';\n }\n\n /**\n * We're viewing a draft, but the document could have a published version\n */\n if (docStatus === 'draft' && statuses.find((doc) => doc.publishedAt !== null)) {\n return 'published';\n }\n\n return docStatus;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ProtectedEditViewPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst ProtectedEditViewPage = () => {\n const { slug = '' } = useParams<{\n slug: string;\n }>();\n const {\n permissions = [],\n isLoading,\n error,\n } = useRBAC(\n PERMISSIONS.map((action) => ({\n action,\n subject: slug,\n }))\n );\n\n if (isLoading) {\n return <Page.Loading />;\n }\n\n if (error || !slug) {\n return <Page.Error />;\n }\n\n return (\n <Page.Protect permissions={permissions}>\n {({ permissions }) => (\n <DocumentRBAC permissions={permissions}>\n <EditViewPage />\n </DocumentRBAC>\n )}\n </Page.Protect>\n );\n};\n\nexport { EditViewPage, ProtectedEditViewPage, getDocumentStatus };\n"],"names":["useOnce","effect","React","useEffect","emptyDeps","EditViewPage","location","useLocation","query","status","setQuery","useQueryParams","formatMessage","useIntl","toggleNotification","useNotification","document","meta","isLoading","isLoadingDocument","schema","components","collectionType","id","model","hasError","getTitle","getInitialFormValues","useDoc","hasDraftAndPublished","options","draftAndPublish","state","type","message","error","timeout","isLoadingActionsRBAC","useDocumentRBAC","isSingleType","SINGLE_TYPES","isCreatingDocument","isLoadingLayout","edit","layout","settings","mainField","useDocumentLayout","isLazyLoading","useLazyComponents","initialValues","_jsx","Page","Error","documentId","Loading","handleTabChange","validateSync","values","yupSchema","createYupSchema","attributes","abortEarly","_jsxs","Main","paddingLeft","paddingRight","Title","Form","disabled","method","validate","initialErrors","forceValidation","resetForm","_Fragment","Header","isCreating","getDocumentStatus","undefined","title","Tabs","Root","variant","value","onValueChange","List","aria-label","getTranslation","defaultMessage","StatusTab","availableStatus","length","Grid","paddingTop","gap","Item","col","s","direction","alignItems","Content","FormLayout","Panels","Blocker","onProceed","styled","Trigger","docStatus","statuses","find","doc","publishedAt","ProtectedEditViewPage","slug","useParams","permissions","useRBAC","PERMISSIONS","map","action","subject","Protect","DocumentRBAC"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAMA,UAAU,CAACC,MAAAA,GAAiCC,MAAMC,SAAS,CAACF,QAAQG,SAAW,CAAA;AAE5F,MAAMA,YAAkC,EAAE;;AC0B1C;;AAEkG,2GAE5FC,YAAe,GAAA,IAAA;AACnB,IAAA,MAAMC,QAAWC,GAAAA,WAAAA,EAAAA;IACjB,MAAM,CACJ,EACEC,KAAAA,EAAO,EAAEC,MAAM,EAAE,EAClB,EACDC,QACD,CAAA,GAAGC,cAAkD,CAAA;QACpDF,MAAQ,EAAA;AACV,KAAA,CAAA;IACA,MAAM,EAAEG,aAAa,EAAE,GAAGC,OAAAA,EAAAA;IAC1B,MAAM,EAAEC,kBAAkB,EAAE,GAAGC,eAAAA,EAAAA;IAE/B,MAAM,EACJC,QAAQ,EACRC,IAAI,EACJC,WAAWC,iBAAiB,EAC5BC,MAAM,EACNC,UAAU,EACVC,cAAc,EACdC,EAAE,EACFC,KAAK,EACLC,QAAQ,EACRC,QAAQ,EACRC,oBAAoB,EACrB,GAAGC,MAAAA,EAAAA;IAEJ,MAAMC,oBAAAA,GAAuBT,MAAQU,EAAA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AAI,CAACiB,SAAW,EAAA;QACd,OAAO,OAAA;AACT;AAEA;;MAGA,IAAIA,SAAc,KAAA,OAAA,IAAWC,QAASC,CAAAA,IAAI,CAAC,CAACC,GAAQA,GAAAA,GAAAA,CAAIC,WAAW,KAAK,IAAO,CAAA,EAAA;QAC7E,OAAO,WAAA;AACT;IAEA,OAAOJ,SAAAA;AACT;AAEA;;AAEkG,2GAE5FK,qBAAwB,GAAA,IAAA;AAC5B,IAAA,MAAM,EAAEC,IAAAA,GAAO,EAAE,EAAE,GAAGC,SAAAA,EAAAA;AAGtB,IAAA,MAAM,EACJC,WAAAA,GAAc,EAAE,EAChBlG,SAAS,EACTiB,KAAK,EACN,GAAGkF,QACFC,WAAYC,CAAAA,GAAG,CAAC,CAACC,UAAY;AAC3BA,YAAAA,MAAAA;YACAC,OAASP,EAAAA;SACX,CAAA,CAAA,CAAA;AAGF,IAAA,IAAIhG,SAAW,EAAA;QACb,qBAAOiC,GAAA,CAACC,KAAKG,OAAO,EAAA,EAAA,CAAA;AACtB;IAEA,IAAIpB,KAAAA,IAAS,CAAC+E,IAAM,EAAA;QAClB,qBAAO/D,GAAA,CAACC,KAAKC,KAAK,EAAA,EAAA,CAAA;AACpB;IAEA,qBACEF,GAAA,CAACC,KAAKsE,OAAO,EAAA;QAACN,WAAaA,EAAAA,WAAAA;AACxB,QAAA,QAAA,EAAA,CAAC,EAAEA,WAAW,EAAE,iBACfjE,GAACwE,CAAAA,YAAAA,EAAAA;gBAAaP,WAAaA,EAAAA,WAAAA;AACzB,gBAAA,QAAA,gBAAAjE,GAAC9C,CAAAA,YAAAA,EAAAA,EAAAA;;;AAKX;;;;"}
@@ -0,0 +1,288 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var strapiAdmin = require('@strapi/admin/strapi-admin');
6
+ var designSystem = require('@strapi/design-system');
7
+ var reactIntl = require('react-intl');
8
+ var reactRouterDom = require('react-router-dom');
9
+ var styledComponents = require('styled-components');
10
+ var index = require('./index-ZIwOPk6p.js');
11
+ var Input = require('./Input-DiR2Xfa7.js');
12
+ require('@strapi/icons');
13
+ require('lodash/fp/mapValues');
14
+ require('yup');
15
+ require('fractional-indexing');
16
+ require('lodash/fp/pipe');
17
+ require('qs');
18
+ require('date-fns');
19
+ require('@reduxjs/toolkit');
20
+ require('slate');
21
+ require('slate-history');
22
+ require('slate-react');
23
+ require('prismjs');
24
+ require('prismjs/themes/prism-solarizedlight.css');
25
+ require('./usePrev-DIYl-IAL.js');
26
+ require('./useDragAndDrop-gcqEJMnO.js');
27
+ require('react-dnd');
28
+ require('@radix-ui/react-toolbar');
29
+ require('react-dnd-html5-backend');
30
+ require('./objects-C3EebVVe.js');
31
+ require('lodash/clone');
32
+ require('lodash/toPath');
33
+ require('./Relations-mxOUS7TJ.js');
34
+ require('react-window');
35
+ require('./relations-CmoFVrKj.js');
36
+ require('./ComponentIcon-C-EjOUPA.js');
37
+ require('@strapi/icons/symbols');
38
+ require('codemirror5');
39
+ require('sanitize-html');
40
+ require('highlight.js');
41
+ require('markdown-it');
42
+ require('markdown-it-abbr');
43
+ require('markdown-it-container');
44
+ require('markdown-it-deflist');
45
+ require('markdown-it-emoji');
46
+ require('markdown-it-footnote');
47
+ require('markdown-it-ins');
48
+ require('markdown-it-mark');
49
+ require('markdown-it-sub');
50
+ require('markdown-it-sup');
51
+ require('highlight.js/styles/solarized-dark.css');
52
+ require('codemirror5/addon/display/placeholder');
53
+
54
+ function _interopNamespaceDefault(e) {
55
+ var n = Object.create(null);
56
+ if (e) {
57
+ Object.keys(e).forEach(function (k) {
58
+ if (k !== 'default') {
59
+ var d = Object.getOwnPropertyDescriptor(e, k);
60
+ Object.defineProperty(n, k, d.get ? d : {
61
+ enumerable: true,
62
+ get: function () { return e[k]; }
63
+ });
64
+ }
65
+ });
66
+ }
67
+ n.default = e;
68
+ return Object.freeze(n);
69
+ }
70
+
71
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
72
+
73
+ const useOnce = (effect)=>React__namespace.useEffect(effect, emptyDeps);
74
+ const emptyDeps = [];
75
+
76
+ /* -------------------------------------------------------------------------------------------------
77
+ * EditViewPage
78
+ * -----------------------------------------------------------------------------------------------*/ const EditViewPage = ()=>{
79
+ const location = reactRouterDom.useLocation();
80
+ const [{ query: { status } }, setQuery] = strapiAdmin.useQueryParams({
81
+ status: 'draft'
82
+ });
83
+ const { formatMessage } = reactIntl.useIntl();
84
+ const { toggleNotification } = strapiAdmin.useNotification();
85
+ const { document, meta, isLoading: isLoadingDocument, schema, components, collectionType, id, model, hasError, getTitle, getInitialFormValues } = index.useDoc();
86
+ const hasDraftAndPublished = schema?.options?.draftAndPublish ?? false;
87
+ useOnce(()=>{
88
+ /**
89
+ * We only ever want to fire the notification once otherwise
90
+ * whenever the app re-renders it'll pop up regardless of
91
+ * what we do because the state comes from react-router-dom
92
+ */ if (location?.state && 'error' in location.state) {
93
+ toggleNotification({
94
+ type: 'danger',
95
+ message: location.state.error,
96
+ timeout: 5000
97
+ });
98
+ }
99
+ });
100
+ const isLoadingActionsRBAC = index.useDocumentRBAC('EditViewPage', (state)=>state.isLoading);
101
+ const isSingleType = collectionType === index.SINGLE_TYPES;
102
+ /**
103
+ * single-types don't current have an id, but because they're a singleton
104
+ * we can simply use the update operation to continuously update the same
105
+ * document with varying params.
106
+ */ const isCreatingDocument = !id && !isSingleType;
107
+ const { isLoading: isLoadingLayout, edit: { layout, settings: { mainField } } } = index.useDocumentLayout(model);
108
+ const { isLazyLoading } = Input.useLazyComponents([]);
109
+ const isLoading = isLoadingActionsRBAC || isLoadingDocument || isLoadingLayout || isLazyLoading;
110
+ const initialValues = getInitialFormValues(isCreatingDocument);
111
+ if (hasError) {
112
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
113
+ }
114
+ if (isLoading && !document?.documentId) {
115
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
116
+ }
117
+ if (!initialValues) {
118
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
119
+ }
120
+ const handleTabChange = (status)=>{
121
+ if (status === 'published' || status === 'draft') {
122
+ setQuery({
123
+ status
124
+ }, 'push', true);
125
+ }
126
+ };
127
+ const validateSync = (values, options)=>{
128
+ const yupSchema = index.createYupSchema(schema?.attributes, components, {
129
+ status,
130
+ ...options
131
+ });
132
+ return yupSchema.validateSync(values, {
133
+ abortEarly: false
134
+ });
135
+ };
136
+ return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Main, {
137
+ paddingLeft: 10,
138
+ paddingRight: 10,
139
+ children: [
140
+ /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Title, {
141
+ children: getTitle(mainField)
142
+ }),
143
+ /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Form, {
144
+ disabled: hasDraftAndPublished && status === 'published',
145
+ initialValues: initialValues,
146
+ method: isCreatingDocument ? 'POST' : 'PUT',
147
+ validate: (values, options)=>{
148
+ const yupSchema = index.createYupSchema(schema?.attributes, components, {
149
+ status,
150
+ ...options
151
+ });
152
+ return yupSchema.validate(values, {
153
+ abortEarly: false
154
+ });
155
+ },
156
+ initialErrors: location?.state?.forceValidation ? validateSync(initialValues, {}) : {},
157
+ children: ({ resetForm })=>/*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
158
+ children: [
159
+ /*#__PURE__*/ jsxRuntime.jsx(index.Header, {
160
+ isCreating: isCreatingDocument,
161
+ status: hasDraftAndPublished ? getDocumentStatus(document, meta) : undefined,
162
+ title: getTitle(mainField)
163
+ }),
164
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Tabs.Root, {
165
+ variant: "simple",
166
+ value: status,
167
+ onValueChange: handleTabChange,
168
+ children: [
169
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Tabs.List, {
170
+ "aria-label": formatMessage({
171
+ id: index.getTranslation('containers.edit.tabs.label'),
172
+ defaultMessage: 'Document status'
173
+ }),
174
+ children: hasDraftAndPublished ? /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
175
+ children: [
176
+ /*#__PURE__*/ jsxRuntime.jsx(StatusTab, {
177
+ value: "draft",
178
+ children: formatMessage({
179
+ id: index.getTranslation('containers.edit.tabs.draft'),
180
+ defaultMessage: 'draft'
181
+ })
182
+ }),
183
+ /*#__PURE__*/ jsxRuntime.jsx(StatusTab, {
184
+ disabled: !meta || meta.availableStatus.length === 0,
185
+ value: "published",
186
+ children: formatMessage({
187
+ id: index.getTranslation('containers.edit.tabs.published'),
188
+ defaultMessage: 'published'
189
+ })
190
+ })
191
+ ]
192
+ }) : null
193
+ }),
194
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Grid.Root, {
195
+ paddingTop: 8,
196
+ gap: 4,
197
+ children: [
198
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Grid.Item, {
199
+ col: 9,
200
+ s: 12,
201
+ direction: "column",
202
+ alignItems: "stretch",
203
+ children: [
204
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Tabs.Content, {
205
+ value: "draft",
206
+ children: /*#__PURE__*/ jsxRuntime.jsx(Input.FormLayout, {
207
+ layout: layout
208
+ })
209
+ }),
210
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Tabs.Content, {
211
+ value: "published",
212
+ children: /*#__PURE__*/ jsxRuntime.jsx(Input.FormLayout, {
213
+ layout: layout
214
+ })
215
+ })
216
+ ]
217
+ }),
218
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Item, {
219
+ col: 3,
220
+ s: 12,
221
+ direction: "column",
222
+ alignItems: "stretch",
223
+ children: /*#__PURE__*/ jsxRuntime.jsx(index.Panels, {})
224
+ })
225
+ ]
226
+ })
227
+ ]
228
+ }),
229
+ /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Blocker, {
230
+ // We reset the form to the published version to avoid errors like – https://strapi-inc.atlassian.net/browse/CONTENT-2284
231
+ onProceed: resetForm
232
+ })
233
+ ]
234
+ })
235
+ })
236
+ ]
237
+ });
238
+ };
239
+ const StatusTab = styledComponents.styled(designSystem.Tabs.Trigger)`
240
+ text-transform: uppercase;
241
+ `;
242
+ /**
243
+ * @internal
244
+ * @description Returns the status of the document where its latest state takes priority,
245
+ * this typically will be "published" unless a user has edited their draft in which we should
246
+ * display "modified".
247
+ */ const getDocumentStatus = (document, meta)=>{
248
+ const docStatus = document?.status;
249
+ const statuses = meta?.availableStatus ?? [];
250
+ /**
251
+ * Creating an entry
252
+ */ if (!docStatus) {
253
+ return 'draft';
254
+ }
255
+ /**
256
+ * We're viewing a draft, but the document could have a published version
257
+ */ if (docStatus === 'draft' && statuses.find((doc)=>doc.publishedAt !== null)) {
258
+ return 'published';
259
+ }
260
+ return docStatus;
261
+ };
262
+ /* -------------------------------------------------------------------------------------------------
263
+ * ProtectedEditViewPage
264
+ * -----------------------------------------------------------------------------------------------*/ const ProtectedEditViewPage = ()=>{
265
+ const { slug = '' } = reactRouterDom.useParams();
266
+ const { permissions = [], isLoading, error } = strapiAdmin.useRBAC(index.PERMISSIONS.map((action)=>({
267
+ action,
268
+ subject: slug
269
+ })));
270
+ if (isLoading) {
271
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
272
+ }
273
+ if (error || !slug) {
274
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
275
+ }
276
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Protect, {
277
+ permissions: permissions,
278
+ children: ({ permissions })=>/*#__PURE__*/ jsxRuntime.jsx(index.DocumentRBAC, {
279
+ permissions: permissions,
280
+ children: /*#__PURE__*/ jsxRuntime.jsx(EditViewPage, {})
281
+ })
282
+ });
283
+ };
284
+
285
+ exports.EditViewPage = EditViewPage;
286
+ exports.ProtectedEditViewPage = ProtectedEditViewPage;
287
+ exports.getDocumentStatus = getDocumentStatus;
288
+ //# sourceMappingURL=EditViewPage-zSnDwLz3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditViewPage-zSnDwLz3.js","sources":["../../../admin/src/hooks/useOnce.ts","../../../admin/src/pages/EditView/EditViewPage.tsx"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\nimport * as React from 'react';\n\nexport const useOnce = (effect: React.EffectCallback) => React.useEffect(effect, emptyDeps);\n\nconst emptyDeps: React.DependencyList = [];\n","import * as React from 'react';\n\nimport {\n Page,\n Blocker,\n Form,\n useRBAC,\n useNotification,\n useQueryParams,\n} from '@strapi/admin/strapi-admin';\nimport { Grid, Main, Tabs } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { useLocation, useParams } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { SINGLE_TYPES } from '../../constants/collections';\nimport { PERMISSIONS } from '../../constants/plugin';\nimport { DocumentRBAC, useDocumentRBAC } from '../../features/DocumentRBAC';\nimport { type UseDocument, useDoc } from '../../hooks/useDocument';\nimport { useDocumentLayout } from '../../hooks/useDocumentLayout';\nimport { useLazyComponents } from '../../hooks/useLazyComponents';\nimport { useOnce } from '../../hooks/useOnce';\nimport { getTranslation } from '../../utils/translations';\nimport { createYupSchema } from '../../utils/validation';\n\nimport { FormLayout } from './components/FormLayout';\nimport { Header } from './components/Header';\nimport { Panels } from './components/Panels';\nimport { transformDocument } from './utils/data';\nimport { createDefaultForm } from './utils/forms';\n\n/* -------------------------------------------------------------------------------------------------\n * EditViewPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst EditViewPage = () => {\n const location = useLocation();\n const [\n {\n query: { status },\n },\n setQuery,\n ] = useQueryParams<{ status: 'draft' | 'published' }>({\n status: 'draft',\n });\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n\n const {\n document,\n meta,\n isLoading: isLoadingDocument,\n schema,\n components,\n collectionType,\n id,\n model,\n hasError,\n getTitle,\n getInitialFormValues,\n } = useDoc();\n\n const hasDraftAndPublished = schema?.options?.draftAndPublish ?? false;\n\n useOnce(() => {\n /**\n * We only ever want to fire the notification once otherwise\n * whenever the app re-renders it'll pop up regardless of\n * what we do because the state comes from react-router-dom\n */\n if (location?.state && 'error' in location.state) {\n toggleNotification({\n type: 'danger',\n message: location.state.error,\n timeout: 5000,\n });\n }\n });\n\n const isLoadingActionsRBAC = useDocumentRBAC('EditViewPage', (state) => state.isLoading);\n\n const isSingleType = collectionType === SINGLE_TYPES;\n\n /**\n * single-types don't current have an id, but because they're a singleton\n * we can simply use the update operation to continuously update the same\n * document with varying params.\n */\n const isCreatingDocument = !id && !isSingleType;\n\n const {\n isLoading: isLoadingLayout,\n edit: {\n layout,\n settings: { mainField },\n },\n } = useDocumentLayout(model);\n\n const { isLazyLoading } = useLazyComponents([]);\n\n const isLoading = isLoadingActionsRBAC || isLoadingDocument || isLoadingLayout || isLazyLoading;\n\n const initialValues = getInitialFormValues(isCreatingDocument);\n\n if (hasError) {\n return <Page.Error />;\n }\n\n if (isLoading && !document?.documentId) {\n return <Page.Loading />;\n }\n\n if (!initialValues) {\n return <Page.Error />;\n }\n\n const handleTabChange = (status: string) => {\n if (status === 'published' || status === 'draft') {\n setQuery({ status }, 'push', true);\n }\n };\n\n const validateSync = (values: Record<string, unknown>, options: Record<string, string>) => {\n const yupSchema = createYupSchema(schema?.attributes, components, {\n status,\n ...options,\n });\n\n return yupSchema.validateSync(values, { abortEarly: false });\n };\n\n return (\n <Main paddingLeft={10} paddingRight={10}>\n <Page.Title>{getTitle(mainField)}</Page.Title>\n <Form\n disabled={hasDraftAndPublished && status === 'published'}\n initialValues={initialValues}\n method={isCreatingDocument ? 'POST' : 'PUT'}\n validate={(values: Record<string, unknown>, options: Record<string, string>) => {\n const yupSchema = createYupSchema(schema?.attributes, components, {\n status,\n ...options,\n });\n\n return yupSchema.validate(values, { abortEarly: false });\n }}\n initialErrors={location?.state?.forceValidation ? validateSync(initialValues, {}) : {}}\n >\n {({ resetForm }) => (\n <>\n <Header\n isCreating={isCreatingDocument}\n status={hasDraftAndPublished ? getDocumentStatus(document, meta) : undefined}\n title={getTitle(mainField)}\n />\n <Tabs.Root variant=\"simple\" value={status} onValueChange={handleTabChange}>\n <Tabs.List\n aria-label={formatMessage({\n id: getTranslation('containers.edit.tabs.label'),\n defaultMessage: 'Document status',\n })}\n >\n {hasDraftAndPublished ? (\n <>\n <StatusTab value=\"draft\">\n {formatMessage({\n id: getTranslation('containers.edit.tabs.draft'),\n defaultMessage: 'draft',\n })}\n </StatusTab>\n <StatusTab\n disabled={!meta || meta.availableStatus.length === 0}\n value=\"published\"\n >\n {formatMessage({\n id: getTranslation('containers.edit.tabs.published'),\n defaultMessage: 'published',\n })}\n </StatusTab>\n </>\n ) : null}\n </Tabs.List>\n <Grid.Root paddingTop={8} gap={4}>\n <Grid.Item col={9} s={12} direction=\"column\" alignItems=\"stretch\">\n <Tabs.Content value=\"draft\">\n <FormLayout layout={layout} />\n </Tabs.Content>\n <Tabs.Content value=\"published\">\n <FormLayout layout={layout} />\n </Tabs.Content>\n </Grid.Item>\n <Grid.Item col={3} s={12} direction=\"column\" alignItems=\"stretch\">\n <Panels />\n </Grid.Item>\n </Grid.Root>\n </Tabs.Root>\n <Blocker\n // We reset the form to the published version to avoid errors like – https://strapi-inc.atlassian.net/browse/CONTENT-2284\n onProceed={resetForm}\n />\n </>\n )}\n </Form>\n </Main>\n );\n};\n\nconst StatusTab = styled(Tabs.Trigger)`\n text-transform: uppercase;\n`;\n\n/**\n * @internal\n * @description Returns the status of the document where its latest state takes priority,\n * this typically will be \"published\" unless a user has edited their draft in which we should\n * display \"modified\".\n */\nconst getDocumentStatus = (\n document: ReturnType<UseDocument>['document'],\n meta: ReturnType<UseDocument>['meta']\n): 'draft' | 'published' | 'modified' => {\n const docStatus = document?.status;\n const statuses = meta?.availableStatus ?? [];\n\n /**\n * Creating an entry\n */\n if (!docStatus) {\n return 'draft';\n }\n\n /**\n * We're viewing a draft, but the document could have a published version\n */\n if (docStatus === 'draft' && statuses.find((doc) => doc.publishedAt !== null)) {\n return 'published';\n }\n\n return docStatus;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ProtectedEditViewPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst ProtectedEditViewPage = () => {\n const { slug = '' } = useParams<{\n slug: string;\n }>();\n const {\n permissions = [],\n isLoading,\n error,\n } = useRBAC(\n PERMISSIONS.map((action) => ({\n action,\n subject: slug,\n }))\n );\n\n if (isLoading) {\n return <Page.Loading />;\n }\n\n if (error || !slug) {\n return <Page.Error />;\n }\n\n return (\n <Page.Protect permissions={permissions}>\n {({ permissions }) => (\n <DocumentRBAC permissions={permissions}>\n <EditViewPage />\n </DocumentRBAC>\n )}\n </Page.Protect>\n );\n};\n\nexport { EditViewPage, ProtectedEditViewPage, getDocumentStatus };\n"],"names":["useOnce","effect","React","useEffect","emptyDeps","EditViewPage","location","useLocation","query","status","setQuery","useQueryParams","formatMessage","useIntl","toggleNotification","useNotification","document","meta","isLoading","isLoadingDocument","schema","components","collectionType","id","model","hasError","getTitle","getInitialFormValues","useDoc","hasDraftAndPublished","options","draftAndPublish","state","type","message","error","timeout","isLoadingActionsRBAC","useDocumentRBAC","isSingleType","SINGLE_TYPES","isCreatingDocument","isLoadingLayout","edit","layout","settings","mainField","useDocumentLayout","isLazyLoading","useLazyComponents","initialValues","_jsx","Page","Error","documentId","Loading","handleTabChange","validateSync","values","yupSchema","createYupSchema","attributes","abortEarly","_jsxs","Main","paddingLeft","paddingRight","Title","Form","disabled","method","validate","initialErrors","forceValidation","resetForm","_Fragment","Header","isCreating","getDocumentStatus","undefined","title","Tabs","Root","variant","value","onValueChange","List","aria-label","getTranslation","defaultMessage","StatusTab","availableStatus","length","Grid","paddingTop","gap","Item","col","s","direction","alignItems","Content","FormLayout","Panels","Blocker","onProceed","styled","Trigger","docStatus","statuses","find","doc","publishedAt","ProtectedEditViewPage","slug","useParams","permissions","useRBAC","PERMISSIONS","map","action","subject","Protect","DocumentRBAC"],"mappings":";;;;;;;;;;;;;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