@strapi/content-manager 0.0.0-experimental.c3e9d4b26f9fd3d9eb530b5c11f9baa1d09b13ad → 0.0.0-experimental.c592deb623aed3f74ef7fdacfad9757ed59d34f7

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 (133) hide show
  1. package/LICENSE +18 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-BMajAl1u.mjs → ComponentConfigurationPage-7-qB29e7.mjs} +3 -3
  3. package/dist/_chunks/{ComponentConfigurationPage-BMajAl1u.mjs.map → ComponentConfigurationPage-7-qB29e7.mjs.map} +1 -1
  4. package/dist/_chunks/{ComponentConfigurationPage-y_7iLdmB.js → ComponentConfigurationPage-DP7AC0UU.js} +3 -3
  5. package/dist/_chunks/{ComponentConfigurationPage-y_7iLdmB.js.map → ComponentConfigurationPage-DP7AC0UU.js.map} +1 -1
  6. package/dist/_chunks/{EditConfigurationPage-CcOoD26O.mjs → EditConfigurationPage-CI4XoymK.mjs} +3 -3
  7. package/dist/_chunks/{EditConfigurationPage-CcOoD26O.mjs.map → EditConfigurationPage-CI4XoymK.mjs.map} +1 -1
  8. package/dist/_chunks/{EditConfigurationPage-CPVB8Uqc.js → EditConfigurationPage-DITVliEI.js} +3 -3
  9. package/dist/_chunks/{EditConfigurationPage-CPVB8Uqc.js.map → EditConfigurationPage-DITVliEI.js.map} +1 -1
  10. package/dist/_chunks/{EditViewPage-CTTDHKkQ.js → EditViewPage-CUS2EAhB.js} +62 -47
  11. package/dist/_chunks/EditViewPage-CUS2EAhB.js.map +1 -0
  12. package/dist/_chunks/{EditViewPage-DWb0DE7R.mjs → EditViewPage-Dzpno8xI.mjs} +63 -48
  13. package/dist/_chunks/EditViewPage-Dzpno8xI.mjs.map +1 -0
  14. package/dist/_chunks/{Field-DnStdvQw.mjs → Field-B_jG_EV9.mjs} +541 -221
  15. package/dist/_chunks/Field-B_jG_EV9.mjs.map +1 -0
  16. package/dist/_chunks/{Field-C5Z1Ivdv.js → Field-CtUU1Fg8.js} +543 -223
  17. package/dist/_chunks/Field-CtUU1Fg8.js.map +1 -0
  18. package/dist/_chunks/{Form-DqGgE55Q.mjs → Form-BXHao2mZ.mjs} +53 -35
  19. package/dist/_chunks/Form-BXHao2mZ.mjs.map +1 -0
  20. package/dist/_chunks/{Form-B81OtW-k.js → Form-DTqO0ymI.js} +51 -33
  21. package/dist/_chunks/Form-DTqO0ymI.js.map +1 -0
  22. package/dist/_chunks/{History-DS6-HCYX.mjs → History-2Ah2CQ4T.mjs} +52 -29
  23. package/dist/_chunks/History-2Ah2CQ4T.mjs.map +1 -0
  24. package/dist/_chunks/{History-4NbOq2dX.js → History-C_uSGzO5.js} +51 -28
  25. package/dist/_chunks/History-C_uSGzO5.js.map +1 -0
  26. package/dist/_chunks/{ListConfigurationPage-DQJJltko.mjs → ListConfigurationPage-BjSJlaoC.mjs} +58 -48
  27. package/dist/_chunks/ListConfigurationPage-BjSJlaoC.mjs.map +1 -0
  28. package/dist/_chunks/{ListConfigurationPage-CpfstlYY.js → ListConfigurationPage-nyuP7OSy.js} +57 -46
  29. package/dist/_chunks/ListConfigurationPage-nyuP7OSy.js.map +1 -0
  30. package/dist/_chunks/{ListViewPage-nQrOQuVo.mjs → ListViewPage-B75x3nz2.mjs} +103 -102
  31. package/dist/_chunks/ListViewPage-B75x3nz2.mjs.map +1 -0
  32. package/dist/_chunks/{ListViewPage-CA3I75m5.js → ListViewPage-DHgHD8Xg.js} +105 -104
  33. package/dist/_chunks/ListViewPage-DHgHD8Xg.js.map +1 -0
  34. package/dist/_chunks/{NoContentTypePage-Dldu-_Mx.js → NoContentTypePage-CDUKdZ7d.js} +2 -2
  35. package/dist/_chunks/{NoContentTypePage-Dldu-_Mx.js.map → NoContentTypePage-CDUKdZ7d.js.map} +1 -1
  36. package/dist/_chunks/{NoContentTypePage-DbnHE22g.mjs → NoContentTypePage-DUacQSyF.mjs} +2 -2
  37. package/dist/_chunks/{NoContentTypePage-DbnHE22g.mjs.map → NoContentTypePage-DUacQSyF.mjs.map} +1 -1
  38. package/dist/_chunks/{NoPermissionsPage-fOIkQM0v.mjs → NoPermissionsPage-SFllMekk.mjs} +2 -2
  39. package/dist/_chunks/{NoPermissionsPage-fOIkQM0v.mjs.map → NoPermissionsPage-SFllMekk.mjs.map} +1 -1
  40. package/dist/_chunks/{NoPermissionsPage-CO2MK200.js → NoPermissionsPage-zwIZydDI.js} +2 -2
  41. package/dist/_chunks/{NoPermissionsPage-CO2MK200.js.map → NoPermissionsPage-zwIZydDI.js.map} +1 -1
  42. package/dist/_chunks/{Relations-BDRl99Ux.mjs → Relations-D2NRW8fC.mjs} +14 -10
  43. package/dist/_chunks/Relations-D2NRW8fC.mjs.map +1 -0
  44. package/dist/_chunks/{Relations-DG2jnOcr.js → Relations-NFLaRNPr.js} +14 -10
  45. package/dist/_chunks/Relations-NFLaRNPr.js.map +1 -0
  46. package/dist/_chunks/{en-fbKQxLGn.js → en-BlhnxQfj.js} +11 -9
  47. package/dist/_chunks/{en-fbKQxLGn.js.map → en-BlhnxQfj.js.map} +1 -1
  48. package/dist/_chunks/{en-Ux26r5pl.mjs → en-C8YBvRrK.mjs} +11 -9
  49. package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-C8YBvRrK.mjs.map} +1 -1
  50. package/dist/_chunks/{index-Drt2DN7v.mjs → index-C9HxCo5R.mjs} +1008 -867
  51. package/dist/_chunks/index-C9HxCo5R.mjs.map +1 -0
  52. package/dist/_chunks/{index-BZoNZMXL.js → index-ovJRE1FM.js} +998 -857
  53. package/dist/_chunks/index-ovJRE1FM.js.map +1 -0
  54. package/dist/_chunks/{layout-BzAbmoO6.mjs → layout-DaUjDiWQ.mjs} +27 -14
  55. package/dist/_chunks/layout-DaUjDiWQ.mjs.map +1 -0
  56. package/dist/_chunks/{layout-DEYBqgF1.js → layout-UNWstw_s.js} +25 -12
  57. package/dist/_chunks/layout-UNWstw_s.js.map +1 -0
  58. package/dist/_chunks/{relations-D26zVRdi.mjs → relations-D8iFAeRu.mjs} +2 -2
  59. package/dist/_chunks/{relations-D26zVRdi.mjs.map → relations-D8iFAeRu.mjs.map} +1 -1
  60. package/dist/_chunks/{relations-D0eZ4VWw.js → relations-NN3coOG5.js} +2 -2
  61. package/dist/_chunks/{relations-D0eZ4VWw.js.map → relations-NN3coOG5.js.map} +1 -1
  62. package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
  63. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  64. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  65. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  66. package/dist/admin/index.js +2 -1
  67. package/dist/admin/index.js.map +1 -1
  68. package/dist/admin/index.mjs +3 -2
  69. package/dist/admin/src/exports.d.ts +1 -1
  70. package/dist/admin/src/history/index.d.ts +3 -0
  71. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  72. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  73. package/dist/admin/src/index.d.ts +1 -0
  74. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +8 -3
  75. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
  76. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
  77. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
  78. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  79. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +6 -58
  80. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  81. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  82. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  83. package/dist/admin/src/services/api.d.ts +1 -1
  84. package/dist/admin/src/services/components.d.ts +2 -2
  85. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  86. package/dist/admin/src/services/documents.d.ts +19 -17
  87. package/dist/admin/src/services/init.d.ts +1 -1
  88. package/dist/admin/src/services/relations.d.ts +2 -2
  89. package/dist/admin/src/services/uid.d.ts +3 -3
  90. package/dist/admin/src/utils/validation.d.ts +4 -1
  91. package/dist/server/index.js +191 -110
  92. package/dist/server/index.js.map +1 -1
  93. package/dist/server/index.mjs +192 -111
  94. package/dist/server/index.mjs.map +1 -1
  95. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  96. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  97. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  98. package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
  99. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
  100. package/dist/server/src/history/services/history.d.ts.map +1 -1
  101. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  102. package/dist/server/src/history/services/utils.d.ts +2 -1
  103. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  104. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  105. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  106. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  107. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  108. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  109. package/dist/shared/contracts/collection-types.d.ts +3 -1
  110. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  111. package/package.json +11 -11
  112. package/dist/_chunks/EditViewPage-CTTDHKkQ.js.map +0 -1
  113. package/dist/_chunks/EditViewPage-DWb0DE7R.mjs.map +0 -1
  114. package/dist/_chunks/Field-C5Z1Ivdv.js.map +0 -1
  115. package/dist/_chunks/Field-DnStdvQw.mjs.map +0 -1
  116. package/dist/_chunks/Form-B81OtW-k.js.map +0 -1
  117. package/dist/_chunks/Form-DqGgE55Q.mjs.map +0 -1
  118. package/dist/_chunks/History-4NbOq2dX.js.map +0 -1
  119. package/dist/_chunks/History-DS6-HCYX.mjs.map +0 -1
  120. package/dist/_chunks/ListConfigurationPage-CpfstlYY.js.map +0 -1
  121. package/dist/_chunks/ListConfigurationPage-DQJJltko.mjs.map +0 -1
  122. package/dist/_chunks/ListViewPage-CA3I75m5.js.map +0 -1
  123. package/dist/_chunks/ListViewPage-nQrOQuVo.mjs.map +0 -1
  124. package/dist/_chunks/Relations-BDRl99Ux.mjs.map +0 -1
  125. package/dist/_chunks/Relations-DG2jnOcr.js.map +0 -1
  126. package/dist/_chunks/index-BZoNZMXL.js.map +0 -1
  127. package/dist/_chunks/index-Drt2DN7v.mjs.map +0 -1
  128. package/dist/_chunks/layout-BzAbmoO6.mjs.map +0 -1
  129. package/dist/_chunks/layout-DEYBqgF1.js.map +0 -1
  130. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  131. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  132. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  133. package/strapi-server.js +0 -3
