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

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 (437) hide show
  1. package/dist/_chunks/CardDragPreview-C0QyJgRA.js +69 -0
  2. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -0
  3. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs +70 -0
  4. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -0
  5. package/dist/_chunks/ComponentConfigurationPage-9_4yUE9L.mjs +236 -0
  6. package/dist/_chunks/ComponentConfigurationPage-9_4yUE9L.mjs.map +1 -0
  7. package/dist/_chunks/ComponentConfigurationPage-DBSh-kET.js +254 -0
  8. package/dist/_chunks/ComponentConfigurationPage-DBSh-kET.js.map +1 -0
  9. package/dist/_chunks/ComponentIcon-CRbtQEUV.js +175 -0
  10. package/dist/_chunks/ComponentIcon-CRbtQEUV.js.map +1 -0
  11. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs +157 -0
  12. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -0
  13. package/dist/_chunks/EditConfigurationPage-Bl_U2JgH.js +150 -0
  14. package/dist/_chunks/EditConfigurationPage-Bl_U2JgH.js.map +1 -0
  15. package/dist/_chunks/EditConfigurationPage-COe6hjPC.mjs +132 -0
  16. package/dist/_chunks/EditConfigurationPage-COe6hjPC.mjs.map +1 -0
  17. package/dist/_chunks/EditViewPage-D4yFJET6.js +209 -0
  18. package/dist/_chunks/EditViewPage-D4yFJET6.js.map +1 -0
  19. package/dist/_chunks/EditViewPage-DrmVmYN0.mjs +191 -0
  20. package/dist/_chunks/EditViewPage-DrmVmYN0.mjs.map +1 -0
  21. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +50 -0
  22. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -0
  23. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +49 -0
  24. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -0
  25. package/dist/_chunks/Form-C4rSaGsz.js +778 -0
  26. package/dist/_chunks/Form-C4rSaGsz.js.map +1 -0
  27. package/dist/_chunks/Form-DamaxNpG.mjs +758 -0
  28. package/dist/_chunks/Form-DamaxNpG.mjs.map +1 -0
  29. package/dist/_chunks/History-D1PreDSY.mjs +999 -0
  30. package/dist/_chunks/History-D1PreDSY.mjs.map +1 -0
  31. package/dist/_chunks/History-DTm8UCCQ.js +1019 -0
  32. package/dist/_chunks/History-DTm8UCCQ.js.map +1 -0
  33. package/dist/_chunks/Input-B7sapvBG.js +5617 -0
  34. package/dist/_chunks/Input-B7sapvBG.js.map +1 -0
  35. package/dist/_chunks/Input-CZ1YvjHR.mjs +5585 -0
  36. package/dist/_chunks/Input-CZ1YvjHR.mjs.map +1 -0
  37. package/dist/_chunks/ListConfigurationPage-Bbi32isk.mjs +633 -0
  38. package/dist/_chunks/ListConfigurationPage-Bbi32isk.mjs.map +1 -0
  39. package/dist/_chunks/ListConfigurationPage-ysFMjKI3.js +652 -0
  40. package/dist/_chunks/ListConfigurationPage-ysFMjKI3.js.map +1 -0
  41. package/dist/_chunks/ListViewPage-Bud_jBDQ.mjs +854 -0
  42. package/dist/_chunks/ListViewPage-Bud_jBDQ.mjs.map +1 -0
  43. package/dist/_chunks/ListViewPage-DTuuxU3n.js +877 -0
  44. package/dist/_chunks/ListViewPage-DTuuxU3n.js.map +1 -0
  45. package/dist/_chunks/NoContentTypePage-CL7VVeYs.js +51 -0
  46. package/dist/_chunks/NoContentTypePage-CL7VVeYs.js.map +1 -0
  47. package/dist/_chunks/NoContentTypePage-DVhkugsf.mjs +51 -0
  48. package/dist/_chunks/NoContentTypePage-DVhkugsf.mjs.map +1 -0
  49. package/dist/_chunks/NoPermissionsPage-CMdM-dCo.mjs +23 -0
  50. package/dist/_chunks/NoPermissionsPage-CMdM-dCo.mjs.map +1 -0
  51. package/dist/_chunks/NoPermissionsPage-v7I599vC.js +23 -0
  52. package/dist/_chunks/NoPermissionsPage-v7I599vC.js.map +1 -0
  53. package/dist/_chunks/Preview-BNuU0SuQ.mjs +287 -0
  54. package/dist/_chunks/Preview-BNuU0SuQ.mjs.map +1 -0
  55. package/dist/_chunks/Preview-Cxq-uI6D.js +305 -0
  56. package/dist/_chunks/Preview-Cxq-uI6D.js.map +1 -0
  57. package/dist/_chunks/Relations-C2Ahkrdg.mjs +728 -0
  58. package/dist/_chunks/Relations-C2Ahkrdg.mjs.map +1 -0
  59. package/dist/_chunks/Relations-CWS79QQn.js +747 -0
  60. package/dist/_chunks/Relations-CWS79QQn.js.map +1 -0
  61. package/dist/_chunks/ar-BUUWXIYu.js +226 -0
  62. package/dist/{admin/chunks/ar-DckYq_WK.js.map → _chunks/ar-BUUWXIYu.js.map} +1 -1
  63. package/dist/_chunks/ar-CCEVvqGG.mjs +226 -0
  64. package/dist/_chunks/ar-CCEVvqGG.mjs.map +1 -0
  65. package/dist/_chunks/ca-5U32ON2v.mjs +201 -0
  66. package/dist/_chunks/ca-5U32ON2v.mjs.map +1 -0
  67. package/dist/_chunks/ca-Cmk45QO6.js +201 -0
  68. package/dist/{admin/chunks/de-CbImAUA5.js.map → _chunks/ca-Cmk45QO6.js.map} +1 -1
  69. package/dist/_chunks/cs-CM2aBUar.mjs +125 -0
  70. package/dist/_chunks/cs-CM2aBUar.mjs.map +1 -0
  71. package/dist/_chunks/cs-CkJy6B2v.js +125 -0
  72. package/dist/{admin/chunks/cs-C7OSYFQ7.js.map → _chunks/cs-CkJy6B2v.js.map} +1 -1
  73. package/dist/_chunks/de-C72KDNOl.mjs +199 -0
  74. package/dist/_chunks/de-C72KDNOl.mjs.map +1 -0
  75. package/dist/_chunks/de-CCEmbAah.js +199 -0
  76. package/dist/{admin/chunks/es-C8vLuvZL.js.map → _chunks/de-CCEmbAah.js.map} +1 -1
  77. package/dist/_chunks/en-BR48D_RH.js +312 -0
  78. package/dist/{admin/chunks/en-DB7sPJVj.js.map → _chunks/en-BR48D_RH.js.map} +1 -1
  79. package/dist/_chunks/en-D65uIF6Y.mjs +312 -0
  80. package/dist/{admin/chunks/en-1xHet_GV.js.map → _chunks/en-D65uIF6Y.mjs.map} +1 -1
  81. package/dist/_chunks/es-9K52xZIr.js +196 -0
  82. package/dist/{admin/chunks/de-5QRlDHyR.js.map → _chunks/es-9K52xZIr.js.map} +1 -1
  83. package/dist/_chunks/es-D34tqjMw.mjs +196 -0
  84. package/dist/_chunks/es-D34tqjMw.mjs.map +1 -0
  85. package/dist/_chunks/eu-CdALomew.mjs +202 -0
  86. package/dist/_chunks/eu-CdALomew.mjs.map +1 -0
  87. package/dist/_chunks/eu-VDH-3ovk.js +202 -0
  88. package/dist/_chunks/eu-VDH-3ovk.js.map +1 -0
  89. package/dist/_chunks/fr-C43IbhA_.js +219 -0
  90. package/dist/_chunks/fr-C43IbhA_.js.map +1 -0
  91. package/dist/_chunks/fr-DBseuRuB.mjs +219 -0
  92. package/dist/_chunks/fr-DBseuRuB.mjs.map +1 -0
  93. package/dist/_chunks/gu-BRmF601H.js +200 -0
  94. package/dist/_chunks/gu-BRmF601H.js.map +1 -0
  95. package/dist/_chunks/gu-CNpaMDpH.mjs +200 -0
  96. package/dist/_chunks/gu-CNpaMDpH.mjs.map +1 -0
  97. package/dist/_chunks/hi-CCJBptSq.js +200 -0
  98. package/dist/_chunks/hi-CCJBptSq.js.map +1 -0
  99. package/dist/_chunks/hi-Dwvd04m3.mjs +200 -0
  100. package/dist/_chunks/hi-Dwvd04m3.mjs.map +1 -0
  101. package/dist/{admin/chunks/hooks-D-sOYd1s.js → _chunks/hooks-BAaaKPS_.js} +3 -6
  102. package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -0
  103. package/dist/_chunks/hooks-E5u1mcgM.mjs +8 -0
  104. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +1 -0
  105. package/dist/_chunks/hu-CeYvaaO0.mjs +202 -0
  106. package/dist/_chunks/hu-CeYvaaO0.mjs.map +1 -0
  107. package/dist/_chunks/hu-sNV_yLYy.js +202 -0
  108. package/dist/_chunks/hu-sNV_yLYy.js.map +1 -0
  109. package/dist/_chunks/id-B5Ser98A.js +160 -0
  110. package/dist/{admin/chunks/it-BAHrwmYS.js.map → _chunks/id-B5Ser98A.js.map} +1 -1
  111. package/dist/_chunks/id-BtwA9WJT.mjs +160 -0
  112. package/dist/_chunks/id-BtwA9WJT.mjs.map +1 -0
  113. package/dist/_chunks/index-DQsvBb_N.js +4500 -0
  114. package/dist/_chunks/index-DQsvBb_N.js.map +1 -0
  115. package/dist/_chunks/index-ZKrsjv-2.mjs +4481 -0
  116. package/dist/_chunks/index-ZKrsjv-2.mjs.map +1 -0
  117. package/dist/_chunks/it-BrVPqaf1.mjs +162 -0
  118. package/dist/_chunks/it-BrVPqaf1.mjs.map +1 -0
  119. package/dist/_chunks/it-DkBIs7vD.js +162 -0
  120. package/dist/{admin/chunks/id-D7V5S1rB.js.map → _chunks/it-DkBIs7vD.js.map} +1 -1
  121. package/dist/_chunks/ja-7sfIbjxE.js +196 -0
  122. package/dist/{admin/chunks/it-CQFpa_Dc.js.map → _chunks/ja-7sfIbjxE.js.map} +1 -1
  123. package/dist/_chunks/ja-BHqhDq4V.mjs +196 -0
  124. package/dist/_chunks/ja-BHqhDq4V.mjs.map +1 -0
  125. package/dist/_chunks/ko-HVQRlfUI.mjs +195 -0
  126. package/dist/_chunks/ko-HVQRlfUI.mjs.map +1 -0
  127. package/dist/_chunks/ko-woFZPmLk.js +195 -0
  128. package/dist/{admin/chunks/es-DkoWSExG.js.map → _chunks/ko-woFZPmLk.js.map} +1 -1
  129. package/dist/_chunks/layout-Cl0NhlQB.js +488 -0
  130. package/dist/_chunks/layout-Cl0NhlQB.js.map +1 -0
  131. package/dist/_chunks/layout-fQk1rMk9.mjs +471 -0
  132. package/dist/_chunks/layout-fQk1rMk9.mjs.map +1 -0
  133. package/dist/_chunks/ml-BihZwQit.mjs +200 -0
  134. package/dist/_chunks/ml-BihZwQit.mjs.map +1 -0
  135. package/dist/_chunks/ml-C2W8N8k1.js +200 -0
  136. package/dist/_chunks/ml-C2W8N8k1.js.map +1 -0
  137. package/dist/_chunks/ms-BuFotyP_.js +144 -0
  138. package/dist/{admin/chunks/cs-BJFxwIWj.js.map → _chunks/ms-BuFotyP_.js.map} +1 -1
  139. package/dist/_chunks/ms-m_WjyWx7.mjs +144 -0
  140. package/dist/_chunks/ms-m_WjyWx7.mjs.map +1 -0
  141. package/dist/_chunks/nl-D4R9gHx5.mjs +202 -0
  142. package/dist/_chunks/nl-D4R9gHx5.mjs.map +1 -0
  143. package/dist/_chunks/nl-bbEOHChV.js +202 -0
  144. package/dist/_chunks/nl-bbEOHChV.js.map +1 -0
  145. package/dist/_chunks/objects-BcXOv6_9.js +47 -0
  146. package/dist/_chunks/objects-BcXOv6_9.js.map +1 -0
  147. package/dist/_chunks/objects-D6yBsdmx.mjs +45 -0
  148. package/dist/_chunks/objects-D6yBsdmx.mjs.map +1 -0
  149. package/dist/_chunks/pl-sbx9mSt_.mjs +199 -0
  150. package/dist/_chunks/pl-sbx9mSt_.mjs.map +1 -0
  151. package/dist/_chunks/pl-uzwG-hk7.js +199 -0
  152. package/dist/{admin/chunks/ca-DviY7mRj.js.map → _chunks/pl-uzwG-hk7.js.map} +1 -1
  153. package/dist/_chunks/pt-BR-BiOz37D9.js +201 -0
  154. package/dist/{admin/chunks/pt-BR-CcotyBGJ.js.map → _chunks/pt-BR-BiOz37D9.js.map} +1 -1
  155. package/dist/_chunks/pt-BR-C71iDxnh.mjs +201 -0
  156. package/dist/_chunks/pt-BR-C71iDxnh.mjs.map +1 -0
  157. package/dist/_chunks/pt-BsaFvS8-.mjs +95 -0
  158. package/dist/_chunks/pt-BsaFvS8-.mjs.map +1 -0
  159. package/dist/_chunks/pt-CeXQuq50.js +95 -0
  160. package/dist/_chunks/pt-CeXQuq50.js.map +1 -0
  161. package/dist/_chunks/relations-BRfBxVbX.js +133 -0
  162. package/dist/_chunks/relations-BRfBxVbX.js.map +1 -0
  163. package/dist/_chunks/relations-BakOFl_1.mjs +134 -0
  164. package/dist/_chunks/relations-BakOFl_1.mjs.map +1 -0
  165. package/dist/_chunks/ru-BE6A4Exp.mjs +231 -0
  166. package/dist/{admin/chunks/ar-DeQBSsfl.js.map → _chunks/ru-BE6A4Exp.mjs.map} +1 -1
  167. package/dist/_chunks/ru-BT3ybNny.js +231 -0
  168. package/dist/{admin/chunks/ru-CB4BUyQp.js.map → _chunks/ru-BT3ybNny.js.map} +1 -1
  169. package/dist/_chunks/sa-CcvkYInH.js +200 -0
  170. package/dist/_chunks/sa-CcvkYInH.js.map +1 -0
  171. package/dist/_chunks/sa-Dag0k-Z8.mjs +200 -0
  172. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +1 -0
  173. package/dist/_chunks/sk-BFg-R8qJ.mjs +202 -0
  174. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +1 -0
  175. package/dist/_chunks/sk-CvY09Xjv.js +202 -0
  176. package/dist/_chunks/sk-CvY09Xjv.js.map +1 -0
  177. package/dist/_chunks/sv-CUnfWGsh.mjs +202 -0
  178. package/dist/_chunks/sv-CUnfWGsh.mjs.map +1 -0
  179. package/dist/_chunks/sv-MYDuzgvT.js +202 -0
  180. package/dist/_chunks/sv-MYDuzgvT.js.map +1 -0
  181. package/dist/_chunks/th-BqbI8lIT.mjs +148 -0
  182. package/dist/_chunks/th-BqbI8lIT.mjs.map +1 -0
  183. package/dist/_chunks/th-D9_GfAjc.js +148 -0
  184. package/dist/{admin/chunks/ms-CvSC0OdG.js.map → _chunks/th-D9_GfAjc.js.map} +1 -1
  185. package/dist/_chunks/tr-CgeK3wJM.mjs +199 -0
  186. package/dist/_chunks/tr-CgeK3wJM.mjs.map +1 -0
  187. package/dist/_chunks/tr-D9UH-O_R.js +199 -0
  188. package/dist/_chunks/tr-D9UH-O_R.js.map +1 -0
  189. package/dist/_chunks/uk-C8EiqJY7.js +144 -0
  190. package/dist/{admin/chunks/ms-Bh09NFff.js.map → _chunks/uk-C8EiqJY7.js.map} +1 -1
  191. package/dist/_chunks/uk-CR-zDhAY.mjs +144 -0
  192. package/dist/_chunks/uk-CR-zDhAY.mjs.map +1 -0
  193. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js +245 -0
  194. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js.map +1 -0
  195. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs +228 -0
  196. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs.map +1 -0
  197. package/dist/_chunks/usePrev-CZGy2Vjf.mjs +29 -0
  198. package/dist/_chunks/usePrev-CZGy2Vjf.mjs.map +1 -0
  199. package/dist/_chunks/usePrev-D5J_2fEu.js +28 -0
  200. package/dist/_chunks/usePrev-D5J_2fEu.js.map +1 -0
  201. package/dist/_chunks/vi-CJlYDheJ.js +111 -0
  202. package/dist/{admin/chunks/vi-CvBGlTjr.js.map → _chunks/vi-CJlYDheJ.js.map} +1 -1
  203. package/dist/_chunks/vi-DUXIk_fw.mjs +111 -0
  204. package/dist/_chunks/vi-DUXIk_fw.mjs.map +1 -0
  205. package/dist/_chunks/zh-BWZspA60.mjs +209 -0
  206. package/dist/_chunks/zh-BWZspA60.mjs.map +1 -0
  207. package/dist/_chunks/zh-CQQfszqR.js +209 -0
  208. package/dist/{admin/chunks/ca-ClDTvatJ.js.map → _chunks/zh-CQQfszqR.js.map} +1 -1
  209. package/dist/_chunks/zh-Hans-9kOncHGw.js +952 -0
  210. package/dist/{admin/chunks/zh-Hans-CI0HKio3.js.map → _chunks/zh-Hans-9kOncHGw.js.map} +1 -1
  211. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +952 -0
  212. package/dist/{admin/chunks/zh-Hans-JVK9x7xr.js.map → _chunks/zh-Hans-BPQcRIyH.mjs.map} +1 -1
  213. package/dist/admin/index.js +4 -23
  214. package/dist/admin/index.js.map +1 -1
  215. package/dist/admin/index.mjs +13 -16
  216. package/dist/admin/index.mjs.map +1 -1
  217. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  218. package/dist/admin/src/hooks/useDocument.d.ts +2 -2
  219. package/dist/admin/src/preview/index.d.ts +3 -2
  220. package/dist/server/index.js +4396 -5468
  221. package/dist/server/index.js.map +1 -1
  222. package/dist/server/index.mjs +4368 -5442
  223. package/dist/server/index.mjs.map +1 -1
  224. package/dist/server/src/controllers/utils/metadata.d.ts +1 -1
  225. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  226. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  227. package/dist/server/src/services/utils/count.d.ts +1 -1
  228. package/dist/server/src/services/utils/count.d.ts.map +1 -1
  229. package/dist/server/src/services/utils/populate.d.ts +1 -1
  230. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  231. package/dist/shared/contracts/collection-types.d.ts +1 -0
  232. package/dist/shared/contracts/components.d.ts +1 -0
  233. package/dist/shared/contracts/content-types.d.ts +1 -0
  234. package/dist/shared/contracts/history-versions.d.ts +1 -0
  235. package/dist/shared/contracts/index.d.ts +1 -0
  236. package/dist/shared/contracts/init.d.ts +1 -0
  237. package/dist/shared/contracts/preview.d.ts +1 -0
  238. package/dist/shared/contracts/relations.d.ts +2 -1
  239. package/dist/shared/contracts/relations.d.ts.map +1 -1
  240. package/dist/shared/contracts/review-workflows.d.ts +1 -0
  241. package/dist/shared/contracts/single-types.d.ts +1 -0
  242. package/dist/shared/contracts/uid.d.ts +1 -0
  243. package/dist/shared/index.d.ts +1 -0
  244. package/dist/shared/index.js +24 -35
  245. package/dist/shared/index.js.map +1 -1
  246. package/dist/shared/index.mjs +25 -34
  247. package/dist/shared/index.mjs.map +1 -1
  248. package/package.json +10 -13
  249. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js +0 -80
  250. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js.map +0 -1
  251. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js +0 -82
  252. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js.map +0 -1
  253. package/dist/admin/chunks/ComponentConfigurationPage-BqW-t7Lr.js +0 -276
  254. package/dist/admin/chunks/ComponentConfigurationPage-BqW-t7Lr.js.map +0 -1
  255. package/dist/admin/chunks/ComponentConfigurationPage-CM3vQxyp.js +0 -298
  256. package/dist/admin/chunks/ComponentConfigurationPage-CM3vQxyp.js.map +0 -1
  257. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js +0 -153
  258. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js.map +0 -1
  259. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js +0 -176
  260. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js.map +0 -1
  261. package/dist/admin/chunks/EditConfigurationPage-CIKO27N8.js +0 -180
  262. package/dist/admin/chunks/EditConfigurationPage-CIKO27N8.js.map +0 -1
  263. package/dist/admin/chunks/EditConfigurationPage-CYQ6mJWy.js +0 -158
  264. package/dist/admin/chunks/EditConfigurationPage-CYQ6mJWy.js.map +0 -1
  265. package/dist/admin/chunks/EditViewPage-CRu2G4OS.js +0 -337
  266. package/dist/admin/chunks/EditViewPage-CRu2G4OS.js.map +0 -1
  267. package/dist/admin/chunks/EditViewPage-DaY9aMeu.js +0 -314
  268. package/dist/admin/chunks/EditViewPage-DaY9aMeu.js.map +0 -1
  269. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js +0 -56
  270. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js.map +0 -1
  271. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js +0 -58
  272. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js.map +0 -1
  273. package/dist/admin/chunks/Form--7s-Wsw1.js +0 -978
  274. package/dist/admin/chunks/Form--7s-Wsw1.js.map +0 -1
  275. package/dist/admin/chunks/Form-CX_f1AUZ.js +0 -955
  276. package/dist/admin/chunks/Form-CX_f1AUZ.js.map +0 -1
  277. package/dist/admin/chunks/History-SRih7tGq.js +0 -1380
  278. package/dist/admin/chunks/History-SRih7tGq.js.map +0 -1
  279. package/dist/admin/chunks/History-VVVFEAnd.js +0 -1357
  280. package/dist/admin/chunks/History-VVVFEAnd.js.map +0 -1
  281. package/dist/admin/chunks/Input-B3wbR0pJ.js +0 -6754
  282. package/dist/admin/chunks/Input-B3wbR0pJ.js.map +0 -1
  283. package/dist/admin/chunks/Input-BIRb1gP2.js +0 -6785
  284. package/dist/admin/chunks/Input-BIRb1gP2.js.map +0 -1
  285. package/dist/admin/chunks/ListConfigurationPage-BMBxgLtZ.js +0 -795
  286. package/dist/admin/chunks/ListConfigurationPage-BMBxgLtZ.js.map +0 -1
  287. package/dist/admin/chunks/ListConfigurationPage-DBWZlkHs.js +0 -818
  288. package/dist/admin/chunks/ListConfigurationPage-DBWZlkHs.js.map +0 -1
  289. package/dist/admin/chunks/ListViewPage-9jad22KO.js +0 -1154
  290. package/dist/admin/chunks/ListViewPage-9jad22KO.js.map +0 -1
  291. package/dist/admin/chunks/ListViewPage-Dq2zuPYL.js +0 -1132
  292. package/dist/admin/chunks/ListViewPage-Dq2zuPYL.js.map +0 -1
  293. package/dist/admin/chunks/NoContentTypePage-B5xX6Br5.js +0 -59
  294. package/dist/admin/chunks/NoContentTypePage-B5xX6Br5.js.map +0 -1
  295. package/dist/admin/chunks/NoContentTypePage-BtpSxTZs.js +0 -57
  296. package/dist/admin/chunks/NoContentTypePage-BtpSxTZs.js.map +0 -1
  297. package/dist/admin/chunks/NoPermissionsPage-CRS0hARz.js +0 -38
  298. package/dist/admin/chunks/NoPermissionsPage-CRS0hARz.js.map +0 -1
  299. package/dist/admin/chunks/NoPermissionsPage-HnOCsRtG.js +0 -36
  300. package/dist/admin/chunks/NoPermissionsPage-HnOCsRtG.js.map +0 -1
  301. package/dist/admin/chunks/Preview-BcggSPwn.js +0 -435
  302. package/dist/admin/chunks/Preview-BcggSPwn.js.map +0 -1
  303. package/dist/admin/chunks/Preview-DRtWRrYn.js +0 -457
  304. package/dist/admin/chunks/Preview-DRtWRrYn.js.map +0 -1
  305. package/dist/admin/chunks/Relations-B1i77Jba.js +0 -826
  306. package/dist/admin/chunks/Relations-B1i77Jba.js.map +0 -1
  307. package/dist/admin/chunks/Relations-BDe2e0a7.js +0 -852
  308. package/dist/admin/chunks/Relations-BDe2e0a7.js.map +0 -1
  309. package/dist/admin/chunks/ar-DckYq_WK.js +0 -222
  310. package/dist/admin/chunks/ar-DeQBSsfl.js +0 -227
  311. package/dist/admin/chunks/ca-ClDTvatJ.js +0 -202
  312. package/dist/admin/chunks/ca-DviY7mRj.js +0 -197
  313. package/dist/admin/chunks/cs-BJFxwIWj.js +0 -126
  314. package/dist/admin/chunks/cs-C7OSYFQ7.js +0 -122
  315. package/dist/admin/chunks/de-5QRlDHyR.js +0 -195
  316. package/dist/admin/chunks/de-CbImAUA5.js +0 -200
  317. package/dist/admin/chunks/en-1xHet_GV.js +0 -312
  318. package/dist/admin/chunks/en-DB7sPJVj.js +0 -307
  319. package/dist/admin/chunks/es-C8vLuvZL.js +0 -197
  320. package/dist/admin/chunks/es-DkoWSExG.js +0 -192
  321. package/dist/admin/chunks/eu-BG1xX7HK.js +0 -198
  322. package/dist/admin/chunks/eu-BG1xX7HK.js.map +0 -1
  323. package/dist/admin/chunks/eu-BJW3AvXu.js +0 -203
  324. package/dist/admin/chunks/eu-BJW3AvXu.js.map +0 -1
  325. package/dist/admin/chunks/fr-CqAyDOmo.js +0 -217
  326. package/dist/admin/chunks/fr-CqAyDOmo.js.map +0 -1
  327. package/dist/admin/chunks/fr-Dm1xiZI5.js +0 -212
  328. package/dist/admin/chunks/fr-Dm1xiZI5.js.map +0 -1
  329. package/dist/admin/chunks/gu-D5MMMXRs.js +0 -196
  330. package/dist/admin/chunks/gu-D5MMMXRs.js.map +0 -1
  331. package/dist/admin/chunks/gu-DPU4wyx7.js +0 -201
  332. package/dist/admin/chunks/gu-DPU4wyx7.js.map +0 -1
  333. package/dist/admin/chunks/hi-Dp4omeBb.js +0 -201
  334. package/dist/admin/chunks/hi-Dp4omeBb.js.map +0 -1
  335. package/dist/admin/chunks/hi-lp17SCjr.js +0 -196
  336. package/dist/admin/chunks/hi-lp17SCjr.js.map +0 -1
  337. package/dist/admin/chunks/hooks-D-sOYd1s.js.map +0 -1
  338. package/dist/admin/chunks/hooks-DMvik5y_.js +0 -7
  339. package/dist/admin/chunks/hooks-DMvik5y_.js.map +0 -1
  340. package/dist/admin/chunks/hu-CLka1U2C.js +0 -198
  341. package/dist/admin/chunks/hu-CLka1U2C.js.map +0 -1
  342. package/dist/admin/chunks/hu-CtFJuhTd.js +0 -203
  343. package/dist/admin/chunks/hu-CtFJuhTd.js.map +0 -1
  344. package/dist/admin/chunks/id-D7V5S1rB.js +0 -161
  345. package/dist/admin/chunks/id-USfY9m1g.js +0 -156
  346. package/dist/admin/chunks/id-USfY9m1g.js.map +0 -1
  347. package/dist/admin/chunks/index-CKZHZ3ir.js +0 -5339
  348. package/dist/admin/chunks/index-CKZHZ3ir.js.map +0 -1
  349. package/dist/admin/chunks/index-DfEfFmQC.js +0 -5273
  350. package/dist/admin/chunks/index-DfEfFmQC.js.map +0 -1
  351. package/dist/admin/chunks/it-BAHrwmYS.js +0 -158
  352. package/dist/admin/chunks/it-CQFpa_Dc.js +0 -163
  353. package/dist/admin/chunks/ja-BWKmBJFT.js +0 -192
  354. package/dist/admin/chunks/ja-BWKmBJFT.js.map +0 -1
  355. package/dist/admin/chunks/ja-jdQM-B79.js +0 -197
  356. package/dist/admin/chunks/ja-jdQM-B79.js.map +0 -1
  357. package/dist/admin/chunks/ko-CgADGBNt.js +0 -191
  358. package/dist/admin/chunks/ko-CgADGBNt.js.map +0 -1
  359. package/dist/admin/chunks/ko-k46sEyzt.js +0 -196
  360. package/dist/admin/chunks/ko-k46sEyzt.js.map +0 -1
  361. package/dist/admin/chunks/layout-BN6DSZ4t.js +0 -598
  362. package/dist/admin/chunks/layout-BN6DSZ4t.js.map +0 -1
  363. package/dist/admin/chunks/layout-CX-A0s3P.js +0 -618
  364. package/dist/admin/chunks/layout-CX-A0s3P.js.map +0 -1
  365. package/dist/admin/chunks/ml-CnhCfOn_.js +0 -196
  366. package/dist/admin/chunks/ml-CnhCfOn_.js.map +0 -1
  367. package/dist/admin/chunks/ml-DqxPwODx.js +0 -201
  368. package/dist/admin/chunks/ml-DqxPwODx.js.map +0 -1
  369. package/dist/admin/chunks/ms-Bh09NFff.js +0 -140
  370. package/dist/admin/chunks/ms-CvSC0OdG.js +0 -145
  371. package/dist/admin/chunks/nl-BEubhS8C.js +0 -203
  372. package/dist/admin/chunks/nl-BEubhS8C.js.map +0 -1
  373. package/dist/admin/chunks/nl-C8HYflTc.js +0 -198
  374. package/dist/admin/chunks/nl-C8HYflTc.js.map +0 -1
  375. package/dist/admin/chunks/objects-C3EebVVe.js +0 -76
  376. package/dist/admin/chunks/objects-C3EebVVe.js.map +0 -1
  377. package/dist/admin/chunks/objects-wl73iEma.js +0 -73
  378. package/dist/admin/chunks/objects-wl73iEma.js.map +0 -1
  379. package/dist/admin/chunks/pl-DWhGDzmM.js +0 -200
  380. package/dist/admin/chunks/pl-DWhGDzmM.js.map +0 -1
  381. package/dist/admin/chunks/pl-MFCZJZuZ.js +0 -195
  382. package/dist/admin/chunks/pl-MFCZJZuZ.js.map +0 -1
  383. package/dist/admin/chunks/pt-BR-CPtAXD-4.js +0 -202
  384. package/dist/admin/chunks/pt-BR-CPtAXD-4.js.map +0 -1
  385. package/dist/admin/chunks/pt-BR-CcotyBGJ.js +0 -197
  386. package/dist/admin/chunks/pt-BoPxN80n.js +0 -96
  387. package/dist/admin/chunks/pt-BoPxN80n.js.map +0 -1
  388. package/dist/admin/chunks/pt-HbmgeiYO.js +0 -93
  389. package/dist/admin/chunks/pt-HbmgeiYO.js.map +0 -1
  390. package/dist/admin/chunks/relations-CuPmv-zR.js +0 -160
  391. package/dist/admin/chunks/relations-CuPmv-zR.js.map +0 -1
  392. package/dist/admin/chunks/relations-xwSNlsdc.js +0 -156
  393. package/dist/admin/chunks/relations-xwSNlsdc.js.map +0 -1
  394. package/dist/admin/chunks/ru-C0op0ALG.js +0 -232
  395. package/dist/admin/chunks/ru-C0op0ALG.js.map +0 -1
  396. package/dist/admin/chunks/ru-CB4BUyQp.js +0 -230
  397. package/dist/admin/chunks/sa-B_FuPyMw.js +0 -201
  398. package/dist/admin/chunks/sa-B_FuPyMw.js.map +0 -1
  399. package/dist/admin/chunks/sa-n_aPA-pU.js +0 -196
  400. package/dist/admin/chunks/sa-n_aPA-pU.js.map +0 -1
  401. package/dist/admin/chunks/sk-D_iXML2C.js +0 -203
  402. package/dist/admin/chunks/sk-D_iXML2C.js.map +0 -1
  403. package/dist/admin/chunks/sk-tn_BDjE2.js +0 -198
  404. package/dist/admin/chunks/sk-tn_BDjE2.js.map +0 -1
  405. package/dist/admin/chunks/sv-BstBC1Yp.js +0 -203
  406. package/dist/admin/chunks/sv-BstBC1Yp.js.map +0 -1
  407. package/dist/admin/chunks/sv-cq4ZrQRd.js +0 -198
  408. package/dist/admin/chunks/sv-cq4ZrQRd.js.map +0 -1
  409. package/dist/admin/chunks/th-lXoOCqPC.js +0 -149
  410. package/dist/admin/chunks/th-lXoOCqPC.js.map +0 -1
  411. package/dist/admin/chunks/th-mUH7hEtc.js +0 -144
  412. package/dist/admin/chunks/th-mUH7hEtc.js.map +0 -1
  413. package/dist/admin/chunks/tr-CkS6sLIE.js +0 -200
  414. package/dist/admin/chunks/tr-CkS6sLIE.js.map +0 -1
  415. package/dist/admin/chunks/tr-Yt38daxh.js +0 -195
  416. package/dist/admin/chunks/tr-Yt38daxh.js.map +0 -1
  417. package/dist/admin/chunks/uk-B24MoTVg.js +0 -145
  418. package/dist/admin/chunks/uk-B24MoTVg.js.map +0 -1
  419. package/dist/admin/chunks/uk-Cpgmm7gE.js +0 -140
  420. package/dist/admin/chunks/uk-Cpgmm7gE.js.map +0 -1
  421. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js +0 -247
  422. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js.map +0 -1
  423. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js +0 -271
  424. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js.map +0 -1
  425. package/dist/admin/chunks/usePrev-CwGzb4ed.js +0 -38
  426. package/dist/admin/chunks/usePrev-CwGzb4ed.js.map +0 -1
  427. package/dist/admin/chunks/usePrev-tlgK0qPG.js +0 -34
  428. package/dist/admin/chunks/usePrev-tlgK0qPG.js.map +0 -1
  429. package/dist/admin/chunks/vi-BGr1X_HZ.js +0 -112
  430. package/dist/admin/chunks/vi-BGr1X_HZ.js.map +0 -1
  431. package/dist/admin/chunks/vi-CvBGlTjr.js +0 -108
  432. package/dist/admin/chunks/zh-BmF-sHaT.js +0 -205
  433. package/dist/admin/chunks/zh-BmF-sHaT.js.map +0 -1
  434. package/dist/admin/chunks/zh-DwFu_Kfj.js +0 -210
  435. package/dist/admin/chunks/zh-DwFu_Kfj.js.map +0 -1
  436. package/dist/admin/chunks/zh-Hans-CI0HKio3.js +0 -934
  437. package/dist/admin/chunks/zh-Hans-JVK9x7xr.js +0 -953
