@frontify/guideline-blocks-settings 3.0.2 → 3.0.4

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 (262) 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 +63 -63
  43. package/dist/components/Link/LinkInput.es.js.map +1 -1
  44. package/dist/components/Link/LinkSelector/DocumentLink.es.js +46 -63
  45. package/dist/components/Link/LinkSelector/DocumentLink.es.js.map +1 -1
  46. package/dist/components/Link/LinkSelector/DocumentLinks.es.js +50 -64
  47. package/dist/components/Link/LinkSelector/DocumentLinks.es.js.map +1 -1
  48. package/dist/components/Link/LinkSelector/LinkSelector2.es.js +77 -0
  49. package/dist/components/Link/LinkSelector/LinkSelector2.es.js.map +1 -0
  50. package/dist/components/Link/LinkSelector/LoadingIndicator.es.js +10 -6
  51. package/dist/components/Link/LinkSelector/LoadingIndicator.es.js.map +1 -1
  52. package/dist/components/Link/LinkSelector/PageLink.es.js +53 -67
  53. package/dist/components/Link/LinkSelector/PageLink.es.js.map +1 -1
  54. package/dist/components/Link/LinkSelector/PageLinks.es.js +28 -37
  55. package/dist/components/Link/LinkSelector/PageLinks.es.js.map +1 -1
  56. package/dist/components/Link/LinkSelector/SectionLink.es.js +31 -24
  57. package/dist/components/Link/LinkSelector/SectionLink.es.js.map +1 -1
  58. package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js +6 -5
  59. package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js.map +1 -1
  60. package/dist/components/Link/utils/getUrl.es.js +10 -12
  61. package/dist/components/Link/utils/getUrl.es.js.map +1 -1
  62. package/dist/components/Link/utils/relativeUrlRegex.es.js +6 -5
  63. package/dist/components/Link/utils/relativeUrlRegex.es.js.map +1 -1
  64. package/dist/components/Link/utils/url.es.js +21 -17
  65. package/dist/components/Link/utils/url.es.js.map +1 -1
  66. package/dist/components/RichTextEditor/RichTextEditor.es.js +61 -68
  67. package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -1
  68. package/dist/components/RichTextEditor/SerializedText.es.js +25 -22
  69. package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -1
  70. package/dist/components/RichTextEditor/constants.es.js +6 -5
  71. package/dist/components/RichTextEditor/constants.es.js.map +1 -1
  72. package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js +30 -37
  73. package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -1
  74. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +31 -39
  75. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -1
  76. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js +12 -11
  77. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js.map +1 -1
  78. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +19 -23
  79. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -1
  80. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +24 -26
  81. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -1
  82. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +46 -53
  83. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js.map +1 -1
  84. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js +52 -54
  85. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -1
  86. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +68 -68
  87. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js.map +1 -1
  88. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +91 -103
  89. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -1
  90. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js +26 -32
  91. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js.map +1 -1
  92. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +47 -53
  93. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js.map +1 -1
  94. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js +12 -18
  95. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js.map +1 -1
  96. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js +21 -25
  97. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js.map +1 -1
  98. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js +29 -37
  99. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js.map +1 -1
  100. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js +13 -17
  101. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js.map +1 -1
  102. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js +56 -62
  103. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -1
  104. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js +9 -12
  105. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +1 -1
  106. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js +23 -24
  107. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js.map +1 -1
  108. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js +28 -33
  109. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -1
  110. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js +61 -80
  111. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -1
  112. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js +23 -23
  113. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -1
  114. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js +18 -18
  115. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +1 -1
  116. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js +13 -12
  117. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +1 -1
  118. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js +9 -8
  119. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js.map +1 -1
  120. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js +11 -10
  121. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js.map +1 -1
  122. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js +85 -84
  123. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js.map +1 -1
  124. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js +13 -16
  125. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +1 -1
  126. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js +13 -16
  127. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js.map +1 -1
  128. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js +10 -13
  129. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +1 -1
  130. package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js +45 -51
  131. package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -1
  132. package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js +20 -22
  133. package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js.map +1 -1
  134. package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/helpers.es.js +12 -12
  135. package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/helpers.es.js.map +1 -1
  136. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +48 -57
  137. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -1
  138. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +46 -48
  139. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -1
  140. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +12 -8
  141. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js.map +1 -1
  142. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +62 -71
  143. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -1
  144. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +76 -77
  145. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -1
  146. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +17 -21
  147. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -1
  148. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +17 -10
  149. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -1
  150. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js +11 -10
  151. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js.map +1 -1
  152. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.es.js +22 -26
  153. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.es.js.map +1 -1
  154. package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js +6 -5
  155. package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js.map +1 -1
  156. package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +39 -40
  157. package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -1
  158. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js +10 -10
  159. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js.map +1 -1
  160. package/dist/components/RichTextEditor/plugins/OrderedListPlugin/index.es.js +26 -26
  161. package/dist/components/RichTextEditor/plugins/OrderedListPlugin/index.es.js.map +1 -1
  162. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +40 -46
  163. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -1
  164. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +40 -46
  165. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -1
  166. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +40 -46
  167. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -1
  168. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +41 -47
  169. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -1
  170. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +41 -47
  171. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -1
  172. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +41 -47
  173. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -1
  174. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +41 -47
  175. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -1
  176. package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js +44 -38
  177. package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js.map +1 -1
  178. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +41 -47
  179. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -1
  180. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +40 -46
  181. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -1
  182. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +45 -41
  183. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -1
  184. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +40 -48
  185. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -1
  186. package/dist/components/RichTextEditor/plugins/UnorderedListPlugin/index.es.js +29 -29
  187. package/dist/components/RichTextEditor/plugins/UnorderedListPlugin/index.es.js.map +1 -1
  188. package/dist/components/RichTextEditor/plugins/styles.es.js +167 -166
  189. package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -1
  190. package/dist/helpers/addHttps.es.js +12 -12
  191. package/dist/helpers/addHttps.es.js.map +1 -1
  192. package/dist/helpers/convertToRichTextValue.es.js +14 -6
  193. package/dist/helpers/convertToRichTextValue.es.js.map +1 -1
  194. package/dist/helpers/hasRichTextValue.es.js +13 -14
  195. package/dist/helpers/hasRichTextValue.es.js.map +1 -1
  196. package/dist/helpers/isDownloadable.es.js +6 -5
  197. package/dist/helpers/isDownloadable.es.js.map +1 -1
  198. package/dist/hooks/useAttachments.es.js +65 -73
  199. package/dist/hooks/useAttachments.es.js.map +1 -1
  200. package/dist/hooks/useIsInViewport.es.js +20 -21
  201. package/dist/hooks/useIsInViewport.es.js.map +1 -1
  202. package/dist/index.cjs.js +6 -8
  203. package/dist/index.cjs.js.map +1 -1
  204. package/dist/index.d.ts +8 -7
  205. package/dist/index.es.js +221 -213
  206. package/dist/index.es.js.map +1 -1
  207. package/dist/index.umd.js +6 -8
  208. package/dist/index.umd.js.map +1 -1
  209. package/dist/settings/background.es.js +20 -21
  210. package/dist/settings/background.es.js.map +1 -1
  211. package/dist/settings/border.es.js +62 -64
  212. package/dist/settings/border.es.js.map +1 -1
  213. package/dist/settings/borderRadius.es.js +49 -52
  214. package/dist/settings/borderRadius.es.js.map +1 -1
  215. package/dist/settings/borderRadiusExtended.es.js +58 -60
  216. package/dist/settings/borderRadiusExtended.es.js.map +1 -1
  217. package/dist/settings/defaultValues.es.js +16 -19
  218. package/dist/settings/defaultValues.es.js.map +1 -1
  219. package/dist/settings/gutter.es.js +48 -52
  220. package/dist/settings/gutter.es.js.map +1 -1
  221. package/dist/settings/margin.es.js +49 -52
  222. package/dist/settings/margin.es.js.map +1 -1
  223. package/dist/settings/marginExtended.es.js +62 -64
  224. package/dist/settings/marginExtended.es.js.map +1 -1
  225. package/dist/settings/padding.es.js +49 -52
  226. package/dist/settings/padding.es.js.map +1 -1
  227. package/dist/settings/paddingExtended.es.js +62 -64
  228. package/dist/settings/paddingExtended.es.js.map +1 -1
  229. package/dist/settings/securityDownloadable.es.js +16 -16
  230. package/dist/settings/securityDownloadable.es.js.map +1 -1
  231. package/dist/settings/securityGlobalControl.es.js +26 -32
  232. package/dist/settings/securityGlobalControl.es.js.map +1 -1
  233. package/dist/settings/types.es.js +41 -47
  234. package/dist/settings/types.es.js.map +1 -1
  235. package/dist/styles.css +2 -1
  236. package/dist/utilities/color/getReadableColor.es.js +15 -13
  237. package/dist/utilities/color/getReadableColor.es.js.map +1 -1
  238. package/dist/utilities/color/isDark.es.js +14 -9
  239. package/dist/utilities/color/isDark.es.js.map +1 -1
  240. package/dist/utilities/color/setAlpha.es.js +7 -6
  241. package/dist/utilities/color/setAlpha.es.js.map +1 -1
  242. package/dist/utilities/color/toColorObject.es.js +14 -8
  243. package/dist/utilities/color/toColorObject.es.js.map +1 -1
  244. package/dist/utilities/color/toHex8String.es.js +7 -6
  245. package/dist/utilities/color/toHex8String.es.js.map +1 -1
  246. package/dist/utilities/color/toHexString.es.js +7 -6
  247. package/dist/utilities/color/toHexString.es.js.map +1 -1
  248. package/dist/utilities/color/toRgbaString.es.js +7 -6
  249. package/dist/utilities/color/toRgbaString.es.js.map +1 -1
  250. package/dist/utilities/color/toShortRgba.es.js +18 -11
  251. package/dist/utilities/color/toShortRgba.es.js.map +1 -1
  252. package/dist/utilities/react/getBackgroundColorStyles.es.js +7 -8
  253. package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -1
  254. package/dist/utilities/react/getBorderStyles.es.js +12 -11
  255. package/dist/utilities/react/getBorderStyles.es.js.map +1 -1
  256. package/dist/utilities/react/getRadiusStyles.es.js +7 -8
  257. package/dist/utilities/react/getRadiusStyles.es.js.map +1 -1
  258. package/dist/utilities/react/joinClassNames.es.js +6 -5
  259. package/dist/utilities/react/joinClassNames.es.js.map +1 -1
  260. package/package.json +8 -10
  261. package/dist/components/Link/LinkSelector/LinkSelector.es.js +0 -72
  262. package/dist/components/Link/LinkSelector/LinkSelector.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,64 @@
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 { LinkSelector as t } from "./LinkSelector/LinkSelector2.es.js";
3
+ import { Checkbox as n, Label as r, TextInput as i } from "@frontify/fondue/components";
4
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ import { FormControl as s } from "@frontify/fondue";
6
+ //#region src/components/Link/LinkInput.tsx
7
+ var c = ({ onUrlChange: c, onToggleTab: l, isValidUrlOrEmpty: u, appBridge: d, placeholder: f, newTab: p, url: m = "", required: h, info: g, label: _, buttonSize: v, hideInternalLinkButton: y }) => {
8
+ let b = u ? u(m) : e(m);
9
+ return /* @__PURE__ */ o("div", {
10
+ "data-test-id": "link-input",
11
+ children: [
12
+ /* @__PURE__ */ a(s, {
13
+ label: {
14
+ children: _,
15
+ htmlFor: "url",
16
+ required: h,
17
+ tooltip: g ? {
18
+ content: g,
19
+ position: "top"
20
+ } : void 0
21
+ },
22
+ children: /* @__PURE__ */ a(i, {
23
+ "data-test-id": "text-input",
24
+ id: "url",
25
+ value: m,
26
+ onChange: (e) => c?.(e.target.value),
27
+ placeholder: f ?? "https://example.com"
28
+ })
29
+ }),
30
+ !b && /* @__PURE__ */ a("div", {
31
+ className: "tw-text-error tw-mt-1 tw-text-small",
32
+ children: "Please enter a valid URL."
33
+ }),
34
+ !y && /* @__PURE__ */ a("div", {
35
+ className: "tw-mt-3",
36
+ children: /* @__PURE__ */ a(t, {
37
+ url: m,
38
+ onUrlChange: c,
39
+ buttonSize: v ?? "medium",
40
+ getAllDocuments: () => d.getAllDocuments(),
41
+ getDocumentPagesByDocumentId: (e) => d.getDocumentPagesByDocumentId(e),
42
+ getDocumentSectionsByDocumentPageId: (e) => d.getDocumentSectionsByDocumentPageId(e)
43
+ })
44
+ }),
45
+ /* @__PURE__ */ o("div", {
46
+ className: "tw-mt-3 tw-flex tw-items-center tw-gap-1.5",
47
+ children: [/* @__PURE__ */ a(n, {
48
+ id: "new-tab",
49
+ value: p,
50
+ onChange: () => l?.(!p)
51
+ }), /* @__PURE__ */ a(r, {
52
+ id: "new-tab-label",
53
+ htmlFor: "new-tab",
54
+ className: "tw-whitespace-nowrap",
55
+ children: "Open in new tab"
56
+ })]
57
+ })
58
+ ]
59
+ });
60
60
  };