@@ -2,12 +2,12 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { useState, useEffect, useCallback, memo } from "react";
4
4
  import { useStrapiApp, createContext, useField, useNotification, useForm, useAPIErrorHandler, useQueryParams, useFocusInputField, InputRenderer as InputRenderer$1 } from "@strapi/admin/strapi-admin";
5
- import { Typography, Flex, Box, BaseLink, Button, useComposedRefs, Popover, Field, Tooltip, SingleSelect, SingleSelectOption, IconButton, Portal, FocusTrap, Divider, VisuallyHidden, Grid as Grid$1, GridItem, Accordion, TextButton, BaseButton, TextInput, IconButtonGroup, Menu, MenuItem } from "@strapi/design-system";
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, d as buildValidParams, f as useDocumentRBAC, n as useDocLayout } from "./index-Drt2DN7v.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, o as useDocLayout } from "./index-C9HxCo5R.mjs";
9
9
  import { generateNKeysBetween } from "fractional-indexing";
10
- import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-BDRl99Ux.mjs";
10
+ import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-D2NRW8fC.mjs";
11
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";
12
12
  import { styled, css, keyframes } from "styled-components";
13
13
  import { C as ComponentIcon, a as COMPONENT_ICONS } from "./ComponentIcon-u4bIXTFY.mjs";
@@ -17,9 +17,9 @@ import { g as getIn } from "./objects-mKMAmfec.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 { p as prefixFileUrlWithBackendUrl, u as usePrev } from "./usePrev-DH6iah0A.mjs";
20
+ import { p as prefixFileUrlWithBackendUrl, u as usePrev, a as useDebounce } from "./useDebounce-DmuSJIF3.mjs";
21
21
  import * as Toolbar from "@radix-ui/react-toolbar";
22
- import { useLocation } from "react-router-dom";
22
+ import { useLocation, useMatch } from "react-router-dom";
23
23
  import CodeMirror from "codemirror5";
24
24
  import sanitizeHtml from "sanitize-html";
25
25
  import { getLanguage, highlight, highlightAuto } from "highlight.js";
@@ -160,6 +160,220 @@ const useLazyComponents = (componentUids = []) => {
160
160
  }, []);
161
161
  return { isLazyLoading: loading, lazyComponentStore, cleanup };
162
162
  };
