@strapi/content-manager 0.0.0-next.840550dc97a3782302ddf918d3a0d07e59dd11eb → 0.0.0-next.8414b837972392b1d362ae53b86b5da1eb2ad05c

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 (158) 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-gsCd80MU.js → ComponentConfigurationPage-BTR_hQow.js} +4 -5
  4. package/dist/_chunks/{ComponentConfigurationPage-gsCd80MU.js.map → ComponentConfigurationPage-BTR_hQow.js.map} +1 -1
  5. package/dist/_chunks/{ComponentConfigurationPage-CIjXcRAB.mjs → ComponentConfigurationPage-bLQr82ce.mjs} +3 -3
  6. package/dist/_chunks/{ComponentConfigurationPage-CIjXcRAB.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-BglmD_BF.mjs → EditConfigurationPage-BhRSnUsL.mjs} +3 -3
  11. package/dist/_chunks/{EditConfigurationPage-BglmD_BF.mjs.map → EditConfigurationPage-BhRSnUsL.mjs.map} +1 -1
  12. package/dist/_chunks/{EditConfigurationPage-DHDQKBzw.js → EditConfigurationPage-z39Wv3E6.js} +4 -5
  13. package/dist/_chunks/{EditConfigurationPage-DHDQKBzw.js.map → EditConfigurationPage-z39Wv3E6.js.map} +1 -1
  14. package/dist/_chunks/{EditViewPage-CiwVPMaK.mjs → EditViewPage-BCjNxNlY.mjs} +38 -8
  15. package/dist/_chunks/EditViewPage-BCjNxNlY.mjs.map +1 -0
  16. package/dist/_chunks/{EditViewPage-C4iTxUPU.js → EditViewPage-wujOq90c.js} +38 -9
  17. package/dist/_chunks/EditViewPage-wujOq90c.js.map +1 -0
  18. package/dist/_chunks/{Field-DhXEK8y1.js → Field-B5QXnctJ.js} +151 -72
  19. package/dist/_chunks/Field-B5QXnctJ.js.map +1 -0
  20. package/dist/_chunks/{Field-DIjL1b5d.mjs → Field-Byr3mPTl.mjs} +149 -70
  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-CmNesrvR.mjs → Form-BZgvE8C8.mjs} +3 -3
  25. package/dist/_chunks/{Form-CmNesrvR.mjs.map → Form-BZgvE8C8.mjs.map} +1 -1
  26. package/dist/_chunks/{Form-CwmJ4sWe.js → Form-D7mexvm3.js} +5 -6
  27. package/dist/_chunks/{Form-CwmJ4sWe.js.map → Form-D7mexvm3.js.map} +1 -1
  28. package/dist/_chunks/{History-D-99Wh30.mjs → History-CqNgxkqK.mjs} +22 -92
  29. package/dist/_chunks/History-CqNgxkqK.mjs.map +1 -0
  30. package/dist/_chunks/{History-BLCCNgCt.js → History-DYl2A8Z_.js} +22 -93
  31. package/dist/_chunks/History-DYl2A8Z_.js.map +1 -0
  32. package/dist/_chunks/{ListConfigurationPage-DxWpeZrO.js → ListConfigurationPage-BXnu_OoY.js} +6 -6
  33. package/dist/_chunks/ListConfigurationPage-BXnu_OoY.js.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-JPWZz7Kg.mjs → ListConfigurationPage-BbQjzKkQ.mjs} +6 -5
  35. package/dist/_chunks/ListConfigurationPage-BbQjzKkQ.mjs.map +1 -0
  36. package/dist/_chunks/{ListViewPage-CIQekSFz.js → ListViewPage-BtSi8C1l.js} +64 -53
  37. package/dist/_chunks/ListViewPage-BtSi8C1l.js.map +1 -0
  38. package/dist/_chunks/{ListViewPage-DSK3f0ST.mjs → ListViewPage-D4ofkbjR.mjs} +63 -51
  39. package/dist/_chunks/ListViewPage-D4ofkbjR.mjs.map +1 -0
  40. package/dist/_chunks/{NoContentTypePage-C5cxKvC2.js → NoContentTypePage-CitJeOq4.js} +2 -2
  41. package/dist/_chunks/{NoContentTypePage-C5cxKvC2.js.map → NoContentTypePage-CitJeOq4.js.map} +1 -1
  42. package/dist/_chunks/{NoContentTypePage-D99LU1YP.mjs → NoContentTypePage-DyUx5mXh.mjs} +2 -2
  43. package/dist/_chunks/{NoContentTypePage-D99LU1YP.mjs.map → NoContentTypePage-DyUx5mXh.mjs.map} +1 -1
  44. package/dist/_chunks/{NoPermissionsPage-DBrBw-0y.mjs → NoPermissionsPage-DhIiyWkk.mjs} +2 -2
  45. package/dist/_chunks/{NoPermissionsPage-DBrBw-0y.mjs.map → NoPermissionsPage-DhIiyWkk.mjs.map} +1 -1
  46. package/dist/_chunks/{NoPermissionsPage-Oy4tmUrW.js → NoPermissionsPage-DzgWz0M-.js} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-Oy4tmUrW.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-BBmhcWFV.mjs → Relations-DM2yUTST.mjs} +9 -8
  53. package/dist/_chunks/Relations-DM2yUTST.mjs.map +1 -0
  54. package/dist/_chunks/{Relations-eG-9p_qS.js → Relations-DuKCaXrv.js} +10 -10
  55. package/dist/_chunks/Relations-DuKCaXrv.js.map +1 -0
  56. package/dist/_chunks/{en-Bm0D0IWz.js → en-BK8Xyl5I.js} +16 -4
  57. package/dist/_chunks/{en-Bm0D0IWz.js.map → en-BK8Xyl5I.js.map} +1 -1
  58. package/dist/_chunks/{en-DKV44jRb.mjs → en-Dtk_ot79.mjs} +16 -4
  59. package/dist/_chunks/{en-DKV44jRb.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-BIWDoFLK.js → index-BUWEmX8m.js} +324 -181
  70. package/dist/_chunks/index-BUWEmX8m.js.map +1 -0
  71. package/dist/_chunks/{index-BrUzbQ30.mjs → index-DVAIIsOs.mjs} +327 -183
  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-_5-cXs34.mjs → layout-Bxsv5mP7.mjs} +4 -4
  78. package/dist/_chunks/{layout-_5-cXs34.mjs.map → layout-Bxsv5mP7.mjs.map} +1 -1
  79. package/dist/_chunks/{layout-lMc9i1-Z.js → layout-C3fN7Ejz.js} +5 -6
  80. package/dist/_chunks/{layout-lMc9i1-Z.js.map → layout-C3fN7Ejz.js.map} +1 -1
  81. package/dist/_chunks/objects-BcXOv6_9.js.map +1 -1
  82. package/dist/_chunks/objects-D6yBsdmx.mjs.map +1 -1
  83. package/dist/_chunks/{relations-BRHithi8.js → relations-BPZKAoEY.js} +6 -3
  84. package/dist/_chunks/relations-BPZKAoEY.js.map +1 -0
  85. package/dist/_chunks/{relations-B_VLk-DD.mjs → relations-o3pPhzY4.mjs} +6 -3
  86. package/dist/_chunks/relations-o3pPhzY4.mjs.map +1 -0
  87. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -1
  88. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -1
  89. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
  90. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
  91. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
  92. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
  93. package/dist/admin/index.js +1 -1
  94. package/dist/admin/index.mjs +4 -4
  95. package/dist/admin/src/content-manager.d.ts +3 -2
  96. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  97. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
  98. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
  99. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  100. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  101. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  102. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  103. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  104. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  105. package/dist/admin/src/preview/index.d.ts +1 -1
  106. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  107. package/dist/admin/src/preview/routes.d.ts +3 -0
  108. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  109. package/dist/admin/src/router.d.ts +1 -1
  110. package/dist/admin/src/services/documents.d.ts +0 -3
  111. package/dist/server/index.js +138 -59
  112. package/dist/server/index.js.map +1 -1
  113. package/dist/server/index.mjs +138 -58
  114. package/dist/server/index.mjs.map +1 -1
  115. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  116. package/dist/server/src/preview/controllers/preview.d.ts +6 -2
  117. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -1
  118. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  119. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  120. package/dist/server/src/preview/index.d.ts.map +1 -1
  121. package/dist/server/src/preview/services/index.d.ts +6 -1
  122. package/dist/server/src/preview/services/index.d.ts.map +1 -1
  123. package/dist/server/src/preview/services/preview-config.d.ts +2 -0
  124. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -1
  125. package/dist/server/src/preview/services/preview.d.ts +7 -1
  126. package/dist/server/src/preview/services/preview.d.ts.map +1 -1
  127. package/dist/server/src/preview/utils.d.ts +6 -1
  128. package/dist/server/src/preview/utils.d.ts.map +1 -1
  129. package/dist/server/src/register.d.ts.map +1 -1
  130. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  131. package/dist/shared/contracts/index.d.ts +1 -0
  132. package/dist/shared/contracts/index.d.ts.map +1 -1
  133. package/dist/shared/contracts/preview.d.ts +27 -0
  134. package/dist/shared/contracts/preview.d.ts.map +1 -0
  135. package/dist/shared/index.js +4 -0
  136. package/dist/shared/index.js.map +1 -1
  137. package/dist/shared/index.mjs +4 -0
  138. package/dist/shared/index.mjs.map +1 -1
  139. package/package.json +13 -11
  140. package/dist/_chunks/EditViewPage-C4iTxUPU.js.map +0 -1
  141. package/dist/_chunks/EditViewPage-CiwVPMaK.mjs.map +0 -1
  142. package/dist/_chunks/Field-DIjL1b5d.mjs.map +0 -1
  143. package/dist/_chunks/Field-DhXEK8y1.js.map +0 -1
  144. package/dist/_chunks/History-BLCCNgCt.js.map +0 -1
  145. package/dist/_chunks/History-D-99Wh30.mjs.map +0 -1
  146. package/dist/_chunks/ListConfigurationPage-DxWpeZrO.js.map +0 -1
  147. package/dist/_chunks/ListConfigurationPage-JPWZz7Kg.mjs.map +0 -1
  148. package/dist/_chunks/ListViewPage-CIQekSFz.js.map +0 -1
  149. package/dist/_chunks/ListViewPage-DSK3f0ST.mjs.map +0 -1
  150. package/dist/_chunks/Relations-BBmhcWFV.mjs.map +0 -1
  151. package/dist/_chunks/Relations-eG-9p_qS.js.map +0 -1
  152. package/dist/_chunks/index-BIWDoFLK.js.map +0 -1
  153. package/dist/_chunks/index-BrUzbQ30.mjs.map +0 -1
  154. package/dist/_chunks/relations-BRHithi8.js.map +0 -1
  155. package/dist/_chunks/relations-B_VLk-DD.mjs.map +0 -1
  156. package/dist/admin/src/preview/constants.d.ts +0 -1
  157. package/dist/server/src/preview/constants.d.ts +0 -2
  158. package/dist/server/src/preview/constants.d.ts.map +0 -1
