@strapi/content-manager 0.0.0-experimental.3d525b3d2d44b055469a7694f6aaecfe7145b9e6 → 0.0.0-experimental.3f0da6c47a9691860812c214ad0ea5ed99e620e7

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 (203) hide show
  1. package/dist/admin/chunks/{CardDragPreview-DwuraT0K.js → CardDragPreview-DwuraT0K.mjs} +1 -1
  2. package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs.map +1 -0
  3. package/dist/admin/chunks/{ComponentConfigurationPage-BSCYuG9k.js → ComponentConfigurationPage-BN2kOtDm.mjs} +9 -8
  4. package/dist/admin/chunks/ComponentConfigurationPage-BN2kOtDm.mjs.map +1 -0
  5. package/dist/admin/chunks/{ComponentConfigurationPage-D4UH2BN4.js → ComponentConfigurationPage-C5H-5L1u.js} +4 -3
  6. package/dist/admin/chunks/{ComponentConfigurationPage-D4UH2BN4.js.map → ComponentConfigurationPage-C5H-5L1u.js.map} +1 -1
  7. package/dist/admin/chunks/{ComponentIcon-BZcTc4rj.js → ComponentIcon-BZcTc4rj.mjs} +1 -1
  8. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs.map +1 -0
  9. package/dist/admin/chunks/{EditConfigurationPage-C6jesdjb.js → EditConfigurationPage-BExtZuB7.js} +4 -3
  10. package/dist/admin/chunks/{EditConfigurationPage-C6jesdjb.js.map → EditConfigurationPage-BExtZuB7.js.map} +1 -1
  11. package/dist/admin/chunks/{EditConfigurationPage-DAwy6frt.js → EditConfigurationPage-tMgOELQG.mjs} +9 -8
  12. package/dist/admin/chunks/EditConfigurationPage-tMgOELQG.mjs.map +1 -0
  13. package/dist/admin/chunks/{EditViewPage-BZuZJr0N.js → EditViewPage-CYe7wAXF.mjs} +59 -10
  14. package/dist/admin/chunks/EditViewPage-CYe7wAXF.mjs.map +1 -0
  15. package/dist/admin/chunks/{EditViewPage-D8FDB8_y.js → EditViewPage-DFkloeMZ.js} +55 -6
  16. package/dist/admin/chunks/EditViewPage-DFkloeMZ.js.map +1 -0
  17. package/dist/admin/chunks/{FieldTypeIcon-BY6MrVF4.js → FieldTypeIcon-BY6MrVF4.mjs} +1 -1
  18. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs.map +1 -0
  19. package/dist/admin/chunks/{Form-CzUHBbLw.js → Form-DGUP3zQO.js} +2 -2
  20. package/dist/admin/chunks/{Form-CzUHBbLw.js.map → Form-DGUP3zQO.js.map} +1 -1
  21. package/dist/admin/chunks/{Form-Bwz2xTe9.js → Form-DTO0ZIaB.mjs} +5 -5
  22. package/dist/admin/chunks/Form-DTO0ZIaB.mjs.map +1 -0
  23. package/dist/admin/chunks/{History-5wpSVAu9.js → History-C333pgXF.mjs} +60 -11
  24. package/dist/admin/chunks/History-C333pgXF.mjs.map +1 -0
  25. package/dist/admin/chunks/{History-Dax5KiyG.js → History-CQznK1pG.js} +55 -6
  26. package/dist/admin/chunks/{History-Dax5KiyG.js.map → History-CQznK1pG.js.map} +1 -1
  27. package/dist/admin/chunks/{Input-Csrk7S5E.js → Input-BexkC_pp.mjs} +805 -371
  28. package/dist/admin/chunks/Input-BexkC_pp.mjs.map +1 -0
  29. package/dist/admin/chunks/{Input-Dr7YL5Sv.js → Input-DLJZHw9Y.js} +800 -365
  30. package/dist/admin/chunks/Input-DLJZHw9Y.js.map +1 -0
  31. package/dist/admin/chunks/{ListConfigurationPage-oFwCMRWP.js → ListConfigurationPage-71I_stAM.js} +3 -2
  32. package/dist/admin/chunks/{ListConfigurationPage-Bp1dKd-U.js.map → ListConfigurationPage-71I_stAM.js.map} +1 -1
  33. package/dist/admin/chunks/{ListConfigurationPage-Bp1dKd-U.js → ListConfigurationPage-BX2WR7MI.mjs} +8 -7
  34. package/dist/admin/chunks/ListConfigurationPage-BX2WR7MI.mjs.map +1 -0
  35. package/dist/admin/chunks/{ListViewPage-DfHXfD_c.js → ListViewPage-BDeT3Dkk.mjs} +6 -5
  36. package/dist/admin/chunks/ListViewPage-BDeT3Dkk.mjs.map +1 -0
  37. package/dist/admin/chunks/{ListViewPage-CkPfXiex.js → ListViewPage-DV3heO4F.js} +4 -3
  38. package/dist/admin/chunks/{ListViewPage-DfHXfD_c.js.map → ListViewPage-DV3heO4F.js.map} +1 -1
  39. package/dist/admin/chunks/{NoContentTypePage-BLWccskh.js → NoContentTypePage-9JHYpYVX.mjs} +3 -2
  40. package/dist/admin/chunks/NoContentTypePage-9JHYpYVX.mjs.map +1 -0
  41. package/dist/admin/chunks/{NoContentTypePage-BgTBqH4R.js → NoContentTypePage-COih9y2J.js} +3 -2
  42. package/dist/admin/chunks/{NoContentTypePage-BLWccskh.js.map → NoContentTypePage-COih9y2J.js.map} +1 -1
  43. package/dist/admin/chunks/{NoPermissionsPage-CUnJ9nZ8.js → NoPermissionsPage-DGAwRIlN.js} +3 -2
  44. package/dist/admin/chunks/{NoPermissionsPage-CGC__b-5.js.map → NoPermissionsPage-DGAwRIlN.js.map} +1 -1
  45. package/dist/admin/chunks/{NoPermissionsPage-CGC__b-5.js → NoPermissionsPage-DTe9I47q.mjs} +3 -2
  46. package/dist/admin/chunks/NoPermissionsPage-DTe9I47q.mjs.map +1 -0
  47. package/dist/admin/chunks/{Preview-uBnW2CsI.js → Preview-BEq0FXda.mjs} +101 -32
  48. package/dist/admin/chunks/Preview-BEq0FXda.mjs.map +1 -0
  49. package/dist/admin/chunks/{Preview-DKUCY7o_.js → Preview-CXtc9yEV.js} +96 -27
  50. package/dist/admin/chunks/Preview-CXtc9yEV.js.map +1 -0
  51. package/dist/admin/chunks/{Relations-CzrnshXy.js → Relations-o7_hVGyK.js} +469 -4
  52. package/dist/admin/chunks/Relations-o7_hVGyK.js.map +1 -0
  53. package/dist/admin/chunks/{Relations-BgtVC-3t.js → Relations-qeZyLDgQ.mjs} +471 -7
  54. package/dist/admin/chunks/Relations-qeZyLDgQ.mjs.map +1 -0
  55. package/dist/admin/chunks/{ar-DckYq_WK.js → ar-DckYq_WK.mjs} +1 -1
  56. package/dist/admin/chunks/ar-DckYq_WK.mjs.map +1 -0
  57. package/dist/admin/chunks/{ca-DviY7mRj.js → ca-DviY7mRj.mjs} +1 -1
  58. package/dist/admin/chunks/ca-DviY7mRj.mjs.map +1 -0
  59. package/dist/admin/chunks/{cs-C7OSYFQ7.js → cs-C7OSYFQ7.mjs} +1 -1
  60. package/dist/admin/chunks/cs-C7OSYFQ7.mjs.map +1 -0
  61. package/dist/admin/chunks/{de-5QRlDHyR.js → de-5QRlDHyR.mjs} +1 -1
  62. package/dist/admin/chunks/de-5QRlDHyR.mjs.map +1 -0
  63. package/dist/admin/chunks/{en-LfhocNG2.js → en-LfhocNG2.mjs} +1 -1
  64. package/dist/admin/chunks/{en-LfhocNG2.js.map → en-LfhocNG2.mjs.map} +1 -1
  65. package/dist/admin/chunks/{es-DkoWSExG.js → es-DkoWSExG.mjs} +1 -1
  66. package/dist/admin/chunks/es-DkoWSExG.mjs.map +1 -0
  67. package/dist/admin/chunks/{eu-BG1xX7HK.js → eu-BG1xX7HK.mjs} +1 -1
  68. package/dist/admin/chunks/eu-BG1xX7HK.mjs.map +1 -0
  69. package/dist/admin/chunks/{fr-CFdRaRVj.js → fr-CFdRaRVj.mjs} +1 -1
  70. package/dist/admin/chunks/fr-CFdRaRVj.mjs.map +1 -0
  71. package/dist/admin/chunks/{gu-D5MMMXRs.js → gu-D5MMMXRs.mjs} +1 -1
  72. package/dist/admin/chunks/gu-D5MMMXRs.mjs.map +1 -0
  73. package/dist/admin/chunks/{hi-lp17SCjr.js → hi-lp17SCjr.mjs} +1 -1
  74. package/dist/admin/chunks/hi-lp17SCjr.mjs.map +1 -0
  75. package/dist/admin/chunks/{hooks-DMvik5y_.js → hooks-DMvik5y_.mjs} +1 -1
  76. package/dist/admin/chunks/hooks-DMvik5y_.mjs.map +1 -0
  77. package/dist/admin/chunks/{hu-CLka1U2C.js → hu-CLka1U2C.mjs} +1 -1
  78. package/dist/admin/chunks/hu-CLka1U2C.mjs.map +1 -0
  79. package/dist/admin/chunks/{id-USfY9m1g.js → id-USfY9m1g.mjs} +1 -1
  80. package/dist/admin/chunks/id-USfY9m1g.mjs.map +1 -0
  81. package/dist/admin/chunks/{index-BhFoy2kH.js → index-BHimg6jW.js} +12 -11
  82. package/dist/admin/chunks/{index-2cT6u68c.js.map → index-BHimg6jW.js.map} +1 -1
  83. package/dist/admin/chunks/{index-2cT6u68c.js → index-Cs6qwFQu.mjs} +43 -42
  84. package/dist/admin/chunks/index-Cs6qwFQu.mjs.map +1 -0
  85. package/dist/admin/chunks/{it-BAHrwmYS.js → it-BAHrwmYS.mjs} +1 -1
  86. package/dist/admin/chunks/it-BAHrwmYS.mjs.map +1 -0
  87. package/dist/admin/chunks/{ja-BWKmBJFT.js → ja-BWKmBJFT.mjs} +1 -1
  88. package/dist/admin/chunks/ja-BWKmBJFT.mjs.map +1 -0
  89. package/dist/admin/chunks/{ko-CgADGBNt.js → ko-CgADGBNt.mjs} +1 -1
  90. package/dist/admin/chunks/ko-CgADGBNt.mjs.map +1 -0
  91. package/dist/admin/chunks/{layout-CsDX52Zb.js → layout-DStNia_P.mjs} +8 -7
  92. package/dist/admin/chunks/layout-DStNia_P.mjs.map +1 -0
  93. package/dist/admin/chunks/{layout-CDvvkRib.js → layout-Dtahn4Ue.js} +5 -4
  94. package/dist/admin/chunks/{layout-CDvvkRib.js.map → layout-Dtahn4Ue.js.map} +1 -1
  95. package/dist/admin/chunks/{ml-CnhCfOn_.js → ml-CnhCfOn_.mjs} +1 -1
  96. package/dist/admin/chunks/ml-CnhCfOn_.mjs.map +1 -0
  97. package/dist/admin/chunks/{ms-Bh09NFff.js → ms-Bh09NFff.mjs} +1 -1
  98. package/dist/admin/chunks/ms-Bh09NFff.mjs.map +1 -0
  99. package/dist/admin/chunks/{nl-C8HYflTc.js → nl-C8HYflTc.mjs} +1 -1
  100. package/dist/admin/chunks/nl-C8HYflTc.mjs.map +1 -0
  101. package/dist/admin/chunks/{objects-wl73iEma.js → objects-wl73iEma.mjs} +1 -1
  102. package/dist/admin/chunks/objects-wl73iEma.mjs.map +1 -0
  103. package/dist/admin/chunks/{pl-MFCZJZuZ.js → pl-MFCZJZuZ.mjs} +1 -1
  104. package/dist/admin/chunks/pl-MFCZJZuZ.mjs.map +1 -0
  105. package/dist/admin/chunks/{pt-BR-CcotyBGJ.js → pt-BR-CcotyBGJ.mjs} +1 -1
  106. package/dist/admin/chunks/pt-BR-CcotyBGJ.mjs.map +1 -0
  107. package/dist/admin/chunks/{pt-HbmgeiYO.js → pt-HbmgeiYO.mjs} +1 -1
  108. package/dist/admin/chunks/pt-HbmgeiYO.mjs.map +1 -0
  109. package/dist/admin/chunks/{relations-LR7_V8ZN.js → relations-Cq8NRUto.mjs} +2 -2
  110. package/dist/admin/chunks/relations-Cq8NRUto.mjs.map +1 -0
  111. package/dist/admin/chunks/{relations--SHAQ-Ch.js → relations-XOYEEqMz.js} +2 -2
  112. package/dist/admin/chunks/{relations--SHAQ-Ch.js.map → relations-XOYEEqMz.js.map} +1 -1
  113. package/dist/admin/chunks/{ru-CB4BUyQp.js → ru-CB4BUyQp.mjs} +1 -1
  114. package/dist/admin/chunks/{ru-CB4BUyQp.js.map → ru-CB4BUyQp.mjs.map} +1 -1
  115. package/dist/admin/chunks/{sa-n_aPA-pU.js → sa-n_aPA-pU.mjs} +1 -1
  116. package/dist/admin/chunks/sa-n_aPA-pU.mjs.map +1 -0
  117. package/dist/admin/chunks/{sk-tn_BDjE2.js → sk-tn_BDjE2.mjs} +1 -1
  118. package/dist/admin/chunks/sk-tn_BDjE2.mjs.map +1 -0
  119. package/dist/admin/chunks/{sv-cq4ZrQRd.js → sv-cq4ZrQRd.mjs} +1 -1
  120. package/dist/admin/chunks/sv-cq4ZrQRd.mjs.map +1 -0
  121. package/dist/admin/chunks/{th-mUH7hEtc.js → th-mUH7hEtc.mjs} +1 -1
  122. package/dist/admin/chunks/th-mUH7hEtc.mjs.map +1 -0
  123. package/dist/admin/chunks/{tr-Yt38daxh.js → tr-Yt38daxh.mjs} +1 -1
  124. package/dist/admin/chunks/tr-Yt38daxh.mjs.map +1 -0
  125. package/dist/admin/chunks/{uk-Cpgmm7gE.js → uk-Cpgmm7gE.mjs} +1 -1
  126. package/dist/admin/chunks/uk-Cpgmm7gE.mjs.map +1 -0
  127. package/dist/admin/chunks/{useDragAndDrop-HYwNDExe.js → useDragAndDrop-HYwNDExe.mjs} +1 -1
  128. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.mjs.map +1 -0
  129. package/dist/admin/chunks/{usePrev-Bjw2dhmq.js → usePrev-Bjw2dhmq.mjs} +1 -1
  130. package/dist/admin/chunks/usePrev-Bjw2dhmq.mjs.map +1 -0
  131. package/dist/admin/chunks/{vi-CvBGlTjr.js → vi-CvBGlTjr.mjs} +1 -1
  132. package/dist/admin/chunks/vi-CvBGlTjr.mjs.map +1 -0
  133. package/dist/admin/chunks/{zh-BmF-sHaT.js → zh-BmF-sHaT.mjs} +1 -1
  134. package/dist/admin/chunks/zh-BmF-sHaT.mjs.map +1 -0
  135. package/dist/admin/chunks/{zh-Hans-CI0HKio3.js → zh-Hans-CI0HKio3.mjs} +1 -1
  136. package/dist/admin/chunks/{zh-Hans-CI0HKio3.js.map → zh-Hans-CI0HKio3.mjs.map} +1 -1
  137. package/dist/admin/index.js +2 -1
  138. package/dist/admin/index.js.map +1 -1
  139. package/dist/admin/index.mjs +2 -1
  140. package/dist/admin/index.mjs.map +1 -1
  141. package/dist/admin/src/index.d.ts +1 -0
  142. package/dist/admin/src/pages/EditView/components/EditorToolbarObserver.d.ts +11 -0
  143. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +49 -1
  144. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +2 -1
  145. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.d.ts +1 -2
  146. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +2 -1
  147. package/dist/admin/src/preview/pages/Preview.d.ts +2 -0
  148. package/package.json +7 -7
  149. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js.map +0 -1
  150. package/dist/admin/chunks/ComponentConfigurationPage-BSCYuG9k.js.map +0 -1
  151. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js.map +0 -1
  152. package/dist/admin/chunks/EditConfigurationPage-DAwy6frt.js.map +0 -1
  153. package/dist/admin/chunks/EditViewPage-BZuZJr0N.js.map +0 -1
  154. package/dist/admin/chunks/EditViewPage-D8FDB8_y.js.map +0 -1
  155. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js.map +0 -1
  156. package/dist/admin/chunks/Form-Bwz2xTe9.js.map +0 -1
  157. package/dist/admin/chunks/History-5wpSVAu9.js.map +0 -1
  158. package/dist/admin/chunks/Input-Csrk7S5E.js.map +0 -1
  159. package/dist/admin/chunks/Input-Dr7YL5Sv.js.map +0 -1
  160. package/dist/admin/chunks/ListConfigurationPage-oFwCMRWP.js.map +0 -1
  161. package/dist/admin/chunks/ListViewPage-CkPfXiex.js.map +0 -1
  162. package/dist/admin/chunks/NoContentTypePage-BgTBqH4R.js.map +0 -1
  163. package/dist/admin/chunks/NoPermissionsPage-CUnJ9nZ8.js.map +0 -1
  164. package/dist/admin/chunks/Preview-DKUCY7o_.js.map +0 -1
  165. package/dist/admin/chunks/Preview-uBnW2CsI.js.map +0 -1
  166. package/dist/admin/chunks/Relations-BgtVC-3t.js.map +0 -1
  167. package/dist/admin/chunks/Relations-CzrnshXy.js.map +0 -1
  168. package/dist/admin/chunks/ar-DckYq_WK.js.map +0 -1
  169. package/dist/admin/chunks/ca-DviY7mRj.js.map +0 -1
  170. package/dist/admin/chunks/cs-C7OSYFQ7.js.map +0 -1
  171. package/dist/admin/chunks/de-5QRlDHyR.js.map +0 -1
  172. package/dist/admin/chunks/es-DkoWSExG.js.map +0 -1
  173. package/dist/admin/chunks/eu-BG1xX7HK.js.map +0 -1
  174. package/dist/admin/chunks/fr-CFdRaRVj.js.map +0 -1
  175. package/dist/admin/chunks/gu-D5MMMXRs.js.map +0 -1
  176. package/dist/admin/chunks/hi-lp17SCjr.js.map +0 -1
  177. package/dist/admin/chunks/hooks-DMvik5y_.js.map +0 -1
  178. package/dist/admin/chunks/hu-CLka1U2C.js.map +0 -1
  179. package/dist/admin/chunks/id-USfY9m1g.js.map +0 -1
  180. package/dist/admin/chunks/index-BhFoy2kH.js.map +0 -1
  181. package/dist/admin/chunks/it-BAHrwmYS.js.map +0 -1
  182. package/dist/admin/chunks/ja-BWKmBJFT.js.map +0 -1
  183. package/dist/admin/chunks/ko-CgADGBNt.js.map +0 -1
  184. package/dist/admin/chunks/layout-CsDX52Zb.js.map +0 -1
  185. package/dist/admin/chunks/ml-CnhCfOn_.js.map +0 -1
  186. package/dist/admin/chunks/ms-Bh09NFff.js.map +0 -1
  187. package/dist/admin/chunks/nl-C8HYflTc.js.map +0 -1
  188. package/dist/admin/chunks/objects-wl73iEma.js.map +0 -1
  189. package/dist/admin/chunks/pl-MFCZJZuZ.js.map +0 -1
  190. package/dist/admin/chunks/pt-BR-CcotyBGJ.js.map +0 -1
  191. package/dist/admin/chunks/pt-HbmgeiYO.js.map +0 -1
  192. package/dist/admin/chunks/relations-LR7_V8ZN.js.map +0 -1
  193. package/dist/admin/chunks/sa-n_aPA-pU.js.map +0 -1
  194. package/dist/admin/chunks/sk-tn_BDjE2.js.map +0 -1
  195. package/dist/admin/chunks/sv-cq4ZrQRd.js.map +0 -1
  196. package/dist/admin/chunks/th-mUH7hEtc.js.map +0 -1
  197. package/dist/admin/chunks/tr-Yt38daxh.js.map +0 -1
  198. package/dist/admin/chunks/uk-Cpgmm7gE.js.map +0 -1
  199. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js.map +0 -1
  200. package/dist/admin/chunks/usePrev-Bjw2dhmq.js.map +0 -1
  201. package/dist/admin/chunks/vi-CvBGlTjr.js.map +0 -1
  202. package/dist/admin/chunks/zh-BmF-sHaT.js.map +0 -1
  203. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +0 -0
