@frontify/guideline-blocks-settings 3.0.2 → 4.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/dist/_virtual/_rolldown/runtime.es.js +17 -0
  2. package/dist/components/Attachments/AttachmentItem.es.js +116 -168
  3. package/dist/components/Attachments/AttachmentItem.es.js.map +1 -1
  4. package/dist/components/Attachments/Attachments.es.js +145 -137
  5. package/dist/components/Attachments/Attachments.es.js.map +1 -1
  6. package/dist/components/Attachments/AttachmentsButtonTrigger.es.js +25 -28
  7. package/dist/components/Attachments/AttachmentsButtonTrigger.es.js.map +1 -1
  8. package/dist/components/BlockInjectButton/BlockInjectButton.es.js +114 -126
  9. package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -1
  10. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +53 -74
  11. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -1
  12. package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js +26 -31
  13. package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js.map +1 -1
  14. package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js +22 -25
  15. package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js.map +1 -1
  16. package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js +17 -28
  17. package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js.map +1 -1
  18. package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js +25 -35
  19. package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js.map +1 -1
  20. package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js +41 -34
  21. package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js.map +1 -1
  22. package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js +41 -36
  23. package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js.map +1 -1
  24. package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js +24 -33
  25. package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js.map +1 -1
  26. package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js +20 -11
  27. package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js.map +1 -1
  28. package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js +18 -10
  29. package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js.map +1 -1
  30. package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js +10 -12
  31. package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js.map +1 -1
  32. package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js +13 -13
  33. package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js.map +1 -1
  34. package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js +21 -19
  35. package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js.map +1 -1
  36. package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js +18 -25
  37. package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js.map +1 -1
  38. package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js +18 -17
  39. package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js.map +1 -1
  40. package/dist/components/BlockItemWrapper/constants.es.js +6 -6
  41. package/dist/components/BlockItemWrapper/constants.es.js.map +1 -1
  42. package/dist/components/Link/LinkInput.es.js +70 -63
  43. package/dist/components/Link/LinkInput.es.js.map +1 -1
  44. package/dist/components/Link/utils/getUrl.es.js +10 -12
  45. package/dist/components/Link/utils/getUrl.es.js.map +1 -1
  46. package/dist/components/Link/utils/relativeUrlRegex.es.js +6 -5
  47. package/dist/components/Link/utils/relativeUrlRegex.es.js.map +1 -1
  48. package/dist/components/Link/utils/url.es.js +21 -17
  49. package/dist/components/Link/utils/url.es.js.map +1 -1
  50. package/dist/components/RichTextEditor/RichTextEditor.es.js +61 -68
  51. package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -1
  52. package/dist/components/RichTextEditor/SerializedText.es.js +25 -22
  53. package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -1
  54. package/dist/components/RichTextEditor/constants.es.js +6 -5
  55. package/dist/components/RichTextEditor/constants.es.js.map +1 -1
  56. package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js +30 -37
  57. package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -1
  58. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +31 -39
  59. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -1
  60. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js +12 -11
  61. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js.map +1 -1
  62. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +19 -23
  63. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -1
  64. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +24 -26
  65. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -1
  66. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +46 -53
  67. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js.map +1 -1
  68. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js +52 -54
  69. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -1
  70. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +68 -68
  71. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js.map +1 -1
  72. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +91 -103
  73. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -1
  74. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js +26 -32
  75. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js.map +1 -1
  76. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +47 -53
  77. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js.map +1 -1
  78. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js +12 -18
  79. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js.map +1 -1
  80. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js +21 -25
  81. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js.map +1 -1
  82. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js +29 -37
  83. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js.map +1 -1
  84. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js +13 -17
  85. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js.map +1 -1
  86. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js +56 -62
  87. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -1
  88. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js +9 -12
  89. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +1 -1
  90. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js +23 -24
  91. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js.map +1 -1
  92. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js +28 -33
  93. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -1
  94. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js +61 -80
  95. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -1
  96. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js +23 -23
  97. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -1
  98. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js +18 -18
  99. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +1 -1
  100. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js +13 -12
  101. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +1 -1
  102. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js +9 -8
  103. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js.map +1 -1
  104. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js +11 -10
  105. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js.map +1 -1
  106. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js +85 -84
  107. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js.map +1 -1
  108. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js +13 -16
  109. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +1 -1
  110. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js +13 -16
  111. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js.map +1 -1
  112. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js +10 -13
  113. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +1 -1
  114. package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js +45 -51
  115. package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -1
  116. package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js +20 -22
  117. package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js.map +1 -1
  118. package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/helpers.es.js +12 -12
  119. package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/helpers.es.js.map +1 -1
  120. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +48 -57
  121. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -1
  122. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +46 -48
  123. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -1
  124. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +12 -8
  125. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js.map +1 -1
  126. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +62 -71
  127. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -1
  128. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +76 -77
  129. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -1
  130. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +17 -21
  131. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -1
  132. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +17 -10
  133. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -1
  134. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js +11 -10
  135. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js.map +1 -1
  136. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.es.js +22 -26
  137. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.es.js.map +1 -1
  138. package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js +6 -5
  139. package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js.map +1 -1
  140. package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +39 -40
  141. package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -1
  142. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js +10 -10
  143. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js.map +1 -1
  144. package/dist/components/RichTextEditor/plugins/OrderedListPlugin/index.es.js +26 -26
  145. package/dist/components/RichTextEditor/plugins/OrderedListPlugin/index.es.js.map +1 -1
  146. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +40 -46
  147. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -1
  148. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +40 -46
  149. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -1
  150. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +40 -46
  151. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -1
  152. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +41 -47
  153. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -1
  154. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +41 -47
  155. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -1
  156. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +41 -47
  157. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -1
  158. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +41 -47
  159. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -1
  160. package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js +44 -38
  161. package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js.map +1 -1
  162. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +41 -47
  163. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -1
  164. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +40 -46
  165. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -1
  166. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +45 -41
  167. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -1
  168. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +40 -48
  169. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -1
  170. package/dist/components/RichTextEditor/plugins/UnorderedListPlugin/index.es.js +29 -29
  171. package/dist/components/RichTextEditor/plugins/UnorderedListPlugin/index.es.js.map +1 -1
  172. package/dist/components/RichTextEditor/plugins/styles.es.js +167 -166
  173. package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -1
  174. package/dist/helpers/addHttps.es.js +12 -12
  175. package/dist/helpers/addHttps.es.js.map +1 -1
  176. package/dist/helpers/convertToRichTextValue.es.js +14 -6
  177. package/dist/helpers/convertToRichTextValue.es.js.map +1 -1
  178. package/dist/helpers/hasRichTextValue.es.js +13 -14
  179. package/dist/helpers/hasRichTextValue.es.js.map +1 -1
  180. package/dist/helpers/isDownloadable.es.js +6 -5
  181. package/dist/helpers/isDownloadable.es.js.map +1 -1
  182. package/dist/hooks/useAttachments.es.js +65 -73
  183. package/dist/hooks/useAttachments.es.js.map +1 -1
  184. package/dist/hooks/useIsInViewport.es.js +20 -21
  185. package/dist/hooks/useIsInViewport.es.js.map +1 -1
  186. package/dist/index.cjs.js +2 -10
  187. package/dist/index.cjs.js.map +1 -1
  188. package/dist/index.d.ts +16 -34
  189. package/dist/index.es.js +219 -213
  190. package/dist/index.es.js.map +1 -1
  191. package/dist/index.umd.js +2 -10
  192. package/dist/index.umd.js.map +1 -1
  193. package/dist/settings/background.es.js +20 -21
  194. package/dist/settings/background.es.js.map +1 -1
  195. package/dist/settings/border.es.js +62 -64
  196. package/dist/settings/border.es.js.map +1 -1
  197. package/dist/settings/borderRadius.es.js +49 -52
  198. package/dist/settings/borderRadius.es.js.map +1 -1
  199. package/dist/settings/borderRadiusExtended.es.js +58 -60
  200. package/dist/settings/borderRadiusExtended.es.js.map +1 -1
  201. package/dist/settings/defaultValues.es.js +16 -19
  202. package/dist/settings/defaultValues.es.js.map +1 -1
  203. package/dist/settings/gutter.es.js +48 -52
  204. package/dist/settings/gutter.es.js.map +1 -1
  205. package/dist/settings/margin.es.js +49 -52
  206. package/dist/settings/margin.es.js.map +1 -1
  207. package/dist/settings/marginExtended.es.js +62 -64
  208. package/dist/settings/marginExtended.es.js.map +1 -1
  209. package/dist/settings/padding.es.js +49 -52
  210. package/dist/settings/padding.es.js.map +1 -1
  211. package/dist/settings/paddingExtended.es.js +62 -64
  212. package/dist/settings/paddingExtended.es.js.map +1 -1
  213. package/dist/settings/securityDownloadable.es.js +16 -16
  214. package/dist/settings/securityDownloadable.es.js.map +1 -1
  215. package/dist/settings/securityGlobalControl.es.js +26 -32
  216. package/dist/settings/securityGlobalControl.es.js.map +1 -1
  217. package/dist/settings/types.es.js +41 -47
  218. package/dist/settings/types.es.js.map +1 -1
  219. package/dist/styles.css +2 -1
  220. package/dist/utilities/color/getReadableColor.es.js +15 -13
  221. package/dist/utilities/color/getReadableColor.es.js.map +1 -1
  222. package/dist/utilities/color/isDark.es.js +14 -9
  223. package/dist/utilities/color/isDark.es.js.map +1 -1
  224. package/dist/utilities/color/setAlpha.es.js +7 -6
  225. package/dist/utilities/color/setAlpha.es.js.map +1 -1
  226. package/dist/utilities/color/toColorObject.es.js +14 -8
  227. package/dist/utilities/color/toColorObject.es.js.map +1 -1
  228. package/dist/utilities/color/toHex8String.es.js +7 -6
  229. package/dist/utilities/color/toHex8String.es.js.map +1 -1
  230. package/dist/utilities/color/toHexString.es.js +7 -6
  231. package/dist/utilities/color/toHexString.es.js.map +1 -1
  232. package/dist/utilities/color/toRgbaString.es.js +7 -6
  233. package/dist/utilities/color/toRgbaString.es.js.map +1 -1
  234. package/dist/utilities/color/toShortRgba.es.js +18 -11
  235. package/dist/utilities/color/toShortRgba.es.js.map +1 -1
  236. package/dist/utilities/react/getBackgroundColorStyles.es.js +7 -8
  237. package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -1
  238. package/dist/utilities/react/getBorderStyles.es.js +12 -11
  239. package/dist/utilities/react/getBorderStyles.es.js.map +1 -1
  240. package/dist/utilities/react/getRadiusStyles.es.js +7 -8
  241. package/dist/utilities/react/getRadiusStyles.es.js.map +1 -1
  242. package/dist/utilities/react/joinClassNames.es.js +6 -5
  243. package/dist/utilities/react/joinClassNames.es.js.map +1 -1
  244. package/package.json +7 -9
  245. package/dist/components/Link/LinkSelector/DocumentLink.es.js +0 -64
  246. package/dist/components/Link/LinkSelector/DocumentLink.es.js.map +0 -1
  247. package/dist/components/Link/LinkSelector/DocumentLinks.es.js +0 -65
  248. package/dist/components/Link/LinkSelector/DocumentLinks.es.js.map +0 -1
  249. package/dist/components/Link/LinkSelector/LinkSelector.es.js +0 -72
  250. package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +0 -1
  251. package/dist/components/Link/LinkSelector/LoadingIndicator.es.js +0 -7
  252. package/dist/components/Link/LinkSelector/LoadingIndicator.es.js.map +0 -1
  253. package/dist/components/Link/LinkSelector/PageLink.es.js +0 -69
  254. package/dist/components/Link/LinkSelector/PageLink.es.js.map +0 -1
  255. package/dist/components/Link/LinkSelector/PageLinks.es.js +0 -38
  256. package/dist/components/Link/LinkSelector/PageLinks.es.js.map +0 -1
  257. package/dist/components/Link/LinkSelector/SectionLink.es.js +0 -26
  258. package/dist/components/Link/LinkSelector/SectionLink.es.js.map +0 -1
  259. package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js +0 -5
  260. package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DragPreviewContext.es.js","sources":["../../../../../src/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ReactNode, createContext, useContext } from 'react';\n\nconst DragPreviewContext = createContext(false);\nDragPreviewContext.displayName = 'DragPreviewContext';\n\nexport const DragPreviewContextProvider = ({\n children,\n isDragPreview,\n}: {\n children: ReactNode;\n isDragPreview: boolean;\n}) => <DragPreviewContext.Provider value={isDragPreview}>{children}</DragPreviewContext.Provider>;\n\nexport const useDragPreviewContext = () => useContext(DragPreviewContext);\n"],"names":["DragPreviewContext","createContext","DragPreviewContextProvider","children","isDragPreview","useDragPreviewContext","useContext"],"mappings":";;AAIA,MAAMA,IAAqBC,EAAc,EAAK;AAC9CD,EAAmB,cAAc;AAE1B,MAAME,IAA6B,CAAC;AAAA,EACvC,UAAAC;AAAA,EACA,eAAAC;AACJ,wBAGOJ,EAAmB,UAAnB,EAA4B,OAAOI,GAAgB,UAAAD,EAAA,CAAS,GAEtDE,IAAwB,MAAMC,EAAWN,CAAkB;"}
