@frontify/guideline-blocks-settings 0.33.3 → 0.33.5

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 (508) 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 +78 -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 +54 -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 +17 -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 +30 -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 +16 -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 +43 -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/FloatingButton.es.js +25 -0
  88. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.es.js.map +1 -0
  89. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js +20 -0
  90. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js.map +1 -0
  91. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js +26 -0
  92. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js.map +1 -0
  93. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +69 -0
  94. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js.map +1 -0
  95. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +105 -0
  96. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -0
  97. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js +20 -0
  98. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js.map +1 -0
  99. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js +32 -0
  100. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js.map +1 -0
  101. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +58 -0
  102. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js.map +1 -0
  103. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js +19 -0
  104. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js.map +1 -0
  105. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js +26 -0
  106. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js.map +1 -0
  107. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js +43 -0
  108. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js.map +1 -0
  109. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js +18 -0
  110. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js.map +1 -0
  111. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js +68 -0
  112. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -0
  113. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js +13 -0
  114. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +1 -0
  115. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js +25 -0
  116. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js.map +1 -0
  117. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js +35 -0
  118. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -0
  119. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js +86 -0
  120. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -0
  121. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js +24 -0
  122. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -0
  123. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js +19 -0
  124. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +1 -0
  125. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js +13 -0
  126. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +1 -0
  127. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js +11 -0
  128. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js.map +1 -0
  129. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js +10 -0
  130. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js.map +1 -0
  131. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js +81 -0
  132. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js.map +1 -0
  133. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js +18 -0
  134. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +1 -0
  135. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js +17 -0
  136. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js.map +1 -0
  137. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js +14 -0
  138. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +1 -0
  139. package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js +53 -0
  140. package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -0
  141. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +19 -0
  142. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -0
  143. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +43 -0
  144. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -0
  145. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js +53 -0
  146. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js.map +1 -0
  147. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.es.js +29 -0
  148. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.es.js.map +1 -0
  149. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +8 -0
  150. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js.map +1 -0
  151. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +66 -0
  152. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -0
  153. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js +40 -0
  154. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js.map +1 -0
  155. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +93 -0
  156. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -0
  157. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +25 -0
  158. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -0
  159. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +27 -0
  160. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -0
  161. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js +12 -0
  162. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js.map +1 -0
  163. package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js +5 -0
  164. package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js.map +1 -0
  165. package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +45 -0
  166. package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -0
  167. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +51 -0
  168. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -0
  169. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +51 -0
  170. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -0
  171. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +51 -0
  172. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -0
  173. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +52 -0
  174. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -0
  175. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +52 -0
  176. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -0
  177. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +52 -0
  178. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -0
  179. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +52 -0
  180. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -0
  181. package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js +40 -0
  182. package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js.map +1 -0
  183. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +52 -0
  184. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -0
  185. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +52 -0
  186. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -0
  187. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +46 -0
  188. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -0
  189. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +54 -0
  190. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -0
  191. package/dist/components/RichTextEditor/plugins/styles.es.js +167 -0
  192. package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -0
  193. package/dist/helpers/addHttps.es.js +14 -0
  194. package/dist/helpers/addHttps.es.js.map +1 -0
  195. package/dist/helpers/convertToRichTextValue.es.js +6 -0
  196. package/dist/helpers/convertToRichTextValue.es.js.map +1 -0
  197. package/dist/helpers/customCoordinatesGetterFactory.es.js +32 -0
  198. package/dist/helpers/customCoordinatesGetterFactory.es.js.map +1 -0
  199. package/dist/helpers/hasRichTextValue.es.js +15 -0
  200. package/dist/helpers/hasRichTextValue.es.js.map +1 -0
  201. package/dist/helpers/isDownloadable.es.js +6 -0
  202. package/dist/helpers/isDownloadable.es.js.map +1 -0
  203. package/dist/helpers/mapColorPalettes.es.js +28 -0
  204. package/dist/helpers/mapColorPalettes.es.js.map +1 -0
  205. package/dist/hooks/useAttachments.es.js +53 -0
  206. package/dist/hooks/useAttachments.es.js.map +1 -0
  207. package/dist/hooks/useDndSensors.es.js +20 -0
  208. package/dist/hooks/useDndSensors.es.js.map +1 -0
  209. package/dist/index.cjs.js +4 -0
  210. package/dist/index.cjs.js.map +1 -0
  211. package/dist/index.d.ts +1193 -0
  212. package/dist/index.es.js +217 -0
  213. package/dist/index.es.js.map +1 -0
  214. package/dist/index.umd.js +4 -0
  215. package/dist/index.umd.js.map +1 -0
  216. package/dist/settings/background.es.js +22 -0
  217. package/dist/settings/background.es.js.map +1 -0
  218. package/dist/settings/border.es.js +61 -0
  219. package/dist/settings/border.es.js.map +1 -0
  220. package/dist/settings/borderRadius.es.js +56 -0
  221. package/dist/settings/borderRadius.es.js.map +1 -0
  222. package/dist/settings/borderRadiusExtended.es.js +64 -0
  223. package/dist/settings/borderRadiusExtended.es.js.map +1 -0
  224. package/dist/settings/defaultValues.es.js +19 -0
  225. package/dist/settings/defaultValues.es.js.map +1 -0
  226. package/dist/settings/gutter.es.js +56 -0
  227. package/dist/settings/gutter.es.js.map +1 -0
  228. package/dist/settings/margin.es.js +53 -0
  229. package/dist/settings/margin.es.js.map +1 -0
  230. package/dist/settings/marginExtended.es.js +65 -0
  231. package/dist/settings/marginExtended.es.js.map +1 -0
  232. package/dist/settings/padding.es.js +53 -0
  233. package/dist/settings/padding.es.js.map +1 -0
  234. package/dist/settings/paddingExtended.es.js +65 -0
  235. package/dist/settings/paddingExtended.es.js.map +1 -0
  236. package/dist/settings/securityDownloadable.es.js +19 -0
  237. package/dist/settings/securityDownloadable.es.js.map +1 -0
  238. package/dist/settings/securityGlobalControl.es.js +33 -0
  239. package/dist/settings/securityGlobalControl.es.js.map +1 -0
  240. package/dist/settings/types.es.js +48 -0
  241. package/dist/settings/types.es.js.map +1 -0
  242. package/dist/styles.css +1 -0
  243. package/dist/styles.css.es.js +2 -0
  244. package/dist/styles.css.es.js.map +1 -0
  245. package/dist/utilities/color/getReadableColor.es.js +14 -0
  246. package/dist/utilities/color/getReadableColor.es.js.map +1 -0
  247. package/dist/utilities/color/isDark.es.js +10 -0
  248. package/dist/utilities/color/isDark.es.js.map +1 -0
  249. package/dist/utilities/color/setAlpha.es.js +6 -0
  250. package/dist/utilities/color/setAlpha.es.js.map +1 -0
  251. package/dist/utilities/color/toColorObject.es.js +9 -0
  252. package/dist/utilities/color/toColorObject.es.js.map +1 -0
  253. package/dist/utilities/color/toHex8String.es.js +7 -0
  254. package/dist/utilities/color/toHex8String.es.js.map +1 -0
  255. package/dist/utilities/color/toHexString.es.js +7 -0
  256. package/dist/utilities/color/toHexString.es.js.map +1 -0
  257. package/dist/utilities/color/toRgbaString.es.js +7 -0
  258. package/dist/utilities/color/toRgbaString.es.js.map +1 -0
  259. package/dist/utilities/color/toShortRgba.es.js +11 -0
  260. package/dist/utilities/color/toShortRgba.es.js.map +1 -0
  261. package/dist/utilities/moveItemInArray.es.js +12 -0
  262. package/dist/utilities/moveItemInArray.es.js.map +1 -0
  263. package/dist/utilities/react/getBackgroundColorStyles.es.js +8 -0
  264. package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -0
  265. package/dist/utilities/react/getBorderStyles.es.js +12 -0
  266. package/dist/utilities/react/getBorderStyles.es.js.map +1 -0
  267. package/dist/utilities/react/getRadiusStyles.es.js +8 -0
  268. package/dist/utilities/react/getRadiusStyles.es.js.map +1 -0
  269. package/dist/utilities/react/joinClassNames.es.js +5 -0
  270. package/dist/utilities/react/joinClassNames.es.js.map +1 -0
  271. package/package.json +8 -2
  272. package/.eslintrc.cjs +0 -27
  273. package/.prettierrc +0 -7
  274. package/CHANGELOG.md +0 -778
  275. package/postcss.config.cjs +0 -8
  276. package/setupTests.ts +0 -23
  277. package/src/components/Attachments/AttachmentItem.tsx +0 -247
  278. package/src/components/Attachments/Attachments.spec.ct.tsx +0 -165
  279. package/src/components/Attachments/Attachments.tsx +0 -241
  280. package/src/components/Attachments/AttachmentsButtonTrigger.tsx +0 -30
  281. package/src/components/Attachments/index.ts +0 -4
  282. package/src/components/Attachments/types.ts +0 -40
  283. package/src/components/BlockInjectButton/BlockInjectButton.spec.ct.tsx +0 -48
  284. package/src/components/BlockInjectButton/BlockInjectButton.tsx +0 -212
  285. package/src/components/BlockInjectButton/index.ts +0 -4
  286. package/src/components/BlockInjectButton/types.ts +0 -18
  287. package/src/components/BlockItemWrapper/BlockItemWrapper.spec.ct.tsx +0 -145
  288. package/src/components/BlockItemWrapper/BlockItemWrapper.tsx +0 -76
  289. package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.spec.tsx +0 -96
  290. package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.tsx +0 -42
  291. package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.spec.tsx +0 -44
  292. package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.tsx +0 -24
  293. package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/index.ts +0 -3
  294. package/src/components/BlockItemWrapper/Toolbar/BaseToolbarButton.spec.tsx +0 -40
  295. package/src/components/BlockItemWrapper/Toolbar/BaseToolbarButton.tsx +0 -37
  296. package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.spec.tsx +0 -89
  297. package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.tsx +0 -40
  298. package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/index.ts +0 -3
  299. package/src/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.spec.tsx +0 -140
  300. package/src/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.tsx +0 -61
  301. package/src/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/index.ts +0 -3
  302. package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.spec.tsx +0 -77
  303. package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.tsx +0 -30
  304. package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.spec.tsx +0 -63
  305. package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.tsx +0 -40
  306. package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/index.ts +0 -4
  307. package/src/components/BlockItemWrapper/Toolbar/Toolbar.spec.tsx +0 -259
  308. package/src/components/BlockItemWrapper/Toolbar/Toolbar.tsx +0 -36
  309. package/src/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.spec.tsx +0 -70
  310. package/src/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.tsx +0 -19
  311. package/src/components/BlockItemWrapper/Toolbar/ToolbarButton/index.ts +0 -3
  312. package/src/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.tsx +0 -25
  313. package/src/components/BlockItemWrapper/Toolbar/ToolbarSegment.tsx +0 -9
  314. package/src/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.tsx +0 -15
  315. package/src/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.tsx +0 -25
  316. package/src/components/BlockItemWrapper/Toolbar/context/index.ts +0 -4
  317. package/src/components/BlockItemWrapper/Toolbar/helpers.ts +0 -33
  318. package/src/components/BlockItemWrapper/Toolbar/hooks/index.ts +0 -3
  319. package/src/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.spec.tsx +0 -59
  320. package/src/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.ts +0 -24
  321. package/src/components/BlockItemWrapper/Toolbar/index.ts +0 -10
  322. package/src/components/BlockItemWrapper/Toolbar/types.ts +0 -18
  323. package/src/components/BlockItemWrapper/constants.ts +0 -4
  324. package/src/components/BlockItemWrapper/index.ts +0 -6
  325. package/src/components/BlockItemWrapper/types.ts +0 -24
  326. package/src/components/DownloadButton/DownloadButton.spec.ct.tsx +0 -20
  327. package/src/components/DownloadButton/DownloadButton.tsx +0 -36
  328. package/src/components/DownloadButton/index.ts +0 -3
  329. package/src/components/DownloadButton/types.ts +0 -5
  330. package/src/components/Link/LinkInput.spec.ct.tsx +0 -142
  331. package/src/components/Link/LinkInput.tsx +0 -86
  332. package/src/components/Link/LinkSelector/DocumentLink.tsx +0 -81
  333. package/src/components/Link/LinkSelector/DocumentLinks.tsx +0 -102
  334. package/src/components/Link/LinkSelector/LinkSelector.spec.ct.tsx +0 -196
  335. package/src/components/Link/LinkSelector/LinkSelector.tsx +0 -96
  336. package/src/components/Link/LinkSelector/LoadingIndicator.tsx +0 -11
  337. package/src/components/Link/LinkSelector/PageLink.tsx +0 -96
  338. package/src/components/Link/LinkSelector/PageLinks.tsx +0 -71
  339. package/src/components/Link/LinkSelector/SectionLink.tsx +0 -36
  340. package/src/components/Link/LinkSelector/index.ts +0 -3
  341. package/src/components/Link/index.ts +0 -6
  342. package/src/components/Link/types.ts +0 -6
  343. package/src/components/Link/utils/getUrl.ts +0 -30
  344. package/src/components/Link/utils/index.ts +0 -5
  345. package/src/components/Link/utils/relativeUrlRegex.spec.ts +0 -32
  346. package/src/components/Link/utils/relativeUrlRegex.ts +0 -3
  347. package/src/components/Link/utils/url.spec.ts +0 -75
  348. package/src/components/Link/utils/url.ts +0 -21
  349. package/src/components/RichTextEditor/RichTextEditor.spec.ct.tsx +0 -231
  350. package/src/components/RichTextEditor/RichTextEditor.tsx +0 -62
  351. package/src/components/RichTextEditor/SerializedText.tsx +0 -29
  352. package/src/components/RichTextEditor/constants.ts +0 -3
  353. package/src/components/RichTextEditor/index.ts +0 -6
  354. package/src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx +0 -55
  355. package/src/components/RichTextEditor/pluginPresets/index.ts +0 -3
  356. package/src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.tsx +0 -74
  357. package/src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.ts +0 -11
  358. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.tsx +0 -20
  359. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx +0 -56
  360. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.tsx +0 -19
  361. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.tsx +0 -42
  362. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.tsx +0 -37
  363. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.tsx +0 -22
  364. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.tsx +0 -30
  365. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.tsx +0 -81
  366. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/types.ts +0 -13
  367. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts +0 -143
  368. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.tsx +0 -31
  369. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.ts +0 -46
  370. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/index.ts +0 -12
  371. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.ts +0 -113
  372. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.ts +0 -21
  373. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.ts +0 -30
  374. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.ts +0 -71
  375. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.ts +0 -22
  376. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/index.ts +0 -3
  377. package/src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts +0 -118
  378. package/src/components/RichTextEditor/plugins/ButtonPlugin/index.ts +0 -7
  379. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/index.ts +0 -8
  380. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.ts +0 -17
  381. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.ts +0 -40
  382. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.ts +0 -68
  383. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.ts +0 -198
  384. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.ts +0 -40
  385. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.ts +0 -30
  386. package/src/components/RichTextEditor/plugins/ButtonPlugin/types.ts +0 -13
  387. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.ts +0 -28
  388. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.ts +0 -14
  389. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.ts +0 -18
  390. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/index.ts +0 -8
  391. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.ts +0 -83
  392. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts +0 -23
  393. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.ts +0 -30
  394. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts +0 -45
  395. package/src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts +0 -106
  396. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.tsx +0 -26
  397. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.tsx +0 -43
  398. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/index.ts +0 -4
  399. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts +0 -113
  400. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.tsx +0 -45
  401. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.tsx +0 -5
  402. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx +0 -88
  403. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/index.ts +0 -4
  404. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/types.ts +0 -11
  405. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.ts +0 -73
  406. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts +0 -136
  407. package/src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx +0 -38
  408. package/src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx +0 -36
  409. package/src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.ts +0 -11
  410. package/src/components/RichTextEditor/plugins/LinkPlugin/id.ts +0 -3
  411. package/src/components/RichTextEditor/plugins/LinkPlugin/index.ts +0 -49
  412. package/src/components/RichTextEditor/plugins/LinkPlugin/types.ts +0 -12
  413. package/src/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.tsx +0 -62
  414. package/src/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.tsx +0 -62
  415. package/src/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.tsx +0 -63
  416. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.tsx +0 -62
  417. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.tsx +0 -62
  418. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.tsx +0 -62
  419. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.tsx +0 -63
  420. package/src/components/RichTextEditor/plugins/TextStylePlugins/helpers.tsx +0 -44
  421. package/src/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.tsx +0 -62
  422. package/src/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.tsx +0 -62
  423. package/src/components/RichTextEditor/plugins/TextStylePlugins/index.ts +0 -15
  424. package/src/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.tsx +0 -58
  425. package/src/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.tsx +0 -63
  426. package/src/components/RichTextEditor/plugins/index.ts +0 -6
  427. package/src/components/RichTextEditor/plugins/styles.ts +0 -178
  428. package/src/components/RichTextEditor/types.ts +0 -23
  429. package/src/components/index.ts +0 -8
  430. package/src/helpers/addHttps.spec.ts +0 -42
  431. package/src/helpers/addHttps.ts +0 -15
  432. package/src/helpers/convertToRichTextValue.spec.ts +0 -32
  433. package/src/helpers/convertToRichTextValue.ts +0 -6
  434. package/src/helpers/customCoordinatesGetterFactory.spec.ts +0 -69
  435. package/src/helpers/customCoordinatesGetterFactory.ts +0 -39
  436. package/src/helpers/hasRichTextValue.spec.ts +0 -63
  437. package/src/helpers/hasRichTextValue.ts +0 -29
  438. package/src/helpers/index.ts +0 -8
  439. package/src/helpers/isDownloadable.spec.ts +0 -47
  440. package/src/helpers/isDownloadable.ts +0 -7
  441. package/src/helpers/mapColorPalettes.spec.ts +0 -47
  442. package/src/helpers/mapColorPalettes.ts +0 -65
  443. package/src/hooks/index.ts +0 -4
  444. package/src/hooks/useAttachments.spec.tsx +0 -127
  445. package/src/hooks/useAttachments.tsx +0 -90
  446. package/src/hooks/useDndSensors.spec.ts +0 -40
  447. package/src/hooks/useDndSensors.ts +0 -23
  448. package/src/index.ts +0 -138
  449. package/src/settings/background.spec.ts +0 -173
  450. package/src/settings/background.ts +0 -52
  451. package/src/settings/border.spec.ts +0 -76
  452. package/src/settings/border.ts +0 -90
  453. package/src/settings/borderRadius.spec.ts +0 -30
  454. package/src/settings/borderRadius.ts +0 -73
  455. package/src/settings/borderRadiusExtended.spec.ts +0 -52
  456. package/src/settings/borderRadiusExtended.ts +0 -84
  457. package/src/settings/defaultValues.ts +0 -21
  458. package/src/settings/gutter.spec.ts +0 -60
  459. package/src/settings/gutter.ts +0 -75
  460. package/src/settings/index.ts +0 -14
  461. package/src/settings/margin.spec.ts +0 -42
  462. package/src/settings/margin.ts +0 -72
  463. package/src/settings/marginExtended.spec.ts +0 -45
  464. package/src/settings/marginExtended.ts +0 -91
  465. package/src/settings/padding.spec.ts +0 -42
  466. package/src/settings/padding.ts +0 -73
  467. package/src/settings/paddingExtended.spec.ts +0 -45
  468. package/src/settings/paddingExtended.ts +0 -91
  469. package/src/settings/security.spec.ts +0 -87
  470. package/src/settings/security.ts +0 -61
  471. package/src/settings/securityDownloadable.spec.ts +0 -46
  472. package/src/settings/securityDownloadable.ts +0 -33
  473. package/src/settings/securityGlobalControl.ts +0 -42
  474. package/src/settings/types.ts +0 -128
  475. package/src/styles.css +0 -3
  476. package/src/utilities/color/getReadableColor.spec.ts +0 -32
  477. package/src/utilities/color/getReadableColor.ts +0 -34
  478. package/src/utilities/color/index.ts +0 -10
  479. package/src/utilities/color/isDark.spec.ts +0 -33
  480. package/src/utilities/color/isDark.ts +0 -29
  481. package/src/utilities/color/setAlpha.spec.ts +0 -28
  482. package/src/utilities/color/setAlpha.ts +0 -14
  483. package/src/utilities/color/toColorObject.spec.ts +0 -19
  484. package/src/utilities/color/toColorObject.ts +0 -16
  485. package/src/utilities/color/toHex8String.spec.ts +0 -17
  486. package/src/utilities/color/toHex8String.ts +0 -14
  487. package/src/utilities/color/toHexString.spec.ts +0 -17
  488. package/src/utilities/color/toHexString.ts +0 -10
  489. package/src/utilities/color/toRgbaString.spec.ts +0 -12
  490. package/src/utilities/color/toRgbaString.ts +0 -14
  491. package/src/utilities/color/toShortRgba.spec.ts +0 -16
  492. package/src/utilities/color/toShortRgba.ts +0 -35
  493. package/src/utilities/index.ts +0 -5
  494. package/src/utilities/moveItemInArray.spec.ts +0 -17
  495. package/src/utilities/moveItemInArray.ts +0 -21
  496. package/src/utilities/react/getBackgroundColorStyles.spec.ts +0 -18
  497. package/src/utilities/react/getBackgroundColorStyles.ts +0 -10
  498. package/src/utilities/react/getBorderStyles.spec.ts +0 -39
  499. package/src/utilities/react/getBorderStyles.ts +0 -20
  500. package/src/utilities/react/getRadiusStyles.spec.ts +0 -25
  501. package/src/utilities/react/getRadiusStyles.ts +0 -8
  502. package/src/utilities/react/index.ts +0 -6
  503. package/src/utilities/react/joinClassNames.spec.ts +0 -18
  504. package/src/utilities/react/joinClassNames.ts +0 -10
  505. package/tailwind.config.ts +0 -27
  506. package/tsconfig.json +0 -24
  507. package/tsconfig.node.json +0 -12
  508. package/vite.config.ts +0 -71
