@strapi/content-manager 0.0.0-experimental.e14656d3b8681880212c13260b9a2b340c182f2d → 0.0.0-experimental.e350eaa6073e65190102b4b798c32c287053cc02

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 (198) hide show
  1. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -1
  2. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-D_M8iBw5.js → ComponentConfigurationPage-BTR_hQow.js} +5 -6
  4. package/dist/_chunks/{ComponentConfigurationPage-D_M8iBw5.js.map → ComponentConfigurationPage-BTR_hQow.js.map} +1 -1
  5. package/dist/_chunks/{ComponentConfigurationPage-qemkOlnj.mjs → ComponentConfigurationPage-bLQr82ce.mjs} +4 -4
  6. package/dist/_chunks/{ComponentConfigurationPage-qemkOlnj.mjs.map → ComponentConfigurationPage-bLQr82ce.mjs.map} +1 -1
  7. package/dist/_chunks/{ComponentIcon-BXdiCGQp.js → ComponentIcon-CRbtQEUV.js} +2 -3
  8. package/dist/_chunks/{ComponentIcon-BXdiCGQp.js.map → ComponentIcon-CRbtQEUV.js.map} +1 -1
  9. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -1
  10. package/dist/_chunks/{EditConfigurationPage-CjUrEewK.mjs → EditConfigurationPage-BhRSnUsL.mjs} +4 -4
  11. package/dist/_chunks/{EditConfigurationPage-CjUrEewK.mjs.map → EditConfigurationPage-BhRSnUsL.mjs.map} +1 -1
  12. package/dist/_chunks/{EditConfigurationPage-BePwPuHy.js → EditConfigurationPage-z39Wv3E6.js} +5 -6
  13. package/dist/_chunks/{EditConfigurationPage-BePwPuHy.js.map → EditConfigurationPage-z39Wv3E6.js.map} +1 -1
  14. package/dist/_chunks/{EditViewPage-De8GyU8P.mjs → EditViewPage-BCjNxNlY.mjs} +50 -10
  15. package/dist/_chunks/EditViewPage-BCjNxNlY.mjs.map +1 -0
  16. package/dist/_chunks/{EditViewPage-B-RJeiJD.js → EditViewPage-wujOq90c.js} +50 -11
  17. package/dist/_chunks/EditViewPage-wujOq90c.js.map +1 -0
  18. package/dist/_chunks/{Field-dq8Tg1M_.js → Field-B5QXnctJ.js} +238 -153
  19. package/dist/_chunks/Field-B5QXnctJ.js.map +1 -0
  20. package/dist/_chunks/{Field-pb2o8uBe.mjs → Field-Byr3mPTl.mjs} +232 -147
  21. package/dist/_chunks/Field-Byr3mPTl.mjs.map +1 -0
  22. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -1
  23. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -1
  24. package/dist/_chunks/{Form-DJn0Dxha.mjs → Form-BZgvE8C8.mjs} +17 -9
  25. package/dist/_chunks/Form-BZgvE8C8.mjs.map +1 -0
  26. package/dist/_chunks/{Form-DGIf4jQU.js → Form-D7mexvm3.js} +19 -12
  27. package/dist/_chunks/Form-D7mexvm3.js.map +1 -0
  28. package/dist/_chunks/{History-BowL3JKP.mjs → History-CqNgxkqK.mjs} +43 -100
  29. package/dist/_chunks/History-CqNgxkqK.mjs.map +1 -0
  30. package/dist/_chunks/{History-Dh2NEHnR.js → History-DYl2A8Z_.js} +42 -100
  31. package/dist/_chunks/History-DYl2A8Z_.js.map +1 -0
  32. package/dist/_chunks/{ListConfigurationPage-BxYCWz9e.js → ListConfigurationPage-BXnu_OoY.js} +7 -7
  33. package/dist/_chunks/ListConfigurationPage-BXnu_OoY.js.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-BpVOB-hn.mjs → ListConfigurationPage-BbQjzKkQ.mjs} +7 -6
  35. package/dist/_chunks/ListConfigurationPage-BbQjzKkQ.mjs.map +1 -0
  36. package/dist/_chunks/{ListViewPage-4XsciqHZ.js → ListViewPage-BtSi8C1l.js} +103 -77
  37. package/dist/_chunks/ListViewPage-BtSi8C1l.js.map +1 -0
  38. package/dist/_chunks/{ListViewPage-CXFUjZQC.mjs → ListViewPage-D4ofkbjR.mjs} +99 -72
  39. package/dist/_chunks/ListViewPage-D4ofkbjR.mjs.map +1 -0
  40. package/dist/_chunks/{NoContentTypePage-C8OpoHeU.js → NoContentTypePage-CitJeOq4.js} +2 -2
  41. package/dist/_chunks/{NoContentTypePage-C8OpoHeU.js.map → NoContentTypePage-CitJeOq4.js.map} +1 -1
  42. package/dist/_chunks/{NoContentTypePage-DuhOTp3x.mjs → NoContentTypePage-DyUx5mXh.mjs} +2 -2
  43. package/dist/_chunks/{NoContentTypePage-DuhOTp3x.mjs.map → NoContentTypePage-DyUx5mXh.mjs.map} +1 -1
  44. package/dist/_chunks/{NoPermissionsPage-DVz3mzDz.mjs → NoPermissionsPage-DhIiyWkk.mjs} +2 -2
  45. package/dist/_chunks/{NoPermissionsPage-DVz3mzDz.mjs.map → NoPermissionsPage-DhIiyWkk.mjs.map} +1 -1
  46. package/dist/_chunks/{NoPermissionsPage-y_r7DVA2.js → NoPermissionsPage-DzgWz0M-.js} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-y_r7DVA2.js.map → NoPermissionsPage-DzgWz0M-.js.map} +1 -1
  48. package/dist/_chunks/Preview-BaYGJ0nb.mjs +293 -0
  49. package/dist/_chunks/Preview-BaYGJ0nb.mjs.map +1 -0
  50. package/dist/_chunks/Preview-DfNx8Ke-.js +311 -0
  51. package/dist/_chunks/Preview-DfNx8Ke-.js.map +1 -0
  52. package/dist/_chunks/{Relations-CVNLrn1Y.mjs → Relations-DM2yUTST.mjs} +75 -41
  53. package/dist/_chunks/Relations-DM2yUTST.mjs.map +1 -0
  54. package/dist/_chunks/{Relations-DPFCAa7b.js → Relations-DuKCaXrv.js} +75 -42
  55. package/dist/_chunks/Relations-DuKCaXrv.js.map +1 -0
  56. package/dist/_chunks/{en-uOUIxfcQ.js → en-BK8Xyl5I.js} +28 -15
  57. package/dist/_chunks/{en-uOUIxfcQ.js.map → en-BK8Xyl5I.js.map} +1 -1
  58. package/dist/_chunks/{en-BrCTWlZv.mjs → en-Dtk_ot79.mjs} +28 -15
  59. package/dist/_chunks/{en-BrCTWlZv.mjs.map → en-Dtk_ot79.mjs.map} +1 -1
  60. package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
  61. package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
  62. package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
  63. package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
  64. package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
  65. package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
  66. package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
  67. package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
  68. package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
  69. package/dist/_chunks/{index-C3fJE-1-.js → index-BUWEmX8m.js} +1273 -996
  70. package/dist/_chunks/index-BUWEmX8m.js.map +1 -0
  71. package/dist/_chunks/{index-DiMrfcfy.mjs → index-DVAIIsOs.mjs} +1276 -999
  72. package/dist/_chunks/index-DVAIIsOs.mjs.map +1 -0
  73. package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
  74. package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
  75. package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
  76. package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
  77. package/dist/_chunks/{layout-ls3gxfpH.mjs → layout-Bxsv5mP7.mjs} +6 -5
  78. package/dist/_chunks/{layout-ls3gxfpH.mjs.map → layout-Bxsv5mP7.mjs.map} +1 -1
  79. package/dist/_chunks/{layout-C788OmNr.js → layout-C3fN7Ejz.js} +7 -7
  80. package/dist/_chunks/{layout-C788OmNr.js.map → layout-C3fN7Ejz.js.map} +1 -1
  81. package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
  82. package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
  83. package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
  84. package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
  85. package/dist/_chunks/{relations-DYeotliT.js → relations-BPZKAoEY.js} +6 -7
  86. package/dist/_chunks/relations-BPZKAoEY.js.map +1 -0
  87. package/dist/_chunks/{relations-CLcOmGO0.mjs → relations-o3pPhzY4.mjs} +6 -7
  88. package/dist/_chunks/relations-o3pPhzY4.mjs.map +1 -0
  89. package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
  90. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  91. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  92. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  93. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
  94. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
  95. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
  96. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
  97. package/dist/admin/index.js +2 -1
  98. package/dist/admin/index.js.map +1 -1
  99. package/dist/admin/index.mjs +4 -3
  100. package/dist/admin/src/content-manager.d.ts +3 -2
  101. package/dist/admin/src/exports.d.ts +1 -1
  102. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  103. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  104. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
  105. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
  106. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  107. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  108. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  109. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +0 -32
  110. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  111. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  112. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  113. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  114. package/dist/admin/src/preview/index.d.ts +4 -0
  115. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  116. package/dist/admin/src/preview/routes.d.ts +3 -0
  117. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  118. package/dist/admin/src/router.d.ts +1 -1
  119. package/dist/admin/src/services/documents.d.ts +3 -4
  120. package/dist/server/index.js +453 -201
  121. package/dist/server/index.js.map +1 -1
  122. package/dist/server/index.mjs +453 -200
  123. package/dist/server/index.mjs.map +1 -1
  124. package/dist/server/src/bootstrap.d.ts.map +1 -1
  125. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  126. package/dist/server/src/controllers/index.d.ts.map +1 -1
  127. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  128. package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
  129. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  130. package/dist/server/src/history/services/history.d.ts.map +1 -1
  131. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  132. package/dist/server/src/history/services/utils.d.ts +3 -3
  133. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  134. package/dist/server/src/index.d.ts +4 -4
  135. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  136. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  137. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  138. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  139. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  140. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  141. package/dist/server/src/preview/index.d.ts +4 -0
  142. package/dist/server/src/preview/index.d.ts.map +1 -0
  143. package/dist/server/src/preview/routes/index.d.ts +8 -0
  144. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  145. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  146. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  147. package/dist/server/src/preview/services/index.d.ts +16 -0
  148. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  149. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  150. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  151. package/dist/server/src/preview/services/preview.d.ts +12 -0
  152. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  153. package/dist/server/src/preview/utils.d.ts +19 -0
  154. package/dist/server/src/preview/utils.d.ts.map +1 -0
  155. package/dist/server/src/register.d.ts.map +1 -1
  156. package/dist/server/src/routes/index.d.ts.map +1 -1
  157. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  158. package/dist/server/src/services/document-metadata.d.ts +8 -8
  159. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  160. package/dist/server/src/services/index.d.ts +4 -4
  161. package/dist/server/src/services/index.d.ts.map +1 -1
  162. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  163. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  164. package/dist/server/src/utils/index.d.ts +2 -0
  165. package/dist/server/src/utils/index.d.ts.map +1 -1
  166. package/dist/shared/contracts/collection-types.d.ts +3 -1
  167. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  168. package/dist/shared/contracts/index.d.ts +1 -0
  169. package/dist/shared/contracts/index.d.ts.map +1 -1
  170. package/dist/shared/contracts/preview.d.ts +27 -0
  171. package/dist/shared/contracts/preview.d.ts.map +1 -0
  172. package/dist/shared/index.js +4 -0
  173. package/dist/shared/index.js.map +1 -1
  174. package/dist/shared/index.mjs +4 -0
  175. package/dist/shared/index.mjs.map +1 -1
  176. package/package.json +17 -15
  177. package/dist/_chunks/EditViewPage-B-RJeiJD.js.map +0 -1
  178. package/dist/_chunks/EditViewPage-De8GyU8P.mjs.map +0 -1
  179. package/dist/_chunks/Field-dq8Tg1M_.js.map +0 -1
  180. package/dist/_chunks/Field-pb2o8uBe.mjs.map +0 -1
  181. package/dist/_chunks/Form-DGIf4jQU.js.map +0 -1
  182. package/dist/_chunks/Form-DJn0Dxha.mjs.map +0 -1
  183. package/dist/_chunks/History-BowL3JKP.mjs.map +0 -1
  184. package/dist/_chunks/History-Dh2NEHnR.js.map +0 -1
  185. package/dist/_chunks/ListConfigurationPage-BpVOB-hn.mjs.map +0 -1
  186. package/dist/_chunks/ListConfigurationPage-BxYCWz9e.js.map +0 -1
  187. package/dist/_chunks/ListViewPage-4XsciqHZ.js.map +0 -1
  188. package/dist/_chunks/ListViewPage-CXFUjZQC.mjs.map +0 -1
  189. package/dist/_chunks/Relations-CVNLrn1Y.mjs.map +0 -1
  190. package/dist/_chunks/Relations-DPFCAa7b.js.map +0 -1
  191. package/dist/_chunks/index-C3fJE-1-.js.map +0 -1
  192. package/dist/_chunks/index-DiMrfcfy.mjs.map +0 -1
  193. package/dist/_chunks/relations-CLcOmGO0.mjs.map +0 -1
  194. package/dist/_chunks/relations-DYeotliT.js.map +0 -1
  195. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  196. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  197. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  198. package/strapi-server.js +0 -3
