@strapi/content-manager 0.0.0-experimental.f75e3c6d67cc47c64ab37479efdbb7b43be50b78 → 5.0.0-beta.10

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 (95) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-by0e_kNd.js → ComponentConfigurationPage-BNrZY1Rt.js} +3 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-by0e_kNd.js.map → ComponentConfigurationPage-BNrZY1Rt.js.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-CuWgXugY.mjs → ComponentConfigurationPage-DF4KsgJw.mjs} +3 -3
  4. package/dist/_chunks/{ComponentConfigurationPage-CuWgXugY.mjs.map → ComponentConfigurationPage-DF4KsgJw.mjs.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-CqBeCPGH.js → EditConfigurationPage-CzBCnSlY.js} +3 -3
  6. package/dist/_chunks/{EditConfigurationPage-CqBeCPGH.js.map → EditConfigurationPage-CzBCnSlY.js.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-DbI4KMyz.mjs → EditConfigurationPage-Dn7sFfOu.mjs} +3 -3
  8. package/dist/_chunks/{EditConfigurationPage-DbI4KMyz.mjs.map → EditConfigurationPage-Dn7sFfOu.mjs.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-ChgloMyO.js → EditViewPage-CEemNwSu.js} +45 -45
  10. package/dist/_chunks/EditViewPage-CEemNwSu.js.map +1 -0
  11. package/dist/_chunks/{EditViewPage-dFPBya9U.mjs → EditViewPage-D2uq2uZS.mjs} +46 -46
  12. package/dist/_chunks/EditViewPage-D2uq2uZS.mjs.map +1 -0
  13. package/dist/_chunks/{Field-C1nUKcdS.mjs → Field-DvB4ig_f.mjs} +373 -118
  14. package/dist/_chunks/Field-DvB4ig_f.mjs.map +1 -0
  15. package/dist/_chunks/{Field-dLk-vgLL.js → Field-KHBYihjn.js} +372 -117
  16. package/dist/_chunks/Field-KHBYihjn.js.map +1 -0
  17. package/dist/_chunks/{Form-DOlpi7Js.mjs → Form-BGmF27Mb.mjs} +27 -28
  18. package/dist/_chunks/Form-BGmF27Mb.mjs.map +1 -0
  19. package/dist/_chunks/{Form-CbXtmHC_.js → Form-De_O8dNp.js} +25 -26
  20. package/dist/_chunks/Form-De_O8dNp.js.map +1 -0
  21. package/dist/_chunks/{History-BFNUAiGc.mjs → History-Cqq6Csvj.mjs} +103 -23
  22. package/dist/_chunks/History-Cqq6Csvj.mjs.map +1 -0
  23. package/dist/_chunks/{History-BjDfohBr.js → History-aALwb_34.js} +102 -22
  24. package/dist/_chunks/History-aALwb_34.js.map +1 -0
  25. package/dist/_chunks/{ListConfigurationPage-DDi0KqFm.mjs → ListConfigurationPage-Bke2024Z.mjs} +43 -45
  26. package/dist/_chunks/ListConfigurationPage-Bke2024Z.mjs.map +1 -0
  27. package/dist/_chunks/{ListConfigurationPage-IQBgWTaa.js → ListConfigurationPage-DimG1pln.js} +42 -43
  28. package/dist/_chunks/ListConfigurationPage-DimG1pln.js.map +1 -0
  29. package/dist/_chunks/{ListViewPage-CZYGqlvF.js → ListViewPage-BO-JvrUA.js} +60 -65
  30. package/dist/_chunks/ListViewPage-BO-JvrUA.js.map +1 -0
  31. package/dist/_chunks/{ListViewPage-BPjljUsH.mjs → ListViewPage-Cjbh5jyY.mjs} +62 -67
  32. package/dist/_chunks/ListViewPage-Cjbh5jyY.mjs.map +1 -0
  33. package/dist/_chunks/{NoContentTypePage-BOAI6VZ1.js → NoContentTypePage-S-R1DXX2.js} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-BOAI6VZ1.js.map → NoContentTypePage-S-R1DXX2.js.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-DaWw67K-.mjs → NoContentTypePage-m6_m6mFn.mjs} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-DaWw67K-.mjs.map → NoContentTypePage-m6_m6mFn.mjs.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-CZrJH00p.mjs → NoPermissionsPage-CCMchuOR.mjs} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-CZrJH00p.mjs.map → NoPermissionsPage-CCMchuOR.mjs.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-cYEtLc_e.js → NoPermissionsPage-wFEMKcdV.js} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-cYEtLc_e.js.map → NoPermissionsPage-wFEMKcdV.js.map} +1 -1
  41. package/dist/_chunks/{Relations-DU6B7irU.js → Relations-PjEVbLqZ.js} +4 -4
  42. package/dist/_chunks/{Relations-DU6B7irU.js.map → Relations-PjEVbLqZ.js.map} +1 -1
  43. package/dist/_chunks/{Relations-DTowyge2.mjs → Relations-i8F_imXr.mjs} +4 -4
  44. package/dist/_chunks/{Relations-DTowyge2.mjs.map → Relations-i8F_imXr.mjs.map} +1 -1
  45. package/dist/_chunks/{en-GCOTL6jR.mjs → en-Ux26r5pl.mjs} +5 -1
  46. package/dist/_chunks/{en-GCOTL6jR.mjs.map → en-Ux26r5pl.mjs.map} +1 -1
  47. package/dist/_chunks/{en-DTULi5-d.js → en-fbKQxLGn.js} +5 -1
  48. package/dist/_chunks/{en-DTULi5-d.js.map → en-fbKQxLGn.js.map} +1 -1
  49. package/dist/_chunks/{index-CCJeB7Rw.js → index-B4Gj2Oe9.js} +1239 -947
  50. package/dist/_chunks/index-B4Gj2Oe9.js.map +1 -0
  51. package/dist/_chunks/{index-BaGHmIir.mjs → index-BAGok3Xa.mjs} +1257 -965
  52. package/dist/_chunks/index-BAGok3Xa.mjs.map +1 -0
  53. package/dist/_chunks/{layout-BinjszSQ.mjs → layout-BybbePH7.mjs} +17 -12
  54. package/dist/_chunks/layout-BybbePH7.mjs.map +1 -0
  55. package/dist/_chunks/{layout-ni_L9kT1.js → layout-aK6fNSLK.js} +17 -12
  56. package/dist/_chunks/layout-aK6fNSLK.js.map +1 -0
  57. package/dist/_chunks/{relations-c91ji5eR.mjs → relations-BZicUuRc.mjs} +2 -2
  58. package/dist/_chunks/{relations-c91ji5eR.mjs.map → relations-BZicUuRc.mjs.map} +1 -1
  59. package/dist/_chunks/{relations-CeJAJc5I.js → relations-yBDEAWeN.js} +2 -2
  60. package/dist/_chunks/{relations-CeJAJc5I.js.map → relations-yBDEAWeN.js.map} +1 -1
  61. package/dist/admin/index.js +1 -1
  62. package/dist/admin/index.mjs +5 -5
  63. package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
  64. package/dist/admin/src/hooks/useDocumentActions.d.ts +1 -1
  65. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +7 -3
  66. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
  67. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +2 -10
  68. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  69. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  70. package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +14 -0
  71. package/dist/server/index.js +20 -15
  72. package/dist/server/index.js.map +1 -1
  73. package/dist/server/index.mjs +20 -15
  74. package/dist/server/index.mjs.map +1 -1
  75. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  76. package/dist/server/src/controllers/single-types.d.ts.map +1 -1
  77. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  78. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  79. package/package.json +8 -8
  80. package/dist/_chunks/EditViewPage-ChgloMyO.js.map +0 -1
  81. package/dist/_chunks/EditViewPage-dFPBya9U.mjs.map +0 -1
  82. package/dist/_chunks/Field-C1nUKcdS.mjs.map +0 -1
  83. package/dist/_chunks/Field-dLk-vgLL.js.map +0 -1
  84. package/dist/_chunks/Form-CbXtmHC_.js.map +0 -1
  85. package/dist/_chunks/Form-DOlpi7Js.mjs.map +0 -1
  86. package/dist/_chunks/History-BFNUAiGc.mjs.map +0 -1
  87. package/dist/_chunks/History-BjDfohBr.js.map +0 -1
  88. package/dist/_chunks/ListConfigurationPage-DDi0KqFm.mjs.map +0 -1
  89. package/dist/_chunks/ListConfigurationPage-IQBgWTaa.js.map +0 -1
  90. package/dist/_chunks/ListViewPage-BPjljUsH.mjs.map +0 -1
  91. package/dist/_chunks/ListViewPage-CZYGqlvF.js.map +0 -1
  92. package/dist/_chunks/index-BaGHmIir.mjs.map +0 -1
  93. package/dist/_chunks/index-CCJeB7Rw.js.map +0 -1
  94. package/dist/_chunks/layout-BinjszSQ.mjs.map +0 -1
  95. package/dist/_chunks/layout-ni_L9kT1.js.map +0 -1