@@ -5,18 +5,69 @@ import { useStrapiApp, createContext, useField, useNotification, useForm, useAPI
5
5
  import { Box, SingleSelect, SingleSelectOption, Typography, Flex, BaseLink, Button, Popover, Field, Tooltip, IconButton, useComposedRefs, Portal, FocusTrap, Divider, VisuallyHidden, Grid as Grid$1, Accordion, TextButton, TextInput, IconButtonGroup, Menu, MenuItem } from "@strapi/design-system";
6
6
  import pipe$1 from "lodash/fp/pipe";
7
7
  import { useIntl } from "react-intl";
8
- import { m as DOCUMENT_META_FIELDS, g as getTranslation, c as useDoc, e as contentManagerApi, n as CLONE_PATH, d as buildValidParams, f as useDocumentRBAC, S as SINGLE_TYPES, o as useDocLayout } from "./index-BrUzbQ30.mjs";
8
+ import { m as DOCUMENT_META_FIELDS, g as getTranslation, c as useDoc, e as contentManagerApi, n as CLONE_PATH, d as buildValidParams, f as useDocumentRBAC, S as SINGLE_TYPES, o as useDocLayout } from "./index-DVAIIsOs.mjs";
9
9
  import { generateNKeysBetween } from "fractional-indexing";
10
- import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-BBmhcWFV.mjs";
11
- import { Code, HeadingOne, HeadingTwo, HeadingThree, HeadingFour, HeadingFive, HeadingSix, Image as Image$1, NumberList, BulletList, Paragraph, Quotes, Link as Link$1, Drag, Collapse, Bold, Italic, Underline, StrikeThrough, Expand, PlusCircle, Plus, Trash, EyeStriked, CheckCircle, WarningCircle, Loader, ArrowClockwise, More } from "@strapi/icons";
10
+ import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-DM2yUTST.mjs";
11
+ import { CodeBlock as CodeBlock$1, HeadingOne, HeadingTwo, HeadingThree, HeadingFour, HeadingFive, HeadingSix, Image as Image$1, NumberList, BulletList, Paragraph, Quotes, Link as Link$1, Drag, Collapse, Bold, Italic, Underline, StrikeThrough, Code, Expand, PlusCircle, Plus, Trash, EyeStriked, CheckCircle, WarningCircle, Loader, ArrowClockwise, More } from "@strapi/icons";
12
12
  import { styled, css, keyframes } from "styled-components";
13
13
  import { C as ComponentIcon, a as COMPONENT_ICONS } from "./ComponentIcon-u4bIXTFY.mjs";
14
14
  import { getEmptyImage } from "react-dnd-html5-backend";
15
- import { a as DIRECTIONS, u as useDragAndDrop, I as ItemTypes } from "./useDragAndDrop-DdHgKsqq.mjs";
15
+ import { a as DIRECTIONS, u as useDragAndDrop, I as ItemTypes } from "./useDragAndDrop-DJ6jqvZN.mjs";
16
16
  import { g as getIn } from "./objects-D6yBsdmx.mjs";
17
17
  import { Editor as Editor$1, Transforms, Node, Element, Range, Path, Point, createEditor } from "slate";
18
18
  import { withHistory } from "slate-history";
19
19
  import { useFocused, useSelected, ReactEditor, Editable, useSlate, Slate, withReact } from "slate-react";
20
+ import * as Prism from "prismjs";
21
+ import "prismjs/themes/prism-solarizedlight.css";
22
+ import "prismjs/components/prism-asmatmel";
23
+ import "prismjs/components/prism-bash";
24
+ import "prismjs/components/prism-basic";
25
+ import "prismjs/components/prism-c";
26
+ import "prismjs/components/prism-clojure";
27
+ import "prismjs/components/prism-cobol";
28
+ import "prismjs/components/prism-cpp";
29
+ import "prismjs/components/prism-csharp";
30
+ import "prismjs/components/prism-dart";
31
+ import "prismjs/components/prism-docker";
32
+ import "prismjs/components/prism-elixir";
33
+ import "prismjs/components/prism-erlang";
34
+ import "prismjs/components/prism-fortran";
35
+ import "prismjs/components/prism-fsharp";
36
+ import "prismjs/components/prism-go";
37
+ import "prismjs/components/prism-graphql";
38
+ import "prismjs/components/prism-groovy";
39
+ import "prismjs/components/prism-haskell";
40
+ import "prismjs/components/prism-haxe";
41
+ import "prismjs/components/prism-ini";
42
+ import "prismjs/components/prism-java";
43
+ import "prismjs/components/prism-javascript";
44
+ import "prismjs/components/prism-jsx";
45
+ import "prismjs/components/prism-json";
46
+ import "prismjs/components/prism-julia";
47
+ import "prismjs/components/prism-kotlin";
48
+ import "prismjs/components/prism-latex";
49
+ import "prismjs/components/prism-lua";
50
+ import "prismjs/components/prism-markdown";
51
+ import "prismjs/components/prism-matlab";
52
+ import "prismjs/components/prism-makefile";
53
+ import "prismjs/components/prism-objectivec";
54
+ import "prismjs/components/prism-perl";
55
+ import "prismjs/components/prism-php";
56
+ import "prismjs/components/prism-powershell";
57
+ import "prismjs/components/prism-python";
58
+ import "prismjs/components/prism-r";
59
+ import "prismjs/components/prism-ruby";
60
+ import "prismjs/components/prism-rust";
61
+ import "prismjs/components/prism-sas";
62
+ import "prismjs/components/prism-scala";
63
+ import "prismjs/components/prism-scheme";
64
+ import "prismjs/components/prism-sql";
65
+ import "prismjs/components/prism-stata";
66
+ import "prismjs/components/prism-swift";
67
+ import "prismjs/components/prism-typescript";
68
+ import "prismjs/components/prism-tsx";
69
+ import "prismjs/components/prism-vbnet";
70
+ import "prismjs/components/prism-yaml";
20
71
  import { p as prefixFileUrlWithBackendUrl, u as usePrev, a as useDebounce } from "./useDebounce-DmuSJIF3.mjs";
21
72
  import * as Toolbar from "@radix-ui/react-toolbar";
22
73
  import { useLocation, useMatch } from "react-router-dom";
@@ -163,7 +214,8 @@ const useLazyComponents = (componentUids = []) => {
163
214
  const codeLanguages = [
164
215
  {
165
216
  value: "asm",
166
- label: "Assembly"
217
+ label: "Assembly",
218
+ decorate: "asmatmel"
167
219
  },
168
220
  {
169
221
  value: "bash",
@@ -199,7 +251,8 @@ const codeLanguages = [
199
251
  },
200
252
  {
201
253
  value: "dockerfile",
202
- label: "Dockerfile"
254
+ label: "Dockerfile",
255
+ decorate: "docker"
203
256
  },
204
257
  {
205
258
  value: "elixir",
@@ -355,7 +408,8 @@ const codeLanguages = [
355
408
  },
356
409
  {
357
410
  value: "typescript",
358
- label: "TypeScript"
411
+ label: "TypeScript",
412
+ decorate: "ts"
359
413
  },
360
414
  {
361
415
  value: "tsx",
@@ -371,7 +425,8 @@ const codeLanguages = [
371
425
  },
372
426
  {
373
427
  value: "yaml",
374
- label: "YAML"
428
+ label: "YAML",
429
+ decorate: "yml"
375
430
  }
376
431
  ];
377
432
  const baseHandleConvert = (editor, attributesToSet) => {
@@ -437,6 +492,29 @@ const pressEnterTwiceToExit = (editor) => {
437
492
  });
438
493
  }
439
494
  };
495
+ const decorateCode = ([node, path]) => {
496
+ const ranges = [];
497
+ if (!Element.isElement(node) || node.type !== "code") return ranges;
498
+ const text = Node.string(node);
499
+ const language = codeLanguages.find((lang) => lang.value === node.language);
500
+ const decorateKey = language?.decorate ?? language?.value;
501
+ const selectedLanguage = Prism.languages[decorateKey || "plaintext"];
502
+ const tokens = Prism.tokenize(text, selectedLanguage);
503
+ let start = 0;
504
+ for (const token of tokens) {
505
+ const length = token.length;
506
+ const end = start + length;
507
+ if (typeof token !== "string") {
508
+ ranges.push({
509
+ anchor: { path, offset: start },
510
+ focus: { path, offset: end },
511
+ className: `token ${token.type}`
512
+ });
513
+ }
514
+ start = end;
515
+ }
516
+ return ranges;
517
+ };
440
518
  const CodeBlock = styled.pre`
441
519
  border-radius: ${({ theme }) => theme.borderRadius};
442
520
  background-color: ${({ theme }) => theme.colors.neutral100};
@@ -508,7 +586,7 @@ const CodeEditor = (props) => {
508
586
  const codeBlocks = {
509
587
  code: {
510
588
  renderElement: (props) => /* @__PURE__ */ jsx(CodeEditor, { ...props }),
511
- icon: Code,
589
+ icon: CodeBlock$1,
512
590
  label: {
513
591
  id: "components.Blocks.blocks.code",
514
592
  defaultMessage: "Code block"
@@ -697,8 +775,7 @@ const ImageDialog = () => {
697
775
  const [isOpen, setIsOpen] = React.useState(true);
698
776
  const { editor } = useBlocksEditorContext("ImageDialog");
699
777
  const components = useStrapiApp("ImageDialog", (state) => state.components);
700
- if (!components || !isOpen)
701
- return null;
778
+ if (!components || !isOpen) return null;
702
779
  const MediaLibraryDialog = components["media-library"];
703
780
  const insertImages = (images) => {
704
781
  Transforms.unwrapNodes(editor, {
@@ -707,14 +784,12 @@ const ImageDialog = () => {
707
784
  });
708
785
  const nodeEntryBeingReplaced = Editor$1.above(editor, {
709
786
  match(node) {
710
- if (Editor$1.isEditor(node))
711
- return false;
787
+ if (Editor$1.isEditor(node)) return false;
712
788
  const isInlineNode = ["text", "link"].includes(node.type);
713
789
  return !isInlineNode;
714
790
  }
715
791
  });
716
- if (!nodeEntryBeingReplaced)
717
- return;
792
+ if (!nodeEntryBeingReplaced) return;
718
793
  const [, pathToInsert] = nodeEntryBeingReplaced;
719
794
  Transforms.removeNodes(editor);
720
795
  const nodesToInsert = images.map((image) => {
@@ -892,8 +967,7 @@ const LinkContent = React.forwardRef(
892
967
  ReactEditor.focus(editor);
893
968
  };
894
969
  React.useEffect(() => {
895
- if (popoverOpen)
896
- linkInputRef.current?.focus();
970
+ if (popoverOpen) linkInputRef.current?.focus();
897
971
  }, [popoverOpen]);
898
972
  const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
899
973
  return /* @__PURE__ */ jsxs(Popover.Root, { open: popoverOpen, children: [
@@ -963,11 +1037,11 @@ const LinkContent = React.forwardRef(
963
1037
  ),
964
1038
  /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
965
1039
  /* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
966
- id: "components.Blocks.popover.cancel",
1040
+ id: "global.cancel",
967
1041
  defaultMessage: "Cancel"
968
1042
  }) }),
969
1043
  /* @__PURE__ */ jsx(Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
970
- id: "components.Blocks.popover.save",
1044
+ id: "global.save",
971
1045
  defaultMessage: "Save"
972
1046
  }) })
973
1047
  ] })
@@ -1048,8 +1122,7 @@ const isText$1 = (node) => {
1048
1122
  return Node.isNode(node) && !Editor$1.isEditor(node) && node.type === "text";
1049
1123
  };
1050
1124
  const handleBackspaceKeyOnList = (editor, event) => {
1051
- if (!editor.selection)
1052
- return;
1125
+ if (!editor.selection) return;
1053
1126
  const [currentListItem, currentListItemPath] = Editor$1.parent(editor, editor.selection.anchor);
1054
1127
  const [currentList, currentListPath] = Editor$1.parent(editor, currentListItemPath);
1055
1128
  const isListEmpty = currentList.children.length === 1 && isText$1(currentListItem.children[0]) && currentListItem.children[0].text === "";
@@ -1158,8 +1231,7 @@ const handleEnterKeyOnList = (editor) => {
1158
1231
  };
1159
1232
  const handleConvertToList = (editor, format) => {
1160
1233
  const convertedPath = baseHandleConvert(editor, { type: "list-item" });
1161
- if (!convertedPath)
1162
- return;
1234
+ if (!convertedPath) return;
1163
1235
  Transforms.wrapNodes(editor, { type: "list", format, children: [] }, { at: convertedPath });
1164
1236
  };
1165
1237
  const handleTabOnList = (editor) => {
@@ -1171,8 +1243,7 @@ const handleTabOnList = (editor) => {
1171
1243
  }
1172
1244
  const [currentListItem, currentListItemPath] = currentListItemEntry;
1173
1245
  const [currentList] = Editor$1.parent(editor, currentListItemPath);
1174
- if (currentListItem === currentList.children[0])
1175
- return;
1246
+ if (currentListItem === currentList.children[0]) return;
1176
1247
  const currentListItemIndex = currentList.children.findIndex((item) => item === currentListItem);
1177
1248
  const previousNode = currentList.children[currentListItemIndex - 1];
1178
1249
  if (previousNode.type === "list") {
@@ -1539,8 +1610,7 @@ const isListNode = (node) => {
1539
1610
  const ListButton = ({ block, format }) => {
1540
1611
  const { editor, disabled, blocks } = useBlocksEditorContext("ListButton");
1541
1612
  const isListActive = () => {
1542
- if (!editor.selection)
1543
- return false;
1613
+ if (!editor.selection) return false;
1544
1614
  const currentListEntry = Editor$1.above(editor, {
1545
1615
  match: (node) => !Editor$1.isEditor(node) && node.type === "list",
1546
1616
  at: editor.selection.anchor
@@ -1614,8 +1684,7 @@ const LinkButton = ({ disabled }) => {
1614
1684
  const { editor } = useBlocksEditorContext("LinkButton");
1615
1685
  const isLinkActive = () => {
1616
1686
  const { selection } = editor;
1617
- if (!selection)
1618
- return false;
1687
+ if (!selection) return false;
1619
1688
  const [match] = Array.from(
1620
1689
  Editor$1.nodes(editor, {
1621
1690
  at: Editor$1.unhangRange(editor, selection),
@@ -1821,8 +1890,7 @@ const DragAndDropElement = ({
1821
1890
  displayedValue: children
1822
1891
  },
1823
1892
  onDropItem(currentIndex, newIndex) {
1824
- if (newIndex)
1825
- handleMoveBlock(newIndex, currentIndex);
1893
+ if (newIndex) handleMoveBlock(newIndex, currentIndex);
1826
1894
  }
1827
1895
  });
1828
1896
  const composedBoxRefs = useComposedRefs(blockRef, dropRef);
@@ -1928,7 +1996,7 @@ const baseRenderLeaf = (props, modifiers2) => {
1928
1996
  }
1929
1997
  return currentChildren;
1930
1998
  }, props.children);
1931
- return /* @__PURE__ */ jsx("span", { ...props.attributes, children: wrappedChildren });
1999
+ return /* @__PURE__ */ jsx("span", { ...props.attributes, className: props.leaf.className, children: wrappedChildren });
1932
2000
  };
1933
2001
  const baseRenderElement = ({
1934
2002
  props,
@@ -1966,8 +2034,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
1966
2034
  [modifiers2]
1967
2035
  );
1968
2036
  const handleMoveBlocks = (editor2, event) => {
1969
- if (!editor2.selection)
1970
- return;
2037
+ if (!editor2.selection) return;
1971
2038
  const start = Range.start(editor2.selection);
1972
2039
  const currentIndex = [start.path[0]];
1973
2040
  let newIndexPosition = 0;
@@ -2104,8 +2171,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
2104
2171
  }
2105
2172
  };
2106
2173
  const handleScrollSelectionIntoView = () => {
2107
- if (!editor.selection)
2108
- return;
2174
+ if (!editor.selection) return;
2109
2175
  const domRange = ReactEditor.toDOMRange(editor, editor.selection);
2110
2176
  const domRect = domRange.getBoundingClientRect();
2111
2177
  const blocksInput = blocksRef.current;
@@ -2143,6 +2209,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
2143
2209
  readOnly: disabled,
2144
2210
  placeholder,
2145
2211
  isExpandedMode,
2212
+ decorate: decorateCode,
2146
2213
  renderElement,
2147
2214
  renderLeaf,
2148
2215
  onKeyDown: handleKeyDown,
@@ -2299,8 +2366,7 @@ const InlineCode = styled.code`
2299
2366
  `;
2300
2367
  const baseCheckIsActive = (editor, name2) => {
2301
2368
  const marks = Editor$1.marks(editor);
2302
- if (!marks)
2303
- return false;
2369
+ if (!marks) return false;
2304
2370
  return Boolean(marks[name2]);
2305
2371
  };
2306
2372
  const baseHandleToggle = (editor, name2) => {
@@ -2624,7 +2690,7 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
2624
2690
  Box,
2625
2691
  {
2626
2692
  tag: "button",
2627
- background: "neutral100",
2693
+ background: disabled ? "neutral150" : "neutral100",
2628
2694
  borderColor: field.error ? "danger600" : "neutral200",
2629
2695
  hasRadius: true,
2630
2696
  disabled,
@@ -2632,32 +2698,32 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
2632
2698
  paddingTop: 9,
2633
2699
  paddingBottom: 9,
2634
2700
  type: "button",
2701
+ style: { cursor: disabled ? "not-allowed" : "pointer" },
2635
2702
  children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
2636
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(CircleIcon, {}) }),
2637
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
2638
- id: getTranslation("components.empty-repeatable"),
2639
- defaultMessage: "No entry yet. Click on the button below to add one."
2640
- }) }) })
2703
+ /* @__PURE__ */ jsx(Flex, { justifyContent: "center", color: disabled ? "neutral500" : "primary600", children: /* @__PURE__ */ jsx(PlusCircle, { width: "3.2rem", height: "3.2rem" }) }),
2704
+ /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(
2705
+ Typography,
2706
+ {
2707
+ textColor: disabled ? "neutral600" : "primary600",
2708
+ variant: "pi",
2709
+ fontWeight: "bold",
2710
+ children: formatMessage({
2711
+ id: getTranslation("components.empty-repeatable"),
2712
+ defaultMessage: "No entry yet. Click to add one."
2713
+ })
2714
+ }
2715
+ ) })
2641
2716
  ] })
2642
2717
  }
2643
2718
  ) });
2644
2719
  };
2645
- const CircleIcon = styled(PlusCircle)`
2646
- width: 2.4rem;
2647
- height: 2.4rem;
2648
- > circle {
2649
- fill: ${({ theme }) => theme.colors.primary200};
2650
- }
2651
- > path {
2652
- fill: ${({ theme }) => theme.colors.primary600};
2653
- }
2654
- `;
2655
2720
  const NonRepeatableComponent = ({
2656
2721
  attribute,
2657
2722
  name: name2,
2658
2723
  children,
2659
2724
  layout
2660
2725
  }) => {
2726
+ const { formatMessage } = useIntl();
2661
2727
  const { value } = useField(name2);
2662
2728
  const level = useComponent("NonRepeatableComponent", (state) => state.level);
2663
2729
  const isNested = level > 0;
@@ -2674,6 +2740,10 @@ const NonRepeatableComponent = ({
2674
2740
  children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index) => {
2675
2741
  return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2676
2742
  const completeFieldName = `${name2}.${field.name}`;
2743
+ const translatedLabel = formatMessage({
2744
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2745
+ defaultMessage: field.label
2746
+ });
2677
2747
  return /* @__PURE__ */ jsx(
2678
2748
  Grid$1.Item,
2679
2749
  {
@@ -2682,7 +2752,7 @@ const NonRepeatableComponent = ({
2682
2752
  xs: 12,
2683
2753
  direction: "column",
2684
2754
  alignItems: "stretch",
2685
- children: children({ ...field, name: completeFieldName })
2755
+ children: children({ ...field, label: translatedLabel, name: completeFieldName })
2686
2756
  },
2687
2757
  completeFieldName
2688
2758
  );
@@ -2884,6 +2954,10 @@ const RepeatableComponent = ({
2884
2954
  children: layout.map((row, index2) => {
2885
2955
  return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2886
2956
  const completeFieldName = `${nameWithIndex}.${field.name}`;
2957
+ const translatedLabel = formatMessage({
2958
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2959
+ defaultMessage: field.label
2960
+ });
2887
2961
  return /* @__PURE__ */ jsx(
2888
2962
  Grid$1.Item,
2889
2963
  {
@@ -2892,7 +2966,11 @@ const RepeatableComponent = ({
2892
2966
  xs: 12,
2893
2967
  direction: "column",
2894
2968
  alignItems: "stretch",
2895
- children: children({ ...field, name: completeFieldName })
2969
+ children: children({
2970
+ ...field,
2971
+ label: translatedLabel,
2972
+ name: completeFieldName
2973
+ })
2896
2974
  },
2897
2975
  completeFieldName
2898
2976
  );
@@ -3736,8 +3814,7 @@ const Wrapper = styled.div`
3736
3814
  `;
3737
3815
  var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/;
3738
3816
  function newlineAndIndentContinueMarkdownList(cm) {
3739
- if (cm.getOption("disableInput"))
3740
- return CodeMirror.Pass;
3817
+ if (cm.getOption("disableInput")) return CodeMirror.Pass;
3741
3818
  var ranges = cm.listSelections(), replacements = [];
3742
3819
  for (var i = 0; i < ranges.length; i++) {
3743
3820
  var pos = ranges[i].head;
@@ -3771,8 +3848,7 @@ function newlineAndIndentContinueMarkdownList(cm) {
3771
3848
  var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
3772
3849
  var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace("x", " ");
3773
3850
  replacements[i] = "\n" + indent + bullet + after;
3774
- if (numbered)
3775
- incrementRemainingMarkdownListNumbers(cm, pos);
3851
+ if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
3776
3852
  }
3777
3853
  }
3778
3854
  cm.replaceSelections(replacements);
@@ -3790,10 +3866,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3790
3866
  var newNumber = parseInt(startItem[3], 10) + lookAhead - skipCount;
3791
3867
  var nextNumber = parseInt(nextItem[3], 10), itemNumber = nextNumber;
3792
3868
  if (startIndent === nextIndent && !isNaN(nextNumber)) {
3793
- if (newNumber === nextNumber)
3794
- itemNumber = nextNumber + 1;
3795
- if (newNumber > nextNumber)
3796
- itemNumber = newNumber + 1;
3869
+ if (newNumber === nextNumber) itemNumber = nextNumber + 1;
3870
+ if (newNumber > nextNumber) itemNumber = newNumber + 1;
3797
3871
  cm.replaceRange(
3798
3872
  nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
3799
3873
  {
@@ -3806,10 +3880,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3806
3880
  }
3807
3881
  );
3808
3882
  } else {
3809
- if (startIndent.length > nextIndent.length)
3810
- return;
3811
- if (startIndent.length < nextIndent.length && lookAhead === 1)
3812
- return;
3883
+ if (startIndent.length > nextIndent.length) return;
3884
+ if (startIndent.length < nextIndent.length && lookAhead === 1) return;
3813
3885
  skipCount += 1;
3814
3886
  }
3815
3887
  }
@@ -5237,6 +5309,13 @@ const DynamicComponent = ({
5237
5309
  alignItems: "stretch",
5238
5310
  children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5239
5311
  const fieldName = `${name2}.${index}.${field.name}`;
5312
+ const fieldWithTranslatedLabel = {
5313
+ ...field,
5314
+ label: formatMessage({
5315
+ id: `content-manager.components.${componentUid}.${field.name}`,
5316
+ defaultMessage: field.label
5317
+ })
5318
+ };
5240
5319
  return /* @__PURE__ */ jsx(
5241
5320
  Grid$1.Item,
5242
5321
  {
@@ -5245,7 +5324,7 @@ const DynamicComponent = ({
5245
5324
  xs: 12,
5246
5325
  direction: "column",
5247
5326
  alignItems: "stretch",
5248
- children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName })
5327
+ children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...fieldWithTranslatedLabel, name: fieldName })
5249
5328
  },
5250
5329
  fieldName
5251
5330
  );
@@ -5560,4 +5639,4 @@ export {
5560
5639
  transformDocument as t,
5561
5640
  useLazyComponents as u
5562
5641
  };
5563
- //# sourceMappingURL=Field-DIjL1b5d.mjs.map
5642
+ //# sourceMappingURL=Field-Byr3mPTl.mjs.map