@frontify/guideline-blocks-settings 0.33.4 → 0.34.0

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 (498) hide show
  1. package/dist/components/Attachments/AttachmentItem.es.js +174 -0
  2. package/dist/components/Attachments/AttachmentItem.es.js.map +1 -0
  3. package/dist/components/Attachments/Attachments.es.js +160 -0
  4. package/dist/components/Attachments/Attachments.es.js.map +1 -0
  5. package/dist/components/Attachments/AttachmentsButtonTrigger.es.js +29 -0
  6. package/dist/components/Attachments/AttachmentsButtonTrigger.es.js.map +1 -0
  7. package/dist/components/BlockInjectButton/BlockInjectButton.es.js +150 -0
  8. package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -0
  9. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +71 -0
  10. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -0
  11. package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js +33 -0
  12. package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js.map +1 -0
  13. package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js +26 -0
  14. package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js.map +1 -0
  15. package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js +28 -0
  16. package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js.map +1 -0
  17. package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js +35 -0
  18. package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js.map +1 -0
  19. package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js +44 -0
  20. package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js.map +1 -0
  21. package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js +25 -0
  22. package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js.map +1 -0
  23. package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.es.js +29 -0
  24. package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.es.js.map +1 -0
  25. package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js +22 -0
  26. package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js.map +1 -0
  27. package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js +12 -0
  28. package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js.map +1 -0
  29. package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js +20 -0
  30. package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js.map +1 -0
  31. package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js +6 -0
  32. package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js.map +1 -0
  33. package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js +11 -0
  34. package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js.map +1 -0
  35. package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js +18 -0
  36. package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js.map +1 -0
  37. package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js +26 -0
  38. package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js.map +1 -0
  39. package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js +18 -0
  40. package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js.map +1 -0
  41. package/dist/components/BlockItemWrapper/constants.es.js +6 -0
  42. package/dist/components/BlockItemWrapper/constants.es.js.map +1 -0
  43. package/dist/components/DownloadButton/DownloadButton.es.js +39 -0
  44. package/dist/components/DownloadButton/DownloadButton.es.js.map +1 -0
  45. package/dist/components/Link/LinkInput.es.js +63 -0
  46. package/dist/components/Link/LinkInput.es.js.map +1 -0
  47. package/dist/components/Link/LinkSelector/DocumentLink.es.js +68 -0
  48. package/dist/components/Link/LinkSelector/DocumentLink.es.js.map +1 -0
  49. package/dist/components/Link/LinkSelector/DocumentLinks.es.js +60 -0
  50. package/dist/components/Link/LinkSelector/DocumentLinks.es.js.map +1 -0
  51. package/dist/components/Link/LinkSelector/LinkSelector.es.js +86 -0
  52. package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +1 -0
  53. package/dist/components/Link/LinkSelector/LoadingIndicator.es.js +7 -0
  54. package/dist/components/Link/LinkSelector/LoadingIndicator.es.js.map +1 -0
  55. package/dist/components/Link/LinkSelector/PageLink.es.js +70 -0
  56. package/dist/components/Link/LinkSelector/PageLink.es.js.map +1 -0
  57. package/dist/components/Link/LinkSelector/PageLinks.es.js +38 -0
  58. package/dist/components/Link/LinkSelector/PageLinks.es.js.map +1 -0
  59. package/dist/components/Link/LinkSelector/SectionLink.es.js +25 -0
  60. package/dist/components/Link/LinkSelector/SectionLink.es.js.map +1 -0
  61. package/dist/components/Link/utils/getUrl.es.js +18 -0
  62. package/dist/components/Link/utils/getUrl.es.js.map +1 -0
  63. package/dist/components/Link/utils/relativeUrlRegex.es.js +5 -0
  64. package/dist/components/Link/utils/relativeUrlRegex.es.js.map +1 -0
  65. package/dist/components/Link/utils/url.es.js +17 -0
  66. package/dist/components/Link/utils/url.es.js.map +1 -0
  67. package/dist/components/RichTextEditor/RichTextEditor.es.js +42 -0
  68. package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -0
  69. package/dist/components/RichTextEditor/SerializedText.es.js +20 -0
  70. package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -0
  71. package/dist/components/RichTextEditor/constants.es.js +5 -0
  72. package/dist/components/RichTextEditor/constants.es.js.map +1 -0
  73. package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js +35 -0
  74. package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -0
  75. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +41 -0
  76. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -0
  77. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js +12 -0
  78. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js.map +1 -0
  79. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +24 -0
  80. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -0
  81. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +26 -0
  82. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -0
  83. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +28 -0
  84. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js.map +1 -0
  85. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js +48 -0
  86. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -0
  87. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +69 -0
  88. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js.map +1 -0
  89. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +104 -0
  90. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -0
  91. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js +32 -0
  92. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js.map +1 -0
  93. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +57 -0
  94. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js.map +1 -0
  95. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js +19 -0
  96. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js.map +1 -0
  97. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js +26 -0
  98. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js.map +1 -0
  99. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js +41 -0
  100. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js.map +1 -0
  101. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js +18 -0
  102. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js.map +1 -0
  103. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js +67 -0
  104. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -0
  105. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js +13 -0
  106. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +1 -0
  107. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js +25 -0
  108. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js.map +1 -0
  109. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js +35 -0
  110. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -0
  111. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js +86 -0
  112. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -0
  113. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js +24 -0
  114. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -0
  115. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js +19 -0
  116. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +1 -0
  117. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js +13 -0
  118. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +1 -0
  119. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js +11 -0
  120. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js.map +1 -0
  121. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js +10 -0
  122. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js.map +1 -0
  123. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js +81 -0
  124. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js.map +1 -0
  125. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js +18 -0
  126. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +1 -0
  127. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js +17 -0
  128. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js.map +1 -0
  129. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js +14 -0
  130. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +1 -0
  131. package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js +52 -0
  132. package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -0
  133. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +32 -0
  134. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -0
  135. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +35 -0
  136. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -0
  137. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +8 -0
  138. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js.map +1 -0
  139. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +66 -0
  140. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -0
  141. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +79 -0
  142. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -0
  143. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +22 -0
  144. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -0
  145. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +12 -0
  146. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -0
  147. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js +11 -0
  148. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js.map +1 -0
  149. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.es.js +25 -0
  150. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.es.js.map +1 -0
  151. package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js +5 -0
  152. package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js.map +1 -0
  153. package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +45 -0
  154. package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -0
  155. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js +13 -0
  156. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js.map +1 -0
  157. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +50 -0
  158. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -0
  159. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +50 -0
  160. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -0
  161. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +50 -0
  162. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -0
  163. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +51 -0
  164. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -0
  165. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +51 -0
  166. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -0
  167. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +51 -0
  168. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -0
  169. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +51 -0
  170. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -0
  171. package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js +40 -0
  172. package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js.map +1 -0
  173. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +51 -0
  174. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -0
  175. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +51 -0
  176. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -0
  177. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +45 -0
  178. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -0
  179. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +53 -0
  180. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -0
  181. package/dist/components/RichTextEditor/plugins/styles.es.js +167 -0
  182. package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -0
  183. package/dist/helpers/addHttps.es.js +14 -0
  184. package/dist/helpers/addHttps.es.js.map +1 -0
  185. package/dist/helpers/convertToRichTextValue.es.js +6 -0
  186. package/dist/helpers/convertToRichTextValue.es.js.map +1 -0
  187. package/dist/helpers/customCoordinatesGetterFactory.es.js +32 -0
  188. package/dist/helpers/customCoordinatesGetterFactory.es.js.map +1 -0
  189. package/dist/helpers/hasRichTextValue.es.js +15 -0
  190. package/dist/helpers/hasRichTextValue.es.js.map +1 -0
  191. package/dist/helpers/isDownloadable.es.js +6 -0
  192. package/dist/helpers/isDownloadable.es.js.map +1 -0
  193. package/dist/helpers/mapColorPalettes.es.js +28 -0
  194. package/dist/helpers/mapColorPalettes.es.js.map +1 -0
  195. package/dist/hooks/useAttachments.es.js +53 -0
  196. package/dist/hooks/useAttachments.es.js.map +1 -0
  197. package/dist/hooks/useDndSensors.es.js +20 -0
  198. package/dist/hooks/useDndSensors.es.js.map +1 -0
  199. package/dist/index.cjs.js +4 -0
  200. package/dist/index.cjs.js.map +1 -0
  201. package/dist/index.d.ts +1190 -0
  202. package/dist/index.es.js +217 -0
  203. package/dist/index.es.js.map +1 -0
  204. package/dist/index.umd.js +4 -0
  205. package/dist/index.umd.js.map +1 -0
  206. package/dist/settings/background.es.js +22 -0
  207. package/dist/settings/background.es.js.map +1 -0
  208. package/dist/settings/border.es.js +61 -0
  209. package/dist/settings/border.es.js.map +1 -0
  210. package/dist/settings/borderRadius.es.js +56 -0
  211. package/dist/settings/borderRadius.es.js.map +1 -0
  212. package/dist/settings/borderRadiusExtended.es.js +64 -0
  213. package/dist/settings/borderRadiusExtended.es.js.map +1 -0
  214. package/dist/settings/defaultValues.es.js +19 -0
  215. package/dist/settings/defaultValues.es.js.map +1 -0
  216. package/dist/settings/gutter.es.js +56 -0
  217. package/dist/settings/gutter.es.js.map +1 -0
  218. package/dist/settings/margin.es.js +53 -0
  219. package/dist/settings/margin.es.js.map +1 -0
  220. package/dist/settings/marginExtended.es.js +65 -0
  221. package/dist/settings/marginExtended.es.js.map +1 -0
  222. package/dist/settings/padding.es.js +53 -0
  223. package/dist/settings/padding.es.js.map +1 -0
  224. package/dist/settings/paddingExtended.es.js +65 -0
  225. package/dist/settings/paddingExtended.es.js.map +1 -0
  226. package/dist/settings/securityDownloadable.es.js +19 -0
  227. package/dist/settings/securityDownloadable.es.js.map +1 -0
  228. package/dist/settings/securityGlobalControl.es.js +33 -0
  229. package/dist/settings/securityGlobalControl.es.js.map +1 -0
  230. package/dist/settings/types.es.js +48 -0
  231. package/dist/settings/types.es.js.map +1 -0
  232. package/dist/styles.css +1 -0
  233. package/dist/styles.css.es.js +2 -0
  234. package/dist/styles.css.es.js.map +1 -0
  235. package/dist/utilities/color/getReadableColor.es.js +14 -0
  236. package/dist/utilities/color/getReadableColor.es.js.map +1 -0
  237. package/dist/utilities/color/isDark.es.js +10 -0
  238. package/dist/utilities/color/isDark.es.js.map +1 -0
  239. package/dist/utilities/color/setAlpha.es.js +6 -0
  240. package/dist/utilities/color/setAlpha.es.js.map +1 -0
  241. package/dist/utilities/color/toColorObject.es.js +9 -0
  242. package/dist/utilities/color/toColorObject.es.js.map +1 -0
  243. package/dist/utilities/color/toHex8String.es.js +7 -0
  244. package/dist/utilities/color/toHex8String.es.js.map +1 -0
  245. package/dist/utilities/color/toHexString.es.js +7 -0
  246. package/dist/utilities/color/toHexString.es.js.map +1 -0
  247. package/dist/utilities/color/toRgbaString.es.js +7 -0
  248. package/dist/utilities/color/toRgbaString.es.js.map +1 -0
  249. package/dist/utilities/color/toShortRgba.es.js +11 -0
  250. package/dist/utilities/color/toShortRgba.es.js.map +1 -0
  251. package/dist/utilities/moveItemInArray.es.js +12 -0
  252. package/dist/utilities/moveItemInArray.es.js.map +1 -0
  253. package/dist/utilities/react/getBackgroundColorStyles.es.js +8 -0
  254. package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -0
  255. package/dist/utilities/react/getBorderStyles.es.js +12 -0
  256. package/dist/utilities/react/getBorderStyles.es.js.map +1 -0
  257. package/dist/utilities/react/getRadiusStyles.es.js +8 -0
  258. package/dist/utilities/react/getRadiusStyles.es.js.map +1 -0
  259. package/dist/utilities/react/joinClassNames.es.js +5 -0
  260. package/dist/utilities/react/joinClassNames.es.js.map +1 -0
  261. package/package.json +9 -6
  262. package/.eslintrc.cjs +0 -27
  263. package/.prettierrc +0 -7
  264. package/CHANGELOG.md +0 -787
  265. package/postcss.config.cjs +0 -8
  266. package/setupTests.ts +0 -23
  267. package/src/components/Attachments/AttachmentItem.tsx +0 -247
  268. package/src/components/Attachments/Attachments.spec.ct.tsx +0 -165
  269. package/src/components/Attachments/Attachments.tsx +0 -241
  270. package/src/components/Attachments/AttachmentsButtonTrigger.tsx +0 -30
  271. package/src/components/Attachments/index.ts +0 -4
  272. package/src/components/Attachments/types.ts +0 -40
  273. package/src/components/BlockInjectButton/BlockInjectButton.spec.ct.tsx +0 -48
  274. package/src/components/BlockInjectButton/BlockInjectButton.tsx +0 -212
  275. package/src/components/BlockInjectButton/index.ts +0 -4
  276. package/src/components/BlockInjectButton/types.ts +0 -18
  277. package/src/components/BlockItemWrapper/BlockItemWrapper.spec.ct.tsx +0 -145
  278. package/src/components/BlockItemWrapper/BlockItemWrapper.tsx +0 -76
  279. package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.spec.tsx +0 -96
  280. package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.tsx +0 -42
  281. package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.spec.tsx +0 -44
  282. package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.tsx +0 -24
  283. package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/index.ts +0 -3
  284. package/src/components/BlockItemWrapper/Toolbar/BaseToolbarButton.spec.tsx +0 -40
  285. package/src/components/BlockItemWrapper/Toolbar/BaseToolbarButton.tsx +0 -37
  286. package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.spec.tsx +0 -89
  287. package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.tsx +0 -40
  288. package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/index.ts +0 -3
  289. package/src/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.spec.tsx +0 -140
  290. package/src/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.tsx +0 -61
  291. package/src/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/index.ts +0 -3
  292. package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.spec.tsx +0 -77
  293. package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.tsx +0 -30
  294. package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.spec.tsx +0 -63
  295. package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.tsx +0 -40
  296. package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/index.ts +0 -4
  297. package/src/components/BlockItemWrapper/Toolbar/Toolbar.spec.tsx +0 -259
  298. package/src/components/BlockItemWrapper/Toolbar/Toolbar.tsx +0 -36
  299. package/src/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.spec.tsx +0 -70
  300. package/src/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.tsx +0 -19
  301. package/src/components/BlockItemWrapper/Toolbar/ToolbarButton/index.ts +0 -3
  302. package/src/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.tsx +0 -25
  303. package/src/components/BlockItemWrapper/Toolbar/ToolbarSegment.tsx +0 -9
  304. package/src/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.tsx +0 -15
  305. package/src/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.tsx +0 -25
  306. package/src/components/BlockItemWrapper/Toolbar/context/index.ts +0 -4
  307. package/src/components/BlockItemWrapper/Toolbar/helpers.ts +0 -33
  308. package/src/components/BlockItemWrapper/Toolbar/hooks/index.ts +0 -3
  309. package/src/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.spec.tsx +0 -59
  310. package/src/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.ts +0 -24
  311. package/src/components/BlockItemWrapper/Toolbar/index.ts +0 -10
  312. package/src/components/BlockItemWrapper/Toolbar/types.ts +0 -18
  313. package/src/components/BlockItemWrapper/constants.ts +0 -4
  314. package/src/components/BlockItemWrapper/index.ts +0 -6
  315. package/src/components/BlockItemWrapper/types.ts +0 -24
  316. package/src/components/DownloadButton/DownloadButton.spec.ct.tsx +0 -20
  317. package/src/components/DownloadButton/DownloadButton.tsx +0 -36
  318. package/src/components/DownloadButton/index.ts +0 -3
  319. package/src/components/DownloadButton/types.ts +0 -5
  320. package/src/components/Link/LinkInput.spec.ct.tsx +0 -142
  321. package/src/components/Link/LinkInput.tsx +0 -86
  322. package/src/components/Link/LinkSelector/DocumentLink.tsx +0 -81
  323. package/src/components/Link/LinkSelector/DocumentLinks.tsx +0 -102
  324. package/src/components/Link/LinkSelector/LinkSelector.spec.ct.tsx +0 -196
  325. package/src/components/Link/LinkSelector/LinkSelector.tsx +0 -96
  326. package/src/components/Link/LinkSelector/LoadingIndicator.tsx +0 -11
  327. package/src/components/Link/LinkSelector/PageLink.tsx +0 -96
  328. package/src/components/Link/LinkSelector/PageLinks.tsx +0 -71
  329. package/src/components/Link/LinkSelector/SectionLink.tsx +0 -36
  330. package/src/components/Link/LinkSelector/index.ts +0 -3
  331. package/src/components/Link/index.ts +0 -6
  332. package/src/components/Link/types.ts +0 -6
  333. package/src/components/Link/utils/getUrl.ts +0 -30
  334. package/src/components/Link/utils/index.ts +0 -5
  335. package/src/components/Link/utils/relativeUrlRegex.spec.ts +0 -32
  336. package/src/components/Link/utils/relativeUrlRegex.ts +0 -3
  337. package/src/components/Link/utils/url.spec.ts +0 -75
  338. package/src/components/Link/utils/url.ts +0 -21
  339. package/src/components/RichTextEditor/RichTextEditor.spec.ct.tsx +0 -231
  340. package/src/components/RichTextEditor/RichTextEditor.tsx +0 -62
  341. package/src/components/RichTextEditor/SerializedText.tsx +0 -29
  342. package/src/components/RichTextEditor/constants.ts +0 -3
  343. package/src/components/RichTextEditor/index.ts +0 -6
  344. package/src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx +0 -55
  345. package/src/components/RichTextEditor/pluginPresets/index.ts +0 -3
  346. package/src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.tsx +0 -74
  347. package/src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.ts +0 -11
  348. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.tsx +0 -20
  349. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx +0 -56
  350. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.tsx +0 -19
  351. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.tsx +0 -42
  352. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.tsx +0 -37
  353. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.tsx +0 -22
  354. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.tsx +0 -30
  355. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.tsx +0 -81
  356. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/types.ts +0 -13
  357. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts +0 -143
  358. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.tsx +0 -31
  359. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.ts +0 -46
  360. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/index.ts +0 -12
  361. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.ts +0 -113
  362. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.ts +0 -21
  363. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.ts +0 -30
  364. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.ts +0 -71
  365. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.ts +0 -22
  366. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/index.ts +0 -3
  367. package/src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts +0 -118
  368. package/src/components/RichTextEditor/plugins/ButtonPlugin/index.ts +0 -7
  369. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/index.ts +0 -8
  370. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.ts +0 -17
  371. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.ts +0 -40
  372. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.ts +0 -68
  373. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.ts +0 -198
  374. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.ts +0 -40
  375. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.ts +0 -30
  376. package/src/components/RichTextEditor/plugins/ButtonPlugin/types.ts +0 -13
  377. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.ts +0 -28
  378. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.ts +0 -14
  379. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.ts +0 -18
  380. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/index.ts +0 -8
  381. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.ts +0 -83
  382. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts +0 -23
  383. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.ts +0 -30
  384. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts +0 -45
  385. package/src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts +0 -106
  386. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.tsx +0 -26
  387. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.tsx +0 -43
  388. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/index.ts +0 -4
  389. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts +0 -113
  390. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.tsx +0 -45
  391. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.tsx +0 -5
  392. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx +0 -88
  393. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/index.ts +0 -4
  394. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/types.ts +0 -11
  395. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.ts +0 -73
  396. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts +0 -136
  397. package/src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx +0 -38
  398. package/src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx +0 -36
  399. package/src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.ts +0 -11
  400. package/src/components/RichTextEditor/plugins/LinkPlugin/id.ts +0 -3
  401. package/src/components/RichTextEditor/plugins/LinkPlugin/index.ts +0 -49
  402. package/src/components/RichTextEditor/plugins/LinkPlugin/types.ts +0 -12
  403. package/src/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.tsx +0 -62
  404. package/src/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.tsx +0 -62
  405. package/src/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.tsx +0 -63
  406. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.tsx +0 -62
  407. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.tsx +0 -62
  408. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.tsx +0 -62
  409. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.tsx +0 -63
  410. package/src/components/RichTextEditor/plugins/TextStylePlugins/helpers.tsx +0 -44
  411. package/src/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.tsx +0 -62
  412. package/src/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.tsx +0 -62
  413. package/src/components/RichTextEditor/plugins/TextStylePlugins/index.ts +0 -15
  414. package/src/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.tsx +0 -58
  415. package/src/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.tsx +0 -63
  416. package/src/components/RichTextEditor/plugins/index.ts +0 -6
  417. package/src/components/RichTextEditor/plugins/styles.ts +0 -178
  418. package/src/components/RichTextEditor/types.ts +0 -23
  419. package/src/components/index.ts +0 -8
  420. package/src/helpers/addHttps.spec.ts +0 -42
  421. package/src/helpers/addHttps.ts +0 -15
  422. package/src/helpers/convertToRichTextValue.spec.ts +0 -32
  423. package/src/helpers/convertToRichTextValue.ts +0 -6
  424. package/src/helpers/customCoordinatesGetterFactory.spec.ts +0 -69
  425. package/src/helpers/customCoordinatesGetterFactory.ts +0 -39
  426. package/src/helpers/hasRichTextValue.spec.ts +0 -63
  427. package/src/helpers/hasRichTextValue.ts +0 -29
  428. package/src/helpers/index.ts +0 -8
  429. package/src/helpers/isDownloadable.spec.ts +0 -47
  430. package/src/helpers/isDownloadable.ts +0 -7
  431. package/src/helpers/mapColorPalettes.spec.ts +0 -47
  432. package/src/helpers/mapColorPalettes.ts +0 -65
  433. package/src/hooks/index.ts +0 -4
  434. package/src/hooks/useAttachments.spec.tsx +0 -127
  435. package/src/hooks/useAttachments.tsx +0 -90
  436. package/src/hooks/useDndSensors.spec.ts +0 -40
  437. package/src/hooks/useDndSensors.ts +0 -23
  438. package/src/index.ts +0 -138
  439. package/src/settings/background.spec.ts +0 -173
  440. package/src/settings/background.ts +0 -52
  441. package/src/settings/border.spec.ts +0 -76
  442. package/src/settings/border.ts +0 -90
  443. package/src/settings/borderRadius.spec.ts +0 -30
  444. package/src/settings/borderRadius.ts +0 -73
  445. package/src/settings/borderRadiusExtended.spec.ts +0 -52
  446. package/src/settings/borderRadiusExtended.ts +0 -84
  447. package/src/settings/defaultValues.ts +0 -21
  448. package/src/settings/gutter.spec.ts +0 -60
  449. package/src/settings/gutter.ts +0 -75
  450. package/src/settings/index.ts +0 -14
  451. package/src/settings/margin.spec.ts +0 -42
  452. package/src/settings/margin.ts +0 -72
  453. package/src/settings/marginExtended.spec.ts +0 -45
  454. package/src/settings/marginExtended.ts +0 -91
  455. package/src/settings/padding.spec.ts +0 -42
  456. package/src/settings/padding.ts +0 -73
  457. package/src/settings/paddingExtended.spec.ts +0 -45
  458. package/src/settings/paddingExtended.ts +0 -91
  459. package/src/settings/security.spec.ts +0 -87
  460. package/src/settings/security.ts +0 -61
  461. package/src/settings/securityDownloadable.spec.ts +0 -46
  462. package/src/settings/securityDownloadable.ts +0 -33
  463. package/src/settings/securityGlobalControl.ts +0 -42
  464. package/src/settings/types.ts +0 -128
  465. package/src/styles.css +0 -3
  466. package/src/utilities/color/getReadableColor.spec.ts +0 -32
  467. package/src/utilities/color/getReadableColor.ts +0 -34
  468. package/src/utilities/color/index.ts +0 -10
  469. package/src/utilities/color/isDark.spec.ts +0 -33
  470. package/src/utilities/color/isDark.ts +0 -29
  471. package/src/utilities/color/setAlpha.spec.ts +0 -28
  472. package/src/utilities/color/setAlpha.ts +0 -14
  473. package/src/utilities/color/toColorObject.spec.ts +0 -19
  474. package/src/utilities/color/toColorObject.ts +0 -16
  475. package/src/utilities/color/toHex8String.spec.ts +0 -17
  476. package/src/utilities/color/toHex8String.ts +0 -14
  477. package/src/utilities/color/toHexString.spec.ts +0 -17
  478. package/src/utilities/color/toHexString.ts +0 -10
  479. package/src/utilities/color/toRgbaString.spec.ts +0 -12
  480. package/src/utilities/color/toRgbaString.ts +0 -14
  481. package/src/utilities/color/toShortRgba.spec.ts +0 -16
  482. package/src/utilities/color/toShortRgba.ts +0 -35
  483. package/src/utilities/index.ts +0 -5
  484. package/src/utilities/moveItemInArray.spec.ts +0 -17
  485. package/src/utilities/moveItemInArray.ts +0 -21
  486. package/src/utilities/react/getBackgroundColorStyles.spec.ts +0 -18
  487. package/src/utilities/react/getBackgroundColorStyles.ts +0 -10
  488. package/src/utilities/react/getBorderStyles.spec.ts +0 -39
  489. package/src/utilities/react/getBorderStyles.ts +0 -20
  490. package/src/utilities/react/getRadiusStyles.spec.ts +0 -25
  491. package/src/utilities/react/getRadiusStyles.ts +0 -8
  492. package/src/utilities/react/index.ts +0 -6
  493. package/src/utilities/react/joinClassNames.spec.ts +0 -18
  494. package/src/utilities/react/joinClassNames.ts +0 -10
  495. package/tailwind.config.ts +0 -27
  496. package/tsconfig.json +0 -24
  497. package/tsconfig.node.json +0 -12
  498. package/vite.config.ts +0 -71