@@ -1,955 +0,0 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import * as React from 'react';
3
- import { useNotification, useField, Form, InputRenderer, useForm, Layouts, BackButton } from '@strapi/admin/strapi-admin';
4
- import { Modal, Flex, Grid, Button, IconButton, Typography, Box, Menu, useComposedRefs, Link, Main, Divider } from '@strapi/design-system';
5
- import { generateNKeysBetween as generateNKeysBetween$1 } from 'fractional-indexing';
6
- import pipe from 'lodash/fp/pipe';
7
- import { useIntl } from 'react-intl';
8
- import { a as useGetInitialDataQuery, E as ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD, z as capitalise, g as getTranslation } from './index-DfEfFmQC.js';
9
- import { Plus, Drag, Pencil, Cross, Cog } from '@strapi/icons';
10
- import { getEmptyImage } from 'react-dnd-html5-backend';
11
- import { NavLink } from 'react-router-dom';
12
- import { styled } from 'styled-components';
13
- import { u as useDragAndDrop, I as ItemTypes } from './useDragAndDrop-HYwNDExe.js';
14
- import { C as ComponentIcon } from './ComponentIcon-BZcTc4rj.js';
15
- import * as yup from 'yup';
16
- import { F as FieldTypeIcon } from './FieldTypeIcon-BY6MrVF4.js';
17
-
18
- /* -------------------------------------------------------------------------------------------------
19
- * Constants
20
- * -----------------------------------------------------------------------------------------------*/ const FIELD_SCHEMA = yup.object().shape({
21
- label: yup.string().required().nullable(),
22
- description: yup.string(),
23
- editable: yup.boolean(),
24
- size: yup.number().required()
25
- });
26
- const EditFieldForm = ({ attribute, name, onClose })=>{
27
- const { formatMessage } = useIntl();
28
- const { toggleNotification } = useNotification();
29
- const { value, onChange } = useField(name);
30
- const { data: mainFieldOptions } = useGetInitialDataQuery(undefined, {
31
- selectFromResult: (res)=>{
32
- if (attribute?.type !== 'relation' || !res.data) {
33
- return {
34
- data: []
35
- };
36
- }
37
- if ('targetModel' in attribute && typeof attribute.targetModel === 'string') {
38
- const targetSchema = res.data.contentTypes.find((schema)=>schema.uid === attribute.targetModel);
39
- if (targetSchema) {
40
- return {
41
- data: Object.entries(targetSchema.attributes).reduce((acc, [key, attribute])=>{
42
- /**
43
- * Create the list of attributes from the schema as to which can
44
- * be our `mainField` and dictate the display name of the schema
45
- * we're editing.
46
- */ if (!ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD.includes(attribute.type)) {
47
- acc.push({
48
- label: key,
49
- value: key
50
- });
51
- }
52
- return acc;
53
- }, [])
54
- };
55
- }
56
- }
57
- return {
58
- data: []
59
- };
60
- },
61
- skip: attribute?.type !== 'relation'
62
- });
63
- if (!value || value.name === TEMP_FIELD_NAME || !attribute) {
64
- // This is very unlikely to happen, but it ensures the form is not opened without a value.
65
- console.error("You've opened a field to edit without it being part of the form, this is likely a bug with Strapi. Please open an issue.");
66
- toggleNotification({
67
- message: formatMessage({
68
- id: 'content-manager.containers.edit-settings.modal-form.error',
69
- defaultMessage: 'An error occurred while trying to open the form.'
70
- }),
71
- type: 'danger'
72
- });
73
- return null;
74
- }
75
- return /*#__PURE__*/ jsx(Modal.Content, {
76
- children: /*#__PURE__*/ jsxs(Form, {
77
- method: "PUT",
78
- initialValues: value,
79
- validationSchema: FIELD_SCHEMA,
80
- onSubmit: (data)=>{
81
- onChange(name, data);
82
- onClose();
83
- },
84
- children: [
85
- /*#__PURE__*/ jsx(Modal.Header, {
86
- children: /*#__PURE__*/ jsxs(Flex, {
87
- gap: 3,
88
- children: [
89
- /*#__PURE__*/ jsx(FieldTypeIcon, {
90
- type: attribute.type
91
- }),
92
- /*#__PURE__*/ jsx(Modal.Title, {
93
- children: formatMessage({
94
- id: 'content-manager.containers.edit-settings.modal-form.label',
95
- defaultMessage: 'Edit {fieldName}'
96
- }, {
97
- fieldName: capitalise(value.name)
98
- })
99
- })
100
- ]
101
- })
102
- }),
103
- /*#__PURE__*/ jsx(Modal.Body, {
104
- children: /*#__PURE__*/ jsx(Grid.Root, {
105
- gap: 4,
106
- children: [
107
- {
108
- name: 'label',
109
- label: formatMessage({
110
- id: getTranslation('containers.edit-settings.modal-form.label'),
111
- defaultMessage: 'Label'
112
- }),
113
- size: 6,
114
- type: 'string'
115
- },
116
- {
117
- name: 'description',
118
- label: formatMessage({
119
- id: getTranslation('containers.edit-settings.modal-form.description'),
120
- defaultMessage: 'Description'
121
- }),
122
- size: 6,
123
- type: 'string'
124
- },
125
- {
126
- name: 'placeholder',
127
- label: formatMessage({
128
- id: getTranslation('containers.edit-settings.modal-form.placeholder'),
129
- defaultMessage: 'Placeholder'
130
- }),
131
- size: 6,
132
- type: 'string'
133
- },
134
- {
135
- name: 'editable',
136
- label: formatMessage({
137
- id: getTranslation('containers.edit-settings.modal-form.editable'),
138
- defaultMessage: 'Editable'
139
- }),
140
- size: 6,
141
- type: 'boolean'
142
- },
143
- {
144
- name: 'mainField',
145
- label: formatMessage({
146
- id: getTranslation('containers.edit-settings.modal-form.mainField'),
147
- defaultMessage: 'Entry title'
148
- }),
149
- hint: formatMessage({
150
- id: getTranslation('containers.SettingPage.edit-settings.modal-form.mainField.hint'),
151
- defaultMessage: 'Set the displayed field'
152
- }),
153
- size: 6,
154
- options: mainFieldOptions,
155
- type: 'enumeration'
156
- },
157
- {
158
- name: 'size',
159
- label: formatMessage({
160
- id: getTranslation('containers.ListSettingsView.modal-form.size'),
161
- defaultMessage: 'Size'
162
- }),
163
- size: 6,
164
- options: [
165
- {
166
- value: '4',
167
- label: '33%'
168
- },
169
- {
170
- value: '6',
171
- label: '50%'
172
- },
173
- {
174
- value: '8',
175
- label: '66%'
176
- },
177
- {
178
- value: '12',
179
- label: '100%'
180
- }
181
- ],
182
- type: 'enumeration'
183
- }
184
- ].filter(filterFieldsBasedOnAttributeType(attribute.type)).map(({ size, ...field })=>/*#__PURE__*/ jsx(Grid.Item, {
185
- col: size,
186
- direction: "column",
187
- alignItems: "stretch",
188
- children: /*#__PURE__*/ jsx(InputRenderer, {
189
- ...field
190
- })
191
- }, field.name))
192
- })
193
- }),
194
- /*#__PURE__*/ jsxs(Modal.Footer, {
195
- children: [
196
- /*#__PURE__*/ jsx(Modal.Close, {
197
- children: /*#__PURE__*/ jsx(Button, {
198
- variant: "tertiary",
199
- children: formatMessage({
200
- id: 'app.components.Button.cancel',
201
- defaultMessage: 'Cancel'
202
- })
203
- })
204
- }),
205
- /*#__PURE__*/ jsx(Button, {
206
- type: "submit",
207
- children: formatMessage({
208
- id: 'global.finish',
209
- defaultMessage: 'Finish'
210
- })
211
- })
212
- ]
213
- })
214
- ]
215
- })
216
- });
217
- };
218
- /**
219
- * @internal
220
- * @description not all edit fields have the same editable properties, it depends on the type
221
- * e.g. a dynamic zone can only change it's label.
222
- */ const filterFieldsBasedOnAttributeType = (type)=>(field)=>{
223
- switch(type){
224
- case 'blocks':
225
- case 'richtext':
226
- return field.name !== 'size' && field.name !== 'mainField';
227
- case 'boolean':
228
- case 'media':
229
- return field.name !== 'placeholder' && field.name !== 'mainField';
230
- case 'component':
231
- case 'dynamiczone':
232
- return field.name === 'label' || field.name === 'editable';
233
- case 'json':
234
- return field.name !== 'placeholder' && field.name !== 'mainField' && field.name !== 'size';
235
- case 'relation':
236
- return true;
237
- default:
238
- return field.name !== 'mainField';
239
- }
240
- };
241
-
242
- const Fields = ({ attributes, fieldSizes, components, metadatas = {} })=>{
243
- const { formatMessage } = useIntl();
244
- const layout = useForm('Fields', (state)=>state.values.layout ?? []);
245
- const onChange = useForm('Fields', (state)=>state.onChange);
246
- const addFieldRow = useForm('Fields', (state)=>state.addFieldRow);
247
- const removeFieldRow = useForm('Fields', (state)=>state.removeFieldRow);
248
- const existingFields = layout.map((row)=>row.children.map((field)=>field.name)).flat();
249
- /**
250
- * Get the fields that are not already in the layout
251
- * But also check that they are visible before we give users
252
- * the option to display them. e.g. `id` is not visible.
253
- */ const remainingFields = Object.entries(metadatas).reduce((acc, current)=>{
254
- const [name, { visible, ...field }] = current;
255
- if (!existingFields.includes(name) && visible === true) {
256
- const type = attributes[name]?.type;
257
- const size = type ? fieldSizes[type] : 12;
258
- acc.push({
259
- ...field,
260
- label: field.label ?? name,
261
- name,
262
- size
263
- });
264
- }
265
- return acc;
266
- }, []);
267
- const handleMoveField = ([newRowIndex, newFieldIndex], [currentRowIndex, currentFieldIndex])=>{
268
- /**
269
- * Because this view has the constraint that the sum of field sizes cannot be greater
270
- * than 12, we don't use the form's method to move field rows, instead, we calculate
271
- * the new layout and set the entire form.
272
- */ const newLayout = structuredClone(layout);
273
- /**
274
- * Remove field from the current layout space using splice so we have the item
275
- */ const [field] = newLayout[currentRowIndex].children.splice(currentFieldIndex, 1);
276
- if (!field || field.name === TEMP_FIELD_NAME) {
277
- return;
278
- }
279
- const newRow = newLayout[newRowIndex].children;
280
- const [newFieldKey] = generateNKeysBetween(newRow, 1, currentFieldIndex, newFieldIndex);
281
- /**
282
- * Next we inject the field into it's new row at it's specified index, we then remove the spaces
283
- * if they exist and recalculate into potentially two arrays ONLY if the sizing is now over 12,
284
- * the row and the rest of the row that couldn't fit.
285
- *
286
- * for example, if i have a row of `[{size: 4}, {size: 6}]` and i add `{size: 8}` a index 0,
287
- * the new array will look like `[{size: 8}, {size: 4}, {size: 6}]` which breaks the limit of 12,
288
- * so instead we make two arrays for the new rows `[[{size: 8}, {size: 4}], [{size: 6}]]` which we
289
- * then inject at the original row point with spacers included.
290
- */ newRow.splice(newFieldIndex, 0, {
291
- ...field,
292
- __temp_key__: newFieldKey
293
- });
294
- if (newLayout[newRowIndex].children.reduce((acc, curr)=>acc + curr.size, 0) > 12) {
295
- const recalculatedRows = chunkArray(newLayout[newRowIndex].children.filter((field)=>field.name !== TEMP_FIELD_NAME));
296
- const rowKeys = generateNKeysBetween(newLayout, recalculatedRows.length, currentRowIndex, newRowIndex);
297
- newLayout.splice(newRowIndex, 1, ...recalculatedRows.map((row, index)=>({
298
- __temp_key__: rowKeys[index],
299
- children: row
300
- })));
301
- }
302
- /**
303
- * Now we remove our spacers from the rows so we can understand what dead rows exist:
304
- * - if there's only spacers left
305
- * - there's nothing in the row, e.g. a size 12 field left it.
306
- * These rows are then filtered out.
307
- * After that, we recalculate the spacers for the rows that need them.
308
- */ const newLayoutWithSpacers = newLayout.map((row)=>({
309
- ...row,
310
- children: row.children.filter((field)=>field.name !== TEMP_FIELD_NAME)
311
- })).filter((row)=>row.children.length > 0).map((row)=>{
312
- const totalSpaceTaken = row.children.reduce((acc, curr)=>acc + curr.size, 0);
313
- if (totalSpaceTaken < 12) {
314
- const [spacerKey] = generateNKeysBetween$1(row.children.at(-1)?.__temp_key__, undefined, 1);
315
- return {
316
- ...row,
317
- children: [
318
- ...row.children,
319
- {
320
- name: TEMP_FIELD_NAME,
321
- size: 12 - totalSpaceTaken,
322
- __temp_key__: spacerKey
323
- }
324
- ]
325
- };
326
- }
327
- return row;
328
- });
329
- onChange('layout', newLayoutWithSpacers);
330
- };
331
- const handleRemoveField = (rowIndex, fieldIndex)=>()=>{
332
- if (layout[rowIndex].children.length === 1) {
333
- removeFieldRow(`layout`, rowIndex);
334
- } else {
335
- onChange(`layout.${rowIndex}.children`, [
336
- ...layout[rowIndex].children.slice(0, fieldIndex),
337
- ...layout[rowIndex].children.slice(fieldIndex + 1)
338
- ]);
339
- }
340
- };
341
- const handleAddField = (field)=>()=>{
342
- addFieldRow('layout', {
343
- children: [
344
- field
345
- ]
346
- });
347
- };
348
- return /*#__PURE__*/ jsxs(Flex, {
349
- paddingTop: 6,
350
- direction: "column",
351
- alignItems: "stretch",
352
- gap: 4,
353
- children: [
354
- /*#__PURE__*/ jsxs(Flex, {
355
- alignItems: "flex-start",
356
- direction: "column",
357
- justifyContent: "space-between",
358
- children: [
359
- /*#__PURE__*/ jsx(Typography, {
360
- fontWeight: "bold",
361
- children: formatMessage({
362
- id: getTranslation('containers.list.displayedFields'),
363
- defaultMessage: 'Displayed fields'
364
- })
365
- }),
366
- /*#__PURE__*/ jsx(Typography, {
367
- variant: "pi",
368
- textColor: "neutral600",
369
- children: formatMessage({
370
- id: 'containers.SettingPage.editSettings.description',
371
- defaultMessage: 'Drag & drop the fields to build the layout'
372
- })
373
- })
374
- ]
375
- }),
376
- /*#__PURE__*/ jsx(Box, {
377
- padding: 4,
378
- hasRadius: true,
379
- borderStyle: "dashed",
380
- borderWidth: "1px",
381
- borderColor: "neutral300",
382
- children: /*#__PURE__*/ jsxs(Flex, {
383
- direction: "column",
384
- alignItems: "stretch",
385
- gap: 2,
386
- children: [
387
- layout.map((row, rowIndex)=>/*#__PURE__*/ jsx(Grid.Root, {
388
- gap: 2,
389
- children: row.children.map(({ size, ...field }, fieldIndex)=>/*#__PURE__*/ jsx(Grid.Item, {
390
- col: size,
391
- direction: "column",
392
- alignItems: "stretch",
393
- children: /*#__PURE__*/ jsx(Field, {
394
- attribute: attributes[field.name],
395
- components: components,
396
- index: [
397
- rowIndex,
398
- fieldIndex
399
- ],
400
- name: `layout.${rowIndex}.children.${fieldIndex}`,
401
- onMoveField: handleMoveField,
402
- onRemoveField: handleRemoveField(rowIndex, fieldIndex)
403
- })
404
- }, field.name))
405
- }, row.__temp_key__)),
406
- /*#__PURE__*/ jsxs(Menu.Root, {
407
- children: [
408
- /*#__PURE__*/ jsx(Menu.Trigger, {
409
- startIcon: /*#__PURE__*/ jsx(Plus, {}),
410
- endIcon: null,
411
- disabled: remainingFields.length === 0,
412
- fullWidth: true,
413
- variant: "secondary",
414
- children: formatMessage({
415
- id: getTranslation('containers.SettingPage.add.field'),
416
- defaultMessage: 'Insert another field'
417
- })
418
- }),
419
- /*#__PURE__*/ jsx(Menu.Content, {
420
- children: remainingFields.map((field)=>/*#__PURE__*/ jsx(Menu.Item, {
421
- onSelect: handleAddField(field),
422
- children: field.label
423
- }, field.name))
424
- })
425
- ]
426
- })
427
- ]
428
- })
429
- })
430
- ]
431
- });
432
- };
433
- /**
434
- * @internal
435
- * @description Small abstraction to solve within an array of fields where you can
436
- * add a field to the beginning or start, move back and forth what it's index range
437
- * should be when calculating it's new temp key
438
- */ const generateNKeysBetween = (field, count, currInd, newInd)=>{
439
- const startKey = currInd > newInd ? field[newInd - 1]?.__temp_key__ : field[newInd]?.__temp_key__;
440
- const endKey = currInd > newInd ? field[newInd]?.__temp_key__ : field[newInd + 1]?.__temp_key__;
441
- return generateNKeysBetween$1(startKey, endKey, count);
442
- };
443
- /**
444
- * @internal
445
- * @description chunks a row of layouts by the max size we allow, 12. It does not add the
446
- * spacers again, that should be added separately.
447
- */ const chunkArray = (array)=>{
448
- const result = [];
449
- let temp = [];
450
- array.reduce((acc, field)=>{
451
- if (acc + field.size > 12) {
452
- result.push(temp);
453
- temp = [
454
- field
455
- ];
456
- return field.size;
457
- } else {
458
- temp.push(field);
459
- return acc + field.size;
460
- }
461
- }, 0);
462
- if (temp.length > 0) {
463
- result.push(temp);
464
- }
465
- return result;
466
- };
467
- const TEMP_FIELD_NAME = '_TEMP_';
468
- /**
469
- * Displays a field in the layout with drag options, also
470
- * opens a modal to edit the details of said field.
471
- */ const Field = ({ attribute, components, name, index, onMoveField, onRemoveField })=>{
472
- const [isModalOpen, setIsModalOpen] = React.useState(false);
473
- const { formatMessage } = useIntl();
474
- const { value } = useField(name);
475
- const [{ isDragging }, objectRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop(true, {
476
- dropSensitivity: 'immediate',
477
- type: ItemTypes.EDIT_FIELD,
478
- item: {
479
- index,
480
- label: value?.label,
481
- name
482
- },
483
- index,
484
- onMoveItem: onMoveField
485
- });
486
- React.useEffect(()=>{
487
- dragPreviewRef(getEmptyImage(), {
488
- captureDraggingState: false
489
- });
490
- }, [
491
- dragPreviewRef
492
- ]);
493
- const composedRefs = useComposedRefs(dragRef, objectRef);
494
- const handleRemoveField = (e)=>{
495
- e.preventDefault();
496
- e.stopPropagation();
497
- onRemoveField(e);
498
- };
499
- const onEditFieldMeta = (e)=>{
500
- e.preventDefault();
501
- e.stopPropagation();
502
- setIsModalOpen(true);
503
- };
504
- const tempRefs = useComposedRefs(dropRef, objectRef);
505
- if (!value) {
506
- return null;
507
- }
508
- if (value.name === TEMP_FIELD_NAME) {
509
- return /*#__PURE__*/ jsx(Flex, {
510
- tag: "span",
511
- height: "100%",
512
- style: {
513
- opacity: 0
514
- },
515
- ref: tempRefs
516
- });
517
- }
518
- return /*#__PURE__*/ jsxs(Modal.Root, {
519
- open: isModalOpen,
520
- onOpenChange: setIsModalOpen,
521
- children: [
522
- /*#__PURE__*/ jsxs(Flex, {
523
- borderColor: "neutral150",
524
- background: "neutral100",
525
- hasRadius: true,
526
- style: {
527
- opacity: isDragging ? 0.5 : 1
528
- },
529
- ref: dropRef,
530
- gap: 3,
531
- cursor: "pointer",
532
- onClick: ()=>{
533
- setIsModalOpen(true);
534
- },
535
- children: [
536
- /*#__PURE__*/ jsx(DragButton, {
537
- tag: "span",
538
- withTooltip: false,
539
- label: formatMessage({
540
- id: getTranslation('components.DraggableCard.move.field'),
541
- defaultMessage: 'Move {item}'
542
- }, {
543
- item: value.label
544
- }),
545
- onClick: (e)=>e.stopPropagation(),
546
- ref: composedRefs,
547
- children: /*#__PURE__*/ jsx(Drag, {})
548
- }),
549
- /*#__PURE__*/ jsxs(Flex, {
550
- direction: "column",
551
- alignItems: "flex-start",
552
- grow: 1,
553
- overflow: "hidden",
554
- children: [
555
- /*#__PURE__*/ jsxs(Flex, {
556
- gap: 3,
557
- justifyContent: "space-between",
558
- width: "100%",
559
- children: [
560
- /*#__PURE__*/ jsx(Typography, {
561
- ellipsis: true,
562
- fontWeight: "bold",
563
- children: value.label
564
- }),
565
- /*#__PURE__*/ jsxs(Flex, {
566
- children: [
567
- /*#__PURE__*/ jsx(IconButton, {
568
- type: "button",
569
- variant: "ghost",
570
- background: "transparent",
571
- onClick: onEditFieldMeta,
572
- withTooltip: false,
573
- label: formatMessage({
574
- id: getTranslation('components.DraggableCard.edit.field'),
575
- defaultMessage: 'Edit {item}'
576
- }, {
577
- item: value.label
578
- }),
579
- children: /*#__PURE__*/ jsx(Pencil, {})
580
- }),
581
- /*#__PURE__*/ jsx(IconButton, {
582
- type: "button",
583
- variant: "ghost",
584
- onClick: handleRemoveField,
585
- background: "transparent",
586
- withTooltip: false,
587
- label: formatMessage({
588
- id: getTranslation('components.DraggableCard.delete.field'),
589
- defaultMessage: 'Delete {item}'
590
- }, {
591
- item: value.label
592
- }),
593
- children: /*#__PURE__*/ jsx(Cross, {})
594
- })
595
- ]
596
- })
597
- ]
598
- }),
599
- attribute?.type === 'component' ? /*#__PURE__*/ jsxs(Flex, {
600
- paddingTop: 3,
601
- paddingRight: 3,
602
- paddingBottom: 3,
603
- paddingLeft: 0,
604
- alignItems: "flex-start",
605
- direction: "column",
606
- gap: 2,
607
- width: "100%",
608
- children: [
609
- /*#__PURE__*/ jsx(Grid.Root, {
610
- gap: 4,
611
- width: "100%",
612
- children: components[attribute.component].layout.map((row)=>row.map(({ size, ...field })=>/*#__PURE__*/ jsx(Grid.Item, {
613
- col: size,
614
- direction: "column",
615
- alignItems: "stretch",
616
- children: /*#__PURE__*/ jsx(Flex, {
617
- alignItems: "center",
618
- background: "neutral0",
619
- paddingTop: 2,
620
- paddingBottom: 2,
621
- paddingLeft: 3,
622
- paddingRight: 3,
623
- hasRadius: true,
624
- borderColor: "neutral200",
625
- children: /*#__PURE__*/ jsx(Typography, {
626
- textColor: "neutral800",
627
- children: field.name
628
- })
629
- })
630
- }, field.name)))
631
- }),
632
- /*#__PURE__*/ jsx(Link, {
633
- // used to stop the edit form from appearing when we click here.
634
- onClick: (e)=>e.stopPropagation(),
635
- startIcon: /*#__PURE__*/ jsx(Cog, {}),
636
- tag: NavLink,
637
- to: `../components/${attribute.component}/configurations/edit`,
638
- children: formatMessage({
639
- id: getTranslation('components.FieldItem.linkToComponentLayout'),
640
- defaultMessage: "Set the component's layout"
641
- })
642
- })
643
- ]
644
- }) : null,
645
- attribute?.type === 'dynamiczone' ? /*#__PURE__*/ jsx(Flex, {
646
- paddingTop: 3,
647
- paddingRight: 3,
648
- paddingBottom: 3,
649
- paddingLeft: 0,
650
- alignItems: "flex-start",
651
- gap: 2,
652
- width: "100%",
653
- children: attribute?.components.map((uid)=>/*#__PURE__*/ jsxs(ComponentLink, {
654
- // used to stop the edit form from appearing when we click here.
655
- onClick: (e)=>e.stopPropagation(),
656
- to: `../components/${uid}/configurations/edit`,
657
- children: [
658
- /*#__PURE__*/ jsx(ComponentIcon, {
659
- icon: components[uid].settings.icon
660
- }),
661
- /*#__PURE__*/ jsx(Typography, {
662
- fontSize: 1,
663
- textColor: "neutral600",
664
- fontWeight: "bold",
665
- children: components[uid].settings.displayName
666
- })
667
- ]
668
- }, uid))
669
- }) : null
670
- ]
671
- })
672
- ]
673
- }),
674
- value.name !== TEMP_FIELD_NAME && /*#__PURE__*/ jsx(EditFieldForm, {
675
- attribute: attribute,
676
- name: name,
677
- onClose: ()=>setIsModalOpen(false)
678
- })
679
- ]
680
- });
681
- };
682
- const DragButton = styled(IconButton)`
683
- height: unset;
684
- align-self: stretch;
685
- display: flex;
686
- align-items: center;
687
- padding: 0;
688
- border: none;
689
- background-color: transparent;
690
- border-radius: 0px;
691
- border-right: 1px solid ${({ theme })=>theme.colors.neutral150};
692
- cursor: all-scroll;
693
-
694
- svg {
695
- width: 1.2rem;
696
- height: 1.2rem;
697
- }
698
- `;
699
- const ComponentLink = styled(NavLink)`
700
- display: flex;
701
- flex-direction: column;
702
- align-items: center;
703
- gap: ${({ theme })=>theme.spaces[1]};
704
- padding: ${(props)=>props.theme.spaces[2]};
705
- border: 1px solid ${({ theme })=>theme.colors.neutral200};
706
- background: ${({ theme })=>theme.colors.neutral0};
707
- width: 14rem;
708
- border-radius: ${({ theme })=>theme.borderRadius};
709
- text-decoration: none;
710
-
711
- &:focus,
712
- &:hover {
713
- ${({ theme })=>`
714
- background-color: ${theme.colors.primary100};
715
- border-color: ${theme.colors.primary200};
716
-
717
- ${Typography} {
718
- color: ${theme.colors.primary600};
719
- }
720
- `}
721
-
722
- /* > ComponentIcon */
723
- > div:first-child {
724
- background: ${({ theme })=>theme.colors.primary200};
725
- color: ${({ theme })=>theme.colors.primary600};
726
-
727
- svg {
728
- path {
729
- fill: ${({ theme })=>theme.colors.primary600};
730
- }
731
- }
732
- }
733
- }
734
- `;
735
-
736
- const ConfigurationForm = ({ attributes, fieldSizes, layout: editLayout, onSubmit })=>{
737
- const { components, settings, layout, metadatas } = editLayout;
738
- const { formatMessage } = useIntl();
739
- const initialValues = React.useMemo(()=>{
740
- const transformations = pipe(flattenPanels, replaceMainFieldWithNameOnly, extractMetadata, addTmpSpaceToLayout, addTmpKeysToLayout);
741
- return {
742
- layout: transformations(layout),
743
- settings
744
- };
745
- }, [
746
- layout,
747
- settings
748
- ]);
749
- return /*#__PURE__*/ jsx(Layouts.Root, {
750
- children: /*#__PURE__*/ jsx(Main, {
751
- children: /*#__PURE__*/ jsxs(Form, {
752
- initialValues: initialValues,
753
- onSubmit: onSubmit,
754
- method: "PUT",
755
- children: [
756
- /*#__PURE__*/ jsx(Header, {
757
- name: settings.displayName ?? ''
758
- }),
759
- /*#__PURE__*/ jsx(Layouts.Content, {
760
- children: /*#__PURE__*/ jsxs(Flex, {
761
- alignItems: "stretch",
762
- background: "neutral0",
763
- direction: "column",
764
- gap: 6,
765
- hasRadius: true,
766
- shadow: "tableShadow",
767
- paddingTop: 6,
768
- paddingBottom: 6,
769
- paddingLeft: 7,
770
- paddingRight: 7,
771
- children: [
772
- /*#__PURE__*/ jsx(Typography, {
773
- variant: "delta",
774
- tag: "h2",
775
- children: formatMessage({
776
- id: getTranslation('containers.SettingPage.settings'),
777
- defaultMessage: 'Settings'
778
- })
779
- }),
780
- /*#__PURE__*/ jsxs(Grid.Root, {
781
- children: [
782
- /*#__PURE__*/ jsx(Grid.Item, {
783
- col: 6,
784
- s: 12,
785
- direction: "column",
786
- alignItems: "stretch",
787
- children: /*#__PURE__*/ jsx(InputRenderer, {
788
- type: "enumeration",
789
- label: formatMessage({
790
- id: getTranslation('containers.SettingPage.editSettings.entry.title'),
791
- defaultMessage: 'Entry title'
792
- }),
793
- hint: formatMessage({
794
- id: getTranslation('containers.SettingPage.editSettings.entry.title.description'),
795
- defaultMessage: 'Set the display field of your entry'
796
- }),
797
- name: "settings.mainField",
798
- options: Object.entries(attributes).reduce((acc, [key, attribute])=>{
799
- if (!attribute) {
800
- return acc;
801
- }
802
- /**
803
- * Create the list of attributes from the schema as to which can
804
- * be our `mainField` and dictate the display name of the schema
805
- * we're editing.
806
- */ if (!ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD.includes(attribute.type)) {
807
- acc.push({
808
- label: key,
809
- value: key
810
- });
811
- }
812
- return acc;
813
- }, [])
814
- })
815
- }),
816
- /*#__PURE__*/ jsx(Grid.Item, {
817
- paddingTop: 6,
818
- paddingBottom: 6,
819
- col: 12,
820
- s: 12,
821
- direction: "column",
822
- alignItems: "stretch",
823
- children: /*#__PURE__*/ jsx(Divider, {})
824
- }),
825
- /*#__PURE__*/ jsx(Grid.Item, {
826
- col: 12,
827
- s: 12,
828
- direction: "column",
829
- alignItems: "stretch",
830
- children: /*#__PURE__*/ jsx(Typography, {
831
- variant: "delta",
832
- tag: "h3",
833
- children: formatMessage({
834
- id: getTranslation('containers.SettingPage.view'),
835
- defaultMessage: 'View'
836
- })
837
- })
838
- }),
839
- /*#__PURE__*/ jsx(Grid.Item, {
840
- col: 12,
841
- s: 12,
842
- direction: "column",
843
- alignItems: "stretch",
844
- children: /*#__PURE__*/ jsx(Fields, {
845
- attributes: attributes,
846
- components: components,
847
- fieldSizes: fieldSizes,
848
- metadatas: metadatas
849
- })
850
- })
851
- ]
852
- })
853
- ]
854
- })
855
- })
856
- ]
857
- })
858
- })
859
- });
860
- };
861
- /**
862
- * @internal
863
- * @description Panels don't exist in the layout, so we flatten by one.
864
- */ const flattenPanels = (layout)=>layout.flat(1);
865
- /**
866
- * @internal
867
- * @description We don't need the mainField object in the layout, we only need the name.
868
- */ const replaceMainFieldWithNameOnly = (layout)=>layout.map((row)=>row.map((field)=>({
869
- ...field,
870
- mainField: field.mainField?.name
871
- })));
872
- /**
873
- * @internal
874
- * @description We extract the metadata values from the field layout, because these are editable by the user.
875
- */ const extractMetadata = (layout)=>{
876
- return layout.map((row)=>row.map(({ label, disabled, hint, placeholder, size, name, mainField })=>({
877
- label,
878
- editable: !disabled,
879
- description: hint,
880
- mainField,
881
- placeholder,
882
- size,
883
- name,
884
- __temp_key__: ''
885
- })));
886
- };
887
- /**
888
- * @internal
889
- * @description Each row of the layout has a max size of 12 (based on bootstrap grid system)
890
- * So in order to offer a better drop zone we add the _TEMP_ div to complete the remaining substract (12 - existing)
891
- */ const addTmpSpaceToLayout = (layout)=>[
892
- ...layout.map((row)=>{
893
- const totalSpaceTaken = row.reduce((acc, field)=>acc + field.size, 0);
894
- if (totalSpaceTaken < 12) {
895
- return [
896
- ...row,
897
- {
898
- name: TEMP_FIELD_NAME,
899
- size: 12 - totalSpaceTaken,
900
- __temp_key__: ''
901
- }
902
- ];
903
- }
904
- return row;
905
- })
906
- ];
907
- /**
908
- * @internal
909
- * @description At this point of the transformations we have Field[][], but each row for the form should have a __temp_key__
910
- * applied. This means we need to change it so `Field` is nested under the children property.
911
- */ const addTmpKeysToLayout = (layout)=>{
912
- const keys = generateNKeysBetween$1(undefined, undefined, layout.length);
913
- return layout.map((row, rowIndex)=>{
914
- const fieldKeys = generateNKeysBetween$1(undefined, undefined, row.length);
915
- return {
916
- __temp_key__: keys[rowIndex],
917
- children: row.map((field, fieldIndex)=>{
918
- return {
919
- ...field,
920
- __temp_key__: fieldKeys[fieldIndex]
921
- };
922
- })
923
- };
924
- });
925
- };
926
- const Header = ({ name })=>{
927
- const { formatMessage } = useIntl();
928
- const modified = useForm('Header', (state)=>state.modified);
929
- const isSubmitting = useForm('Header', (state)=>state.isSubmitting);
930
- return /*#__PURE__*/ jsx(Layouts.Header, {
931
- title: formatMessage({
932
- id: getTranslation('components.SettingsViewWrapper.pluginHeader.title'),
933
- defaultMessage: `Configure the view - {name}`
934
- }, {
935
- name: capitalise(name)
936
- }),
937
- subtitle: formatMessage({
938
- id: getTranslation('components.SettingsViewWrapper.pluginHeader.description.edit-settings'),
939
- defaultMessage: 'Customize how the edit view will look like.'
940
- }),
941
- navigationAction: /*#__PURE__*/ jsx(BackButton, {}),
942
- primaryAction: /*#__PURE__*/ jsx(Button, {
943
- disabled: !modified,
944
- loading: isSubmitting,
945
- type: "submit",
946
- children: formatMessage({
947
- id: 'global.save',
948
- defaultMessage: 'Save'
949
- })
950
- })
951
- });
952
- };
953
-
954
- export { ConfigurationForm as C, TEMP_FIELD_NAME as T };
955
- //# sourceMappingURL=Form-CX_f1AUZ.js.map