163
+ const codeLanguages = [
164
+ {
165
+ value: "asm",
166
+ label: "Assembly"
167
+ },
168
+ {
169
+ value: "bash",
170
+ label: "Bash"
171
+ },
172
+ {
173
+ value: "c",
174
+ label: "C"
175
+ },
176
+ {
177
+ value: "clojure",
178
+ label: "Clojure"
179
+ },
180
+ {
181
+ value: "cobol",
182
+ label: "COBOL"
183
+ },
184
+ {
185
+ value: "cpp",
186
+ label: "C++"
187
+ },
188
+ {
189
+ value: "csharp",
190
+ label: "C#"
191
+ },
192
+ {
193
+ value: "css",
194
+ label: "CSS"
195
+ },
196
+ {
197
+ value: "dart",
198
+ label: "Dart"
199
+ },
200
+ {
201
+ value: "dockerfile",
202
+ label: "Dockerfile"
203
+ },
204
+ {
205
+ value: "elixir",
206
+ label: "Elixir"
207
+ },
208
+ {
209
+ value: "erlang",
210
+ label: "Erlang"
211
+ },
212
+ {
213
+ value: "fortran",
214
+ label: "Fortran"
215
+ },
216
+ {
217
+ value: "fsharp",
218
+ label: "F#"
219
+ },
220
+ {
221
+ value: "go",
222
+ label: "Go"
223
+ },
224
+ {
225
+ value: "graphql",
226
+ label: "GraphQL"
227
+ },
228
+ {
229
+ value: "groovy",
230
+ label: "Groovy"
231
+ },
232
+ {
233
+ value: "haskell",
234
+ label: "Haskell"
235
+ },
236
+ {
237
+ value: "haxe",
238
+ label: "Haxe"
239
+ },
240
+ {
241
+ value: "html",
242
+ label: "HTML"
243
+ },
244
+ {
245
+ value: "ini",
246
+ label: "INI"
247
+ },
248
+ {
249
+ value: "java",
250
+ label: "Java"
251
+ },
252
+ {
253
+ value: "javascript",
254
+ label: "JavaScript"
255
+ },
256
+ {
257
+ value: "jsx",
258
+ label: "JavaScript (React)"
259
+ },
260
+ {
261
+ value: "json",
262
+ label: "JSON"
263
+ },
264
+ {
265
+ value: "julia",
266
+ label: "Julia"
267
+ },
268
+ {
269
+ value: "kotlin",
270
+ label: "Kotlin"
271
+ },
272
+ {
273
+ value: "latex",
274
+ label: "LaTeX"
275
+ },
276
+ {
277
+ value: "lua",
278
+ label: "Lua"
279
+ },
280
+ {
281
+ value: "markdown",
282
+ label: "Markdown"
283
+ },
284
+ {
285
+ value: "matlab",
286
+ label: "MATLAB"
287
+ },
288
+ {
289
+ value: "makefile",
290
+ label: "Makefile"
291
+ },
292
+ {
293
+ value: "objectivec",
294
+ label: "Objective-C"
295
+ },
296
+ {
297
+ value: "perl",
298
+ label: "Perl"
299
+ },
300
+ {
301
+ value: "php",
302
+ label: "PHP"
303
+ },
304
+ {
305
+ value: "plaintext",
306
+ label: "Plain text"
307
+ },
308
+ {
309
+ value: "powershell",
310
+ label: "PowerShell"
311
+ },
312
+ {
313
+ value: "python",
314
+ label: "Python"
315
+ },
316
+ {
317
+ value: "r",
318
+ label: "R"
319
+ },
320
+ {
321
+ value: "ruby",
322
+ label: "Ruby"
323
+ },
324
+ {
325
+ value: "rust",
326
+ label: "Rust"
327
+ },
328
+ {
329
+ value: "sas",
330
+ label: "SAS"
331
+ },
332
+ {
333
+ value: "scala",
334
+ label: "Scala"
335
+ },
336
+ {
337
+ value: "scheme",
338
+ label: "Scheme"
339
+ },
340
+ {
341
+ value: "shell",
342
+ label: "Shell"
343
+ },
344
+ {
345
+ value: "sql",
346
+ label: "SQL"
347
+ },
348
+ {
349
+ value: "stata",
350
+ label: "Stata"
351
+ },
352
+ {
353
+ value: "swift",
354
+ label: "Swift"
355
+ },
356
+ {
357
+ value: "typescript",
358
+ label: "TypeScript"
359
+ },
360
+ {
361
+ value: "tsx",
362
+ label: "TypeScript (React)"
363
+ },
364
+ {
365
+ value: "vbnet",
366
+ label: "VB.NET"
367
+ },
368
+ {
369
+ value: "xml",
370
+ label: "XML"
371
+ },
372
+ {
373
+ value: "yaml",
374
+ label: "YAML"
375
+ }
376
+ ];
163
377
  const baseHandleConvert = (editor, attributesToSet) => {
164
378
  const [_, lastNodePath] = Editor$1.last(editor, []);
165
379
  Transforms.unwrapNodes(editor, {
@@ -230,6 +444,7 @@ const CodeBlock = styled.pre`
230
444
  overflow: auto;
231
445
  padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};
232
446
  flex-shrink: 1;
447
+
233
448
  & > code {
234
449
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas,
235
450
  monospace;
@@ -238,9 +453,61 @@ const CodeBlock = styled.pre`
238
453
  max-width: 100%;
239
454
  }
240
455
  `;
456
+ const CodeEditor = (props) => {
457
+ const { editor } = useBlocksEditorContext("ImageDialog");
458
+ const editorIsFocused = useFocused();
459
+ const imageIsSelected = useSelected();
460
+ const { formatMessage } = useIntl();
461
+ const [isSelectOpen, setIsSelectOpen] = React.useState(false);
462
+ const shouldDisplayLanguageSelect = editorIsFocused && imageIsSelected || isSelectOpen;
463
+ return /* @__PURE__ */ jsxs(Box, { position: "relative", width: "100%", children: [
464
+ /* @__PURE__ */ jsx(CodeBlock, { ...props.attributes, children: /* @__PURE__ */ jsx("code", { children: props.children }) }),
465
+ shouldDisplayLanguageSelect && /* @__PURE__ */ jsx(
466
+ Box,
467
+ {
468
+ position: "absolute",
469
+ background: "neutral0",
470
+ borderColor: "neutral150",
471
+ borderStyle: "solid",
472
+ borderWidth: "0.5px",
473
+ shadow: "tableShadow",
474
+ top: "100%",
475
+ marginTop: 1,
476
+ right: 0,
477
+ padding: 1,
478
+ hasRadius: true,
479
+ children: /* @__PURE__ */ jsx(
480
+ SingleSelect,
481
+ {
482
+ onChange: (open) => {
483
+ Transforms.setNodes(
484
+ editor,
485
+ { language: open.toString() },
486
+ { match: (node) => !Editor$1.isEditor(node) && node.type === "code" }
487
+ );
488
+ },
489
+ value: props.element.type === "code" && props.element.language || "plaintext",
490
+ onOpenChange: (open) => {
491
+ setIsSelectOpen(open);
492
+ if (!open) {
493
+ ReactEditor.focus(editor);
494
+ }
495
+ },
496
+ onCloseAutoFocus: (e) => e.preventDefault(),
497
+ "aria-label": formatMessage({
498
+ id: "components.Blocks.blocks.code.languageLabel",
499
+ defaultMessage: "Select a language"
500
+ }),
501
+ children: codeLanguages.map(({ value, label }) => /* @__PURE__ */ jsx(SingleSelectOption, { value, children: label }, value))
502
+ }
503
+ )
504
+ }
505
+ )
506
+ ] });
507
+ };
241
508
  const codeBlocks = {
242
509
  code: {
243
- renderElement: (props) => /* @__PURE__ */ jsx(CodeBlock, { ...props.attributes, children: /* @__PURE__ */ jsx("code", { children: props.children }) }),
510
+ renderElement: (props) => /* @__PURE__ */ jsx(CodeEditor, { ...props }),
244
511
  icon: Code,
245
512
  label: {
246
513
  id: "components.Blocks.blocks.code",
@@ -249,7 +516,7 @@ const codeBlocks = {
249
516
  matchNode: (node) => node.type === "code",
250
517
  isInBlocksSelector: true,
251
518
  handleConvert(editor) {
252
- baseHandleConvert(editor, { type: "code" });
519
+ baseHandleConvert(editor, { type: "code", language: "plaintext" });
253
520
  },
254
521
  handleEnterKey(editor) {
255
522
  pressEnterTwiceToExit(editor);
@@ -589,18 +856,12 @@ const LinkContent = React.forwardRef(
589
856
  const [popoverOpen, setPopoverOpen] = React.useState(
590
857
  editor.lastInsertedLinkPath ? Path.equals(path, editor.lastInsertedLinkPath) : false
591
858
  );
592
- const linkRef = React.useRef(null);
593
859
  const elementText = link.children.map((child) => child.text).join("");
594
860
  const [linkText, setLinkText] = React.useState(elementText);
595
861
  const [linkUrl, setLinkUrl] = React.useState(link.url);
596
862
  const linkInputRef = React.useRef(null);
597
- const [showRemoveButton, setShowRemoveButton] = React.useState(false);
863
+ const isLastInsertedLink = editor.lastInsertedLinkPath ? !Path.equals(path, editor.lastInsertedLinkPath) : true;
598
864
  const [isSaveDisabled, setIsSaveDisabled] = React.useState(false);
599
- const handleOpenEditPopover = (e) => {
600
- e.preventDefault();
601
- setPopoverOpen(true);
602
- setShowRemoveButton(true);
603
- };
604
865
  const onLinkChange = (e) => {
605
866
  setIsSaveDisabled(false);
606
867
  setLinkUrl(e.target.value);
@@ -621,33 +882,33 @@ const LinkContent = React.forwardRef(
621
882
  editLink(editor, { url: linkUrl, text: linkText });
622
883
  setPopoverOpen(false);
623
884
  editor.lastInsertedLinkPath = null;
885
+ ReactEditor.focus(editor);
624
886
  };
625
- const handleDismiss = () => {
626
- setPopoverOpen(false);
887
+ const handleClose = () => {
627
888
  if (link.url === "") {
628
889
  removeLink(editor);
629
890
  }
891
+ setPopoverOpen(false);
630
892
  ReactEditor.focus(editor);
631
893
  };
632
- const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
633
- const composedRefs = useComposedRefs(linkRef, forwardedRef);
634
894
  React.useEffect(() => {
635
895
  if (popoverOpen)
636
896
  linkInputRef.current?.focus();
637
897
  }, [popoverOpen]);
638
- return /* @__PURE__ */ jsxs(Fragment, { children: [
639
- /* @__PURE__ */ jsx(
898
+ const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
899
+ return /* @__PURE__ */ jsxs(Popover.Root, { open: popoverOpen, children: [
900
+ /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
640
901
  StyledBaseLink,
641
902
  {
642
903
  ...attributes,
643
- ref: composedRefs,
904
+ ref: forwardedRef,
644
905
  href: link.url,
645
- onClick: handleOpenEditPopover,
906
+ onClick: () => setPopoverOpen(true),
646
907
  color: "primary600",
647
908
  children
648
909
  }
649
- ),
650
- popoverOpen && /* @__PURE__ */ jsx(Popover, { source: linkRef, onDismiss: handleDismiss, padding: 4, contentEditable: false, children: /* @__PURE__ */ jsxs(Flex, { tag: "form", onSubmit: handleSave, direction: "column", gap: 4, children: [
910
+ ) }),
911
+ /* @__PURE__ */ jsx(Popover.Content, { onPointerDownOutside: handleClose, children: /* @__PURE__ */ jsxs(Flex, { padding: 4, direction: "column", gap: 4, children: [
651
912
  /* @__PURE__ */ jsx(Field.Root, { width: "368px", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
652
913
  /* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
653
914
  id: "components.Blocks.popover.text",
@@ -693,7 +954,7 @@ const LinkContent = React.forwardRef(
693
954
  {
694
955
  variant: "danger-light",
695
956
  onClick: () => removeLink(editor),
696
- $visible: showRemoveButton,
957
+ $visible: isLastInsertedLink,
697
958
  children: formatMessage({
698
959
  id: "components.Blocks.popover.remove",
699
960
  defaultMessage: "Remove"
@@ -701,11 +962,11 @@ const LinkContent = React.forwardRef(
701
962
  }
702
963
  ),
703
964
  /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
704
- /* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: handleDismiss, children: formatMessage({
965
+ /* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
705
966
  id: "components.Blocks.popover.cancel",
706
967
  defaultMessage: "Cancel"
707
968
  }) }),
708
- /* @__PURE__ */ jsx(Button, { type: "submit", disabled: Boolean(inputNotDirty) || isSaveDisabled, children: formatMessage({
969
+ /* @__PURE__ */ jsx(Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
709
970
  id: "components.Blocks.popover.save",
710
971
  defaultMessage: "Save"
711
972
  }) })
@@ -1146,7 +1407,7 @@ const ToolbarButton = ({
1146
1407
  width: 7,
1147
1408
  height: 7,
1148
1409
  hasRadius: true,
1149
- children: /* @__PURE__ */ jsx(Icon, { width: "1.2rem", height: "1.2rem", fill: disabled ? "neutral300" : enabledColor })
1410
+ children: /* @__PURE__ */ jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
1150
1411
  }
1151
1412
  )
1152
1413
  }
@@ -1291,6 +1552,26 @@ const ListButton = ({ block, format }) => {
1291
1552
  }
1292
1553
  return false;
1293
1554
  };
1555
+ const isListDisabled = () => {
1556
+ if (disabled) {
1557
+ return true;
1558
+ }
1559
+ if (!editor.selection) {
1560
+ return false;
1561
+ }
1562
+ const anchorNodeEntry = Editor$1.above(editor, {
1563
+ at: editor.selection.anchor,
1564
+ match: (node) => !Editor$1.isEditor(node) && node.type !== "text"
1565
+ });
1566
+ const focusNodeEntry = Editor$1.above(editor, {
1567
+ at: editor.selection.focus,
1568
+ match: (node) => !Editor$1.isEditor(node) && node.type !== "text"
1569
+ });
1570
+ if (!anchorNodeEntry || !focusNodeEntry) {
1571
+ return false;
1572
+ }
1573
+ return anchorNodeEntry[0] !== focusNodeEntry[0];
1574
+ };
1294
1575
  const toggleList = (format2) => {
1295
1576
  let currentListEntry;
1296
1577
  if (editor.selection) {
@@ -1324,7 +1605,7 @@ const ListButton = ({ block, format }) => {
1324
1605
  name: format,
1325
1606
  label: block.label,
1326
1607
  isActive: isListActive(),
1327
- disabled,
1608
+ disabled: isListDisabled(),
1328
1609
  handleClick: () => toggleList(format)
1329
1610
  }
1330
1611
  );
@@ -1468,6 +1749,7 @@ const DragItem = styled(Flex)`
1468
1749
  }
1469
1750
  `;
1470
1751
  const DragIconButton = styled(IconButton)`
1752
+ user-select: none;
1471
1753
  display: flex;
1472
1754
  align-items: center;
1473
1755
  justify-content: center;
@@ -1491,7 +1773,7 @@ const DragIconButton = styled(IconButton)`
1491
1773
  }
1492
1774
  svg {
1493
1775
  height: auto;
1494
- width: ${({ theme }) => theme.spaces[3]};
1776
+ min-width: ${({ theme }) => theme.spaces[3]};
1495
1777
 
1496
1778
  path {
1497
1779
  fill: ${({ theme }) => theme.colors.neutral700};
@@ -1596,6 +1878,7 @@ const DragAndDropElement = ({
1596
1878
  DragIconButton,
1597
1879
  {
1598
1880
  tag: "div",
1881
+ contentEditable: false,
1599
1882
  role: "button",
1600
1883
  tabIndex: 0,
1601
1884
  withTooltip: false,
@@ -1608,7 +1891,7 @@ const DragAndDropElement = ({
1608
1891
  disabled,
1609
1892
  draggable: true,
1610
1893
  $dragHandleTopMargin: dragHandleTopMargin,
1611
- children: /* @__PURE__ */ jsx(Drag, { color: "neutral600" })
1894
+ children: /* @__PURE__ */ jsx(Drag, { color: "primary500" })
1612
1895
  }
1613
1896
  ),
1614
1897
  children
@@ -1932,7 +2215,7 @@ const EditorLayout$1 = ({
1932
2215
  /* @__PURE__ */ jsx(
1933
2216
  CollapseIconButton,
1934
2217
  {
1935
- "aria-label": formatMessage({
2218
+ label: formatMessage({
1936
2219
  id: getTranslation("components.Blocks.collapse"),
1937
2220
  defaultMessage: "Collapse"
1938
2221
  }),
@@ -2271,7 +2554,7 @@ const BlocksEditor = React.forwardRef(
2271
2554
  !isExpandedMode && /* @__PURE__ */ jsx(
2272
2555
  ExpandIconButton,
2273
2556
  {
2274
- "aria-label": formatMessage({
2557
+ label: formatMessage({
2275
2558
  id: getTranslation("components.Blocks.expand"),
2276
2559
  defaultMessage: "Expand"
2277
2560
  }),
@@ -2337,30 +2620,27 @@ const createDefaultForm = (contentType, components = {}) => {
2337
2620
  const Initializer = ({ disabled, name: name2, onClick }) => {
2338
2621
  const { formatMessage } = useIntl();
2339
2622
  const field = useField(name2);
2340
- return /* @__PURE__ */ jsxs(Fragment, { children: [
2341
- /* @__PURE__ */ jsx(
2342
- Box,
2343
- {
2344
- tag: "button",
2345
- background: "neutral100",
2346
- borderColor: field.error ? "danger600" : "neutral200",
2347
- hasRadius: true,
2348
- disabled,
2349
- onClick,
2350
- paddingTop: 9,
2351
- paddingBottom: 9,
2352
- type: "button",
2353
- children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
2354
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(CircleIcon, {}) }),
2355
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
2356
- id: getTranslation("components.empty-repeatable"),
2357
- defaultMessage: "No entry yet. Click on the button below to add one."
2358
- }) }) })
2359
- ] })
2360
- }
2361
- ),
2362
- field.error && /* @__PURE__ */ jsx(Typography, { textColor: "danger600", variant: "pi", children: field.error })
2363
- ] });
2623
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2624
+ Box,
2625
+ {
2626
+ tag: "button",
2627
+ background: "neutral100",
2628
+ borderColor: field.error ? "danger600" : "neutral200",
2629
+ hasRadius: true,
2630
+ disabled,
2631
+ onClick,
2632
+ paddingTop: 9,
2633
+ paddingBottom: 9,
2634
+ type: "button",
2635
+ 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
+ }) }) })
2641
+ ] })
2642
+ }
2643
+ ) });
2364
2644
  };
2365
2645
  const CircleIcon = styled(PlusCircle)`
2366
2646
  width: 2.4rem;
@@ -2392,9 +2672,20 @@ const NonRepeatableComponent = ({
2392
2672
  hasRadius: isNested,
2393
2673
  borderColor: isNested ? "neutral200" : void 0,
2394
2674
  children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index) => {
2395
- return /* @__PURE__ */ jsx(Grid$1, { gap: 4, children: row.map(({ size, ...field }) => {
2675
+ return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2396
2676
  const completeFieldName = `${name2}.${field.name}`;
2397
- return /* @__PURE__ */ jsx(GridItem, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2677
+ return /* @__PURE__ */ jsx(
2678
+ Grid$1.Item,
2679
+ {
2680
+ col: size,
2681
+ s: 12,
2682
+ xs: 12,
2683
+ direction: "column",
2684
+ alignItems: "stretch",
2685
+ children: children({ ...field, name: completeFieldName })
2686
+ },
2687
+ completeFieldName
2688
+ );
2398
2689
  }) }, index);
2399
2690
  }) })