61
- export {
62
- N as LinkInput
63
- };
64
- //# sourceMappingURL=LinkInput.es.js.map
61
+ //#endregion
62
+ export { c as LinkInput };
63
+
64
+ //# 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 } 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"],"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;CAC7F,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,KACE,kBAAC,OAAD;IAAK,WAAU;IACX,UAAA,kBAAC,GAAD;KACS;KACQ;KACb,YAAY,KAAc;KAC1B,uBAAuB,EAAU,gBAAgB;KACjD,+BAA+B,MAC3B,EAAU,6BAA6B,CAAU;KAErD,sCAAsC,MAClC,EAAU,oCAAoC,CAAc;IAEnE,CAAA;GACA,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,64 +1,47 @@
1
- import { jsxs as a, Fragment as d, jsx as e } from "react/jsx-runtime";
2
- import { IconColorFan as g } from "@frontify/fondue/icons";
3
- import { useState as p, useEffect as m } from "react";
4
- import { PageLinks as b } from "./PageLinks.es.js";
5
- const v = ({
6
- document: t,
7
- selectedUrl: o,
8
- onSelectUrl: i,
9
- itemsToExpandInitially: r,
10
- getDocumentSectionsByDocumentPageId: h,
11
- getDocumentPagesByDocumentId: l
12
- }) => {
13
- const [n, s] = p(t.id === r.documentId), c = t.permanentLink === o;
14
- return m(() => {
15
- t.id === r.documentId && s(!0);
16
- }, [r, t.id]), /* @__PURE__ */ a(d, { children: [
17
- /* @__PURE__ */ a(
18
- "button",
19
- {
20
- type: "button",
21
- "data-test-id": "internal-link-selector-document-link",
22
- className: `tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-w-full ${c ? "tw-bg-highlight tw-text-highlight-on-highlight hover:tw-bg-highlight-hover:hover hover:tw-text-highlight-on-highlight:hover" : "hover:tw-bg-container-secondary-hover hover:tw-text-container-secondary-on-secondary-container"}`,
23
- onClick: () => i(t.permanentLink),
24
- children: [
25
- /* @__PURE__ */ e(
26
- "button",
27
- {
28
- type: "button",
29
- tabIndex: 0,
30
- "data-test-id": "tree-item-toggle",
31
- className: "tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer",
32
- onClick: () => s(!n),
33
- onKeyDown: (w) => w.key === "Enter" && w.stopPropagation(),
34
- children: /* @__PURE__ */ e(
35
- "div",
36
- {
37
- className: `tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong ${n ? "tw-rotate-90" : ""}`
38
- }
39
- )
40
- }
41
- ),
42
- /* @__PURE__ */ e(g, { size: 16 }),
43
- /* @__PURE__ */ e("span", { className: "tw-text-small", children: t.title }),
44
- /* @__PURE__ */ e("span", { className: "tw-flex-auto tw-font-sans tw-text-x-small tw-text-right", children: "Document" })
45
- ]
46
- }
47
- ),
48
- n && /* @__PURE__ */ e(
49
- b,
50
- {
51
- documentId: t.id,
52
- selectedUrl: o,
53
- onSelectUrl: i,
54
- itemsToExpandInitially: r,
55
- getDocumentSectionsByDocumentPageId: h,
56
- getDocumentPagesByDocumentId: l
57
- }
58
- )
59
- ] });
1
+ import { PageLinks as e } from "./PageLinks.es.js";
2
+ import { IconColorFan as t } from "@frontify/fondue/icons";
3
+ import { useEffect as n, useState as r } from "react";
4
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ //#region src/components/Link/LinkSelector/DocumentLink.tsx
6
+ var s = ({ document: s, selectedUrl: c, onSelectUrl: l, itemsToExpandInitially: u, getDocumentSectionsByDocumentPageId: d, getDocumentPagesByDocumentId: f }) => {
7
+ let [p, m] = r(s.id === u.documentId), h = s.permanentLink === c;
8
+ return n(() => {
9
+ s.id === u.documentId && m(!0);
10
+ }, [u, s.id]), /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("button", {
11
+ type: "button",
12
+ "data-test-id": "internal-link-selector-document-link",
13
+ className: `tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-w-full ${h ? "tw-bg-highlight tw-text-highlight-on-highlight hover:tw-bg-highlight-hover:hover hover:tw-text-highlight-on-highlight:hover" : "hover:tw-bg-container-secondary-hover hover:tw-text-container-secondary-on-secondary-container"}`,
14
+ onClick: () => l(s.permanentLink),
15
+ children: [
16
+ /* @__PURE__ */ a("button", {
17
+ type: "button",
18
+ tabIndex: 0,
19
+ "data-test-id": "tree-item-toggle",
20
+ className: "tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer",
21
+ onClick: () => m(!p),
22
+ onKeyDown: (e) => e.key === "Enter" && e.stopPropagation(),
23
+ children: /* @__PURE__ */ a("div", { className: `tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong ${p ? "tw-rotate-90" : ""}` })
24
+ }),
25
+ /* @__PURE__ */ a(t, { size: 16 }),
26
+ /* @__PURE__ */ a("span", {
27
+ className: "tw-text-small",
28
+ children: s.title
29
+ }),
30
+ /* @__PURE__ */ a("span", {
31
+ className: "tw-flex-auto tw-font-sans tw-text-x-small tw-text-right",
32
+ children: "Document"
33
+ })
34
+ ]
35
+ }), p && /* @__PURE__ */ a(e, {
36
+ documentId: s.id,
37
+ selectedUrl: c,
38
+ onSelectUrl: l,
39
+ itemsToExpandInitially: u,
40
+ getDocumentSectionsByDocumentPageId: d,
41
+ getDocumentPagesByDocumentId: f
42
+ })] });
60
43
  };