@@ -1,27 +1,76 @@
1
1
  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
- import { useStrapiApp, createContext, useField, useForm, useNotification, useAPIErrorHandler, useQueryParams, useFocusInputField, InputRenderer as InputRenderer$1 } from '@strapi/admin/strapi-admin';
5
- import { Box, SingleSelect, SingleSelectOption, Typography, Flex, BaseLink, Button, Popover, Field, Tooltip, IconButton, useComposedRefs, Portal, FocusTrap, Divider, VisuallyHidden, Accordion, Menu, MenuItem, Grid as Grid$1, TextInput, IconButtonGroup, TextButton } from '@strapi/design-system';
6
- 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, Trash, More, EyeStriked, CheckCircle, WarningCircle, Loader, ArrowClockwise, Plus } from '@strapi/icons';
4
+ import { useStrapiApp, useElementOnScreen, createContext, useField, useForm, useNotification, useAPIErrorHandler, useQueryParams, useFocusInputField, InputRenderer as InputRenderer$1 } from '@strapi/admin/strapi-admin';
5
+ import { Box, SingleSelect, SingleSelectOption, Typography, Flex, Button, Popover, Field, Menu, IconButton, Tooltip, useComposedRefs, Portal, FocusTrap, Divider, VisuallyHidden, Accordion, MenuItem, Grid as Grid$1, TextInput, IconButtonGroup, TextButton } from '@strapi/design-system';
6
+ import { CodeBlock as CodeBlock$1, HeadingOne, HeadingTwo, HeadingThree, HeadingFour, HeadingFive, HeadingSix, Image as Image$1, NumberList, BulletList, Paragraph, Quotes, More, Link as Link$1, Drag, Collapse, Bold, Italic, Underline, StrikeThrough, Code, Expand, PlusCircle, Trash, EyeStriked, CheckCircle, WarningCircle, Loader, ArrowClockwise, Plus } from '@strapi/icons';
7
7
  import { useIntl } from 'react-intl';