2400
2691
  }
@@ -2570,9 +2861,20 @@ const RepeatableComponent = ({
2570
2861
  onGrabItem: handleGrabItem,
2571
2862
  __temp_key__: key,
2572
2863
  children: layout.map((row, index2) => {
2573
- return /* @__PURE__ */ jsx(Grid$1, { gap: 4, children: row.map(({ size, ...field }) => {
2864
+ return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2574
2865
  const completeFieldName = `${nameWithIndex}.${field.name}`;
2575
- return /* @__PURE__ */ jsx(GridItem, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2866
+ return /* @__PURE__ */ jsx(
2867
+ Grid$1.Item,
2868
+ {
2869
+ col: size,
2870
+ s: 12,
2871
+ xs: 12,
2872
+ direction: "column",
2873
+ alignItems: "stretch",
2874
+ children: children({ ...field, name: completeFieldName })
2875
+ },
2876
+ completeFieldName
2877
+ );
2576
2878
  }) }, index2);
2577
2879
  })
2578
2880
  }
@@ -2617,7 +2919,7 @@ const TextButtonCustom = styled(TextButton)`
2617
2919
  }
2618
2920
 
2619
2921
  @media (prefers-reduced-motion: no-preference) {
2620
- transition: background-color 120ms ${(props) => props.theme.easings.easeOutQuad};
2922
+ transition: background-color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};
2621
2923
  }
2622
2924
  `;
2623
2925
  const Component = ({
@@ -2667,7 +2969,7 @@ const Component = ({
2667
2969
  /* @__PURE__ */ jsx(
2668
2970
  IconButton,
2669
2971
  {
2670
- borderWidth: 0,
2972
+ variant: "ghost",
2671
2973
  onClick: onDeleteComponent,
2672
2974
  label: formatMessage({
2673
2975
  id: getTranslation("containers.Edit.delete"),
@@ -2680,7 +2982,7 @@ const Component = ({
2680
2982
  IconButton,
2681
2983
  {
2682
2984
  ref: composedAccordionRefs,
2683
- borderWidth: 0,
2985
+ variant: "ghost",
2684
2986
  onClick: (e) => e.stopPropagation(),
2685
2987
  "data-handler-id": handlerId,
2686
2988
  label: formatMessage({
@@ -2750,7 +3052,7 @@ const ComponentInput = ({
2750
3052
  id: getTranslation("components.reset-entry"),
2751
3053
  defaultMessage: "Reset Entry"
2752
3054
  }),
2753
- borderWidth: 0,
3055
+ variant: "ghost",
2754
3056
  onClick: () => {
2755
3057
  field.onChange(name2, null);
2756
3058
  },
@@ -2779,11 +3081,8 @@ const AddComponentButton = ({
2779
3081
  onClick,
2780
3082
  disabled: isDisabled,
2781
3083
  background: "neutral0",
2782
- paddingTop: 3,
2783
- paddingBottom: 3,
2784
- paddingLeft: 4,
2785
- paddingRight: 4,
2786
3084
  style: { cursor: isDisabled ? "not-allowed" : "pointer" },
3085
+ variant: "tertiary",
2787
3086
  children: /* @__PURE__ */ jsxs(Flex, { tag: "span", gap: 2, children: [
2788
3087
  /* @__PURE__ */ jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
2789
3088
  /* @__PURE__ */ jsx(
@@ -2812,10 +3111,11 @@ const StyledAddIcon = styled(PlusCircle)`
2812
3111
  }
2813
3112
  `;
2814
3113
  const AddComponentTitle = styled(Typography)``;
2815
- const StyledButton = styled(BaseButton)`
3114
+ const StyledButton = styled(Button)`
2816
3115
  border-radius: 26px;
2817
3116
  border-color: ${({ theme }) => theme.colors.neutral150};
2818
3117
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
3118
+ height: 5rem;
2819
3119
 
2820
3120
  &:hover {
2821
3121
  ${AddComponentTitle} {
@@ -2827,7 +3127,7 @@ const StyledButton = styled(BaseButton)`
2827
3127
  fill: ${({ theme }) => theme.colors.primary600};
2828
3128
  }
2829
3129
  > path {
2830
- fill: ${({ theme }) => theme.colors.neutral100};
3130
+ fill: ${({ theme }) => theme.colors.primary600};
2831
3131
  }
2832
3132
  }
2833
3133
  }
@@ -2885,7 +3185,7 @@ const ComponentBox = styled(Flex)`
2885
3185
  cursor: pointer;
2886
3186
 
2887
3187
  @media (prefers-reduced-motion: no-preference) {
2888
- transition: color 120ms ${(props) => props.theme.easings.easeOutQuad};
3188
+ transition: color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};
2889
3189
  }
2890
3190
 
2891
3191
  &:focus,
@@ -2958,18 +3258,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
2958
3258
  /* @__PURE__ */ jsx(Field.Hint, {})
2959
3259
  ] });
2960
3260
  };
2961
- function useDebounce(value, delay) {
2962
- const [debouncedValue, setDebouncedValue] = useState(value);
2963
- useEffect(() => {
2964
- const handler = setTimeout(() => {
2965
- setDebouncedValue(value);
2966
- }, delay);
2967
- return () => {
2968
- clearTimeout(handler);
2969
- };
2970
- }, [value, delay]);
2971
- return debouncedValue;
2972
- }
2973
3261
  const uidApi = contentManagerApi.injectEndpoints({
2974
3262
  endpoints: (builder) => ({
2975
3263
  getDefaultUID: builder.query({
@@ -3004,7 +3292,10 @@ const uidApi = contentManagerApi.injectEndpoints({
3004
3292
  config: {
3005
3293
  params
3006
3294
  }
3007
- })
3295
+ }),
3296
+ providesTags: (_res, _error, params) => [
3297
+ { type: "UidAvailability", id: params.contentTypeUID }
3298
+ ]
3008
3299
  })
3009
3300
  })
3010
3301
  });
@@ -3016,8 +3307,10 @@ const UIDInput = React.forwardRef(
3016
3307
  const allFormValues = useForm("InputUID", (form) => form.values);
3017
3308
  const [availability, setAvailability] = React.useState();
3018
3309
  const [showRegenerate, setShowRegenerate] = React.useState(false);
3310
+ const isCloning = useMatch(CLONE_PATH) !== null;
3019
3311
  const field = useField(name2);
3020
3312
  const debouncedValue = useDebounce(field.value, 300);
3313
+ const hasChanged = debouncedValue !== field.initialValue;
3021
3314
  const { toggleNotification } = useNotification();
3022
3315
  const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
3023
3316
  const { formatMessage } = useIntl();
@@ -3093,8 +3386,9 @@ const UIDInput = React.forwardRef(
3093
3386
  params
3094
3387
  },
3095
3388
  {
3389
+ // Don't check availability if the value is empty or wasn't changed
3096
3390
  skip: !Boolean(
3097
- debouncedValue !== field.initialValue && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3391
+ (hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3098
3392
  )
3099
3393
  }
3100
3394
  );
@@ -3123,6 +3417,7 @@ const UIDInput = React.forwardRef(
3123
3417
  const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
3124
3418
  const fieldRef = useFocusInputField(name2);
3125
3419
  const composedRefs = useComposedRefs(ref, fieldRef);
3420
+ const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
3126
3421
  return /* @__PURE__ */ jsxs(Field.Root, { hint, name: name2, error: field.error, required, children: [
3127
3422
  /* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
3128
3423
  /* @__PURE__ */ jsx(
@@ -3131,7 +3426,7 @@ const UIDInput = React.forwardRef(
3131
3426
  ref: composedRefs,
3132
3427
  disabled: props.disabled,
3133
3428
  endAction: /* @__PURE__ */ jsxs(Flex, { position: "relative", gap: 1, children: [
3134
- availability && !showRegenerate && /* @__PURE__ */ jsxs(
3429
+ shouldShowAvailability && /* @__PURE__ */ jsxs(
3135
3430
  TextValidation,
3136
3431
  {
3137
3432
  alignItems: "center",
@@ -3965,7 +4260,7 @@ const EditorLayout = ({
3965
4260
  justifyContent: "flex-end",
3966
4261
  shrink: 0,
3967
4262
  width: "100%",
3968
- children: /* @__PURE__ */ jsxs(ExpandButton$1, { onClick: onCollapse, children: [
4263
+ children: /* @__PURE__ */ jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
3969
4264
  /* @__PURE__ */ jsx(Typography, { children: formatMessage({
3970
4265
  id: "components.Wysiwyg.collapse",
3971
4266
  defaultMessage: "Collapse"
@@ -3983,12 +4278,14 @@ const EditorLayout = ({
3983
4278
  ) }) });
3984
4279
  }
3985
4280
  return /* @__PURE__ */ jsx(
3986
- Box,
4281
+ Flex,
3987
4282
  {
3988
4283
  borderColor: error ? "danger600" : "neutral200",
3989
4284
  borderStyle: "solid",
3990
4285
  borderWidth: "1px",
3991
4286
  hasRadius: true,
4287
+ direction: "column",
4288
+ alignItems: "stretch",
3992
4289
  children
3993
4290
  }
3994
4291
  );
@@ -3999,11 +4296,19 @@ const ExpandWrapper = styled(Flex)`
3999
4296
  const BoxWithBorder = styled(Box)`
4000
4297
  border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
4001
4298
  `;
4002
- const ExpandButton$1 = styled(BaseButton)`
4299
+ const ExpandButton$1 = styled(Button)`
4003
4300
  background-color: transparent;
4004
4301
  border: none;
4005
4302
  align-items: center;
4006
4303
 
4304
+ & > span {
4305
+ display: flex;
4306
+ justify-content: space-between;
4307
+ align-items: center;
4308
+ width: 100%;
4309
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4310
+ }
4311
+
4007
4312
  svg {
4008
4313
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4009
4314
 
@@ -4270,42 +4575,28 @@ const quoteAndCodeHandler = (editor, markdownType) => {
4270
4575
  insertWithoutTextToEdit(editor, markdownType, line, contentLength);
4271
4576
  }
4272
4577
  };
4273
- const CustomIconButton = styled(IconButton)`
4274
- padding: ${({ theme }) => theme.spaces[2]};
4275
- /* Trick to prevent the outline from overflowing because of the general outline-offset */
4276
- outline-offset: -2px !important;
4277
-
4278
- svg {
4279
- width: 1.8rem;
4280
- height: 1.8rem;
4281
- }
4282
- `;
4283
- const CustomLinkIconButton = styled(CustomIconButton)`
4284
- svg {
4285
- width: 0.8rem;
4286
- height: 0.8rem;
4287
- }
4288
- `;
4289
4578
  const MainButtons = styled(IconButtonGroup)`
4290
4579
  margin-left: ${({ theme }) => theme.spaces[4]};
4291
4580
  `;
4292
4581
  const MoreButton = styled(IconButton)`
4293
4582
  margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
4294
- padding: ${({ theme }) => theme.spaces[2]};
4295
-
4296
- svg {
4297
- width: 1.8rem;
4298
- height: 1.8rem;
4299
- }
4300
4583
  `;
4301
4584
  const IconButtonGroupMargin = styled(IconButtonGroup)`
4302
4585
  margin-right: ${({ theme }) => `${theme.spaces[2]}`};
4303
4586
  `;
4304
- const ExpandButton = styled(BaseButton)`
4587
+ const ExpandButton = styled(Button)`
4305
4588
  background-color: transparent;
4306
4589
  border: none;
4307
4590
  align-items: center;
4308
4591
 
4592
+ & > span {
4593
+ display: flex;
4594
+ justify-content: space-between;
4595
+ align-items: center;
4596
+ width: 100%;
4597
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4598
+ }
4599
+
4309
4600
  svg {
4310
4601
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4311
4602
  path {
@@ -4317,8 +4608,8 @@ const ExpandButton = styled(BaseButton)`
4317
4608
  `;
4318
4609
  const WysiwygFooter = ({ onToggleExpand }) => {
4319
4610
  const { formatMessage } = useIntl();
4320
- return /* @__PURE__ */ jsx(Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, children: [
4321
- /* @__PURE__ */ jsx(Typography, { children: formatMessage({
4611
+ return /* @__PURE__ */ jsx(Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, variant: "tertiary", size: "M", children: [
4612
+ /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: formatMessage({
4322
4613
  id: "components.WysiwygBottomControls.fullscreen",
4323
4614
  defaultMessage: "Expand"
4324
4615
  }) }),
@@ -4340,7 +4631,7 @@ const WysiwygNav = ({
4340
4631
  id: "components.Wysiwyg.selectOptions.title",
4341
4632
  defaultMessage: "Add a title"
4342
4633
  });
4343
- const buttonMoreRef = React.useRef(null);
4634
+ React.useRef(null);
4344
4635
  const handleTogglePopover = () => {
4345
4636
  setVisiblePopover((prev) => !prev);
4346
4637
  };
@@ -4354,18 +4645,27 @@ const WysiwygNav = ({
4354
4645
  borderRadius: `0.4rem 0.4rem 0 0`,
4355
4646
  children: [
4356
4647
  /* @__PURE__ */ jsxs(Flex, { children: [
4357
- /* @__PURE__ */ jsx(Field.Root, { children: /* @__PURE__ */ jsxs(SingleSelect, { disabled: true, placeholder: selectPlaceholder, "aria-label": selectPlaceholder, children: [
4358
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
4359
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
4360
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h3", children: "h3" }),
4361
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h4", children: "h4" }),
4362
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h5", children: "h5" }),
4363
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h6", children: "h6" })
4364
- ] }) }),
4648
+ /* @__PURE__ */ jsx(Field.Root, { children: /* @__PURE__ */ jsxs(
4649
+ SingleSelect,
4650
+ {
4651
+ disabled: true,
4652
+ placeholder: selectPlaceholder,
4653
+ "aria-label": selectPlaceholder,
4654
+ size: "S",
4655
+ children: [
4656
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
4657
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
4658
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h3", children: "h3" }),
4659
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h4", children: "h4" }),
4660
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h5", children: "h5" }),
4661
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h6", children: "h6" })
4662
+ ]
4663
+ }
4664
+ ) }),
4365
4665
  /* @__PURE__ */ jsxs(MainButtons, { children: [
4366
- /* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
4367
- /* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsx(Italic, {}) }),
4368
- /* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsx(Underline, {}) })
4666
+ /* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
4667
+ /* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsx(Italic, {}) }),
4668
+ /* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsx(Underline, {}) })
4369
4669
  ] }),
4370
4670
  /* @__PURE__ */ jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsx(More, {}) })
4371
4671
  ] }),
@@ -4392,6 +4692,7 @@ const WysiwygNav = ({
4392
4692
  placeholder: selectPlaceholder,
4393
4693
  "aria-label": selectPlaceholder,
4394
4694
  onChange: (value) => onActionClick(value, editorRef),
4695
+ size: "S",
4395
4696
  children: [
4396
4697
  /* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
4397
4698
  /* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
@@ -4403,17 +4704,9 @@ const WysiwygNav = ({
4403
4704
  }
4404
4705
  ) }),
4405
4706
  /* @__PURE__ */ jsxs(MainButtons, { children: [
4707
+ /* @__PURE__ */ jsx(IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
4406
4708
  /* @__PURE__ */ jsx(
4407
- CustomIconButton,
4408
- {
4409
- onClick: () => onActionClick("Bold", editorRef),
4410
- label: "Bold",
4411
- name: "Bold",
4412
- children: /* @__PURE__ */ jsx(Bold, {})
4413
- }
4414
- ),
4415
- /* @__PURE__ */ jsx(
4416
- CustomIconButton,
4709
+ IconButton,
4417
4710
  {
4418
4711
  onClick: () => onActionClick("Italic", editorRef),
4419
4712
  label: "Italic",
@@ -4422,7 +4715,7 @@ const WysiwygNav = ({
4422
4715
  }
4423
4716
  ),
4424
4717
  /* @__PURE__ */ jsx(
4425
- CustomIconButton,
4718
+ IconButton,
4426
4719
  {
4427
4720
  onClick: () => onActionClick("Underline", editorRef),
4428
4721
  label: "Underline",
@@ -4431,79 +4724,81 @@ const WysiwygNav = ({
4431
4724
  }
4432
4725
  )
4433
4726
  ] }),
4434
- /* @__PURE__ */ jsx(MoreButton, { ref: buttonMoreRef, onClick: handleTogglePopover, label: "More", children: /* @__PURE__ */ jsx(More, {}) }),
4435
- visiblePopover && /* @__PURE__ */ jsx(Popover, { onDismiss: handleTogglePopover, centered: true, source: buttonMoreRef, spacing: 4, children: /* @__PURE__ */ jsxs(Flex, { children: [
4436
- /* @__PURE__ */ jsxs(IconButtonGroupMargin, { children: [
4437
- /* @__PURE__ */ jsx(
4438
- CustomIconButton,
4439
- {
4440
- onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4441
- label: "Strikethrough",
4442
- name: "Strikethrough",
4443
- children: /* @__PURE__ */ jsx(StrikeThrough, {})
4444
- }
4445
- ),
4446
- /* @__PURE__ */ jsx(
4447
- CustomIconButton,
4448
- {
4449
- onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4450
- label: "BulletList",
4451
- name: "BulletList",
4452
- children: /* @__PURE__ */ jsx(BulletList, {})
4453
- }
4454
- ),
4455
- /* @__PURE__ */ jsx(
4456
- CustomIconButton,
4457
- {
4458
- onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4459
- label: "NumberList",
4460
- name: "NumberList",
4461
- children: /* @__PURE__ */ jsx(NumberList, {})
4462
- }
4463
- )
4464
- ] }),
4465
- /* @__PURE__ */ jsxs(IconButtonGroup, { children: [
4466
- /* @__PURE__ */ jsx(
4467
- CustomIconButton,
4468
- {
4469
- onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4470
- label: "Code",
4471
- name: "Code",
4472
- children: /* @__PURE__ */ jsx(Code, {})
4473
- }
4474
- ),
4475
- /* @__PURE__ */ jsx(
4476
- CustomIconButton,
4477
- {
4478
- onClick: () => {
4479
- handleTogglePopover();
4480
- onToggleMediaLib();
4481
- },
4482
- label: "Image",
4483
- name: "Image",
4484
- children: /* @__PURE__ */ jsx(Image$1, {})
4485
- }
4486
- ),
4487
- /* @__PURE__ */ jsx(
4488
- CustomLinkIconButton,
4489
- {
4490
- onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4491
- label: "Link",
4492
- name: "Link",
4493
- children: /* @__PURE__ */ jsx(Link$1, {})
4494
- }
4495
- ),
4496
- /* @__PURE__ */ jsx(
4497
- CustomIconButton,
4498
- {
4499
- onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4500
- label: "Quote",
4501
- name: "Quote",
4502
- children: /* @__PURE__ */ jsx(Quotes, {})
4503
- }
4504
- )
4505
- ] })
4506
- ] }) })
4727
+ /* @__PURE__ */ jsxs(Popover.Root, { children: [
4728
+ /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(MoreButton, { label: "More", children: /* @__PURE__ */ jsx(More, {}) }) }),
4729
+ /* @__PURE__ */ jsx(Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxs(Flex, { padding: 2, children: [
4730
+ /* @__PURE__ */ jsxs(IconButtonGroupMargin, { children: [
4731
+ /* @__PURE__ */ jsx(
4732
+ IconButton,
4733
+ {
4734
+ onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4735
+ label: "Strikethrough",
4736
+ name: "Strikethrough",
4737
+ children: /* @__PURE__ */ jsx(StrikeThrough, {})
4738
+ }
4739
+ ),
4740
+ /* @__PURE__ */ jsx(
4741
+ IconButton,
4742
+ {
4743
+ onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4744
+ label: "BulletList",
4745
+ name: "BulletList",
4746
+ children: /* @__PURE__ */ jsx(BulletList, {})
4747
+ }
4748
+ ),
4749
+ /* @__PURE__ */ jsx(
4750
+ IconButton,
4751
+ {
4752
+ onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4753
+ label: "NumberList",
4754
+ name: "NumberList",
4755
+ children: /* @__PURE__ */ jsx(NumberList, {})
4756
+ }
4757
+ )
4758
+ ] }),
4759
+ /* @__PURE__ */ jsxs(IconButtonGroup, { children: [
4760
+ /* @__PURE__ */ jsx(
4761
+ IconButton,
4762
+ {
4763
+ onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4764
+ label: "Code",
4765
+ name: "Code",
4766
+ children: /* @__PURE__ */ jsx(Code, {})
4767
+ }
4768
+ ),
4769
+ /* @__PURE__ */ jsx(
4770
+ IconButton,
4771
+ {
4772
+ onClick: () => {
4773
+ handleTogglePopover();
4774
+ onToggleMediaLib();
4775
+ },
4776
+ label: "Image",
4777
+ name: "Image",
4778
+ children: /* @__PURE__ */ jsx(Image$1, {})
4779
+ }
4780
+ ),
4781
+ /* @__PURE__ */ jsx(
4782
+ IconButton,
4783
+ {
4784
+ onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4785
+ label: "Link",
4786
+ name: "Link",
4787
+ children: /* @__PURE__ */ jsx(Link$1, {})
4788
+ }
4789
+ ),
4790
+ /* @__PURE__ */ jsx(
4791
+ IconButton,
4792
+ {
4793
+ onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4794
+ label: "Quote",
4795
+ name: "Quote",
4796
+ children: /* @__PURE__ */ jsx(Quotes, {})
4797
+ }
4798
+ )
4799
+ ] })
4800
+ ] }) })
4801
+ ] })
4507
4802
  ] }),
4508
4803
  onTogglePreviewMode && /* @__PURE__ */ jsx(Button, { onClick: onTogglePreviewMode, variant: "tertiary", children: formatMessage({
4509
4804
  id: "components.Wysiwyg.ToggleMode.preview-mode",
@@ -4649,6 +4944,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4649
4944
  const {
4650
4945
  edit: { components }
4651
4946
  } = useDocLayout();
4947
+ const field = useField(props.name);
4652
4948
  if (!visible) {
4653
4949
  return null;
4654
4950
  }
@@ -4659,7 +4955,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4659
4955
  if (attributeHasCustomFieldProperty(props.attribute)) {
4660
4956
  const CustomInput = lazyComponentStore[props.attribute.customField];
4661
4957
  if (CustomInput) {
4662
- return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
4958
+ return /* @__PURE__ */ jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
4663
4959
  }
4664
4960
  return /* @__PURE__ */ jsx(
4665
4961
  InputRenderer$1,
@@ -4729,7 +5025,9 @@ const useFieldHint = (hint = void 0, attribute) => {
4729
5025
  if (!maximum && !minimum) {
4730
5026
  return hint;
4731
5027
  }
4732
- const units = !["biginteger", "integer", "number"].includes(attribute.type) ? formatMessage(
5028
+ const units = !["biginteger", "integer", "number", "dynamiczone", "component"].includes(
5029
+ attribute.type
5030
+ ) ? formatMessage(
4733
5031
  {
4734
5032
  id: "content-manager.form.Input.hint.character.unit",
4735
5033
  defaultMessage: "{maxValue, plural, one { character} other { characters}}"
@@ -4823,7 +5121,7 @@ const DynamicComponent = ({
4823
5121
  /* @__PURE__ */ jsx(
4824
5122
  IconButton,
4825
5123
  {
4826
- borderWidth: 0,
5124
+ variant: "ghost",
4827
5125
  label: formatMessage(
4828
5126
  {
4829
5127
  id: getTranslation("components.DynamicZone.delete-label"),
@@ -4838,7 +5136,7 @@ const DynamicComponent = ({
4838
5136
  /* @__PURE__ */ jsx(
4839
5137
  IconButton,
4840
5138
  {
4841
- borderWidth: 0,
5139
+ variant: "ghost",
4842
5140
  onClick: (e) => e.stopPropagation(),
4843
5141
  "data-handler-id": handlerId,
4844
5142
  ref: dragRef,
@@ -4897,10 +5195,32 @@ const DynamicComponent = ({
4897
5195
  ),
4898
5196
  /* @__PURE__ */ jsx(Accordion.Actions, { children: accordionActions })
4899
5197
  ] }),
4900
- /* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsx(Grid$1, { gap: 4, children: row.map(({ size, ...field }) => {
4901
- const fieldName = `${name2}.${index}.${field.name}`;
4902
- return /* @__PURE__ */ jsx(GridItem, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName }) }, fieldName);
4903
- }) }, rowInd)) }) }) })
5198
+ /* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsx(
5199
+ Grid$1.Item,
5200
+ {
5201
+ col: 12,
5202
+ s: 12,
5203
+ xs: 12,
5204
+ direction: "column",
5205
+ alignItems: "stretch",
5206
+ children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5207
+ const fieldName = `${name2}.${index}.${field.name}`;
5208
+ return /* @__PURE__ */ jsx(
5209
+ Grid$1.Item,
5210
+ {
5211
+ col: size,
5212
+ s: 12,
5213
+ xs: 12,
5214
+ direction: "column",
5215
+ alignItems: "stretch",
5216
+ children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName })
5217
+ },
5218
+ fieldName
5219
+ );
5220
+ }) })
5221
+ },
5222
+ rowInd
5223
+ )) }) }) }) })
4904
5224
  ] }) }) })
4905
5225
  ] });
4906
5226
  };
@@ -5092,7 +5412,7 @@ const DynamicZone = ({
5092
5412
  const handleRemoveComponent = (name22, currentIndex) => () => {
5093
5413
  removeFieldRow(name22, currentIndex);
5094
5414
  };
5095
- const hasError = error !== void 0 || dynamicDisplayedComponentsLength < min || dynamicDisplayedComponentsLength > max;
5415
+ const hasError = error !== void 0;
5096
5416
  const renderButtonLabel = () => {
5097
5417
  if (addComponentIsOpen) {
5098
5418
  return formatMessage({ id: "app.utils.close-label", defaultMessage: "Close" });
@@ -5208,4 +5528,4 @@ export {
5208
5528
  transformDocument as t,
5209
5529
  useLazyComponents as u
5210
5530
  };
5211
- //# sourceMappingURL=Field-DnStdvQw.mjs.map
5531
+ //# sourceMappingURL=Field-B_jG_EV9.mjs.map