61
- export {
62
- v as DocumentLink
63
- };
64
- //# sourceMappingURL=DocumentLink.es.js.map
44
+ //#endregion
45
+ export { s as DocumentLink };
46
+
47
+ //# sourceMappingURL=DocumentLink.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentLink.es.js","sources":["../../../../src/components/Link/LinkSelector/DocumentLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type DocumentPage, type DocumentSection } from '@frontify/app-bridge';\nimport { IconColorFan } from '@frontify/fondue/icons';\nimport { useEffect, useState } from 'react';\n\nimport { type InitiallyExpandedItems } from '../types';\n\nimport { PageLinks } from './PageLinks';\n\ntype DocumentLinkProps = {\n document: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n getDocumentSectionsByDocumentPageId: (documentPageId: number) => Promise<DocumentSection[]>;\n getDocumentPagesByDocumentId: (documentId: number) => Promise<DocumentPage[]>;\n};\n\nexport const DocumentLink = ({\n document,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\n getDocumentSectionsByDocumentPageId,\n getDocumentPagesByDocumentId,\n}: DocumentLinkProps) => {\n const [isExpanded, setIsExpanded] = useState(document.id === itemsToExpandInitially.documentId);\n const isActive = document.permanentLink === selectedUrl;\n\n useEffect(() => {\n if (document.id === itemsToExpandInitially.documentId) {\n // oxlint-disable-next-line @eslint-react/set-state-in-effect\n setIsExpanded(true);\n }\n }, [itemsToExpandInitially, document.id]);\n\n return (\n <>\n <button\n type=\"button\"\n data-test-id=\"internal-link-selector-document-link\"\n className={`tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-w-full ${\n isActive\n ? 'tw-bg-highlight tw-text-highlight-on-highlight hover:tw-bg-highlight-hover:hover hover:tw-text-highlight-on-highlight:hover'\n : 'hover:tw-bg-container-secondary-hover hover:tw-text-container-secondary-on-secondary-container'\n }`}\n onClick={() => onSelectUrl(document.permanentLink)}\n >\n <button\n type=\"button\"\n tabIndex={0}\n data-test-id=\"tree-item-toggle\"\n className=\"tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer\"\n onClick={() => setIsExpanded(!isExpanded)}\n onKeyDown={(event) => event.key === 'Enter' && event.stopPropagation()}\n >\n <div\n className={`tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong ${isExpanded ? 'tw-rotate-90' : ''}`}\n ></div>\n </button>\n <IconColorFan size={16} />\n <span className=\"tw-text-small\">{document.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-x-small tw-text-right\">Document</span>\n </button>\n {isExpanded && (\n <PageLinks\n documentId={document.id}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n getDocumentSectionsByDocumentPageId={getDocumentSectionsByDocumentPageId}\n getDocumentPagesByDocumentId={getDocumentPagesByDocumentId}\n />\n )}\n </>\n );\n};\n"],"names":["DocumentLink","document","selectedUrl","onSelectUrl","itemsToExpandInitially","getDocumentSectionsByDocumentPageId","getDocumentPagesByDocumentId","isExpanded","setIsExpanded","useState","isActive","useEffect","jsxs","Fragment","jsx","event","IconColorFan","PageLinks"],"mappings":";;;;AAuBO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,qCAAAC;AAAA,EACA,8BAAAC;AACJ,MAAyB;AACrB,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAASR,EAAS,OAAOG,EAAuB,UAAU,GACxFM,IAAWT,EAAS,kBAAkBC;AAE5C,SAAAS,EAAU,MAAM;AACZ,IAAIV,EAAS,OAAOG,EAAuB,cAEvCI,EAAc,EAAI;AAAA,EAE1B,GAAG,CAACJ,GAAwBH,EAAS,EAAE,CAAC,GAGpC,gBAAAW,EAAAC,GAAA,EACI,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,MAAK;AAAA,QACL,gBAAa;AAAA,QACb,WAAW,6GACPF,IACM,gIACA,gGACV;AAAA,QACA,SAAS,MAAMP,EAAYF,EAAS,aAAa;AAAA,QAEjD,UAAA;AAAA,UAAA,gBAAAa;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,MAAK;AAAA,cACL,UAAU;AAAA,cACV,gBAAa;AAAA,cACb,WAAU;AAAA,cACV,SAAS,MAAMN,EAAc,CAACD,CAAU;AAAA,cACxC,WAAW,CAACQ,MAAUA,EAAM,QAAQ,WAAWA,EAAM,gBAAA;AAAA,cAErD,UAAA,gBAAAD;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WAAW,uKAAuKP,IAAa,iBAAiB,EAAE;AAAA,gBAAA;AAAA,cAAA;AAAA,YACrN;AAAA,UAAA;AAAA,UAEL,gBAAAO,EAACE,GAAA,EAAa,MAAM,GAAA,CAAI;AAAA,UACxB,gBAAAF,EAAC,QAAA,EAAK,WAAU,iBAAiB,YAAS,OAAM;AAAA,UAChD,gBAAAA,EAAC,QAAA,EAAK,WAAU,2DAA0D,UAAA,WAAA,CAAQ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAErFP,KACG,gBAAAO;AAAA,MAACG;AAAA,MAAA;AAAA,QACG,YAAYhB,EAAS;AAAA,QACrB,aAAAC;AAAA,QACA,aAAAC;AAAA,QACA,wBAAAC;AAAA,QACA,qCAAAC;AAAA,QACA,8BAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACJ,GAER;AAER;"}
1
+ {"version":3,"file":"DocumentLink.es.js","names":[],"sources":["../../../../src/components/Link/LinkSelector/DocumentLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type DocumentPage, type DocumentSection } from '@frontify/app-bridge';\nimport { IconColorFan } from '@frontify/fondue/icons';\nimport { useEffect, useState } from 'react';\n\nimport { type InitiallyExpandedItems } from '../types';\n\nimport { PageLinks } from './PageLinks';\n\ntype DocumentLinkProps = {\n document: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n getDocumentSectionsByDocumentPageId: (documentPageId: number) => Promise<DocumentSection[]>;\n getDocumentPagesByDocumentId: (documentId: number) => Promise<DocumentPage[]>;\n};\n\nexport const DocumentLink = ({\n document,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\n getDocumentSectionsByDocumentPageId,\n getDocumentPagesByDocumentId,\n}: DocumentLinkProps) => {\n const [isExpanded, setIsExpanded] = useState(document.id === itemsToExpandInitially.documentId);\n const isActive = document.permanentLink === selectedUrl;\n\n useEffect(() => {\n if (document.id === itemsToExpandInitially.documentId) {\n // oxlint-disable-next-line @eslint-react/set-state-in-effect\n setIsExpanded(true);\n }\n }, [itemsToExpandInitially, document.id]);\n\n return (\n <>\n <button\n type=\"button\"\n data-test-id=\"internal-link-selector-document-link\"\n className={`tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-w-full ${\n isActive\n ? 'tw-bg-highlight tw-text-highlight-on-highlight hover:tw-bg-highlight-hover:hover hover:tw-text-highlight-on-highlight:hover'\n : 'hover:tw-bg-container-secondary-hover hover:tw-text-container-secondary-on-secondary-container'\n }`}\n onClick={() => onSelectUrl(document.permanentLink)}\n >\n <button\n type=\"button\"\n tabIndex={0}\n data-test-id=\"tree-item-toggle\"\n className=\"tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer\"\n onClick={() => setIsExpanded(!isExpanded)}\n onKeyDown={(event) => event.key === 'Enter' && event.stopPropagation()}\n >\n <div\n className={`tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong ${isExpanded ? 'tw-rotate-90' : ''}`}\n ></div>\n </button>\n <IconColorFan size={16} />\n <span className=\"tw-text-small\">{document.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-x-small tw-text-right\">Document</span>\n </button>\n {isExpanded && (\n <PageLinks\n documentId={document.id}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n getDocumentSectionsByDocumentPageId={getDocumentSectionsByDocumentPageId}\n getDocumentPagesByDocumentId={getDocumentPagesByDocumentId}\n />\n )}\n </>\n );\n};\n"],"mappings":";;;;;AAuBA,IAAa,KAAgB,EACzB,aACA,gBACA,gBACA,2BACA,wCACA,sCACqB;CACrB,IAAM,CAAC,GAAY,KAAiB,EAAS,EAAS,OAAO,EAAuB,UAAU,GACxF,IAAW,EAAS,kBAAkB;CAS5C,OAPA,QAAgB;EACZ,AAAI,EAAS,OAAO,EAAuB,cAEvC,EAAc,EAAI;CAE1B,GAAG,CAAC,GAAwB,EAAS,EAAE,CAAC,GAGpC,kBAAA,GAAA,EAAA,UAAA,CACI,kBAAC,UAAD;EACI,MAAK;EACL,gBAAa;EACb,WAAW,6GACP,IACM,gIACA;EAEV,eAAe,EAAY,EAAS,aAAa;EARrD,UAAA;GAUI,kBAAC,UAAD;IACI,MAAK;IACL,UAAU;IACV,gBAAa;IACb,WAAU;IACV,eAAe,EAAc,CAAC,CAAU;IACxC,YAAY,MAAU,EAAM,QAAQ,WAAW,EAAM,gBAAgB;IAErE,UAAA,kBAAC,OAAD,EACI,WAAW,uKAAuK,IAAa,iBAAiB,KAC9M,CAAA;GACF,CAAA;GACR,kBAAC,GAAD,EAAc,MAAM,GAAK,CAAA;GACzB,kBAAC,QAAD;IAAM,WAAU;IAAiB,UAAA,EAAS;GAAY,CAAA;GACtD,kBAAC,QAAD;IAAM,WAAU;IAA0D,UAAA;GAAc,CAAA;EACpF;CACP,CAAA,GAAA,KACG,kBAAC,GAAD;EACI,YAAY,EAAS;EACR;EACA;EACW;EACa;EACP;CACjC,CAAA,CAEP,EAAA,CAAA;AAEV"}