@strapi/content-manager 0.0.0-experimental.3c73a4c6f6073abdf1608121a200c3d4d87b1aa8 → 0.0.0-experimental.3d5794391d4c2d9eddf7bd162c02f4bb836eb7a6

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 (210) hide show
  1. package/LICENSE +18 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-BZIaEffq.js → ComponentConfigurationPage-Cjr64OS0.js} +4 -4
  3. package/dist/_chunks/{ComponentConfigurationPage-BZIaEffq.js.map → ComponentConfigurationPage-Cjr64OS0.js.map} +1 -1
  4. package/dist/_chunks/{ComponentConfigurationPage-Cxz51Sve.mjs → ComponentConfigurationPage-DKuCF_uX.mjs} +4 -4
  5. package/dist/_chunks/{ComponentConfigurationPage-Cxz51Sve.mjs.map → ComponentConfigurationPage-DKuCF_uX.mjs.map} +1 -1
  6. package/dist/_chunks/{EditConfigurationPage-CM62NN0L.js → EditConfigurationPage-BeikGxvq.js} +4 -4
  7. package/dist/_chunks/{EditConfigurationPage-CM62NN0L.js.map → EditConfigurationPage-BeikGxvq.js.map} +1 -1
  8. package/dist/_chunks/{EditConfigurationPage-CZLbgfIp.mjs → EditConfigurationPage-CyqSP6ru.mjs} +4 -4
  9. package/dist/_chunks/{EditConfigurationPage-CZLbgfIp.mjs.map → EditConfigurationPage-CyqSP6ru.mjs.map} +1 -1
  10. package/dist/_chunks/{EditViewPage-CzuJgWWp.mjs → EditViewPage-PrPHZN_9.mjs} +102 -51
  11. package/dist/_chunks/EditViewPage-PrPHZN_9.mjs.map +1 -0
  12. package/dist/_chunks/{EditViewPage-CU7724gt.js → EditViewPage-pyqEgLgP.js} +100 -49
  13. package/dist/_chunks/EditViewPage-pyqEgLgP.js.map +1 -0
  14. package/dist/_chunks/{Field-QtUSh5mU.mjs → Field-DuAYQka5.mjs} +600 -228
  15. package/dist/_chunks/Field-DuAYQka5.mjs.map +1 -0
  16. package/dist/_chunks/{Field-Dh1yZyqy.js → Field-fKtb7rWK.js} +602 -230
  17. package/dist/_chunks/Field-fKtb7rWK.js.map +1 -0
  18. package/dist/_chunks/{Form-BOR8NOe1.js → Form-BPXw-S-J.js} +52 -34
  19. package/dist/_chunks/Form-BPXw-S-J.js.map +1 -0
  20. package/dist/_chunks/{Form-COLpvlnv.mjs → Form-Dxh71ckp.mjs} +54 -36
  21. package/dist/_chunks/Form-Dxh71ckp.mjs.map +1 -0
  22. package/dist/_chunks/{History-CW2akQ6h.js → History-BGGn9JGY.js} +171 -126
  23. package/dist/_chunks/History-BGGn9JGY.js.map +1 -0
  24. package/dist/_chunks/{History-Bu53Yfw-.mjs → History-CGblSVMc.mjs} +172 -127
  25. package/dist/_chunks/History-CGblSVMc.mjs.map +1 -0
  26. package/dist/_chunks/{ListConfigurationPage-jzdhEk_u.js → ListConfigurationPage-D3Avyi4t.js} +58 -47
  27. package/dist/_chunks/ListConfigurationPage-D3Avyi4t.js.map +1 -0
  28. package/dist/_chunks/{ListConfigurationPage-TqrmwjPN.mjs → ListConfigurationPage-TIM0JveM.mjs} +59 -49
  29. package/dist/_chunks/ListConfigurationPage-TIM0JveM.mjs.map +1 -0
  30. package/dist/_chunks/{ListViewPage-BO_mOXIl.mjs → ListViewPage-C975eW-t.mjs} +128 -105
  31. package/dist/_chunks/ListViewPage-C975eW-t.mjs.map +1 -0
  32. package/dist/_chunks/{ListViewPage-B3bMOrMv.js → ListViewPage-DtAHWFMV.js} +130 -107
  33. package/dist/_chunks/ListViewPage-DtAHWFMV.js.map +1 -0
  34. package/dist/_chunks/{NoContentTypePage-D77xsNHj.js → NoContentTypePage-BFjWZX0i.js} +2 -2
  35. package/dist/_chunks/{NoContentTypePage-D77xsNHj.js.map → NoContentTypePage-BFjWZX0i.js.map} +1 -1
  36. package/dist/_chunks/{NoContentTypePage-DqB0QV0k.mjs → NoContentTypePage-SgNTVGjF.mjs} +2 -2
  37. package/dist/_chunks/{NoContentTypePage-DqB0QV0k.mjs.map → NoContentTypePage-SgNTVGjF.mjs.map} +1 -1
  38. package/dist/_chunks/{NoPermissionsPage-DTXi042N.mjs → NoPermissionsPage-D4XYRoPf.mjs} +2 -2
  39. package/dist/_chunks/{NoPermissionsPage-DTXi042N.mjs.map → NoPermissionsPage-D4XYRoPf.mjs.map} +1 -1
  40. package/dist/_chunks/{NoPermissionsPage-C6qTGogm.js → NoPermissionsPage-j7oulOpl.js} +2 -2
  41. package/dist/_chunks/{NoPermissionsPage-C6qTGogm.js.map → NoPermissionsPage-j7oulOpl.js.map} +1 -1
  42. package/dist/_chunks/Preview-Bx1WfmKJ.js +256 -0
  43. package/dist/_chunks/Preview-Bx1WfmKJ.js.map +1 -0
  44. package/dist/_chunks/Preview-Cy6fuAnd.mjs +237 -0
  45. package/dist/_chunks/Preview-Cy6fuAnd.mjs.map +1 -0
  46. package/dist/_chunks/{Relations-B6fb2POW.js → Relations-CXQqwRXC.js} +72 -36
  47. package/dist/_chunks/Relations-CXQqwRXC.js.map +1 -0
  48. package/dist/_chunks/{Relations-CJ4qdkRo.mjs → Relations-DUrYWw0N.mjs} +73 -37
  49. package/dist/_chunks/Relations-DUrYWw0N.mjs.map +1 -0
  50. package/dist/_chunks/{en-9GwRW_ku.mjs → en-69jRDM9j.mjs} +31 -17
  51. package/dist/_chunks/{en-9GwRW_ku.mjs.map → en-69jRDM9j.mjs.map} +1 -1
  52. package/dist/_chunks/{en-DZXjRiWA.js → en-DAgtrRoa.js} +31 -17
  53. package/dist/_chunks/{en-DZXjRiWA.js.map → en-DAgtrRoa.js.map} +1 -1
  54. package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
  55. package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
  56. package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
  57. package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
  58. package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
  59. package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
  60. package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
  61. package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
  62. package/dist/_chunks/{index-Dahjdw4h.mjs → index-Ta--2bRa.mjs} +1107 -883
  63. package/dist/_chunks/index-Ta--2bRa.mjs.map +1 -0
  64. package/dist/_chunks/{index-DcUu-_72.js → index-_j7lH3CO.js} +1099 -874
  65. package/dist/_chunks/index-_j7lH3CO.js.map +1 -0
  66. package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
  67. package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
  68. package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
  69. package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
  70. package/dist/_chunks/{layout-jcY4dyUG.js → layout-BDwU2I_y.js} +25 -12
  71. package/dist/_chunks/layout-BDwU2I_y.js.map +1 -0
  72. package/dist/_chunks/{layout-omucV6TV.mjs → layout-C8H4oKDo.mjs} +27 -14
  73. package/dist/_chunks/layout-C8H4oKDo.mjs.map +1 -0
  74. package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
  75. package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
  76. package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
  77. package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
  78. package/dist/_chunks/{relations-DGzD7ORa.js → relations-CPfMNzM6.js} +6 -7
  79. package/dist/_chunks/relations-CPfMNzM6.js.map +1 -0
  80. package/dist/_chunks/{relations-CN0-aw6p.mjs → relations-Ch70q86O.mjs} +6 -7
  81. package/dist/_chunks/relations-Ch70q86O.mjs.map +1 -0
  82. package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
  83. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  84. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  85. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  86. package/dist/admin/index.js +2 -1
  87. package/dist/admin/index.js.map +1 -1
  88. package/dist/admin/index.mjs +4 -3
  89. package/dist/admin/src/exports.d.ts +1 -1
  90. package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
  91. package/dist/admin/src/history/index.d.ts +3 -0
  92. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  93. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  94. package/dist/admin/src/index.d.ts +1 -0
  95. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  96. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +8 -3
  97. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
  98. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
  99. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
  100. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
  101. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  102. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +6 -58
  103. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  104. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  105. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  106. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  107. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  108. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  109. package/dist/admin/src/preview/constants.d.ts +1 -0
  110. package/dist/admin/src/preview/index.d.ts +4 -0
  111. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  112. package/dist/admin/src/preview/routes.d.ts +3 -0
  113. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  114. package/dist/admin/src/router.d.ts +1 -1
  115. package/dist/admin/src/services/api.d.ts +1 -1
  116. package/dist/admin/src/services/components.d.ts +2 -2
  117. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  118. package/dist/admin/src/services/documents.d.ts +19 -17
  119. package/dist/admin/src/services/init.d.ts +1 -1
  120. package/dist/admin/src/services/relations.d.ts +2 -2
  121. package/dist/admin/src/services/uid.d.ts +3 -3
  122. package/dist/admin/src/utils/validation.d.ts +4 -1
  123. package/dist/server/index.js +551 -263
  124. package/dist/server/index.js.map +1 -1
  125. package/dist/server/index.mjs +552 -264
  126. package/dist/server/index.mjs.map +1 -1
  127. package/dist/server/src/bootstrap.d.ts.map +1 -1
  128. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  129. package/dist/server/src/controllers/index.d.ts.map +1 -1
  130. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  131. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  132. package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
  133. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  134. package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
  135. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
  136. package/dist/server/src/history/services/history.d.ts.map +1 -1
  137. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  138. package/dist/server/src/history/services/utils.d.ts +4 -4
  139. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  140. package/dist/server/src/index.d.ts +4 -4
  141. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  142. package/dist/server/src/preview/constants.d.ts +2 -0
  143. package/dist/server/src/preview/constants.d.ts.map +1 -0
  144. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  145. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  146. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  147. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  148. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  149. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  150. package/dist/server/src/preview/index.d.ts +4 -0
  151. package/dist/server/src/preview/index.d.ts.map +1 -0
  152. package/dist/server/src/preview/routes/index.d.ts +8 -0
  153. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  154. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  155. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  156. package/dist/server/src/preview/services/index.d.ts +15 -0
  157. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  158. package/dist/server/src/preview/services/preview-config.d.ts +30 -0
  159. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  160. package/dist/server/src/preview/services/preview.d.ts +12 -0
  161. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  162. package/dist/server/src/preview/utils.d.ts +18 -0
  163. package/dist/server/src/preview/utils.d.ts.map +1 -0
  164. package/dist/server/src/routes/index.d.ts.map +1 -1
  165. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  166. package/dist/server/src/services/document-metadata.d.ts +8 -8
  167. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  168. package/dist/server/src/services/index.d.ts +4 -4
  169. package/dist/server/src/services/index.d.ts.map +1 -1
  170. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  171. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  172. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  173. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  174. package/dist/server/src/utils/index.d.ts +2 -0
  175. package/dist/server/src/utils/index.d.ts.map +1 -1
  176. package/dist/shared/contracts/collection-types.d.ts +3 -1
  177. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  178. package/dist/shared/contracts/index.d.ts +1 -0
  179. package/dist/shared/contracts/index.d.ts.map +1 -1
  180. package/dist/shared/contracts/preview.d.ts +27 -0
  181. package/dist/shared/contracts/preview.d.ts.map +1 -0
  182. package/dist/shared/index.js +4 -0
  183. package/dist/shared/index.js.map +1 -1
  184. package/dist/shared/index.mjs +4 -0
  185. package/dist/shared/index.mjs.map +1 -1
  186. package/package.json +14 -14
  187. package/dist/_chunks/EditViewPage-CU7724gt.js.map +0 -1
  188. package/dist/_chunks/EditViewPage-CzuJgWWp.mjs.map +0 -1
  189. package/dist/_chunks/Field-Dh1yZyqy.js.map +0 -1
  190. package/dist/_chunks/Field-QtUSh5mU.mjs.map +0 -1
  191. package/dist/_chunks/Form-BOR8NOe1.js.map +0 -1
  192. package/dist/_chunks/Form-COLpvlnv.mjs.map +0 -1
  193. package/dist/_chunks/History-Bu53Yfw-.mjs.map +0 -1
  194. package/dist/_chunks/History-CW2akQ6h.js.map +0 -1
  195. package/dist/_chunks/ListConfigurationPage-TqrmwjPN.mjs.map +0 -1
  196. package/dist/_chunks/ListConfigurationPage-jzdhEk_u.js.map +0 -1
  197. package/dist/_chunks/ListViewPage-B3bMOrMv.js.map +0 -1
  198. package/dist/_chunks/ListViewPage-BO_mOXIl.mjs.map +0 -1
  199. package/dist/_chunks/Relations-B6fb2POW.js.map +0 -1
  200. package/dist/_chunks/Relations-CJ4qdkRo.mjs.map +0 -1
  201. package/dist/_chunks/index-Dahjdw4h.mjs.map +0 -1
  202. package/dist/_chunks/index-DcUu-_72.js.map +0 -1
  203. package/dist/_chunks/layout-jcY4dyUG.js.map +0 -1
  204. package/dist/_chunks/layout-omucV6TV.mjs.map +0 -1
  205. package/dist/_chunks/relations-CN0-aw6p.mjs.map +0 -1
  206. package/dist/_chunks/relations-DGzD7ORa.js.map +0 -1
  207. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  208. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  209. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  210. package/strapi-server.js +0 -3
