@strapi/content-manager 0.0.0-experimental.e60ec1829240dae21c1e1d29076681c322288813 → 0.0.0-experimental.eba25ec571b091c6bde1104eb6c753debdf15462

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 (253) hide show
  1. package/LICENSE +18 -3
  2. package/dist/_chunks/{CardDragPreview-DSVYodBX.js → CardDragPreview-C0QyJgRA.js} +10 -14
  3. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -0
  4. package/dist/_chunks/{CardDragPreview-ikSG4M46.mjs → CardDragPreview-DOxamsuj.mjs} +7 -9
  5. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -0
  6. package/dist/_chunks/{ComponentConfigurationPage-BPvzFjM7.mjs → ComponentConfigurationPage-BaJMOQyq.mjs} +4 -4
  7. package/dist/_chunks/{ComponentConfigurationPage-BPvzFjM7.mjs.map → ComponentConfigurationPage-BaJMOQyq.mjs.map} +1 -1
  8. package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js → ComponentConfigurationPage-N-CTtgQa.js} +4 -4
  9. package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js.map → ComponentConfigurationPage-N-CTtgQa.js.map} +1 -1
  10. package/dist/_chunks/{ComponentIcon-BBQsYCVn.js → ComponentIcon-BXdiCGQp.js} +8 -2
  11. package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +1 -0
  12. package/dist/_chunks/{ComponentIcon-BOFnK76n.mjs → ComponentIcon-u4bIXTFY.mjs} +9 -3
  13. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -0
  14. package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js → EditConfigurationPage-BHkjAbxH.js} +4 -4
  15. package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js.map → EditConfigurationPage-BHkjAbxH.js.map} +1 -1
  16. package/dist/_chunks/{EditConfigurationPage-DacbqQ_f.mjs → EditConfigurationPage-CKK-5LfX.mjs} +4 -4
  17. package/dist/_chunks/{EditConfigurationPage-DacbqQ_f.mjs.map → EditConfigurationPage-CKK-5LfX.mjs.map} +1 -1
  18. package/dist/_chunks/EditViewPage-B11aeMcf.mjs +254 -0
  19. package/dist/_chunks/EditViewPage-B11aeMcf.mjs.map +1 -0
  20. package/dist/_chunks/{EditViewPage-DvNpQkam.js → EditViewPage-QPUftxUd.js} +101 -52
  21. package/dist/_chunks/EditViewPage-QPUftxUd.js.map +1 -0
  22. package/dist/_chunks/{Field-6gvGdPBV.mjs → Field-Bj_RgtGo.mjs} +1077 -814
  23. package/dist/_chunks/Field-Bj_RgtGo.mjs.map +1 -0
  24. package/dist/_chunks/{Field-DmVKIAOo.js → Field-DUK83cfh.js} +1121 -859
  25. package/dist/_chunks/Field-DUK83cfh.js.map +1 -0
  26. package/dist/_chunks/{Form-CPZC9vWa.js → Form-DHmBRlHd.js} +66 -46
  27. package/dist/_chunks/Form-DHmBRlHd.js.map +1 -0
  28. package/dist/_chunks/{Form-DW6K1IH-.mjs → Form-DLMSoXV7.mjs} +66 -45
  29. package/dist/_chunks/Form-DLMSoXV7.mjs.map +1 -0
  30. package/dist/_chunks/{History-Dmr9fmUA.mjs → History-CfCSNlG9.mjs} +181 -144
  31. package/dist/_chunks/History-CfCSNlG9.mjs.map +1 -0
  32. package/dist/_chunks/{History-DeAPlvtv.js → History-Di3zm4HT.js} +181 -145
  33. package/dist/_chunks/History-Di3zm4HT.js.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-DhwvYcNv.mjs → ListConfigurationPage-0mtv_iqk.mjs} +67 -56
  35. package/dist/_chunks/ListConfigurationPage-0mtv_iqk.mjs.map +1 -0
  36. package/dist/_chunks/{ListConfigurationPage-DPCwW5Vr.js → ListConfigurationPage-Cq361KIt.js} +70 -60
  37. package/dist/_chunks/ListConfigurationPage-Cq361KIt.js.map +1 -0
  38. package/dist/_chunks/{ListViewPage-BtAwuYLE.mjs → ListViewPage-BxLVROX8.mjs} +175 -159
  39. package/dist/_chunks/ListViewPage-BxLVROX8.mjs.map +1 -0
  40. package/dist/_chunks/{ListViewPage-5ySZ-VUs.js → ListViewPage-DFDcG8gM.js} +178 -162
  41. package/dist/_chunks/ListViewPage-DFDcG8gM.js.map +1 -0
  42. package/dist/_chunks/{NoContentTypePage-DSPxnxxp.mjs → NoContentTypePage-BRfDd67_.mjs} +3 -3
  43. package/dist/_chunks/NoContentTypePage-BRfDd67_.mjs.map +1 -0
  44. package/dist/_chunks/{NoContentTypePage-DOC_yWOf.js → NoContentTypePage-BSyvnDZZ.js} +3 -3
  45. package/dist/_chunks/NoContentTypePage-BSyvnDZZ.js.map +1 -0
  46. package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs → NoPermissionsPage-CV9V8KWa.mjs} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs.map → NoPermissionsPage-CV9V8KWa.mjs.map} +1 -1
  48. package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js → NoPermissionsPage-DyLphsn_.js} +2 -2
  49. package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js.map → NoPermissionsPage-DyLphsn_.js.map} +1 -1
  50. package/dist/_chunks/Preview-C_B1nx3g.mjs +272 -0
  51. package/dist/_chunks/Preview-C_B1nx3g.mjs.map +1 -0
  52. package/dist/_chunks/Preview-D_3aO6Ly.js +291 -0
  53. package/dist/_chunks/Preview-D_3aO6Ly.js.map +1 -0
  54. package/dist/_chunks/{Relations-J8cscLlR.mjs → Relations-C6pwmDXh.mjs} +135 -89
  55. package/dist/_chunks/Relations-C6pwmDXh.mjs.map +1 -0
  56. package/dist/_chunks/{Relations-CgWtgnPe.js → Relations-Cne2AlrL.js} +138 -93
  57. package/dist/_chunks/Relations-Cne2AlrL.js.map +1 -0
  58. package/dist/_chunks/{en-MBPul9Su.mjs → en-DhFUjrNW.mjs} +37 -18
  59. package/dist/_chunks/{en-MBPul9Su.mjs.map → en-DhFUjrNW.mjs.map} +1 -1
  60. package/dist/_chunks/{en-C-V1_90f.js → en-Ic0kXjxB.js} +37 -18
  61. package/dist/_chunks/{en-C-V1_90f.js.map → en-Ic0kXjxB.js.map} +1 -1
  62. package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
  63. package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
  64. package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
  65. package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
  66. package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
  67. package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
  68. package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
  69. package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
  70. package/dist/_chunks/{index-CwRRo1V9.mjs → index-BpxR3En4.mjs} +1835 -824
  71. package/dist/_chunks/index-BpxR3En4.mjs.map +1 -0
  72. package/dist/_chunks/{index-C6AH2hEl.js → index-T-aWjbj2.js} +1788 -777
  73. package/dist/_chunks/index-T-aWjbj2.js.map +1 -0
  74. package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
  75. package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
  76. package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
  77. package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
  78. package/dist/_chunks/{layout-B_SXLhqf.js → layout-BEuNwv-F.js} +45 -29
  79. package/dist/_chunks/layout-BEuNwv-F.js.map +1 -0
  80. package/dist/_chunks/{layout-jIDzX0Fp.mjs → layout-DhMZ_lDx.mjs} +45 -27
  81. package/dist/_chunks/layout-DhMZ_lDx.mjs.map +1 -0
  82. package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
  83. package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
  84. package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
  85. package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
  86. package/dist/_chunks/{relations-CuvIgCqI.mjs → relations-BdnxoX6f.mjs} +6 -7
  87. package/dist/_chunks/relations-BdnxoX6f.mjs.map +1 -0
  88. package/dist/_chunks/{relations-iBMa_OFG.js → relations-kLcuobLk.js} +6 -7
  89. package/dist/_chunks/relations-kLcuobLk.js.map +1 -0
  90. package/dist/_chunks/useDebounce-CtcjDB3L.js +28 -0
  91. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  92. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  93. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  94. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +1 -1
  95. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +1 -1
  96. package/dist/admin/index.js +3 -1
  97. package/dist/admin/index.js.map +1 -1
  98. package/dist/admin/index.mjs +9 -7
  99. package/dist/admin/src/components/ComponentIcon.d.ts +6 -3
  100. package/dist/admin/src/content-manager.d.ts +3 -3
  101. package/dist/admin/src/exports.d.ts +2 -1
  102. package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
  103. package/dist/admin/src/history/index.d.ts +3 -0
  104. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  105. package/dist/admin/src/hooks/useDocument.d.ts +37 -9
  106. package/dist/admin/src/hooks/useDocumentActions.d.ts +24 -3
  107. package/dist/admin/src/hooks/useDocumentLayout.d.ts +2 -2
  108. package/dist/admin/src/hooks/useDragAndDrop.d.ts +4 -4
  109. package/dist/admin/src/hooks/useKeyboardDragAndDrop.d.ts +1 -1
  110. package/dist/admin/src/index.d.ts +1 -0
  111. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  112. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +11 -4
  113. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
  114. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.d.ts +3 -3
  115. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
  116. package/dist/admin/src/pages/EditView/components/FormInputs/Component/Input.d.ts +2 -2
  117. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.d.ts +3 -5
  118. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +1 -1
  119. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +30 -18
  120. package/dist/admin/src/pages/EditView/components/FormInputs/UID.d.ts +2 -2
  121. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +3 -49
  122. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/Field.d.ts +2 -2
  123. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  124. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +16 -53
  125. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  126. package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +2 -10
  127. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  128. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  129. package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +9 -26
  130. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  131. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  132. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  133. package/dist/admin/src/preview/constants.d.ts +1 -0
  134. package/dist/admin/src/preview/index.d.ts +4 -0
  135. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  136. package/dist/admin/src/preview/routes.d.ts +3 -0
  137. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  138. package/dist/admin/src/router.d.ts +1 -1
  139. package/dist/admin/src/services/api.d.ts +2 -3
  140. package/dist/admin/src/services/components.d.ts +2 -2
  141. package/dist/admin/src/services/contentTypes.d.ts +5 -5
  142. package/dist/admin/src/services/documents.d.ts +31 -20
  143. package/dist/admin/src/services/init.d.ts +2 -2
  144. package/dist/admin/src/services/relations.d.ts +3 -3
  145. package/dist/admin/src/services/uid.d.ts +3 -3
  146. package/dist/admin/src/utils/api.d.ts +4 -18
  147. package/dist/admin/src/utils/validation.d.ts +5 -7
  148. package/dist/server/index.js +852 -436
  149. package/dist/server/index.js.map +1 -1
  150. package/dist/server/index.mjs +859 -443
  151. package/dist/server/index.mjs.map +1 -1
  152. package/dist/server/src/bootstrap.d.ts.map +1 -1
  153. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  154. package/dist/server/src/controllers/index.d.ts.map +1 -1
  155. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  156. package/dist/server/src/controllers/single-types.d.ts.map +1 -1
  157. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  158. package/dist/server/src/controllers/utils/metadata.d.ts +22 -0
  159. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -0
  160. package/dist/server/src/controllers/validation/dimensions.d.ts +11 -0
  161. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -0
  162. package/dist/server/src/controllers/validation/index.d.ts +1 -1
  163. package/dist/server/src/history/services/history.d.ts.map +1 -1
  164. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  165. package/dist/server/src/history/services/utils.d.ts +4 -4
  166. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  167. package/dist/server/src/index.d.ts +21 -42
  168. package/dist/server/src/index.d.ts.map +1 -1
  169. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  170. package/dist/server/src/preview/constants.d.ts +2 -0
  171. package/dist/server/src/preview/constants.d.ts.map +1 -0
  172. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  173. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  174. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  175. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  176. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  177. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  178. package/dist/server/src/preview/index.d.ts +4 -0
  179. package/dist/server/src/preview/index.d.ts.map +1 -0
  180. package/dist/server/src/preview/routes/index.d.ts +8 -0
  181. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  182. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  183. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  184. package/dist/server/src/preview/services/index.d.ts +16 -0
  185. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  186. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  187. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  188. package/dist/server/src/preview/services/preview.d.ts +12 -0
  189. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  190. package/dist/server/src/preview/utils.d.ts +19 -0
  191. package/dist/server/src/preview/utils.d.ts.map +1 -0
  192. package/dist/server/src/register.d.ts.map +1 -1
  193. package/dist/server/src/routes/index.d.ts.map +1 -1
  194. package/dist/server/src/services/document-manager.d.ts +13 -12
  195. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  196. package/dist/server/src/services/document-metadata.d.ts +14 -35
  197. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  198. package/dist/server/src/services/index.d.ts +21 -42
  199. package/dist/server/src/services/index.d.ts.map +1 -1
  200. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  201. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  202. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  203. package/dist/server/src/services/utils/populate.d.ts +8 -1
  204. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  205. package/dist/server/src/utils/index.d.ts +2 -0
  206. package/dist/server/src/utils/index.d.ts.map +1 -1
  207. package/dist/shared/contracts/collection-types.d.ts +17 -7
  208. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  209. package/dist/shared/contracts/index.d.ts +1 -0
  210. package/dist/shared/contracts/index.d.ts.map +1 -1
  211. package/dist/shared/contracts/preview.d.ts +27 -0
  212. package/dist/shared/contracts/preview.d.ts.map +1 -0
  213. package/dist/shared/contracts/relations.d.ts +2 -2
  214. package/dist/shared/contracts/relations.d.ts.map +1 -1
  215. package/dist/shared/index.js +4 -0
  216. package/dist/shared/index.js.map +1 -1
  217. package/dist/shared/index.mjs +4 -0
  218. package/dist/shared/index.mjs.map +1 -1
  219. package/package.json +19 -20
  220. package/dist/_chunks/CardDragPreview-DSVYodBX.js.map +0 -1
  221. package/dist/_chunks/CardDragPreview-ikSG4M46.mjs.map +0 -1
  222. package/dist/_chunks/ComponentIcon-BBQsYCVn.js.map +0 -1
  223. package/dist/_chunks/ComponentIcon-BOFnK76n.mjs.map +0 -1
  224. package/dist/_chunks/EditViewPage-DDS6H9HO.mjs +0 -203
  225. package/dist/_chunks/EditViewPage-DDS6H9HO.mjs.map +0 -1
  226. package/dist/_chunks/EditViewPage-DvNpQkam.js.map +0 -1
  227. package/dist/_chunks/Field-6gvGdPBV.mjs.map +0 -1
  228. package/dist/_chunks/Field-DmVKIAOo.js.map +0 -1
  229. package/dist/_chunks/Form-CPZC9vWa.js.map +0 -1
  230. package/dist/_chunks/Form-DW6K1IH-.mjs.map +0 -1
  231. package/dist/_chunks/History-DeAPlvtv.js.map +0 -1
  232. package/dist/_chunks/History-Dmr9fmUA.mjs.map +0 -1
  233. package/dist/_chunks/ListConfigurationPage-DPCwW5Vr.js.map +0 -1
  234. package/dist/_chunks/ListConfigurationPage-DhwvYcNv.mjs.map +0 -1
  235. package/dist/_chunks/ListViewPage-5ySZ-VUs.js.map +0 -1
  236. package/dist/_chunks/ListViewPage-BtAwuYLE.mjs.map +0 -1
  237. package/dist/_chunks/NoContentTypePage-DOC_yWOf.js.map +0 -1
  238. package/dist/_chunks/NoContentTypePage-DSPxnxxp.mjs.map +0 -1
  239. package/dist/_chunks/Relations-CgWtgnPe.js.map +0 -1
  240. package/dist/_chunks/Relations-J8cscLlR.mjs.map +0 -1
  241. package/dist/_chunks/index-C6AH2hEl.js.map +0 -1
  242. package/dist/_chunks/index-CwRRo1V9.mjs.map +0 -1
  243. package/dist/_chunks/layout-B_SXLhqf.js.map +0 -1
  244. package/dist/_chunks/layout-jIDzX0Fp.mjs.map +0 -1
  245. package/dist/_chunks/relations-CuvIgCqI.mjs.map +0 -1
  246. package/dist/_chunks/relations-iBMa_OFG.js.map +0 -1
  247. package/dist/_chunks/urls-CbOsUOoW.mjs +0 -7
  248. package/dist/_chunks/urls-CbOsUOoW.mjs.map +0 -1
  249. package/dist/_chunks/urls-DzZya_gm.js +0 -6
  250. package/dist/_chunks/urls-DzZya_gm.js.map +0 -1
  251. package/dist/server/src/controllers/utils/dimensions.d.ts +0 -5
  252. package/dist/server/src/controllers/utils/dimensions.d.ts.map +0 -1
  253. package/strapi-server.js +0 -3