@@ -0,0 +1,13 @@
1
+ import { getPluginType as i } from "@udecode/plate";
2
+ import { ELEMENT_BUTTON as m } from "../createButtonPlugin.es.js";
3
+ const u = (t, { url: r, text: e = "", buttonStyle: o = "primary", target: p, children: n }) => ({
4
+ type: i(t, m),
5
+ url: r,
6
+ target: p,
7
+ buttonStyle: o,
8
+ children: n ?? [{ text: e }]
9
+ });
10
+ export {
11
+ u as createButtonNode
12
+ };
13
+ //# sourceMappingURL=createButtonNode.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createButtonNode.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, TText, Value, getPluginType } from '@udecode/plate';\nimport { RichTextButtonStyle, TButtonElement } from '..';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\nexport interface CreateButtonNodeOptions {\n url: string;\n text?: string;\n buttonStyle?: RichTextButtonStyle;\n target?: string;\n children?: TText[];\n}\n\nexport const createButtonNode = <V extends Value>(\n editor: PlateEditor<V>,\n { url, text = '', buttonStyle = 'primary', target, children }: CreateButtonNodeOptions,\n): TButtonElement => {\n const type = getPluginType(editor, ELEMENT_BUTTON);\n\n return {\n type,\n url,\n target,\n buttonStyle,\n children: children ?? [{ text }],\n };\n};\n"],"names":["createButtonNode","editor","url","text","buttonStyle","target","children","getPluginType","ELEMENT_BUTTON"],"mappings":";;AAca,MAAAA,IAAmB,CAC5BC,GACA,EAAE,KAAAC,GAAK,MAAAC,IAAO,IAAI,aAAAC,IAAc,WAAW,QAAAC,GAAQ,UAAAC,SAI5C;AAAA,EACH,MAHSC,EAAcN,GAAQO,CAAc;AAAA,EAI7C,KAAAN;AAAA,EACA,QAAAG;AAAA,EACA,aAAAD;AAAA,EACA,UAAUE,KAAY,CAAC,EAAE,MAAAH,GAAM;AAAA;"}
@@ -0,0 +1,11 @@
1
+ import { getAboveNode as e } from "@udecode/plate";
2
+ import { ELEMENT_BUTTON as i } from "../createButtonPlugin.es.js";
3
+ const y = (o) => {
4
+ var t;
5
+ const r = e(o, { match: { type: i } });
6
+ return Array.isArray(r) && ((t = r[0]) == null ? void 0 : t.buttonStyle) || "primary";
7
+ };
8
+ export {
9
+ y as getButtonStyle
10
+ };
11
+ //# sourceMappingURL=getButtonStyle.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getButtonStyle.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, getAboveNode } from '@udecode/plate';\nimport { ELEMENT_BUTTON, RichTextButtonStyle, TButtonElement } from '..';\n\nexport const getButtonStyle = (editor: PlateEditor): RichTextButtonStyle => {\n const linkNode = getAboveNode<TButtonElement>(editor, { match: { type: ELEMENT_BUTTON } });\n\n if (!Array.isArray(linkNode)) {\n return 'primary';\n }\n\n return (linkNode[0]?.buttonStyle as RichTextButtonStyle) || 'primary';\n};\n"],"names":["getButtonStyle","editor","linkNode","getAboveNode","ELEMENT_BUTTON","_a"],"mappings":";;AAKa,MAAAA,IAAiB,CAACC,MAA6C;;AAClE,QAAAC,IAAWC,EAA6BF,GAAQ,EAAE,OAAO,EAAE,MAAMG,EAAe,EAAA,CAAG;AAEzF,SAAK,MAAM,QAAQF,CAAQ,OAInBG,IAAAH,EAAS,CAAC,MAAV,gBAAAG,EAAa,gBAAuC;AAChE;"}
@@ -0,0 +1,10 @@
1
+ import { getAboveNode as e } from "@udecode/plate";
2
+ import { ELEMENT_BUTTON as n } from "../createButtonPlugin.es.js";
3
+ const i = (r, t) => {
4
+ const o = e(r, { match: { type: n } });
5
+ return Array.isArray(o) ? t(o[0]) : "";
6
+ }, c = (r) => i(r, (t) => t.url ?? "");
7
+ export {
8
+ c as getUrlFromEditor
9
+ };
10
+ //# sourceMappingURL=getUrl.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUrl.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, getAboveNode } from '@udecode/plate';\nimport { ELEMENT_BUTTON, TButtonElement } from '..';\n\nconst getLinkNode = (editor: PlateEditor, cb: (link: TButtonElement) => string): string => {\n const linkNode = getAboveNode<TButtonElement>(editor, { match: { type: ELEMENT_BUTTON } });\n\n if (!Array.isArray(linkNode)) {\n return '';\n }\n\n return cb(linkNode[0]);\n};\n\nexport const getUrlFromEditor = (editor: PlateEditor) => {\n return getLinkNode(editor, (link) => link.url ?? '');\n};\n"],"names":["getLinkNode","editor","cb","linkNode","getAboveNode","ELEMENT_BUTTON","getUrlFromEditor","link"],"mappings":";;AAKA,MAAMA,IAAc,CAACC,GAAqBC,MAAiD;AACjF,QAAAC,IAAWC,EAA6BH,GAAQ,EAAE,OAAO,EAAE,MAAMI,EAAe,EAAA,CAAG;AAEzF,SAAK,MAAM,QAAQF,CAAQ,IAIpBD,EAAGC,EAAS,CAAC,CAAC,IAHV;AAIf,GAEaG,IAAmB,CAACL,MACtBD,EAAYC,GAAQ,CAACM,MAASA,EAAK,OAAO,EAAE;"}
@@ -0,0 +1,81 @@
1
+ const t = {
2
+ buttonPrimary: {
3
+ fontFamily: "var(--f-theme-settings-button-primary-font-family)",
4
+ fontSize: "var(--f-theme-settings-button-primary-font-size)",
5
+ fontWeight: "var(--f-theme-settings-button-primary-font-weight)",
6
+ lineHeight: "var(--f-theme-settings-button-primary-line-height)",
7
+ paddingTop: "var(--f-theme-settings-button-primary-padding-top)",
8
+ paddingRight: "var(--f-theme-settings-button-primary-padding-right)",
9
+ paddingBottom: "var(--f-theme-settings-button-primary-padding-bottom)",
10
+ paddingLeft: "var(--f-theme-settings-button-primary-padding-left)",
11
+ fontStyle: "var(--f-theme-settings-button-primary-font-style)",
12
+ textTransform: "var(--f-theme-settings-button-primary-text-transform)",
13
+ backgroundColor: "var(--f-theme-settings-button-primary-background-color)",
14
+ borderColor: "var(--f-theme-settings-button-primary-border-color)",
15
+ borderRadius: "var(--f-theme-settings-button-primary-border-radius)",
16
+ borderWidth: "var(--f-theme-settings-button-primary-border-width)",
17
+ color: "var(--f-theme-settings-button-primary-color)",
18
+ marginTop: "10px",
19
+ marginBottom: "10px",
20
+ display: "inline-block",
21
+ hover: {
22
+ backgroundColor: "var(--f-theme-settings-button-primary-background-color-hover)",
23
+ borderColor: "var(--f-theme-settings-button-primary-border-color-hover)",
24
+ color: "var(--f-theme-settings-button-primary-color-hover)"
25
+ }
26
+ },
27
+ buttonSecondary: {
28
+ fontFamily: "var(--f-theme-settings-button-secondary-font-family)",
29
+ fontSize: "var(--f-theme-settings-button-secondary-font-size)",
30
+ fontWeight: "var(--f-theme-settings-button-secondary-font-weight)",
31
+ lineHeight: "var(--f-theme-settings-button-secondary-line-height)",
32
+ paddingTop: "var(--f-theme-settings-button-secondary-padding-top)",
33
+ paddingRight: "var(--f-theme-settings-button-secondary-padding-right)",
34
+ paddingBottom: "var(--f-theme-settings-button-secondary-padding-bottom)",
35
+ paddingLeft: "var(--f-theme-settings-button-secondary-padding-left)",
36
+ fontStyle: "var(--f-theme-settings-button-secondary-font-style)",
37
+ textTransform: "var(--f-theme-settings-button-secondary-text-transform)",
38
+ backgroundColor: "var(--f-theme-settings-button-secondary-background-color)",
39
+ borderColor: "var(--f-theme-settings-button-secondary-border-color)",
40
+ borderRadius: "var(--f-theme-settings-button-secondary-border-radius)",
41
+ borderWidth: "var(--f-theme-settings-button-secondary-border-width)",
42
+ color: "var(--f-theme-settings-button-secondary-color)",
43
+ display: "inline-block",
44
+ marginTop: "10px",
45
+ marginBottom: "10px",
46
+ hover: {
47
+ backgroundColor: "var(--f-theme-settings-button-secondary-background-color-hover)",
48
+ borderColor: "var(--f-theme-settings-button-secondary-border-color-hover)",
49
+ color: "var(--f-theme-settings-button-secondary-color-hover)"
50
+ }
51
+ },
52
+ buttonTertiary: {
53
+ fontFamily: "var(--f-theme-settings-button-tertiary-font-family)",
54
+ fontSize: "var(--f-theme-settings-button-tertiary-font-size)",
55
+ fontWeight: "var(--f-theme-settings-button-tertiary-font-weight)",
56
+ lineHeight: "var(--f-theme-settings-button-tertiary-line-height)",
57
+ paddingTop: "var(--f-theme-settings-button-tertiary-padding-top)",
58
+ paddingRight: "var(--f-theme-settings-button-tertiary-padding-right)",
59
+ paddingBottom: "var(--f-theme-settings-button-tertiary-padding-bottom)",
60
+ paddingLeft: "var(--f-theme-settings-button-tertiary-padding-left)",
61
+ fontStyle: "var(--f-theme-settings-button-tertiary-font-style)",
62
+ textTransform: "var(--f-theme-settings-button-tertiary-text-transform)",
63
+ backgroundColor: "var(--f-theme-settings-button-tertiary-background-color)",
64
+ borderColor: "var(--f-theme-settings-button-tertiary-border-color)",
65
+ borderRadius: "var(--f-theme-settings-button-tertiary-border-radius)",
66
+ borderWidth: "var(--f-theme-settings-button-tertiary-border-width)",
67
+ color: "var(--f-theme-settings-button-tertiary-color)",
68
+ display: "inline-block",
69
+ marginTop: "10px",
70
+ marginBottom: "10px",
71
+ hover: {
72
+ backgroundColor: "var(--f-theme-settings-button-tertiary-background-color-hover)",
73
+ borderColor: "var(--f-theme-settings-button-tertiary-border-color-hover)",
74
+ color: "var(--f-theme-settings-button-tertiary-color-hover)"
75
+ }
76
+ }
77
+ };
78
+ export {
79
+ t as BlockButtonStyles
80
+ };
81
+ //# sourceMappingURL=styles.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\n\nexport const BlockButtonStyles: Record<string, CSSProperties & { hover?: CSSProperties }> = {\n buttonPrimary: {\n fontFamily: 'var(--f-theme-settings-button-primary-font-family)',\n fontSize: 'var(--f-theme-settings-button-primary-font-size)',\n fontWeight: 'var(--f-theme-settings-button-primary-font-weight)',\n lineHeight: 'var(--f-theme-settings-button-primary-line-height)',\n paddingTop: 'var(--f-theme-settings-button-primary-padding-top)',\n paddingRight: 'var(--f-theme-settings-button-primary-padding-right)',\n paddingBottom: 'var(--f-theme-settings-button-primary-padding-bottom)',\n paddingLeft: 'var(--f-theme-settings-button-primary-padding-left)',\n fontStyle: 'var(--f-theme-settings-button-primary-font-style)',\n textTransform: 'var(--f-theme-settings-button-primary-text-transform)' as CSSProperties['textTransform'],\n backgroundColor: 'var(--f-theme-settings-button-primary-background-color)',\n borderColor: 'var(--f-theme-settings-button-primary-border-color)',\n borderRadius: 'var(--f-theme-settings-button-primary-border-radius)',\n borderWidth: 'var(--f-theme-settings-button-primary-border-width)',\n color: 'var(--f-theme-settings-button-primary-color)',\n marginTop: '10px',\n marginBottom: '10px',\n display: 'inline-block',\n hover: {\n backgroundColor: 'var(--f-theme-settings-button-primary-background-color-hover)',\n borderColor: 'var(--f-theme-settings-button-primary-border-color-hover)',\n color: 'var(--f-theme-settings-button-primary-color-hover)',\n },\n },\n\n buttonSecondary: {\n fontFamily: 'var(--f-theme-settings-button-secondary-font-family)',\n fontSize: 'var(--f-theme-settings-button-secondary-font-size)',\n fontWeight: 'var(--f-theme-settings-button-secondary-font-weight)',\n lineHeight: 'var(--f-theme-settings-button-secondary-line-height)',\n paddingTop: 'var(--f-theme-settings-button-secondary-padding-top)',\n paddingRight: 'var(--f-theme-settings-button-secondary-padding-right)',\n paddingBottom: 'var(--f-theme-settings-button-secondary-padding-bottom)',\n paddingLeft: 'var(--f-theme-settings-button-secondary-padding-left)',\n fontStyle: 'var(--f-theme-settings-button-secondary-font-style)',\n textTransform: 'var(--f-theme-settings-button-secondary-text-transform)' as CSSProperties['textTransform'],\n backgroundColor: 'var(--f-theme-settings-button-secondary-background-color)',\n borderColor: 'var(--f-theme-settings-button-secondary-border-color)',\n borderRadius: 'var(--f-theme-settings-button-secondary-border-radius)',\n borderWidth: 'var(--f-theme-settings-button-secondary-border-width)',\n color: 'var(--f-theme-settings-button-secondary-color)',\n display: 'inline-block',\n marginTop: '10px',\n marginBottom: '10px',\n hover: {\n backgroundColor: 'var(--f-theme-settings-button-secondary-background-color-hover)',\n borderColor: 'var(--f-theme-settings-button-secondary-border-color-hover)',\n color: 'var(--f-theme-settings-button-secondary-color-hover)',\n },\n },\n\n buttonTertiary: {\n fontFamily: 'var(--f-theme-settings-button-tertiary-font-family)',\n fontSize: 'var(--f-theme-settings-button-tertiary-font-size)',\n fontWeight: 'var(--f-theme-settings-button-tertiary-font-weight)',\n lineHeight: 'var(--f-theme-settings-button-tertiary-line-height)',\n paddingTop: 'var(--f-theme-settings-button-tertiary-padding-top)',\n paddingRight: 'var(--f-theme-settings-button-tertiary-padding-right)',\n paddingBottom: 'var(--f-theme-settings-button-tertiary-padding-bottom)',\n paddingLeft: 'var(--f-theme-settings-button-tertiary-padding-left)',\n fontStyle: 'var(--f-theme-settings-button-tertiary-font-style)',\n textTransform: 'var(--f-theme-settings-button-tertiary-text-transform)' as CSSProperties['textTransform'],\n backgroundColor: 'var(--f-theme-settings-button-tertiary-background-color)',\n borderColor: 'var(--f-theme-settings-button-tertiary-border-color)',\n borderRadius: 'var(--f-theme-settings-button-tertiary-border-radius)',\n borderWidth: 'var(--f-theme-settings-button-tertiary-border-width)',\n color: 'var(--f-theme-settings-button-tertiary-color)',\n display: 'inline-block',\n marginTop: '10px',\n marginBottom: '10px',\n hover: {\n backgroundColor: 'var(--f-theme-settings-button-tertiary-background-color-hover)',\n borderColor: 'var(--f-theme-settings-button-tertiary-border-color-hover)',\n color: 'var(--f-theme-settings-button-tertiary-color-hover)',\n },\n },\n};\n"],"names":["BlockButtonStyles"],"mappings":"AAIO,MAAMA,IAA+E;AAAA,EACxF,eAAe;AAAA,IACX,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,eAAe;AAAA,IACf,aAAa;AAAA,IACb,WAAW;AAAA,IACX,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,cAAc;AAAA,IACd,aAAa;AAAA,IACb,OAAO;AAAA,IACP,WAAW;AAAA,IACX,cAAc;AAAA,IACd,SAAS;AAAA,IACT,OAAO;AAAA,MACH,iBAAiB;AAAA,MACjB,aAAa;AAAA,MACb,OAAO;AAAA,IACX;AAAA,EACJ;AAAA,EAEA,iBAAiB;AAAA,IACb,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,eAAe;AAAA,IACf,aAAa;AAAA,IACb,WAAW;AAAA,IACX,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,cAAc;AAAA,IACd,aAAa;AAAA,IACb,OAAO;AAAA,IACP,SAAS;AAAA,IACT,WAAW;AAAA,IACX,cAAc;AAAA,IACd,OAAO;AAAA,MACH,iBAAiB;AAAA,MACjB,aAAa;AAAA,MACb,OAAO;AAAA,IACX;AAAA,EACJ;AAAA,EAEA,gBAAgB;AAAA,IACZ,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,eAAe;AAAA,IACf,aAAa;AAAA,IACb,WAAW;AAAA,IACX,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,cAAc;AAAA,IACd,aAAa;AAAA,IACb,OAAO;AAAA,IACP,SAAS;AAAA,IACT,WAAW;AAAA,IACX,cAAc;AAAA,IACd,OAAO;AAAA,MACH,iBAAiB;AAAA,MACjB,aAAa;AAAA,MACb,OAAO;AAAA,IACX;AAAA,EACJ;AACJ;"}
@@ -0,0 +1,18 @@
1
+ import { floatingButtonSelectors as r } from "../components/FloatingButton/floatingButtonStore.es.js";
2
+ import { triggerFloatingButtonEdit as i } from "./triggerFloatingButtonEdit.es.js";
3
+ import { triggerFloatingButtonInsert as n } from "./triggerFloatingButtonInsert.es.js";
4
+ const f = (t, {
5
+ focused: o
6
+ } = {}) => {
7
+ if (r.mode() === "edit") {
8
+ i(t);
9
+ return;
10
+ }
11
+ n(t, {
12
+ focused: o
13
+ });
14
+ };
15
+ export {
16
+ f as triggerFloatingButton
17
+ };
18
+ //# sourceMappingURL=triggerFloatingButton.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triggerFloatingButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, Value } from '@udecode/plate';\nimport { floatingButtonSelectors } from '../components';\nimport { triggerFloatingButtonEdit, triggerFloatingButtonInsert } from '.';\n\nexport const triggerFloatingButton = <V extends Value>(\n editor: PlateEditor<V>,\n {\n focused,\n }: {\n focused?: boolean;\n } = {},\n) => {\n if (floatingButtonSelectors.mode() === 'edit') {\n triggerFloatingButtonEdit(editor);\n return;\n }\n\n triggerFloatingButtonInsert(editor, {\n focused,\n });\n};\n"],"names":["triggerFloatingButton","editor","focused","floatingButtonSelectors","triggerFloatingButtonEdit","triggerFloatingButtonInsert"],"mappings":";;;AAMa,MAAAA,IAAwB,CACjCC,GACA;AAAA,EACI,SAAAC;AACJ,IAEI,OACH;AACG,MAAAC,EAAwB,KAAK,MAAM,QAAQ;AAC3C,IAAAC,EAA0BH,CAAM;AAChC;AAAA,EACJ;AAEA,EAAAI,EAA4BJ,GAAQ;AAAA,IAChC,SAAAC;AAAA,EAAA,CACH;AACL;"}
@@ -0,0 +1,17 @@
1
+ import { findNode as g, getPluginType as l, getEditorString as u } from "@udecode/plate";
2
+ import { floatingButtonActions as t } from "../components/FloatingButton/floatingButtonStore.es.js";
3
+ import { ELEMENT_BUTTON as f } from "../createButtonPlugin.es.js";
4
+ const E = (i) => {
5
+ const o = g(i, {
6
+ match: { type: l(i, f) }
7
+ });
8
+ if (!o)
9
+ return;
10
+ const [r, e] = o;
11
+ let n = u(i, e);
12
+ t.url(r.url), t.newTab(r.target === void 0), n === r.url && (n = ""), t.text(n), t.isEditing(!0);
13
+ };
14
+ export {
15
+ E as triggerFloatingButtonEdit
16
+ };
17
+ //# sourceMappingURL=triggerFloatingButtonEdit.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triggerFloatingButtonEdit.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, Value, findNode, getEditorString, getPluginType } from '@udecode/plate';\nimport { ELEMENT_BUTTON, TButtonElement } from '..';\nimport { floatingButtonActions } from '../components/FloatingButton/floatingButtonStore';\n\nexport const triggerFloatingButtonEdit = <V extends Value>(editor: PlateEditor<V>) => {\n const entry = findNode<TButtonElement>(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n if (!entry) {\n return;\n }\n\n const [link, path] = entry;\n\n let text = getEditorString(editor, path);\n\n floatingButtonActions.url(link.url);\n\n floatingButtonActions.newTab(link.target === undefined);\n\n if (text === link.url) {\n text = '';\n }\n\n floatingButtonActions.text(text);\n\n floatingButtonActions.isEditing(true);\n};\n"],"names":["triggerFloatingButtonEdit","editor","entry","findNode","getPluginType","ELEMENT_BUTTON","link","path","text","getEditorString","floatingButtonActions"],"mappings":";;;AAMa,MAAAA,IAA4B,CAAkBC,MAA2B;AAC5E,QAAAC,IAAQC,EAAyBF,GAAQ;AAAA,IAC3C,OAAO,EAAE,MAAMG,EAAcH,GAAQI,CAAc,EAAE;AAAA,EAAA,CACxD;AACD,MAAI,CAACH;AACD;AAGE,QAAA,CAACI,GAAMC,CAAI,IAAIL;AAEjB,MAAAM,IAAOC,EAAgBR,GAAQM,CAAI;AAEjB,EAAAG,EAAA,IAAIJ,EAAK,GAAG,GAEZI,EAAA,OAAOJ,EAAK,WAAW,MAAS,GAElDE,MAASF,EAAK,QACPE,IAAA,KAGXE,EAAsB,KAAKF,CAAI,GAE/BE,EAAsB,UAAU,EAAI;AACxC;"}
@@ -0,0 +1,14 @@
1
+ import { isRangeAcrossBlocks as e, someNode as r, getPluginType as s, getEditorString as i } from "@udecode/plate";
2
+ import { floatingButtonSelectors as g, floatingButtonActions as n } from "../components/FloatingButton/floatingButtonStore.es.js";
3
+ import { ELEMENT_BUTTON as u } from "../createButtonPlugin.es.js";
4
+ const l = (t, {
5
+ focused: o
6
+ } = {}) => {
7
+ g.mode() || !o || e(t, { at: t.selection }) || r(t, {
8
+ match: { type: s(t, u) }
9
+ }) || (n.text(i(t, t.selection)), n.show("insert", t.id));
10
+ };
11
+ export {
12
+ l as triggerFloatingButtonInsert
13
+ };
14
+ //# sourceMappingURL=triggerFloatingButtonInsert.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triggerFloatingButtonInsert.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, Value, getEditorString, getPluginType, isRangeAcrossBlocks, someNode } from '@udecode/plate';\nimport { floatingButtonActions, floatingButtonSelectors } from '../components/FloatingButton/floatingButtonStore';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\n/**\n * Trigger floating button.\n *\n * Do not trigger when:\n * - selection is across blocks\n * - selection has more than one leaf node\n * - lowest selection is not text\n * - selection has a button node\n */\nexport const triggerFloatingButtonInsert = <V extends Value>(\n editor: PlateEditor<V>,\n {\n focused,\n }: {\n focused?: boolean;\n } = {},\n) => {\n if (floatingButtonSelectors.mode()) {\n return;\n }\n\n if (!focused) {\n return;\n }\n\n if (isRangeAcrossBlocks(editor, { at: editor.selection })) {\n return;\n }\n\n const hasButton = someNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n if (hasButton) {\n return;\n }\n\n floatingButtonActions.text(getEditorString(editor, editor.selection));\n floatingButtonActions.show('insert', editor.id);\n};\n"],"names":["triggerFloatingButtonInsert","editor","focused","floatingButtonSelectors","isRangeAcrossBlocks","someNode","getPluginType","ELEMENT_BUTTON","floatingButtonActions","getEditorString"],"mappings":";;;AAea,MAAAA,IAA8B,CACvCC,GACA;AAAA,EACI,SAAAC;AACJ,IAEI,OACH;AAgBD,EAfIC,EAAwB,UAIxB,CAACD,KAIDE,EAAoBH,GAAQ,EAAE,IAAIA,EAAO,UAAA,CAAW,KAItCI,EAASJ,GAAQ;AAAA,IAC/B,OAAO,EAAE,MAAMK,EAAcL,GAAQM,CAAc,EAAE;AAAA,EAAA,CACxD,MAKDC,EAAsB,KAAKC,EAAgBR,GAAQA,EAAO,SAAS,CAAC,GAC9CO,EAAA,KAAK,UAAUP,EAAO,EAAE;AAClD;"}
@@ -0,0 +1,53 @@
1
+ import { isCollapsed as i, getAboveNode as a, getPluginType as l, isStartPoint as g, getPreviousNodeEndPoint as x, isEndPoint as P, getNextNodeStartPoint as m, select as u, insertNodes as E, withRemoveEmptyNodes as h, mockPlugin as r } from "@udecode/plate";
2
+ import { Path as w } from "slate";
3
+ import { ELEMENT_BUTTON as p } from "./createButtonPlugin.es.js";
4
+ const B = (t, { type: N }) => {
5
+ const { apply: f, normalizeNode: y } = t;
6
+ return t.apply = (s) => {
7
+ if (s.type !== "set_selection") {
8
+ f(s);
9
+ return;
10
+ }
11
+ const n = s.newProperties;
12
+ if (!(n != null && n.focus) || !n.anchor || !i(n)) {
13
+ f(s);
14
+ return;
15
+ }
16
+ const c = a(t, {
17
+ at: n,
18
+ match: { type: l(t, p) }
19
+ });
20
+ if (c) {
21
+ const [, o] = c;
22
+ let e;
23
+ g(t, n.focus, o) && (e = x(t, o)), P(t, n.focus, o) && (e = m(t, o)), e && (s.newProperties = {
24
+ anchor: e,
25
+ focus: e
26
+ });
27
+ }
28
+ f(s);
29
+ }, t.normalizeNode = ([s, n]) => {
30
+ if (s.type === l(t, p)) {
31
+ const c = t.selection;
32
+ if (c && i(c) && P(t, c.focus, n)) {
33
+ const o = m(t, n);
34
+ if (o)
35
+ u(t, o);
36
+ else {
37
+ const e = w.next(n);
38
+ E(t, { text: "" }, { at: e }), u(t, e);
39
+ }
40
+ }
41
+ }
42
+ y([s, n]);
43
+ }, h(
44
+ t,
45
+ r({
46
+ options: { types: N }
47
+ })
48
+ );
49
+ };
50
+ export {
51
+ B as withButton
52
+ };
53
+ //# sourceMappingURL=withButton.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withButton.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n AnyObject,\n EText,\n PlateEditor,\n Value,\n WithOverride,\n getAboveNode,\n getNextNodeStartPoint,\n getPluginType,\n getPreviousNodeEndPoint,\n insertNodes,\n isCollapsed,\n isEndPoint,\n isStartPoint,\n mockPlugin,\n select,\n withRemoveEmptyNodes,\n} from '@udecode/plate';\nimport { Path, Point, Range } from 'slate';\nimport { ELEMENT_BUTTON } from './createButtonPlugin';\n\n/**\n * Insert space after a url to wrap a button.\n * Lookup from the block start to the cursor to check if there is an url.\n * If not found, lookup before the cursor for a space character to check the url.\n *\n * On insert data:\n * Paste a string inside a button element will edit its children text but not its url.\n *\n */\n\nexport const withButton: WithOverride = (editor, { type }) => {\n const { apply, normalizeNode } = editor;\n\n editor.apply = (operation) => {\n if (operation.type !== 'set_selection') {\n apply(operation);\n return;\n }\n\n const range = operation.newProperties;\n if (!range?.focus || !range.anchor || !isCollapsed(range as Range)) {\n apply(operation);\n return;\n }\n\n const entry = getAboveNode(editor, {\n at: range as Range,\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n if (entry) {\n const [, path] = entry;\n\n let newPoint: Point | undefined;\n\n if (isStartPoint(editor, range.focus, path)) {\n newPoint = getPreviousNodeEndPoint(editor, path);\n }\n\n if (isEndPoint(editor, range.focus, path)) {\n newPoint = getNextNodeStartPoint(editor, path);\n }\n\n if (newPoint) {\n operation.newProperties = {\n anchor: newPoint,\n focus: newPoint,\n };\n }\n }\n\n apply(operation);\n };\n\n editor.normalizeNode = ([node, path]) => {\n if (node.type === getPluginType(editor, ELEMENT_BUTTON)) {\n const range = editor.selection as Range | null;\n\n if (range && isCollapsed(range) && isEndPoint(editor, range.focus, path)) {\n const nextPoint = getNextNodeStartPoint(editor, path);\n\n // select next text node if any\n if (nextPoint) {\n select(editor, nextPoint);\n } else {\n // insert text node then select\n const nextPath = Path.next(path);\n insertNodes(editor, { text: '' } as EText<Value>, { at: nextPath });\n select(editor, nextPath);\n }\n }\n }\n\n normalizeNode([node, path]);\n };\n\n return withRemoveEmptyNodes<Value, PlateEditor<Value>>(\n editor,\n mockPlugin<AnyObject, Value, PlateEditor<Value>>({\n options: { types: type },\n }),\n );\n};\n"],"names":["withButton","editor","type","apply","normalizeNode","operation","range","isCollapsed","entry","getAboveNode","getPluginType","ELEMENT_BUTTON","path","newPoint","isStartPoint","getPreviousNodeEndPoint","isEndPoint","getNextNodeStartPoint","node","nextPoint","select","nextPath","Path","insertNodes","withRemoveEmptyNodes","mockPlugin"],"mappings":";;;AAiCO,MAAMA,IAA2B,CAACC,GAAQ,EAAE,MAAAC,QAAW;AACpD,QAAA,EAAE,OAAAC,GAAO,eAAAC,EAAkB,IAAAH;AAE1B,SAAAA,EAAA,QAAQ,CAACI,MAAc;AACtB,QAAAA,EAAU,SAAS,iBAAiB;AACpC,MAAAF,EAAME,CAAS;AACf;AAAA,IACJ;AAEA,UAAMC,IAAQD,EAAU;AACpB,QAAA,EAACC,KAAA,QAAAA,EAAO,UAAS,CAACA,EAAM,UAAU,CAACC,EAAYD,CAAc,GAAG;AAChE,MAAAH,EAAME,CAAS;AACf;AAAA,IACJ;AAEM,UAAAG,IAAQC,EAAaR,GAAQ;AAAA,MAC/B,IAAIK;AAAA,MACJ,OAAO,EAAE,MAAMI,EAAcT,GAAQU,CAAc,EAAE;AAAA,IAAA,CACxD;AAED,QAAIH,GAAO;AACD,YAAA,CAAG,EAAAI,CAAI,IAAIJ;AAEb,UAAAK;AAEJ,MAAIC,EAAab,GAAQK,EAAM,OAAOM,CAAI,MAC3BC,IAAAE,EAAwBd,GAAQW,CAAI,IAG/CI,EAAWf,GAAQK,EAAM,OAAOM,CAAI,MACzBC,IAAAI,EAAsBhB,GAAQW,CAAI,IAG7CC,MACAR,EAAU,gBAAgB;AAAA,QACtB,QAAQQ;AAAA,QACR,OAAOA;AAAA,MAAA;AAAA,IAGnB;AAEA,IAAAV,EAAME,CAAS;AAAA,EAAA,GAGnBJ,EAAO,gBAAgB,CAAC,CAACiB,GAAMN,CAAI,MAAM;AACrC,QAAIM,EAAK,SAASR,EAAcT,GAAQU,CAAc,GAAG;AACrD,YAAML,IAAQL,EAAO;AAEjB,UAAAK,KAASC,EAAYD,CAAK,KAAKU,EAAWf,GAAQK,EAAM,OAAOM,CAAI,GAAG;AAChE,cAAAO,IAAYF,EAAsBhB,GAAQW,CAAI;AAGpD,YAAIO;AACA,UAAAC,EAAOnB,GAAQkB,CAAS;AAAA,aACrB;AAEG,gBAAAE,IAAWC,EAAK,KAAKV,CAAI;AACnB,UAAAW,EAAAtB,GAAQ,EAAE,MAAM,MAAsB,EAAE,IAAIoB,GAAU,GAClED,EAAOnB,GAAQoB,CAAQ;AAAA,QAC3B;AAAA,MACJ;AAAA,IACJ;AAEc,IAAAjB,EAAA,CAACc,GAAMN,CAAI,CAAC;AAAA,EAAA,GAGvBY;AAAA,IACHvB;AAAA,IACAwB,EAAiD;AAAA,MAC7C,SAAS,EAAE,OAAOvB,EAAK;AAAA,IAAA,CAC1B;AAAA,EAAA;AAET;"}
@@ -0,0 +1,19 @@
1
+ import { jsxs as s, Fragment as m, jsx as t } from "react/jsx-runtime";
2
+ import { useFloatingLinkSelectors as l } from "@udecode/plate";
3
+ import { FloatingLink as i } from "./FloatingLink.es.js";
4
+ import { InsertLinkModal as d } from "./InsertLinkModal/InsertLinkModal.es.js";
5
+ import { EditModal as c } from "./EditLinkModal/EditModal.es.js";
6
+ const k = ({ readOnly: n }) => {
7
+ const r = l().isEditing();
8
+ if (n)
9
+ return null;
10
+ const o = /* @__PURE__ */ t(d, {}), e = r ? o : /* @__PURE__ */ t(c, {});
11
+ return /* @__PURE__ */ s(m, { children: [
12
+ /* @__PURE__ */ t(i.InsertRoot, { children: o }),
13
+ /* @__PURE__ */ t(i.EditRoot, { children: e })
14
+ ] });
15
+ };
16
+ export {
17
+ k as CustomFloatingLink
18
+ };
19
+ //# sourceMappingURL=CustomFloatingLink.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomFloatingLink.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TEditableProps, useFloatingLinkSelectors } from '@udecode/plate';\n\nimport { EditModal } from './EditLinkModal';\nimport { FloatingLink } from './FloatingLink';\nimport { InsertLinkModal } from './InsertLinkModal/InsertLinkModal';\n\nexport const CustomFloatingLink = ({ readOnly }: TEditableProps) => {\n const isEditing = useFloatingLinkSelectors().isEditing();\n\n if (readOnly) {\n return null;\n }\n\n const input = <InsertLinkModal />;\n const editContent = isEditing ? input : <EditModal />;\n\n return (\n <>\n <FloatingLink.InsertRoot>{input}</FloatingLink.InsertRoot>\n\n <FloatingLink.EditRoot>{editContent}</FloatingLink.EditRoot>\n </>\n );\n};\n"],"names":["CustomFloatingLink","readOnly","isEditing","useFloatingLinkSelectors","input","InsertLinkModal","editContent","jsx","EditModal","jsxs","Fragment","FloatingLink"],"mappings":";;;;;AAQO,MAAMA,IAAqB,CAAC,EAAE,UAAAC,QAA+B;AAC1D,QAAAC,IAAYC,IAA2B;AAE7C,MAAIF;AACO,WAAA;AAGL,QAAAG,sBAASC,GAAgB,CAAA,CAAA,GACzBC,IAAcJ,IAAYE,IAAQ,gBAAAG,EAACC,GAAU,CAAA,CAAA;AAEnD,SAEQ,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAC,gBAAAH,EAAAI,EAAa,YAAb,EAAyB,UAAMP,EAAA,CAAA;AAAA,IAE/B,gBAAAG,EAAAI,EAAa,UAAb,EAAuB,UAAYL,EAAA,CAAA;AAAA,EACxC,EAAA,CAAA;AAER;"}
@@ -0,0 +1,43 @@
1
+ import { jsx as t, jsxs as e } from "react/jsx-runtime";
2
+ import { IconPen16 as o, IconTrashBin16 as r } from "@frontify/fondue";
3
+ import { useFloatingLinkUrlInput as a } from "@udecode/plate";
4
+ import { FloatingLink as n } from "../FloatingLink.es.js";
5
+ const c = () => {
6
+ const i = a({});
7
+ return /* @__PURE__ */ t(
8
+ "div",
9
+ {
10
+ "data-test-id": "floating-link-edit",
11
+ className: "tw-bg-white tw-text-text tw-rounded tw-shadow tw-p-4 tw-min-w-[400px]",
12
+ children: /* @__PURE__ */ e("span", { "data-test-id": "preview-link-flyout", className: "tw-flex tw-justify-between tw-items-center", children: [
13
+ /* @__PURE__ */ t("span", { className: "tw-pointer-events-none", children: i.defaultValue }),
14
+ /* @__PURE__ */ e("span", { className: "tw-flex tw-gap-2", children: [
15
+ /* @__PURE__ */ t(
16
+ "span",
17
+ {
18
+ role: "button",
19
+ tabIndex: 0,
20
+ "data-test-id": "edit-link-button",
21
+ className: "tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",
22
+ children: /* @__PURE__ */ t(n.EditButton, { children: /* @__PURE__ */ t(o, {}) })
23
+ }
24
+ ),
25
+ /* @__PURE__ */ t(
26
+ "span",
27
+ {
28
+ role: "button",
29
+ tabIndex: 0,
30
+ "data-test-id": "remove-link-button",
31
+ className: "tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",
32
+ children: /* @__PURE__ */ t(n.UnlinkButton, { children: /* @__PURE__ */ t(r, {}) })
33
+ }
34
+ )
35
+ ] })
36
+ ] })
37
+ }
38
+ );
39
+ };
40
+ export {
41
+ c as EditModal
42
+ };
43
+ //# sourceMappingURL=EditModal.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditModal.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconPen16, IconTrashBin16 } from '@frontify/fondue';\nimport { useFloatingLinkUrlInput } from '@udecode/plate';\nimport { FloatingLink } from '../FloatingLink';\n\nexport const EditModal = () => {\n const urlHtmlProps = useFloatingLinkUrlInput({});\n\n return (\n <div\n data-test-id=\"floating-link-edit\"\n className=\"tw-bg-white tw-text-text tw-rounded tw-shadow tw-p-4 tw-min-w-[400px]\"\n >\n <span data-test-id={'preview-link-flyout'} className=\"tw-flex tw-justify-between tw-items-center\">\n <span className=\"tw-pointer-events-none\">{urlHtmlProps.defaultValue}</span>\n <span className=\"tw-flex tw-gap-2\">\n <span\n role=\"button\"\n tabIndex={0}\n data-test-id={'edit-link-button'}\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n >\n <FloatingLink.EditButton>\n <IconPen16 />\n </FloatingLink.EditButton>\n </span>\n\n <span\n role=\"button\"\n tabIndex={0}\n data-test-id={'remove-link-button'}\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n >\n <FloatingLink.UnlinkButton>\n <IconTrashBin16 />\n </FloatingLink.UnlinkButton>\n </span>\n </span>\n </span>\n </div>\n );\n};\n"],"names":["EditModal","urlHtmlProps","useFloatingLinkUrlInput","jsx","jsxs","FloatingLink","IconPen16","IconTrashBin16"],"mappings":";;;;AAMO,MAAMA,IAAY,MAAM;AACrB,QAAAC,IAAeC,EAAwB,CAAA,CAAE;AAG3C,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,gBAAa;AAAA,MACb,WAAU;AAAA,MAEV,UAAC,gBAAAC,EAAA,QAAA,EAAK,gBAAc,uBAAuB,WAAU,8CACjD,UAAA;AAAA,QAAA,gBAAAD,EAAC,QAAK,EAAA,WAAU,0BAA0B,UAAAF,EAAa,cAAa;AAAA,QACpE,gBAAAG,EAAC,QAAK,EAAA,WAAU,oBACZ,UAAA;AAAA,UAAA,gBAAAD;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,MAAK;AAAA,cACL,UAAU;AAAA,cACV,gBAAc;AAAA,cACd,WAAU;AAAA,cAEV,4BAACE,EAAa,YAAb,EACG,UAAA,gBAAAF,EAACG,IAAU,CAAA,GACf;AAAA,YAAA;AAAA,UACJ;AAAA,UAEA,gBAAAH;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,MAAK;AAAA,cACL,UAAU;AAAA,cACV,gBAAc;AAAA,cACd,WAAU;AAAA,cAEV,4BAACE,EAAa,cAAb,EACG,UAAA,gBAAAF,EAACI,IAAe,CAAA,GACpB;AAAA,YAAA;AAAA,UACJ;AAAA,QAAA,GACJ;AAAA,MAAA,GACJ;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
@@ -0,0 +1,53 @@
1
+ import { useEditorRef as y, usePlateSelectors as F, useFloatingLinkSelectors as d, getPluginOptions as h, ELEMENT_LINK as n, getAboveNode as C, getPluginType as l, getRangeBoundingClientRect as R, getStartPoint as P, getEndPoint as b, getDefaultBoundingClientRect as N, useVirtualFloatingLink as O, floatingLinkActions as o, someNode as S, floatingLinkSelectors as c, useHotkeys as B, triggerFloatingLinkEdit as I, useFloatingLinkEnter as v, useFloatingLinkEscape as x, useComposedRef as A } from "@udecode/plate";
2
+ import { useCallback as D, useEffect as H } from "react";
3
+ import { getLinkFromEditor as T } from "../../../../../Link/utils/getUrl.es.js";
4
+ const M = ({ floatingOptions: g, ...i }) => {
5
+ const e = y(), u = F().keyEditor(), a = d().mode(), f = d().isOpen(e.id), { triggerFloatingLinkHotkeys: k = "command+k, ctrl+k" } = h(e, n), m = D(() => {
6
+ const t = C(e, {
7
+ match: { type: l(e, n) }
8
+ });
9
+ if (t) {
10
+ const [, s] = t;
11
+ return R(e, {
12
+ anchor: P(e, s),
13
+ focus: b(e, s)
14
+ });
15
+ }
16
+ return N();
17
+ }, [e]), p = f && a === "edit", { update: r, style: E, floating: L } = O({
18
+ editorId: e.id,
19
+ open: p,
20
+ getBoundingClientRect: m,
21
+ ...g
22
+ });
23
+ return H(() => {
24
+ const t = T(e);
25
+ if (t && o.url(t), e.selection && S(e, {
26
+ match: { type: l(e, n) }
27
+ })) {
28
+ o.show("edit", e.id), r();
29
+ return;
30
+ }
31
+ c.mode() === "edit" && o.hide();
32
+ }, [e, u, r]), B(
33
+ k,
34
+ (t) => {
35
+ t.preventDefault(), c.mode() === "edit" && I(e);
36
+ },
37
+ {
38
+ enableOnContentEditable: !0
39
+ },
40
+ []
41
+ ), v(), x(), {
42
+ style: {
43
+ ...E,
44
+ zIndex: 1e3
45
+ },
46
+ ...i,
47
+ ref: A(i.ref, L)
48
+ };
49
+ };
50
+ export {
51
+ M as useFloatingLinkEdit
52
+ };
53
+ //# sourceMappingURL=useFloatingLinkEdit.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFloatingLinkEdit.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ELEMENT_LINK,\n FloatingLinkProps,\n HTMLPropsAs,\n LinkPlugin,\n floatingLinkActions,\n floatingLinkSelectors,\n getAboveNode,\n getDefaultBoundingClientRect,\n getEndPoint,\n getPluginOptions,\n getPluginType,\n getRangeBoundingClientRect,\n getStartPoint,\n someNode,\n triggerFloatingLinkEdit,\n useComposedRef,\n useEditorRef,\n useFloatingLinkEnter,\n useFloatingLinkEscape,\n useFloatingLinkSelectors,\n useHotkeys,\n usePlateSelectors,\n useVirtualFloatingLink,\n} from '@udecode/plate';\nimport { useCallback, useEffect } from 'react';\nimport { getLinkFromEditor } from '../../../../../Link';\n\nexport const useFloatingLinkEdit = ({ floatingOptions, ...props }: FloatingLinkProps): HTMLPropsAs<'div'> => {\n const editor = useEditorRef();\n const keyEditor = usePlateSelectors().keyEditor();\n const mode = useFloatingLinkSelectors().mode();\n const open = useFloatingLinkSelectors().isOpen(editor.id);\n\n const { triggerFloatingLinkHotkeys = 'command+k, ctrl+k' } = getPluginOptions<LinkPlugin>(editor, ELEMENT_LINK);\n\n const getBoundingClientRect = useCallback(() => {\n const entry = getAboveNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_LINK) },\n });\n\n if (entry) {\n const [, path] = entry;\n return getRangeBoundingClientRect(editor, {\n anchor: getStartPoint(editor, path),\n focus: getEndPoint(editor, path),\n });\n }\n\n return getDefaultBoundingClientRect();\n }, [editor]);\n\n const isOpen = open && mode === 'edit';\n\n const { update, style, floating } = useVirtualFloatingLink({\n editorId: editor.id,\n open: isOpen,\n getBoundingClientRect,\n ...floatingOptions,\n });\n\n useEffect(() => {\n const url = getLinkFromEditor(editor);\n if (url) {\n floatingLinkActions.url(url);\n }\n\n if (\n editor.selection &&\n someNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_LINK) },\n })\n ) {\n floatingLinkActions.show('edit', editor.id);\n update();\n return;\n }\n\n if (floatingLinkSelectors.mode() === 'edit') {\n floatingLinkActions.hide();\n }\n }, [editor, keyEditor, update]);\n\n useHotkeys(\n triggerFloatingLinkHotkeys,\n (e) => {\n e.preventDefault();\n\n if (floatingLinkSelectors.mode() === 'edit') {\n triggerFloatingLinkEdit(editor);\n }\n },\n {\n enableOnContentEditable: true,\n },\n [],\n );\n\n useFloatingLinkEnter();\n\n useFloatingLinkEscape();\n\n return {\n style: {\n ...style,\n zIndex: 1000,\n },\n ...props,\n ref: useComposedRef<HTMLElement | null>(props.ref, floating),\n };\n};\n"],"names":["useFloatingLinkEdit","floatingOptions","props","editor","useEditorRef","keyEditor","usePlateSelectors","mode","useFloatingLinkSelectors","open","triggerFloatingLinkHotkeys","getPluginOptions","ELEMENT_LINK","getBoundingClientRect","useCallback","entry","getAboveNode","getPluginType","path","getRangeBoundingClientRect","getStartPoint","getEndPoint","getDefaultBoundingClientRect","isOpen","update","style","floating","useVirtualFloatingLink","useEffect","url","getLinkFromEditor","floatingLinkActions","someNode","floatingLinkSelectors","useHotkeys","e","triggerFloatingLinkEdit","useFloatingLinkEnter","useFloatingLinkEscape","useComposedRef"],"mappings":";;;AA8BO,MAAMA,IAAsB,CAAC,EAAE,iBAAAC,GAAiB,GAAGC,QAAmD;AACzG,QAAMC,IAASC,KACTC,IAAYC,IAAoB,aAChCC,IAAOC,IAA2B,QAClCC,IAAOD,EAA2B,EAAA,OAAOL,EAAO,EAAE,GAElD,EAAE,4BAAAO,IAA6B,oBAAA,IAAwBC,EAA6BR,GAAQS,CAAY,GAExGC,IAAwBC,EAAY,MAAM;AACtC,UAAAC,IAAQC,EAAab,GAAQ;AAAA,MAC/B,OAAO,EAAE,MAAMc,EAAcd,GAAQS,CAAY,EAAE;AAAA,IAAA,CACtD;AAED,QAAIG,GAAO;AACD,YAAA,CAAG,EAAAG,CAAI,IAAIH;AACjB,aAAOI,EAA2BhB,GAAQ;AAAA,QACtC,QAAQiB,EAAcjB,GAAQe,CAAI;AAAA,QAClC,OAAOG,EAAYlB,GAAQe,CAAI;AAAA,MAAA,CAClC;AAAA,IACL;AAEA,WAAOI,EAA6B;AAAA,EAAA,GACrC,CAACnB,CAAM,CAAC,GAELoB,IAASd,KAAQF,MAAS,QAE1B,EAAE,QAAAiB,GAAQ,OAAAC,GAAO,UAAAC,EAAA,IAAaC,EAAuB;AAAA,IACvD,UAAUxB,EAAO;AAAA,IACjB,MAAMoB;AAAA,IACN,uBAAAV;AAAA,IACA,GAAGZ;AAAA,EAAA,CACN;AAED,SAAA2B,EAAU,MAAM;AACN,UAAAC,IAAMC,EAAkB3B,CAAM;AAMhC,QALA0B,KACAE,EAAoB,IAAIF,CAAG,GAI3B1B,EAAO,aACP6B,EAAS7B,GAAQ;AAAA,MACb,OAAO,EAAE,MAAMc,EAAcd,GAAQS,CAAY,EAAE;AAAA,IAAA,CACtD,GACH;AACsB,MAAAmB,EAAA,KAAK,QAAQ5B,EAAO,EAAE,GACnCqB;AACP;AAAA,IACJ;AAEI,IAAAS,EAAsB,KAAK,MAAM,UACjCF,EAAoB,KAAK;AAAA,EAE9B,GAAA,CAAC5B,GAAQE,GAAWmB,CAAM,CAAC,GAE9BU;AAAA,IACIxB;AAAA,IACA,CAACyB,MAAM;AACH,MAAAA,EAAE,eAAe,GAEbF,EAAsB,KAAK,MAAM,UACjCG,EAAwBjC,CAAM;AAAA,IAEtC;AAAA,IACA;AAAA,MACI,yBAAyB;AAAA,IAC7B;AAAA,IACA,CAAC;AAAA,EAAA,GAGgBkC,KAECC,KAEf;AAAA,IACH,OAAO;AAAA,MACH,GAAGb;AAAA,MACH,QAAQ;AAAA,IACZ;AAAA,IACA,GAAGvB;AAAA,IACH,KAAKqC,EAAmCrC,EAAM,KAAKwB,CAAQ;AAAA,EAAA;AAEnE;"}
@@ -0,0 +1,29 @@
1
+ import { createComponentAs as e, createElementAs as s, FloatingLink as i } from "@udecode/plate";
2
+ import { useFloatingLinkInsert as r } from "./InsertLinkModal/useFloatingLinkInsert.es.js";
3
+ import { useFloatingLinkEdit as l } from "./EditLinkModal/useFloatingLinkEdit.es.js";
4
+ const a = e((o) => {
5
+ var n;
6
+ const t = r({
7
+ ...o,
8
+ floatingOptions: {
9
+ strategy: "absolute"
10
+ }
11
+ });
12
+ return ((n = t.style) == null ? void 0 : n.display) === "none" ? null : s("div", t);
13
+ }), g = e((o) => {
14
+ var n;
15
+ const t = l({
16
+ ...o,
17
+ floatingOptions: {
18
+ strategy: "absolute"
19
+ }
20
+ });
21
+ return ((n = t.style) == null ? void 0 : n.display) === "none" ? null : s("div", t);
22
+ });
23
+ i.EditRoot = g;
24
+ i.InsertRoot = a;
25
+ const c = i;
26
+ export {
27
+ c as FloatingLink
28
+ };
29
+ //# sourceMappingURL=FloatingLink.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FloatingLink.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n FloatingLinkProps,\n FloatingLink as PlateFloatingLink,\n createComponentAs,\n createElementAs,\n} from '@udecode/plate';\nimport { useFloatingLinkEdit } from './EditLinkModal';\nimport { useFloatingLinkInsert } from './InsertLinkModal/useFloatingLinkInsert';\n\nconst FloatingLinkInsertRoot = createComponentAs<FloatingLinkProps>((props) => {\n const htmlProps = useFloatingLinkInsert({\n ...props,\n floatingOptions: {\n strategy: 'absolute',\n },\n });\n\n if (htmlProps.style?.display === 'none') {\n return null;\n }\n\n return createElementAs('div', htmlProps);\n});\n\nconst FloatingLinkEditRoot = createComponentAs<FloatingLinkProps>((props) => {\n const htmlProps = useFloatingLinkEdit({\n ...props,\n floatingOptions: {\n strategy: 'absolute',\n },\n });\n\n if (htmlProps.style?.display === 'none') {\n return null;\n }\n\n return createElementAs('div', htmlProps);\n});\n\nPlateFloatingLink.EditRoot = FloatingLinkEditRoot;\nPlateFloatingLink.InsertRoot = FloatingLinkInsertRoot;\n\nexport const FloatingLink = PlateFloatingLink;\n"],"names":["FloatingLinkInsertRoot","createComponentAs","props","htmlProps","useFloatingLinkInsert","_a","createElementAs","FloatingLinkEditRoot","useFloatingLinkEdit","PlateFloatingLink","FloatingLink"],"mappings":";;;AAWA,MAAMA,IAAyBC,EAAqC,CAACC,MAAU;;AAC3E,QAAMC,IAAYC,EAAsB;AAAA,IACpC,GAAGF;AAAA,IACH,iBAAiB;AAAA,MACb,UAAU;AAAA,IACd;AAAA,EAAA,CACH;AAEG,WAAAG,IAAAF,EAAU,UAAV,gBAAAE,EAAiB,aAAY,SACtB,OAGJC,EAAgB,OAAOH,CAAS;AAC3C,CAAC,GAEKI,IAAuBN,EAAqC,CAACC,MAAU;;AACzE,QAAMC,IAAYK,EAAoB;AAAA,IAClC,GAAGN;AAAA,IACH,iBAAiB;AAAA,MACb,UAAU;AAAA,IACd;AAAA,EAAA,CACH;AAEG,WAAAG,IAAAF,EAAU,UAAV,gBAAAE,EAAiB,aAAY,SACtB,OAGJC,EAAgB,OAAOH,CAAS;AAC3C,CAAC;AAEDM,EAAkB,WAAWF;AAC7BE,EAAkB,aAAaT;AAExB,MAAMU,IAAeD;"}
@@ -0,0 +1,8 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { InsertModal as t } from "./InsertModal.es.js";
3
+ import { useInsertModal as r } from "./useInsertModal.es.js";
4
+ const i = () => /* @__PURE__ */ o(t, { ...r(), testId: "floating-link-insert" });
5
+ export {
6
+ i as InsertLinkModal
7
+ };
8
+ //# sourceMappingURL=InsertLinkModal.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InsertLinkModal.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { InsertModal, useInsertModal } from '.';\n\nexport const InsertLinkModal = () => <InsertModal {...useInsertModal()} testId=\"floating-link-insert\" />;\n"],"names":["InsertLinkModal","jsx","InsertModal","useInsertModal"],"mappings":";;;AAIa,MAAAA,IAAkB,MAAO,gBAAAC,EAAAC,GAAA,EAAa,GAAGC,EAAe,GAAG,QAAO,uBAAuB,CAAA;"}
@@ -0,0 +1,66 @@
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import { FormControl as p, TextInput as x, Button as n, ButtonSize as r, ButtonStyle as k, ButtonEmphasis as b, IconCheckMark20 as f } from "@frontify/fondue";
3
+ import { LinkInput as v } from "../../../../../Link/LinkInput.es.js";
4
+ const I = ({
5
+ state: t,
6
+ onTextChange: o,
7
+ onUrlChange: d,
8
+ onToggleTab: a,
9
+ onCancel: c,
10
+ onSave: w,
11
+ isValidUrlOrEmpty: i,
12
+ hasValues: u,
13
+ testId: m,
14
+ appBridge: h,
15
+ children: s
16
+ }) => /* @__PURE__ */ l("div", { "data-test-id": m, className: "tw-bg-white tw-rounded tw-shadow tw-p-7 tw-min-w-[400px] tw-overflow-y-auto", children: [
17
+ /* @__PURE__ */ e(
18
+ p,
19
+ {
20
+ label: {
21
+ children: "Text",
22
+ htmlFor: "linkText",
23
+ required: !0
24
+ },
25
+ children: /* @__PURE__ */ e(x, { id: "linkText", value: t.text, placeholder: "Link Text", onChange: o })
26
+ }
27
+ ),
28
+ s,
29
+ /* @__PURE__ */ e("div", { className: "tw-mt-5", children: /* @__PURE__ */ e(
30
+ v,
31
+ {
32
+ url: t.url,
33
+ newTab: t.newTab,
34
+ onUrlChange: d,
35
+ onToggleTab: a,
36
+ isValidUrlOrEmpty: i,
37
+ appBridge: h
38
+ }
39
+ ) }),
40
+ /* @__PURE__ */ e("div", { className: "tw-mt-3", children: /* @__PURE__ */ l("div", { className: "tw-pt-5 tw-flex tw-gap-x-3 tw-justify-end tw-border-t tw-border-t-black-10", children: [
41
+ /* @__PURE__ */ e(
42
+ n,
43
+ {
44
+ onClick: c,
45
+ size: r.Medium,
46
+ style: k.Default,
47
+ emphasis: b.Default,
48
+ children: "Cancel"
49
+ }
50
+ ),
51
+ /* @__PURE__ */ e(
52
+ n,
53
+ {
54
+ onClick: w,
55
+ size: r.Medium,
56
+ icon: /* @__PURE__ */ e(f, {}),
57
+ disabled: !u || !i(t == null ? void 0 : t.url),
58
+ children: "Save"
59
+ }
60
+ )
61
+ ] }) })
62
+ ] });
63
+ export {
64
+ I as InsertModal
65
+ };
66
+ //# sourceMappingURL=InsertModal.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InsertModal.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n Button,\n ButtonEmphasis,\n ButtonSize,\n ButtonStyle,\n FormControl,\n IconCheckMark20,\n TextInput,\n} from '@frontify/fondue';\nimport { FC, ReactNode } from 'react';\nimport { InsertModalStateProps } from './types';\nimport { LinkInput } from '../../../../../Link/LinkInput';\n\ntype InsertModalProps = {\n state: InsertModalStateProps;\n onTextChange: (value: string) => void;\n onUrlChange: (value: string) => void;\n onToggleTab: (checked: boolean) => void;\n onCancel: () => void;\n onSave: (event: React.MouseEvent<HTMLButtonElement, MouseEvent> | KeyboardEvent | undefined) => void;\n hasValues: boolean;\n isValidUrlOrEmpty: (url: string) => boolean;\n testId?: string;\n children?: ReactNode;\n appBridge: AppBridgeBlock;\n};\n\nexport const InsertModal: FC<InsertModalProps> = ({\n state,\n onTextChange,\n onUrlChange,\n onToggleTab,\n onCancel,\n onSave,\n isValidUrlOrEmpty,\n hasValues,\n testId,\n appBridge,\n children,\n}) => (\n <div data-test-id={testId} className=\"tw-bg-white tw-rounded tw-shadow tw-p-7 tw-min-w-[400px] tw-overflow-y-auto\">\n <FormControl\n label={{\n children: 'Text',\n htmlFor: 'linkText',\n required: true,\n }}\n >\n <TextInput id=\"linkText\" value={state.text} placeholder=\"Link Text\" onChange={onTextChange} />\n </FormControl>\n\n {children}\n\n <div className=\"tw-mt-5\">\n <LinkInput\n url={state.url}\n newTab={state.newTab}\n onUrlChange={onUrlChange}\n onToggleTab={onToggleTab}\n isValidUrlOrEmpty={isValidUrlOrEmpty}\n appBridge={appBridge}\n />\n </div>\n <div className=\"tw-mt-3\">\n <div className={'tw-pt-5 tw-flex tw-gap-x-3 tw-justify-end tw-border-t tw-border-t-black-10'}>\n <Button\n onClick={onCancel}\n size={ButtonSize.Medium}\n style={ButtonStyle.Default}\n emphasis={ButtonEmphasis.Default}\n >\n Cancel\n </Button>\n <Button\n onClick={onSave}\n size={ButtonSize.Medium}\n icon={<IconCheckMark20 />}\n disabled={!hasValues || !isValidUrlOrEmpty(state?.url)}\n >\n Save\n </Button>\n </div>\n </div>\n </div>\n);\n"],"names":["InsertModal","state","onTextChange","onUrlChange","onToggleTab","onCancel","onSave","isValidUrlOrEmpty","hasValues","testId","appBridge","children","jsxs","jsx","FormControl","TextInput","LinkInput","Button","ButtonSize","ButtonStyle","ButtonEmphasis","IconCheckMark20"],"mappings":";;;AA8BO,MAAMA,IAAoC,CAAC;AAAA,EAC9C,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AACJ,MACK,gBAAAC,EAAA,OAAA,EAAI,gBAAcH,GAAQ,WAAU,+EACjC,UAAA;AAAA,EAAA,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,OAAO;AAAA,QACH,UAAU;AAAA,QACV,SAAS;AAAA,QACT,UAAU;AAAA,MACd;AAAA,MAEA,UAAA,gBAAAD,EAACE,GAAU,EAAA,IAAG,YAAW,OAAOd,EAAM,MAAM,aAAY,aAAY,UAAUC,EAAc,CAAA;AAAA,IAAA;AAAA,EAChG;AAAA,EAECS;AAAA,EAED,gBAAAE,EAAC,OAAI,EAAA,WAAU,WACX,UAAA,gBAAAA;AAAA,IAACG;AAAA,IAAA;AAAA,MACG,KAAKf,EAAM;AAAA,MACX,QAAQA,EAAM;AAAA,MACd,aAAAE;AAAA,MACA,aAAAC;AAAA,MACA,mBAAAG;AAAA,MACA,WAAAG;AAAA,IAAA;AAAA,EAAA,GAER;AAAA,oBACC,OAAI,EAAA,WAAU,WACX,UAAC,gBAAAE,EAAA,OAAA,EAAI,WAAW,8EACZ,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACI;AAAA,MAAA;AAAA,QACG,SAASZ;AAAA,QACT,MAAMa,EAAW;AAAA,QACjB,OAAOC,EAAY;AAAA,QACnB,UAAUC,EAAe;AAAA,QAC5B,UAAA;AAAA,MAAA;AAAA,IAED;AAAA,IACA,gBAAAP;AAAA,MAACI;AAAA,MAAA;AAAA,QACG,SAASX;AAAA,QACT,MAAMY,EAAW;AAAA,QACjB,wBAAOG,GAAgB,EAAA;AAAA,QACvB,UAAU,CAACb,KAAa,CAACD,EAAkBN,KAAA,gBAAAA,EAAO,GAAG;AAAA,QACxD,UAAA;AAAA,MAAA;AAAA,IAED;AAAA,EAAA,EAAA,CACJ,EACJ,CAAA;AAAA,EACJ,CAAA;"}
@@ -0,0 +1,40 @@
1
+ import { useEditorRef as f, useFloatingLinkSelectors as s, getPluginOptions as p, ELEMENT_LINK as m, useHotkeys as k, triggerFloatingLinkInsert as L, useVirtualFloatingLink as E, getSelectionBoundingClientRect as F, floatingLinkActions as r, useFloatingLinkEscape as I, useComposedRef as y } from "@udecode/plate";
2
+ import { useEffect as C } from "react";
3
+ import { useFocused as R } from "slate-react";
4
+ const B = ({ floatingOptions: l, ...n }) => {
5
+ const e = f(), o = R(), u = s().mode(), t = s().isOpen(e.id), { triggerFloatingLinkHotkeys: d } = p(e, m);
6
+ k(
7
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
8
+ d,
9
+ (c) => {
10
+ L(e, { focused: o }) && c.preventDefault();
11
+ },
12
+ {
13
+ enableOnContentEditable: !0
14
+ },
15
+ [o]
16
+ );
17
+ const { update: i, style: g, floating: a } = E({
18
+ editorId: e.id,
19
+ open: t && u === "insert",
20
+ getBoundingClientRect: F,
21
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
22
+ whileElementsMounted: () => {
23
+ },
24
+ ...l
25
+ });
26
+ return C(() => {
27
+ t ? (i(), r.updated(!0)) : r.updated(!1);
28
+ }, [t, i]), I(), {
29
+ style: {
30
+ ...g,
31
+ zIndex: 1e3
32
+ },
33
+ ...n,
34
+ ref: y(n.ref, a)
35
+ };
36
+ };
37
+ export {
38
+ B as useFloatingLinkInsert
39
+ };
40
+ //# sourceMappingURL=useFloatingLinkInsert.es.js.map