8
- import { g as getTranslation, m as useDocLayout, c as useDoc, n as createDefaultForm, t as transformDocument, e as contentManagerApi, o as CLONE_PATH, d as buildValidParams, f as useDocumentRBAC, S as SINGLE_TYPES } from './index-2cT6u68c.js';
8
+ import { g as getTranslation, m as useDocLayout, c as useDoc, n as createDefaultForm, t as transformDocument, e as contentManagerApi, o as CLONE_PATH, d as buildValidParams, f as useDocumentRBAC, S as SINGLE_TYPES } from './index-Cs6qwFQu.mjs';
9
9
  import { styled, css, keyframes } from 'styled-components';
10
10
  import { Editor as Editor$1, Transforms, Node, Element, Range, Path, Point, createEditor } from 'slate';
11
11
  import { withHistory } from 'slate-history';
12
12
  import { useFocused, useSelected, ReactEditor, Editable, Slate, useSlate, withReact } from 'slate-react';
13
- import Prism from 'prismjs';
13
+ import * as Prism from 'prismjs';
14
14
  import 'prismjs/themes/prism-solarizedlight.css';
15
- import { p as prefixFileUrlWithBackendUrl, u as usePrev } from './usePrev-Bjw2dhmq.js';
16
- import { a as DIRECTIONS, u as useDragAndDrop, I as ItemTypes } from './useDragAndDrop-HYwNDExe.js';
15
+ import 'prismjs/components/prism-asmatmel';
16
+ import 'prismjs/components/prism-bash';
17
+ import 'prismjs/components/prism-basic';
18
+ import 'prismjs/components/prism-c';
19
+ import 'prismjs/components/prism-clojure';
20
+ import 'prismjs/components/prism-cobol';
21
+ import 'prismjs/components/prism-cpp';
22
+ import 'prismjs/components/prism-csharp';
23
+ import 'prismjs/components/prism-dart';
24
+ import 'prismjs/components/prism-docker';
25
+ import 'prismjs/components/prism-elixir';
26
+ import 'prismjs/components/prism-erlang';
27
+ import 'prismjs/components/prism-fortran';
28
+ import 'prismjs/components/prism-fsharp';
29
+ import 'prismjs/components/prism-go';
30
+ import 'prismjs/components/prism-graphql';
31
+ import 'prismjs/components/prism-groovy';
32
+ import 'prismjs/components/prism-haskell';
33
+ import 'prismjs/components/prism-haxe';
34
+ import 'prismjs/components/prism-ini';
35
+ import 'prismjs/components/prism-java';
36
+ import 'prismjs/components/prism-javascript';
37
+ import 'prismjs/components/prism-jsx';
38
+ import 'prismjs/components/prism-json';
39
+ import 'prismjs/components/prism-julia';
40
+ import 'prismjs/components/prism-kotlin';
41
+ import 'prismjs/components/prism-latex';
42
+ import 'prismjs/components/prism-lua';
43
+ import 'prismjs/components/prism-markdown';
44
+ import 'prismjs/components/prism-matlab';
45
+ import 'prismjs/components/prism-makefile';
46
+ import 'prismjs/components/prism-objectivec';
47
+ import 'prismjs/components/prism-perl';
48
+ import 'prismjs/components/prism-php';
49
+ import 'prismjs/components/prism-powershell';
50
+ import 'prismjs/components/prism-python';
51
+ import 'prismjs/components/prism-r';
52
+ import 'prismjs/components/prism-ruby';
53
+ import 'prismjs/components/prism-rust';
54
+ import 'prismjs/components/prism-sas';
55
+ import 'prismjs/components/prism-scala';
56
+ import 'prismjs/components/prism-scheme';
57
+ import 'prismjs/components/prism-sql';
58
+ import 'prismjs/components/prism-stata';
59
+ import 'prismjs/components/prism-swift';
60
+ import 'prismjs/components/prism-typescript';
61
+ import 'prismjs/components/prism-tsx';
62
+ import 'prismjs/components/prism-vbnet';
63
+ import 'prismjs/components/prism-yaml';
64
+ import { p as prefixFileUrlWithBackendUrl, u as usePrev } from './usePrev-Bjw2dhmq.mjs';
65
+ import { a as DIRECTIONS, u as useDragAndDrop, I as ItemTypes } from './useDragAndDrop-HYwNDExe.mjs';
17
66
  import * as Toolbar from '@radix-ui/react-toolbar';
18
67
  import { getEmptyImage } from 'react-dnd-html5-backend';
19
68
  import { useMatch, useLocation } from 'react-router-dom';
20
- import { g as getIn } from './objects-wl73iEma.js';
21
- import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from './Relations-BgtVC-3t.js';
69
+ import { g as getIn } from './objects-wl73iEma.mjs';
70
+ import { u as useComponent, C as ComponentProvider, M as MemoizedUnstableRelationsField, a as MemoizedRelationsField } from './Relations-qeZyLDgQ.mjs';
22
71
  import pipe$1 from 'lodash/fp/pipe';
23
- import { C as ComponentIcon, a as COMPONENT_ICONS } from './ComponentIcon-BZcTc4rj.js';
24
- import { a as useDebounce } from './relations-LR7_V8ZN.js';
72
+ import { C as ComponentIcon, a as COMPONENT_ICONS } from './ComponentIcon-BZcTc4rj.mjs';
73
+ import { a as useDebounce } from './relations-Cq8NRUto.mjs';
25
74
  import CodeMirror from 'codemirror5';
26
75
  import sanitizeHtml from 'sanitize-html';
27
76
  import { getLanguage, highlight, highlightAuto } from 'highlight.js';
@@ -410,56 +459,6 @@ const isText$2 = (node)=>{
410
459
  }
411
460
  };
412
461
 