@@ -5,19 +5,70 @@ 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-C3fJE-1-.js");
8
+ const index = require("./index-BUWEmX8m.js");
9
9
  const fractionalIndexing = require("fractional-indexing");
10
- const Relations = require("./Relations-DPFCAa7b.js");
10
+ const Relations = require("./Relations-DuKCaXrv.js");
11
11
  const Icons = require("@strapi/icons");
12
12
  const styledComponents = require("styled-components");
13
- const ComponentIcon = require("./ComponentIcon-BXdiCGQp.js");
13
+ const ComponentIcon = require("./ComponentIcon-CRbtQEUV.js");
14
14
  const reactDndHtml5Backend = require("react-dnd-html5-backend");
15
- const useDragAndDrop = require("./useDragAndDrop-J0TUUbR6.js");
16
- const objects = require("./objects-gigeqt7s.js");
15
+ const useDragAndDrop = require("./useDragAndDrop-BMtgCYzL.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 Prism = require("prismjs");
21
+ require("prismjs/themes/prism-solarizedlight.css");
22
+ require("prismjs/components/prism-asmatmel");
23
+ require("prismjs/components/prism-bash");
24
+ require("prismjs/components/prism-basic");
25
+ require("prismjs/components/prism-c");
26
+ require("prismjs/components/prism-clojure");
27
+ require("prismjs/components/prism-cobol");
28
+ require("prismjs/components/prism-cpp");
29
+ require("prismjs/components/prism-csharp");
30
+ require("prismjs/components/prism-dart");
31
+ require("prismjs/components/prism-docker");
32
+ require("prismjs/components/prism-elixir");
33
+ require("prismjs/components/prism-erlang");
34
+ require("prismjs/components/prism-fortran");
35
+ require("prismjs/components/prism-fsharp");
36
+ require("prismjs/components/prism-go");
37
+ require("prismjs/components/prism-graphql");
38
+ require("prismjs/components/prism-groovy");
39
+ require("prismjs/components/prism-haskell");
40
+ require("prismjs/components/prism-haxe");
41
+ require("prismjs/components/prism-ini");
42
+ require("prismjs/components/prism-java");
43
+ require("prismjs/components/prism-javascript");
44
+ require("prismjs/components/prism-jsx");
45
+ require("prismjs/components/prism-json");
46
+ require("prismjs/components/prism-julia");
47
+ require("prismjs/components/prism-kotlin");
48
+ require("prismjs/components/prism-latex");
49
+ require("prismjs/components/prism-lua");
50
+ require("prismjs/components/prism-markdown");
51
+ require("prismjs/components/prism-matlab");
52
+ require("prismjs/components/prism-makefile");
53
+ require("prismjs/components/prism-objectivec");
54
+ require("prismjs/components/prism-perl");
55
+ require("prismjs/components/prism-php");
56
+ require("prismjs/components/prism-powershell");
57
+ require("prismjs/components/prism-python");
58
+ require("prismjs/components/prism-r");
59
+ require("prismjs/components/prism-ruby");
60
+ require("prismjs/components/prism-rust");
61
+ require("prismjs/components/prism-sas");
62
+ require("prismjs/components/prism-scala");
63
+ require("prismjs/components/prism-scheme");
64
+ require("prismjs/components/prism-sql");
65
+ require("prismjs/components/prism-stata");
66
+ require("prismjs/components/prism-swift");
67
+ require("prismjs/components/prism-typescript");
68
+ require("prismjs/components/prism-tsx");
69
+ require("prismjs/components/prism-vbnet");
70
+ require("prismjs/components/prism-yaml");
71
+ const useDebounce = require("./useDebounce-CtcjDB3L.js");
21
72
  const Toolbar = require("@radix-ui/react-toolbar");
22
73
  const reactRouterDom = require("react-router-dom");
23
74
  const CodeMirror = require("codemirror5");
@@ -37,8 +88,7 @@ require("highlight.js/styles/solarized-dark.css");
37
88
  require("codemirror5/addon/display/placeholder");
38
89
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
39
90
  function _interopNamespace(e) {
40
- if (e && e.__esModule)
41
- return e;
91
+ if (e && e.__esModule) return e;
42
92
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
43
93
  if (e) {
44
94
  for (const k in e) {
@@ -56,6 +106,7 @@ function _interopNamespace(e) {
56
106
  }
57
107
  const React__namespace = /* @__PURE__ */ _interopNamespace(React);
58
108
  const pipe__default = /* @__PURE__ */ _interopDefault(pipe$1);
109
+ const Prism__namespace = /* @__PURE__ */ _interopNamespace(Prism);
59
110
  const Toolbar__namespace = /* @__PURE__ */ _interopNamespace(Toolbar);
60
111
  const CodeMirror__default = /* @__PURE__ */ _interopDefault(CodeMirror);
61
112
  const sanitizeHtml__default = /* @__PURE__ */ _interopDefault(sanitizeHtml);
@@ -197,7 +248,8 @@ const useLazyComponents = (componentUids = []) => {
197
248
  const codeLanguages = [
198
249
  {
199
250
  value: "asm",
200
- label: "Assembly"
251
+ label: "Assembly",
252
+ decorate: "asmatmel"
201
253
  },
202
254
  {
203
255
  value: "bash",
@@ -233,7 +285,8 @@ const codeLanguages = [
233
285
  },
234
286
  {
235
287
  value: "dockerfile",
236
- label: "Dockerfile"
288
+ label: "Dockerfile",
289
+ decorate: "docker"
237
290
  },
238
291
  {
239
292
  value: "elixir",
@@ -389,7 +442,8 @@ const codeLanguages = [
389
442
  },
390
443
  {
391
444
  value: "typescript",
392
- label: "TypeScript"
445
+ label: "TypeScript",
446
+ decorate: "ts"
393
447
  },
394
448
  {
395
449
  value: "tsx",
@@ -405,7 +459,8 @@ const codeLanguages = [
405
459
  },
406
460
  {
407
461
  value: "yaml",
408
- label: "YAML"
462
+ label: "YAML",
463
+ decorate: "yml"
409
464
  }
410
465
  ];
411
466
  const baseHandleConvert = (editor, attributesToSet) => {
@@ -471,6 +526,29 @@ const pressEnterTwiceToExit = (editor) => {
471
526
  });
472
527
  }
473
528
  };
529
+ const decorateCode = ([node, path]) => {
530
+ const ranges = [];
531
+ if (!slate.Element.isElement(node) || node.type !== "code") return ranges;
532
+ const text = slate.Node.string(node);
533
+ const language = codeLanguages.find((lang) => lang.value === node.language);
534
+ const decorateKey = language?.decorate ?? language?.value;
535
+ const selectedLanguage = Prism__namespace.languages[decorateKey || "plaintext"];
536
+ const tokens = Prism__namespace.tokenize(text, selectedLanguage);
537
+ let start = 0;
538
+ for (const token of tokens) {
539
+ const length = token.length;
540
+ const end = start + length;
541
+ if (typeof token !== "string") {
542
+ ranges.push({
543
+ anchor: { path, offset: start },
544
+ focus: { path, offset: end },
545
+ className: `token ${token.type}`
546
+ });
547
+ }
548
+ start = end;
549
+ }
550
+ return ranges;
551
+ };
474
552
  const CodeBlock = styledComponents.styled.pre`
475
553
  border-radius: ${({ theme }) => theme.borderRadius};
476
554
  background-color: ${({ theme }) => theme.colors.neutral100};
@@ -542,7 +620,7 @@ const CodeEditor = (props) => {
542
620
  const codeBlocks = {
543
621
  code: {
544
622
  renderElement: (props) => /* @__PURE__ */ jsxRuntime.jsx(CodeEditor, { ...props }),
545
- icon: Icons.Code,
623
+ icon: Icons.CodeBlock,
546
624
  label: {
547
625
  id: "components.Blocks.blocks.code",
548
626
  defaultMessage: "Code block"
@@ -731,8 +809,7 @@ const ImageDialog = () => {
731
809
  const [isOpen, setIsOpen] = React__namespace.useState(true);
732
810
  const { editor } = useBlocksEditorContext("ImageDialog");
733
811
  const components = strapiAdmin.useStrapiApp("ImageDialog", (state) => state.components);
734
- if (!components || !isOpen)
735
- return null;
812
+ if (!components || !isOpen) return null;
736
813
  const MediaLibraryDialog = components["media-library"];
737
814
  const insertImages = (images) => {
738
815
  slate.Transforms.unwrapNodes(editor, {
@@ -741,14 +818,12 @@ const ImageDialog = () => {
741
818
  });
742
819
  const nodeEntryBeingReplaced = slate.Editor.above(editor, {
743
820
  match(node) {
744
- if (slate.Editor.isEditor(node))
745
- return false;
821
+ if (slate.Editor.isEditor(node)) return false;
746
822
  const isInlineNode = ["text", "link"].includes(node.type);
747
823
  return !isInlineNode;
748
824
  }
749
825
  });
750
- if (!nodeEntryBeingReplaced)
751
- return;
826
+ if (!nodeEntryBeingReplaced) return;
752
827
  const [, pathToInsert] = nodeEntryBeingReplaced;
753
828
  slate.Transforms.removeNodes(editor);
754
829
  const nodesToInsert = images.map((image) => {
@@ -768,7 +843,7 @@ const ImageDialog = () => {
768
843
  const nodeImage = {
769
844
  ...expectedImage,
770
845
  alternativeText: expectedImage.alternativeText || expectedImage.name,
771
- url: usePrev.prefixFileUrlWithBackendUrl(image.url)
846
+ url: useDebounce.prefixFileUrlWithBackendUrl(image.url)
772
847
  };
773
848
  return nodeImage;
774
849
  });
@@ -926,8 +1001,7 @@ const LinkContent = React__namespace.forwardRef(
926
1001
  slateReact.ReactEditor.focus(editor);
927
1002
  };
928
1003
  React__namespace.useEffect(() => {
929
- if (popoverOpen)
930
- linkInputRef.current?.focus();
1004
+ if (popoverOpen) linkInputRef.current?.focus();
931
1005
  }, [popoverOpen]);
932
1006
  const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
933
1007
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { open: popoverOpen, children: [
@@ -997,11 +1071,11 @@ const LinkContent = React__namespace.forwardRef(
997
1071
  ),
998
1072
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
999
1073
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
1000
- id: "components.Blocks.popover.cancel",
1074
+ id: "global.cancel",
1001
1075
  defaultMessage: "Cancel"
1002
1076
  }) }),
1003
1077
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
1004
- id: "components.Blocks.popover.save",
1078
+ id: "global.save",
1005
1079
  defaultMessage: "Save"
1006
1080
  }) })
1007
1081
  ] })
@@ -1082,8 +1156,7 @@ const isText$1 = (node) => {
1082
1156
  return slate.Node.isNode(node) && !slate.Editor.isEditor(node) && node.type === "text";
1083
1157
  };
1084
1158
  const handleBackspaceKeyOnList = (editor, event) => {
1085
- if (!editor.selection)
1086
- return;
1159
+ if (!editor.selection) return;
1087
1160
  const [currentListItem, currentListItemPath] = slate.Editor.parent(editor, editor.selection.anchor);
1088
1161
  const [currentList, currentListPath] = slate.Editor.parent(editor, currentListItemPath);
1089
1162
  const isListEmpty = currentList.children.length === 1 && isText$1(currentListItem.children[0]) && currentListItem.children[0].text === "";
@@ -1192,8 +1265,7 @@ const handleEnterKeyOnList = (editor) => {
1192
1265
  };
1193
1266
  const handleConvertToList = (editor, format) => {
1194
1267
  const convertedPath = baseHandleConvert(editor, { type: "list-item" });
1195
- if (!convertedPath)
1196
- return;
1268
+ if (!convertedPath) return;
1197
1269
  slate.Transforms.wrapNodes(editor, { type: "list", format, children: [] }, { at: convertedPath });
1198
1270
  };
1199
1271
  const handleTabOnList = (editor) => {
@@ -1205,8 +1277,7 @@ const handleTabOnList = (editor) => {
1205
1277
  }
1206
1278
  const [currentListItem, currentListItemPath] = currentListItemEntry;
1207
1279
  const [currentList] = slate.Editor.parent(editor, currentListItemPath);
1208
- if (currentListItem === currentList.children[0])
1209
- return;
1280
+ if (currentListItem === currentList.children[0]) return;
1210
1281
  const currentListItemIndex = currentList.children.findIndex((item) => item === currentListItem);
1211
1282
  const previousNode = currentList.children[currentListItemIndex - 1];
1212
1283
  if (previousNode.type === "list") {
@@ -1441,7 +1512,7 @@ const ToolbarButton = ({
1441
1512
  width: 7,
1442
1513
  height: 7,
1443
1514
  hasRadius: true,
1444
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { width: "1.2rem", height: "1.2rem", fill: disabled ? "neutral300" : enabledColor })
1515
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
1445
1516
  }
1446
1517
  )
1447
1518
  }
@@ -1573,8 +1644,7 @@ const isListNode = (node) => {
1573
1644
  const ListButton = ({ block, format }) => {
1574
1645
  const { editor, disabled, blocks } = useBlocksEditorContext("ListButton");
1575
1646
  const isListActive = () => {
1576
- if (!editor.selection)
1577
- return false;
1647
+ if (!editor.selection) return false;
1578
1648
  const currentListEntry = slate.Editor.above(editor, {
1579
1649
  match: (node) => !slate.Editor.isEditor(node) && node.type === "list",
1580
1650
  at: editor.selection.anchor
@@ -1648,8 +1718,7 @@ const LinkButton = ({ disabled }) => {
1648
1718
  const { editor } = useBlocksEditorContext("LinkButton");
1649
1719
  const isLinkActive = () => {
1650
1720
  const { selection } = editor;
1651
- if (!selection)
1652
- return false;
1721
+ if (!selection) return false;
1653
1722
  const [match] = Array.from(
1654
1723
  slate.Editor.nodes(editor, {
1655
1724
  at: slate.Editor.unhangRange(editor, selection),
@@ -1783,6 +1852,7 @@ const DragItem = styledComponents.styled(designSystem.Flex)`
1783
1852
  }
1784
1853
  `;
1785
1854
  const DragIconButton = styledComponents.styled(designSystem.IconButton)`
1855
+ user-select: none;
1786
1856
  display: flex;
1787
1857
  align-items: center;
1788
1858
  justify-content: center;
@@ -1854,8 +1924,7 @@ const DragAndDropElement = ({
1854
1924
  displayedValue: children
1855
1925
  },
1856
1926
  onDropItem(currentIndex, newIndex) {
1857
- if (newIndex)
1858
- handleMoveBlock(newIndex, currentIndex);
1927
+ if (newIndex) handleMoveBlock(newIndex, currentIndex);
1859
1928
  }
1860
1929
  });
1861
1930
  const composedBoxRefs = designSystem.useComposedRefs(blockRef, dropRef);
@@ -1911,6 +1980,7 @@ const DragAndDropElement = ({
1911
1980
  DragIconButton,
1912
1981
  {
1913
1982
  tag: "div",
1983
+ contentEditable: false,
1914
1984
  role: "button",
1915
1985
  tabIndex: 0,
1916
1986
  withTooltip: false,
@@ -1960,7 +2030,7 @@ const baseRenderLeaf = (props, modifiers2) => {
1960
2030
  }
1961
2031
  return currentChildren;
1962
2032
  }, props.children);
1963
- return /* @__PURE__ */ jsxRuntime.jsx("span", { ...props.attributes, children: wrappedChildren });
2033
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { ...props.attributes, className: props.leaf.className, children: wrappedChildren });
1964
2034
  };
1965
2035
  const baseRenderElement = ({
1966
2036
  props,
@@ -1998,8 +2068,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
1998
2068
  [modifiers2]
1999
2069
  );
2000
2070
  const handleMoveBlocks = (editor2, event) => {
2001
- if (!editor2.selection)
2002
- return;
2071
+ if (!editor2.selection) return;
2003
2072
  const start = slate.Range.start(editor2.selection);
2004
2073
  const currentIndex = [start.path[0]];
2005
2074
  let newIndexPosition = 0;
@@ -2136,8 +2205,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
2136
2205
  }
2137
2206
  };
2138
2207
  const handleScrollSelectionIntoView = () => {
2139
- if (!editor.selection)
2140
- return;
2208
+ if (!editor.selection) return;
2141
2209
  const domRange = slateReact.ReactEditor.toDOMRange(editor, editor.selection);
2142
2210
  const domRect = domRange.getBoundingClientRect();
2143
2211
  const blocksInput = blocksRef.current;
@@ -2175,6 +2243,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
2175
2243
  readOnly: disabled,
2176
2244
  placeholder,
2177
2245
  isExpandedMode,
2246
+ decorate: decorateCode,
2178
2247
  renderElement,
2179
2248
  renderLeaf,
2180
2249
  onKeyDown: handleKeyDown,
@@ -2331,8 +2400,7 @@ const InlineCode = styledComponents.styled.code`
2331
2400
  `;
2332
2401
  const baseCheckIsActive = (editor, name2) => {
2333
2402
  const marks = slate.Editor.marks(editor);
2334
- if (!marks)
2335
- return false;
2403
+ if (!marks) return false;
2336
2404
  return Boolean(marks[name2]);
2337
2405
  };
2338
2406
  const baseHandleToggle = (editor, name2) => {
@@ -2656,7 +2724,7 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
2656
2724
  designSystem.Box,
2657
2725
  {
2658
2726
  tag: "button",
2659
- background: "neutral100",
2727
+ background: disabled ? "neutral150" : "neutral100",
2660
2728
  borderColor: field.error ? "danger600" : "neutral200",
2661
2729
  hasRadius: true,
2662
2730
  disabled,
@@ -2664,32 +2732,32 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
2664
2732
  paddingTop: 9,
2665
2733
  paddingBottom: 9,
2666
2734
  type: "button",
2735
+ style: { cursor: disabled ? "not-allowed" : "pointer" },
2667
2736
  children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
2668
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(CircleIcon, {}) }),
2669
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
2670
- id: index.getTranslation("components.empty-repeatable"),
2671
- defaultMessage: "No entry yet. Click on the button below to add one."
2672
- }) }) })
2737
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", color: disabled ? "neutral500" : "primary600", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.PlusCircle, { width: "3.2rem", height: "3.2rem" }) }),
2738
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(
2739
+ designSystem.Typography,
2740
+ {
2741
+ textColor: disabled ? "neutral600" : "primary600",
2742
+ variant: "pi",
2743
+ fontWeight: "bold",
2744
+ children: formatMessage({
2745
+ id: index.getTranslation("components.empty-repeatable"),
2746
+ defaultMessage: "No entry yet. Click to add one."
2747
+ })
2748
+ }
2749
+ ) })
2673
2750
  ] })