@@ -1,96 +0,0 @@
1
- /* (c) Copyright Frontify Ltd., all rights reserved. */
2
-
3
- import { AssetDummy, getAppBridgeBlockStub } from '@frontify/app-bridge';
4
- import { fireEvent, render, waitFor } from '@testing-library/react';
5
- import { beforeAll, describe, expect, it, vi } from 'vitest';
6
-
7
- import { AttachmentsProvider } from '../../../../hooks/useAttachments';
8
- import { DragPreviewContextProvider } from '../context/DragPreviewContext';
9
- import { MultiFlyoutContextProvider } from '../context/MultiFlyoutContext';
10
-
11
- import { AttachmentsToolbarButton } from './AttachmentsToolbarButton';
12
-
13
- const TOOLBAR_BUTTON_ID = 'attachments-toolbar-button-trigger';
14
- const FLYOUT_CONTENT_ID = 'attachments-flyout-content';
15
- const TOOLTIP_ID = 'tooltip';
16
-
17
- const TEST_FLYOUT_ID = 'flyout-id';
18
- const ASSET_ID = 'attachments';
19
-
20
- const STUB_WITH_THREE_ASSETS = getAppBridgeBlockStub({
21
- blockId: 2,
22
- blockAssets: { [ASSET_ID]: [AssetDummy.with(1), AssetDummy.with(2), AssetDummy.with(3)] },
23
- editorState: true,
24
- });
25
-
26
- /**
27
- * @vitest-environment happy-dom
28
- */
29
-
30
- describe('AttachmentsToolbarButton', () => {
31
- beforeAll(() => {
32
- vi.stubGlobal(
33
- 'Worker',
34
- class Worker {
35
- constructor() {}
36
- addEventListener() {}
37
- terminate() {}
38
- },
39
- );
40
- });
41
- it('should disable tooltip and hide flyout when item is in drag preview context', async () => {
42
- const { getByTestId, queryByTestId } = render(
43
- <MultiFlyoutContextProvider openFlyoutIds={[TEST_FLYOUT_ID]} setOpenFlyoutIds={vi.fn()}>
44
- <DragPreviewContextProvider isDragPreview>
45
- <AttachmentsProvider appBridge={STUB_WITH_THREE_ASSETS} assetId={ASSET_ID}>
46
- <AttachmentsToolbarButton flyoutId={TEST_FLYOUT_ID} />
47
- </AttachmentsProvider>
48
- </DragPreviewContextProvider>
49
- </MultiFlyoutContextProvider>,
50
- );
51
-
52
- expect(getByTestId(TOOLTIP_ID)).toHaveClass('tw-opacity-0');
53
-
54
- getByTestId(TOOLBAR_BUTTON_ID).focus();
55
-
56
- await waitFor(() => {
57
- expect(getByTestId(TOOLTIP_ID)).toHaveClass('tw-opacity-0');
58
- expect(queryByTestId(FLYOUT_CONTENT_ID)).toBeNull();
59
- });
60
- });
61
-
62
- it('should open flyout onClick', async () => {
63
- const setOpenFlyoutIdsStub = vi.fn();
64
- const { getByTestId } = render(
65
- <MultiFlyoutContextProvider openFlyoutIds={[]} setOpenFlyoutIds={setOpenFlyoutIdsStub}>
66
- <DragPreviewContextProvider isDragPreview>
67
- <AttachmentsProvider appBridge={STUB_WITH_THREE_ASSETS} assetId={ASSET_ID}>
68
- <AttachmentsToolbarButton flyoutId={TEST_FLYOUT_ID} />
69
- </AttachmentsProvider>
70
- </DragPreviewContextProvider>
71
- </MultiFlyoutContextProvider>,
72
- );
73
-
74
- await fireEvent.click(getByTestId(TOOLBAR_BUTTON_ID));
75
-
76
- expect(setOpenFlyoutIdsStub).toHaveBeenCalledOnce();
77
- const dispatchedStateResult = setOpenFlyoutIdsStub.mock.lastCall[0]([]);
78
- expect(dispatchedStateResult).toEqual([TEST_FLYOUT_ID]);
79
- });
80
-
81
- it('should open tooltip when item is focused', async () => {
82
- const { getByTestId } = render(
83
- <AttachmentsProvider appBridge={STUB_WITH_THREE_ASSETS} assetId={ASSET_ID}>
84
- <AttachmentsToolbarButton />
85
- </AttachmentsProvider>,
86
- );
87
-
88
- expect(getByTestId(TOOLTIP_ID)).toHaveClass('tw-opacity-0');
89
-
90
- getByTestId(TOOLTIP_ID).focus();
91
-
92
- await waitFor(() => {
93
- expect(getByTestId(TOOLTIP_ID)).not.toHaveClass('tw-opacity-0');
94
- });
95
- });
96
- });
@@ -1,42 +0,0 @@
1
- /* (c) Copyright Frontify Ltd., all rights reserved. */
2
-
3
- import { useMemoizedId } from '@frontify/fondue';
4
-
5
- import { useAttachmentsContext } from '../../../../hooks';
6
- import { Attachments } from '../../../Attachments';
7
- import { useMultiFlyoutState } from '../hooks/useMultiFlyoutState';
8
-
9
- import { AttachmentsToolbarButtonTrigger } from './AttachmentsToolbarButtonTrigger';
10
- import { useDragPreviewContext } from '../context/DragPreviewContext';
11
-
12
- export const DEFAULT_ATTACHMENTS_BUTTON_ID = 'attachments';
13
-
14
- type AttachmentsToolbarButtonProps = { flyoutId?: string };
15
-
16
- export const AttachmentsToolbarButton = ({
17
- flyoutId = DEFAULT_ATTACHMENTS_BUTTON_ID,
18
- }: AttachmentsToolbarButtonProps) => {
19
- const id = useMemoizedId(flyoutId);
20
-
21
- const { appBridge, attachments, onAttachmentsAdd, onAttachmentDelete, onAttachmentReplace, onAttachmentsSorted } =
22
- useAttachmentsContext();
23
-
24
- const { isOpen, onOpenChange } = useMultiFlyoutState(id);
25
- const isDragPreview = useDragPreviewContext();
26
-
27
- return (
28
- <Attachments
29
- onUpload={onAttachmentsAdd}
30
- onDelete={onAttachmentDelete}
31
- onReplaceWithBrowse={onAttachmentReplace}
32
- onReplaceWithUpload={onAttachmentReplace}
33
- onSorted={onAttachmentsSorted}
34
- onBrowse={onAttachmentsAdd}
35
- items={attachments}
36
- appBridge={appBridge}
37
- triggerComponent={AttachmentsToolbarButtonTrigger}
38
- isOpen={isOpen && !isDragPreview}
39
- onOpenChange={onOpenChange}
40
- />
41
- );
42
- };
@@ -1,44 +0,0 @@
1
- /* (c) Copyright Frontify Ltd., all rights reserved. */
2
-
3
- import { cleanup, fireEvent, render } from '@testing-library/react';
4
- import { afterEach, describe, expect, it, vi } from 'vitest';
5
- import { AttachmentsToolbarButtonTrigger } from './AttachmentsToolbarButtonTrigger';
6
- import { MutableRefObject } from 'react';
7
-
8
- const BUTTON_ID = 'attachments-toolbar-button-trigger';
9
-
10
- describe('AttachmentsToolbarButtonTrigger', () => {
11
- afterEach(() => {
12
- cleanup();
13
- });
14
-
15
- it('should apply active styles when flyout is open', async () => {
16
- const { getByTestId } = render(
17
- <AttachmentsToolbarButtonTrigger
18
- isFlyoutOpen
19
- triggerProps={{}}
20
- triggerRef={{} as MutableRefObject<HTMLButtonElement>}
21
- >
22
- Button
23
- </AttachmentsToolbarButtonTrigger>,
24
- );
25
-
26
- expect(getByTestId(BUTTON_ID)).toHaveClass('tw-text-box-neutral-inverse-pressed');
27
- });
28
- it('should forward trigger props to button', async () => {
29
- const onPointerUpStub = vi.fn();
30
-
31
- const { getByTestId } = render(
32
- <AttachmentsToolbarButtonTrigger
33
- isFlyoutOpen={false}
34
- triggerProps={{ onPointerUp: onPointerUpStub }}
35
- triggerRef={{} as MutableRefObject<HTMLButtonElement>}
36
- >
37
- Button
38
- </AttachmentsToolbarButtonTrigger>,
39
- );
40
- await fireEvent.pointerUp(getByTestId(BUTTON_ID));
41
-
42
- expect(onPointerUpStub).toHaveBeenCalledOnce();
43
- });
44
- });
@@ -1,24 +0,0 @@
1
- /* (c) Copyright Frontify Ltd., all rights reserved. */
2
-
3
- import { IconCaretDown12, IconPaperclip16 } from '@frontify/fondue';
4
- import { type AttachmentsTriggerProps } from '../../../Attachments/types';
5
-
6
- import { BaseToolbarButton } from '../BaseToolbarButton';
7
-
8
- export const AttachmentsToolbarButtonTrigger = ({
9
- children,
10
- isFlyoutOpen,
11
- triggerProps,
12
- triggerRef,
13
- }: AttachmentsTriggerProps) => (
14
- <BaseToolbarButton
15
- forceActiveStyle={isFlyoutOpen}
16
- data-test-id="attachments-toolbar-button-trigger"
17
- {...triggerProps}
18
- ref={triggerRef}
19
- >
20
- <IconPaperclip16 />
21
- {children}
22
- <IconCaretDown12 />
23
- </BaseToolbarButton>
24
- );
@@ -1,3 +0,0 @@
1
- /* (c) Copyright Frontify Ltd., all rights reserved. */
2
-
3
- export * from './AttachmentsToolbarButton';
@@ -1,40 +0,0 @@
1
- /* (c) Copyright Frontify Ltd., all rights reserved. */
2
-
3
- import { cleanup, fireEvent, render } from '@testing-library/react';
4
- import { afterEach, describe, expect, it, vi } from 'vitest';
5
- import { BaseToolbarButton } from './BaseToolbarButton';
6
-
7
- const BUTTON_ID = 'base-toolbar-button';
8
-
9
- describe('BaseToolbarButton', () => {
10
- afterEach(() => {
11
- cleanup();
12
- });
13
- it('should call onClick', async () => {
14
- const onClickStub = vi.fn();
15
- const { getByTestId } = render(<BaseToolbarButton onClick={onClickStub}>Button</BaseToolbarButton>);
16
-
17
- await fireEvent.click(getByTestId(BUTTON_ID));
18
-
19
- expect(onClickStub).toHaveBeenCalledOnce();
20
- });
21
-
22
- it('should apply cursor styles', async () => {
23
- const { getByTestId } = render(<BaseToolbarButton cursor="grab">Button</BaseToolbarButton>);
24
-
25
- expect(getByTestId(BUTTON_ID)).toHaveClass('!tw-cursor-grab');
26
- });
27
-
28
- it('should apply active styles', async () => {
29
- const { getByTestId } = render(<BaseToolbarButton forceActiveStyle>Button</BaseToolbarButton>);
30
-
31
- expect(getByTestId(BUTTON_ID)).toHaveClass('tw-text-box-neutral-inverse-pressed');
32
- });
33
-
34
- it('should forward other attributes to button', async () => {
35
- const BUTTON_TYPE = 'base';
36
- const { getByTestId } = render(<BaseToolbarButton data-button-type={BUTTON_TYPE}>Button</BaseToolbarButton>);
37
-
38
- expect(getByTestId(BUTTON_ID).dataset.buttonType).toEqual(BUTTON_TYPE);
39
- });
40
- });
@@ -1,37 +0,0 @@
1
- /* (c) Copyright Frontify Ltd., all rights reserved. */
2
-
3
- import { type HTMLAttributes, type ReactNode, forwardRef } from 'react';
4
- import { getToolbarButtonClassNames } from './helpers';
5
-
6
- type BaseToolbarButtonProps = {
7
- children: ReactNode;
8
- forceActiveStyle?: boolean;
9
- cursor?: 'pointer' | 'grab';
10
- 'data-test-id'?: string;
11
- } & HTMLAttributes<HTMLButtonElement>;
12
-
13
- export const BaseToolbarButton = forwardRef<HTMLButtonElement, BaseToolbarButtonProps>(
14
- (
15
- {
16
- onClick,
17
- children,
18
- forceActiveStyle,
19
- cursor = 'pointer',
20
- 'data-test-id': dataTestId = 'base-toolbar-button',
21
- ...props
22
- },
23
- ref,
24
- ) => (
25
- <button
26
- onClick={onClick}
27
- className={getToolbarButtonClassNames(cursor, forceActiveStyle)}
28
- data-test-id={dataTestId}
29
- {...props}
30
- ref={ref}
31
- >
32
- {children}
33
- </button>
34
- ),
35
- );
36
-
37
- BaseToolbarButton.displayName = 'BaseToolbarButton';
@@ -1,89 +0,0 @@
1
- /* (c) Copyright Frontify Ltd., all rights reserved. */
2
-
3
- import { fireEvent, render, waitFor } from '@testing-library/react';
4
- import { describe, expect, it, vi } from 'vitest';
5
- import { DragHandleToolbarButton } from './DragHandleToolbarButton';
6
- import { IconAdobeCreativeCloud } from '@frontify/fondue';
7
- import { DragPreviewContextProvider } from '../context/DragPreviewContext';
8
-
9
- const TOOLBAR_BUTTON_ID = 'block-item-wrapper-toolbar-btn';
10
- const TOOLTIP_ID = 'toolbar-button-tooltip';
11
-
12
- const TOOLTIP_CONTENT = 'content';
13
-
14
- /**
15
- * @vitest-environment happy-dom
16
- */
17
-
18
- describe('DragHandleToolbarButton', () => {
19
- it('should show tooltip and activeStyles when item is in drag preview context', async () => {
20
- const { getByTestId } = render(
21
- <DragPreviewContextProvider isDragPreview>
22
- <DragHandleToolbarButton
23
- tooltip={TOOLTIP_CONTENT}
24
- icon={<IconAdobeCreativeCloud />}
25
- draggableProps={{}}
26
- />
27
- </DragPreviewContextProvider>,
28
- );
29
-
30
- expect(getByTestId(TOOLTIP_ID)).not.toHaveClass('tw-opacity-0');
31
- expect(getByTestId(TOOLBAR_BUTTON_ID)).toHaveClass('tw-cursor-grabbing');
32
- });
33
-
34
- it('should show tooltip when item is focused', async () => {
35
- const { getByTestId } = render(
36
- <DragHandleToolbarButton tooltip={TOOLTIP_CONTENT} icon={<IconAdobeCreativeCloud />} draggableProps={{}} />,
37
- );
38
-
39
- expect(getByTestId(TOOLTIP_ID)).toHaveClass('tw-opacity-0');
40
- expect(getByTestId(TOOLTIP_ID)).toHaveTextContent(TOOLTIP_CONTENT);
41
-
42
- getByTestId(TOOLBAR_BUTTON_ID).focus();
43
-
44
- await waitFor(() => {
45
- expect(getByTestId(TOOLTIP_ID)).not.toHaveClass('tw-opacity-0');
46
- });
47
- });
48
-
49
- it('should forward draggableProps', async () => {
50
- const onDragStub = vi.fn();
51
-
52
- const { getByTestId } = render(
53
- <DragHandleToolbarButton
54
- tooltip={TOOLTIP_CONTENT}
55
- icon={<IconAdobeCreativeCloud />}
56
- draggableProps={{ onDrag: onDragStub }}
57
- />,
58
- );
59
-
60
- await fireEvent.drag(getByTestId(TOOLBAR_BUTTON_ID));
61
-
62
- expect(onDragStub).toHaveBeenCalledOnce();
63
- });
64
-
65
- it('should forward setActivatorNodeRef', async () => {
66
- const setActivatorNodeRefStub = vi.fn();
67
-
68
- render(
69
- <DragHandleToolbarButton
70
- tooltip={TOOLTIP_CONTENT}
71
- icon={<IconAdobeCreativeCloud />}
72
- draggableProps={{}}
73
- setActivatorNodeRef={setActivatorNodeRefStub}
74
- />,
75
- );
76
-
77
- expect(setActivatorNodeRefStub).toHaveBeenCalledOnce();
78
- });
79
-
80
- it('should display icon', async () => {
81
- const { getByTestId } = render(
82
- <DragHandleToolbarButton tooltip={TOOLTIP_CONTENT} icon={<IconAdobeCreativeCloud />} draggableProps={{}} />,
83
- );
84
-
85
- const icons = [...getByTestId(TOOLBAR_BUTTON_ID).getElementsByTagName('svg')];
86
- expect(icons).toHaveLength(1);
87
- expect(icons[0].outerHTML).toMatch('IconAdobeCreativeCloud');
88
- });
89
- });
@@ -1,40 +0,0 @@
1
- /* (c) Copyright Frontify Ltd., all rights reserved. */
2
-
3
- import { ReactNode } from 'react';
4
- import { DEFAULT_DRAGGING_TOOLTIP, DEFAULT_DRAG_TOOLTIP } from '../../constants';
5
- import { useDragPreviewContext } from '../context/DragPreviewContext';
6
- import { BaseToolbarButton } from '../BaseToolbarButton';
7
- import { ToolbarButtonTooltip } from '../ToolbarButtonTooltip';
8
-
9
- export type DragHandleToolbarButtonProps = {
10
- icon?: ReactNode;
11
- tooltip?: string;
12
- draggableProps: Record<string, unknown>;
13
- setActivatorNodeRef?: (node: HTMLElement | null) => void;
14
- };
15
-
16
- export const DragHandleToolbarButton = ({
17
- tooltip,
18
- icon,
19
- setActivatorNodeRef,
20
- draggableProps,
21
- }: DragHandleToolbarButtonProps) => {
22
- const isDragPreview = useDragPreviewContext();
23
-
24
- return (
25
- <ToolbarButtonTooltip
26
- open={isDragPreview}
27
- content={<div>{isDragPreview ? DEFAULT_DRAGGING_TOOLTIP : tooltip ?? DEFAULT_DRAG_TOOLTIP}</div>}
28
- >
29
- <BaseToolbarButton
30
- ref={setActivatorNodeRef}
31
- data-test-id="block-item-wrapper-toolbar-btn"
32
- forceActiveStyle={isDragPreview}
33
- cursor="grab"
34
- {...draggableProps}
35
- >
36
- {icon}
37
- </BaseToolbarButton>
38
- </ToolbarButtonTooltip>
39
- );
40
- };
@@ -1,3 +0,0 @@
1
- /* (c) Copyright Frontify Ltd., all rights reserved. */
2
-
3
- export * from './DragHandleToolbarButton';
@@ -1,140 +0,0 @@
1
- /* (c) Copyright Frontify Ltd., all rights reserved. */
2
-
3
- import { fireEvent, render, waitFor } from '@testing-library/react';
4
- import { describe, expect, it, vi } from 'vitest';
5
- import { FlyoutToolbarButton } from './FlyoutToolbarButton';
6
- import { MultiFlyoutContextProvider } from '../context/MultiFlyoutContext';
7
- import { IconAdobeCreativeCloud } from '@frontify/fondue';
8
- import { DragPreviewContextProvider } from '../context/DragPreviewContext';
9
-
10
- const BUTTON_ID = 'block-item-wrapper-toolbar-flyout';
11
- const TOOLTIP_ID = 'toolbar-button-tooltip';
12
-
13
- const TEST_FLYOUT_ID = 'test';
14
- const TEST_TOOLTIP = 'tooltip';
15
-
16
- /**
17
- * @vitest-environment happy-dom
18
- */
19
- describe('FlyoutToolbarButton', () => {
20
- it('should log error if not inside a flyout provider when opening', async () => {
21
- vi.spyOn(console, 'error');
22
- const { getByTestId } = render(
23
- <FlyoutToolbarButton
24
- flyoutId={TEST_FLYOUT_ID}
25
- icon={<IconAdobeCreativeCloud />}
26
- tooltip={TEST_TOOLTIP}
27
- content="screen"
28
- />,
29
- );
30
-
31
- await fireEvent.click(getByTestId(BUTTON_ID));
32
-
33
- expect(console.error).toBeCalled();
34
- });
35
-
36
- it('should use flyoutId in flyout context', async () => {
37
- const setOpenFlyoutIdsStub = vi.fn();
38
-
39
- const { getByTestId } = render(
40
- <MultiFlyoutContextProvider openFlyoutIds={[]} setOpenFlyoutIds={setOpenFlyoutIdsStub}>
41
- <FlyoutToolbarButton
42
- flyoutId={TEST_FLYOUT_ID}
43
- icon={<IconAdobeCreativeCloud />}
44
- tooltip={TEST_TOOLTIP}
45
- content="children"
46
- />
47
- </MultiFlyoutContextProvider>,
48
- );
49
-
50
- await fireEvent.click(getByTestId(BUTTON_ID));
51
-
52
- expect(setOpenFlyoutIdsStub).toHaveBeenCalled();
53
- const dispatchedStateResult = setOpenFlyoutIdsStub.mock.lastCall[0]([]);
54
- expect(dispatchedStateResult).toEqual([TEST_FLYOUT_ID]);
55
- });
56
-
57
- it('should display content', async () => {
58
- const setOpenFlyoutIdsStub = vi.fn();
59
-
60
- const { getByTestId } = render(
61
- <MultiFlyoutContextProvider openFlyoutIds={[TEST_FLYOUT_ID]} setOpenFlyoutIds={setOpenFlyoutIdsStub}>
62
- <FlyoutToolbarButton
63
- flyoutId={TEST_FLYOUT_ID}
64
- icon={<IconAdobeCreativeCloud />}
65
- tooltip={TEST_TOOLTIP}
66
- flyoutFooter={<div data-test-id="footer">Footer</div>}
67
- flyoutHeader={<div data-test-id="header">Header</div>}
68
- content={<div data-test-id="content">Content</div>}
69
- />
70
- </MultiFlyoutContextProvider>,
71
- );
72
-
73
- expect(getByTestId('content')).toBeVisible();
74
- expect(getByTestId('header')).toBeVisible();
75
- expect(getByTestId('footer')).toBeVisible();
76
- });
77
-
78
- it('should show tooltip content', async () => {
79
- const setOpenFlyoutIdsStub = vi.fn();
80
-
81
- const { getByTestId } = render(
82
- <MultiFlyoutContextProvider openFlyoutIds={[]} setOpenFlyoutIds={setOpenFlyoutIdsStub}>
83
- <FlyoutToolbarButton
84
- flyoutId={TEST_FLYOUT_ID}
85
- icon={<IconAdobeCreativeCloud />}
86
- tooltip={TEST_TOOLTIP}
87
- content="children"
88
- />
89
- </MultiFlyoutContextProvider>,
90
- );
91
-
92
- getByTestId(BUTTON_ID).focus();
93
-
94
- await waitFor(() => expect(getByTestId(TOOLTIP_ID)).not.toHaveClass('tw-opacity-0'));
95
- expect(getByTestId(TOOLTIP_ID)).toHaveTextContent(TEST_TOOLTIP);
96
- });
97
-
98
- it('should use supplied icon', async () => {
99
- const setOpenFlyoutIdsStub = vi.fn();
100
-
101
- const { getByTestId } = render(
102
- <MultiFlyoutContextProvider openFlyoutIds={[]} setOpenFlyoutIds={setOpenFlyoutIdsStub}>
103
- <FlyoutToolbarButton
104
- flyoutId={TEST_FLYOUT_ID}
105
- icon={<IconAdobeCreativeCloud />}
106
- tooltip={TEST_TOOLTIP}
107
- content="content"
108
- />
109
- </MultiFlyoutContextProvider>,
110
- );
111
-
112
- const icons = [...getByTestId(BUTTON_ID).getElementsByTagName('svg')];
113
- expect(icons).toHaveLength(1);
114
- expect(icons[0].outerHTML).toMatch('IconAdobeCreativeCloud');
115
- });
116
-
117
- it('should disable tooltip and flyout when content is inside drag preview', async () => {
118
- const { getByTestId, queryByTestId } = render(
119
- <MultiFlyoutContextProvider openFlyoutIds={[TEST_FLYOUT_ID]} setOpenFlyoutIds={vi.fn()}>
120
- <DragPreviewContextProvider isDragPreview>
121
- <FlyoutToolbarButton
122
- flyoutId={TEST_FLYOUT_ID}
123
- icon={<IconAdobeCreativeCloud />}
124
- tooltip={TEST_TOOLTIP}
125
- content={<div data-test-id="content">Content</div>}
126
- />
127
- </DragPreviewContextProvider>
128
- </MultiFlyoutContextProvider>,
129
- );
130
-
131
- expect(getByTestId(TOOLTIP_ID)).toHaveClass('tw-opacity-0');
132
-
133
- getByTestId(TOOLTIP_ID).focus();
134
-
135
- await waitFor(() => {
136
- expect(getByTestId(TOOLTIP_ID)).toHaveClass('tw-opacity-0');
137
- expect(queryByTestId('content')).toBeNull();
138
- });
139
- });
140
- });
@@ -1,61 +0,0 @@
1
- /* (c) Copyright Frontify Ltd., all rights reserved. */
2
-
3
- import { type MutableRefObject, type ReactNode } from 'react';
4
- import { useDragPreviewContext } from '../context/DragPreviewContext';
5
- import { ToolbarButtonTooltip } from '../ToolbarButtonTooltip';
6
- import { Flyout, FlyoutPlacement, useMemoizedId } from '@frontify/fondue';
7
- import { BaseToolbarButton } from '../BaseToolbarButton';
8
- import { useMultiFlyoutState } from '../hooks/useMultiFlyoutState';
9
-
10
- export type FlyoutToolbarButtonProps = {
11
- content: ReactNode;
12
- icon: ReactNode;
13
- tooltip: ReactNode;
14
- flyoutId: string;
15
- flyoutFooter?: ReactNode;
16
- flyoutHeader?: ReactNode;
17
- };
18
-
19
- export const FlyoutToolbarButton = ({
20
- content,
21
- icon,
22
- tooltip,
23
- flyoutId,
24
- flyoutFooter,
25
- flyoutHeader,
26
- }: FlyoutToolbarButtonProps) => {
27
- const id = useMemoizedId(flyoutId);
28
-
29
- const { isOpen, onOpenChange } = useMultiFlyoutState(id);
30
-
31
- const isDragPreview = useDragPreviewContext();
32
-
33
- return (
34
- <ToolbarButtonTooltip disabled={isDragPreview || isOpen} content={tooltip}>
35
- <div className="tw-flex tw-flex-shrink-0 tw-flex-1 tw-h-6 tw-relative">
36
- <Flyout
37
- isOpen={isOpen && !isDragPreview}
38
- legacyFooter={false}
39
- fixedFooter={flyoutFooter}
40
- fixedHeader={flyoutHeader}
41
- fitContent
42
- hug={false}
43
- placement={FlyoutPlacement.BottomRight}
44
- onOpenChange={onOpenChange}
45
- trigger={(triggerProps, triggerRef) => (
46
- <BaseToolbarButton
47
- data-test-id="block-item-wrapper-toolbar-flyout"
48
- forceActiveStyle={isOpen && !isDragPreview}
49
- {...triggerProps}
50
- ref={triggerRef as MutableRefObject<HTMLButtonElement>}
51
- >
52
- {icon}
53
- </BaseToolbarButton>
54
- )}
55
- >
56
- {content}
57
- </Flyout>
58
- </div>
59
- </ToolbarButtonTooltip>
60
- );
61
- };
@@ -1,3 +0,0 @@
1
- /* (c) Copyright Frontify Ltd., all rights reserved. */
2
-
3
- export * from './FlyoutToolbarButton';