@@ -5,19 +5,19 @@ const strapiAdmin = require("@strapi/admin/strapi-admin");
5
5
  const designSystem = require("@strapi/design-system");
6
6
  const pipe$1 = require("lodash/fp/pipe");
7
7
  const reactIntl = require("react-intl");
8
- const index = require("./index-DcUu-_72.js");
8
+ const index = require("./index-_j7lH3CO.js");
9
9
  const fractionalIndexing = require("fractional-indexing");
10
- const Relations = require("./Relations-B6fb2POW.js");
10
+ const Relations = require("./Relations-CXQqwRXC.js");
11
11
  const Icons = require("@strapi/icons");
12
12
  const styledComponents = require("styled-components");
13
13
  const ComponentIcon = require("./ComponentIcon-BXdiCGQp.js");
14
14
  const reactDndHtml5Backend = require("react-dnd-html5-backend");
15
15
  const useDragAndDrop = require("./useDragAndDrop-J0TUUbR6.js");
16
- const objects = require("./objects-gigeqt7s.js");
16
+ const objects = require("./objects-BcXOv6_9.js");
17
17
  const slate = require("slate");
18
18
  const slateHistory = require("slate-history");
19
19
  const slateReact = require("slate-react");
20
- const usePrev = require("./usePrev-B9w_-eYc.js");
20
+ const useDebounce = require("./useDebounce-CtcjDB3L.js");
21
21
  const Toolbar = require("@radix-ui/react-toolbar");
22
22
  const reactRouterDom = require("react-router-dom");
23
23
  const CodeMirror = require("codemirror5");
@@ -194,6 +194,220 @@ const useLazyComponents = (componentUids = []) => {
194
194
  }, []);
195
195
  return { isLazyLoading: loading, lazyComponentStore, cleanup };
196
196
  };