413
- require('prismjs/components/prism-asmatmel');
414
- require('prismjs/components/prism-bash');
415
- require('prismjs/components/prism-basic');
416
- require('prismjs/components/prism-c');
417
- require('prismjs/components/prism-clojure');
418
- require('prismjs/components/prism-cobol');
419
- require('prismjs/components/prism-cpp');
420
- require('prismjs/components/prism-csharp');
421
- require('prismjs/components/prism-dart');
422
- require('prismjs/components/prism-docker');
423
- require('prismjs/components/prism-elixir');
424
- require('prismjs/components/prism-erlang');
425
- require('prismjs/components/prism-fortran');
426
- require('prismjs/components/prism-fsharp');
427
- require('prismjs/components/prism-go');
428
- require('prismjs/components/prism-graphql');
429
- require('prismjs/components/prism-groovy');
430
- require('prismjs/components/prism-haskell');
431
- require('prismjs/components/prism-haxe');
432
- require('prismjs/components/prism-ini');
433
- require('prismjs/components/prism-java');
434
- require('prismjs/components/prism-javascript');
435
- require('prismjs/components/prism-jsx');
436
- require('prismjs/components/prism-json');
437
- require('prismjs/components/prism-julia');
438
- require('prismjs/components/prism-kotlin');
439
- require('prismjs/components/prism-latex');
440
- require('prismjs/components/prism-lua');
441
- require('prismjs/components/prism-markdown');
442
- require('prismjs/components/prism-matlab');
443
- require('prismjs/components/prism-makefile');
444
- require('prismjs/components/prism-objectivec');
445
- require('prismjs/components/prism-perl');
446
- require('prismjs/components/prism-php');
447
- require('prismjs/components/prism-powershell');
448
- require('prismjs/components/prism-python');
449
- require('prismjs/components/prism-r');
450
- require('prismjs/components/prism-ruby');
451
- require('prismjs/components/prism-rust');
452
- require('prismjs/components/prism-sas');
453
- require('prismjs/components/prism-scala');
454
- require('prismjs/components/prism-scheme');
455
- require('prismjs/components/prism-sql');
456
- require('prismjs/components/prism-stata');
457
- require('prismjs/components/prism-swift');
458
- require('prismjs/components/prism-typescript');
459
- require('prismjs/components/prism-tsx');
460
- require('prismjs/components/prism-vbnet');
461
- require('prismjs/components/prism-yaml');
462
-
463
462
  const decorateCode = ([node, path])=>{
464
463
  const ranges = [];
465
464
  // make sure it is an Slate Element
@@ -1032,7 +1031,7 @@ const isListNode$1 = (element)=>{
1032
1031
  return element.type === 'list';
1033
1032
  };
1034
1033
 
1035
- const StyledBaseLink = styled(BaseLink)`
1034
+ const StyledLink = styled(Box)`
1036
1035
  text-decoration: none;
1037
1036
  `;
1038
1037
  const RemoveButton = styled(Button)`
@@ -1092,9 +1091,10 @@ const LinkContent = /*#__PURE__*/ React.forwardRef(({ link, children, attributes
1092
1091
  open: popoverOpen,
1093
1092
  children: [
1094
1093
  /*#__PURE__*/ jsx(Popover.Trigger, {
1095
- children: /*#__PURE__*/ jsx(StyledBaseLink, {
1094
+ children: /*#__PURE__*/ jsx(StyledLink, {
1096
1095
  ...attributes,
1097
1096
  ref: forwardedRef,
1097
+ tag: "a",
1098
1098
  href: link.url,
1099
1099
  onClick: ()=>setPopoverOpen(true),
1100
1100
  color: "primary600",
@@ -1698,13 +1698,102 @@ const quoteBlocks = {
1698
1698
  }
1699
1699
  };
1700
1700
 
1701
+ const ObservedToolbarComponent = ({ index, lastVisibleIndex, setLastVisibleIndex, rootRef, children })=>{
1702
+ const isVisible = index <= lastVisibleIndex;
1703
+ const containerRef = useElementOnScreen((isVisible)=>{
1704
+ /**
1705
+ * It's the MoreMenu's job to make an item not visible when there's not room for it.
1706
+ * But we need to react here to the element becoming visible again.
1707
+ */ if (isVisible) {
1708
+ setLastVisibleIndex((prev)=>Math.max(prev, index));
1709
+ }
1710
+ }, {
1711
+ threshold: 1,
1712
+ root: rootRef.current
1713
+ });
1714
+ return /*#__PURE__*/ jsx("div", {
1715
+ ref: containerRef,
1716
+ style: {
1717
+ /**
1718
+ * Use visibility so that the element occupies the space if requires even when there's not
1719
+ * enough room for it to be visible. The empty reserved space will be clipped by the
1720
+ * overflow:hidden rule on the parent, so it doesn't affect the UI.
1721
+ * This way we can keep observing its visiblity and react to browser resize events.
1722
+ */ visibility: isVisible ? 'visible' : 'hidden'
1723
+ },
1724
+ children: children
1725
+ });
1726
+ };
1727
+ const EditorToolbarObserver = ({ observedComponents, menuTriggerVariant = 'ghost' })=>{
1728
+ const { formatMessage } = useIntl();
1729
+ const toolbarRef = React.useRef(null);
1730
+ const [lastVisibleIndex, setLastVisibleIndex] = React.useState(observedComponents.length - 1);
1731
+ const hasHiddenItems = lastVisibleIndex < observedComponents.length - 1;
1732
+ const menuIndex = lastVisibleIndex + 1;
1733
+ const [open, setOpen] = React.useState(false);
1734
+ const isMenuOpenWithContent = open && hasHiddenItems;
1735
+ const menuTriggerRef = useElementOnScreen((isVisible)=>{
1736
+ // We only react to the menu becoming invisible. When that happens, we hide the last item.
1737
+ if (!isVisible) {
1738
+ /**
1739
+ * If there's no room for any item, the index can be -1.
1740
+ * This is intentional, in that case only the more menu will be visible.
1741
+ **/ setLastVisibleIndex((prev)=>prev - 1);
1742
+ // Maintain the menu state if it has content
1743
+ setOpen(isMenuOpenWithContent);
1744
+ }
1745
+ }, {
1746
+ threshold: 1,
1747
+ root: toolbarRef.current
1748
+ });
1749
+ return observedComponents.map((component, index)=>{
1750
+ return /*#__PURE__*/ jsx(ObservedToolbarComponent, {
1751
+ index: index,
1752
+ lastVisibleIndex: lastVisibleIndex,
1753
+ setLastVisibleIndex: setLastVisibleIndex,
1754
+ rootRef: toolbarRef,
1755
+ children: component.toolbar
1756
+ }, component.key);
1757
+ }).toSpliced(menuIndex, 0, /*#__PURE__*/ jsxs(Menu.Root, {
1758
+ defaultOpen: false,
1759
+ open: isMenuOpenWithContent,
1760
+ onOpenChange: setOpen,
1761
+ children: [
1762
+ /*#__PURE__*/ jsx(Menu.Trigger, {
1763
+ paddingLeft: 0,
1764
+ paddingRight: 0,
1765
+ ref: menuTriggerRef,
1766
+ variant: menuTriggerVariant,
1767
+ style: {
1768
+ visibility: hasHiddenItems ? 'visible' : 'hidden'
1769
+ },
1770
+ label: formatMessage({
1771
+ id: 'global.more',
1772
+ defaultMessage: 'More'
1773
+ }),
1774
+ tag: IconButton,
1775
+ icon: /*#__PURE__*/ jsx(More, {})
1776
+ }),
1777
+ /*#__PURE__*/ jsx(Menu.Content, {
1778
+ onCloseAutoFocus: (e)=>e.preventDefault(),
1779
+ maxHeight: "100%",
1780
+ minWidth: "256px",
1781
+ popoverPlacement: "bottom-end",
1782
+ children: observedComponents.slice(menuIndex).map((component)=>/*#__PURE__*/ jsx(React.Fragment, {
1783
+ children: component.menu
1784
+ }, component.key))
1785
+ })
1786
+ ]
1787
+ }, "more-menu"));
1788
+ };
1789
+
1701
1790
  const ToolbarWrapper = styled(Flex)`
1702
1791
  &[aria-disabled='true'] {
1703
1792
  cursor: not-allowed;
1704
1793
  background: ${({ theme })=>theme.colors.neutral150};
1705
1794
  }
1706
1795
  `;
1707
- const Separator = styled(Toolbar.Separator)`
1796
+ const ToolbarSeparator = styled(Toolbar.Separator)`
1708
1797
  background: ${({ theme })=>theme.colors.neutral150};
1709
1798
  width: 1px;
1710
1799
  height: 2.4rem;
@@ -1774,7 +1863,7 @@ const ToolbarButton = ({ icon: Icon, name, label, isActive, disabled, handleClic
1774
1863
  const labelMessage = formatMessage(label);
1775
1864
  const enabledColor = isActive ? 'primary600' : 'neutral600';
1776
1865
  return /*#__PURE__*/ jsx(Tooltip, {
1777
- description: labelMessage,
1866
+ label: labelMessage,
1778
1867
  children: /*#__PURE__*/ jsx(Toolbar.ToggleItem, {
1779
1868
  value: name,
1780
1869
  "data-state": isActive ? 'on' : 'off',
@@ -1966,8 +2055,9 @@ const BlockOption = ({ value, icon: Icon, label, blockSelected })=>{
1966
2055
  const isListNode = (node)=>{
1967
2056
  return Node.isNode(node) && !Editor$1.isEditor(node) && node.type === 'list';
1968
2057
  };
1969
- const ListButton = ({ block, format })=>{
2058
+ const ListButton = ({ block, format, location = 'toolbar' })=>{
1970
2059
  const { editor, disabled, blocks } = useBlocksEditorContext('ListButton');
2060
+ const { formatMessage } = useIntl();
1971
2061
  const isListActive = ()=>{
1972
2062
  if (!editor.selection) return false;
1973
2063
  // Get the parent list at selection anchor node
@@ -2043,6 +2133,18 @@ const ListButton = ({ block, format })=>{
2043
2133
  }
2044
2134
  }
2045
2135
  };
2136
+ if (location === 'menu') {
2137
+ const Icon = block.icon;
2138
+ return /*#__PURE__*/ jsxs(StyledMenuItem, {
2139
+ onSelect: ()=>toggleList(format),
2140
+ isActive: isListActive(),
2141
+ disabled: isListDisabled(),
2142
+ children: [
2143
+ /*#__PURE__*/ jsx(Icon, {}),
2144
+ formatMessage(block.label)
2145
+ ]
2146
+ });
2147
+ }
2046
2148
  return /*#__PURE__*/ jsx(ToolbarButton, {
2047
2149
  icon: block.icon,
2048
2150
  name: format,
@@ -2052,8 +2154,9 @@ const ListButton = ({ block, format })=>{
2052
2154
  handleClick: ()=>toggleList(format)
2053
2155
  });
2054
2156
  };
2055
- const LinkButton = ({ disabled })=>{
2157
+ const LinkButton = ({ disabled, location = 'toolbar' })=>{
2056
2158
  const { editor } = useBlocksEditorContext('LinkButton');
2159
+ const { formatMessage } = useIntl();
2057
2160
  const isLinkActive = ()=>{
2058
2161
  const { selection } = editor;
2059
2162
  if (!selection) return false;
@@ -2094,20 +2197,55 @@ const LinkButton = ({ disabled })=>{
2094
2197
  url: ''
2095
2198
  });
2096
2199
  };
2200
+ const label = {
2201
+ id: 'components.Blocks.link',
2202
+ defaultMessage: 'Link'
2203
+ };
2204
+ if (location === 'menu') {
2205
+ return /*#__PURE__*/ jsxs(StyledMenuItem, {
2206
+ onSelect: addLink,
2207
+ isActive: isLinkActive(),
2208
+ disabled: isLinkDisabled(),
2209
+ children: [
2210
+ /*#__PURE__*/ jsx(Link$1, {}),
2211
+ formatMessage(label)
2212
+ ]
2213
+ });
2214
+ }
2097
2215
  return /*#__PURE__*/ jsx(ToolbarButton, {
2098
2216
  icon: Link$1,
2099
2217
  name: "link",
2100
- label: {
2101
- id: 'components.Blocks.link',
2102
- defaultMessage: 'Link'
2103
- },
2218
+ label: label,
2104
2219
  isActive: isLinkActive(),
2105
2220
  handleClick: addLink,
2106
2221
  disabled: isLinkDisabled()
2107
2222
  });
2108
2223
  };
2224
+ const StyledMenuItem = styled(Menu.Item)`
2225
+ &:hover {
2226
+ background-color: ${({ theme })=>theme.colors.primary100};
2227
+ }
2228
+
2229
+ ${(props)=>props.isActive && css`
2230
+ font-weight: bold;
2231
+ background-color: ${({ theme })=>theme.colors.primary100};
2232
+ color: ${({ theme })=>theme.colors.primary600};
2233
+ font-weight: bold;
2234
+ `}
2235
+
2236
+ > span {
2237
+ display: inline-flex;
2238
+ gap: ${({ theme })=>theme.spaces[2]};
2239
+ align-items: center;
2240
+ }
2241
+
2242
+ svg {
2243
+ fill: ${({ theme, isActive })=>isActive ? theme.colors.primary600 : theme.colors.neutral600};
2244
+ }
2245
+ `;
2109
2246
  const BlocksToolbar = ()=>{
2110
2247
  const { editor, blocks, modifiers, disabled } = useBlocksEditorContext('BlocksToolbar');
2248
+ const { formatMessage } = useIntl();
2111
2249
  /**
2112
2250
  * The modifier buttons are disabled when an image is selected.
2113
2251
  */ const checkButtonDisabled = ()=>{
@@ -2128,6 +2266,94 @@ const BlocksToolbar = ()=>{
2128
2266
  return false;
2129
2267
  };
2130
2268
  const isButtonDisabled = checkButtonDisabled();
2269
+ /**
2270
+ * Observed components are ones that may or may not be visible in the toolbar, depending on the
2271
+ * available space. They provide two render props:
2272
+ * - renderInToolbar: for when we try to render the component in the toolbar (may be hidden)
2273
+ * - renderInMenu: for when the component didn't fit in the toolbar and is relegated
2274
+ * to the "more" menu
2275
+ */ const observedComponents = [
2276
+ ...Object.entries(modifiers).map(([name, modifier])=>{
2277
+ const Icon = modifier.icon;
2278
+ const isActive = modifier.checkIsActive(editor);
2279
+ const handleSelect = ()=>modifier.handleToggle(editor);
2280
+ return {
2281
+ toolbar: /*#__PURE__*/ jsx(ToolbarButton, {
2282
+ name: name,
2283
+ icon: modifier.icon,
2284
+ label: modifier.label,
2285
+ isActive: modifier.checkIsActive(editor),
2286
+ handleClick: handleSelect,
2287
+ disabled: isButtonDisabled
2288
+ }, name),
2289
+ menu: /*#__PURE__*/ jsxs(StyledMenuItem, {
2290
+ onSelect: handleSelect,
2291
+ isActive: isActive,
2292
+ children: [
2293
+ /*#__PURE__*/ jsx(Icon, {}),
2294
+ formatMessage(modifier.label)
2295
+ ]
2296
+ }),
2297
+ key: `modifier.${name}`
2298
+ };
2299
+ }),
2300
+ {
2301
+ toolbar: /*#__PURE__*/ jsx(LinkButton, {
2302
+ disabled: isButtonDisabled,
2303
+ location: "toolbar"
2304
+ }),
2305
+ menu: /*#__PURE__*/ jsx(LinkButton, {
2306
+ disabled: isButtonDisabled,
2307
+ location: "menu"
2308
+ }),
2309
+ key: 'block.link'
2310
+ },
2311
+ {
2312
+ // List buttons can only be rendered together when in the toolbar
2313
+ toolbar: /*#__PURE__*/ jsxs(Flex, {
2314
+ direction: "row",
2315
+ gap: 1,
2316
+ children: [
2317
+ /*#__PURE__*/ jsx(ToolbarSeparator, {}),
2318
+ /*#__PURE__*/ jsx(Toolbar.ToggleGroup, {
2319
+ type: "single",
2320
+ asChild: true,
2321
+ children: /*#__PURE__*/ jsxs(Flex, {
2322
+ gap: 1,
2323
+ children: [
2324
+ /*#__PURE__*/ jsx(ListButton, {
2325
+ block: blocks['list-unordered'],
2326
+ format: "unordered",
2327
+ location: "toolbar"
2328
+ }),
2329
+ /*#__PURE__*/ jsx(ListButton, {
2330
+ block: blocks['list-ordered'],
2331
+ format: "ordered",
2332
+ location: "toolbar"
2333
+ })
2334
+ ]
2335
+ })
2336
+ })
2337
+ ]
2338
+ }),
2339
+ menu: /*#__PURE__*/ jsxs(Fragment, {
2340
+ children: [
2341
+ /*#__PURE__*/ jsx(Menu.Separator, {}),
2342
+ /*#__PURE__*/ jsx(ListButton, {
2343
+ block: blocks['list-unordered'],
2344
+ format: "unordered",
2345
+ location: "menu"
2346
+ }),
2347
+ /*#__PURE__*/ jsx(ListButton, {
2348
+ block: blocks['list-ordered'],
2349
+ format: "ordered",
2350
+ location: "menu"
2351
+ })
2352
+ ]
2353
+ }),
2354
+ key: 'block.list'
2355
+ }
2356
+ ];
2131
2357
  return /*#__PURE__*/ jsx(Toolbar.Root, {
2132
2358
  "aria-disabled": disabled,
2133
2359
  asChild: true,
@@ -2137,43 +2363,18 @@ const BlocksToolbar = ()=>{
2137
2363
  width: "100%",
2138
2364
  children: [
2139
2365
  /*#__PURE__*/ jsx(BlocksDropdown, {}),
2140
- /*#__PURE__*/ jsx(Separator, {}),
2366
+ /*#__PURE__*/ jsx(ToolbarSeparator, {}),
2141
2367
  /*#__PURE__*/ jsx(Toolbar.ToggleGroup, {
2142
2368
  type: "multiple",
2143
2369
  asChild: true,
2144
- children: /*#__PURE__*/ jsxs(Flex, {
2145
- gap: 1,
2146
- children: [
2147
- Object.entries(modifiers).map(([name, modifier])=>/*#__PURE__*/ jsx(ToolbarButton, {
2148
- name: name,
2149
- icon: modifier.icon,
2150
- label: modifier.label,
2151
- isActive: modifier.checkIsActive(editor),
2152
- handleClick: ()=>modifier.handleToggle(editor),
2153
- disabled: isButtonDisabled
2154
- }, name)),
2155
- /*#__PURE__*/ jsx(LinkButton, {
2156
- disabled: isButtonDisabled
2157
- })
2158
- ]
2159
- })
2160
- }),
2161
- /*#__PURE__*/ jsx(Separator, {}),
2162
- /*#__PURE__*/ jsx(Toolbar.ToggleGroup, {
2163
- type: "single",
2164
- asChild: true,
2165
- children: /*#__PURE__*/ jsxs(Flex, {
2370
+ children: /*#__PURE__*/ jsx(Flex, {
2371
+ direction: "row",
2166
2372
  gap: 1,
2167
- children: [
2168
- /*#__PURE__*/ jsx(ListButton, {
2169
- block: blocks['list-unordered'],
2170
- format: "unordered"
2171
- }),
2172
- /*#__PURE__*/ jsx(ListButton, {
2173
- block: blocks['list-ordered'],
2174
- format: "ordered"
2175
- })
2176
- ]
2373
+ grow: 1,
2374
+ overflow: "hidden",
2375
+ children: /*#__PURE__*/ jsx(EditorToolbarObserver, {
2376
+ observedComponents: observedComponents
2377
+ })
2177
2378
  })
2178
2379
  })
2179
2380
  ]
@@ -5529,14 +5730,14 @@ const quoteAndCodeHandler = (editor, markdownType)=>{
5529
5730
  };
5530
5731
 
5531
5732
  // NAV BUTTONS
5532
- const MainButtons = styled(IconButtonGroup)`
5733
+ styled(IconButtonGroup)`
5533
5734
  margin-left: ${({ theme })=>theme.spaces[4]};
5534
5735
  `;
5535
- const MoreButton = styled(IconButton)`
5736
+ styled(IconButton)`
5536
5737
  margin: ${({ theme })=>`0 ${theme.spaces[2]}`};
5537
5738
  `;
5538
5739
  // NAV
5539
- const IconButtonGroupMargin = styled(IconButtonGroup)`
5740
+ styled(IconButtonGroup)`
5540
5741
  margin-right: ${({ theme })=>`${theme.spaces[2]}`};
5541
5742
  `;
5542
5743
  // FOOTER
@@ -5594,245 +5795,515 @@ const WysiwygFooter = ({ onToggleExpand })=>{
5594
5795
 
5595
5796
  /**
5596
5797
  * TODO: refactor this mess.
5597
- */ const WysiwygNav = ({ disabled, editorRef, isExpandMode, isPreviewMode, onActionClick, onToggleMediaLib, onTogglePreviewMode })=>{
5598
- const [visiblePopover, setVisiblePopover] = React.useState(false);
5798
+ */ const WysiwygNav = ({ disabled, editorRef, isPreviewMode, onToggleMediaLib, onTogglePreviewMode })=>{
5599
5799
  const { formatMessage } = useIntl();
5600
- const selectPlaceholder = formatMessage({
5601
- id: 'components.Wysiwyg.selectOptions.title',
5602
- defaultMessage: 'Add a title'
5603
- });
5604
- React.useRef(null);
5605
- const handleTogglePopover = ()=>{
5606
- setVisiblePopover((prev)=>!prev);
5800
+ const isDisabled = disabled || isPreviewMode;
5801
+ const handleActionClick = (value, currentEditorRef)=>{
5802
+ switch(value){
5803
+ case 'Link':
5804
+ {
5805
+ markdownHandler(currentEditorRef, value);
5806
+ break;
5807
+ }
5808
+ case 'Code':
5809
+ case 'Quote':
5810
+ {
5811
+ quoteAndCodeHandler(currentEditorRef, value);
5812
+ break;
5813
+ }
5814
+ case 'Bold':
5815
+ case 'Italic':
5816
+ case 'Underline':
5817
+ case 'Strikethrough':
5818
+ {
5819
+ markdownHandler(currentEditorRef, value);
5820
+ break;
5821
+ }
5822
+ case 'BulletList':
5823
+ case 'NumberList':
5824
+ {
5825
+ listHandler(currentEditorRef, value);
5826
+ break;
5827
+ }
5828
+ case 'h1':
5829
+ case 'h2':
5830
+ case 'h3':
5831
+ case 'h4':
5832
+ case 'h5':
5833
+ case 'h6':
5834
+ {
5835
+ titleHandler(currentEditorRef, value);
5836
+ break;
5837
+ }
5838
+ }
5607
5839
  };
5608
- if (disabled || isPreviewMode) {
5609
- return /*#__PURE__*/ jsxs(Flex, {
5610
- padding: 2,
5611
- background: "neutral100",
5612
- justifyContent: "space-between",
5613
- borderRadius: `0.4rem 0.4rem 0 0`,
5614
- children: [
5615
- /*#__PURE__*/ jsxs(Flex, {
5616
- children: [
5617
- /*#__PURE__*/ jsx(Field.Root, {
5618
- children: /*#__PURE__*/ jsxs(SingleSelect, {
5619
- disabled: true,
5620
- placeholder: selectPlaceholder,
5621
- "aria-label": selectPlaceholder,
5622
- size: "S",
5623
- children: [
5624
- /*#__PURE__*/ jsx(SingleSelectOption, {
5625
- value: "h1",
5626
- children: "h1"
5627
- }),
5628
- /*#__PURE__*/ jsx(SingleSelectOption, {
5629
- value: "h2",
5630
- children: "h2"
5631
- }),
5632
- /*#__PURE__*/ jsx(SingleSelectOption, {
5633
- value: "h3",
5634
- children: "h3"
5635
- }),
5636
- /*#__PURE__*/ jsx(SingleSelectOption, {
5637
- value: "h4",
5638
- children: "h4"
5639
- }),
5640
- /*#__PURE__*/ jsx(SingleSelectOption, {
5641
- value: "h5",
5642
- children: "h5"
5643
- }),
5644
- /*#__PURE__*/ jsx(SingleSelectOption, {
5645
- value: "h6",
5646
- children: "h6"
5647
- })
5648
- ]
5649
- })
5840
+ const observedComponents = [
5841
+ {
5842
+ toolbar: /*#__PURE__*/ jsxs(IconButtonGroup, {
5843
+ children: [
5844
+ /*#__PURE__*/ jsx(IconButton, {
5845
+ disabled: isDisabled,
5846
+ onClick: ()=>handleActionClick('Bold', editorRef),
5847
+ label: formatMessage({
5848
+ id: 'components.Blocks.modifiers.bold',
5849
+ defaultMessage: 'Bold'
5650
5850
  }),
5651
- /*#__PURE__*/ jsxs(MainButtons, {
5851
+ name: formatMessage({
5852
+ id: 'components.Blocks.modifiers.bold',
5853
+ defaultMessage: 'Bold'
5854
+ }),
5855
+ children: /*#__PURE__*/ jsx(Bold, {})
5856
+ }),
5857
+ /*#__PURE__*/ jsx(IconButton, {
5858
+ disabled: isDisabled,
5859
+ onClick: ()=>handleActionClick('Italic', editorRef),
5860
+ label: formatMessage({
5861
+ id: 'components.Blocks.modifiers.italic',
5862
+ defaultMessage: 'Italic'
5863
+ }),
5864
+ name: formatMessage({
5865
+ id: 'components.Blocks.modifiers.italic',
5866
+ defaultMessage: 'Italic'
5867
+ }),
5868
+ children: /*#__PURE__*/ jsx(Italic, {})
5869
+ }),
5870
+ /*#__PURE__*/ jsx(IconButton, {
5871
+ disabled: isDisabled,
5872
+ onClick: ()=>handleActionClick('Underline', editorRef),
5873
+ label: formatMessage({
5874
+ id: 'components.Blocks.modifiers.underline',
5875
+ defaultMessage: 'Underline'
5876
+ }),
5877
+ name: formatMessage({
5878
+ id: 'components.Blocks.modifiers.underline',
5879
+ defaultMessage: 'Underline'
5880
+ }),
5881
+ children: /*#__PURE__*/ jsx(Underline, {})
5882
+ }),
5883
+ /*#__PURE__*/ jsx(IconButton, {
5884
+ disabled: isDisabled,
5885
+ onClick: ()=>handleActionClick('Strikethrough', editorRef),
5886
+ label: formatMessage({
5887
+ id: 'components.Blocks.modifiers.strikethrough',
5888
+ defaultMessage: 'Strikethrough'
5889
+ }),
5890
+ name: formatMessage({
5891
+ id: 'components.Blocks.modifiers.strikethrough',
5892
+ defaultMessage: 'Strikethrough'
5893
+ }),
5894
+ children: /*#__PURE__*/ jsx(StrikeThrough, {})
5895
+ })
5896
+ ]
5897
+ }),
5898
+ menu: /*#__PURE__*/ jsxs(Fragment, {
5899
+ children: [
5900
+ /*#__PURE__*/ jsx(Menu.Separator, {}),
5901
+ /*#__PURE__*/ jsx(Menu.Item, {
5902
+ onSelect: ()=>handleActionClick('Bold', editorRef),
5903
+ disabled: isDisabled,
5904
+ children: /*#__PURE__*/ jsxs(Flex, {
5905
+ tag: "span",
5906
+ gap: 2,
5652
5907
  children: [
5653
- /*#__PURE__*/ jsx(IconButton, {
5654
- disabled: true,
5655
- label: "Bold",
5656
- name: "Bold",
5657
- children: /*#__PURE__*/ jsx(Bold, {})
5908
+ /*#__PURE__*/ jsx(Bold, {
5909
+ "aria-hidden": true,
5910
+ fill: "neutral600"
5658
5911
  }),
5659
- /*#__PURE__*/ jsx(IconButton, {
5660
- disabled: true,
5661
- label: "Italic",
5662
- name: "Italic",
5663
- children: /*#__PURE__*/ jsx(Italic, {})
5912
+ formatMessage({
5913
+ id: 'components.Blocks.modifiers.bold',
5914
+ defaultMessage: 'Bold'
5915
+ })
5916
+ ]
5917
+ })
5918
+ }),
5919
+ /*#__PURE__*/ jsx(Menu.Item, {
5920
+ onSelect: ()=>handleActionClick('Italic', editorRef),
5921
+ disabled: isDisabled,
5922
+ children: /*#__PURE__*/ jsxs(Flex, {
5923
+ tag: "span",
5924
+ gap: 2,
5925
+ children: [
5926
+ /*#__PURE__*/ jsx(Italic, {
5927
+ "aria-hidden": true,
5928
+ fill: "neutral600"
5664
5929
  }),
5665
- /*#__PURE__*/ jsx(IconButton, {
5666
- disabled: true,
5667
- label: "Underline",
5668
- name: "Underline",
5669
- children: /*#__PURE__*/ jsx(Underline, {})
5930
+ formatMessage({
5931
+ id: 'components.Blocks.modifiers.italic',
5932
+ defaultMessage: 'Italic'
5933
+ })
5934
+ ]
5935
+ })
5936
+ }),
5937
+ /*#__PURE__*/ jsx(Menu.Item, {
5938
+ onSelect: ()=>handleActionClick('Underline', editorRef),
5939
+ disabled: isDisabled,
5940
+ children: /*#__PURE__*/ jsxs(Flex, {
5941
+ tag: "span",
5942
+ gap: 2,
5943
+ children: [
5944
+ /*#__PURE__*/ jsx(Underline, {
5945
+ "aria-hidden": true,
5946
+ fill: "neutral600"
5947
+ }),
5948
+ formatMessage({
5949
+ id: 'components.Blocks.modifiers.underline',
5950
+ defaultMessage: 'Underline'
5951
+ })
5952
+ ]
5953
+ })
5954
+ }),
5955
+ /*#__PURE__*/ jsx(Menu.Item, {
5956
+ onSelect: ()=>handleActionClick('Strikethrough', editorRef),
5957
+ disabled: isDisabled,
5958
+ children: /*#__PURE__*/ jsxs(Flex, {
5959
+ tag: "span",
5960
+ gap: 2,
5961
+ children: [
5962
+ /*#__PURE__*/ jsx(StrikeThrough, {
5963
+ "aria-hidden": true,
5964
+ fill: "neutral600"
5965
+ }),
5966
+ formatMessage({
5967
+ id: 'components.Blocks.modifiers.strikethrough',
5968
+ defaultMessage: 'Strikethrough'
5670
5969
  })
5671
5970
  ]
5672
- }),
5673
- /*#__PURE__*/ jsx(MoreButton, {
5674
- disabled: true,
5675
- label: "More",
5676
- children: /*#__PURE__*/ jsx(More, {})
5677
5971
  })
5678
- ]
5679
- }),
5680
- !isExpandMode && /*#__PURE__*/ jsx(Button, {
5681
- onClick: onTogglePreviewMode,
5682
- variant: "tertiary",
5683
- children: formatMessage({
5684
- id: 'components.Wysiwyg.ToggleMode.markdown-mode',
5685
- defaultMessage: 'Markdown mode'
5686
5972
  })
5687
- })
5688
- ]
5689
- });
5690
- }
5691
- return /*#__PURE__*/ jsxs(Flex, {
5692
- padding: 2,
5693
- background: "neutral100",
5694
- justifyContent: "space-between",
5695
- borderRadius: `0.4rem 0.4rem 0 0`,
5696
- children: [
5697
- /*#__PURE__*/ jsxs(Flex, {
5973
+ ]
5974
+ }),
5975
+ key: 'formatting-group-1'
5976
+ },
5977
+ {
5978
+ toolbar: /*#__PURE__*/ jsxs(IconButtonGroup, {
5979
+ children: [
5980
+ /*#__PURE__*/ jsx(IconButton, {
5981
+ disabled: isDisabled,
5982
+ onClick: ()=>handleActionClick('BulletList', editorRef),
5983
+ label: formatMessage({
5984
+ id: 'components.Blocks.blocks.bulletList',
5985
+ defaultMessage: 'Bulleted list'
5986
+ }),
5987
+ name: formatMessage({
5988
+ id: 'components.Blocks.blocks.bulletList',
5989
+ defaultMessage: 'Bulleted list'
5990
+ }),
5991
+ children: /*#__PURE__*/ jsx(BulletList, {})
5992
+ }),
5993
+ /*#__PURE__*/ jsx(IconButton, {
5994
+ disabled: isDisabled,
5995
+ onClick: ()=>handleActionClick('NumberList', editorRef),
5996
+ label: formatMessage({
5997
+ id: 'components.Blocks.blocks.numberList',
5998
+ defaultMessage: 'Numbered list'
5999
+ }),
6000
+ name: formatMessage({
6001
+ id: 'components.Blocks.blocks.numberList',
6002
+ defaultMessage: 'Numbered list'
6003
+ }),
6004
+ children: /*#__PURE__*/ jsx(NumberList, {})
6005
+ })
6006
+ ]
6007
+ }),
6008
+ menu: /*#__PURE__*/ jsxs(Fragment, {
5698
6009
  children: [
5699
- /*#__PURE__*/ jsx(Field.Root, {
5700
- children: /*#__PURE__*/ jsxs(SingleSelect, {
5701
- placeholder: selectPlaceholder,
5702
- "aria-label": selectPlaceholder,
5703
- // @ts-expect-error DS v2 will only allow strings.
5704
- onChange: (value)=>onActionClick(value, editorRef),
5705
- size: "S",
6010
+ /*#__PURE__*/ jsx(Menu.Separator, {}),
6011
+ /*#__PURE__*/ jsx(Menu.Item, {
6012
+ onSelect: ()=>handleActionClick('BulletList', editorRef),
6013
+ disabled: isDisabled,
6014
+ children: /*#__PURE__*/ jsxs(Flex, {
6015
+ tag: "span",
6016
+ gap: 2,
5706
6017
  children: [
5707
- /*#__PURE__*/ jsx(SingleSelectOption, {
5708
- value: "h1",
5709
- children: "h1"
6018
+ /*#__PURE__*/ jsx(BulletList, {
6019
+ "aria-hidden": true,
6020
+ fill: "neutral600"
5710
6021
  }),
5711
- /*#__PURE__*/ jsx(SingleSelectOption, {
5712
- value: "h2",
5713
- children: "h2"
6022
+ formatMessage({
6023
+ id: 'components.Blocks.blocks.unorderedList',
6024
+ defaultMessage: 'Bulleted list'
6025
+ })
6026
+ ]
6027
+ })
6028
+ }),
6029
+ /*#__PURE__*/ jsx(Menu.Item, {
6030
+ onSelect: ()=>handleActionClick('NumberList', editorRef),
6031
+ disabled: isDisabled,
6032
+ children: /*#__PURE__*/ jsxs(Flex, {
6033
+ tag: "span",
6034
+ gap: 2,
6035
+ children: [
6036
+ /*#__PURE__*/ jsx(NumberList, {
6037
+ "aria-hidden": true,
6038
+ fill: "neutral600"
5714
6039
  }),
5715
- /*#__PURE__*/ jsx(SingleSelectOption, {
5716
- value: "h3",
5717
- children: "h3"
6040
+ formatMessage({
6041
+ id: 'components.Blocks.blocks.orderedList',
6042
+ defaultMessage: 'Numbered list'
6043
+ })
6044
+ ]
6045
+ })
6046
+ })
6047
+ ]
6048
+ }),
6049
+ key: 'formatting-group-2'
6050
+ },
6051
+ {
6052
+ toolbar: /*#__PURE__*/ jsxs(IconButtonGroup, {
6053
+ children: [
6054
+ /*#__PURE__*/ jsx(IconButton, {
6055
+ disabled: isDisabled,
6056
+ onClick: ()=>handleActionClick('Code', editorRef),
6057
+ label: formatMessage({
6058
+ id: 'components.Wysiwyg.blocks.code',
6059
+ defaultMessage: 'Code'
6060
+ }),
6061
+ name: formatMessage({
6062
+ id: 'components.Wysiwyg.blocks.code',
6063
+ defaultMessage: 'Code'
6064
+ }),
6065
+ children: /*#__PURE__*/ jsx(Code, {})
6066
+ }),
6067
+ /*#__PURE__*/ jsx(IconButton, {
6068
+ disabled: isDisabled,
6069
+ onClick: ()=>{
6070
+ onToggleMediaLib();
6071
+ },
6072
+ label: formatMessage({
6073
+ id: 'components.Blocks.blocks.image',
6074
+ defaultMessage: 'Image'
6075
+ }),
6076
+ name: formatMessage({
6077
+ id: 'components.Blocks.blocks.image',
6078
+ defaultMessage: 'Image'
6079
+ }),
6080
+ children: /*#__PURE__*/ jsx(Image$1, {})
6081
+ }),
6082
+ /*#__PURE__*/ jsx(IconButton, {
6083
+ disabled: isDisabled,
6084
+ onClick: ()=>handleActionClick('Link', editorRef),
6085
+ label: formatMessage({
6086
+ id: 'components.Blocks.popover.link',
6087
+ defaultMessage: 'Link'
6088
+ }),
6089
+ name: formatMessage({
6090
+ id: 'components.Blocks.popover.link',
6091
+ defaultMessage: 'Link'
6092
+ }),
6093
+ children: /*#__PURE__*/ jsx(Link$1, {})
6094
+ }),
6095
+ /*#__PURE__*/ jsx(IconButton, {
6096
+ disabled: isDisabled,
6097
+ onClick: ()=>handleActionClick('Quote', editorRef),
6098
+ label: formatMessage({
6099
+ id: 'components.Blocks.blocks.quote',
6100
+ defaultMessage: 'Quote'
6101
+ }),
6102
+ name: formatMessage({
6103
+ id: 'components.Blocks.blocks.quote',
6104
+ defaultMessage: 'Quote'
6105
+ }),
6106
+ children: /*#__PURE__*/ jsx(Quotes, {})
6107
+ })
6108
+ ]
6109
+ }),
6110
+ menu: /*#__PURE__*/ jsxs(Fragment, {
6111
+ children: [
6112
+ /*#__PURE__*/ jsx(Menu.Separator, {}),
6113
+ /*#__PURE__*/ jsx(Menu.Item, {
6114
+ onSelect: ()=>handleActionClick('Code', editorRef),
6115
+ disabled: isDisabled,
6116
+ children: /*#__PURE__*/ jsxs(Flex, {
6117
+ tag: "span",
6118
+ gap: 2,
6119
+ children: [
6120
+ /*#__PURE__*/ jsx(Code, {
6121
+ "aria-hidden": true,
6122
+ fill: "neutral600"
5718
6123
  }),
5719
- /*#__PURE__*/ jsx(SingleSelectOption, {
5720
- value: "h4",
5721
- children: "h4"
6124
+ formatMessage({
6125
+ id: 'components.Wysiwyg.blocks.code',
6126
+ defaultMessage: 'Code'
6127
+ })
6128
+ ]
6129
+ })
6130
+ }),
6131
+ /*#__PURE__*/ jsx(Menu.Item, {
6132
+ startIcon: /*#__PURE__*/ jsx(Image$1, {}),
6133
+ onSelect: ()=>{
6134
+ onToggleMediaLib();
6135
+ },
6136
+ disabled: isDisabled,
6137
+ children: /*#__PURE__*/ jsxs(Flex, {
6138
+ tag: "span",
6139
+ gap: 2,
6140
+ children: [
6141
+ /*#__PURE__*/ jsx(Image$1, {
6142
+ "aria-hidden": true,
6143
+ fill: "neutral600"
5722
6144
  }),
5723
- /*#__PURE__*/ jsx(SingleSelectOption, {
5724
- value: "h5",
5725
- children: "h5"
6145
+ formatMessage({
6146
+ id: 'components.Blocks.blocks.image',
6147
+ defaultMessage: 'Image'
6148
+ })
6149
+ ]
6150
+ })
6151
+ }),
6152
+ /*#__PURE__*/ jsx(Menu.Item, {
6153
+ startIcon: /*#__PURE__*/ jsx(Link$1, {}),
6154
+ onSelect: ()=>handleActionClick('Link', editorRef),
6155
+ disabled: isDisabled,
6156
+ children: /*#__PURE__*/ jsxs(Flex, {
6157
+ tag: "span",
6158
+ gap: 2,
6159
+ children: [
6160
+ /*#__PURE__*/ jsx(Link$1, {
6161
+ "aria-hidden": true,
6162
+ fill: "neutral600"
5726
6163
  }),
5727
- /*#__PURE__*/ jsx(SingleSelectOption, {
5728
- value: "h6",
5729
- children: "h6"
6164
+ formatMessage({
6165
+ id: 'components.Blocks.popover.link',
6166
+ defaultMessage: 'Link'
5730
6167
  })
5731
6168
  ]
5732
6169
  })
5733
6170
  }),
5734
- /*#__PURE__*/ jsxs(MainButtons, {
5735
- children: [
5736
- /*#__PURE__*/ jsx(IconButton, {
5737
- onClick: ()=>onActionClick('Bold', editorRef),
5738
- label: "Bold",
5739
- name: "Bold",
5740
- children: /*#__PURE__*/ jsx(Bold, {})
6171
+ /*#__PURE__*/ jsx(Menu.Item, {
6172
+ onSelect: ()=>handleActionClick('Quote', editorRef),
6173
+ disabled: isDisabled,
6174
+ children: /*#__PURE__*/ jsxs(Flex, {
6175
+ tag: "span",
6176
+ gap: 2,
6177
+ children: [
6178
+ /*#__PURE__*/ jsx(Quotes, {
6179
+ "aria-hidden": true,
6180
+ fill: "neutral600"
6181
+ }),
6182
+ formatMessage({
6183
+ id: 'components.Blocks.blocks.quote',
6184
+ defaultMessage: 'Quote'
6185
+ })
6186
+ ]
6187
+ })
6188
+ })
6189
+ ]
6190
+ }),
6191
+ key: 'formatting-group-3'
6192
+ }
6193
+ ];
6194
+ return /*#__PURE__*/ jsxs(Flex, {
6195
+ padding: 2,
6196
+ background: "neutral100",
6197
+ justifyContent: "space-between",
6198
+ borderRadius: "0.4rem 0.4rem 0 0",
6199
+ width: "100%",
6200
+ gap: 4,
6201
+ children: [
6202
+ /*#__PURE__*/ jsx(Field.Root, {
6203
+ children: /*#__PURE__*/ jsxs(SingleSelect, {
6204
+ disabled: isDisabled,
6205
+ placeholder: formatMessage({
6206
+ id: 'components.Wysiwyg.selectOptions.title',
6207
+ defaultMessage: 'Headings'
6208
+ }),
6209
+ "aria-label": formatMessage({
6210
+ id: 'components.Wysiwyg.selectOptions.title',
6211
+ defaultMessage: 'Headings'
6212
+ }),
6213
+ // @ts-expect-error – DS v2 will only allow strings.
6214
+ onChange: (value)=>handleActionClick(value, editorRef),
6215
+ size: "S",
6216
+ children: [
6217
+ /*#__PURE__*/ jsx(SingleSelectOption, {
6218
+ value: "h1",
6219
+ startIcon: /*#__PURE__*/ jsx(HeadingOne, {
6220
+ fill: "neutral600"
5741
6221
  }),
5742
- /*#__PURE__*/ jsx(IconButton, {
5743
- onClick: ()=>onActionClick('Italic', editorRef),
5744
- label: "Italic",
5745
- name: "Italic",
5746
- children: /*#__PURE__*/ jsx(Italic, {})
6222
+ children: formatMessage({
6223
+ id: 'components.Wysiwyg.selectOptions.H1',
6224
+ defaultMessage: 'Heading 1'
6225
+ })
6226
+ }),
6227
+ /*#__PURE__*/ jsx(SingleSelectOption, {
6228
+ value: "h2",
6229
+ startIcon: /*#__PURE__*/ jsx(HeadingTwo, {
6230
+ fill: "neutral600"
5747
6231
  }),
5748
- /*#__PURE__*/ jsx(IconButton, {
5749
- onClick: ()=>onActionClick('Underline', editorRef),
5750
- label: "Underline",
5751
- name: "Underline",
5752
- children: /*#__PURE__*/ jsx(Underline, {})
6232
+ children: formatMessage({
6233
+ id: 'components.Wysiwyg.selectOptions.H2',
6234
+ defaultMessage: 'Heading 2'
5753
6235
  })
5754
- ]
5755
- }),
5756
- /*#__PURE__*/ jsxs(Popover.Root, {
5757
- children: [
5758
- /*#__PURE__*/ jsx(Popover.Trigger, {
5759
- children: /*#__PURE__*/ jsx(MoreButton, {
5760
- label: "More",
5761
- children: /*#__PURE__*/ jsx(More, {})
5762
- })
6236
+ }),
6237
+ /*#__PURE__*/ jsx(SingleSelectOption, {
6238
+ value: "h3",
6239
+ startIcon: /*#__PURE__*/ jsx(HeadingThree, {
6240
+ fill: "neutral600"
5763
6241
  }),
5764
- /*#__PURE__*/ jsx(Popover.Content, {
5765
- sideOffset: 12,
5766
- children: /*#__PURE__*/ jsxs(Flex, {
5767
- padding: 2,
5768
- children: [
5769
- /*#__PURE__*/ jsxs(IconButtonGroupMargin, {
5770
- children: [
5771
- /*#__PURE__*/ jsx(IconButton, {
5772
- onClick: ()=>onActionClick('Strikethrough', editorRef, handleTogglePopover),
5773
- label: "Strikethrough",
5774
- name: "Strikethrough",
5775
- children: /*#__PURE__*/ jsx(StrikeThrough, {})
5776
- }),
5777
- /*#__PURE__*/ jsx(IconButton, {
5778
- onClick: ()=>onActionClick('BulletList', editorRef, handleTogglePopover),
5779
- label: "BulletList",
5780
- name: "BulletList",
5781
- children: /*#__PURE__*/ jsx(BulletList, {})
5782
- }),
5783
- /*#__PURE__*/ jsx(IconButton, {
5784
- onClick: ()=>onActionClick('NumberList', editorRef, handleTogglePopover),
5785
- label: "NumberList",
5786
- name: "NumberList",
5787
- children: /*#__PURE__*/ jsx(NumberList, {})
5788
- })
5789
- ]
5790
- }),
5791
- /*#__PURE__*/ jsxs(IconButtonGroup, {
5792
- children: [
5793
- /*#__PURE__*/ jsx(IconButton, {
5794
- onClick: ()=>onActionClick('Code', editorRef, handleTogglePopover),
5795
- label: "Code",
5796
- name: "Code",
5797
- children: /*#__PURE__*/ jsx(Code, {})
5798
- }),
5799
- /*#__PURE__*/ jsx(IconButton, {
5800
- onClick: ()=>{
5801
- handleTogglePopover();
5802
- onToggleMediaLib();
5803
- },
5804
- label: "Image",
5805
- name: "Image",
5806
- children: /*#__PURE__*/ jsx(Image$1, {})
5807
- }),
5808
- /*#__PURE__*/ jsx(IconButton, {
5809
- onClick: ()=>onActionClick('Link', editorRef, handleTogglePopover),
5810
- label: "Link",
5811
- name: "Link",
5812
- children: /*#__PURE__*/ jsx(Link$1, {})
5813
- }),
5814
- /*#__PURE__*/ jsx(IconButton, {
5815
- onClick: ()=>onActionClick('Quote', editorRef, handleTogglePopover),
5816
- label: "Quote",
5817
- name: "Quote",
5818
- children: /*#__PURE__*/ jsx(Quotes, {})
5819
- })
5820
- ]
5821
- })
5822
- ]
5823
- })
6242
+ children: formatMessage({
6243
+ id: 'components.Wysiwyg.selectOptions.H3',
6244
+ defaultMessage: 'Heading 3'
5824
6245
  })
5825
- ]
6246
+ }),
6247
+ /*#__PURE__*/ jsx(SingleSelectOption, {
6248
+ value: "h4",
6249
+ startIcon: /*#__PURE__*/ jsx(HeadingFour, {
6250
+ fill: "neutral600"
6251
+ }),
6252
+ children: formatMessage({
6253
+ id: 'components.Wysiwyg.selectOptions.H4',
6254
+ defaultMessage: 'Heading 4'
6255
+ })
6256
+ }),
6257
+ /*#__PURE__*/ jsx(SingleSelectOption, {
6258
+ value: "h5",
6259
+ startIcon: /*#__PURE__*/ jsx(HeadingFive, {
6260
+ fill: "neutral600"
6261
+ }),
6262
+ children: formatMessage({
6263
+ id: 'components.Wysiwyg.selectOptions.H5',
6264
+ defaultMessage: 'Heading 5'
6265
+ })
6266
+ }),
6267
+ /*#__PURE__*/ jsx(SingleSelectOption, {
6268
+ value: "h6",
6269
+ startIcon: /*#__PURE__*/ jsx(HeadingSix, {
6270
+ fill: "neutral600"
6271
+ }),
6272
+ children: formatMessage({
6273
+ id: 'components.Wysiwyg.selectOptions.H6',
6274
+ defaultMessage: 'Heading 6'
6275
+ })
6276
+ })
6277
+ ]
6278
+ })
6279
+ }),
6280
+ /*#__PURE__*/ jsxs(Flex, {
6281
+ width: "100%",
6282
+ justifyContent: "space-between",
6283
+ overflow: "hidden",
6284
+ children: [
6285
+ /*#__PURE__*/ jsx(Flex, {
6286
+ gap: 2,
6287
+ overflow: "hidden",
6288
+ width: "100%",
6289
+ children: /*#__PURE__*/ jsx(EditorToolbarObserver, {
6290
+ menuTriggerVariant: "tertiary",
6291
+ observedComponents: observedComponents
6292
+ })
6293
+ }),
6294
+ onTogglePreviewMode && /*#__PURE__*/ jsx(Button, {
6295
+ onClick: onTogglePreviewMode,
6296
+ variant: "tertiary",
6297
+ minWidth: "132px",
6298
+ children: isPreviewMode ? formatMessage({
6299
+ id: 'components.Wysiwyg.ToggleMode.markdown-mode',
6300
+ defaultMessage: 'Markdown mode'
6301
+ }) : formatMessage({
6302
+ id: 'components.Wysiwyg.ToggleMode.preview-mode',
6303
+ defaultMessage: 'Preview mode'
6304
+ })
5826
6305
  })
5827
6306
  ]
5828
- }),
5829
- onTogglePreviewMode && /*#__PURE__*/ jsx(Button, {
5830
- onClick: onTogglePreviewMode,
5831
- variant: "tertiary",
5832
- children: formatMessage({
5833
- id: 'components.Wysiwyg.ToggleMode.preview-mode',
5834
- defaultMessage: 'Preview mode'
5835
- })
5836
6307
  })
5837
6308
  ]
5838
6309
  });
@@ -5853,48 +6324,6 @@ const Wysiwyg = /*#__PURE__*/ React.forwardRef(({ hint, disabled, label, name, p
5853
6324
  setIsPreviewMode(false);
5854
6325
  setIsExpandMode((prev)=>!prev);
5855
6326
  };
5856
- const handleActionClick = (value, currentEditorRef, togglePopover)=>{
5857
- switch(value){
5858
- case 'Link':
5859
- case 'Strikethrough':
5860
- {
5861
- markdownHandler(currentEditorRef, value);
5862
- togglePopover?.();
5863
- break;
5864
- }
5865
- case 'Code':
5866
- case 'Quote':
5867
- {
5868
- quoteAndCodeHandler(currentEditorRef, value);
5869
- togglePopover?.();
5870
- break;
5871
- }
5872
- case 'Bold':
5873
- case 'Italic':
5874
- case 'Underline':
5875
- {
5876
- markdownHandler(currentEditorRef, value);
5877
- break;
5878
- }
5879
- case 'BulletList':
5880
- case 'NumberList':
5881
- {
5882
- listHandler(currentEditorRef, value);
5883
- togglePopover?.();
5884
- break;
5885
- }
5886
- case 'h1':
5887
- case 'h2':
5888
- case 'h3':
5889
- case 'h4':
5890
- case 'h5':
5891
- case 'h6':
5892
- {
5893
- titleHandler(currentEditorRef, value);
5894
- break;
5895
- }
5896
- }
5897
- };
5898
6327
  const handleSelectAssets = (files)=>{
5899
6328
  const formattedFiles = files.map((f)=>({
5900
6329
  alt: f.alternativeText || f.name,
@@ -5929,7 +6358,6 @@ const Wysiwyg = /*#__PURE__*/ React.forwardRef(({ hint, disabled, label, name, p
5929
6358
  isExpandMode: isExpandMode,
5930
6359
  editorRef: editorRef,
5931
6360
  isPreviewMode: isPreviewMode,
5932
- onActionClick: handleActionClick,
5933
6361
  onToggleMediaLib: handleToggleMediaLib,
5934
6362
  onTogglePreviewMode: isExpandMode ? undefined : handleTogglePreviewMode,
5935
6363
  disabled: disabled
@@ -6074,6 +6502,13 @@ const MemoizedWysiwyg = /*#__PURE__*/ React.memo(Wysiwyg);
6074
6502
  disabled: fieldIsDisabled
6075
6503
  });
6076
6504
  case 'relation':
6505
+ if (window.strapi.future.isEnabled('unstableRelationsOnTheFly')) {
6506
+ return /*#__PURE__*/ jsx(MemoizedUnstableRelationsField, {
6507
+ ...props,
6508
+ hint: hint,
6509
+ disabled: fieldIsDisabled
6510
+ });
6511
+ }
6077
6512
  return /*#__PURE__*/ jsx(MemoizedRelationsField, {
6078
6513
  ...props,
6079
6514
  hint: hint,
@@ -6186,7 +6621,7 @@ const ResponsiveGridItem = styled(Grid$1.Item)`
6186
6621
  ${({ col })=>col && `grid-column: span ${col};`}
6187
6622
  }
6188
6623
  `;
6189
- const FormLayout = ({ layout })=>{
6624
+ const FormLayout = ({ layout, hasBackground = false })=>{
6190
6625
  const { formatMessage } = useIntl();
6191
6626
  const { model } = useDoc();
6192
6627
  return /*#__PURE__*/ jsx(Flex, {
@@ -6219,14 +6654,13 @@ const FormLayout = ({ layout })=>{
6219
6654
  }, field.name);
6220
6655
  }
6221
6656
  return /*#__PURE__*/ jsx(Box, {
6222
- hasRadius: true,
6223
- background: "neutral0",
6224
- shadow: "tableShadow",
6225
- paddingLeft: 6,
6226
- paddingRight: 6,
6227
- paddingTop: 6,
6228
- paddingBottom: 6,
6229
- borderColor: "neutral150",
6657
+ ...!hasBackground && {
6658
+ padding: 6,
6659
+ borderColor: 'neutral150',
6660
+ background: 'neutral0',
6661
+ hasRadius: true,
6662
+ shadow: 'tableShadow'
6663
+ },
6230
6664
  children: /*#__PURE__*/ jsx(Flex, {
6231
6665
  direction: "column",
6232
6666
  alignItems: "stretch",
@@ -6753,4 +7187,4 @@ const ComponentInput = ({ label, required, name, attribute, disabled, labelActio
6753
7187
  const MemoizedComponentInput = /*#__PURE__*/ React.memo(ComponentInput);
6754
7188
 
6755
7189
  export { DynamicZone as D, FormLayout as F, MemoizedUIDInput as M, NotAllowedInput as N, useDynamicZone as a, useFieldHint as b, MemoizedWysiwyg as c, MemoizedComponentInput as d, MemoizedBlocksInput as e, useLazyComponents as u };
6756
- //# sourceMappingURL=Input-Csrk7S5E.js.map
7190
+ //# sourceMappingURL=Input-BexkC_pp.mjs.map