@@ -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, BaseButton, 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 { l as DOCUMENT_META_FIELDS, g as getTranslation, b as useDoc, d as contentManagerApi, c as buildValidParams, e as useDocumentRBAC, m as useDocLayout } from "./index-BaGHmIir.mjs";
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-BAGok3Xa.mjs";
9
9
  import { generateNKeysBetween } from "fractional-indexing";
10
- import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-DTowyge2.mjs";
10
+ import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-i8F_imXr.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";
@@ -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,17 +856,23 @@ 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
863
  const [showRemoveButton, setShowRemoveButton] = React.useState(false);
598
864
  const [isSaveDisabled, setIsSaveDisabled] = React.useState(false);
599
- const handleOpenEditPopover = (e) => {
600
- e.preventDefault();
601
- setPopoverOpen(true);
602
- setShowRemoveButton(true);
865
+ const handleOpenChange = (isOpen) => {
866
+ if (isOpen) {
867
+ setPopoverOpen(isOpen);
868
+ setShowRemoveButton(isOpen);
869
+ } else {
870
+ setPopoverOpen(isOpen);
871
+ if (link.url === "") {
872
+ removeLink(editor);
873
+ }
874
+ ReactEditor.focus(editor);
875
+ }
603
876
  };
604
877
  const onLinkChange = (e) => {
605
878
  setIsSaveDisabled(false);
@@ -622,32 +895,14 @@ const LinkContent = React.forwardRef(
622
895
  setPopoverOpen(false);
623
896
  editor.lastInsertedLinkPath = null;
624
897
  };
625
- const handleDismiss = () => {
626
- setPopoverOpen(false);
627
- if (link.url === "") {
628
- removeLink(editor);
629
- }
630
- ReactEditor.focus(editor);
631
- };
632
- const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
633
- const composedRefs = useComposedRefs(linkRef, forwardedRef);
634
898
  React.useEffect(() => {
635
899
  if (popoverOpen)
636
900
  linkInputRef.current?.focus();
637
901
  }, [popoverOpen]);
638
- return /* @__PURE__ */ jsxs(Fragment, { children: [
639
- /* @__PURE__ */ jsx(
640
- StyledBaseLink,
641
- {
642
- ...attributes,
643
- ref: composedRefs,
644
- href: link.url,
645
- onClick: handleOpenEditPopover,
646
- color: "primary600",
647
- children
648
- }
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: [
902
+ const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
903
+ return /* @__PURE__ */ jsxs(Popover.Root, { onOpenChange: handleOpenChange, open: popoverOpen, children: [
904
+ /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(StyledBaseLink, { ...attributes, ref: forwardedRef, href: link.url, color: "primary600", children }) }),
905
+ /* @__PURE__ */ jsx(Popover.Content, { children: /* @__PURE__ */ jsxs(Flex, { padding: 4, tag: "form", onSubmit: handleSave, direction: "column", gap: 4, children: [
651
906
  /* @__PURE__ */ jsx(Field.Root, { width: "368px", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
652
907
  /* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
653
908
  id: "components.Blocks.popover.text",
@@ -701,7 +956,7 @@ const LinkContent = React.forwardRef(
701
956
  }
702
957
  ),
703
958
  /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
704
- /* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: handleDismiss, children: formatMessage({
959
+ /* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: () => handleOpenChange(false), children: formatMessage({
705
960
  id: "components.Blocks.popover.cancel",
706
961
  defaultMessage: "Cancel"
707
962
  }) }),
@@ -2392,9 +2647,9 @@ const NonRepeatableComponent = ({
2392
2647
  hasRadius: isNested,
2393
2648
  borderColor: isNested ? "neutral200" : void 0,
2394
2649
  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 }) => {
2650
+ return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2396
2651
  const completeFieldName = `${name2}.${field.name}`;
2397
- return /* @__PURE__ */ jsx(GridItem, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2652
+ return /* @__PURE__ */ jsx(Grid$1.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2398
2653
  }) }, index);
2399
2654
  }) })
2400
2655
  }
@@ -2570,9 +2825,9 @@ const RepeatableComponent = ({
2570
2825
  onGrabItem: handleGrabItem,
2571
2826
  __temp_key__: key,
2572
2827
  children: layout.map((row, index2) => {
2573
- return /* @__PURE__ */ jsx(Grid$1, { gap: 4, children: row.map(({ size, ...field }) => {
2828
+ return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2574
2829
  const completeFieldName = `${nameWithIndex}.${field.name}`;
2575
- return /* @__PURE__ */ jsx(GridItem, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2830
+ return /* @__PURE__ */ jsx(Grid$1.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2576
2831
  }) }, index2);
2577
2832
  })
2578
2833
  }
@@ -2617,7 +2872,7 @@ const TextButtonCustom = styled(TextButton)`
2617
2872
  }
2618
2873
 
2619
2874
  @media (prefers-reduced-motion: no-preference) {
2620
- transition: background-color 120ms ${(props) => props.theme.easings.easeOutQuad};
2875
+ transition: background-color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};
2621
2876
  }
2622
2877
  `;
2623
2878
  const Component = ({
@@ -2885,7 +3140,7 @@ const ComponentBox = styled(Flex)`
2885
3140
  cursor: pointer;
2886
3141
 
2887
3142
  @media (prefers-reduced-motion: no-preference) {
2888
- transition: color 120ms ${(props) => props.theme.easings.easeOutQuad};
3143
+ transition: color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};
2889
3144
  }
2890
3145
 
2891
3146
  &:focus,
@@ -4272,8 +4527,6 @@ const quoteAndCodeHandler = (editor, markdownType) => {
4272
4527
  };
4273
4528
  const CustomIconButton = styled(IconButton)`
4274
4529
  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
4530
 
4278
4531
  svg {
4279
4532
  width: 1.8rem;
@@ -4340,7 +4593,7 @@ const WysiwygNav = ({
4340
4593
  id: "components.Wysiwyg.selectOptions.title",
4341
4594
  defaultMessage: "Add a title"
4342
4595
  });
4343
- const buttonMoreRef = React.useRef(null);
4596
+ React.useRef(null);
4344
4597
  const handleTogglePopover = () => {
4345
4598
  setVisiblePopover((prev) => !prev);
4346
4599
  };
@@ -4431,79 +4684,81 @@ const WysiwygNav = ({
4431
4684
  }
4432
4685
  )
4433
4686
  ] }),
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
- ] }) })
4687
+ /* @__PURE__ */ jsxs(Popover.Root, { children: [
4688
+ /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(MoreButton, { label: "More", children: /* @__PURE__ */ jsx(More, {}) }) }),
4689
+ /* @__PURE__ */ jsx(Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxs(Flex, { padding: 2, children: [
4690
+ /* @__PURE__ */ jsxs(IconButtonGroupMargin, { children: [
4691
+ /* @__PURE__ */ jsx(
4692
+ CustomIconButton,
4693
+ {
4694
+ onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4695
+ label: "Strikethrough",
4696
+ name: "Strikethrough",
4697
+ children: /* @__PURE__ */ jsx(StrikeThrough, {})
4698
+ }
4699
+ ),
4700
+ /* @__PURE__ */ jsx(
4701
+ CustomIconButton,
4702
+ {
4703
+ onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4704
+ label: "BulletList",
4705
+ name: "BulletList",
4706
+ children: /* @__PURE__ */ jsx(BulletList, {})
4707
+ }
4708
+ ),
4709
+ /* @__PURE__ */ jsx(
4710
+ CustomIconButton,
4711
+ {
4712
+ onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4713
+ label: "NumberList",
4714
+ name: "NumberList",
4715
+ children: /* @__PURE__ */ jsx(NumberList, {})
4716
+ }
4717
+ )
4718
+ ] }),
4719
+ /* @__PURE__ */ jsxs(IconButtonGroup, { children: [
4720
+ /* @__PURE__ */ jsx(
4721
+ CustomIconButton,
4722
+ {
4723
+ onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4724
+ label: "Code",
4725
+ name: "Code",
4726
+ children: /* @__PURE__ */ jsx(Code, {})
4727
+ }
4728
+ ),
4729
+ /* @__PURE__ */ jsx(
4730
+ CustomIconButton,
4731
+ {
4732
+ onClick: () => {
4733
+ handleTogglePopover();
4734
+ onToggleMediaLib();
4735
+ },
4736
+ label: "Image",
4737
+ name: "Image",
4738
+ children: /* @__PURE__ */ jsx(Image$1, {})
4739
+ }
4740
+ ),
4741
+ /* @__PURE__ */ jsx(
4742
+ CustomLinkIconButton,
4743
+ {
4744
+ onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4745
+ label: "Link",
4746
+ name: "Link",
4747
+ children: /* @__PURE__ */ jsx(Link$1, {})
4748
+ }
4749
+ ),
4750
+ /* @__PURE__ */ jsx(
4751
+ CustomIconButton,
4752
+ {
4753
+ onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4754
+ label: "Quote",
4755
+ name: "Quote",
4756
+ children: /* @__PURE__ */ jsx(Quotes, {})
4757
+ }
4758
+ )
4759
+ ] })
4760
+ ] }) })
4761
+ ] })
4507
4762
  ] }),
4508
4763
  onTogglePreviewMode && /* @__PURE__ */ jsx(Button, { onClick: onTogglePreviewMode, variant: "tertiary", children: formatMessage({
4509
4764
  id: "components.Wysiwyg.ToggleMode.preview-mode",
@@ -4897,9 +5152,9 @@ const DynamicComponent = ({
4897
5152
  ),
4898
5153
  /* @__PURE__ */ jsx(Accordion.Actions, { children: accordionActions })
4899
5154
  ] }),
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 }) => {
5155
+ /* @__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.Root, { gap: 4, children: row.map(({ size, ...field }) => {
4901
5156
  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);
5157
+ return /* @__PURE__ */ jsx(Grid$1.Item, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName }) }, fieldName);
4903
5158
  }) }, rowInd)) }) }) })
4904
5159
  ] }) }) })
4905
5160
  ] });
@@ -5208,4 +5463,4 @@ export {
5208
5463
  transformDocument as t,
5209
5464
  useLazyComponents as u
5210
5465
  };
5211
- //# sourceMappingURL=Field-C1nUKcdS.mjs.map
5466
+ //# sourceMappingURL=Field-DvB4ig_f.mjs.map