197
+ const codeLanguages = [
198
+ {
199
+ value: "asm",
200
+ label: "Assembly"
201
+ },
202
+ {
203
+ value: "bash",
204
+ label: "Bash"
205
+ },
206
+ {
207
+ value: "c",
208
+ label: "C"
209
+ },
210
+ {
211
+ value: "clojure",
212
+ label: "Clojure"
213
+ },
214
+ {
215
+ value: "cobol",
216
+ label: "COBOL"
217
+ },
218
+ {
219
+ value: "cpp",
220
+ label: "C++"
221
+ },
222
+ {
223
+ value: "csharp",
224
+ label: "C#"
225
+ },
226
+ {
227
+ value: "css",
228
+ label: "CSS"
229
+ },
230
+ {
231
+ value: "dart",
232
+ label: "Dart"
233
+ },
234
+ {
235
+ value: "dockerfile",
236
+ label: "Dockerfile"
237
+ },
238
+ {
239
+ value: "elixir",
240
+ label: "Elixir"
241
+ },
242
+ {
243
+ value: "erlang",
244
+ label: "Erlang"
245
+ },
246
+ {
247
+ value: "fortran",
248
+ label: "Fortran"
249
+ },
250
+ {
251
+ value: "fsharp",
252
+ label: "F#"
253
+ },
254
+ {
255
+ value: "go",
256
+ label: "Go"
257
+ },
258
+ {
259
+ value: "graphql",
260
+ label: "GraphQL"
261
+ },
262
+ {
263
+ value: "groovy",
264
+ label: "Groovy"
265
+ },
266
+ {
267
+ value: "haskell",
268
+ label: "Haskell"
269
+ },
270
+ {
271
+ value: "haxe",
272
+ label: "Haxe"
273
+ },
274
+ {
275
+ value: "html",
276
+ label: "HTML"
277
+ },
278
+ {
279
+ value: "ini",
280
+ label: "INI"
281
+ },
282
+ {
283
+ value: "java",
284
+ label: "Java"
285
+ },
286
+ {
287
+ value: "javascript",
288
+ label: "JavaScript"
289
+ },
290
+ {
291
+ value: "jsx",
292
+ label: "JavaScript (React)"
293
+ },
294
+ {
295
+ value: "json",
296
+ label: "JSON"
297
+ },
298
+ {
299
+ value: "julia",
300
+ label: "Julia"
301
+ },
302
+ {
303
+ value: "kotlin",
304
+ label: "Kotlin"
305
+ },
306
+ {
307
+ value: "latex",
308
+ label: "LaTeX"
309
+ },
310
+ {
311
+ value: "lua",
312
+ label: "Lua"
313
+ },
314
+ {
315
+ value: "markdown",
316
+ label: "Markdown"
317
+ },
318
+ {
319
+ value: "matlab",
320
+ label: "MATLAB"
321
+ },
322
+ {
323
+ value: "makefile",
324
+ label: "Makefile"
325
+ },
326
+ {
327
+ value: "objectivec",
328
+ label: "Objective-C"
329
+ },
330
+ {
331
+ value: "perl",
332
+ label: "Perl"
333
+ },
334
+ {
335
+ value: "php",
336
+ label: "PHP"
337
+ },
338
+ {
339
+ value: "plaintext",
340
+ label: "Plain text"
341
+ },
342
+ {
343
+ value: "powershell",
344
+ label: "PowerShell"
345
+ },
346
+ {
347
+ value: "python",
348
+ label: "Python"
349
+ },
350
+ {
351
+ value: "r",
352
+ label: "R"
353
+ },
354
+ {
355
+ value: "ruby",
356
+ label: "Ruby"
357
+ },
358
+ {
359
+ value: "rust",
360
+ label: "Rust"
361
+ },
362
+ {
363
+ value: "sas",
364
+ label: "SAS"
365
+ },
366
+ {
367
+ value: "scala",
368
+ label: "Scala"
369
+ },
370
+ {
371
+ value: "scheme",
372
+ label: "Scheme"
373
+ },
374
+ {
375
+ value: "shell",
376
+ label: "Shell"
377
+ },
378
+ {
379
+ value: "sql",
380
+ label: "SQL"
381
+ },
382
+ {
383
+ value: "stata",
384
+ label: "Stata"
385
+ },
386
+ {
387
+ value: "swift",
388
+ label: "Swift"
389
+ },
390
+ {
391
+ value: "typescript",
392
+ label: "TypeScript"
393
+ },
394
+ {
395
+ value: "tsx",
396
+ label: "TypeScript (React)"
397
+ },
398
+ {
399
+ value: "vbnet",
400
+ label: "VB.NET"
401
+ },
402
+ {
403
+ value: "xml",
404
+ label: "XML"
405
+ },
406
+ {
407
+ value: "yaml",
408
+ label: "YAML"
409
+ }
410
+ ];
197
411
  const baseHandleConvert = (editor, attributesToSet) => {
198
412
  const [_, lastNodePath] = slate.Editor.last(editor, []);
199
413
  slate.Transforms.unwrapNodes(editor, {
@@ -264,6 +478,7 @@ const CodeBlock = styledComponents.styled.pre`
264
478
  overflow: auto;
265
479
  padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};
266
480
  flex-shrink: 1;
481
+
267
482
  & > code {
268
483
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas,
269
484
  monospace;
@@ -272,9 +487,61 @@ const CodeBlock = styledComponents.styled.pre`
272
487
  max-width: 100%;
273
488
  }
274
489
  `;
490
+ const CodeEditor = (props) => {
491
+ const { editor } = useBlocksEditorContext("ImageDialog");
492
+ const editorIsFocused = slateReact.useFocused();
493
+ const imageIsSelected = slateReact.useSelected();
494
+ const { formatMessage } = reactIntl.useIntl();
495
+ const [isSelectOpen, setIsSelectOpen] = React__namespace.useState(false);
496
+ const shouldDisplayLanguageSelect = editorIsFocused && imageIsSelected || isSelectOpen;
497
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { position: "relative", width: "100%", children: [
498
+ /* @__PURE__ */ jsxRuntime.jsx(CodeBlock, { ...props.attributes, children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: props.children }) }),
499
+ shouldDisplayLanguageSelect && /* @__PURE__ */ jsxRuntime.jsx(
500
+ designSystem.Box,
501
+ {
502
+ position: "absolute",
503
+ background: "neutral0",
504
+ borderColor: "neutral150",
505
+ borderStyle: "solid",
506
+ borderWidth: "0.5px",
507
+ shadow: "tableShadow",
508
+ top: "100%",
509
+ marginTop: 1,
510
+ right: 0,
511
+ padding: 1,
512
+ hasRadius: true,
513
+ children: /* @__PURE__ */ jsxRuntime.jsx(
514
+ designSystem.SingleSelect,
515
+ {
516
+ onChange: (open) => {
517
+ slate.Transforms.setNodes(
518
+ editor,
519
+ { language: open.toString() },
520
+ { match: (node) => !slate.Editor.isEditor(node) && node.type === "code" }
521
+ );
522
+ },
523
+ value: props.element.type === "code" && props.element.language || "plaintext",
524
+ onOpenChange: (open) => {
525
+ setIsSelectOpen(open);
526
+ if (!open) {
527
+ slateReact.ReactEditor.focus(editor);
528
+ }
529
+ },
530
+ onCloseAutoFocus: (e) => e.preventDefault(),
531
+ "aria-label": formatMessage({
532
+ id: "components.Blocks.blocks.code.languageLabel",
533
+ defaultMessage: "Select a language"
534
+ }),
535
+ children: codeLanguages.map(({ value, label }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value, children: label }, value))
536
+ }
537
+ )
538
+ }
539
+ )
540
+ ] });
541
+ };
275
542
  const codeBlocks = {
276
543
  code: {
277
- renderElement: (props) => /* @__PURE__ */ jsxRuntime.jsx(CodeBlock, { ...props.attributes, children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: props.children }) }),
544
+ renderElement: (props) => /* @__PURE__ */ jsxRuntime.jsx(CodeEditor, { ...props }),
278
545
  icon: Icons.Code,
279
546
  label: {
280
547
  id: "components.Blocks.blocks.code",
@@ -283,7 +550,7 @@ const codeBlocks = {
283
550
  matchNode: (node) => node.type === "code",
284
551
  isInBlocksSelector: true,
285
552
  handleConvert(editor) {
286
- baseHandleConvert(editor, { type: "code" });
553
+ baseHandleConvert(editor, { type: "code", language: "plaintext" });
287
554
  },
288
555
  handleEnterKey(editor) {
289
556
  pressEnterTwiceToExit(editor);
@@ -501,7 +768,7 @@ const ImageDialog = () => {
501
768
  const nodeImage = {
502
769
  ...expectedImage,
503
770
  alternativeText: expectedImage.alternativeText || expectedImage.name,
504
- url: usePrev.prefixFileUrlWithBackendUrl(image.url)
771
+ url: useDebounce.prefixFileUrlWithBackendUrl(image.url)
505
772
  };
506
773
  return nodeImage;
507
774
  });
@@ -623,18 +890,12 @@ const LinkContent = React__namespace.forwardRef(
623
890
  const [popoverOpen, setPopoverOpen] = React__namespace.useState(
624
891
  editor.lastInsertedLinkPath ? slate.Path.equals(path, editor.lastInsertedLinkPath) : false
625
892
  );
626
- const linkRef = React__namespace.useRef(null);
627
893
  const elementText = link.children.map((child) => child.text).join("");
628
894
  const [linkText, setLinkText] = React__namespace.useState(elementText);
629
895
  const [linkUrl, setLinkUrl] = React__namespace.useState(link.url);
630
896
  const linkInputRef = React__namespace.useRef(null);
631
- const [showRemoveButton, setShowRemoveButton] = React__namespace.useState(false);
897
+ const isLastInsertedLink = editor.lastInsertedLinkPath ? !slate.Path.equals(path, editor.lastInsertedLinkPath) : true;
632
898
  const [isSaveDisabled, setIsSaveDisabled] = React__namespace.useState(false);
633
- const handleOpenEditPopover = (e) => {
634
- e.preventDefault();
635
- setPopoverOpen(true);
636
- setShowRemoveButton(true);
637
- };
638
899
  const onLinkChange = (e) => {
639
900
  setIsSaveDisabled(false);
640
901
  setLinkUrl(e.target.value);
@@ -655,33 +916,33 @@ const LinkContent = React__namespace.forwardRef(
655
916
  editLink(editor, { url: linkUrl, text: linkText });
656
917
  setPopoverOpen(false);
657
918
  editor.lastInsertedLinkPath = null;
919
+ slateReact.ReactEditor.focus(editor);
658
920
  };
659
- const handleDismiss = () => {
660
- setPopoverOpen(false);
921
+ const handleClose = () => {
661
922
  if (link.url === "") {
662
923
  removeLink(editor);
663
924
  }
925
+ setPopoverOpen(false);
664
926
  slateReact.ReactEditor.focus(editor);
665
927
  };
666
- const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
667
- const composedRefs = designSystem.useComposedRefs(linkRef, forwardedRef);
668
928
  React__namespace.useEffect(() => {
669
929
  if (popoverOpen)
670
930
  linkInputRef.current?.focus();
671
931
  }, [popoverOpen]);
672
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
673
- /* @__PURE__ */ jsxRuntime.jsx(
932
+ const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
933
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { open: popoverOpen, children: [
934
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
674
935
  StyledBaseLink,
675
936
  {
676
937
  ...attributes,
677
- ref: composedRefs,
938
+ ref: forwardedRef,
678
939
  href: link.url,
679
- onClick: handleOpenEditPopover,
940
+ onClick: () => setPopoverOpen(true),
680
941
  color: "primary600",
681
942
  children
682
943
  }
683
- ),
684
- popoverOpen && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover, { source: linkRef, onDismiss: handleDismiss, padding: 4, contentEditable: false, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "form", onSubmit: handleSave, direction: "column", gap: 4, children: [
944
+ ) }),
945
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { onPointerDownOutside: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 4, direction: "column", gap: 4, children: [
685
946
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { width: "368px", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
686
947
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
687
948
  id: "components.Blocks.popover.text",
@@ -727,7 +988,7 @@ const LinkContent = React__namespace.forwardRef(
727
988
  {
728
989
  variant: "danger-light",
729
990
  onClick: () => removeLink(editor),
730
- $visible: showRemoveButton,
991
+ $visible: isLastInsertedLink,
731
992
  children: formatMessage({
732
993
  id: "components.Blocks.popover.remove",
733
994
  defaultMessage: "Remove"
@@ -735,11 +996,11 @@ const LinkContent = React__namespace.forwardRef(
735
996
  }
736
997
  ),
737
998
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
738
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: handleDismiss, children: formatMessage({
999
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
739
1000
  id: "components.Blocks.popover.cancel",
740
1001
  defaultMessage: "Cancel"
741
1002
  }) }),
742
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { type: "submit", disabled: Boolean(inputNotDirty) || isSaveDisabled, children: formatMessage({
1003
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
743
1004
  id: "components.Blocks.popover.save",
744
1005
  defaultMessage: "Save"
745
1006
  }) })
@@ -1180,7 +1441,7 @@ const ToolbarButton = ({
1180
1441
  width: 7,
1181
1442
  height: 7,
1182
1443
  hasRadius: true,
1183
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { width: "1.2rem", height: "1.2rem", fill: disabled ? "neutral300" : enabledColor })
1444
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
1184
1445
  }
1185
1446
  )
1186
1447
  }
@@ -1325,6 +1586,26 @@ const ListButton = ({ block, format }) => {
1325
1586
  }
1326
1587
  return false;
1327
1588
  };
1589
+ const isListDisabled = () => {
1590
+ if (disabled) {
1591
+ return true;
1592
+ }
1593
+ if (!editor.selection) {
1594
+ return false;
1595
+ }
1596
+ const anchorNodeEntry = slate.Editor.above(editor, {
1597
+ at: editor.selection.anchor,
1598
+ match: (node) => !slate.Editor.isEditor(node) && node.type !== "text"
1599
+ });
1600
+ const focusNodeEntry = slate.Editor.above(editor, {
1601
+ at: editor.selection.focus,
1602
+ match: (node) => !slate.Editor.isEditor(node) && node.type !== "text"
1603
+ });
1604
+ if (!anchorNodeEntry || !focusNodeEntry) {
1605
+ return false;
1606
+ }
1607
+ return anchorNodeEntry[0] !== focusNodeEntry[0];
1608
+ };
1328
1609
  const toggleList = (format2) => {
1329
1610
  let currentListEntry;
1330
1611
  if (editor.selection) {
@@ -1358,7 +1639,7 @@ const ListButton = ({ block, format }) => {
1358
1639
  name: format,
1359
1640
  label: block.label,
1360
1641
  isActive: isListActive(),
1361
- disabled,
1642
+ disabled: isListDisabled(),
1362
1643
  handleClick: () => toggleList(format)
1363
1644
  }
1364
1645
  );
@@ -1502,6 +1783,7 @@ const DragItem = styledComponents.styled(designSystem.Flex)`
1502
1783
  }
1503
1784
  `;
1504
1785
  const DragIconButton = styledComponents.styled(designSystem.IconButton)`
1786
+ user-select: none;
1505
1787
  display: flex;
1506
1788
  align-items: center;
1507
1789
  justify-content: center;
@@ -1525,7 +1807,7 @@ const DragIconButton = styledComponents.styled(designSystem.IconButton)`
1525
1807
  }
1526
1808
  svg {
1527
1809
  height: auto;
1528
- width: ${({ theme }) => theme.spaces[3]};
1810
+ min-width: ${({ theme }) => theme.spaces[3]};
1529
1811
 
1530
1812
  path {
1531
1813
  fill: ${({ theme }) => theme.colors.neutral700};
@@ -1630,6 +1912,7 @@ const DragAndDropElement = ({
1630
1912
  DragIconButton,
1631
1913
  {
1632
1914
  tag: "div",
1915
+ contentEditable: false,
1633
1916
  role: "button",
1634
1917
  tabIndex: 0,
1635
1918
  withTooltip: false,
@@ -1642,7 +1925,7 @@ const DragAndDropElement = ({
1642
1925
  disabled,
1643
1926
  draggable: true,
1644
1927
  $dragHandleTopMargin: dragHandleTopMargin,
1645
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, { color: "neutral600" })
1928
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, { color: "primary500" })
1646
1929
  }
1647
1930
  ),
1648
1931
  children
@@ -1966,7 +2249,7 @@ const EditorLayout$1 = ({
1966
2249
  /* @__PURE__ */ jsxRuntime.jsx(
1967
2250
  CollapseIconButton,
1968
2251
  {
1969
- "aria-label": formatMessage({
2252
+ label: formatMessage({
1970
2253
  id: index.getTranslation("components.Blocks.collapse"),
1971
2254
  defaultMessage: "Collapse"
1972
2255
  }),
@@ -2305,7 +2588,7 @@ const BlocksEditor = React__namespace.forwardRef(
2305
2588
  !isExpandedMode && /* @__PURE__ */ jsxRuntime.jsx(
2306
2589
  ExpandIconButton,
2307
2590
  {
2308
- "aria-label": formatMessage({
2591
+ label: formatMessage({
2309
2592
  id: index.getTranslation("components.Blocks.expand"),
2310
2593
  defaultMessage: "Expand"
2311
2594
  }),
@@ -2371,30 +2654,27 @@ const createDefaultForm = (contentType, components = {}) => {
2371
2654
  const Initializer = ({ disabled, name: name2, onClick }) => {
2372
2655
  const { formatMessage } = reactIntl.useIntl();
2373
2656
  const field = strapiAdmin.useField(name2);
2374
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2375
- /* @__PURE__ */ jsxRuntime.jsx(
2376
- designSystem.Box,
2377
- {
2378
- tag: "button",
2379
- background: "neutral100",
2380
- borderColor: field.error ? "danger600" : "neutral200",
2381
- hasRadius: true,
2382
- disabled,
2383
- onClick,
2384
- paddingTop: 9,
2385
- paddingBottom: 9,
2386
- type: "button",
2387
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
2388
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(CircleIcon, {}) }),
2389
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
2390
- id: index.getTranslation("components.empty-repeatable"),
2391
- defaultMessage: "No entry yet. Click on the button below to add one."
2392
- }) }) })
2393
- ] })
2394
- }
2395
- ),
2396
- field.error && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", variant: "pi", children: field.error })
2397
- ] });
2657
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
2658
+ designSystem.Box,
2659
+ {
2660
+ tag: "button",
2661
+ background: "neutral100",
2662
+ borderColor: field.error ? "danger600" : "neutral200",
2663
+ hasRadius: true,
2664
+ disabled,
2665
+ onClick,
2666
+ paddingTop: 9,
2667
+ paddingBottom: 9,
2668
+ type: "button",
2669
+ children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
2670
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(CircleIcon, {}) }),
2671
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
2672
+ id: index.getTranslation("components.empty-repeatable"),
2673
+ defaultMessage: "No entry yet. Click to add one."
2674
+ }) }) })
2675
+ ] })
2676
+ }
2677
+ ) });
2398
2678
  };
2399
2679
  const CircleIcon = styledComponents.styled(Icons.PlusCircle)`
2400
2680
  width: 2.4rem;
@@ -2412,6 +2692,7 @@ const NonRepeatableComponent = ({
2412
2692
  children,
2413
2693
  layout
2414
2694
  }) => {
2695
+ const { formatMessage } = reactIntl.useIntl();
2415
2696
  const { value } = strapiAdmin.useField(name2);
2416
2697
  const level = Relations.useComponent("NonRepeatableComponent", (state) => state.level);
2417
2698
  const isNested = level > 0;
@@ -2426,9 +2707,24 @@ const NonRepeatableComponent = ({
2426
2707
  hasRadius: isNested,
2427
2708
  borderColor: isNested ? "neutral200" : void 0,
2428
2709
  children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index2) => {
2429
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: row.map(({ size, ...field }) => {
2710
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2430
2711
  const completeFieldName = `${name2}.${field.name}`;
2431
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2712
+ const translatedLabel = formatMessage({
2713
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2714
+ defaultMessage: field.label
2715
+ });
2716
+ return /* @__PURE__ */ jsxRuntime.jsx(
2717
+ designSystem.Grid.Item,
2718
+ {
2719
+ col: size,
2720
+ s: 12,
2721
+ xs: 12,
2722
+ direction: "column",
2723
+ alignItems: "stretch",
2724
+ children: children({ ...field, label: translatedLabel, name: completeFieldName })
2725
+ },
2726
+ completeFieldName
2727
+ );
2432
2728
  }) }, index2);
2433
2729
  }) })