2674
2751
  }
2675
2752
  ) });
2676
2753
  };
2677
- const CircleIcon = styledComponents.styled(Icons.PlusCircle)`
2678
- width: 2.4rem;
2679
- height: 2.4rem;
2680
- > circle {
2681
- fill: ${({ theme }) => theme.colors.primary200};
2682
- }
2683
- > path {
2684
- fill: ${({ theme }) => theme.colors.primary600};
2685
- }
2686
- `;
2687
2754
  const NonRepeatableComponent = ({
2688
2755
  attribute,
2689
2756
  name: name2,
2690
2757
  children,
2691
2758
  layout
2692
2759
  }) => {
2760
+ const { formatMessage } = reactIntl.useIntl();
2693
2761
  const { value } = strapiAdmin.useField(name2);
2694
2762
  const level = Relations.useComponent("NonRepeatableComponent", (state) => state.level);
2695
2763
  const isNested = level > 0;
@@ -2706,6 +2774,10 @@ const NonRepeatableComponent = ({
2706
2774
  children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index2) => {
2707
2775
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2708
2776
  const completeFieldName = `${name2}.${field.name}`;
2777
+ const translatedLabel = formatMessage({
2778
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2779
+ defaultMessage: field.label
2780
+ });
2709
2781
  return /* @__PURE__ */ jsxRuntime.jsx(
2710
2782
  designSystem.Grid.Item,
2711
2783
  {
@@ -2714,7 +2786,7 @@ const NonRepeatableComponent = ({
2714
2786
  xs: 12,
2715
2787
  direction: "column",
2716
2788
  alignItems: "stretch",
2717
- children: children({ ...field, name: completeFieldName })
2789
+ children: children({ ...field, label: translatedLabel, name: completeFieldName })
2718
2790
  },
2719
2791
  completeFieldName
2720
2792
  );
@@ -2736,13 +2808,34 @@ const RepeatableComponent = ({
2736
2808
  const { search: searchString } = reactRouterDom.useLocation();
2737
2809
  const search = React__namespace.useMemo(() => new URLSearchParams(searchString), [searchString]);
2738
2810
  const { components } = index.useDoc();
2739
- const { value = [], error } = strapiAdmin.useField(name2);
2811
+ const {
2812
+ value = [],
2813
+ error,
2814
+ rawError
2815
+ } = strapiAdmin.useField(name2);
2740
2816
  const addFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.addFieldRow);
2741
2817
  const moveFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.moveFieldRow);
2742
2818
  const removeFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.removeFieldRow);
2743
2819
  const { max = Infinity } = attribute;
2744
2820
  const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
2745
2821
  const [liveText, setLiveText] = React__namespace.useState("");
2822
+ React__namespace.useEffect(() => {
2823
+ const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
2824
+ const hasNestedValue = value && Array.isArray(value) && value.length > 0;
2825
+ if (hasNestedErrors && hasNestedValue) {
2826
+ const errorOpenItems = rawError.map((_, idx) => {
2827
+ return value[idx] ? value[idx].__temp_key__ : null;
2828
+ }).filter((value2) => !!value2);
2829
+ if (errorOpenItems && errorOpenItems.length > 0) {
2830
+ setCollapseToOpen((collapseToOpen2) => {
2831
+ if (!errorOpenItems.includes(collapseToOpen2)) {
2832
+ return errorOpenItems[0];
2833
+ }
2834
+ return collapseToOpen2;
2835
+ });
2836
+ }
2837
+ }
2838
+ }, [rawError, value]);
2746
2839
  const componentTmpKeyWithFocussedField = React__namespace.useMemo(() => {
2747
2840
  if (search.has("field")) {
2748
2841
  const fieldParam = search.get("field");
@@ -2757,7 +2850,7 @@ const RepeatableComponent = ({
2757
2850
  }
2758
2851
  return void 0;
2759
2852
  }, [search, name2, value]);
2760
- const prevValue = usePrev.usePrev(value);
2853
+ const prevValue = useDebounce.usePrev(value);
2761
2854
  React__namespace.useEffect(() => {
2762
2855
  if (prevValue && prevValue.length < value.length) {
2763
2856
  setCollapseToOpen(value[value.length - 1].__temp_key__);
@@ -2895,6 +2988,10 @@ const RepeatableComponent = ({
2895
2988
  children: layout.map((row, index22) => {
2896
2989
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2897
2990
  const completeFieldName = `${nameWithIndex}.${field.name}`;
2991
+ const translatedLabel = formatMessage({
2992
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2993
+ defaultMessage: field.label
2994
+ });
2898
2995
  return /* @__PURE__ */ jsxRuntime.jsx(
2899
2996
  designSystem.Grid.Item,
2900
2997
  {
@@ -2903,7 +3000,11 @@ const RepeatableComponent = ({
2903
3000
  xs: 12,
2904
3001
  direction: "column",
2905
3002
  alignItems: "stretch",
2906
- children: children({ ...field, name: completeFieldName })
3003
+ children: children({
3004
+ ...field,
3005
+ label: translatedLabel,
3006
+ name: completeFieldName
3007
+ })
2907
3008
  },
2908
3009
  completeFieldName
2909
3010
  );
@@ -3290,18 +3391,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
3290
3391
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
3291
3392
  ] });
3292
3393
  };
3293
- function useDebounce(value, delay) {
3294
- const [debouncedValue, setDebouncedValue] = React.useState(value);
3295
- React.useEffect(() => {
3296
- const handler = setTimeout(() => {
3297
- setDebouncedValue(value);
3298
- }, delay);
3299
- return () => {
3300
- clearTimeout(handler);
3301
- };
3302
- }, [value, delay]);
3303
- return debouncedValue;
3304
- }
3305
3394
  const uidApi = index.contentManagerApi.injectEndpoints({
3306
3395
  endpoints: (builder) => ({
3307
3396
  getDefaultUID: builder.query({
@@ -3353,7 +3442,7 @@ const UIDInput = React__namespace.forwardRef(
3353
3442
  const [showRegenerate, setShowRegenerate] = React__namespace.useState(false);
3354
3443
  const isCloning = reactRouterDom.useMatch(index.CLONE_PATH) !== null;
3355
3444
  const field = strapiAdmin.useField(name2);
3356
- const debouncedValue = useDebounce(field.value, 300);
3445
+ const debouncedValue = useDebounce.useDebounce(field.value, 300);
3357
3446
  const hasChanged = debouncedValue !== field.initialValue;
3358
3447
  const { toggleNotification } = strapiAdmin.useNotification();
3359
3448
  const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
@@ -3759,8 +3848,7 @@ const Wrapper = styledComponents.styled.div`
3759
3848
  `;
3760
3849
  var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/;
3761
3850
  function newlineAndIndentContinueMarkdownList(cm) {
3762
- if (cm.getOption("disableInput"))
3763
- return CodeMirror__default.default.Pass;
3851
+ if (cm.getOption("disableInput")) return CodeMirror__default.default.Pass;
3764
3852
  var ranges = cm.listSelections(), replacements = [];
3765
3853
  for (var i = 0; i < ranges.length; i++) {
3766
3854
  var pos = ranges[i].head;
@@ -3794,8 +3882,7 @@ function newlineAndIndentContinueMarkdownList(cm) {
3794
3882
  var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
3795
3883
  var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace("x", " ");
3796
3884
  replacements[i] = "\n" + indent + bullet + after;
3797
- if (numbered)
3798
- incrementRemainingMarkdownListNumbers(cm, pos);
3885
+ if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
3799
3886
  }
3800
3887
  }
3801
3888
  cm.replaceSelections(replacements);
@@ -3813,10 +3900,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3813
3900
  var newNumber = parseInt(startItem[3], 10) + lookAhead - skipCount;
3814
3901
  var nextNumber = parseInt(nextItem[3], 10), itemNumber = nextNumber;
3815
3902
  if (startIndent === nextIndent && !isNaN(nextNumber)) {
3816
- if (newNumber === nextNumber)
3817
- itemNumber = nextNumber + 1;
3818
- if (newNumber > nextNumber)
3819
- itemNumber = newNumber + 1;
3903
+ if (newNumber === nextNumber) itemNumber = nextNumber + 1;
3904
+ if (newNumber > nextNumber) itemNumber = newNumber + 1;
3820
3905
  cm.replaceRange(
3821
3906
  nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
3822
3907
  {
@@ -3829,10 +3914,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3829
3914
  }
3830
3915
  );
3831
3916
  } else {
3832
- if (startIndent.length > nextIndent.length)
3833
- return;
3834
- if (startIndent.length < nextIndent.length && lookAhead === 1)
3835
- return;
3917
+ if (startIndent.length > nextIndent.length) return;
3918
+ if (startIndent.length < nextIndent.length && lookAhead === 1) return;
3836
3919
  skipCount += 1;
3837
3920
  }
3838
3921
  }
@@ -4619,31 +4702,11 @@ const quoteAndCodeHandler = (editor, markdownType) => {
4619
4702
  insertWithoutTextToEdit(editor, markdownType, line, contentLength);
4620
4703
  }
4621
4704
  };
4622
- const CustomIconButton = styledComponents.styled(designSystem.IconButton)`
4623
- padding: ${({ theme }) => theme.spaces[2]};
4624
-
4625
- svg {
4626
- width: 1.8rem;
4627
- height: 1.8rem;
4628
- }
4629
- `;
4630
- const CustomLinkIconButton = styledComponents.styled(CustomIconButton)`
4631
- svg {
4632
- width: 0.8rem;
4633
- height: 0.8rem;
4634
- }
4635
- `;
4636
4705
  const MainButtons = styledComponents.styled(designSystem.IconButtonGroup)`
4637
4706
  margin-left: ${({ theme }) => theme.spaces[4]};
4638
4707
  `;
4639
4708
  const MoreButton = styledComponents.styled(designSystem.IconButton)`
4640
4709
  margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
4641
- padding: ${({ theme }) => theme.spaces[2]};
4642
-
4643
- svg {
4644
- width: 1.8rem;
4645
- height: 1.8rem;
4646
- }
4647
4710
  `;
4648
4711
  const IconButtonGroupMargin = styledComponents.styled(designSystem.IconButtonGroup)`
4649
4712
  margin-right: ${({ theme }) => `${theme.spaces[2]}`};
@@ -4727,9 +4790,9 @@ const WysiwygNav = ({
4727
4790
  }
4728
4791
  ) }),
4729
4792
  /* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
4730
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4731
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
4732
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
4793
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4794
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
4795
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
4733
4796
  ] }),
4734
4797
  /* @__PURE__ */ jsxRuntime.jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) })
4735
4798
  ] }),
@@ -4768,17 +4831,9 @@ const WysiwygNav = ({
4768
4831
  }
4769
4832
  ) }),
4770
4833
  /* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
4834
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4771
4835
  /* @__PURE__ */ jsxRuntime.jsx(
4772
- CustomIconButton,
4773
- {
4774
- onClick: () => onActionClick("Bold", editorRef),
4775
- label: "Bold",
4776
- name: "Bold",
4777
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {})
4778
- }
4779
- ),
4780
- /* @__PURE__ */ jsxRuntime.jsx(
4781
- CustomIconButton,
4836
+ designSystem.IconButton,
4782
4837
  {
4783
4838
  onClick: () => onActionClick("Italic", editorRef),
4784
4839
  label: "Italic",
@@ -4787,7 +4842,7 @@ const WysiwygNav = ({
4787
4842
  }
4788
4843
  ),
4789
4844
  /* @__PURE__ */ jsxRuntime.jsx(
4790
- CustomIconButton,
4845
+ designSystem.IconButton,
4791
4846
  {
4792
4847
  onClick: () => onActionClick("Underline", editorRef),
4793
4848
  label: "Underline",
@@ -4801,7 +4856,7 @@ const WysiwygNav = ({
4801
4856
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 2, children: [
4802
4857
  /* @__PURE__ */ jsxRuntime.jsxs(IconButtonGroupMargin, { children: [
4803
4858
  /* @__PURE__ */ jsxRuntime.jsx(
4804
- CustomIconButton,
4859
+ designSystem.IconButton,
4805
4860
  {
4806
4861
  onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4807
4862
  label: "Strikethrough",
@@ -4810,7 +4865,7 @@ const WysiwygNav = ({
4810
4865
  }
4811
4866
  ),
4812
4867
  /* @__PURE__ */ jsxRuntime.jsx(
4813
- CustomIconButton,
4868
+ designSystem.IconButton,
4814
4869
  {
4815
4870
  onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4816
4871
  label: "BulletList",
@@ -4819,7 +4874,7 @@ const WysiwygNav = ({
4819
4874
  }
4820
4875
  ),
4821
4876
  /* @__PURE__ */ jsxRuntime.jsx(
4822
- CustomIconButton,
4877
+ designSystem.IconButton,
4823
4878
  {
4824
4879
  onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4825
4880
  label: "NumberList",
@@ -4830,7 +4885,7 @@ const WysiwygNav = ({
4830
4885
  ] }),
4831
4886
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.IconButtonGroup, { children: [
4832
4887
  /* @__PURE__ */ jsxRuntime.jsx(
4833
- CustomIconButton,
4888
+ designSystem.IconButton,
4834
4889
  {
4835
4890
  onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4836
4891
  label: "Code",
@@ -4839,7 +4894,7 @@ const WysiwygNav = ({
4839
4894
  }
4840
4895
  ),
4841
4896
  /* @__PURE__ */ jsxRuntime.jsx(
4842
- CustomIconButton,
4897
+ designSystem.IconButton,
4843
4898
  {
4844
4899
  onClick: () => {
4845
4900
  handleTogglePopover();
@@ -4851,7 +4906,7 @@ const WysiwygNav = ({
4851
4906
  }
4852
4907
  ),
4853
4908
  /* @__PURE__ */ jsxRuntime.jsx(
4854
- CustomLinkIconButton,
4909
+ designSystem.IconButton,
4855
4910
  {
4856
4911
  onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4857
4912
  label: "Link",
@@ -4860,7 +4915,7 @@ const WysiwygNav = ({
4860
4915
  }
4861
4916
  ),
4862
4917
  /* @__PURE__ */ jsxRuntime.jsx(
4863
- CustomIconButton,
4918
+ designSystem.IconButton,
4864
4919
  {
4865
4920
  onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4866
4921
  label: "Quote",
@@ -4938,7 +4993,7 @@ const Wysiwyg = React__namespace.forwardRef(
4938
4993
  const handleSelectAssets = (files) => {
4939
4994
  const formattedFiles = files.map((f) => ({
4940
4995
  alt: f.alternativeText || f.name,
4941
- url: usePrev.prefixFileUrlWithBackendUrl(f.url),
4996
+ url: useDebounce.prefixFileUrlWithBackendUrl(f.url),
4942
4997
  mime: f.mime
4943
4998
  }));
4944
4999
  insertFile(editorRef, formattedFiles);
@@ -4997,15 +5052,19 @@ const Wysiwyg = React__namespace.forwardRef(
4997
5052
  );
4998
5053
  const MemoizedWysiwyg = React__namespace.memo(Wysiwyg);
4999
5054
  const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
5000
- const { id } = index.useDoc();
5055
+ const { id, document: document2, collectionType } = index.useDoc();
5001
5056
  const isFormDisabled = strapiAdmin.useForm("InputRenderer", (state) => state.disabled);
5002
5057
  const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
5003
5058
  const canCreateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
5004
5059
  const canReadFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
5005
5060
  const canUpdateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
5006
5061
  const canUserAction = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
5007
- const editableFields = id ? canUpdateFields : canCreateFields;
5008
- const readableFields = id ? canReadFields : canCreateFields;
5062
+ let idToCheck = id;
5063
+ if (collectionType === index.SINGLE_TYPES) {
5064
+ idToCheck = document2?.documentId;
5065
+ }
5066
+ const editableFields = idToCheck ? canUpdateFields : canCreateFields;
5067
+ const readableFields = idToCheck ? canReadFields : canCreateFields;
5009
5068
  const canUserReadField = canUserAction(props.name, readableFields, props.type);
5010
5069
  const canUserEditField = canUserAction(props.name, editableFields, props.type);
5011
5070
  const fields = strapiAdmin.useStrapiApp("InputRenderer", (app) => app.fields);
@@ -5016,6 +5075,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
5016
5075
  const {
5017
5076
  edit: { components }
5018
5077
  } = index.useDocLayout();
5078
+ const field = strapiAdmin.useField(props.name);
5019
5079
  if (!visible) {
5020
5080
  return null;
5021
5081
  }
@@ -5026,7 +5086,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
5026
5086
  if (attributeHasCustomFieldProperty(props.attribute)) {
5027
5087
  const CustomInput = lazyComponentStore[props.attribute.customField];
5028
5088
  if (CustomInput) {
5029
- return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
5089
+ return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
5030
5090
  }
5031
5091
  return /* @__PURE__ */ jsxRuntime.jsx(
5032
5092
  strapiAdmin.InputRenderer,
@@ -5187,6 +5247,14 @@ const DynamicComponent = ({
5187
5247
  React__namespace.useEffect(() => {
5188
5248
  dragPreviewRef(reactDndHtml5Backend.getEmptyImage(), { captureDraggingState: false });
5189
5249
  }, [dragPreviewRef, index$1]);
5250
+ const accordionValue = React__namespace.useId();
5251
+ const { value = [], rawError } = strapiAdmin.useField(`${name2}.${index$1}`);
5252
+ const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
5253
+ React__namespace.useEffect(() => {
5254
+ if (rawError && value) {
5255
+ setCollapseToOpen(accordionValue);
5256
+ }
5257
+ }, [rawError, value, accordionValue]);
5190
5258
  const composedBoxRefs = designSystem.useComposedRefs(boxRef, dropRef);
5191
5259
  const accordionActions = disabled ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5192
5260
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -5252,10 +5320,9 @@ const DynamicComponent = ({
5252
5320
  ] })
5253
5321
  ] });
5254
5322
  const accordionTitle = title ? `${displayName} ${title}` : displayName;
5255
- const accordionValue = React__namespace.useId();
5256
5323
  return /* @__PURE__ */ jsxRuntime.jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
5257
5324
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Rectangle, { background: "neutral200" }) }),
5258
- /* @__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: [
5325
+ /* @__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: [
5259
5326
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Header, { children: [
5260
5327
  /* @__PURE__ */ jsxRuntime.jsx(
5261
5328
  designSystem.Accordion.Trigger,
@@ -5266,21 +5333,39 @@ const DynamicComponent = ({
5266
5333
  ),
5267
5334
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Actions, { children: accordionActions })
5268
5335
  ] }),
5269
- /* @__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.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5270
- const fieldName = `${name2}.${index$1}.${field.name}`;
5271
- return /* @__PURE__ */ jsxRuntime.jsx(
5272
- designSystem.Grid.Item,
5273
- {
5274
- col: size,
5275
- s: 12,
5276
- xs: 12,
5277
- direction: "column",
5278
- alignItems: "stretch",
5279
- children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...field, name: fieldName })
5280
- },
5281
- fieldName
5282
- );
5283
- }) }, rowInd)) }) }) })
5336
+ /* @__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(
5337
+ designSystem.Grid.Item,
5338
+ {
5339
+ col: 12,
5340
+ s: 12,
5341
+ xs: 12,
5342
+ direction: "column",
5343
+ alignItems: "stretch",
5344
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5345
+ const fieldName = `${name2}.${index$1}.${field.name}`;
5346
+ const fieldWithTranslatedLabel = {
5347
+ ...field,
5348
+ label: formatMessage({
5349
+ id: `content-manager.components.${componentUid}.${field.name}`,
5350
+ defaultMessage: field.label
5351
+ })
5352
+ };
5353
+ return /* @__PURE__ */ jsxRuntime.jsx(
5354
+ designSystem.Grid.Item,
5355
+ {
5356
+ col: size,
5357
+ s: 12,
5358
+ xs: 12,
5359
+ direction: "column",
5360
+ alignItems: "stretch",
5361
+ children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...fieldWithTranslatedLabel, name: fieldName })
5362
+ },
5363
+ fieldName
5364
+ );
5365
+ }) })
5366
+ },
5367
+ rowInd
5368
+ )) }) }) }) })
5284
5369
  ] }) }) })
5285
5370
  ] });
5286
5371
  };
@@ -5586,4 +5671,4 @@ exports.transformDocument = transformDocument;
5586
5671
  exports.useDynamicZone = useDynamicZone;
5587
5672
  exports.useFieldHint = useFieldHint;
5588
5673
  exports.useLazyComponents = useLazyComponents;
5589
- //# sourceMappingURL=Field-dq8Tg1M_.js.map
5674
+ //# sourceMappingURL=Field-B5QXnctJ.js.map