@@ -1 +0,0 @@
1
- {"version":3,"file":"CardDragPreview-DSVYodBX.js","sources":["../../admin/src/components/DragPreviews/CardDragPreview.tsx"],"sourcesContent":["import { Flex, Typography } from '@strapi/design-system';\nimport { Cross, Drag, Pencil } from '@strapi/icons';\nimport styled from 'styled-components';\n\ninterface CardDragPreviewProps {\n label: string;\n isSibling?: boolean;\n}\n\nconst CardDragPreview = ({ label, isSibling = false }: CardDragPreviewProps) => {\n return (\n <FieldContainer\n background={isSibling ? 'neutral100' : 'primary100'}\n display=\"inline-flex\"\n gap={3}\n hasRadius\n justifyContent=\"space-between\"\n isSibling={isSibling}\n max-height={`3.2rem`}\n maxWidth=\"min-content\"\n >\n <Flex gap={3}>\n <DragButton alignItems=\"center\" cursor=\"all-scroll\" padding={3}>\n <Drag />\n </DragButton>\n\n <TypographyMaxWidth\n textColor={isSibling ? undefined : 'primary600'}\n fontWeight=\"bold\"\n ellipsis\n >\n {label}\n </TypographyMaxWidth>\n </Flex>\n\n <Flex>\n <ActionBox alignItems=\"center\">\n <Pencil />\n </ActionBox>\n\n <ActionBox alignItems=\"center\">\n <Cross />\n </ActionBox>\n </Flex>\n </FieldContainer>\n );\n};\n\nconst ActionBox = styled(Flex)`\n height: ${({ theme }) => theme.spaces[7]};\n\n &:last-child {\n padding: 0 ${({ theme }) => theme.spaces[3]};\n }\n`;\n\nconst DragButton = styled(ActionBox)`\n border-right: 1px solid ${({ theme }) => theme.colors.primary200};\n\n svg {\n width: 1.2rem;\n height: 1.2rem;\n }\n`;\n\nconst FieldContainer = styled(Flex)<{ isSibling: boolean }>`\n border: 1px solid\n ${({ theme, isSibling }) => (isSibling ? theme.colors.neutral150 : theme.colors.primary200)};\n\n svg {\n width: 1rem;\n height: 1rem;\n\n path {\n fill: ${({ theme, isSibling }) => (isSibling ? undefined : theme.colors.primary600)};\n }\n }\n`;\n\nconst TypographyMaxWidth = styled(Typography)`\n max-width: 7.2rem;\n`;\n\nexport { CardDragPreview };\nexport type { CardDragPreviewProps };\n"],"names":["jsxs","Flex","jsx","Drag","Pencil","Cross","styled","Typography"],"mappings":";;;;;;;AASA,MAAM,kBAAkB,CAAC,EAAE,OAAO,YAAY,YAAkC;AAE5E,SAAAA,2BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,YAAY,YAAY,eAAe;AAAA,MACvC,SAAQ;AAAA,MACR,KAAK;AAAA,MACL,WAAS;AAAA,MACT,gBAAe;AAAA,MACf;AAAA,MACA,cAAY;AAAA,MACZ,UAAS;AAAA,MAET,UAAA;AAAA,QAACA,2BAAAA,KAAAC,aAAAA,MA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@@ -1 +0,0 @@
1
- {"version":3,"file":"CardDragPreview-ikSG4M46.mjs","sources":["../../admin/src/components/DragPreviews/CardDragPreview.tsx"],"sourcesContent":["import { Flex, Typography } from '@strapi/design-system';\nimport { Cross, Drag, Pencil } from '@strapi/icons';\nimport styled from 'styled-components';\n\ninterface CardDragPreviewProps {\n label: string;\n isSibling?: boolean;\n}\n\nconst CardDragPreview = ({ label, isSibling = false }: CardDragPreviewProps) => {\n return (\n <FieldContainer\n background={isSibling ? 'neutral100' : 'primary100'}\n display=\"inline-flex\"\n gap={3}\n hasRadius\n justifyContent=\"space-between\"\n isSibling={isSibling}\n max-height={`3.2rem`}\n maxWidth=\"min-content\"\n >\n <Flex gap={3}>\n <DragButton alignItems=\"center\" cursor=\"all-scroll\" padding={3}>\n <Drag />\n </DragButton>\n\n <TypographyMaxWidth\n textColor={isSibling ? undefined : 'primary600'}\n fontWeight=\"bold\"\n ellipsis\n >\n {label}\n </TypographyMaxWidth>\n </Flex>\n\n <Flex>\n <ActionBox alignItems=\"center\">\n <Pencil />\n </ActionBox>\n\n <ActionBox alignItems=\"center\">\n <Cross />\n </ActionBox>\n </Flex>\n </FieldContainer>\n );\n};\n\nconst ActionBox = styled(Flex)`\n height: ${({ theme }) => theme.spaces[7]};\n\n &:last-child {\n padding: 0 ${({ theme }) => theme.spaces[3]};\n }\n`;\n\nconst DragButton = styled(ActionBox)`\n border-right: 1px solid ${({ theme }) => theme.colors.primary200};\n\n svg {\n width: 1.2rem;\n height: 1.2rem;\n }\n`;\n\nconst FieldContainer = styled(Flex)<{ isSibling: boolean }>`\n border: 1px solid\n ${({ theme, isSibling }) => (isSibling ? theme.colors.neutral150 : theme.colors.primary200)};\n\n svg {\n width: 1rem;\n height: 1rem;\n\n path {\n fill: ${({ theme, isSibling }) => (isSibling ? undefined : theme.colors.primary600)};\n }\n }\n`;\n\nconst TypographyMaxWidth = styled(Typography)`\n max-width: 7.2rem;\n`;\n\nexport { CardDragPreview };\nexport type { CardDragPrevi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AW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAOjF,CAAC,EAAE,OAAO,gBAAiB,YAAY,SAAY,MAAM,OAAO,UAAW;AAAA;AAAA;AAAA;AAKzF,MAAM,qBAAqB,OAAO,UAAU;AAAA;AAAA;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ComponentIcon-BBQsYCVn.js","sources":["../../admin/src/components/ComponentIcon.tsx"],"sourcesContent":["import { Flex } from '@strapi/design-system';\nimport * as Icons from '@strapi/icons';\nimport * as Symbols from '@strapi/icons/symbols';\n\nimport type { Struct } from '@strapi/types';\n\ninterface ComponentIconProps {\n showBackground?: boolean;\n icon?: Struct.ContentTypeSchemaInfo['icon'];\n}\n\nconst ComponentIcon = ({ showBackground = true, icon = 'dashboard' }: ComponentIconProps) => {\n const Icon = COMPONENT_ICONS[icon as keyof typeof COMPONENT_ICONS] || COMPONENT_ICONS.dashboard;\n\n return (\n <Flex\n alignItems=\"center\"\n background={showBackground ? 'neutral200' : undefined}\n justifyContent=\"center\"\n height={8}\n width={8}\n color=\"neutral600\"\n borderRadius={showBackground ? '50%' : 0}\n >\n <Icon height=\"2rem\" width=\"2rem\" />\n </Flex>\n );\n};\n\nconst COMPONENT_ICONS = {\n alien: Icons.Alien,\n apps: Icons.GridNine,\n archive: Icons.Archive,\n arrowDown: Icons.ArrowDown,\n arrowLeft: Icons.ArrowLeft,\n arrowRight: Icons.ArrowRight,\n arrowUp: Icons.ArrowUp,\n attachment: Icons.Paperclip,\n bell: Icons.Bell,\n bold: Icons.Bold,\n book: Icons.Book,\n briefcase: Icons.Briefcase,\n brush: Icons.PaintBrush,\n bulletList: Icons.BulletList,\n calendar: Icons.Calendar,\n car: Icons.Car,\n cast: Icons.Cast,\n chartBubble: Icons.ChartBubble,\n chartCircle: Icons.ChartCircle,\n chartPie: Icons.ChartPie,\n check: Icons.Check,\n clock: Icons.Clock,\n cloud: Icons.Cloud,\n code: Icons.Code,\n cog: Icons.Cog,\n collapse: Icons.Collapse,\n command: Icons.Command,\n connector: Icons.Faders,\n crop: Icons.Crop,\n crown: Icons.Crown,\n cup: Icons.Coffee,\n cursor: Icons.Cursor,\n dashboard: Icons.SquaresFour,\n database: Icons.Database,\n discuss: Icons.Discuss,\n doctor: Icons.Stethoscope,\n earth: Icons.Earth,\n emotionHappy: Icons.EmotionHappy,\n emotionUnhappy: Icons.EmotionUnhappy,\n envelop: Icons.Mail,\n exit: Icons.SignOut,\n expand: Icons.Expand,\n eye: Icons.Eye,\n feather: Icons.Feather,\n file: Icons.File,\n fileError: Icons.FileError,\n filePdf: Icons.FilePdf,\n filter: Icons.Filter,\n folder: Icons.Folder,\n gate: Icons.CastleTurret,\n gift: Icons.Gift,\n globe: Icons.Globe,\n grid: Icons.GridFour,\n handHeart: Icons.HandHeart,\n hashtag: Icons.Hashtag,\n headphone: Icons.Headphones,\n heart: Icons.Heart,\n house: Icons.House,\n information: Icons.Information,\n italic: Icons.Italic,\n key: Icons.Key,\n landscape: Icons.Images,\n layer: Icons.ListPlus,\n layout: Icons.Layout,\n lightbulb: Icons.Lightbulb,\n link: Icons.Link,\n lock: Icons.Lock,\n magic: Icons.Magic,\n manyToMany: Icons.ManyToMany,\n manyToOne: Icons.ManyToOne,\n manyWays: Icons.ManyWays,\n medium: Symbols.Medium,\n message: Icons.Message,\n microphone: Icons.Microphone,\n monitor: Icons.Monitor,\n moon: Icons.Moon,\n music: Icons.MusicNotes,\n oneToMany: Icons.OneToMany,\n oneToOne: Icons.OneToOne,\n oneWay: Icons.OneWay,\n paint: Icons.PaintBrush,\n paintBrush: Icons.PaintBrush,\n paperPlane: Icons.PaperPlane,\n pencil: Icons.Pencil,\n phone: Icons.Phone,\n picture: Icons.Image,\n pin: Icons.Pin,\n pinMap: Icons.PinMap,\n plane: Icons.Plane,\n play: Icons.Play,\n plus: Icons.Plus,\n priceTag: Icons.PriceTag,\n puzzle: Icons.PuzzlePiece,\n question: Icons.Question,\n quote: Icons.Quotes,\n refresh: Icons.ArrowClockwise,\n restaurant: Icons.Restaurant,\n rocket: Icons.Rocket,\n rotate: Icons.ArrowsCounterClockwise,\n scissors: Icons.Scissors,\n search: Icons.Search,\n seed: Icons.Plant,\n server: Icons.Server,\n shield: Icons.Shield,\n shirt: Icons.Shirt,\n shoppingCart: Icons.ShoppingCart,\n slideshow: Icons.PresentationChart,\n stack: Icons.Stack,\n star: Icons.Star,\n store: Icons.Store,\n strikeThrough: Icons.StrikeThrough,\n sun: Icons.Sun,\n television: Icons.Television,\n thumbDown: Icons.ThumbDown,\n thumbUp: Icons.ThumbUp,\n train: Icons.Train,\n twitter: Symbols.X,\n typhoon: Icons.Typhoon,\n underline: Icons.Underline,\n user: Icons.User,\n volumeMute: Icons.VolumeMute,\n volumeUp: Icons.VolumeUp,\n walk: Icons.Walk,\n wheelchair: Icons.Wheelchair,\n write: Icons.Feather,\n};\n\nexport { ComponentIcon };\nexport type { ComponentIconProps };\n"],"names":["jsx","Flex","Icons","Symbols"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAM,gBAAgB,CAAC,EAAE,iBAAiB,MAAM,OAAO,kBAAsC;AAC3F,QAAM,OAAO,gBAAgB,IAAoC,KAAK,gBAAgB;AAGpF,SAAAA,2BAAA;AAAA,IAACC,aAAA;AAAA,IAAA;AAAA,MACC,YAAW;AAAA,MACX,YAAY,iBAAiB,eAAe;AAAA,MAC5C,gBAAe;AAAA,MACf,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,OAAM;AAAA,MACN,cAAc,iBAAiB,QAAQ;AAAA,MAEvC,UAACD,2BAAA,IAAA,MAAA,EAAK,QAAO,QAAO,OAAM,QAAO;AAAA,IAAA;AAAA,EAAA;AAGvC;AAEA,MAAM,kBAAkB;AAAA,EACtB,OAAOE,iBAAM;AAAA,EACb,MAAMA,iBAAM;AAAA,EACZ,SAASA,iBAAM;AAAA,EACf,WAAWA,iBAAM;AAAA,EACjB,WAAWA,iBAAM;AAAA,EACjB,YAAYA,iBAAM;AA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,iBAAM;AAAA,EACZ,QAAQA,iBAAM;AAAA,EACd,QAAQA,iBAAM;AAAA,EACd,OAAOA,iBAAM;AAAA,EACb,cAAcA,iBAAM;AAAA,EACpB,WAAWA,iBAAM;AAAA,EACjB,OAAOA,iBAAM;AAAA,EACb,MAAMA,iBAAM;AAAA,EACZ,OAAOA,iBAAM;AAAA,EACb,eAAeA,iBAAM;AAAA,EACrB,KAAKA,iBAAM;AAAA,EACX,YAAYA,iBAAM;AAAA,EAClB,WAAWA,iBAAM;AAAA,EACjB,SAASA,iBAAM;AAAA,EACf,OAAOA,iBAAM;AAAA,EACb,SAASC,mBAAQ;AAAA,EACjB,SAASD,iBAAM;AAAA,EACf,WAAWA,iBAAM;AAAA,EACjB,MAAMA,iBAAM;AAAA,EACZ,YAAYA,iBAAM;AAAA,EAClB,UAAUA,iBAAM;AAAA,EAChB,MAAMA,iBAAM;AAAA,EACZ,YAAYA,iBAAM;AAAA,EAClB,OAAOA,iBAAM;AACf;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ComponentIcon-BOFnK76n.mjs","sources":["../../admin/src/components/ComponentIcon.tsx"],"sourcesContent":["import { Flex } from '@strapi/design-system';\nimport * as Icons from '@strapi/icons';\nimport * as Symbols from '@strapi/icons/symbols';\n\nimport type { Struct } from '@strapi/types';\n\ninterface ComponentIconProps {\n showBackground?: boolean;\n icon?: Struct.ContentTypeSchemaInfo['icon'];\n}\n\nconst ComponentIcon = ({ showBackground = true, icon = 'dashboard' }: ComponentIconProps) => {\n const Icon = COMPONENT_ICONS[icon as keyof typeof COMPONENT_ICONS] || COMPONENT_ICONS.dashboard;\n\n return (\n <Flex\n alignItems=\"center\"\n background={showBackground ? 'neutral200' : undefined}\n justifyContent=\"center\"\n height={8}\n width={8}\n color=\"neutral600\"\n borderRadius={showBackground ? '50%' : 0}\n >\n <Icon height=\"2rem\" width=\"2rem\" />\n </Flex>\n );\n};\n\nconst COMPONENT_ICONS = {\n alien: Icons.Alien,\n apps: Icons.GridNine,\n archive: Icons.Archive,\n arrowDown: Icons.ArrowDown,\n arrowLeft: Icons.ArrowLeft,\n arrowRight: Icons.ArrowRight,\n arrowUp: Icons.ArrowUp,\n attachment: Icons.Paperclip,\n bell: Icons.Bell,\n bold: Icons.Bold,\n book: Icons.Book,\n briefcase: Icons.Briefcase,\n brush: Icons.PaintBrush,\n bulletList: Icons.BulletList,\n calendar: Icons.Calendar,\n car: Icons.Car,\n cast: Icons.Cast,\n chartBubble: Icons.ChartBubble,\n chartCircle: Icons.ChartCircle,\n chartPie: Icons.ChartPie,\n check: Icons.Check,\n clock: Icons.Clock,\n cloud: Icons.Cloud,\n code: Icons.Code,\n cog: Icons.Cog,\n collapse: Icons.Collapse,\n command: Icons.Command,\n connector: Icons.Faders,\n crop: Icons.Crop,\n crown: Icons.Crown,\n cup: Icons.Coffee,\n cursor: Icons.Cursor,\n dashboard: Icons.SquaresFour,\n database: Icons.Database,\n discuss: Icons.Discuss,\n doctor: Icons.Stethoscope,\n earth: Icons.Earth,\n emotionHappy: Icons.EmotionHappy,\n emotionUnhappy: Icons.EmotionUnhappy,\n envelop: Icons.Mail,\n exit: Icons.SignOut,\n expand: Icons.Expand,\n eye: Icons.Eye,\n feather: Icons.Feather,\n file: Icons.File,\n fileError: Icons.FileError,\n filePdf: Icons.FilePdf,\n filter: Icons.Filter,\n folder: Icons.Folder,\n gate: Icons.CastleTurret,\n gift: Icons.Gift,\n globe: Icons.Globe,\n grid: Icons.GridFour,\n handHeart: Icons.HandHeart,\n hashtag: Icons.Hashtag,\n headphone: Icons.Headphones,\n heart: Icons.Heart,\n house: Icons.House,\n information: Icons.Information,\n italic: Icons.Italic,\n key: Icons.Key,\n landscape: Icons.Images,\n layer: Icons.ListPlus,\n layout: Icons.Layout,\n lightbulb: Icons.Lightbulb,\n link: Icons.Link,\n lock: Icons.Lock,\n magic: Icons.Magic,\n manyToMany: Icons.ManyToMany,\n manyToOne: Icons.ManyToOne,\n manyWays: Icons.ManyWays,\n medium: Symbols.Medium,\n message: Icons.Message,\n microphone: Icons.Microphone,\n monitor: Icons.Monitor,\n moon: Icons.Moon,\n music: Icons.MusicNotes,\n oneToMany: Icons.OneToMany,\n oneToOne: Icons.OneToOne,\n oneWay: Icons.OneWay,\n paint: Icons.PaintBrush,\n paintBrush: Icons.PaintBrush,\n paperPlane: Icons.PaperPlane,\n pencil: Icons.Pencil,\n phone: Icons.Phone,\n picture: Icons.Image,\n pin: Icons.Pin,\n pinMap: Icons.PinMap,\n plane: Icons.Plane,\n play: Icons.Play,\n plus: Icons.Plus,\n priceTag: Icons.PriceTag,\n puzzle: Icons.PuzzlePiece,\n question: Icons.Question,\n quote: Icons.Quotes,\n refresh: Icons.ArrowClockwise,\n restaurant: Icons.Restaurant,\n rocket: Icons.Rocket,\n rotate: Icons.ArrowsCounterClockwise,\n scissors: Icons.Scissors,\n search: Icons.Search,\n seed: Icons.Plant,\n server: Icons.Server,\n shield: Icons.Shield,\n shirt: Icons.Shirt,\n shoppingCart: Icons.ShoppingCart,\n slideshow: Icons.PresentationChart,\n stack: Icons.Stack,\n star: Icons.Star,\n store: Icons.Store,\n strikeThrough: Icons.StrikeThrough,\n sun: Icons.Sun,\n television: Icons.Television,\n thumbDown: Icons.ThumbDown,\n thumbUp: Icons.ThumbUp,\n train: Icons.Train,\n twitter: Symbols.X,\n typhoon: Icons.Typhoon,\n underline: Icons.Underline,\n user: Icons.User,\n volumeMute: Icons.VolumeMute,\n volumeUp: Icons.VolumeUp,\n walk: Icons.Walk,\n wheelchair: Icons.Wheelchair,\n write: Icons.Feather,\n};\n\nexport { ComponentIcon };\nexport type { ComponentIconProps };\n"],"names":[],"mappings":";;;;AAWA,MAAM,gBAAgB,CAAC,EAAE,iBAAiB,MAAM,OAAO,kBAAsC;AAC3F,QAAM,OAAO,gBAAgB,IAAoC,KAAK,gBAAgB;AAGpF,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,YAAW;AAAA,MACX,YAAY,iBAAiB,eAAe;AAAA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;AAAA,EACb,SAAS,MAAM;AAAA,EACf,YAAY,MAAM;AAAA,EAClB,QAAQ,MAAM;AAAA,EACd,QAAQ,MAAM;AAAA,EACd,UAAU,MAAM;AAAA,EAChB,QAAQ,MAAM;AAAA,EACd,MAAM,MAAM;AAAA,EACZ,QAAQ,MAAM;AAAA,EACd,QAAQ,MAAM;AAAA,EACd,OAAO,MAAM;AAAA,EACb,cAAc,MAAM;AAAA,EACpB,WAAW,MAAM;AAAA,EACjB,OAAO,MAAM;AAAA,EACb,MAAM,MAAM;AAAA,EACZ,OAAO,MAAM;AAAA,EACb,eAAe,MAAM;AAAA,EACrB,KAAK,MAAM;AAAA,EACX,YAAY,MAAM;AAAA,EAClB,WAAW,MAAM;AAAA,EACjB,SAAS,MAAM;AAAA,EACf,OAAO,MAAM;AAAA,EACb,SAAS,QAAQ;AAAA,EACjB,SAAS,MAAM;AAAA,EACf,WAAW,MAAM;AAAA,EACjB,MAAM,MAAM;AAAA,EACZ,YAAY,MAAM;AAAA,EAClB,UAAU,MAAM;AAAA,EAChB,MAAM,MAAM;AAAA,EACZ,YAAY,MAAM;AAAA,EAClB,OAAO,MAAM;AACf;"}
@@ -1,203 +0,0 @@
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 { Flex, Grid, GridItem, Box, Main, TabGroup, Tabs, TabPanels, TabPanel, Tab } 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 { b as useDoc, e as useDocumentRBAC, f as useDocumentLayout, h as createYupSchema, i as Header, g as getTranslation, P as Panels, j as PERMISSIONS, k as DocumentRBAC, S as SINGLE_TYPES } from "./index-CwRRo1V9.mjs";
9
- import { I as InputRenderer, u as useLazyComponents, c as createDefaultForm, t as transformDocument } from "./Field-6gvGdPBV.mjs";
10
- const useOnce = (effect) => React.useEffect(effect, emptyDeps);
11
- const emptyDeps = [];
12
- const FormLayout = ({ layout }) => {
13
- return /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((panel, index) => {
14
- if (panel.some((row) => row.some((field) => field.type === "dynamiczone"))) {
15
- const [row] = panel;
16
- const [field] = row;
17
- return /* @__PURE__ */ jsx(Grid, { gap: 4, children: /* @__PURE__ */ jsx(GridItem, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ jsx(InputRenderer, { ...field }) }) }, field.name);
18
- }
19
- return /* @__PURE__ */ jsx(
20
- Box,
21
- {
22
- hasRadius: true,
23
- background: "neutral0",
24
- shadow: "tableShadow",
25
- paddingLeft: 6,
26
- paddingRight: 6,
27
- paddingTop: 6,
28
- paddingBottom: 6,
29
- borderColor: "neutral150",
30
- children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsx(Grid, { gap: 4, children: row.map(({ size, ...field }) => {
31
- return /* @__PURE__ */ jsx(GridItem, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsx(InputRenderer, { ...field }) }, field.name);
32
- }) }, gridRowIndex)) })
33
- },
34
- index
35
- );
36
- }) });
37
- };
38
- const EditViewPage = () => {
39
- const location = useLocation();
40
- const [
41
- {
42
- query: { status }
43
- },
44
- setQuery
45
- ] = useQueryParams();
46
- const { formatMessage } = useIntl();
47
- const { toggleNotification } = useNotification();
48
- const tabApi = React.useRef(null);
49
- const {
50
- document,
51
- meta,
52
- isLoading: isLoadingDocument,
53
- schema,
54
- components,
55
- collectionType,
56
- id,
57
- model
58
- } = useDoc();
59
- const hasDraftAndPublished = schema?.options?.draftAndPublish ?? false;
60
- useOnce(() => {
61
- if (location?.state && "error" in location.state) {
62
- toggleNotification({
63
- type: "danger",
64
- message: location.state.error,
65
- timeout: 5e3
66
- });
67
- }
68
- });
69
- const isLoadingActionsRBAC = useDocumentRBAC("EditViewPage", (state) => state.isLoading);
70
- const isSingleType = collectionType === SINGLE_TYPES;
71
- const isCreatingDocument = !id && !isSingleType;
72
- const {
73
- isLoading: isLoadingLayout,
74
- edit: {
75
- layout,
76
- settings: { mainField }
77
- }
78
- } = useDocumentLayout(model);
79
- const { isLazyLoading } = useLazyComponents([]);
80
- const isLoading = isLoadingActionsRBAC || isLoadingDocument || isLoadingLayout || isLazyLoading;
81
- const initialValues = React.useMemo(() => {
82
- if (!document && !isCreatingDocument && !isSingleType || !schema) {
83
- return void 0;
84
- }
85
- const form = document?.id ? document : createDefaultForm(schema, components);
86
- return transformDocument(schema, components)(form);
87
- }, [document, isCreatingDocument, isSingleType, schema, components]);
88
- if (isLoading && !document?.documentId) {
89
- return /* @__PURE__ */ jsx(Page.Loading, {});
90
- }
91
- if (!initialValues) {
92
- return /* @__PURE__ */ jsx(Page.Error, {});
93
- }
94
- const handleTabChange = (index) => {
95
- if (index === 0) {
96
- setQuery({ status: "draft" }, "push", true);
97
- } else {
98
- setQuery({ status: "published" }, "push", true);
99
- }
100
- };
101
- const documentTitle = mainField !== "id" && document?.[mainField] ? document[mainField] : "Untitled";
102
- return /* @__PURE__ */ jsxs(Main, { paddingLeft: 10, paddingRight: 10, children: [
103
- /* @__PURE__ */ jsx(Page.Title, { children: `${documentTitle}` }),
104
- /* @__PURE__ */ jsx(
105
- Form,
106
- {
107
- disabled: hasDraftAndPublished && status === "published",
108
- initialValues,
109
- method: isCreatingDocument ? "POST" : "PUT",
110
- validationSchema: createYupSchema(schema?.attributes, components),
111
- children: ({ resetForm }) => /* @__PURE__ */ jsxs(Fragment, { children: [
112
- /* @__PURE__ */ jsx(
113
- Header,
114
- {
115
- isCreating: isCreatingDocument,
116
- status: hasDraftAndPublished ? getDocumentStatus(document, meta) : void 0,
117
- title: documentTitle
118
- }
119
- ),
120
- /* @__PURE__ */ jsxs(
121
- TabGroup,
122
- {
123
- ref: tabApi,
124
- variant: "simple",
125
- label: formatMessage({
126
- id: getTranslation("containers.edit.tabs.label"),
127
- defaultMessage: "Document status"
128
- }),
129
- selectedTabIndex: hasDraftAndPublished && status === "published" ? 1 : 0,
130
- onTabChange: (index) => {
131
- handleTabChange(index);
132
- },
133
- children: [
134
- hasDraftAndPublished ? /* @__PURE__ */ jsxs(Tabs, { children: [
135
- /* @__PURE__ */ jsx(StatusTab, { children: formatMessage({
136
- id: getTranslation("containers.edit.tabs.draft"),
137
- defaultMessage: "draft"
138
- }) }),
139
- /* @__PURE__ */ jsx(StatusTab, { disabled: !meta || meta.availableStatus.length === 0, children: formatMessage({
140
- id: getTranslation("containers.edit.tabs.published"),
141
- defaultMessage: "published"
142
- }) })
143
- ] }) : null,
144
- /* @__PURE__ */ jsxs(Grid, { paddingTop: 8, gap: 4, children: [
145
- /* @__PURE__ */ jsx(GridItem, { col: 9, s: 12, children: /* @__PURE__ */ jsxs(TabPanels, { children: [
146
- /* @__PURE__ */ jsx(TabPanel, { children: /* @__PURE__ */ jsx(FormLayout, { layout }) }),
147
- /* @__PURE__ */ jsx(TabPanel, { children: /* @__PURE__ */ jsx(FormLayout, { layout }) })
148
- ] }) }),
149
- /* @__PURE__ */ jsx(GridItem, { col: 3, s: 12, children: /* @__PURE__ */ jsx(Panels, {}) })
150
- ] })
151
- ]
152
- }
153
- ),
154
- /* @__PURE__ */ jsx(
155
- Blocker,
156
- {
157
- onProceed: resetForm
158
- }
159
- )
160
- ] })
161
- }
162
- )
163
- ] });
164
- };
165
- const StatusTab = styled(Tab)`
166
- text-transform: uppercase;
167
- `;
168
- const getDocumentStatus = (document, meta) => {
169
- const docStatus = document?.status;
170
- const statuses = meta?.availableStatus ?? [];
171
- if (!docStatus) {
172
- return "draft";
173
- }
174
- if (docStatus === "draft" && statuses.find((doc) => doc.publishedAt !== null)) {
175
- return "published";
176
- }
177
- return docStatus;
178
- };
179
- const ProtectedEditViewPage = () => {
180
- const { slug = "" } = useParams();
181
- const {
182
- permissions = [],
183
- isLoading,
184
- error
185
- } = useRBAC(
186
- PERMISSIONS.map((action) => ({
187
- action,
188
- subject: slug
189
- }))
190
- );
191
- if (isLoading) {
192
- return /* @__PURE__ */ jsx(Page.Loading, {});
193
- }
194
- if (error || !slug) {
195
- return /* @__PURE__ */ jsx(Page.Error, {});
196
- }
197
- return /* @__PURE__ */ jsx(Page.Protect, { permissions, children: ({ permissions: permissions2 }) => /* @__PURE__ */ jsx(DocumentRBAC, { permissions: permissions2, children: /* @__PURE__ */ jsx(EditViewPage, {}) }) });
198
- };
199
- export {
200
- EditViewPage,
201
- ProtectedEditViewPage
202
- };
203
- //# sourceMappingURL=EditViewPage-DDS6H9HO.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EditViewPage-DDS6H9HO.mjs","sources":["../../admin/src/hooks/useOnce.ts","../../admin/src/pages/EditView/components/FormLayout.tsx","../../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 { Box, Flex, Grid, GridItem } from '@strapi/design-system';\n\nimport { EditLayout } from '../../../hooks/useDocumentLayout';\n\nimport { InputRenderer } from './InputRenderer';\n\ninterface FormLayoutProps extends Pick<EditLayout, 'layout'> {}\n\nconst FormLayout = ({ layout }: FormLayoutProps) => {\n return (\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {layout.map((panel, index) => {\n if (panel.some((row) => row.some((field) => field.type === 'dynamiczone'))) {\n const [row] = panel;\n const [field] = row;\n return (\n <Grid key={field.name} gap={4}>\n <GridItem col={12} s={12} xs={12}>\n <InputRenderer {...field} />\n </GridItem>\n </Grid>\n );\n }\n\n return (\n <Box\n key={index}\n hasRadius\n background=\"neutral0\"\n shadow=\"tableShadow\"\n paddingLeft={6}\n paddingRight={6}\n paddingTop={6}\n paddingBottom={6}\n borderColor=\"neutral150\"\n >\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {panel.map((row, gridRowIndex) => (\n <Grid key={gridRowIndex} gap={4}>\n {row.map(({ size, ...field }) => {\n return (\n <GridItem col={size} key={field.name} s={12} xs={12}>\n <InputRenderer {...field} />\n </GridItem>\n );\n })}\n </Grid>\n ))}\n </Flex>\n </Box>\n );\n })}\n </Flex>\n );\n};\n\nexport { FormLayout, FormLayoutProps };\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 {\n Grid,\n GridItem,\n Main,\n SetSelectedTabIndexHandler,\n Tab,\n TabGroup,\n TabPanel,\n TabPanels,\n Tabs,\n} 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 const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n const tabApi = React.useRef<{\n _handlers: {\n setSelectedTabIndex: SetSelectedTabIndexHandler;\n };\n }>(null);\n\n const {\n document,\n meta,\n isLoading: isLoadingDocument,\n schema,\n components,\n collectionType,\n id,\n model,\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 /**\n * Here we prepare the form for editing, we need to:\n * - remove prohibited fields from the document (passwords | ADD YOURS WHEN THERES A NEW ONE)\n * - swap out count objects on relations for empty arrays\n * - set __temp_key__ on array objects for drag & drop\n *\n * We also prepare the form for new documents, so we need to:\n * - set default values on fields\n */\n const initialValues = React.useMemo(() => {\n if ((!document && !isCreatingDocument && !isSingleType) || !schema) {\n return undefined;\n }\n\n /**\n * Check that we have an ID so we know the\n * document has been created in some way.\n */\n const form = document?.id ? document : createDefaultForm(schema, components);\n\n return transformDocument(schema, components)(form);\n }, [document, isCreatingDocument, isSingleType, schema, components]);\n\n if (isLoading && !document?.documentId) {\n return <Page.Loading />;\n }\n\n if (!initialValues) {\n return <Page.Error />;\n }\n\n const handleTabChange = (index: number) => {\n if (index === 0) {\n setQuery({ status: 'draft' }, 'push', true);\n } else {\n setQuery({ status: 'published' }, 'push', true);\n }\n };\n\n /**\n * We look to see what the mainField is from the configuration,\n * if it's an id we don't use it because it's a uuid format and\n * not very user friendly. Instead in that case, we simply write \"Untitled\".\n */\n const documentTitle =\n mainField !== 'id' && document?.[mainField] ? document[mainField] : 'Untitled';\n\n return (\n <Main paddingLeft={10} paddingRight={10}>\n <Page.Title>{`${documentTitle}`}</Page.Title>\n <Form\n disabled={hasDraftAndPublished && status === 'published'}\n initialValues={initialValues}\n method={isCreatingDocument ? 'POST' : 'PUT'}\n validationSchema={createYupSchema(schema?.attributes, components)}\n >\n {({ resetForm }) => (\n <>\n <Header\n isCreating={isCreatingDocument}\n status={hasDraftAndPublished ? getDocumentStatus(document, meta) : undefined}\n title={documentTitle}\n />\n <TabGroup\n ref={tabApi}\n variant=\"simple\"\n label={formatMessage({\n id: getTranslation('containers.edit.tabs.label'),\n defaultMessage: 'Document status',\n })}\n selectedTabIndex={hasDraftAndPublished && status === 'published' ? 1 : 0}\n onTabChange={(index) => {\n // TODO: remove this hack when the tabs in the DS are implemented well and we can actually use callbacks.\n handleTabChange(index);\n }}\n >\n {hasDraftAndPublished ? (\n <Tabs>\n <StatusTab>\n {formatMessage({\n id: getTranslation('containers.edit.tabs.draft'),\n defaultMessage: 'draft',\n })}\n </StatusTab>\n <StatusTab disabled={!meta || meta.availableStatus.length === 0}>\n {formatMessage({\n id: getTranslation('containers.edit.tabs.published'),\n defaultMessage: 'published',\n })}\n </StatusTab>\n </Tabs>\n ) : null}\n <Grid paddingTop={8} gap={4}>\n <GridItem col={9} s={12}>\n <TabPanels>\n <TabPanel>\n <FormLayout layout={layout} />\n </TabPanel>\n <TabPanel>\n <FormLayout layout={layout} />\n </TabPanel>\n </TabPanels>\n </GridItem>\n <GridItem col={3} s={12}>\n <Panels />\n </GridItem>\n </Grid>\n </TabGroup>\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(Tab)`\n text-transform: uppercase;\n`;\n\n/**\n * @internal\n * @description Returns the status of the document where it's 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 };\n"],"names":["permissions"],"mappings":";;;;;;;;;AAGO,MAAM,UAAU,CAAC,WAAiC,MAAM,UAAU,QAAQ,SAAS;AAE1F,MAAM,YAAkC,CAAC;ACGzC,MAAM,aAAa,CAAC,EAAE,aAA8B;AAClD,SACG,oBAAA,MAAA,EAAK,WAAU,UAAS,YAAW,WAAU,KAAK,GAChD,UAAO,OAAA,IAAI,CAAC,OAAO,UAAU;AAC5B,QAAI,MAAM,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,UAAU,MAAM,SAAS,aAAa,CAAC,GAAG;AACpE,YAAA,CAAC,GAAG,IAAI;AACR,YAAA,CAAC,KAAK,IAAI;AAChB,iCACG,MAAsB,EAAA,KAAK,GAC1B,UAAC,oBAAA,UAAA,EAAS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,aAAaA,cACzB,UAAC,oBAAA,cAAA,CAAa,CAAA,GAChB,EAEJ,CAAA;AAEJ;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"EditViewPage-DvNpQkam.js","sources":["../../admin/src/hooks/useOnce.ts","../../admin/src/pages/EditView/components/FormLayout.tsx","../../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 { Box, Flex, Grid, GridItem } from '@strapi/design-system';\n\nimport { EditLayout } from '../../../hooks/useDocumentLayout';\n\nimport { InputRenderer } from './InputRenderer';\n\ninterface FormLayoutProps extends Pick<EditLayout, 'layout'> {}\n\nconst FormLayout = ({ layout }: FormLayoutProps) => {\n return (\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {layout.map((panel, index) => {\n if (panel.some((row) => row.some((field) => field.type === 'dynamiczone'))) {\n const [row] = panel;\n const [field] = row;\n return (\n <Grid key={field.name} gap={4}>\n <GridItem col={12} s={12} xs={12}>\n <InputRenderer {...field} />\n </GridItem>\n </Grid>\n );\n }\n\n return (\n <Box\n key={index}\n hasRadius\n background=\"neutral0\"\n shadow=\"tableShadow\"\n paddingLeft={6}\n paddingRight={6}\n paddingTop={6}\n paddingBottom={6}\n borderColor=\"neutral150\"\n >\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {panel.map((row, gridRowIndex) => (\n <Grid key={gridRowIndex} gap={4}>\n {row.map(({ size, ...field }) => {\n return (\n <GridItem col={size} key={field.name} s={12} xs={12}>\n <InputRenderer {...field} />\n </GridItem>\n );\n })}\n </Grid>\n ))}\n </Flex>\n </Box>\n );\n })}\n </Flex>\n );\n};\n\nexport { FormLayout, FormLayoutProps };\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 {\n Grid,\n GridItem,\n Main,\n SetSelectedTabIndexHandler,\n Tab,\n TabGroup,\n TabPanel,\n TabPanels,\n Tabs,\n} 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 const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n const tabApi = React.useRef<{\n _handlers: {\n setSelectedTabIndex: SetSelectedTabIndexHandler;\n };\n }>(null);\n\n const {\n document,\n meta,\n isLoading: isLoadingDocument,\n schema,\n components,\n collectionType,\n id,\n model,\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 /**\n * Here we prepare the form for editing, we need to:\n * - remove prohibited fields from the document (passwords | ADD YOURS WHEN THERES A NEW ONE)\n * - swap out count objects on relations for empty arrays\n * - set __temp_key__ on array objects for drag & drop\n *\n * We also prepare the form for new documents, so we need to:\n * - set default values on fields\n */\n const initialValues = React.useMemo(() => {\n if ((!document && !isCreatingDocument && !isSingleType) || !schema) {\n return undefined;\n }\n\n /**\n * Check that we have an ID so we know the\n * document has been created in some way.\n */\n const form = document?.id ? document : createDefaultForm(schema, components);\n\n return transformDocument(schema, components)(form);\n }, [document, isCreatingDocument, isSingleType, schema, components]);\n\n if (isLoading && !document?.documentId) {\n return <Page.Loading />;\n }\n\n if (!initialValues) {\n return <Page.Error />;\n }\n\n const handleTabChange = (index: number) => {\n if (index === 0) {\n setQuery({ status: 'draft' }, 'push', true);\n } else {\n setQuery({ status: 'published' }, 'push', true);\n }\n };\n\n /**\n * We look to see what the mainField is from the configuration,\n * if it's an id we don't use it because it's a uuid format and\n * not very user friendly. Instead in that case, we simply write \"Untitled\".\n */\n const documentTitle =\n mainField !== 'id' && document?.[mainField] ? document[mainField] : 'Untitled';\n\n return (\n <Main paddingLeft={10} paddingRight={10}>\n <Page.Title>{`${documentTitle}`}</Page.Title>\n <Form\n disabled={hasDraftAndPublished && status === 'published'}\n initialValues={initialValues}\n method={isCreatingDocument ? 'POST' : 'PUT'}\n validationSchema={createYupSchema(schema?.attributes, components)}\n >\n {({ resetForm }) => (\n <>\n <Header\n isCreating={isCreatingDocument}\n status={hasDraftAndPublished ? getDocumentStatus(document, meta) : undefined}\n title={documentTitle}\n />\n <TabGroup\n ref={tabApi}\n variant=\"simple\"\n label={formatMessage({\n id: getTranslation('containers.edit.tabs.label'),\n defaultMessage: 'Document status',\n })}\n selectedTabIndex={hasDraftAndPublished && status === 'published' ? 1 : 0}\n onTabChange={(index) => {\n // TODO: remove this hack when the tabs in the DS are implemented well and we can actually use callbacks.\n handleTabChange(index);\n }}\n >\n {hasDraftAndPublished ? (\n <Tabs>\n <StatusTab>\n {formatMessage({\n id: getTranslation('containers.edit.tabs.draft'),\n defaultMessage: 'draft',\n })}\n </StatusTab>\n <StatusTab disabled={!meta || meta.availableStatus.length === 0}>\n {formatMessage({\n id: getTranslation('containers.edit.tabs.published'),\n defaultMessage: 'published',\n })}\n </StatusTab>\n </Tabs>\n ) : null}\n <Grid paddingTop={8} gap={4}>\n <GridItem col={9} s={12}>\n <TabPanels>\n <TabPanel>\n <FormLayout layout={layout} />\n </TabPanel>\n <TabPanel>\n <FormLayout layout={layout} />\n </TabPanel>\n </TabPanels>\n </GridItem>\n <GridItem col={3} s={12}>\n <Panels />\n </GridItem>\n </Grid>\n </TabGroup>\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(Tab)`\n text-transform: uppercase;\n`;\n\n/**\n * @internal\n * @description Returns the status of the document where it's 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 };\n"],"names":["React","jsx","Flex","index","Grid","GridItem","InputRenderer","Box","useLocation","useQueryParams","useIntl","useNotification","useDoc","useDocumentRBAC","SINGLE_TYPES","useDocumentLayout","useLazyComponents","createDefaultForm","transformDocument","Page","jsxs","Main","Form","createYupSchema","Fragment","Header","TabGroup","getTranslation","Tabs","TabPanels","TabPanel","Panels","Blocker","styled","Tab","useParams","useRBAC","PERMISSIONS","permissions","DocumentRBAC"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,UAAU,CAAC,WAAiCA,iBAAM,UAAU,QAAQ,SAAS;AAE1F,MAAM,YAAkC,CAAC;ACGzC,MAAM,aAAa,CAAC,EAAE,aAA8B;AAClD,SACGC,2BAAAA,IAAAC,aAAAA,MAAA,EAAK,WAAU,UAAS,YAAW,WAAU,KAAK,GAChD,UAAO,OAAA,IAAI,CAAC,OAAOC,WAAU;AAC5B,QAAI,MAAM,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,UAAU,MAAM,SAAS,aAAa,CAAC,GAAG;AACpE,YAAA,CAAC,GAAG,IAAI;AACR,YAAA,CAAC,KAAK,IAAI;AAChB,4CACGC,aAAAA,MAAsB,EAAA,KAAK,GAC1B,UAACH,2BAAA,IAAAI,uBAAA,E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