2434
2730
  }
@@ -2447,13 +2743,34 @@ const RepeatableComponent = ({
2447
2743
  const { search: searchString } = reactRouterDom.useLocation();
2448
2744
  const search = React__namespace.useMemo(() => new URLSearchParams(searchString), [searchString]);
2449
2745
  const { components } = index.useDoc();
2450
- const { value = [], error } = strapiAdmin.useField(name2);
2746
+ const {
2747
+ value = [],
2748
+ error,
2749
+ rawError
2750
+ } = strapiAdmin.useField(name2);
2451
2751
  const addFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.addFieldRow);
2452
2752
  const moveFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.moveFieldRow);
2453
2753
  const removeFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.removeFieldRow);
2454
2754
  const { max = Infinity } = attribute;
2455
2755
  const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
2456
2756
  const [liveText, setLiveText] = React__namespace.useState("");
2757
+ React__namespace.useEffect(() => {
2758
+ const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
2759
+ const hasNestedValue = value && Array.isArray(value) && value.length > 0;
2760
+ if (hasNestedErrors && hasNestedValue) {
2761
+ const errorOpenItems = rawError.map((_, idx) => {
2762
+ return value[idx] ? value[idx].__temp_key__ : null;
2763
+ }).filter((value2) => !!value2);
2764
+ if (errorOpenItems && errorOpenItems.length > 0) {
2765
+ setCollapseToOpen((collapseToOpen2) => {
2766
+ if (!errorOpenItems.includes(collapseToOpen2)) {
2767
+ return errorOpenItems[0];
2768
+ }
2769
+ return collapseToOpen2;
2770
+ });
2771
+ }
2772
+ }
2773
+ }, [rawError, value]);
2457
2774
  const componentTmpKeyWithFocussedField = React__namespace.useMemo(() => {
2458
2775
  if (search.has("field")) {
2459
2776
  const fieldParam = search.get("field");
@@ -2468,7 +2785,7 @@ const RepeatableComponent = ({
2468
2785
  }
2469
2786
  return void 0;
2470
2787
  }, [search, name2, value]);
2471
- const prevValue = usePrev.usePrev(value);
2788
+ const prevValue = useDebounce.usePrev(value);
2472
2789
  React__namespace.useEffect(() => {
2473
2790
  if (prevValue && prevValue.length < value.length) {
2474
2791
  setCollapseToOpen(value[value.length - 1].__temp_key__);
@@ -2604,9 +2921,28 @@ const RepeatableComponent = ({
2604
2921
  onGrabItem: handleGrabItem,
2605
2922
  __temp_key__: key,
2606
2923
  children: layout.map((row, index22) => {
2607
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: row.map(({ size, ...field }) => {
2924
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2608
2925
  const completeFieldName = `${nameWithIndex}.${field.name}`;
2609
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2926
+ const translatedLabel = formatMessage({
2927
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2928
+ defaultMessage: field.label
2929
+ });
2930
+ return /* @__PURE__ */ jsxRuntime.jsx(
2931
+ designSystem.Grid.Item,
2932
+ {
2933
+ col: size,
2934
+ s: 12,
2935
+ xs: 12,
2936
+ direction: "column",
2937
+ alignItems: "stretch",
2938
+ children: children({
2939
+ ...field,
2940
+ label: translatedLabel,
2941
+ name: completeFieldName
2942
+ })
2943
+ },
2944
+ completeFieldName
2945
+ );
2610
2946
  }) }, index22);
2611
2947
  })
2612
2948
  }
@@ -2651,7 +2987,7 @@ const TextButtonCustom = styledComponents.styled(designSystem.TextButton)`
2651
2987
  }
2652
2988
 
2653
2989
  @media (prefers-reduced-motion: no-preference) {
2654
- transition: background-color 120ms ${(props) => props.theme.easings.easeOutQuad};
2990
+ transition: background-color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};
2655
2991
  }
2656
2992
  `;
2657
2993
  const Component = ({
@@ -2701,7 +3037,7 @@ const Component = ({
2701
3037
  /* @__PURE__ */ jsxRuntime.jsx(
2702
3038
  designSystem.IconButton,
2703
3039
  {
2704
- borderWidth: 0,
3040
+ variant: "ghost",
2705
3041
  onClick: onDeleteComponent,
2706
3042
  label: formatMessage({
2707
3043
  id: index.getTranslation("containers.Edit.delete"),
@@ -2714,7 +3050,7 @@ const Component = ({
2714
3050
  designSystem.IconButton,
2715
3051
  {
2716
3052
  ref: composedAccordionRefs,
2717
- borderWidth: 0,
3053
+ variant: "ghost",
2718
3054
  onClick: (e) => e.stopPropagation(),
2719
3055
  "data-handler-id": handlerId,
2720
3056
  label: formatMessage({
@@ -2784,7 +3120,7 @@ const ComponentInput = ({
2784
3120
  id: index.getTranslation("components.reset-entry"),
2785
3121
  defaultMessage: "Reset Entry"
2786
3122
  }),
2787
- borderWidth: 0,
3123
+ variant: "ghost",
2788
3124
  onClick: () => {
2789
3125
  field.onChange(name2, null);
2790
3126
  },
@@ -2813,11 +3149,8 @@ const AddComponentButton = ({
2813
3149
  onClick,
2814
3150
  disabled: isDisabled,
2815
3151
  background: "neutral0",
2816
- paddingTop: 3,
2817
- paddingBottom: 3,
2818
- paddingLeft: 4,
2819
- paddingRight: 4,
2820
3152
  style: { cursor: isDisabled ? "not-allowed" : "pointer" },
3153
+ variant: "tertiary",
2821
3154
  children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "span", gap: 2, children: [
2822
3155
  /* @__PURE__ */ jsxRuntime.jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
2823
3156
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2846,10 +3179,11 @@ const StyledAddIcon = styledComponents.styled(Icons.PlusCircle)`
2846
3179
  }
2847
3180
  `;
2848
3181
  const AddComponentTitle = styledComponents.styled(designSystem.Typography)``;
2849
- const StyledButton = styledComponents.styled(designSystem.BaseButton)`
3182
+ const StyledButton = styledComponents.styled(designSystem.Button)`
2850
3183
  border-radius: 26px;
2851
3184
  border-color: ${({ theme }) => theme.colors.neutral150};
2852
3185
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
3186
+ height: 5rem;
2853
3187
 
2854
3188
  &:hover {
2855
3189
  ${AddComponentTitle} {
@@ -2861,7 +3195,7 @@ const StyledButton = styledComponents.styled(designSystem.BaseButton)`
2861
3195
  fill: ${({ theme }) => theme.colors.primary600};
2862
3196
  }
2863
3197
  > path {
2864
- fill: ${({ theme }) => theme.colors.neutral100};
3198
+ fill: ${({ theme }) => theme.colors.primary600};
2865
3199
  }
2866
3200
  }
2867
3201
  }
@@ -2919,7 +3253,7 @@ const ComponentBox = styledComponents.styled(designSystem.Flex)`
2919
3253
  cursor: pointer;
2920
3254
 
2921
3255
  @media (prefers-reduced-motion: no-preference) {
2922
- transition: color 120ms ${(props) => props.theme.easings.easeOutQuad};
3256
+ transition: color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};
2923
3257
  }
2924
3258
 
2925
3259
  &:focus,
@@ -2992,18 +3326,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
2992
3326
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
2993
3327
  ] });
2994
3328
  };
2995
- function useDebounce(value, delay) {
2996
- const [debouncedValue, setDebouncedValue] = React.useState(value);
2997
- React.useEffect(() => {
2998
- const handler = setTimeout(() => {
2999
- setDebouncedValue(value);
3000
- }, delay);
3001
- return () => {
3002
- clearTimeout(handler);
3003
- };
3004
- }, [value, delay]);
3005
- return debouncedValue;
3006
- }
3007
3329
  const uidApi = index.contentManagerApi.injectEndpoints({
3008
3330
  endpoints: (builder) => ({
3009
3331
  getDefaultUID: builder.query({
@@ -3038,7 +3360,10 @@ const uidApi = index.contentManagerApi.injectEndpoints({
3038
3360
  config: {
3039
3361
  params
3040
3362
  }
3041
- })
3363
+ }),
3364
+ providesTags: (_res, _error, params) => [
3365
+ { type: "UidAvailability", id: params.contentTypeUID }
3366
+ ]
3042
3367
  })
3043
3368
  })
3044
3369
  });
@@ -3050,8 +3375,10 @@ const UIDInput = React__namespace.forwardRef(
3050
3375
  const allFormValues = strapiAdmin.useForm("InputUID", (form) => form.values);
3051
3376
  const [availability, setAvailability] = React__namespace.useState();
3052
3377
  const [showRegenerate, setShowRegenerate] = React__namespace.useState(false);
3378
+ const isCloning = reactRouterDom.useMatch(index.CLONE_PATH) !== null;
3053
3379
  const field = strapiAdmin.useField(name2);
3054
- const debouncedValue = useDebounce(field.value, 300);
3380
+ const debouncedValue = useDebounce.useDebounce(field.value, 300);
3381
+ const hasChanged = debouncedValue !== field.initialValue;
3055
3382
  const { toggleNotification } = strapiAdmin.useNotification();
3056
3383
  const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
3057
3384
  const { formatMessage } = reactIntl.useIntl();
@@ -3127,8 +3454,9 @@ const UIDInput = React__namespace.forwardRef(
3127
3454
  params
3128
3455
  },
3129
3456
  {
3457
+ // Don't check availability if the value is empty or wasn't changed
3130
3458
  skip: !Boolean(
3131
- debouncedValue !== field.initialValue && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3459
+ (hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3132
3460
  )
3133
3461
  }
3134
3462
  );
@@ -3157,6 +3485,7 @@ const UIDInput = React__namespace.forwardRef(
3157
3485
  const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
3158
3486
  const fieldRef = strapiAdmin.useFocusInputField(name2);
3159
3487
  const composedRefs = designSystem.useComposedRefs(ref, fieldRef);
3488
+ const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
3160
3489
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { hint, name: name2, error: field.error, required, children: [
3161
3490
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
3162
3491
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3165,7 +3494,7 @@ const UIDInput = React__namespace.forwardRef(
3165
3494
  ref: composedRefs,
3166
3495
  disabled: props.disabled,
3167
3496
  endAction: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { position: "relative", gap: 1, children: [
3168
- availability && !showRegenerate && /* @__PURE__ */ jsxRuntime.jsxs(
3497
+ shouldShowAvailability && /* @__PURE__ */ jsxRuntime.jsxs(
3169
3498
  TextValidation,
3170
3499
  {
3171
3500
  alignItems: "center",
@@ -3999,7 +4328,7 @@ const EditorLayout = ({
3999
4328
  justifyContent: "flex-end",
4000
4329
  shrink: 0,
4001
4330
  width: "100%",
4002
- children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, children: [
4331
+ children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
4003
4332
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
4004
4333
  id: "components.Wysiwyg.collapse",
4005
4334
  defaultMessage: "Collapse"
@@ -4017,12 +4346,14 @@ const EditorLayout = ({
4017
4346
  ) }) });
4018
4347
  }
4019
4348
  return /* @__PURE__ */ jsxRuntime.jsx(
4020
- designSystem.Box,
4349
+ designSystem.Flex,
4021
4350
  {
4022
4351
  borderColor: error ? "danger600" : "neutral200",
4023
4352
  borderStyle: "solid",
4024
4353
  borderWidth: "1px",
4025
4354
  hasRadius: true,
4355
+ direction: "column",
4356
+ alignItems: "stretch",
4026
4357
  children
4027
4358
  }
4028
4359
  );
@@ -4033,11 +4364,19 @@ const ExpandWrapper = styledComponents.styled(designSystem.Flex)`
4033
4364
  const BoxWithBorder = styledComponents.styled(designSystem.Box)`
4034
4365
  border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
4035
4366
  `;
4036
- const ExpandButton$1 = styledComponents.styled(designSystem.BaseButton)`
4367
+ const ExpandButton$1 = styledComponents.styled(designSystem.Button)`
4037
4368
  background-color: transparent;
4038
4369
  border: none;
4039
4370
  align-items: center;
4040
4371
 
4372
+ & > span {
4373
+ display: flex;
4374
+ justify-content: space-between;
4375
+ align-items: center;
4376
+ width: 100%;
4377
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4378
+ }
4379
+
4041
4380
  svg {
4042
4381
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4043
4382
 
@@ -4304,42 +4643,28 @@ const quoteAndCodeHandler = (editor, markdownType) => {
4304
4643
  insertWithoutTextToEdit(editor, markdownType, line, contentLength);
4305
4644
  }
4306
4645
  };
4307
- const CustomIconButton = styledComponents.styled(designSystem.IconButton)`
4308
- padding: ${({ theme }) => theme.spaces[2]};
4309
- /* Trick to prevent the outline from overflowing because of the general outline-offset */
4310
- outline-offset: -2px !important;
4311
-
4312
- svg {
4313
- width: 1.8rem;
4314
- height: 1.8rem;
4315
- }
4316
- `;
4317
- const CustomLinkIconButton = styledComponents.styled(CustomIconButton)`
4318
- svg {
4319
- width: 0.8rem;
4320
- height: 0.8rem;
4321
- }
4322
- `;
4323
4646
  const MainButtons = styledComponents.styled(designSystem.IconButtonGroup)`
4324
4647
  margin-left: ${({ theme }) => theme.spaces[4]};
4325
4648
  `;
4326
4649
  const MoreButton = styledComponents.styled(designSystem.IconButton)`
4327
4650
  margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
4328
- padding: ${({ theme }) => theme.spaces[2]};
4329
-
4330
- svg {
4331
- width: 1.8rem;
4332
- height: 1.8rem;
4333
- }
4334
4651
  `;
4335
4652
  const IconButtonGroupMargin = styledComponents.styled(designSystem.IconButtonGroup)`
4336
4653
  margin-right: ${({ theme }) => `${theme.spaces[2]}`};
4337
4654
  `;
4338
- const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
4655
+ const ExpandButton = styledComponents.styled(designSystem.Button)`
4339
4656
  background-color: transparent;
4340
4657
  border: none;
4341
4658
  align-items: center;
4342
4659
 
4660
+ & > span {
4661
+ display: flex;
4662
+ justify-content: space-between;
4663
+ align-items: center;
4664
+ width: 100%;
4665
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4666
+ }
4667
+
4343
4668
  svg {
4344
4669
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4345
4670
  path {
@@ -4351,8 +4676,8 @@ const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
4351
4676
  `;
4352
4677
  const WysiwygFooter = ({ onToggleExpand }) => {
4353
4678
  const { formatMessage } = reactIntl.useIntl();
4354
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, children: [
4355
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
4679
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, variant: "tertiary", size: "M", children: [
4680
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: formatMessage({
4356
4681
  id: "components.WysiwygBottomControls.fullscreen",
4357
4682
  defaultMessage: "Expand"
4358
4683
  }) }),
@@ -4374,7 +4699,7 @@ const WysiwygNav = ({
4374
4699
  id: "components.Wysiwyg.selectOptions.title",
4375
4700
  defaultMessage: "Add a title"
4376
4701
  });
4377
- const buttonMoreRef = React__namespace.useRef(null);
4702
+ React__namespace.useRef(null);
4378
4703
  const handleTogglePopover = () => {
4379
4704
  setVisiblePopover((prev) => !prev);
4380
4705
  };
@@ -4388,18 +4713,27 @@ const WysiwygNav = ({
4388
4713
  borderRadius: `0.4rem 0.4rem 0 0`,
4389
4714
  children: [
4390
4715
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
4391
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.SingleSelect, { disabled: true, placeholder: selectPlaceholder, "aria-label": selectPlaceholder, children: [
4392
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
4393
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
4394
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
4395
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
4396
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
4397
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
4398
- ] }) }),
4716
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
4717
+ designSystem.SingleSelect,
4718
+ {
4719
+ disabled: true,
4720
+ placeholder: selectPlaceholder,
4721
+ "aria-label": selectPlaceholder,
4722
+ size: "S",
4723
+ children: [
4724
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
4725
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
4726
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
4727
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
4728
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
4729
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
4730
+ ]
4731
+ }
4732
+ ) }),
4399
4733
  /* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
4400
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4401
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
4402
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
4734
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4735
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
4736
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
4403
4737
  ] }),
4404
4738
  /* @__PURE__ */ jsxRuntime.jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) })
4405
4739
  ] }),
@@ -4426,6 +4760,7 @@ const WysiwygNav = ({
4426
4760
  placeholder: selectPlaceholder,
4427
4761
  "aria-label": selectPlaceholder,
4428
4762
  onChange: (value) => onActionClick(value, editorRef),
4763
+ size: "S",
4429
4764
  children: [
4430
4765
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
4431
4766
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
@@ -4437,17 +4772,9 @@ const WysiwygNav = ({
4437
4772
  }
4438
4773
  ) }),
4439
4774
  /* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
4775
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4440
4776
  /* @__PURE__ */ jsxRuntime.jsx(
4441
- CustomIconButton,
4442
- {
4443
- onClick: () => onActionClick("Bold", editorRef),
4444
- label: "Bold",
4445
- name: "Bold",
4446
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {})
4447
- }
4448
- ),
4449
- /* @__PURE__ */ jsxRuntime.jsx(
4450
- CustomIconButton,
4777
+ designSystem.IconButton,
4451
4778
  {
4452
4779
  onClick: () => onActionClick("Italic", editorRef),
4453
4780
  label: "Italic",
@@ -4456,7 +4783,7 @@ const WysiwygNav = ({
4456
4783
  }
4457
4784
  ),
4458
4785
  /* @__PURE__ */ jsxRuntime.jsx(
4459
- CustomIconButton,
4786
+ designSystem.IconButton,
4460
4787
  {
4461
4788
  onClick: () => onActionClick("Underline", editorRef),
4462
4789
  label: "Underline",
@@ -4465,79 +4792,81 @@ const WysiwygNav = ({
4465
4792
  }
4466
4793
  )
4467
4794
  ] }),
4468
- /* @__PURE__ */ jsxRuntime.jsx(MoreButton, { ref: buttonMoreRef, onClick: handleTogglePopover, label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) }),
4469
- visiblePopover && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover, { onDismiss: handleTogglePopover, centered: true, source: buttonMoreRef, spacing: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
4470
- /* @__PURE__ */ jsxRuntime.jsxs(IconButtonGroupMargin, { children: [
4471
- /* @__PURE__ */ jsxRuntime.jsx(
4472
- CustomIconButton,
4473
- {
4474
- onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4475
- label: "Strikethrough",
4476
- name: "Strikethrough",
4477
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.StrikeThrough, {})
4478
- }
4479
- ),
4480
- /* @__PURE__ */ jsxRuntime.jsx(
4481
- CustomIconButton,
4482
- {
4483
- onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4484
- label: "BulletList",
4485
- name: "BulletList",
4486
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.BulletList, {})
4487
- }
4488
- ),
4489
- /* @__PURE__ */ jsxRuntime.jsx(
4490
- CustomIconButton,
4491
- {
4492
- onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4493
- label: "NumberList",
4494
- name: "NumberList",
4495
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.NumberList, {})
4496
- }
4497
- )
4498
- ] }),
4499
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.IconButtonGroup, { children: [
4500
- /* @__PURE__ */ jsxRuntime.jsx(
4501
- CustomIconButton,
4502
- {
4503
- onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4504
- label: "Code",
4505
- name: "Code",
4506
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Code, {})
4507
- }
4508
- ),
4509
- /* @__PURE__ */ jsxRuntime.jsx(
4510
- CustomIconButton,
4511
- {
4512
- onClick: () => {
4513
- handleTogglePopover();
4514
- onToggleMediaLib();
4515
- },
4516
- label: "Image",
4517
- name: "Image",
4518
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Image, {})
4519
- }
4520
- ),
4521
- /* @__PURE__ */ jsxRuntime.jsx(
4522
- CustomLinkIconButton,
4523
- {
4524
- onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4525
- label: "Link",
4526
- name: "Link",
4527
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Link, {})
4528
- }
4529
- ),
4530
- /* @__PURE__ */ jsxRuntime.jsx(
4531
- CustomIconButton,
4532
- {
4533
- onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4534
- label: "Quote",
4535
- name: "Quote",
4536
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Quotes, {})
4537
- }
4538
- )
4539
- ] })
4540
- ] }) })
4795
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { children: [
4796
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(MoreButton, { label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) }) }),
4797
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 2, children: [
4798
+ /* @__PURE__ */ jsxRuntime.jsxs(IconButtonGroupMargin, { children: [
4799
+ /* @__PURE__ */ jsxRuntime.jsx(
4800
+ designSystem.IconButton,
4801
+ {
4802
+ onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4803
+ label: "Strikethrough",
4804
+ name: "Strikethrough",
4805
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.StrikeThrough, {})
4806
+ }
4807
+ ),
4808
+ /* @__PURE__ */ jsxRuntime.jsx(
4809
+ designSystem.IconButton,
4810
+ {
4811
+ onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4812
+ label: "BulletList",
4813
+ name: "BulletList",
4814
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.BulletList, {})
4815
+ }
4816
+ ),
4817
+ /* @__PURE__ */ jsxRuntime.jsx(
4818
+ designSystem.IconButton,
4819
+ {
4820
+ onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4821
+ label: "NumberList",
4822
+ name: "NumberList",
4823
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.NumberList, {})
4824
+ }
4825
+ )
4826
+ ] }),
4827
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.IconButtonGroup, { children: [
4828
+ /* @__PURE__ */ jsxRuntime.jsx(
4829
+ designSystem.IconButton,
4830
+ {
4831
+ onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4832
+ label: "Code",
4833
+ name: "Code",
4834
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Code, {})
4835
+ }
4836
+ ),
4837
+ /* @__PURE__ */ jsxRuntime.jsx(
4838
+ designSystem.IconButton,
4839
+ {
4840
+ onClick: () => {
4841
+ handleTogglePopover();
4842
+ onToggleMediaLib();
4843
+ },
4844
+ label: "Image",
4845
+ name: "Image",
4846
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Image, {})
4847
+ }
4848
+ ),
4849
+ /* @__PURE__ */ jsxRuntime.jsx(
4850
+ designSystem.IconButton,
4851
+ {
4852
+ onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4853
+ label: "Link",
4854
+ name: "Link",
4855
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Link, {})
4856
+ }
4857
+ ),
4858
+ /* @__PURE__ */ jsxRuntime.jsx(
4859
+ designSystem.IconButton,
4860
+ {
4861
+ onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4862
+ label: "Quote",
4863
+ name: "Quote",
4864
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Quotes, {})
4865
+ }
4866
+ )
4867
+ ] })
4868
+ ] }) })
4869
+ ] })
4541
4870
  ] }),
4542
4871
  onTogglePreviewMode && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: onTogglePreviewMode, variant: "tertiary", children: formatMessage({
4543
4872
  id: "components.Wysiwyg.ToggleMode.preview-mode",
@@ -4605,7 +4934,7 @@ const Wysiwyg = React__namespace.forwardRef(
4605
4934
  const handleSelectAssets = (files) => {
4606
4935
  const formattedFiles = files.map((f) => ({
4607
4936
  alt: f.alternativeText || f.name,
4608
- url: usePrev.prefixFileUrlWithBackendUrl(f.url),
4937
+ url: useDebounce.prefixFileUrlWithBackendUrl(f.url),
4609
4938
  mime: f.mime
4610
4939
  }));
4611
4940
  insertFile(editorRef, formattedFiles);
@@ -4664,15 +4993,19 @@ const Wysiwyg = React__namespace.forwardRef(
4664
4993
  );
4665
4994
  const MemoizedWysiwyg = React__namespace.memo(Wysiwyg);
4666
4995
  const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4667
- const { id } = index.useDoc();
4996
+ const { id, document: document2, collectionType } = index.useDoc();
4668
4997
  const isFormDisabled = strapiAdmin.useForm("InputRenderer", (state) => state.disabled);
4669
4998
  const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
4670
4999
  const canCreateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
4671
5000
  const canReadFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
4672
5001
  const canUpdateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
4673
5002
  const canUserAction = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
4674
- const editableFields = id ? canUpdateFields : canCreateFields;
4675
- const readableFields = id ? canReadFields : canCreateFields;
5003
+ let idToCheck = id;
5004
+ if (collectionType === index.SINGLE_TYPES) {
5005
+ idToCheck = document2?.documentId;
5006
+ }
5007
+ const editableFields = idToCheck ? canUpdateFields : canCreateFields;
5008
+ const readableFields = idToCheck ? canReadFields : canCreateFields;
4676
5009
  const canUserReadField = canUserAction(props.name, readableFields, props.type);
4677
5010
  const canUserEditField = canUserAction(props.name, editableFields, props.type);
4678
5011
  const fields = strapiAdmin.useStrapiApp("InputRenderer", (app) => app.fields);
@@ -4683,6 +5016,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4683
5016
  const {
4684
5017
  edit: { components }
4685
5018
  } = index.useDocLayout();
5019
+ const field = strapiAdmin.useField(props.name);
4686
5020
  if (!visible) {
4687
5021
  return null;
4688
5022
  }
@@ -4693,7 +5027,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4693
5027
  if (attributeHasCustomFieldProperty(props.attribute)) {
4694
5028
  const CustomInput = lazyComponentStore[props.attribute.customField];
4695
5029
  if (CustomInput) {
4696
- return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
5030
+ return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
4697
5031
  }
4698
5032
  return /* @__PURE__ */ jsxRuntime.jsx(
4699
5033
  strapiAdmin.InputRenderer,
@@ -4763,7 +5097,9 @@ const useFieldHint = (hint = void 0, attribute) => {
4763
5097
  if (!maximum && !minimum) {
4764
5098
  return hint;
4765
5099
  }
4766
- const units = !["biginteger", "integer", "number"].includes(attribute.type) ? formatMessage(
5100
+ const units = !["biginteger", "integer", "number", "dynamiczone", "component"].includes(
5101
+ attribute.type
5102
+ ) ? formatMessage(
4767
5103
  {
4768
5104
  id: "content-manager.form.Input.hint.character.unit",
4769
5105
  defaultMessage: "{maxValue, plural, one { character} other { characters}}"
@@ -4852,12 +5188,20 @@ const DynamicComponent = ({
4852
5188
  React__namespace.useEffect(() => {
4853
5189
  dragPreviewRef(reactDndHtml5Backend.getEmptyImage(), { captureDraggingState: false });
4854
5190
  }, [dragPreviewRef, index$1]);
5191
+ const accordionValue = React__namespace.useId();
5192
+ const { value = [], rawError } = strapiAdmin.useField(`${name2}.${index$1}`);
5193
+ const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
5194
+ React__namespace.useEffect(() => {
5195
+ if (rawError && value) {
5196
+ setCollapseToOpen(accordionValue);
5197
+ }
5198
+ }, [rawError, value, accordionValue]);
4855
5199
  const composedBoxRefs = designSystem.useComposedRefs(boxRef, dropRef);
4856
5200
  const accordionActions = disabled ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4857
5201
  /* @__PURE__ */ jsxRuntime.jsx(
4858
5202
  designSystem.IconButton,
4859
5203
  {
4860
- borderWidth: 0,
5204
+ variant: "ghost",
4861
5205
  label: formatMessage(
4862
5206
  {
4863
5207
  id: index.getTranslation("components.DynamicZone.delete-label"),
@@ -4872,7 +5216,7 @@ const DynamicComponent = ({
4872
5216
  /* @__PURE__ */ jsxRuntime.jsx(
4873
5217
  designSystem.IconButton,
4874
5218
  {
4875
- borderWidth: 0,
5219
+ variant: "ghost",
4876
5220
  onClick: (e) => e.stopPropagation(),
4877
5221
  "data-handler-id": handlerId,
4878
5222
  ref: dragRef,
@@ -4917,10 +5261,9 @@ const DynamicComponent = ({
4917
5261
  ] })
4918
5262
  ] });
4919
5263
  const accordionTitle = title ? `${displayName} ${title}` : displayName;
4920
- const accordionValue = React__namespace.useId();
4921
5264
  return /* @__PURE__ */ jsxRuntime.jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
4922
5265
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Rectangle, { background: "neutral200" }) }),
4923
- /* @__PURE__ */ jsxRuntime.jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(Preview, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: accordionValue, children: [
5266
+ /* @__PURE__ */ jsxRuntime.jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(Preview, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { value: collapseToOpen, onValueChange: setCollapseToOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: accordionValue, children: [
4924
5267
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Header, { children: [
4925
5268
  /* @__PURE__ */ jsxRuntime.jsx(
4926
5269
  designSystem.Accordion.Trigger,
@@ -4931,10 +5274,39 @@ const DynamicComponent = ({
4931
5274
  ),
4932
5275
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Actions, { children: accordionActions })
4933
5276
  ] }),
4934
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: row.map(({ size, ...field }) => {
4935
- const fieldName = `${name2}.${index$1}.${field.name}`;
4936
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...field, name: fieldName }) }, fieldName);
4937
- }) }, rowInd)) }) }) })
5277
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsxRuntime.jsx(
5278
+ designSystem.Grid.Item,
5279
+ {
5280
+ col: 12,
5281
+ s: 12,
5282
+ xs: 12,
5283
+ direction: "column",
5284
+ alignItems: "stretch",
5285
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5286
+ const fieldName = `${name2}.${index$1}.${field.name}`;
5287
+ const fieldWithTranslatedLabel = {
5288
+ ...field,
5289
+ label: formatMessage({
5290
+ id: `content-manager.components.${componentUid}.${field.name}`,
5291
+ defaultMessage: field.label
5292
+ })
5293
+ };
5294
+ return /* @__PURE__ */ jsxRuntime.jsx(
5295
+ designSystem.Grid.Item,
5296
+ {
5297
+ col: size,
5298
+ s: 12,
5299
+ xs: 12,
5300
+ direction: "column",
5301
+ alignItems: "stretch",
5302
+ children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...fieldWithTranslatedLabel, name: fieldName })
5303
+ },
5304
+ fieldName
5305
+ );
5306
+ }) })
5307
+ },
5308
+ rowInd
5309
+ )) }) }) }) })
4938
5310
  ] }) }) })
4939
5311
  ] });
4940
5312
  };
@@ -5126,7 +5498,7 @@ const DynamicZone = ({
5126
5498
  const handleRemoveComponent = (name22, currentIndex) => () => {
5127
5499
  removeFieldRow(name22, currentIndex);
5128
5500
  };
5129
- const hasError = error !== void 0 || dynamicDisplayedComponentsLength < min || dynamicDisplayedComponentsLength > max;
5501
+ const hasError = error !== void 0;
5130
5502
  const renderButtonLabel = () => {
5131
5503
  if (addComponentIsOpen) {
5132
5504
  return formatMessage({ id: "app.utils.close-label", defaultMessage: "Close" });
@@ -5240,4 +5612,4 @@ exports.transformDocument = transformDocument;
5240
5612
  exports.useDynamicZone = useDynamicZone;
5241
5613
  exports.useFieldHint = useFieldHint;
5242
5614
  exports.useLazyComponents = useLazyComponents;
5243
- //# sourceMappingURL=Field-Dh1yZyqy.js.map
5615
+ //# sourceMappingURL=Field-fKtb7rWK.js.map