1
+ {"version":3,"file":"DragPreviewContext.es.js","names":[],"sources":["../../../../../src/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ReactNode, createContext, useContext } from 'react';\n\nconst DragPreviewContext = createContext(false);\nDragPreviewContext.displayName = 'DragPreviewContext';\n\nexport const DragPreviewContextProvider = ({\n children,\n isDragPreview,\n}: {\n children: ReactNode;\n isDragPreview: boolean;\n}) => <DragPreviewContext.Provider value={isDragPreview}>{children}</DragPreviewContext.Provider>;\n\nexport const useDragPreviewContext = () => useContext(DragPreviewContext);\n"],"mappings":";;;AAIA,IAAM,IAAqB,EAAc,EAAK;AAC9C,EAAmB,cAAc;AAEjC,IAAa,KAA8B,EACvC,aACA,uBAIE,kBAAC,EAAmB,UAApB;CAA6B,OAAO;CAAgB;AAAsC,CAAA,GAEnF,UAA8B,EAAW,CAAkB"}
@@ -1,20 +1,22 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { useMemo as l, useContext as i, createContext as s } from "react";
3
- const t = s({
4
- openFlyoutIds: [],
5
- setOpenFlyoutIds: () => console.error("No MultiFlyoutContext Provider found")
1
+ import { createContext as e, useContext as t, useMemo as n } from "react";
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ //#region src/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.tsx
4
+ var i = e({
5
+ openFlyoutIds: [],
6
+ setOpenFlyoutIds: () => console.error("No MultiFlyoutContext Provider found")
6
7
  });
7
- t.displayName = "MultiFlyoutContext";
8
- const C = ({
9
- children: r,
10
- openFlyoutIds: o,
11
- setOpenFlyoutIds: e
12
- }) => {
13
- const u = l(() => ({ openFlyoutIds: o, setOpenFlyoutIds: e }), [o, e]);
14
- return /* @__PURE__ */ n(t.Provider, { value: u, children: r });
15
- }, c = () => i(t);
16
- export {
17
- C as MultiFlyoutContextProvider,
18
- c as useMultiFlyoutContext
19
- };
20
- //# sourceMappingURL=MultiFlyoutContext.es.js.map
8
+ i.displayName = "MultiFlyoutContext";
9
+ var a = ({ children: e, openFlyoutIds: t, setOpenFlyoutIds: a }) => {
10
+ let o = n(() => ({
11
+ openFlyoutIds: t,
12
+ setOpenFlyoutIds: a
13
+ }), [t, a]);
14
+ return /* @__PURE__ */ r(i.Provider, {
15
+ value: o,
16
+ children: e
17
+ });
18
+ }, o = () => t(i);
19
+ //#endregion
20
+ export { a as MultiFlyoutContextProvider, o as useMultiFlyoutContext };
21
+
22
+ //# sourceMappingURL=MultiFlyoutContext.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MultiFlyoutContext.es.js","sources":["../../../../../src/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type Dispatch, type ReactNode, type SetStateAction, createContext, useContext, useMemo } from 'react';\n\nexport type MultiFlyoutContextType = {\n openFlyoutIds: string[];\n setOpenFlyoutIds: Dispatch<SetStateAction<string[]>>;\n};\n\nconst MultiFlyoutContext = createContext<MultiFlyoutContextType>({\n openFlyoutIds: [],\n setOpenFlyoutIds: () => console.error('No MultiFlyoutContext Provider found'),\n});\nMultiFlyoutContext.displayName = 'MultiFlyoutContext';\n\nexport const MultiFlyoutContextProvider = ({\n children,\n openFlyoutIds,\n setOpenFlyoutIds,\n}: { children: ReactNode } & MultiFlyoutContextType) => {\n const memoizedContext = useMemo(() => ({ openFlyoutIds, setOpenFlyoutIds }), [openFlyoutIds, setOpenFlyoutIds]);\n\n return <MultiFlyoutContext.Provider value={memoizedContext}>{children}</MultiFlyoutContext.Provider>;\n};\n\nexport const useMultiFlyoutContext = () => useContext(MultiFlyoutContext);\n"],"names":["MultiFlyoutContext","createContext","MultiFlyoutContextProvider","children","openFlyoutIds","setOpenFlyoutIds","memoizedContext","useMemo","useMultiFlyoutContext","useContext"],"mappings":";;AASA,MAAMA,IAAqBC,EAAsC;AAAA,EAC7D,eAAe,CAAA;AAAA,EACf,kBAAkB,MAAM,QAAQ,MAAM,sCAAsC;AAChF,CAAC;AACDD,EAAmB,cAAc;AAE1B,MAAME,IAA6B,CAAC;AAAA,EACvC,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,kBAAAC;AACJ,MAAwD;AACpD,QAAMC,IAAkBC,EAAQ,OAAO,EAAE,eAAAH,GAAe,kBAAAC,MAAqB,CAACD,GAAeC,CAAgB,CAAC;AAE9G,2BAAQL,EAAmB,UAAnB,EAA4B,OAAOM,GAAkB,UAAAH,GAAS;AAC1E,GAEaK,IAAwB,MAAMC,EAAWT,CAAkB;"}
1
+ {"version":3,"file":"MultiFlyoutContext.es.js","names":[],"sources":["../../../../../src/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type Dispatch, type ReactNode, type SetStateAction, createContext, useContext, useMemo } from 'react';\n\nexport type MultiFlyoutContextType = {\n openFlyoutIds: string[];\n setOpenFlyoutIds: Dispatch<SetStateAction<string[]>>;\n};\n\nconst MultiFlyoutContext = createContext<MultiFlyoutContextType>({\n openFlyoutIds: [],\n setOpenFlyoutIds: () => console.error('No MultiFlyoutContext Provider found'),\n});\nMultiFlyoutContext.displayName = 'MultiFlyoutContext';\n\nexport const MultiFlyoutContextProvider = ({\n children,\n openFlyoutIds,\n setOpenFlyoutIds,\n}: { children: ReactNode } & MultiFlyoutContextType) => {\n const memoizedContext = useMemo(() => ({ openFlyoutIds, setOpenFlyoutIds }), [openFlyoutIds, setOpenFlyoutIds]);\n\n return <MultiFlyoutContext.Provider value={memoizedContext}>{children}</MultiFlyoutContext.Provider>;\n};\n\nexport const useMultiFlyoutContext = () => useContext(MultiFlyoutContext);\n"],"mappings":";;;AASA,IAAM,IAAqB,EAAsC;CAC7D,eAAe,CAAC;CAChB,wBAAwB,QAAQ,MAAM,sCAAsC;AAChF,CAAC;AACD,EAAmB,cAAc;AAEjC,IAAa,KAA8B,EACvC,aACA,kBACA,0BACoD;CACpD,IAAM,IAAkB,SAAe;EAAE;EAAe;CAAiB,IAAI,CAAC,GAAe,CAAgB,CAAC;CAE9G,OAAO,kBAAC,EAAmB,UAApB;EAA6B,OAAO;EAAkB;CAAsC,CAAA;AACvG,GAEa,UAA8B,EAAW,CAAkB"}
@@ -1,26 +1,19 @@
1
- import { FOCUS_VISIBLE_STYLE as n } from "@frontify/fondue";
2
- import { joinClassNames as o } from "../../../utilities/react/joinClassNames.es.js";
3
- const s = (e, r) => {
4
- const t = [
5
- n,
6
- "tw-relative tw-inline-flex tw-items-center tw-justify-center",
7
- "tw-h-6 tw-p-1",
8
- "tw-rounded-medium",
9
- "tw-body-medium",
10
- "tw-gap-0.5",
11
- "focus-visible:tw-z-10"
12
- ];
13
- return r ? t.push(
14
- "tw-bg-container-secondary-active",
15
- "tw-text-container-secondary-on-secondary-container",
16
- e === "grab" ? "tw-cursor-grabbing" : "tw-cursor-pointer"
17
- ) : t.push(
18
- "hover:tw-bg-container-secondary-hover active:tw-bg-container-secondary-active",
19
- "tw-text-secondary hover:tw-text-container-secondary-on-secondary-container active:tw-text-container-secondary-on-secondary-container",
20
- e === "grab" ? "!tw-cursor-grab active:tw-cursor-grabbing" : "tw-cursor-pointer"
21
- ), o(t);
1
+ import { joinClassNames as e } from "../../../utilities/react/joinClassNames.es.js";
2
+ import { FOCUS_VISIBLE_STYLE as t } from "@frontify/fondue";
3
+ //#region src/components/BlockItemWrapper/Toolbar/helpers.ts
4
+ var n = (n, r) => {
5
+ let i = [
6
+ t,
7
+ "tw-relative tw-inline-flex tw-items-center tw-justify-center",
8
+ "tw-h-6 tw-p-1",
9
+ "tw-rounded-medium",
10
+ "tw-body-medium",
11
+ "tw-gap-0.5",
12
+ "focus-visible:tw-z-10"
13
+ ];
14
+ return r ? i.push("tw-bg-container-secondary-active", "tw-text-container-secondary-on-secondary-container", n === "grab" ? "tw-cursor-grabbing" : "tw-cursor-pointer") : i.push("hover:tw-bg-container-secondary-hover active:tw-bg-container-secondary-active", "tw-text-secondary hover:tw-text-container-secondary-on-secondary-container active:tw-text-container-secondary-on-secondary-container", n === "grab" ? "!tw-cursor-grab active:tw-cursor-grabbing" : "tw-cursor-pointer"), e(i);
22
15
  };
23
- export {
24
- s as getToolbarButtonClassNames
25
- };
26
- //# sourceMappingURL=helpers.es.js.map
16
+ //#endregion
17
+ export { n as getToolbarButtonClassNames };
18
+
19
+ //# sourceMappingURL=helpers.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.es.js","sources":["../../../../src/components/BlockItemWrapper/Toolbar/helpers.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { FOCUS_VISIBLE_STYLE } from '@frontify/fondue';\n\nimport { joinClassNames } from '../../../utilities';\n\nexport const getToolbarButtonClassNames = (cursor: 'grab' | 'pointer', forceActiveStyle?: boolean) => {\n const classNames = [\n FOCUS_VISIBLE_STYLE,\n 'tw-relative tw-inline-flex tw-items-center tw-justify-center',\n 'tw-h-6 tw-p-1',\n 'tw-rounded-medium',\n 'tw-body-medium',\n 'tw-gap-0.5',\n 'focus-visible:tw-z-10',\n ];\n\n if (forceActiveStyle) {\n classNames.push(\n 'tw-bg-container-secondary-active',\n 'tw-text-container-secondary-on-secondary-container',\n cursor === 'grab' ? 'tw-cursor-grabbing' : 'tw-cursor-pointer',\n );\n } else {\n classNames.push(\n 'hover:tw-bg-container-secondary-hover active:tw-bg-container-secondary-active',\n 'tw-text-secondary hover:tw-text-container-secondary-on-secondary-container active:tw-text-container-secondary-on-secondary-container',\n cursor === 'grab' ? '!tw-cursor-grab active:tw-cursor-grabbing' : 'tw-cursor-pointer',\n );\n }\n\n return joinClassNames(classNames);\n};\n"],"names":["getToolbarButtonClassNames","cursor","forceActiveStyle","classNames","FOCUS_VISIBLE_STYLE","joinClassNames"],"mappings":";;AAMO,MAAMA,IAA6B,CAACC,GAA4BC,MAA+B;AAClG,QAAMC,IAAa;AAAA,IACfC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAGJ,SAAIF,IACAC,EAAW;AAAA,IACP;AAAA,IACA;AAAA,IACAF,MAAW,SAAS,uBAAuB;AAAA,EAAA,IAG/CE,EAAW;AAAA,IACP;AAAA,IACA;AAAA,IACAF,MAAW,SAAS,8CAA8C;AAAA,EAAA,GAInEI,EAAeF,CAAU;AACpC;"}
1
+ {"version":3,"file":"helpers.es.js","names":[],"sources":["../../../../src/components/BlockItemWrapper/Toolbar/helpers.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { FOCUS_VISIBLE_STYLE } from '@frontify/fondue';\n\nimport { joinClassNames } from '../../../utilities';\n\nexport const getToolbarButtonClassNames = (cursor: 'grab' | 'pointer', forceActiveStyle?: boolean) => {\n const classNames = [\n FOCUS_VISIBLE_STYLE,\n 'tw-relative tw-inline-flex tw-items-center tw-justify-center',\n 'tw-h-6 tw-p-1',\n 'tw-rounded-medium',\n 'tw-body-medium',\n 'tw-gap-0.5',\n 'focus-visible:tw-z-10',\n ];\n\n if (forceActiveStyle) {\n classNames.push(\n 'tw-bg-container-secondary-active',\n 'tw-text-container-secondary-on-secondary-container',\n cursor === 'grab' ? 'tw-cursor-grabbing' : 'tw-cursor-pointer',\n );\n } else {\n classNames.push(\n 'hover:tw-bg-container-secondary-hover active:tw-bg-container-secondary-active',\n 'tw-text-secondary hover:tw-text-container-secondary-on-secondary-container active:tw-text-container-secondary-on-secondary-container',\n cursor === 'grab' ? '!tw-cursor-grab active:tw-cursor-grabbing' : 'tw-cursor-pointer',\n );\n }\n\n return joinClassNames(classNames);\n};\n"],"mappings":";;;AAMA,IAAa,KAA8B,GAA4B,MAA+B;CAClG,IAAM,IAAa;EACf;EACA;EACA;EACA;EACA;EACA;EACA;CACJ;CAgBA,OAdI,IACA,EAAW,KACP,oCACA,sDACA,MAAW,SAAS,uBAAuB,mBAC/C,IAEA,EAAW,KACP,iFACA,wIACA,MAAW,SAAS,8CAA8C,mBACtE,GAGG,EAAe,CAAU;AACpC"}
@@ -1,18 +1,19 @@
1
- import { useCallback as l } from "react";
2
- import { useMultiFlyoutContext as p } from "../context/MultiFlyoutContext.es.js";
3
- const m = (e) => {
4
- const { openFlyoutIds: s, setOpenFlyoutIds: t } = p(), o = l(
5
- (r) => {
6
- t((u) => {
7
- const n = u.filter((i) => i !== e);
8
- return r ? [...n, e] : n;
9
- });
10
- },
11
- [e, t]
12
- );
13
- return { isOpen: s.includes(e), onOpenChange: o };
1
+ import { useMultiFlyoutContext as e } from "../context/MultiFlyoutContext.es.js";
2
+ import { useCallback as t } from "react";
3
+ //#region src/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.ts
4
+ var n = (n) => {
5
+ let { openFlyoutIds: r, setOpenFlyoutIds: i } = e(), a = t((e) => {
6
+ i((t) => {
7
+ let r = t.filter((e) => e !== n);
8
+ return e ? [...r, n] : r;
9
+ });
10
+ }, [n, i]);
11
+ return {
12
+ isOpen: r.includes(n),
13
+ onOpenChange: a
14
+ };
14
15
  };
15
- export {
16
- m as useMultiFlyoutState
17
- };
18
- //# sourceMappingURL=useMultiFlyoutState.es.js.map
16
+ //#endregion
17
+ export { n as useMultiFlyoutState };
18
+
19
+ //# sourceMappingURL=useMultiFlyoutState.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMultiFlyoutState.es.js","sources":["../../../../../src/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useCallback } from 'react';\n\nimport { useMultiFlyoutContext } from '../context/MultiFlyoutContext';\n\nexport const useMultiFlyoutState = (flyoutId: string) => {\n const { openFlyoutIds, setOpenFlyoutIds } = useMultiFlyoutContext();\n\n const onOpenChange = useCallback(\n (isFlyoutOpen: boolean) => {\n setOpenFlyoutIds((currentIds) => {\n const filteredIds = currentIds.filter((id) => id !== flyoutId);\n if (!isFlyoutOpen) {\n return filteredIds;\n } else {\n return [...filteredIds, flyoutId];\n }\n });\n },\n [flyoutId, setOpenFlyoutIds],\n );\n\n return { isOpen: openFlyoutIds.includes(flyoutId), onOpenChange };\n};\n"],"names":["useMultiFlyoutState","flyoutId","openFlyoutIds","setOpenFlyoutIds","useMultiFlyoutContext","onOpenChange","useCallback","isFlyoutOpen","currentIds","filteredIds","id"],"mappings":";;AAMO,MAAMA,IAAsB,CAACC,MAAqB;AACrD,QAAM,EAAE,eAAAC,GAAe,kBAAAC,EAAA,IAAqBC,EAAA,GAEtCC,IAAeC;AAAA,IACjB,CAACC,MAA0B;AACvB,MAAAJ,EAAiB,CAACK,MAAe;AAC7B,cAAMC,IAAcD,EAAW,OAAO,CAACE,MAAOA,MAAOT,CAAQ;AAC7D,eAAKM,IAGM,CAAC,GAAGE,GAAaR,CAAQ,IAFzBQ;AAAA,MAIf,CAAC;AAAA,IACL;AAAA,IACA,CAACR,GAAUE,CAAgB;AAAA,EAAA;AAG/B,SAAO,EAAE,QAAQD,EAAc,SAASD,CAAQ,GAAG,cAAAI,EAAA;AACvD;"}
1
+ {"version":3,"file":"useMultiFlyoutState.es.js","names":[],"sources":["../../../../../src/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useCallback } from 'react';\n\nimport { useMultiFlyoutContext } from '../context/MultiFlyoutContext';\n\nexport const useMultiFlyoutState = (flyoutId: string) => {\n const { openFlyoutIds, setOpenFlyoutIds } = useMultiFlyoutContext();\n\n const onOpenChange = useCallback(\n (isFlyoutOpen: boolean) => {\n setOpenFlyoutIds((currentIds) => {\n const filteredIds = currentIds.filter((id) => id !== flyoutId);\n if (!isFlyoutOpen) {\n return filteredIds;\n } else {\n return [...filteredIds, flyoutId];\n }\n });\n },\n [flyoutId, setOpenFlyoutIds],\n );\n\n return { isOpen: openFlyoutIds.includes(flyoutId), onOpenChange };\n};\n"],"mappings":";;;AAMA,IAAa,KAAuB,MAAqB;CACrD,IAAM,EAAE,kBAAe,wBAAqB,EAAsB,GAE5D,IAAe,GAChB,MAA0B;EACvB,GAAkB,MAAe;GAC7B,IAAM,IAAc,EAAW,QAAQ,MAAO,MAAO,CAAQ;GAEzD,OADC,IAGM,CAAC,GAAG,GAAa,CAAQ,IAFzB;EAIf,CAAC;CACL,GACA,CAAC,GAAU,CAAgB,CAC/B;CAEA,OAAO;EAAE,QAAQ,EAAc,SAAS,CAAQ;EAAG;CAAa;AACpE"}
@@ -1,6 +1,6 @@
1
- const o = "Drag or press ↵ to move", t = "Move with ↑↓←→ and confirm with ↵";
2
- export {
3
- t as DEFAULT_DRAGGING_TOOLTIP,
4
- o as DEFAULT_DRAG_TOOLTIP
5
- };
6
- //# sourceMappingURL=constants.es.js.map
1
+ //#region src/components/BlockItemWrapper/constants.ts
2
+ var e = "Drag or press ↵ to move", t = "Move with ↑↓←→ and confirm with ↵";
3
+ //#endregion
4
+ export { t as DEFAULT_DRAGGING_TOOLTIP, e as DEFAULT_DRAG_TOOLTIP };
5
+
6
+ //# sourceMappingURL=constants.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.es.js","sources":["../../../src/components/BlockItemWrapper/constants.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const DEFAULT_DRAG_TOOLTIP = 'Drag or press ↵ to move';\nexport const DEFAULT_DRAGGING_TOOLTIP = 'Move with ↑↓←→ and confirm with ↵';\n"],"names":["DEFAULT_DRAG_TOOLTIP","DEFAULT_DRAGGING_TOOLTIP"],"mappings":"AAEO,MAAMA,IAAuB,2BACvBC,IAA2B;"}
1
+ {"version":3,"file":"constants.es.js","names":[],"sources":["../../../src/components/BlockItemWrapper/constants.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const DEFAULT_DRAG_TOOLTIP = 'Drag or press ↵ to move';\nexport const DEFAULT_DRAGGING_TOOLTIP = 'Move with ↑↓←→ and confirm with ↵';\n"],"mappings":";AAEA,IAAa,IAAuB,2BACvB,IAA2B"}
@@ -1,64 +1,71 @@
1
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
- import { FormControl as g } from "@frontify/fondue";
3
- import { TextInput as x, Checkbox as D, Label as v } from "@frontify/fondue/components";
4
- import { isValidUrlOrEmpty as b } from "./utils/url.es.js";
5
- import { LinkSelector as I } from "./LinkSelector/LinkSelector.es.js";
6
- const N = ({
7
- onUrlChange: i,
8
- onToggleTab: r,
9
- isValidUrlOrEmpty: l,
10
- appBridge: n,
11
- placeholder: s,
12
- newTab: m,
13
- url: o = "",
14
- required: d,
15
- info: a,
16
- label: u,
17
- buttonSize: p,
18
- hideInternalLinkButton: h
19
- }) => {
20
- const w = l ? l(o) : b(o);
21
- return /* @__PURE__ */ c("div", { "data-test-id": "link-input", children: [
22
- /* @__PURE__ */ t(
23
- g,
24
- {
25
- label: {
26
- children: u,
27
- htmlFor: "url",
28
- required: d,
29
- tooltip: a ? { content: a, position: "top" } : void 0
30
- },
31
- children: /* @__PURE__ */ t(
32
- x,
33
- {
34
- "data-test-id": "text-input",
35
- id: "url",
36
- value: o,
37
- onChange: (e) => i?.(e.target.value),
38
- placeholder: s ?? "https://example.com"
39
- }
40
- )
41
- }
42
- ),
43
- !w && /* @__PURE__ */ t("div", { className: "tw-text-error tw-mt-1 tw-text-small", children: "Please enter a valid URL." }),
44
- !h && /* @__PURE__ */ t("div", { className: "tw-mt-3", children: /* @__PURE__ */ t(
45
- I,
46
- {
47
- url: o,
48
- onUrlChange: i,
49
- buttonSize: p ?? "medium",
50
- getAllDocuments: () => n.getAllDocuments(),
51
- getDocumentPagesByDocumentId: (e) => n.getDocumentPagesByDocumentId(e),
52
- getDocumentSectionsByDocumentPageId: (e) => n.getDocumentSectionsByDocumentPageId(e)
53
- }
54
- ) }),
55
- /* @__PURE__ */ c("div", { className: "tw-mt-3 tw-flex tw-items-center tw-gap-1.5", children: [
56
- /* @__PURE__ */ t(D, { id: "new-tab", value: m, onChange: () => r?.(!m) }),
57
- /* @__PURE__ */ t(v, { id: "new-tab-label", htmlFor: "new-tab", className: "tw-whitespace-nowrap", children: "Open in new tab" })
58
- ] })
59
- ] });
1
+ import { isValidUrlOrEmpty as e } from "./utils/url.es.js";
2
+ import { useLinkChooser as t } from "@frontify/app-bridge";
3
+ import { Button as n, Checkbox as r, Label as i, TextInput as a } from "@frontify/fondue/components";
4
+ import { IconLink as o } from "@frontify/fondue/icons";
5
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
6
+ import { FormControl as l } from "@frontify/fondue";
7
+ //#region src/components/Link/LinkInput.tsx
8
+ var u = ({ onUrlChange: u, onToggleTab: d, isValidUrlOrEmpty: f, appBridge: p, placeholder: m, newTab: h, url: g = "", required: _, info: v, label: y, buttonSize: b, hideInternalLinkButton: x }) => {
9
+ let S = f ? f(g) : e(g), { openLinkChooser: C, closeLinkChooser: w } = t(p);
10
+ return /* @__PURE__ */ c("div", {
11
+ "data-test-id": "link-input",
12
+ children: [
13
+ /* @__PURE__ */ s(l, {
14
+ label: {
15
+ children: y,
16
+ htmlFor: "url",
17
+ required: _,
18
+ tooltip: v ? {
19
+ content: v,
20
+ position: "top"
21
+ } : void 0
22
+ },
23
+ children: /* @__PURE__ */ s(a, {
24
+ "data-test-id": "text-input",
25
+ id: "url",
26
+ value: g,
27
+ onChange: (e) => u?.(e.target.value),
28
+ placeholder: m ?? "https://example.com"
29
+ })
30
+ }),
31
+ !S && /* @__PURE__ */ s("div", {
32
+ className: "tw-text-error tw-mt-1 tw-text-small",
33
+ children: "Please enter a valid URL."
34
+ }),
35
+ !x && /* @__PURE__ */ s("div", {
36
+ className: "tw-mt-3",
37
+ onPointerDown: (e) => {
38
+ e.preventDefault();
39
+ },
40
+ children: /* @__PURE__ */ c(n, {
41
+ "data-test-id": "internal-link-chooser-button",
42
+ size: b ?? "medium",
43
+ emphasis: "default",
44
+ onPress: async () => {
45
+ await C((e) => {
46
+ u?.(e), w().catch(console.error);
47
+ }, { selectedUrl: g });
48
+ },
49
+ children: [/* @__PURE__ */ s(o, { size: "20" }), "Internal link"]
50
+ })
51
+ }),
52
+ /* @__PURE__ */ c("div", {
53
+ className: "tw-mt-3 tw-flex tw-items-center tw-gap-1.5",
54
+ children: [/* @__PURE__ */ s(r, {
55
+ id: "new-tab",
56
+ value: h,
57
+ onChange: () => d?.(!h)
58
+ }), /* @__PURE__ */ s(i, {
59
+ id: "new-tab-label",
60
+ htmlFor: "new-tab",
61
+ className: "tw-whitespace-nowrap",
62
+ children: "Open in new tab"
63
+ })]
64
+ })
65
+ ]
66
+ });
60
67
  };
61
- export {
62
- N as LinkInput
63
- };
64
- //# sourceMappingURL=LinkInput.es.js.map
68
+ //#endregion
69
+ export { u as LinkInput };
70
+
71
+ //# sourceMappingURL=LinkInput.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkInput.es.js","sources":["../../../src/components/Link/LinkInput.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport { FormControl } from '@frontify/fondue';\nimport { TextInput, Checkbox, Label } from '@frontify/fondue/components';\n\nimport { LinkSelector } from './LinkSelector';\nimport { isValidUrlOrEmpty as internalIsValidUrlOrEmpty } from './utils';\n\ntype LinkInputProps = {\n url?: string;\n info?: string;\n label?: string;\n required?: boolean;\n newTab?: boolean;\n onUrlChange?: (value: string) => void;\n onToggleTab?: (checked: boolean) => void;\n isValidUrlOrEmpty?: (url: string) => boolean;\n appBridge: AppBridgeBlock;\n placeholder?: string;\n buttonSize?: 'small' | 'medium' | 'large';\n hideInternalLinkButton?: boolean;\n};\n\nexport const LinkInput = ({\n onUrlChange,\n onToggleTab,\n isValidUrlOrEmpty,\n appBridge,\n placeholder,\n newTab,\n url = '',\n required,\n info,\n label,\n buttonSize,\n hideInternalLinkButton,\n}: LinkInputProps) => {\n const isUrlValid = isValidUrlOrEmpty ? isValidUrlOrEmpty(url) : internalIsValidUrlOrEmpty(url);\n return (\n <div data-test-id=\"link-input\">\n <FormControl\n label={{\n children: label,\n htmlFor: 'url',\n required,\n tooltip: info ? { content: info, position: 'top' } : undefined,\n }}\n >\n <TextInput\n data-test-id=\"text-input\"\n id=\"url\"\n value={url}\n onChange={(event) => onUrlChange?.(event.target.value)}\n placeholder={placeholder ?? 'https://example.com'}\n />\n </FormControl>\n {!isUrlValid && <div className=\"tw-text-error tw-mt-1 tw-text-small\">Please enter a valid URL.</div>}\n\n {!hideInternalLinkButton && (\n <div className=\"tw-mt-3\">\n <LinkSelector\n url={url}\n onUrlChange={onUrlChange}\n buttonSize={buttonSize ?? 'medium'}\n getAllDocuments={() => appBridge.getAllDocuments()}\n getDocumentPagesByDocumentId={(documentId) =>\n appBridge.getDocumentPagesByDocumentId(documentId)\n }\n getDocumentSectionsByDocumentPageId={(documentPageId) =>\n appBridge.getDocumentSectionsByDocumentPageId(documentPageId)\n }\n />\n </div>\n )}\n\n <div className=\"tw-mt-3 tw-flex tw-items-center tw-gap-1.5\">\n <Checkbox id=\"new-tab\" value={newTab} onChange={() => onToggleTab?.(!newTab)} />\n <Label id=\"new-tab-label\" htmlFor=\"new-tab\" className=\"tw-whitespace-nowrap\">\n Open in new tab\n </Label>\n </div>\n </div>\n );\n};\n"],"names":["LinkInput","onUrlChange","onToggleTab","isValidUrlOrEmpty","appBridge","placeholder","newTab","url","required","info","label","buttonSize","hideInternalLinkButton","isUrlValid","internalIsValidUrlOrEmpty","jsxs","jsx","FormControl","TextInput","event","LinkSelector","documentId","documentPageId","Checkbox","Label"],"mappings":";;;;;AAwBO,MAAMA,IAAY,CAAC;AAAA,EACtB,aAAAC;AAAA,EACA,aAAAC;AAAA,EAAA,mBACAC;AAAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,KAAAC,IAAM;AAAA,EACN,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,wBAAAC;AACJ,MAAsB;AAClB,QAAMC,IAAaV,IAAoBA,EAAkBI,CAAG,IAAIO,EAA0BP,CAAG;AAC7F,SACI,gBAAAQ,EAAC,OAAA,EAAI,gBAAa,cACd,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACG,OAAO;AAAA,UACH,UAAUP;AAAA,UACV,SAAS;AAAA,UACT,UAAAF;AAAA,UACA,SAASC,IAAO,EAAE,SAASA,GAAM,UAAU,UAAU;AAAA,QAAA;AAAA,QAGzD,UAAA,gBAAAO;AAAA,UAACE;AAAA,UAAA;AAAA,YACG,gBAAa;AAAA,YACb,IAAG;AAAA,YACH,OAAOX;AAAA,YACP,UAAU,CAACY,MAAUlB,IAAckB,EAAM,OAAO,KAAK;AAAA,YACrD,aAAad,KAAe;AAAA,UAAA;AAAA,QAAA;AAAA,MAChC;AAAA,IAAA;AAAA,IAEH,CAACQ,KAAc,gBAAAG,EAAC,OAAA,EAAI,WAAU,uCAAsC,UAAA,6BAAyB;AAAA,IAE7F,CAACJ,KACE,gBAAAI,EAAC,OAAA,EAAI,WAAU,WACX,UAAA,gBAAAA;AAAA,MAACI;AAAA,MAAA;AAAA,QACG,KAAAb;AAAA,QACA,aAAAN;AAAA,QACA,YAAYU,KAAc;AAAA,QAC1B,iBAAiB,MAAMP,EAAU,gBAAA;AAAA,QACjC,8BAA8B,CAACiB,MAC3BjB,EAAU,6BAA6BiB,CAAU;AAAA,QAErD,qCAAqC,CAACC,MAClClB,EAAU,oCAAoCkB,CAAc;AAAA,MAAA;AAAA,IAAA,GAGxE;AAAA,IAGJ,gBAAAP,EAAC,OAAA,EAAI,WAAU,8CACX,UAAA;AAAA,MAAA,gBAAAC,EAACO,GAAA,EAAS,IAAG,WAAU,OAAOjB,GAAQ,UAAU,MAAMJ,IAAc,CAACI,CAAM,EAAA,CAAG;AAAA,MAC9E,gBAAAU,EAACQ,KAAM,IAAG,iBAAgB,SAAQ,WAAU,WAAU,wBAAuB,UAAA,kBAAA,CAE7E;AAAA,IAAA,EAAA,CACJ;AAAA,EAAA,GACJ;AAER;"}
1
+ {"version":3,"file":"LinkInput.es.js","names":[],"sources":["../../../src/components/Link/LinkInput.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock, useLinkChooser } from '@frontify/app-bridge';\nimport { FormControl } from '@frontify/fondue';\nimport { TextInput, Checkbox, Label, Button } from '@frontify/fondue/components';\nimport { IconLink } from '@frontify/fondue/icons';\n\nimport { isValidUrlOrEmpty as internalIsValidUrlOrEmpty } from './utils';\n\ntype LinkInputProps = {\n url?: string;\n info?: string;\n label?: string;\n required?: boolean;\n newTab?: boolean;\n onUrlChange?: (value: string) => void;\n onToggleTab?: (checked: boolean) => void;\n isValidUrlOrEmpty?: (url: string) => boolean;\n appBridge: AppBridgeBlock;\n placeholder?: string;\n buttonSize?: 'small' | 'medium' | 'large';\n hideInternalLinkButton?: boolean;\n};\n\nexport const LinkInput = ({\n onUrlChange,\n onToggleTab,\n isValidUrlOrEmpty,\n appBridge,\n placeholder,\n newTab,\n url = '',\n required,\n info,\n label,\n buttonSize,\n hideInternalLinkButton,\n}: LinkInputProps) => {\n const isUrlValid = isValidUrlOrEmpty ? isValidUrlOrEmpty(url) : internalIsValidUrlOrEmpty(url);\n const { openLinkChooser, closeLinkChooser } = useLinkChooser(appBridge);\n\n const onOpenLinkChooser = async () => {\n await openLinkChooser(\n (chosenUrl: string) => {\n onUrlChange?.(chosenUrl);\n closeLinkChooser().catch(console.error);\n },\n { selectedUrl: url },\n );\n };\n\n return (\n <div data-test-id=\"link-input\">\n <FormControl\n label={{\n children: label,\n htmlFor: 'url',\n required,\n tooltip: info ? { content: info, position: 'top' } : undefined,\n }}\n >\n <TextInput\n data-test-id=\"text-input\"\n id=\"url\"\n value={url}\n onChange={(event) => onUrlChange?.(event.target.value)}\n placeholder={placeholder ?? 'https://example.com'}\n />\n </FormControl>\n {!isUrlValid && <div className=\"tw-text-error tw-mt-1 tw-text-small\">Please enter a valid URL.</div>}\n\n {!hideInternalLinkButton && (\n // oxlint-disable-next-line jsx-a11y-x/no-static-element-interactions\n <div\n className=\"tw-mt-3\"\n onPointerDown={(event) => {\n event.preventDefault();\n }}\n >\n <Button\n data-test-id=\"internal-link-chooser-button\"\n size={buttonSize ?? 'medium'}\n emphasis=\"default\"\n onPress={onOpenLinkChooser}\n >\n <IconLink size=\"20\" />\n Internal link\n </Button>\n </div>\n )}\n\n <div className=\"tw-mt-3 tw-flex tw-items-center tw-gap-1.5\">\n <Checkbox id=\"new-tab\" value={newTab} onChange={() => onToggleTab?.(!newTab)} />\n <Label id=\"new-tab-label\" htmlFor=\"new-tab\" className=\"tw-whitespace-nowrap\">\n Open in new tab\n </Label>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;AAwBA,IAAa,KAAa,EACtB,gBACA,gBACA,mBAAA,GACA,cACA,gBACA,WACA,SAAM,IACN,aACA,SACA,UACA,eACA,gCACkB;CAClB,IAAM,IAAa,IAAoB,EAAkB,CAAG,IAAI,EAA0B,CAAG,GACvF,EAAE,oBAAiB,wBAAqB,EAAe,CAAS;CAYtE,OACI,kBAAC,OAAD;EAAK,gBAAa;EAAlB,UAAA;GACI,kBAAC,GAAD;IACI,OAAO;KACH,UAAU;KACV,SAAS;KACT;KACA,SAAS,IAAO;MAAE,SAAS;MAAM,UAAU;KAAM,IAAI,KAAA;IACzD;IAEA,UAAA,kBAAC,GAAD;KACI,gBAAa;KACb,IAAG;KACH,OAAO;KACP,WAAW,MAAU,IAAc,EAAM,OAAO,KAAK;KACrD,aAAa,KAAe;IAC/B,CAAA;GACQ,CAAA;GACZ,CAAC,KAAc,kBAAC,OAAD;IAAK,WAAU;IAAsC,UAAA;GAA8B,CAAA;GAElG,CAAC,KAEE,kBAAC,OAAD;IACI,WAAU;IACV,gBAAgB,MAAU;KACtB,EAAM,eAAe;IACzB;IAEA,UAAA,kBAAC,GAAD;KACI,gBAAa;KACb,MAAM,KAAc;KACpB,UAAS;KACT,SAAS,YA1CS;MAClC,MAAM,GACD,MAAsB;OAEnB,AADA,IAAc,CAAS,GACvB,EAAiB,CAAC,CAAC,MAAM,QAAQ,KAAK;MAC1C,GACA,EAAE,aAAa,EAAI,CACvB;KACJ;KA8BgB,UAAA,CAMI,kBAAC,GAAD,EAAU,MAAK,KAAM,CAAA,GAAC,eAElB;;GACP,CAAA;GAGT,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACI,kBAAC,GAAD;KAAU,IAAG;KAAU,OAAO;KAAQ,gBAAgB,IAAc,CAAC,CAAM;IAAI,CAAA,GAC/E,kBAAC,GAAD;KAAO,IAAG;KAAgB,SAAQ;KAAU,WAAU;KAAuB,UAAA;IAEtE,CAAA,CACN;;EACJ;;AAEb"}
@@ -1,12 +1,10 @@
1
- import { getAboveNode as o, ELEMENT_LINK as c } from "@frontify/fondue/rte";
2
- const t = (r, e) => {
3
- const n = o(r, { match: { type: c } });
4
- return Array.isArray(n) ? e(n[0]) : "";
5
- }, u = (r) => t(r, (e) => e.chosenLink?.searchResult?.link || ""), L = (r) => t(r, (e) => e.url || ""), s = (r) => r.url || r.chosenLink?.searchResult?.link || "", l = (r) => t(r, s);
6
- export {
7
- u as getLegacyUrl,
8
- l as getLinkFromEditor,
9
- L as getUrl,
10
- s as getUrlFromLinkOrLegacyLink
11
- };
12
- //# sourceMappingURL=getUrl.es.js.map
1
+ import { ELEMENT_LINK as e, getAboveNode as t } from "@frontify/fondue/rte";
2
+ //#region src/components/Link/utils/getUrl.ts
3
+ var n = (n, r) => {
4
+ let i = t(n, { match: { type: e } });
5
+ return Array.isArray(i) ? r(i[0]) : "";
6
+ }, r = (e) => n(e, (e) => e.chosenLink?.searchResult?.link || ""), i = (e) => n(e, (e) => e.url || ""), a = (e) => e.url || e.chosenLink?.searchResult?.link || "", o = (e) => n(e, a);
7
+ //#endregion
8
+ export { r as getLegacyUrl, o as getLinkFromEditor, i as getUrl, a as getUrlFromLinkOrLegacyLink };
9
+
10
+ //# sourceMappingURL=getUrl.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getUrl.es.js","sources":["../../../../src/components/Link/utils/getUrl.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ELEMENT_LINK, type PlateEditor, getAboveNode } from '@frontify/fondue/rte';\n\nimport { type TLinkElement } from '../../RichTextEditor/plugins/LinkPlugin/types';\n\nconst getLinkNode = (editor: PlateEditor, cb: (link: TLinkElement) => string): string => {\n const linkNode = getAboveNode<TLinkElement>(editor, { match: { type: ELEMENT_LINK } });\n\n if (!Array.isArray(linkNode)) {\n return '';\n }\n\n return cb(linkNode[0]);\n};\n\nexport const getLegacyUrl = (editor: PlateEditor) => {\n return getLinkNode(editor, (link) => link.chosenLink?.searchResult?.link || '');\n};\n\nexport const getUrl = (editor: PlateEditor) => {\n return getLinkNode(editor, (link) => link.url || '');\n};\n\nexport const getUrlFromLinkOrLegacyLink = (link: TLinkElement): string => {\n return link.url || link.chosenLink?.searchResult?.link || '';\n};\n\nexport const getLinkFromEditor = (editor: PlateEditor) => {\n return getLinkNode(editor, getUrlFromLinkOrLegacyLink);\n};\n"],"names":["getLinkNode","editor","cb","linkNode","getAboveNode","ELEMENT_LINK","getLegacyUrl","link","getUrl","getUrlFromLinkOrLegacyLink","getLinkFromEditor"],"mappings":";AAMA,MAAMA,IAAc,CAACC,GAAqBC,MAA+C;AACrF,QAAMC,IAAWC,EAA2BH,GAAQ,EAAE,OAAO,EAAE,MAAMI,EAAA,GAAgB;AAErF,SAAK,MAAM,QAAQF,CAAQ,IAIpBD,EAAGC,EAAS,CAAC,CAAC,IAHV;AAIf,GAEaG,IAAe,CAACL,MAClBD,EAAYC,GAAQ,CAACM,MAASA,EAAK,YAAY,cAAc,QAAQ,EAAE,GAGrEC,IAAS,CAACP,MACZD,EAAYC,GAAQ,CAACM,MAASA,EAAK,OAAO,EAAE,GAG1CE,IAA6B,CAACF,MAChCA,EAAK,OAAOA,EAAK,YAAY,cAAc,QAAQ,IAGjDG,IAAoB,CAACT,MACvBD,EAAYC,GAAQQ,CAA0B;"}
1
+ {"version":3,"file":"getUrl.es.js","names":[],"sources":["../../../../src/components/Link/utils/getUrl.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ELEMENT_LINK, type PlateEditor, getAboveNode } from '@frontify/fondue/rte';\n\nimport { type TLinkElement } from '../../RichTextEditor/plugins/LinkPlugin/types';\n\nconst getLinkNode = (editor: PlateEditor, cb: (link: TLinkElement) => string): string => {\n const linkNode = getAboveNode<TLinkElement>(editor, { match: { type: ELEMENT_LINK } });\n\n if (!Array.isArray(linkNode)) {\n return '';\n }\n\n return cb(linkNode[0]);\n};\n\nexport const getLegacyUrl = (editor: PlateEditor) => {\n return getLinkNode(editor, (link) => link.chosenLink?.searchResult?.link || '');\n};\n\nexport const getUrl = (editor: PlateEditor) => {\n return getLinkNode(editor, (link) => link.url || '');\n};\n\nexport const getUrlFromLinkOrLegacyLink = (link: TLinkElement): string => {\n return link.url || link.chosenLink?.searchResult?.link || '';\n};\n\nexport const getLinkFromEditor = (editor: PlateEditor) => {\n return getLinkNode(editor, getUrlFromLinkOrLegacyLink);\n};\n"],"mappings":";;AAMA,IAAM,KAAe,GAAqB,MAA+C;CACrF,IAAM,IAAW,EAA2B,GAAQ,EAAE,OAAO,EAAE,MAAM,EAAa,EAAE,CAAC;CAMrF,OAJK,MAAM,QAAQ,CAAQ,IAIpB,EAAG,EAAS,EAAE,IAHV;AAIf,GAEa,KAAgB,MAClB,EAAY,IAAS,MAAS,EAAK,YAAY,cAAc,QAAQ,EAAE,GAGrE,KAAU,MACZ,EAAY,IAAS,MAAS,EAAK,OAAO,EAAE,GAG1C,KAA8B,MAChC,EAAK,OAAO,EAAK,YAAY,cAAc,QAAQ,IAGjD,KAAqB,MACvB,EAAY,GAAQ,CAA0B"}
@@ -1,5 +1,6 @@
1
- const e = /^\/(document|r)\/\S+$/i;
2
- export {
3
- e as relativeUrlRegex
4
- };
5
- //# sourceMappingURL=relativeUrlRegex.es.js.map
1
+ //#region src/components/Link/utils/relativeUrlRegex.ts
2
+ var e = /^\/(document|r)\/\S+$/i;
3
+ //#endregion
4
+ export { e as relativeUrlRegex };
5
+
6
+ //# sourceMappingURL=relativeUrlRegex.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"relativeUrlRegex.es.js","sources":["../../../../src/components/Link/utils/relativeUrlRegex.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const relativeUrlRegex = /^\\/(document|r)\\/\\S+$/i;\n"],"names":["relativeUrlRegex"],"mappings":"AAEO,MAAMA,IAAmB;"}
1
+ {"version":3,"file":"relativeUrlRegex.es.js","names":[],"sources":["../../../../src/components/Link/utils/relativeUrlRegex.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const relativeUrlRegex = /^\\/(document|r)\\/\\S+$/i;\n"],"mappings":";AAEA,IAAa,IAAmB"}
@@ -1,17 +1,21 @@
1
- import { relativeUrlRegex as o } from "./relativeUrlRegex.es.js";
2
- import { addHttps as e } from "../../../helpers/addHttps.es.js";
3
- const l = (t) => {
4
- if (o.test(t))
5
- return !0;
6
- try {
7
- const r = new URL(t);
8
- return ["http:", "https:", "mailto:", "tel:"].includes(r.protocol) && r.pathname !== "";
9
- } catch {
10
- return !1;
11
- }
12
- }, n = (t) => l(e(t)) || t === "";
13
- export {
14
- l as isValidUrl,
15
- n as isValidUrlOrEmpty
16
- };
17
- //# sourceMappingURL=url.es.js.map
1
+ import { relativeUrlRegex as e } from "./relativeUrlRegex.es.js";
2
+ import { addHttps as t } from "../../../helpers/addHttps.es.js";
3
+ //#region src/components/Link/utils/url.ts
4
+ var n = (t) => {
5
+ if (e.test(t)) return !0;
6
+ try {
7
+ let e = new URL(t);
8
+ return [
9
+ "http:",
10
+ "https:",
11
+ "mailto:",
12
+ "tel:"
13
+ ].includes(e.protocol) && e.pathname !== "";
14
+ } catch {
15
+ return !1;
16
+ }
17
+ }, r = (e) => n(t(e)) || e === "";
18
+ //#endregion
19
+ export { n as isValidUrl, r as isValidUrlOrEmpty };
20
+
21
+ //# sourceMappingURL=url.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"url.es.js","sources":["../../../../src/components/Link/utils/url.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { addHttps } from '../../../helpers';\n\nimport { relativeUrlRegex } from './relativeUrlRegex';\n\nexport const isValidUrl = (url: string) => {\n if (relativeUrlRegex.test(url)) {\n return true;\n }\n try {\n const parsedUrl = new URL(url);\n const validProtocols = ['http:', 'https:', 'mailto:', 'tel:'];\n return validProtocols.includes(parsedUrl.protocol) && parsedUrl.pathname !== '';\n } catch {\n return false;\n }\n};\n\nexport const isValidUrlOrEmpty = (url: string): boolean => {\n return isValidUrl(addHttps(url)) || url === '';\n};\n"],"names":["isValidUrl","url","relativeUrlRegex","parsedUrl","isValidUrlOrEmpty","addHttps"],"mappings":";;AAMO,MAAMA,IAAa,CAACC,MAAgB;AACvC,MAAIC,EAAiB,KAAKD,CAAG;AACzB,WAAO;AAEX,MAAI;AACA,UAAME,IAAY,IAAI,IAAIF,CAAG;AAE7B,WADuB,CAAC,SAAS,UAAU,WAAW,MAAM,EACtC,SAASE,EAAU,QAAQ,KAAKA,EAAU,aAAa;AAAA,EACjF,QAAQ;AACJ,WAAO;AAAA,EACX;AACJ,GAEaC,IAAoB,CAACH,MACvBD,EAAWK,EAASJ,CAAG,CAAC,KAAKA,MAAQ;"}
1
+ {"version":3,"file":"url.es.js","names":[],"sources":["../../../../src/components/Link/utils/url.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { addHttps } from '../../../helpers';\n\nimport { relativeUrlRegex } from './relativeUrlRegex';\n\nexport const isValidUrl = (url: string) => {\n if (relativeUrlRegex.test(url)) {\n return true;\n }\n try {\n const parsedUrl = new URL(url);\n const validProtocols = ['http:', 'https:', 'mailto:', 'tel:'];\n return validProtocols.includes(parsedUrl.protocol) && parsedUrl.pathname !== '';\n } catch {\n return false;\n }\n};\n\nexport const isValidUrlOrEmpty = (url: string): boolean => {\n return isValidUrl(addHttps(url)) || url === '';\n};\n"],"mappings":";;;AAMA,IAAa,KAAc,MAAgB;CACvC,IAAI,EAAiB,KAAK,CAAG,GACzB,OAAO;CAEX,IAAI;EACA,IAAM,IAAY,IAAI,IAAI,CAAG;EAE7B,OAAO;GADiB;GAAS;GAAU;GAAW;EAC/C,CAAA,CAAe,SAAS,EAAU,QAAQ,KAAK,EAAU,aAAa;CACjF,QAAQ;EACJ,OAAO;CACX;AACJ,GAEa,KAAqB,MACvB,EAAW,EAAS,CAAG,CAAC,KAAK,MAAQ"}
@@ -1,69 +1,62 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { RichTextEditor as C } from "@frontify/fondue/rte";
3
- import { useRef as R, useState as m, useCallback as c, useEffect as p, memo as V, useId as T } from "react";
4
- import { useIsInViewport as v } from "../../hooks/useIsInViewport.es.js";
5
- import { getResponsiveColumnClasses as I } from "./plugins/ColumnBreakPlugin/helpers.es.js";
6
- import { SerializedText as P } from "./SerializedText.es.js";
7
- import { floatingButtonSelectors as L, floatingButtonActions as S } from "./plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js";
8
- const y = (o) => {
9
- L.isOpen(o) && S.reset();
10
- }, g = V(
11
- ({
12
- isEnabled: o,
13
- value: e,
14
- columns: l,
15
- gap: r,
16
- placeholder: t,
17
- plugins: i,
18
- onTextChange: s,
19
- showSerializedText: d
20
- }) => {
21
- const E = I(l), [f, h] = m(!1), w = T(), x = c(
22
- (n) => {
23
- n !== e && s?.(n), h(!1);
24
- },
25
- [s, e]
26
- ), b = c(() => h(!0), []);
27
- return p(() => {
28
- const n = (u) => {
29
- u.preventDefault(), u.returnValue = "Unprocessed changes";
30
- };
31
- return f && window.addEventListener("beforeunload", n), () => window.removeEventListener("beforeunload", n);
32
- }, [f]), o ? /* @__PURE__ */ a(
33
- C,
34
- {
35
- id: w,
36
- value: e,
37
- border: !1,
38
- placeholder: t,
39
- plugins: i,
40
- onValueChanged: b,
41
- onTextChange: x,
42
- hideExternalFloatingModals: y,
43
- placeholderOpacity: "high"
44
- }
45
- ) : /* @__PURE__ */ a(
46
- P,
47
- {
48
- value: e,
49
- gap: r,
50
- customClass: E,
51
- show: d,
52
- plugins: i
53
- }
54
- );
55
- }
56
- );
57
- g.displayName = "InternalRichTextEditor";
58
- const j = (o) => {
59
- const e = R(null), [l, r] = m(!1), { isEditing: t, ...i } = o, s = c((d) => {
60
- d && r(!0);
61
- }, []);
62
- return v({ ref: e, disabled: !t, onChange: s }), p(() => {
63
- t || r(!1);
64
- }, [t]), /* @__PURE__ */ a("div", { "data-test-id": "rich-text-editor-container", className: "tw-block tw-w-full tw-@container", ref: e, children: /* @__PURE__ */ a(g, { ...i, isEnabled: t && l }) });
1
+ import { useIsInViewport as e } from "../../hooks/useIsInViewport.es.js";
2
+ import { floatingButtonActions as t, floatingButtonSelectors as n } from "./plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js";
3
+ import { getResponsiveColumnClasses as r } from "./plugins/ColumnBreakPlugin/helpers.es.js";
4
+ import { SerializedText as i } from "./SerializedText.es.js";
5
+ import { memo as a, useCallback as o, useEffect as s, useId as c, useRef as l, useState as u } from "react";
6
+ import { jsx as d } from "react/jsx-runtime";
7
+ import { RichTextEditor as f } from "@frontify/fondue/rte";
8
+ //#region src/components/RichTextEditor/RichTextEditor.tsx
9
+ var p = (e) => {
10
+ n.isOpen(e) && t.reset();
11
+ }, m = a(({ isEnabled: e, value: t, columns: n, gap: a, placeholder: l, plugins: m, onTextChange: h, showSerializedText: g }) => {
12
+ let _ = r(n), [v, y] = u(!1), b = c(), x = o((e) => {
13
+ e !== t && h?.(e), y(!1);
14
+ }, [h, t]), S = o(() => y(!0), []);
15
+ return s(() => {
16
+ let e = (e) => {
17
+ e.preventDefault(), e.returnValue = "Unprocessed changes";
18
+ };
19
+ return v && window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
20
+ }, [v]), e ? /* @__PURE__ */ d(f, {
21
+ id: b,
22
+ value: t,
23
+ border: !1,
24
+ placeholder: l,
25
+ plugins: m,
26
+ onValueChanged: S,
27
+ onTextChange: x,
28
+ hideExternalFloatingModals: p,
29
+ placeholderOpacity: "high"
30
+ }) : /* @__PURE__ */ d(i, {
31
+ value: t,
32
+ gap: a,
33
+ customClass: _,
34
+ show: g,
35
+ plugins: m
36
+ });
37
+ });
38
+ m.displayName = "InternalRichTextEditor";
39
+ var h = (t) => {
40
+ let n = l(null), [r, i] = u(!1), { isEditing: a, ...c } = t, f = o((e) => {
41
+ e && i(!0);
42
+ }, []);
43
+ return e({
44
+ ref: n,
45
+ disabled: !a,
46
+ onChange: f
47
+ }), s(() => {
48
+ a || i(!1);
49
+ }, [a]), /* @__PURE__ */ d("div", {
50
+ "data-test-id": "rich-text-editor-container",
51
+ className: "tw-block tw-w-full tw-@container",
52
+ ref: n,
53
+ children: /* @__PURE__ */ d(m, {
54
+ ...c,
55
+ isEnabled: a && r
56
+ })
57
+ });
65
58
  };
66
- export {
67
- j as RichTextEditor
68
- };
69
- //# sourceMappingURL=RichTextEditor.es.js.map
59
+ //#endregion
60
+ export { h as RichTextEditor };
61
+
62
+ //# sourceMappingURL=RichTextEditor.es.js.map