@frontify/guideline-blocks-settings 0.28.0 → 0.28.2

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 (307) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/_virtual/jsx-runtime.es.js +5 -0
  3. package/dist/_virtual/jsx-runtime.es.js.map +1 -0
  4. package/dist/_virtual/react-jsx-runtime.development.es.js +5 -0
  5. package/dist/_virtual/react-jsx-runtime.development.es.js.map +1 -0
  6. package/dist/_virtual/react-jsx-runtime.production.min.es.js +5 -0
  7. package/dist/_virtual/react-jsx-runtime.production.min.es.js.map +1 -0
  8. package/dist/components/Attachments/AttachmentItem.es.js +180 -0
  9. package/dist/components/Attachments/AttachmentItem.es.js.map +1 -0
  10. package/dist/components/Attachments/Attachments.es.js +145 -0
  11. package/dist/components/Attachments/Attachments.es.js.map +1 -0
  12. package/dist/components/BlockInjectButton/BlockInjectButton.es.js +150 -0
  13. package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -0
  14. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +73 -0
  15. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -0
  16. package/dist/components/BlockItemWrapper/Toolbar.es.js +113 -0
  17. package/dist/components/BlockItemWrapper/Toolbar.es.js.map +1 -0
  18. package/dist/components/BlockItemWrapper/constants.es.js +6 -0
  19. package/dist/components/BlockItemWrapper/constants.es.js.map +1 -0
  20. package/dist/components/DownloadButton/DownloadButton.es.js +39 -0
  21. package/dist/components/DownloadButton/DownloadButton.es.js.map +1 -0
  22. package/dist/components/RichTextEditor/RichTextEditor.es.js +42 -0
  23. package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -0
  24. package/dist/components/RichTextEditor/SerializedText.es.js +13 -0
  25. package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -0
  26. package/dist/components/RichTextEditor/constants.es.js +5 -0
  27. package/dist/components/RichTextEditor/constants.es.js.map +1 -0
  28. package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js +34 -0
  29. package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -0
  30. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +54 -0
  31. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -0
  32. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js +12 -0
  33. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js.map +1 -0
  34. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +17 -0
  35. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -0
  36. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +30 -0
  37. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -0
  38. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +16 -0
  39. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js.map +1 -0
  40. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js +37 -0
  41. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -0
  42. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.es.js +25 -0
  43. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.es.js.map +1 -0
  44. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js +20 -0
  45. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js.map +1 -0
  46. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js +26 -0
  47. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js.map +1 -0
  48. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +69 -0
  49. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js.map +1 -0
  50. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +105 -0
  51. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -0
  52. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js +20 -0
  53. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js.map +1 -0
  54. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js +32 -0
  55. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js.map +1 -0
  56. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +58 -0
  57. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js.map +1 -0
  58. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js +19 -0
  59. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js.map +1 -0
  60. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js +26 -0
  61. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js.map +1 -0
  62. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js +43 -0
  63. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js.map +1 -0
  64. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js +18 -0
  65. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js.map +1 -0
  66. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js +62 -0
  67. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -0
  68. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js +13 -0
  69. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +1 -0
  70. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js +25 -0
  71. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js.map +1 -0
  72. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js +35 -0
  73. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -0
  74. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js +86 -0
  75. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -0
  76. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js +24 -0
  77. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -0
  78. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js +19 -0
  79. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +1 -0
  80. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js +13 -0
  81. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +1 -0
  82. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js +11 -0
  83. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js.map +1 -0
  84. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js +10 -0
  85. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js.map +1 -0
  86. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js +75 -0
  87. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js.map +1 -0
  88. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js +18 -0
  89. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +1 -0
  90. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js +17 -0
  91. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js.map +1 -0
  92. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js +14 -0
  93. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +1 -0
  94. package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js +53 -0
  95. package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -0
  96. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +19 -0
  97. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -0
  98. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +37 -0
  99. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -0
  100. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js +53 -0
  101. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js.map +1 -0
  102. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.es.js +29 -0
  103. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.es.js.map +1 -0
  104. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +8 -0
  105. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js.map +1 -0
  106. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +80 -0
  107. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -0
  108. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js +40 -0
  109. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js.map +1 -0
  110. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +93 -0
  111. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -0
  112. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +25 -0
  113. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -0
  114. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +27 -0
  115. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -0
  116. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js +12 -0
  117. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js.map +1 -0
  118. package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js +5 -0
  119. package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js.map +1 -0
  120. package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +39 -0
  121. package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -0
  122. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js +18 -0
  123. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js.map +1 -0
  124. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.es.js +5 -0
  125. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.es.js.map +1 -0
  126. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/url.es.js +17 -0
  127. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/url.es.js.map +1 -0
  128. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +45 -0
  129. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -0
  130. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +45 -0
  131. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -0
  132. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +45 -0
  133. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -0
  134. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +46 -0
  135. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -0
  136. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +39 -0
  137. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -0
  138. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +39 -0
  139. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -0
  140. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +39 -0
  141. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -0
  142. package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js +40 -0
  143. package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js.map +1 -0
  144. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +46 -0
  145. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -0
  146. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +46 -0
  147. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -0
  148. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +41 -0
  149. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -0
  150. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +48 -0
  151. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -0
  152. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js +68 -0
  153. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js.map +1 -0
  154. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js +55 -0
  155. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js.map +1 -0
  156. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js +62 -0
  157. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js.map +1 -0
  158. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js +61 -0
  159. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js.map +1 -0
  160. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js +34 -0
  161. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js.map +1 -0
  162. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js +26 -0
  163. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js.map +1 -0
  164. package/dist/components/RichTextEditor/plugins/styles.es.js +168 -0
  165. package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -0
  166. package/dist/components/RichTextEditor/serializer/nodes/button.es.js +16 -0
  167. package/dist/components/RichTextEditor/serializer/nodes/button.es.js.map +1 -0
  168. package/dist/components/RichTextEditor/serializer/nodes/checkItemNode.es.js +19 -0
  169. package/dist/components/RichTextEditor/serializer/nodes/checkItemNode.es.js.map +1 -0
  170. package/dist/components/RichTextEditor/serializer/nodes/default.es.js +17 -0
  171. package/dist/components/RichTextEditor/serializer/nodes/default.es.js.map +1 -0
  172. package/dist/components/RichTextEditor/serializer/nodes/link.es.js +15 -0
  173. package/dist/components/RichTextEditor/serializer/nodes/link.es.js.map +1 -0
  174. package/dist/components/RichTextEditor/serializer/nodes/mentionHtmlNode.es.js +12 -0
  175. package/dist/components/RichTextEditor/serializer/nodes/mentionHtmlNode.es.js.map +1 -0
  176. package/dist/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.es.js +61 -0
  177. package/dist/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.es.js.map +1 -0
  178. package/dist/components/RichTextEditor/serializer/serializeToHtml.es.js +25 -0
  179. package/dist/components/RichTextEditor/serializer/serializeToHtml.es.js.map +1 -0
  180. package/dist/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.es.js +8 -0
  181. package/dist/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.es.js.map +1 -0
  182. package/dist/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.es.js +13 -0
  183. package/dist/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.es.js.map +1 -0
  184. package/dist/helpers/addHttps.es.js +14 -0
  185. package/dist/helpers/addHttps.es.js.map +1 -0
  186. package/dist/helpers/convertToRichTextValue.es.js +6 -0
  187. package/dist/helpers/convertToRichTextValue.es.js.map +1 -0
  188. package/dist/helpers/customCoordinatesGetterFactory.es.js +32 -0
  189. package/dist/helpers/customCoordinatesGetterFactory.es.js.map +1 -0
  190. package/dist/helpers/hasRichTextValue.es.js +15 -0
  191. package/dist/helpers/hasRichTextValue.es.js.map +1 -0
  192. package/dist/helpers/isDownloadable.es.js +6 -0
  193. package/dist/helpers/isDownloadable.es.js.map +1 -0
  194. package/dist/helpers/mapColorPalettes.es.js +16 -0
  195. package/dist/helpers/mapColorPalettes.es.js.map +1 -0
  196. package/dist/hooks/useAttachments.es.js +31 -0
  197. package/dist/hooks/useAttachments.es.js.map +1 -0
  198. package/dist/hooks/useDndSensors.es.js +20 -0
  199. package/dist/hooks/useDndSensors.es.js.map +1 -0
  200. package/dist/index.cjs.js +46 -0
  201. package/dist/index.cjs.js.map +1 -0
  202. package/dist/index.d.ts +964 -0
  203. package/dist/index.es.js +178 -0
  204. package/dist/index.es.js.map +1 -0
  205. package/dist/index.umd.js +46 -0
  206. package/dist/index.umd.js.map +1 -0
  207. package/dist/settings/background.es.js +22 -0
  208. package/dist/settings/background.es.js.map +1 -0
  209. package/dist/settings/border.es.js +61 -0
  210. package/dist/settings/border.es.js.map +1 -0
  211. package/dist/settings/borderRadius.es.js +56 -0
  212. package/dist/settings/borderRadius.es.js.map +1 -0
  213. package/dist/settings/borderRadiusExtended.es.js +64 -0
  214. package/dist/settings/borderRadiusExtended.es.js.map +1 -0
  215. package/dist/settings/defaultValues.es.js +19 -0
  216. package/dist/settings/defaultValues.es.js.map +1 -0
  217. package/dist/settings/gutter.es.js +56 -0
  218. package/dist/settings/gutter.es.js.map +1 -0
  219. package/dist/settings/margin.es.js +53 -0
  220. package/dist/settings/margin.es.js.map +1 -0
  221. package/dist/settings/marginExtended.es.js +65 -0
  222. package/dist/settings/marginExtended.es.js.map +1 -0
  223. package/dist/settings/padding.es.js +53 -0
  224. package/dist/settings/padding.es.js.map +1 -0
  225. package/dist/settings/paddingExtended.es.js +65 -0
  226. package/dist/settings/paddingExtended.es.js.map +1 -0
  227. package/dist/settings/securityDownloadable.es.js +19 -0
  228. package/dist/settings/securityDownloadable.es.js.map +1 -0
  229. package/dist/settings/securityGlobalControl.es.js +33 -0
  230. package/dist/settings/securityGlobalControl.es.js.map +1 -0
  231. package/dist/settings/types.es.js +48 -0
  232. package/dist/settings/types.es.js.map +1 -0
  233. package/dist/styles.css +1 -0
  234. package/dist/styles.css.es.js +5 -0
  235. package/dist/styles.css.es.js.map +1 -0
  236. package/dist/utilities/color/getReadableColor.es.js +14 -0
  237. package/dist/utilities/color/getReadableColor.es.js.map +1 -0
  238. package/dist/utilities/color/isDark.es.js +10 -0
  239. package/dist/utilities/color/isDark.es.js.map +1 -0
  240. package/dist/utilities/color/setAlpha.es.js +6 -0
  241. package/dist/utilities/color/setAlpha.es.js.map +1 -0
  242. package/dist/utilities/color/toColorObject.es.js +9 -0
  243. package/dist/utilities/color/toColorObject.es.js.map +1 -0
  244. package/dist/utilities/color/toHex8String.es.js +7 -0
  245. package/dist/utilities/color/toHex8String.es.js.map +1 -0
  246. package/dist/utilities/color/toHexString.es.js +7 -0
  247. package/dist/utilities/color/toHexString.es.js.map +1 -0
  248. package/dist/utilities/color/toRgbaString.es.js +7 -0
  249. package/dist/utilities/color/toRgbaString.es.js.map +1 -0
  250. package/dist/utilities/color/toShortRgba.es.js +11 -0
  251. package/dist/utilities/color/toShortRgba.es.js.map +1 -0
  252. package/dist/utilities/moveItemInArray.es.js +12 -0
  253. package/dist/utilities/moveItemInArray.es.js.map +1 -0
  254. package/dist/utilities/react/getBackgroundColorStyles.es.js +8 -0
  255. package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -0
  256. package/dist/utilities/react/getBorderStyles.es.js +12 -0
  257. package/dist/utilities/react/getBorderStyles.es.js.map +1 -0
  258. package/dist/utilities/react/getRadiusStyles.es.js +8 -0
  259. package/dist/utilities/react/getRadiusStyles.es.js.map +1 -0
  260. package/dist/utilities/react/joinClassNames.es.js +5 -0
  261. package/dist/utilities/react/joinClassNames.es.js.map +1 -0
  262. package/package.json +25 -24
  263. package/src/components/Attachments/AttachmentItem.tsx +2 -2
  264. package/src/components/Attachments/Attachments.spec.ct.tsx +4 -4
  265. package/src/components/Attachments/Attachments.tsx +2 -2
  266. package/src/components/BlockInjectButton/BlockInjectButton.spec.ct.tsx +2 -2
  267. package/src/components/BlockItemWrapper/BlockItemWrapper.spec.ct.tsx +8 -8
  268. package/src/components/BlockItemWrapper/Toolbar.tsx +1 -1
  269. package/src/components/RichTextEditor/RichTextEditor.spec.ct.tsx +8 -8
  270. package/src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx +2 -2
  271. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx +1 -1
  272. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.tsx +1 -1
  273. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts +1 -1
  274. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.ts +1 -1
  275. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.ts +1 -1
  276. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.ts +1 -1
  277. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.ts +1 -1
  278. package/src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts +2 -0
  279. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.ts +2 -2
  280. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.ts +1 -1
  281. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.ts +5 -5
  282. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.ts +2 -2
  283. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.ts +1 -1
  284. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts +1 -1
  285. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts +1 -1
  286. package/src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts +1 -1
  287. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts +1 -1
  288. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.ts +1 -1
  289. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts +1 -1
  290. package/src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx +1 -1
  291. package/src/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.spec.ts +24 -27
  292. package/src/components/RichTextEditor/serializer/nodes/checkItemNode.ts +1 -1
  293. package/src/components/RichTextEditor/serializer/nodes/default.ts +2 -2
  294. package/src/components/RichTextEditor/serializer/nodes/link.ts +1 -1
  295. package/src/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.ts +4 -4
  296. package/src/components/RichTextEditor/serializer/serializeToHtml.ts +2 -2
  297. package/src/hooks/useAttachments.ts +1 -1
  298. package/src/hooks/useDndSensors.ts +1 -1
  299. package/src/index.ts +3 -3
  300. package/src/settings/background.spec.ts +1 -1
  301. package/src/settings/border.spec.ts +1 -1
  302. package/src/settings/borderRadiusExtended.spec.ts +4 -4
  303. package/src/settings/marginExtended.spec.ts +4 -4
  304. package/src/settings/paddingExtended.spec.ts +4 -4
  305. package/src/styles.css +3 -0
  306. package/src/utilities/react/getBorderStyles.ts +1 -1
  307. package/vite.config.ts +22 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js","../src/utilities/react/joinClassNames.ts","../src/components/BlockInjectButton/BlockInjectButton.tsx","../src/utilities/color/toShortRgba.ts","../src/utilities/color/isDark.ts","../src/utilities/color/toHex8String.ts","../src/utilities/color/toHexString.ts","../src/utilities/color/toRgbaString.ts","../src/utilities/color/setAlpha.ts","../src/utilities/color/toColorObject.ts","../src/utilities/color/getReadableColor.ts","../src/utilities/moveItemInArray.ts","../src/utilities/react/getBackgroundColorStyles.ts","../src/settings/types.ts","../src/settings/defaultValues.ts","../src/utilities/react/getBorderStyles.ts","../src/utilities/react/getRadiusStyles.ts","../src/components/BlockItemWrapper/constants.ts","../src/components/BlockItemWrapper/Toolbar.tsx","../src/components/BlockItemWrapper/BlockItemWrapper.tsx","../src/components/Attachments/AttachmentItem.tsx","../src/components/Attachments/Attachments.tsx","../src/components/DownloadButton/DownloadButton.tsx","../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.ts","../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.tsx","../src/components/RichTextEditor/plugins/LinkPlugin/id.ts","../src/helpers/hasRichTextValue.ts","../src/helpers/convertToRichTextValue.ts","../src/helpers/customCoordinatesGetterFactory.ts","../src/helpers/isDownloadable.ts","../src/helpers/mapColorPalettes.ts","../src/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.ts","../src/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.ts","../src/helpers/addHttps.ts","../src/components/RichTextEditor/plugins/LinkPlugin/utils/url.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.tsx","../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.tsx","../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.tsx","../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.tsx","../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.tsx","../src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx","../src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.tsx","../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.tsx","../src/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.tsx","../src/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.tsx","../src/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.tsx","../src/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.tsx","../src/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.tsx","../src/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.tsx","../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx","../src/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.tsx","../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.tsx","../src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts","../src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts","../src/components/RichTextEditor/plugins/styles.ts","../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.tsx","../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts","../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts","../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.tsx","../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.tsx","../src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx","../src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx","../src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.ts","../src/components/RichTextEditor/plugins/LinkPlugin/index.ts","../src/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.tsx","../src/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.tsx","../src/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.tsx","../src/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.tsx","../src/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.tsx","../src/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.tsx","../src/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.tsx","../src/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.tsx","../src/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.tsx","../src/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.tsx","../src/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.tsx","../src/components/RichTextEditor/plugins/TextStylePlugins/helpers.tsx","../src/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.ts","../src/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.ts","../src/components/RichTextEditor/serializer/nodes/button.ts","../src/components/RichTextEditor/serializer/nodes/link.ts","../src/components/RichTextEditor/serializer/nodes/default.ts","../src/components/RichTextEditor/serializer/nodes/checkItemNode.ts","../src/components/RichTextEditor/serializer/nodes/mentionHtmlNode.ts","../src/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.ts","../src/components/RichTextEditor/serializer/serializeToHtml.ts","../src/components/RichTextEditor/SerializedText.tsx","../src/components/RichTextEditor/RichTextEditor.tsx","../src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx","../src/components/RichTextEditor/constants.ts","../src/hooks/useAttachments.ts","../src/hooks/useDndSensors.ts","../src/settings/background.ts","../src/settings/border.ts","../src/settings/borderRadius.ts","../src/settings/borderRadiusExtended.ts","../src/settings/gutter.ts","../src/settings/margin.ts","../src/settings/marginExtended.ts","../src/settings/padding.ts","../src/settings/paddingExtended.ts","../src/settings/securityDownloadable.ts","../src/settings/securityGlobalControl.ts","../src/index.ts"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\n/**\n * Cleans and joins an array of inputs with possible undefined or boolean values.\n *\n * @param {Array} classNames Array of class names\n * @returns Clean string to be used for class name.\n */\nexport const joinClassNames = (classNames: (string | undefined | boolean)[]): string =>\n classNames.filter(Boolean).join(' ');\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ActionMenu,\n Flyout,\n IconArrowCircleUp20,\n IconExclamationMarkTriangle,\n IconImageStack20,\n LoadingCircle,\n MenuItemContentSize,\n} from '@frontify/fondue';\nimport { DragEventHandler, MouseEventHandler, useRef, useState } from 'react';\nimport { joinClassNames } from '../../utilities/react/joinClassNames';\nimport { BlockInjectButtonProps } from './types';\nimport { FileExtension, FileExtensionSets } from '@frontify/app-bridge';\n\nexport const BlockInjectButton = ({\n onDrop,\n label,\n icon,\n secondaryLabel,\n isLoading,\n fillParentContainer,\n onAssetChooseClick,\n onUploadClick,\n withMenu = true,\n onClick,\n validFileType,\n verticalLayout,\n}: BlockInjectButtonProps) => {\n const [isDraggingOver, setIsDraggingOver] = useState(false);\n const [menuPosition, setMenuPosition] = useState<[number, number] | undefined>();\n const buttonRef = useRef<HTMLButtonElement>(null);\n const [errorMsg, setErrorMsg] = useState<string | undefined>(undefined);\n\n const handleDrop: DragEventHandler<HTMLButtonElement> = (event) => {\n event.preventDefault();\n setIsDraggingOver(false);\n if (!isValidAsset(event.dataTransfer.files)) {\n setErrorMsg('Invalid');\n setTimeout(() => {\n setErrorMsg(undefined);\n }, 1000);\n return;\n }\n onDrop?.(event.dataTransfer.files);\n };\n\n const isValidAsset = (files: FileList) => {\n if (!validFileType) {\n return true;\n }\n for (let i = 0; i < files.length; i++) {\n const droppedFileExtension = (files[i].name.split('.').pop() ?? '') as FileExtension;\n if (!FileExtensionSets[validFileType].includes(droppedFileExtension)) {\n return false;\n }\n }\n return true;\n };\n\n const openMenu: MouseEventHandler<HTMLButtonElement> = (event) => {\n if (!buttonRef.current || isLoading) {\n return;\n }\n const { left, top } = buttonRef.current.getBoundingClientRect();\n const XInsideComponent = event.clientX - left;\n const YInsideComponent = event.clientY - top;\n setMenuPosition([XInsideComponent, YInsideComponent]);\n };\n\n return (\n <button\n ref={buttonRef}\n data-test-id=\"block-inject-button\"\n className={joinClassNames([\n 'tw-font-body tw-relative tw-text-sm tw-leading-4 tw-border tw-flex tw-items-center tw-justify-center tw-cursor-pointer tw-gap-3 tw-w-full first:tw-rounded-tl last:tw-rounded-br',\n verticalLayout\n ? '[&:not(:first-child)]:tw-border-t-0 first:tw-rounded-tr last:tw-rounded-bl'\n : '[&:not(:first-child)]:tw-border-l-0 first:tw-rounded-bl last:tw-rounded-tr',\n fillParentContainer ? 'tw-h-full' : 'tw-h-[72px]',\n isDraggingOver && !isLoading ? 'tw-border-dashed' : 'tw-border-solid',\n menuPosition && 'tw-bg-blank-state-pressed-inverse',\n isDraggingOver && 'tw-bg-blank-state-weak-inverse',\n errorMsg ? '!tw-border-red-50 !tw-cursor-not-allowed' : ' tw-border-blank-state-line',\n isLoading || menuPosition || isDraggingOver || errorMsg\n ? ''\n : 'tw-text-text-weak hover:tw-text-blank-state-hover hover:tw-bg-blank-state-hover-inverse hover:tw-border-blank-state-line-hover active:tw-text-blank-state-pressed active:tw-bg-blank-state-pressed-inverse active:tw-border-blank-state-line-hover',\n (isDraggingOver || !!menuPosition) && !errorMsg\n ? '[&>*]:tw-pointer-events-none tw-border-blank-state-line-hover'\n : 'tw-bg-blank-state-shaded-inverse tw-text-blank-state-shaded',\n ])}\n onDragEnter={\n onDrop\n ? (event) => {\n setIsDraggingOver(true);\n // is now only used for images, can be adapted if needed\n if (validFileType === 'Images') {\n for (const item of Array.from(event.dataTransfer.items)) {\n if (!item?.type?.startsWith('image/')) {\n setErrorMsg('Invalid');\n } else {\n setErrorMsg(undefined);\n }\n }\n }\n }\n : undefined\n }\n onDragLeave={\n onDrop\n ? () => {\n setIsDraggingOver(false);\n setErrorMsg(undefined);\n }\n : undefined\n }\n onDrop={onDrop ? handleDrop : undefined}\n onClick={(event) => {\n withMenu && openMenu(event);\n onClick?.();\n }}\n >\n {isLoading ? (\n <LoadingCircle />\n ) : // eslint-disable-next-line unicorn/no-nested-ternary\n errorMsg ? (\n <div className=\" tw-flex tw-items-center tw-justify-center tw-text-red-60 tw-font-medium\">\n <IconExclamationMarkTriangle />\n {errorMsg}\n </div>\n ) : (\n <>\n {icon && <div>{icon}</div>}\n {(label || secondaryLabel) && (\n <div className=\"tw-flex tw-flex-col tw-items-start\">\n {label && <div className=\"tw-font-medium\">{label}</div>}\n {secondaryLabel && <div className=\"tw-font-normal\">{secondaryLabel}</div>}\n </div>\n )}\n </>\n )}\n {menuPosition && (\n <div\n className=\"tw-absolute tw-left-0 tw-top-full tw-z-20\"\n style={{\n left: menuPosition[0],\n top: menuPosition[1],\n }}\n >\n <Flyout\n onOpenChange={(isOpen) => !isOpen && setMenuPosition(undefined)}\n isOpen={true}\n fitContent\n hug={false}\n legacyFooter={false}\n trigger={<div />}\n >\n <ActionMenu\n menuBlocks={[\n {\n id: 'menu',\n menuItems: [\n ...(onUploadClick\n ? [\n {\n id: 'upload',\n size: MenuItemContentSize.XSmall,\n title: 'Upload asset',\n onClick: () => {\n onUploadClick();\n setMenuPosition(undefined);\n },\n\n initialValue: true,\n decorator: (\n <div className=\"tw-mr-2\">\n <IconArrowCircleUp20 />\n </div>\n ),\n },\n ]\n : []),\n ...(onAssetChooseClick\n ? [\n {\n id: 'asset',\n size: MenuItemContentSize.XSmall,\n title: 'Browse asset',\n onClick: () => {\n onAssetChooseClick();\n setMenuPosition(undefined);\n },\n initialValue: true,\n decorator: (\n <div className=\"tw-mr-2\">\n <IconImageStack20 />\n </div>\n ),\n },\n ]\n : []),\n ],\n },\n ]}\n />\n </Flyout>\n </div>\n )}\n </button>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Color } from '@frontify/fondue';\n\ntype ShortNotationColor = {\n r: number;\n g: number;\n b: number;\n a?: number;\n};\n\n/**\n * Maps color object from long to short rgba notation.\n *\n * @param {Object} Color object\n * @returns {Object} ShortNotationColor object\n */\n\nexport const toShortRgba = (color: unknown): ShortNotationColor => {\n const isRgbaLongFormat = (value: Color) => {\n const requiredKeys = ['red', 'green', 'blue'];\n return typeof value === 'object' && requiredKeys.every((i) => value.hasOwnProperty(i));\n };\n\n const mapToShortFormat = (value: Color): ShortNotationColor => {\n const alpha = typeof value.alpha === 'number' ? value.alpha : 1;\n return { r: value.red, g: value.green, b: value.blue, a: alpha };\n };\n\n if (isRgbaLongFormat(color as Color)) {\n return mapToShortFormat(color as Color);\n }\n\n return color as ShortNotationColor;\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport tinycolor, { ColorInput } from '@ctrl/tinycolor';\nimport { toShortRgba } from './toShortRgba';\nimport { Color } from '@frontify/sidebar-settings';\n\n/**\n * Calculates if text should be in a light color depending on color (e.g. background-color)\n *\n * @param {Object} value Object of RGBA values\n * @param {Number|undefined} threshold Threshold for the brightness\n * @returns {Boolean} Return if the color is dark\n */\n\nconst isRgbaLongFormat = (value: unknown): value is Color => {\n const requiredKeys = ['red', 'green', 'blue'];\n return typeof value === 'object' && requiredKeys.every((i) => value?.hasOwnProperty(i));\n};\n\nexport const isDark = (color: unknown, threshold?: number): boolean => {\n const inputColor = isRgbaLongFormat(color) ? toShortRgba(color) : (color as ColorInput);\n const parsedColor = tinycolor(inputColor);\n\n if (threshold) {\n return parsedColor.getBrightness() < threshold;\n }\n\n return parsedColor.isDark() || (parsedColor.getAlpha() > 0.25 && parsedColor.getAlpha() < 1);\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Color } from '@frontify/fondue';\nimport tinycolor from '@ctrl/tinycolor';\nimport { toShortRgba } from './toShortRgba';\n\n/**\n * Maps color object of rgba values to hex alpha string.\n *\n * @param {Object} Color object\n * @returns {String} To be used as css value.\n */\n\nexport const toHex8String = (color: Color): string => tinycolor(toShortRgba(color)).toHex8String();\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Color } from '@frontify/fondue';\nimport tinycolor from '@ctrl/tinycolor';\nimport { toShortRgba } from './toShortRgba';\n\n/**\n * Maps color object of rgba values to hex alpha string.\n */\nexport const toHexString = (color: Color): string => tinycolor(toShortRgba(color)).toHexString();\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Color } from '@frontify/fondue';\nimport tinycolor from '@ctrl/tinycolor';\nimport { toShortRgba } from './toShortRgba';\n\n/**\n * Maps color object of rgba values to rgba string.\n *\n * @param {Object} Color object\n * @returns {String} To be used as css value.\n */\n\nexport const toRgbaString = (color: Color): string => tinycolor(toShortRgba(color)).toRgbString();\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport tinycolor from '@ctrl/tinycolor';\n\n/**\n * Sets alpha value and returns rgba string.\n *\n * @param {string} color Rgb or hex string.\n * @returns {String} To be used as css value.\n */\n\nexport const setAlpha = (alpha: number, color?: string): string => {\n return tinycolor(color).setAlpha(alpha).toRgbString();\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Color } from '@frontify/fondue';\nimport tinycolor from '@ctrl/tinycolor';\n\n/**\n * Maps color strings to color objects.\n *\n * @param {String} String representing color\n * @returns {Color} Color object\n */\n\nexport const toColorObject = (colorString: string): Color => {\n const { r, g, b, a } = tinycolor(colorString);\n return { red: r, green: g, blue: b, alpha: a };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport tinycolor, { ColorInput, readability } from '@ctrl/tinycolor';\nimport { toShortRgba } from './toShortRgba';\nimport { Color } from '@frontify/sidebar-settings';\n\n/**\n * Returns darkened text color for a given background color, so that it is readable and has enough contrast (above 4.5)\n *\n * @param {Object} textColor Object of RGBA values\n * @param {Object} backgroundColor Object of RGBA values\n * @returns {string} To be used as css value\n */\n\nconst isRgbaLongFormat = (value: unknown): value is Color => {\n const requiredKeys = ['red', 'green', 'blue'];\n return typeof value === 'object' && requiredKeys.every((i) => value?.hasOwnProperty(i));\n};\n\nexport const getReadableColor = (textColor: unknown, backgroundColor: unknown): string => {\n const inputTextColor = isRgbaLongFormat(textColor) ? toShortRgba(textColor) : (textColor as ColorInput);\n const inputBackgroundColor = isRgbaLongFormat(backgroundColor)\n ? toShortRgba(backgroundColor)\n : (backgroundColor as ColorInput);\n let parsedTextColor = tinycolor(inputTextColor);\n const parsedBackgroundColor = tinycolor(inputBackgroundColor);\n\n //darken the text color until readability is good\n while (readability(parsedTextColor, parsedBackgroundColor) < 4.5) {\n parsedTextColor = parsedTextColor.darken(1);\n }\n\n return parsedTextColor.toRgbString();\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\n/**\n * Moves an item from the 'from' position to the 'to' position and updates the array\n *\n * @param {Array} array Array of items\n * @param {Number} from Initial index of the item\n * @param {Number} to New index of the item\n * @returns {Array} New array with the item moved to the new position\n */\nexport const moveItemInArray = <T>(array: T[], from: number, to: number): T[] => {\n const newArray = [...array];\n const toIndex = to < 0 ? newArray.length + to : to;\n\n if (toIndex >= 0 && toIndex < newArray.length) {\n const slice = newArray.splice(from, 1)[0];\n newArray.splice(toIndex, 0, slice);\n }\n\n return newArray;\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\n\nimport { Color } from '@frontify/fondue';\n\nimport { toRgbaString } from '../color';\n\nexport const getBackgroundColorStyles = (backgroundColor: Color): CSSProperties => ({\n backgroundColor: toRgbaString(backgroundColor),\n});\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Color } from '@frontify/sidebar-settings';\n\nexport enum BorderStyle {\n Solid = 'Solid',\n Dashed = 'Dashed',\n Dotted = 'Dotted',\n}\n\nexport const borderStyleMap: Record<BorderStyle, string> = {\n [BorderStyle.Solid]: 'solid',\n [BorderStyle.Dotted]: 'dotted',\n [BorderStyle.Dashed]: 'dashed',\n};\n\nexport enum Radius {\n None = 'None',\n Small = 'Small',\n Medium = 'Medium',\n Large = 'Large',\n}\n\nexport const radiusStyleMap: Record<Radius, string> = {\n [Radius.None]: '0px',\n [Radius.Small]: '2px',\n [Radius.Medium]: '4px',\n [Radius.Large]: '12px',\n};\n\nexport enum Padding {\n None = 'None',\n Small = 'Small',\n Medium = 'Medium',\n Large = 'Large',\n}\n\nexport const paddingStyleMap: Record<Padding, string> = {\n [Padding.None]: '0px',\n [Padding.Small]: '24px',\n [Padding.Medium]: '36px',\n [Padding.Large]: '60px',\n};\n\nexport type PaddingSettings = {\n paddingChoice: Padding;\n hasCustomPaddingValue: boolean;\n paddingValue: string;\n};\n\nexport type PaddingExtendedSettings = {\n hasExtendedCustomPadding: boolean;\n extendedPaddingChoice: Padding;\n extendedPaddingTop: string;\n extendedPaddingRight: string;\n extendedPaddingBottom: string;\n extendedPaddingLeft: string;\n};\n\nexport type RadiusExtendedSettings = {\n hasExtendedCustomRadius: boolean;\n extendedRadiusChoice: Radius;\n extendedRadiusTopLeft: string;\n extendedRadiusTopRight: string;\n extendedRadiusBottomLeft: string;\n extendedRadiusBottomRight: string;\n};\n\nexport type BorderSettings = {\n hasBorder: boolean;\n borderStyle: BorderStyle;\n borderWidth: string;\n borderColor: Color;\n};\n\nexport type RadiusSettings = {\n hasRadius: boolean;\n radiusValue: string;\n radiusChoice: Radius;\n};\n\nexport enum Margin {\n None = 'None',\n Small = 'Small',\n Medium = 'Medium',\n Large = 'Large',\n}\n\nexport const marginStyleMap: Record<Margin, string> = {\n [Margin.None]: '0px',\n [Margin.Small]: '24px',\n [Margin.Medium]: '36px',\n [Margin.Large]: '60px',\n};\n\nexport type MarginSettings = {\n marginChoice: Margin;\n hasCustomMarginValue: boolean;\n marginValue: string;\n};\n\nexport type MarginExtendedSettings = {\n hasExtendedCustomMargin: boolean;\n extendedMarginChoice: Margin;\n extendedMarginTop: string;\n extendedMarginRight: string;\n extendedMarginBottom: string;\n extendedMarginLeft: string;\n};\n\nexport enum Security {\n Global = 'Global',\n Custom = 'Custom',\n}\n\nexport enum GutterSpacing {\n Auto = 'Auto',\n S = 'S',\n M = 'M',\n L = 'L',\n}\n\nexport const gutterSpacingStyleMap: Record<GutterSpacing, string> = {\n [GutterSpacing.Auto]: '4px',\n [GutterSpacing.S]: '10px',\n [GutterSpacing.M]: '30px',\n [GutterSpacing.L]: '50px',\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const BACKGROUND_COLOR_DEFAULT_VALUE = {\n red: 241,\n green: 241,\n blue: 241,\n alpha: 1,\n};\n\nexport const BORDER_COLOR_DEFAULT_VALUE = {\n red: 234,\n green: 235,\n blue: 235,\n alpha: 1,\n};\n\nexport const BORDER_WIDTH_DEFAULT_VALUE = '1px';\n\nexport const PADDING_DEFAULT_PLACEHOLDER = '24px';\n\nexport const MARGIN_DEFAULT_PLACEHOLDER = '24px';\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\n\nimport { Color } from '@frontify/fondue';\n\nimport { BorderStyle, borderStyleMap } from '../../settings/types';\nimport { BORDER_COLOR_DEFAULT_VALUE } from '../../settings/defaultValues';\nimport { toRgbaString } from '../color';\n\nexport const getBorderStyles = (\n style = BorderStyle.Solid,\n borderWidth = '1px',\n color = BORDER_COLOR_DEFAULT_VALUE as Color,\n): CSSProperties => {\n return {\n borderStyle: borderStyleMap[style],\n borderWidth,\n borderColor: toRgbaString(color),\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\nimport { Radius, radiusStyleMap } from '../../settings/types';\n\nexport const getRadiusStyles = (radiusChoice: Radius, hasRadius = false, radiusValue?: number): CSSProperties => ({\n borderRadius: hasRadius ? radiusValue : radiusStyleMap[radiusChoice],\n});\n","/* (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","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ActionMenu,\n Flyout,\n IconDotsHorizontal16,\n MenuItemContentSize,\n Tooltip,\n TooltipPosition,\n} from '@frontify/fondue';\nimport { ToolbarProps } from './types';\nimport { joinClassNames } from '../../utilities';\nimport { DEFAULT_DRAGGING_TOOLTIP, DEFAULT_DRAG_TOOLTIP } from './constants';\n\nexport const Toolbar = ({\n items,\n flyoutItems,\n isFlyoutOpen,\n setIsFlyoutOpen,\n isDragging,\n isFlyoutDisabled,\n}: ToolbarProps) => {\n return (\n <div data-test-id=\"block-item-wrapper-toolbar\" className=\"tw-flex tw-justify-end\">\n <div className=\"tw-bg-white tw-text-box-selected-inverse tw-pointer-events-auto tw-flex tw-flex-shrink-0 tw-gap-[2px] tw-px-[1px] tw-spacing tw-items-center tw-h-7 tw-self-start tw-border tw-border-box-selected-inverse tw-rounded\">\n {items.map((item, i) =>\n 'draggableProps' in item ? (\n <Tooltip\n key={i}\n withArrow\n hoverDelay={0}\n enterDelay={300}\n open={isDragging}\n position={TooltipPosition.Top}\n content={\n <div>\n {isDragging ? DEFAULT_DRAGGING_TOOLTIP : item.tooltip ?? DEFAULT_DRAG_TOOLTIP}\n </div>\n }\n triggerElement={\n <button\n ref={item.setActivatorNodeRef}\n data-test-id=\"block-item-wrapper-toolbar-btn\"\n {...item.draggableProps}\n className={joinClassNames([\n 'tw-bg-base tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm',\n isDragging\n ? 'tw-cursor-grabbing tw-bg-box-selected-pressed'\n : 'tw-cursor-grab hover:tw-bg-box-selected-hover',\n ])}\n >\n {item.icon}\n </button>\n }\n />\n ) : (\n <Tooltip\n key={i}\n withArrow\n enterDelay={300}\n hoverDelay={0}\n disabled={isDragging}\n position={TooltipPosition.Top}\n content={<div>{item.tooltip ?? ''}</div>}\n triggerElement={\n <button\n data-test-id=\"block-item-wrapper-toolbar-btn\"\n onClick={item.onClick}\n className=\"tw-bg-base hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed tw-cursor-pointer tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm\"\n >\n {item.icon}\n </button>\n }\n />\n ),\n )}\n {flyoutItems.length > 0 && (\n <div className=\"tw-flex tw-flex-shrink-0 tw-flex-1 tw-h-6\">\n <Flyout\n isOpen={isFlyoutOpen && !isDragging}\n isTriggerDisabled={isFlyoutDisabled}\n legacyFooter={false}\n fitContent\n hug={false}\n onOpenChange={setIsFlyoutOpen}\n trigger={\n <Tooltip\n withArrow\n hoverDelay={0}\n enterDelay={300}\n disabled={isDragging}\n position={TooltipPosition.Top}\n content={<div>Options</div>}\n triggerElement={\n <div\n data-test-id=\"block-item-wrapper-toolbar-flyout\"\n className=\"tw-bg-base hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed tw-cursor-pointer tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm\"\n >\n <IconDotsHorizontal16 />\n </div>\n }\n />\n }\n >\n <ActionMenu\n menuBlocks={flyoutItems.map((block, blockIndex) => ({\n id: blockIndex.toString(),\n menuItems: block.map((item, itemIndex) => ({\n id: blockIndex.toString() + itemIndex.toString(),\n size: MenuItemContentSize.XSmall,\n title: item.title,\n style: item.style,\n onClick: () => {\n setIsFlyoutOpen(false);\n item.onClick();\n },\n initialValue: true,\n decorator: <div className=\"tw-mr-2\">{item.icon}</div>,\n })),\n }))}\n />\n </Flyout>\n </div>\n )}\n </div>\n </div>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PropsWithChildren, useEffect, useRef, useState } from 'react';\nimport { joinClassNames } from '../../utilities';\nimport { Toolbar } from './Toolbar';\nimport { BlockItemWrapperProps, ToolbarItem } from './types';\n\nexport const BlockItemWrapper = ({\n children,\n toolbarFlyoutItems,\n toolbarItems,\n shouldHideWrapper,\n shouldHideComponent = false,\n isDragging,\n shouldFillContainer,\n outlineOffset = 2,\n shouldBeShown = false,\n}: PropsWithChildren<BlockItemWrapperProps>) => {\n const [isFlyoutOpen, setIsFlyoutOpen] = useState(shouldBeShown);\n const [isFlyoutDisabled, setIsFlyoutDisabled] = useState(false);\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!isFlyoutOpen) {\n // This prevents automatic refocusing of the trigger element\n setIsFlyoutDisabled(true);\n }\n }, [isFlyoutOpen]);\n\n if (shouldHideWrapper) {\n return children;\n }\n\n const items = toolbarItems?.filter((item): item is ToolbarItem => item !== undefined);\n\n return (\n <div\n ref={wrapperRef}\n onFocus={() => setIsFlyoutDisabled(false)}\n onPointerEnter={() => setIsFlyoutDisabled(false)}\n data-test-id=\"block-item-wrapper\"\n style={{\n outlineOffset,\n }}\n className={joinClassNames([\n 'tw-relative tw-group tw-outline-1 tw-outline-box-selected-inverse',\n shouldFillContainer && 'tw-flex-1 tw-h-full tw-w-full',\n 'hover:tw-outline focus-within:tw-outline',\n (isFlyoutOpen || shouldBeShown) && 'tw-outline',\n shouldHideComponent && 'tw-opacity-0',\n ])}\n >\n <div\n style={{\n right: -1 - outlineOffset,\n bottom: `calc(100% - ${2 + outlineOffset}px)`,\n }}\n className={joinClassNames([\n 'tw-pointer-events-none tw-absolute tw-bottom-[calc(100%-4px)] tw-right-[-3px] tw-w-full tw-opacity-0 tw-z-10',\n 'group-hover:tw-opacity-100 group-focus:tw-opacity-100 focus-within:tw-opacity-100',\n (isFlyoutOpen || shouldBeShown) && 'tw-opacity-100',\n ])}\n >\n <Toolbar\n isFlyoutOpen={isFlyoutOpen}\n isFlyoutDisabled={isFlyoutDisabled}\n setIsFlyoutOpen={setIsFlyoutOpen}\n flyoutItems={toolbarFlyoutItems}\n items={items}\n isDragging={isDragging}\n />\n </div>\n {children}\n </div>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { MutableRefObject, forwardRef, useEffect, useState } from 'react';\nimport { Asset, useAssetUpload, useFileInput } from '@frontify/app-bridge';\nimport { useSortable } from '@dnd-kit/sortable';\nimport { useFocusRing } from '@react-aria/focus';\n\nimport {\n ActionMenu,\n Button,\n ButtonEmphasis,\n FOCUS_STYLE,\n Flyout,\n FlyoutPlacement,\n IconArrowCircleUp20,\n IconDocument24,\n IconGrabHandle20,\n IconImage24,\n IconImageStack20,\n IconMusicNote24,\n IconPen20,\n IconPlayFrame24,\n IconTrashBin20,\n LoadingCircle,\n LoadingCircleSize,\n MenuItemContentSize,\n MenuItemStyle,\n} from '@frontify/fondue';\nimport { AttachmentItemProps, SortableAttachmentItemProps } from './types';\nimport { joinClassNames } from '../../utilities';\n\nconst getDecorator = (type: string) => {\n if (type === 'IMAGE') {\n return <IconImage24 />;\n } else if (type === 'VIDEO') {\n return <IconPlayFrame24 />;\n } else if (type === 'AUDIO') {\n return <IconMusicNote24 />;\n } else {\n return <IconDocument24 />;\n }\n};\n\nexport const AttachmentItem = forwardRef<HTMLButtonElement, AttachmentItemProps>(\n (\n {\n item,\n isEditing,\n draggableProps,\n transformStyle,\n isDragging,\n isOverlay,\n isLoading,\n onDelete,\n onReplaceWithBrowse,\n onReplaceWithUpload,\n },\n ref,\n ) => {\n const [selectedAsset, setSelectedAsset] = useState<Asset | undefined>();\n const [openFileDialog, { selectedFiles }] = useFileInput({ multiple: true, accept: 'image/*' });\n const [uploadFile, { results: uploadResults, doneAll }] = useAssetUpload();\n const { focusProps, isFocusVisible } = useFocusRing();\n\n useEffect(() => {\n if (selectedFiles) {\n uploadFile(selectedFiles[0]);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedFiles]);\n\n useEffect(() => {\n if (doneAll) {\n onReplaceWithUpload(uploadResults[0]);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [doneAll, uploadResults]);\n\n const download = (url: string, filename: string) => {\n fetch(url).then((response) => {\n response.blob().then((blob) => {\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = filename;\n a.click();\n });\n });\n };\n\n const showLoadingCircle = isLoading || (selectedFiles && !doneAll);\n\n return (\n <button\n aria-label=\"Download attachment\"\n data-test-id=\"attachments-item\"\n onClick={() => download(item.genericUrl, item.fileName)}\n ref={ref}\n style={{\n ...transformStyle,\n opacity: isDragging && !isOverlay ? 0.3 : 1,\n fontFamily: 'var(-f-theme-settings-body-font-family)',\n }}\n className={joinClassNames([\n 'tw-cursor-pointer tw-text-left tw-w-full tw-relative tw-flex tw-gap-3 tw-px-5 tw-py-3 tw-items-center tw-group hover:tw-bg-box-neutral-hover',\n isDragging ? 'tw-bg-box-neutral-hover' : '',\n ])}\n >\n <div className=\"tw-text-text-weak group-hover:tw-text-box-neutral-inverse-hover\">\n {showLoadingCircle ? (\n <LoadingCircle size={LoadingCircleSize.Small} />\n ) : (\n getDecorator(item.objectType)\n )}\n </div>\n <div className=\"tw-text-s tw-flex-1 tw-min-w-0\">\n <div className=\"tw-whitespace-nowrap tw-overflow-hidden tw-text-ellipsis tw-font-bold tw-text-text-weak group-hover:tw-text-box-neutral-inverse-hover\">\n {item.title}\n </div>\n <div className=\"tw-text-text-weak\">{`${item.fileSizeHumanReadable} - ${item.extension}`}</div>\n </div>\n {isEditing && (\n <div\n data-test-id=\"attachments-actionbar\"\n className={joinClassNames([\n 'tw-flex tw-gap-0.5 group-focus:tw-opacity-100 focus-visible:tw-opacity-100 focus-within:tw-opacity-100 group-hover:tw-opacity-100',\n isOverlay || selectedAsset?.id === item.id ? 'tw-opacity-100' : 'tw-opacity-0',\n ])}\n >\n <button\n {...focusProps}\n {...draggableProps}\n aria-label=\"Drag attachment\"\n className={joinClassNames([\n ' tw-border-button-border tw-bg-button-background active:tw-bg-button-background-pressed tw-group tw-border tw-box-box tw-relative tw-flex tw-items-center tw-justify-center tw-outline-none tw-font-medium tw-rounded tw-h-9 tw-w-9 ',\n isDragging || isOverlay\n ? 'tw-cursor-grabbing tw-bg-button-background-pressed hover:tw-bg-button-background-pressed'\n : 'tw-cursor-grab hover:tw-bg-button-background-hover',\n isFocusVisible && FOCUS_STYLE,\n isFocusVisible && 'tw-z-[2]',\n ])}\n >\n <IconGrabHandle20 />\n </button>\n <div data-test-id=\"attachments-actionbar-flyout\">\n <Flyout\n placement={FlyoutPlacement.Right}\n isOpen={selectedAsset?.id === item.id}\n fitContent\n legacyFooter={false}\n onOpenChange={(isOpen) => setSelectedAsset(isOpen ? item : undefined)}\n trigger={(_, ref) => (\n <Button\n ref={ref as MutableRefObject<HTMLButtonElement>}\n icon={<IconPen20 />}\n emphasis={ButtonEmphasis.Default}\n onClick={() => setSelectedAsset(item)}\n />\n )}\n >\n <ActionMenu\n menuBlocks={[\n {\n id: 'menu',\n menuItems: [\n {\n id: 'upload',\n size: MenuItemContentSize.XSmall,\n title: 'Replace with upload',\n onClick: () => {\n openFileDialog();\n setSelectedAsset(undefined);\n },\n\n initialValue: true,\n decorator: (\n <div className=\"tw-mr-2\">\n <IconArrowCircleUp20 />\n </div>\n ),\n },\n\n {\n id: 'asset',\n size: MenuItemContentSize.XSmall,\n title: 'Replace with asset',\n onClick: () => {\n onReplaceWithBrowse();\n setSelectedAsset(undefined);\n },\n initialValue: true,\n decorator: (\n <div className=\"tw-mr-2\">\n <IconImageStack20 />\n </div>\n ),\n },\n ],\n },\n {\n id: 'menu-delete',\n menuItems: [\n {\n id: 'delete',\n size: MenuItemContentSize.XSmall,\n title: 'Delete',\n style: MenuItemStyle.Danger,\n onClick: () => {\n onDelete();\n setSelectedAsset(undefined);\n },\n\n initialValue: true,\n decorator: (\n <div className=\"tw-mr-2\">\n <IconTrashBin20 />\n </div>\n ),\n },\n ],\n },\n ]}\n />\n </Flyout>\n </div>\n </div>\n )}\n </button>\n );\n },\n);\n\nAttachmentItem.displayName = 'AttachmentItem';\n\nexport const SortableAttachmentItem = (props: SortableAttachmentItemProps) => {\n const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({\n id: props.item.id,\n });\n\n const transformStyle = {\n transform: transform ? `translate(${transform.x}px, ${transform.y}px)` : '',\n transition,\n zIndex: isDragging ? 2 : 1,\n };\n\n const draggableProps = { ...attributes, ...listeners };\n\n return (\n <AttachmentItem\n ref={setNodeRef}\n isDragging={isDragging}\n transformStyle={transformStyle}\n draggableProps={draggableProps}\n {...props}\n />\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useEffect, useState } from 'react';\nimport {\n DndContext,\n DragEndEvent,\n DragOverlay,\n DragStartEvent,\n KeyboardSensor,\n PointerSensor,\n closestCenter,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport { SortableContext, arrayMove, rectSortingStrategy } from '@dnd-kit/sortable';\nimport { Asset, useAssetUpload, useEditorState } from '@frontify/app-bridge';\nimport {\n AssetInput,\n AssetInputSize,\n Flyout,\n FlyoutPlacement,\n IconCaretDown12,\n IconPaperclip16,\n Tooltip,\n TooltipPosition,\n} from '@frontify/fondue';\nimport { AttachmentItem, SortableAttachmentItem } from './AttachmentItem';\nimport { AttachmentsProps } from './types';\nimport { restrictToWindowEdges } from '@dnd-kit/modifiers';\n\nexport const Attachments = ({\n items = [],\n onDelete,\n onReplaceWithBrowse,\n onReplaceWithUpload,\n onBrowse,\n onUpload,\n onSorted,\n appBridge,\n}: AttachmentsProps) => {\n const [internalItems, setInternalItems] = useState<Asset[]>(items);\n const [isFlyoutOpen, setIsFlyoutOpen] = useState(false);\n const sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor));\n const [draggedAssetId, setDraggedAssetId] = useState<number | undefined>(undefined);\n const [isUploadLoading, setIsUploadLoading] = useState(false);\n const [assetIdsLoading, setAssetIdsLoading] = useState<number[]>([]);\n const [selectedFiles, setSelectedFiles] = useState<FileList | null>(null);\n const isEditing = useEditorState(appBridge);\n\n const draggedItem = internalItems?.find((item) => item.id === draggedAssetId);\n\n const [uploadFile, { results: uploadResults, doneAll }] = useAssetUpload({\n onUploadProgress: () => !isUploadLoading && setIsUploadLoading(true),\n });\n\n useEffect(() => {\n setInternalItems(items);\n }, [items]);\n\n useEffect(() => {\n if (selectedFiles) {\n setIsUploadLoading(true);\n uploadFile(selectedFiles);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedFiles]);\n\n useEffect(() => {\n const uploadDone = async () => {\n if (doneAll) {\n await onUpload(uploadResults);\n setIsUploadLoading(false);\n }\n };\n uploadDone();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [doneAll, uploadResults]);\n\n const onOpenAssetChooser = () => {\n setIsFlyoutOpen(false);\n appBridge.openAssetChooser(\n (result: Asset[]) => {\n onBrowse(result);\n appBridge.closeAssetChooser();\n setIsFlyoutOpen(true);\n },\n {\n multiSelection: true,\n selectedValueIds: internalItems.map((internalItem) => internalItem.id),\n },\n );\n };\n\n const onReplaceItemWithBrowse = (toReplace: Asset) => {\n setIsFlyoutOpen(false);\n appBridge.openAssetChooser(\n async (result: Asset[]) => {\n setIsFlyoutOpen(true);\n appBridge.closeAssetChooser();\n setAssetIdsLoading([...assetIdsLoading, toReplace.id]);\n await onReplaceWithBrowse(toReplace, result[0]);\n setAssetIdsLoading(assetIdsLoading.filter((id) => id !== toReplace.id));\n },\n {\n multiSelection: false,\n selectedValueIds: internalItems.map((internalItem) => internalItem.id),\n },\n );\n };\n\n const onReplaceItemWithUpload = async (toReplace: Asset, uploadedAsset: Asset) => {\n setAssetIdsLoading([...assetIdsLoading, toReplace.id]);\n await onReplaceWithUpload(toReplace, uploadedAsset);\n setAssetIdsLoading(assetIdsLoading.filter((id) => id !== toReplace.id));\n };\n\n const handleDragStart = (event: DragStartEvent) => {\n const { active } = event;\n setDraggedAssetId(active.id as number);\n };\n\n const handleDragEnd = (event: DragEndEvent) => {\n const { active, over } = event;\n if (over && active.id !== over.id && internalItems) {\n const oldIndex = internalItems.findIndex((i) => i.id === active.id);\n const newIndex = internalItems.findIndex((i) => i.id === over.id);\n const sortedItems = arrayMove(internalItems, oldIndex, newIndex);\n setInternalItems(sortedItems);\n onSorted(sortedItems);\n }\n setDraggedAssetId(undefined);\n };\n\n return isEditing || (internalItems?.length ?? 0) > 0 ? (\n <Tooltip\n withArrow\n position={TooltipPosition.Top}\n content=\"Attachments\"\n disabled={isFlyoutOpen}\n enterDelay={500}\n triggerElement={\n <div data-test-id=\"attachments-flyout-button\">\n <Flyout\n placement={FlyoutPlacement.BottomRight}\n onOpenChange={(isOpen) => setIsFlyoutOpen(!!draggedItem ? true : isOpen)}\n isOpen={isFlyoutOpen}\n hug={false}\n fitContent\n legacyFooter={false}\n trigger={\n <div className=\"tw-flex tw-text-[13px] tw-font-body tw-items-center tw-gap-1 tw-rounded-full tw-bg-box-neutral-strong-inverse hover:tw-bg-box-neutral-strong-inverse-hover active:tw-bg-box-neutral-strong-inverse-pressed tw-text-box-neutral-strong tw-outline tw-outline-1 tw-outline-offset-[1px] tw-p-[6px] tw-outline-line\">\n <IconPaperclip16 />\n <div>{items.length > 0 ? items.length : 'Add'}</div>\n <IconCaretDown12 />\n </div>\n }\n >\n <div className=\"tw-w-[300px]\">\n {internalItems.length > 0 && (\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragStart={handleDragStart}\n onDragEnd={handleDragEnd}\n modifiers={[restrictToWindowEdges]}\n >\n <SortableContext items={internalItems} strategy={rectSortingStrategy}>\n <div className=\"tw-border-b tw-border-b-line\">\n {internalItems.map((item) => (\n <SortableAttachmentItem\n isEditing={isEditing}\n isLoading={assetIdsLoading.includes(item.id)}\n key={item.id}\n item={item}\n onDelete={() => onDelete(item)}\n onReplaceWithBrowse={() => onReplaceItemWithBrowse(item)}\n onReplaceWithUpload={(uploadedAsset: Asset) =>\n onReplaceItemWithUpload(item, uploadedAsset)\n }\n />\n ))}\n </div>\n </SortableContext>\n <DragOverlay>\n {draggedItem && (\n <AttachmentItem\n isOverlay={true}\n isEditing={isEditing}\n key={draggedAssetId}\n item={draggedItem}\n isDragging={true}\n onDelete={() => onDelete(draggedItem)}\n onReplaceWithBrowse={() => onReplaceItemWithBrowse(draggedItem)}\n onReplaceWithUpload={(uploadedAsset: Asset) =>\n onReplaceItemWithUpload(draggedItem, uploadedAsset)\n }\n />\n )}\n </DragOverlay>\n </DndContext>\n )}\n {isEditing && (\n <div className=\"tw-px-5 tw-py-3\">\n <div className=\"tw-font-body tw-font-medium tw-text-text tw-text-s tw-my-4\">\n Add attachments\n </div>\n <AssetInput\n isLoading={isUploadLoading}\n size={AssetInputSize.Small}\n onUploadClick={(fileList) => setSelectedFiles(fileList)}\n onLibraryClick={onOpenAssetChooser}\n />\n </div>\n )}\n </div>\n </Flyout>\n </div>\n }\n />\n ) : null;\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { DownloadButtonProps } from './types';\nimport { useFocusRing } from '@react-aria/focus';\nimport { FOCUS_STYLE, IconArrowCircleDown16, Tooltip, TooltipPosition } from '@frontify/fondue';\nimport { joinClassNames } from '../../utilities';\n\nexport const DownloadButton = ({ onDownload }: DownloadButtonProps) => {\n const { isFocused, focusProps } = useFocusRing();\n\n return (\n <Tooltip\n withArrow\n position={TooltipPosition.Top}\n content=\"Download\"\n enterDelay={500}\n triggerElement={\n <button\n tabIndex={0}\n aria-label=\"Download\"\n {...focusProps}\n className={joinClassNames(['tw-outline-none tw-rounded', isFocused && FOCUS_STYLE])}\n onClick={onDownload}\n onPointerDown={(e) => e.preventDefault()}\n >\n <span\n data-test-id=\"download-button\"\n className=\"tw-flex tw-text-xs tw-font-body tw-items-center tw-gap-1 tw-rounded-full tw-bg-box-neutral-strong-inverse hover:tw-bg-box-neutral-strong-inverse-hover active:tw-bg-box-neutral-strong-inverse-pressed tw-text-box-neutral-strong tw-outline tw-outline-1 tw-outline-offset-1 tw-p-1.5 tw-outline-line\"\n >\n <IconArrowCircleDown16 />\n </span>\n </button>\n }\n />\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ELEMENT_LINK,\n FloatingLinkProps,\n HTMLPropsAs,\n LinkPlugin,\n floatingLinkActions,\n getPluginOptions,\n getSelectionBoundingClientRect,\n triggerFloatingLinkInsert,\n useComposedRef,\n useEditorRef,\n useFloatingLinkEscape,\n useFloatingLinkSelectors,\n useHotkeys,\n useVirtualFloatingLink,\n} from '@udecode/plate';\nimport { useEffect } from 'react';\nimport { useFocused } from 'slate-react';\n\nexport const useFloatingLinkInsert = ({ floatingOptions, ...props }: FloatingLinkProps): HTMLPropsAs<'div'> => {\n const editor = useEditorRef();\n const focused = useFocused();\n const mode = useFloatingLinkSelectors().mode();\n const open = useFloatingLinkSelectors().isOpen(editor.id);\n\n const { triggerFloatingLinkHotkeys } = getPluginOptions<LinkPlugin>(editor, ELEMENT_LINK);\n\n useHotkeys(\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n triggerFloatingLinkHotkeys!,\n (e) => {\n if (triggerFloatingLinkInsert(editor, { focused })) {\n e.preventDefault();\n }\n },\n {\n enableOnContentEditable: true,\n },\n [focused],\n );\n\n const { update, style, floating } = useVirtualFloatingLink({\n editorId: editor.id,\n open: open && mode === 'insert',\n getBoundingClientRect: getSelectionBoundingClientRect,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n whileElementsMounted: () => {},\n ...floatingOptions,\n });\n\n // wait for update before focusing input\n useEffect(() => {\n if (open) {\n update();\n floatingLinkActions.updated(true);\n } else {\n floatingLinkActions.updated(false);\n }\n }, [open, update]);\n\n useFloatingLinkEscape();\n\n return {\n style: {\n ...style,\n zIndex: 1000,\n },\n ...props,\n ref: useComposedRef<HTMLElement | null>(props.ref, floating),\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n FloatingLinkProps,\n FloatingLink as PlateFloatingLink,\n createComponentAs,\n createElementAs,\n} from '@udecode/plate';\nimport { useFloatingLinkEdit } from './EditLinkModal';\nimport { useFloatingLinkInsert } from './InsertLinkModal/useFloatingLinkInsert';\n\nconst FloatingLinkInsertRoot = createComponentAs<FloatingLinkProps>((props) => {\n const htmlProps = useFloatingLinkInsert({\n ...props,\n floatingOptions: {\n strategy: 'absolute',\n },\n });\n\n if (htmlProps.style?.display === 'none') {\n return null;\n }\n\n return createElementAs('div', htmlProps);\n});\n\nconst FloatingLinkEditRoot = createComponentAs<FloatingLinkProps>((props) => {\n const htmlProps = useFloatingLinkEdit({\n ...props,\n floatingOptions: {\n strategy: 'absolute',\n },\n });\n\n if (htmlProps.style?.display === 'none') {\n return null;\n }\n\n return createElementAs('div', htmlProps);\n});\n\nPlateFloatingLink.EditRoot = FloatingLinkEditRoot;\nPlateFloatingLink.InsertRoot = FloatingLinkInsertRoot;\n\nexport const FloatingLink = PlateFloatingLink;\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const LINK_PLUGIN = 'link-plugin';\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\ntype TextElement = {\n text: string;\n children?: TextElement[];\n};\n\nexport const hasRichTextValue = (string?: string): boolean => {\n if (!string) {\n return false;\n }\n const hasText = (children: TextElement[]): boolean =>\n children.some((child: TextElement) => {\n if (child.text) {\n return child.text !== '';\n }\n if (child.children) {\n return hasText(child.children);\n }\n return false;\n });\n\n try {\n const json = JSON.parse(string);\n return hasText(json);\n } catch (error) {\n return false;\n }\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { hasRichTextValue } from './hasRichTextValue';\n\nexport const convertToRteValue = (textStyle = 'p', text = '', align?: 'center' | 'right' | 'left' | 'justify') =>\n hasRichTextValue(text) ? text : JSON.stringify([{ type: textStyle, children: [{ text, textStyle }], align }]);\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { KeyboardCode, KeyboardCoordinateGetter } from '@dnd-kit/core';\n\nconst directions: string[] = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];\n\nexport const customCoordinatesGetterFactory =\n (columnGap: number, rowGap: number): KeyboardCoordinateGetter =>\n (event, { currentCoordinates, context: { activeNode } }) => {\n event.preventDefault();\n if (directions.includes(event.code)) {\n const width = activeNode?.offsetWidth ?? 0;\n const height = activeNode?.offsetHeight ?? 0;\n\n switch (event.code) {\n case KeyboardCode.Right:\n return {\n ...currentCoordinates,\n x: currentCoordinates.x + width + columnGap,\n };\n case KeyboardCode.Left:\n return {\n ...currentCoordinates,\n x: currentCoordinates.x - width - columnGap,\n };\n case KeyboardCode.Down:\n return {\n ...currentCoordinates,\n y: currentCoordinates.y + height + rowGap,\n };\n case KeyboardCode.Up:\n return {\n ...currentCoordinates,\n y: currentCoordinates.y - height - rowGap,\n };\n }\n }\n return undefined;\n };\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Security } from '../settings/types';\n\nexport const isDownloadable = (security: Security, downloadable: boolean, globalAssetDownloadEnabled: boolean) => {\n return security === Security.Custom ? downloadable : globalAssetDownloadEnabled;\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ColorPalette } from '@frontify/app-bridge';\nimport { Palette } from '@frontify/fondue';\n\nexport const mapAppBridgeColorPalettesToFonduePalettes = (colorPalettes: ColorPalette[]): Palette[] => {\n return colorPalettes.map(mapAppBridgeColorPaletteToFonduePalette);\n};\n\nexport const mapAppBridgeColorPaletteToFonduePalette = (colorPalette: ColorPalette): Palette => {\n return {\n id: colorPalette.id,\n title: colorPalette.name,\n colors: colorPalette.colors.map((color) => ({\n alpha: color.alpha ? color.alpha / 255 : 1,\n red: color.red ?? 0,\n green: color.green ?? 0,\n blue: color.blue ?? 0,\n name: color.name ?? '',\n })),\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ELEMENT_LINK, PlateEditor, getAboveNode } from '@udecode/plate';\nimport { TLinkElement } from '../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 getUrlFromEditor = (editor: PlateEditor) => {\n return getLinkNode(editor, getUrlFromLinkOrLegacyLink);\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const relativeUrlRegex = /^\\/(document|r)\\/\\S+$/i;\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { relativeUrlRegex } from '../components/RichTextEditor/plugins/LinkPlugin/utils';\n\nexport const addHttps = (url: string) => {\n if (relativeUrlRegex.test(url)) {\n return url;\n }\n try {\n new URL(url);\n return url;\n } catch {\n return `https://${url}`;\n }\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { addHttps } from '../../../../../helpers';\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 (error) {\n return false;\n }\n};\n\nexport const isValidUrlOrEmpty = (url: string) => {\n return isValidUrl(addHttps(url)) || url === '';\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, getAboveNode } from '@udecode/plate';\nimport { ELEMENT_BUTTON, TButtonElement } from '..';\n\nconst getLinkNode = (editor: PlateEditor, cb: (link: TButtonElement) => string): string => {\n const linkNode = getAboveNode<TButtonElement>(editor, { match: { type: ELEMENT_BUTTON } });\n\n if (!Array.isArray(linkNode)) {\n return '';\n }\n\n return cb(linkNode[0]);\n};\n\nexport const getUrlFromEditor = (editor: PlateEditor) => {\n return getLinkNode(editor, (link) => link.url ?? '');\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, TText, Value, getPluginType } from '@udecode/plate';\nimport { RichTextButtonStyle, TButtonElement } from '..';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\nexport interface CreateButtonNodeOptions {\n url: string;\n text?: string;\n buttonStyle?: RichTextButtonStyle;\n target?: string;\n children?: TText[];\n}\n\nexport const createButtonNode = <V extends Value>(\n editor: PlateEditor<V>,\n { url, text = '', buttonStyle = 'primary', target, children }: CreateButtonNodeOptions,\n): TButtonElement => {\n const type = getPluginType(editor, ELEMENT_BUTTON);\n\n return {\n type,\n url,\n target,\n buttonStyle,\n children: children ?? [{ text }],\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createStore } from '@udecode/plate';\nimport { RichTextButtonStyle } from '../../types';\n\nexport type FloatingButtonMode = '' | 'insert' | 'edit';\n\nexport const floatingButtonStore: any = createStore('floatingButton')({\n openEditorId: null as null | string,\n mouseDown: false,\n updated: false,\n url: '',\n text: '',\n buttonStyle: 'primary' as RichTextButtonStyle,\n newTab: false,\n mode: '' as FloatingButtonMode,\n isEditing: false,\n})\n .extendActions((set) => ({\n reset: () => {\n set.url('');\n set.text('');\n set.buttonStyle('primary');\n set.newTab(false);\n set.mode('');\n set.isEditing(false);\n },\n }))\n .extendActions((set) => ({\n show: (mode: FloatingButtonMode, editorId: string) => {\n set.mode(mode);\n set.isEditing(false);\n set.openEditorId(editorId);\n },\n hide: () => {\n set.reset();\n set.openEditorId(null);\n },\n }))\n .extendSelectors((state) => ({\n isOpen: (editorId: string) => state.openEditorId === editorId,\n }));\n\nexport const floatingButtonActions = floatingButtonStore.set;\nexport const floatingButtonSelectors = floatingButtonStore.get;\nexport const useFloatingButtonSelectors = () => floatingButtonStore.use;\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, Value, findNode, getEditorString, getPluginType } from '@udecode/plate';\nimport { ELEMENT_BUTTON, TButtonElement } from '..';\nimport { floatingButtonActions } from '../components/FloatingButton/floatingButtonStore';\n\nexport const triggerFloatingButtonEdit = <V extends Value>(editor: PlateEditor<V>) => {\n const entry = findNode<TButtonElement>(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n if (!entry) {\n return;\n }\n\n const [link, path] = entry;\n\n let text = getEditorString(editor, path);\n\n floatingButtonActions.url(link.url);\n\n floatingButtonActions.newTab(link.target === undefined);\n\n if (text === link.url) {\n text = '';\n }\n\n floatingButtonActions.text(text);\n\n floatingButtonActions.isEditing(true);\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n HTMLPropsAs,\n getAboveNode,\n getDefaultBoundingClientRect,\n getEndPoint,\n getPluginOptions,\n getPluginType,\n getRangeBoundingClientRect,\n getStartPoint,\n someNode,\n useComposedRef,\n useEditorRef,\n useHotkeys,\n usePlateSelectors,\n} from '@udecode/plate';\nimport { useCallback, useEffect } from 'react';\nimport { ButtonPlugin, ELEMENT_BUTTON } from '../../createButtonPlugin';\nimport { getUrlFromEditor } from '../../utils';\nimport { triggerFloatingButtonEdit } from '../../utils/triggerFloatingButtonEdit';\nimport {\n FloatingButtonProps,\n floatingButtonActions,\n floatingButtonSelectors,\n useFloatingButtonEnter,\n useFloatingButtonEscape,\n useFloatingButtonSelectors,\n useVirtualFloatingButton,\n} from '.';\n\nexport const useFloatingButtonEdit = ({ floatingOptions, ...props }: FloatingButtonProps): HTMLPropsAs<'div'> => {\n const editor = useEditorRef();\n const keyEditor = usePlateSelectors(editor.id).keyEditor();\n const mode = useFloatingButtonSelectors().mode();\n const open = useFloatingButtonSelectors().isOpen(editor.id);\n\n const { triggerFloatingButtonHotkeys } = getPluginOptions<ButtonPlugin>(editor, ELEMENT_BUTTON);\n\n const getBoundingClientRect = useCallback(() => {\n const entry = getAboveNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n if (entry) {\n const [, path] = entry;\n return getRangeBoundingClientRect(editor, {\n anchor: getStartPoint(editor, path),\n focus: getEndPoint(editor, path),\n });\n }\n\n return getDefaultBoundingClientRect();\n }, [editor]);\n\n const isOpen = open && mode === 'edit';\n\n const { update, style, floating } = useVirtualFloatingButton({\n open: isOpen,\n getBoundingClientRect,\n ...floatingOptions,\n });\n\n useEffect(() => {\n const url = getUrlFromEditor(editor);\n if (url) {\n floatingButtonActions.url(url);\n }\n\n if (\n editor.selection &&\n someNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n })\n ) {\n floatingButtonActions.show('edit', editor.id);\n update();\n return;\n }\n\n if (floatingButtonSelectors.mode() === 'edit') {\n floatingButtonActions.hide();\n }\n }, [editor, keyEditor, update]);\n\n useHotkeys(\n triggerFloatingButtonHotkeys,\n (e) => {\n e.preventDefault();\n\n if (floatingButtonSelectors.mode() === 'edit') {\n triggerFloatingButtonEdit(editor);\n }\n },\n {\n enableOnContentEditable: true,\n },\n [],\n );\n\n useFloatingButtonEnter();\n\n useFloatingButtonEscape();\n\n return {\n style: {\n ...style,\n zIndex: 1000,\n },\n ...props,\n ref: useComposedRef<HTMLElement | null>(props.ref, floating),\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, Value, getEditorString, getPluginType, isRangeAcrossBlocks, someNode } from '@udecode/plate';\nimport { floatingButtonActions, floatingButtonSelectors } from '../components/FloatingButton/floatingButtonStore';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\n/**\n * Trigger floating button.\n *\n * Do not trigger when:\n * - selection is across blocks\n * - selection has more than one leaf node\n * - lowest selection is not text\n * - selection has a button node\n */\nexport const triggerFloatingButtonInsert = <V extends Value>(\n editor: PlateEditor<V>,\n {\n focused,\n }: {\n focused?: boolean;\n } = {},\n) => {\n if (floatingButtonSelectors.mode()) {\n return;\n }\n\n if (!focused) {\n return;\n }\n\n if (isRangeAcrossBlocks(editor, { at: editor.selection })) {\n return;\n }\n\n const hasButton = someNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n if (hasButton) {\n return;\n }\n\n floatingButtonActions.text(getEditorString(editor, editor.selection));\n floatingButtonActions.show('insert', editor.id);\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n HTMLPropsAs,\n getPluginOptions,\n getSelectionBoundingClientRect,\n useComposedRef,\n useEditorRef,\n useHotkeys,\n} from '@udecode/plate';\nimport { useEffect } from 'react';\nimport { useFocused } from 'slate-react';\nimport { ButtonPlugin, ELEMENT_BUTTON } from '../../createButtonPlugin';\nimport { triggerFloatingButtonInsert } from '../../utils/triggerFloatingButtonInsert';\nimport {\n FloatingButtonProps,\n floatingButtonActions,\n useFloatingButtonEscape,\n useFloatingButtonSelectors,\n useVirtualFloatingButton,\n} from '.';\n\nexport const useFloatingButtonInsert = ({ floatingOptions, ...props }: FloatingButtonProps): HTMLPropsAs<'div'> => {\n const editor = useEditorRef();\n const focused = useFocused();\n const mode = useFloatingButtonSelectors().mode();\n const open = useFloatingButtonSelectors().isOpen(editor.id);\n\n const { triggerFloatingButtonHotkeys } = getPluginOptions<ButtonPlugin>(editor, ELEMENT_BUTTON);\n\n useHotkeys(\n triggerFloatingButtonHotkeys,\n (e) => {\n e.preventDefault();\n\n triggerFloatingButtonInsert(editor, {\n focused,\n });\n },\n {\n enableOnContentEditable: true,\n },\n [focused],\n );\n\n const { update, style, floating } = useVirtualFloatingButton({\n open: open && mode === 'insert',\n getBoundingClientRect: getSelectionBoundingClientRect,\n whileElementsMounted: undefined,\n ...floatingOptions,\n });\n\n // wait for update before focusing input\n useEffect(() => {\n if (open) {\n update();\n }\n floatingButtonActions.updated(open);\n }, [open, update]);\n\n useFloatingButtonEscape();\n\n return {\n style: {\n ...style,\n zIndex: 1000,\n },\n ...props,\n ref: useComposedRef<HTMLElement | null>(props.ref, floating),\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useCallback } from 'react';\nimport { AsProps, HTMLPropsAs, createComponentAs, createElementAs, useEditorRef } from '@udecode/plate';\nimport { triggerFloatingButtonEdit } from '../../utils/triggerFloatingButtonEdit';\n\nexport const useFloatingButtonEditButton = (props: HTMLPropsAs<'button'>): HTMLPropsAs<'button'> => {\n const editor = useEditorRef();\n\n return {\n onClick: useCallback(() => {\n triggerFloatingButtonEdit(editor);\n }, [editor]),\n ...props,\n };\n};\n\nexport const FloatingButtonEditButton = createComponentAs<AsProps<'button'>>((props) => {\n const htmlProps = useFloatingButtonEditButton(props);\n\n return createElementAs('button', htmlProps);\n});\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { InsertNodesOptions, PlateEditor, TText, Value, insertNodes } from '@udecode/plate';\nimport { TButtonElement } from '../types';\nimport { CreateButtonNodeOptions, createButtonNode } from '../utils/index';\n\nexport const insertButton = <V extends Value>(\n editor: PlateEditor<V>,\n createButtonNodeOptions: CreateButtonNodeOptions,\n options?: InsertNodesOptions<V>,\n) => {\n insertNodes<TButtonElement | TText>(\n editor,\n [createButtonNode(editor, createButtonNodeOptions)],\n options as InsertNodesOptions,\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, Value, focusEditor, getPluginOptions } from '@udecode/plate';\nimport { floatingButtonActions, floatingButtonSelectors } from '../components/FloatingButton/floatingButtonStore';\nimport { ButtonPlugin, ELEMENT_BUTTON } from '../createButtonPlugin';\nimport { upsertButton } from '.';\n\nexport const submitFloatingButton = <V extends Value>(editor: PlateEditor<V>) => {\n if (!editor.selection) {\n return;\n }\n\n const { isUrl, forceSubmit } = getPluginOptions<ButtonPlugin, V>(editor, ELEMENT_BUTTON);\n const url = floatingButtonSelectors.url();\n\n const isValid = isUrl?.(url) || forceSubmit;\n if (!isValid) {\n return;\n }\n\n const text = floatingButtonSelectors.text();\n const buttonStyle = floatingButtonSelectors.buttonStyle();\n const target = floatingButtonSelectors.newTab() ? undefined : '_self';\n\n floatingButtonActions.hide();\n\n upsertButton(editor, {\n url,\n text,\n buttonStyle,\n target,\n isUrl: (_url) => (forceSubmit || !isUrl ? true : isUrl(_url)),\n });\n\n setTimeout(() => {\n focusEditor(editor, editor.selection ?? undefined);\n }, 0);\n\n return true;\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n PlateEditor,\n UnwrapNodesOptions,\n Value,\n getAboveNode,\n getPluginType,\n isElement,\n splitNodes,\n unwrapNodes,\n withoutNormalizing,\n} from '@udecode/plate';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\n/**\n * Unwrap button node.\n */\nexport const unwrapButton = <V extends Value>(\n editor: PlateEditor<V>,\n options?: UnwrapNodesOptions & {\n split?: boolean;\n },\n) => {\n return withoutNormalizing(editor, () => {\n if (options?.split) {\n const buttonAboveAnchor = getAboveNode(editor, {\n at: editor.selection?.anchor,\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n // anchor in button\n if (buttonAboveAnchor) {\n splitNodes(editor, {\n at: editor.selection?.anchor,\n match: (n) => isElement(n) && n.type === getPluginType(editor, ELEMENT_BUTTON),\n });\n unwrapButton(editor, {\n at: editor.selection?.anchor,\n });\n return true;\n }\n const buttonAboveFocus = getAboveNode(editor, {\n at: editor.selection?.focus,\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n // focus in button\n if (buttonAboveFocus) {\n splitNodes(editor, {\n at: editor.selection?.focus,\n match: (n) => isElement(n) && n.type === getPluginType(editor, ELEMENT_BUTTON),\n });\n unwrapButton(editor, {\n at: editor.selection?.focus,\n });\n return true;\n }\n }\n\n unwrapNodes(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n ...options,\n });\n\n return;\n });\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n InsertNodesOptions,\n PlateEditor,\n TNode,\n TNodeEntry,\n UnwrapNodesOptions,\n Value,\n WrapNodesOptions,\n findNode,\n getAboveNode,\n getEditorString,\n getNodeLeaf,\n getNodeProps,\n getPluginOptions,\n getPluginType,\n isDefined,\n isExpanded,\n removeNodes,\n setNodes,\n} from '@udecode/plate';\nimport { Path } from 'slate';\nimport { ButtonPlugin, ELEMENT_BUTTON } from '../createButtonPlugin';\nimport { RichTextButtonStyle, TButtonElement } from '../types';\nimport { CreateButtonNodeOptions } from '../utils/index';\nimport { insertButton, unwrapButton, upsertButtonText, wrapButton } from '.';\n\nexport type UpsertButtonOptions<V extends Value = Value> = CreateButtonNodeOptions & {\n /**\n * If true, insert text when selection is in url.\n */\n insertTextInButton?: boolean;\n insertNodesOptions?: InsertNodesOptions<V>;\n unwrapNodesOptions?: UnwrapNodesOptions<V>;\n wrapNodesOptions?: WrapNodesOptions<V>;\n isUrl?: (url: string) => boolean;\n};\n\n/**\n * If selection in a button or is not url:\n * - insert text with url, exit\n * If selection is expanded or `update` in a button:\n * - remove button node, get button text\n * Then:\n * - insert button node\n */\nexport const upsertButton = <V extends Value>(\n editor: PlateEditor<V>,\n {\n url,\n text,\n buttonStyle,\n target,\n insertTextInButton,\n insertNodesOptions,\n isUrl = getPluginOptions<ButtonPlugin, V>(editor, ELEMENT_BUTTON).isUrl,\n }: UpsertButtonOptions<V>,\n) => {\n const at = editor.selection;\n if (!at) {\n return;\n }\n\n const buttonAbove = getAboveNode<TButtonElement>(editor, {\n at,\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n // anchor and focus in button -> insert text\n if (insertTextInButton && buttonAbove) {\n // we don't want to insert marks in buttons\n editor.insertText(url);\n return true;\n }\n\n if (!isUrl?.(url)) {\n return;\n }\n\n if (isDefined(text) && text.length === 0) {\n text = url;\n }\n\n if (buttonAbove) {\n editButtonUrlAndTarget<V>(url, editor, buttonAbove, target, buttonStyle, text);\n return true;\n }\n\n // selection contains at one edge edge or between the edges\n const buttonEntry = findNode<TButtonElement>(editor, {\n at,\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n const [buttonNode, buttonPath] = buttonEntry ?? [];\n\n const shouldReplaceText = shouldReplaceButtonText<V>(editor, buttonPath, text);\n\n if (isExpanded(at)) {\n anchorAndFocusInButton<V>(buttonAbove, editor, url, buttonStyle, target, text);\n return true;\n }\n\n if (shouldReplaceText) {\n removeNodes(editor, {\n at: buttonPath,\n });\n }\n\n const props = getNodeProps(buttonNode ?? ({} as TNode));\n\n const path = editor.selection?.focus.path;\n if (!path) {\n return;\n }\n\n // button text should have the focused leaf marks\n const leaf = getNodeLeaf(editor, path);\n\n // if text is empty, text is url\n if (!text?.length) {\n text = url;\n }\n\n insertButton(\n editor,\n {\n ...props,\n url,\n target,\n children: [\n {\n ...leaf,\n text,\n },\n ],\n },\n insertNodesOptions,\n );\n return true;\n};\n\nfunction shouldReplaceButtonText<V extends Value>(editor: PlateEditor<V>, buttonPath?: Path, text?: string) {\n return buttonPath && text?.length && text !== getEditorString(editor, buttonPath);\n}\n\nfunction anchorAndFocusInButton<V extends Value>(\n buttonAbove: undefined,\n editor: PlateEditor<V>,\n url: string,\n buttonStyle?: RichTextButtonStyle,\n target?: string,\n text?: string,\n) {\n if (buttonAbove) {\n unwrapButton(editor, {\n at: buttonAbove[1],\n });\n } else {\n unwrapButton(editor, {\n split: true,\n });\n }\n\n wrapButton(editor, {\n url,\n buttonStyle,\n target,\n });\n\n upsertButtonText(editor, { url, target, text });\n}\n\nfunction editButtonUrlAndTarget<V extends Value>(\n url: string,\n editor: PlateEditor<V>,\n buttonAbove: TNodeEntry<TButtonElement>,\n target?: string,\n buttonStyle?: string,\n text?: string,\n) {\n if (\n url !== buttonAbove[0]?.url ||\n target !== buttonAbove[0]?.target ||\n buttonStyle !== buttonAbove[0]?.buttonStyle\n ) {\n setNodes<TButtonElement>(\n editor,\n { url, target, buttonStyle },\n {\n at: buttonAbove[1],\n },\n );\n }\n\n upsertButtonText(editor, { url, text, target });\n}\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n PlateEditor,\n TText,\n Value,\n getAboveNode,\n getEditorString,\n getPluginType,\n replaceNodeChildren,\n} from '@udecode/plate';\nimport { ELEMENT_BUTTON, TButtonElement } from '..';\nimport { UpsertButtonOptions } from './upsertButton';\n\n/**\n * If the text is different than the button above text, replace button children by a new text.\n * The new text has the same marks than the first text replaced.\n */\nexport const upsertButtonText = <V extends Value>(editor: PlateEditor<V>, { text }: UpsertButtonOptions<V>) => {\n const newButton = getAboveNode<TButtonElement>(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n if (newButton) {\n const [newButtonNode, newButtonPath] = newButton;\n\n if (text?.length && text !== getEditorString(editor, newButtonPath)) {\n const firstText = newButtonNode.children[0];\n\n // remove button children\n replaceNodeChildren<TText>(editor, {\n at: newButtonPath,\n nodes: { ...firstText, text },\n insertOptions: {\n select: true,\n },\n });\n }\n }\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, Value, WrapNodesOptions, getPluginType, wrapNodes } from '@udecode/plate';\nimport { ELEMENT_BUTTON, RichTextButtonStyle, TButtonElement } from '..';\n\nexport interface WrapButtonOptions<V extends Value = Value> extends WrapNodesOptions<V> {\n url: string;\n buttonStyle?: RichTextButtonStyle;\n target?: string;\n}\n\n/**\n * Wrap a button node with split.\n */\nexport const wrapButton = <V extends Value>(\n editor: PlateEditor<V>,\n { url, buttonStyle, target, ...options }: WrapButtonOptions<V>,\n) => {\n wrapNodes<TButtonElement, Value>(\n editor,\n {\n type: getPluginType(editor, ELEMENT_BUTTON),\n url,\n buttonStyle,\n target,\n children: [],\n },\n { split: true, ...options } as WrapNodesOptions,\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useCallback } from 'react';\nimport {\n AsProps,\n Button,\n HTMLPropsAs,\n createComponentAs,\n createElementAs,\n focusEditor,\n useEditorRef,\n} from '@udecode/plate';\nimport { unwrapButton } from '../../transforms/index';\n\nexport const useUnlinkButton = (props: HTMLPropsAs<'button'>): HTMLPropsAs<'button'> => {\n const editor = useEditorRef();\n\n return {\n onClick: useCallback(() => {\n unwrapButton(editor);\n focusEditor(editor, editor.selection ?? undefined);\n }, [editor]),\n ...props,\n };\n};\n\nexport const UnlinkButton = createComponentAs<AsProps<'button'>>((props) => {\n const htmlProps = useUnlinkButton(props);\n\n return createElementAs(Button, htmlProps);\n});\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { HTMLPropsAs, UseVirtualFloatingOptions, createComponentAs, createElementAs } from '@udecode/plate';\nimport { useFloatingButtonEdit } from './useFloatingButtonEdit';\nimport { useFloatingButtonInsert } from './useFloatingButtonInsert';\nimport { FloatingButtonEditButton } from './FloatingButtonEditButton';\nimport { UnlinkButton } from './UnlinkButton';\n\nexport type FloatingButtonProps = HTMLPropsAs<'div'> & {\n floatingOptions?: UseVirtualFloatingOptions;\n};\n\nexport const FloatingButtonEditRoot = createComponentAs<FloatingButtonProps>((props) => {\n const htmlProps = useFloatingButtonEdit(props);\n\n if (htmlProps.style?.display === 'none') {\n return null;\n }\n\n return createElementAs('div', htmlProps);\n});\n\nexport const FloatingButtonInsertRoot = createComponentAs<FloatingButtonProps>((props) => {\n const htmlProps = useFloatingButtonInsert(props);\n\n if (htmlProps.style?.display === 'none') {\n return null;\n }\n return createElementAs('div', htmlProps);\n});\n\nexport const FloatingButton = {\n EditRoot: FloatingButtonEditRoot,\n InsertRoot: FloatingButtonInsertRoot,\n EditButton: FloatingButtonEditButton,\n UnlinkButton,\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ChangeEventHandler, useCallback, useEffect, useRef } from 'react';\nimport { HTMLPropsAs, mergeProps, useComposedRef } from '@udecode/plate';\nimport { floatingButtonActions, floatingButtonSelectors, useFloatingButtonSelectors } from './floatingButtonStore';\n\nexport const useFloatingButtonUrlInput = (props: HTMLPropsAs<'input'>): HTMLPropsAs<'input'> => {\n const updated = useFloatingButtonSelectors().updated();\n const ref = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (ref.current && updated) {\n setTimeout(() => {\n ref.current?.focus();\n }, 0);\n }\n }, [updated]);\n\n const onChange: ChangeEventHandler<HTMLInputElement> = useCallback((e) => {\n floatingButtonActions.url(e.target.value);\n }, []);\n\n return mergeProps(\n {\n onChange,\n defaultValue: floatingButtonSelectors.url(),\n },\n { ...props, ref: useComposedRef<HTMLInputElement>(props.ref, ref) },\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useEditorRef, useHotkeys } from '@udecode/plate';\nimport { submitFloatingButton } from '../../transforms/submitFloatingButton';\n\nexport const useFloatingButtonEnter = () => {\n const editor = useEditorRef();\n\n useHotkeys(\n '*',\n (e) => {\n if (e.key === 'Enter' && submitFloatingButton(editor)) {\n e.preventDefault();\n }\n },\n {\n enableOnFormTags: ['INPUT'],\n },\n [],\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { focusEditor, useEditorRef, useHotkeys } from '@udecode/plate';\nimport { floatingButtonActions, floatingButtonSelectors } from './floatingButtonStore';\n\nexport const useFloatingButtonEscape = () => {\n const editor = useEditorRef();\n\n useHotkeys(\n 'escape',\n () => {\n if (floatingButtonSelectors.mode() !== 'edit') {\n return;\n }\n\n if (floatingButtonSelectors.isEditing()) {\n floatingButtonActions.show('edit', editor.id);\n focusEditor(editor, editor.selection ?? undefined);\n return;\n }\n\n floatingButtonActions.hide();\n },\n {\n enableOnFormTags: ['INPUT'],\n enableOnContentEditable: true,\n },\n [],\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { UseVirtualFloatingOptions, flip, offset, useVirtualFloating } from '@udecode/plate';\n\nconst OFFSET_Y = 12;\nconst OFFSET_X = -22;\nconst PADDING = 96;\n\nexport const useVirtualFloatingButton = (floatingOptions?: UseVirtualFloatingOptions) =>\n useVirtualFloating({\n placement: 'bottom-start',\n middleware: [\n offset({\n mainAxis: OFFSET_Y,\n alignmentAxis: OFFSET_X,\n }),\n flip({\n padding: PADDING,\n }),\n ],\n ...floatingOptions,\n });\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, Value } from '@udecode/plate';\nimport { floatingButtonSelectors } from '../components';\nimport { triggerFloatingButtonEdit, triggerFloatingButtonInsert } from '.';\n\nexport const triggerFloatingButton = <V extends Value>(\n editor: PlateEditor<V>,\n {\n focused,\n }: {\n focused?: boolean;\n } = {},\n) => {\n if (floatingButtonSelectors.mode() === 'edit') {\n triggerFloatingButtonEdit(editor);\n return;\n }\n\n triggerFloatingButtonInsert(editor, {\n focused,\n });\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\n\nexport const BlockButtonStyles: Record<string, CSSProperties & { hover?: CSSProperties }> = {\n buttonPrimary: {\n fontFamily: 'var(--f-theme-settings-button-primary-font-family)',\n fontSize: 'var(--f-theme-settings-button-primary-font-size)',\n fontWeight: 'var(--f-theme-settings-button-primary-font-weight)',\n lineHeight: 'var(--f-theme-settings-button-primary-line-height)',\n paddingTop: 'var(--f-theme-settings-button-primary-padding-top)',\n paddingRight: 'var(--f-theme-settings-button-primary-padding-right)',\n paddingBottom: 'var(--f-theme-settings-button-primary-padding-bottom)',\n paddingLeft: 'var(--f-theme-settings-button-primary-padding-left)',\n fontStyle: 'var(--f-theme-settings-button-primary-font-style)',\n textTransform: 'var(--f-theme-settings-button-primary-text-transform)' as CSSProperties['textTransform'],\n backgroundColor: 'var(--f-theme-settings-button-primary-background-color)',\n borderColor: 'var(--f-theme-settings-button-primary-border-color)',\n borderRadius: 'var(--f-theme-settings-button-primary-border-radius)',\n borderWidth: 'var(--f-theme-settings-button-primary-border-width)',\n color: 'var(--f-theme-settings-button-primary-color)',\n display: 'inline-block',\n hover: {\n backgroundColor: 'var(--f-theme-settings-button-primary-background-color-hover)',\n borderColor: 'var(--f-theme-settings-button-primary-border-color-hover)',\n color: 'var(--f-theme-settings-button-primary-color-hover)',\n },\n },\n\n buttonSecondary: {\n fontFamily: 'var(--f-theme-settings-button-secondary-font-family)',\n fontSize: 'var(--f-theme-settings-button-secondary-font-size)',\n fontWeight: 'var(--f-theme-settings-button-secondary-font-weight)',\n lineHeight: 'var(--f-theme-settings-button-secondary-line-height)',\n paddingTop: 'var(--f-theme-settings-button-secondary-padding-top)',\n paddingRight: 'var(--f-theme-settings-button-secondary-padding-right)',\n paddingBottom: 'var(--f-theme-settings-button-secondary-padding-bottom)',\n paddingLeft: 'var(--f-theme-settings-button-secondary-padding-left)',\n fontStyle: 'var(--f-theme-settings-button-secondary-font-style)',\n textTransform: 'var(--f-theme-settings-button-secondary-text-transform)' as CSSProperties['textTransform'],\n backgroundColor: 'var(--f-theme-settings-button-secondary-background-color)',\n borderColor: 'var(--f-theme-settings-button-secondary-border-color)',\n borderRadius: 'var(--f-theme-settings-button-secondary-border-radius)',\n borderWidth: 'var(--f-theme-settings-button-secondary-border-width)',\n color: 'var(--f-theme-settings-button-secondary-color)',\n display: 'inline-block',\n hover: {\n backgroundColor: 'var(--f-theme-settings-button-secondary-background-color-hover)',\n borderColor: 'var(--f-theme-settings-button-secondary-border-color-hover)',\n color: 'var(--f-theme-settings-button-secondary-color-hover)',\n },\n },\n\n buttonTertiary: {\n fontFamily: 'var(--f-theme-settings-button-tertiary-font-family)',\n fontSize: 'var(--f-theme-settings-button-tertiary-font-size)',\n fontWeight: 'var(--f-theme-settings-button-tertiary-font-weight)',\n lineHeight: 'var(--f-theme-settings-button-tertiary-line-height)',\n paddingTop: 'var(--f-theme-settings-button-tertiary-padding-top)',\n paddingRight: 'var(--f-theme-settings-button-tertiary-padding-right)',\n paddingBottom: 'var(--f-theme-settings-button-tertiary-padding-bottom)',\n paddingLeft: 'var(--f-theme-settings-button-tertiary-padding-left)',\n fontStyle: 'var(--f-theme-settings-button-tertiary-font-style)',\n textTransform: 'var(--f-theme-settings-button-tertiary-text-transform)' as CSSProperties['textTransform'],\n backgroundColor: 'var(--f-theme-settings-button-tertiary-background-color)',\n borderColor: 'var(--f-theme-settings-button-tertiary-border-color)',\n borderRadius: 'var(--f-theme-settings-button-tertiary-border-radius)',\n borderWidth: 'var(--f-theme-settings-button-tertiary-border-width)',\n color: 'var(--f-theme-settings-button-tertiary-color)',\n display: 'inline-block',\n hover: {\n backgroundColor: 'var(--f-theme-settings-button-tertiary-background-color-hover)',\n borderColor: 'var(--f-theme-settings-button-tertiary-border-color-hover)',\n color: 'var(--f-theme-settings-button-tertiary-color-hover)',\n },\n },\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { HTMLPropsAs, PlateRenderElementProps, Value, useElementProps } from '@udecode/plate';\nimport { CSSProperties, HTMLAttributeAnchorTarget, ReactElement, ReactNode, useState } from 'react';\nimport { RichTextButtonStyle, TButtonElement } from '../types';\nimport { BlockButtonStyles } from '../utils';\n\nexport type ButtonRootProps = PlateRenderElementProps<Value, TButtonElement> & HTMLPropsAs<'a'>;\n\nconst useButton = (props: ButtonRootProps): HTMLPropsAs<'a'> & { buttonStyle: RichTextButtonStyle } => {\n const _props = useElementProps<TButtonElement, 'a'>({\n ...props,\n elementToAttributes: (element) => ({\n url: element.href,\n buttonStyle: element.buttonStyle || 'primary',\n target: element.target || '_blank',\n }),\n });\n\n return {\n ...(_props as HTMLPropsAs<'a'> & { buttonStyle: RichTextButtonStyle }),\n // quick fix: hovering <a> with href loses the editor focus\n onMouseOver: (e) => {\n e.stopPropagation();\n },\n };\n};\n\nexport const ButtonMarkupElementNode = (props: ButtonRootProps) => {\n const { href, target, buttonStyle } = useButton(props);\n const { attributes, children } = props;\n\n return (\n <HoverableButtonLink\n attributes={attributes}\n href={href}\n target={target}\n styles={BlockButtonStyles[`button${buttonStyle.charAt(0).toUpperCase() + buttonStyle.slice(1)}`]}\n >\n {children}\n </HoverableButtonLink>\n );\n};\n\ntype Props = {\n attributes: ButtonRootProps['attributes'];\n children: ReactNode;\n styles?: CSSProperties & { hover?: CSSProperties };\n href?: string;\n target?: HTMLAttributeAnchorTarget;\n};\n\nconst HoverableButtonLink = ({\n attributes,\n styles = { hover: {} },\n children,\n href = '#',\n target,\n}: Props): ReactElement => {\n const [hovered, setHovered] = useState(false);\n\n return (\n <a\n {...attributes}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n href={href}\n target={target}\n style={hovered ? { ...styles, ...styles.hover } : styles}\n >\n {children}\n </a>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { MarkupElement } from '@frontify/fondue';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\nimport { ButtonMarkupElementNode } from './ButtonMarkupElementNode';\n\nexport class ButtonMarkupElement extends MarkupElement {\n constructor(id = ELEMENT_BUTTON, node = ButtonMarkupElementNode) {\n super(id, node);\n }\n}\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { getButtonClassNames, getHotkeyByPlatform, getTooltip } from '@frontify/fondue';\nimport {\n BlockToolbarButtonProps,\n ToolbarButton,\n focusEditor,\n isRangeInSameBlock,\n someNode,\n useEditorRef,\n} from '@udecode/plate';\n\nimport { triggerFloatingButton } from '../utils';\n\nexport interface LinkToolbarButtonProps extends BlockToolbarButtonProps {\n /**\n * Default onMouseDown is getting the link url by calling this promise before inserting the image.\n */\n getLinkUrl?: (prevUrl: string | null) => Promise<string | null>;\n}\n\nexport const ButtonToolbarButton = ({ type, ...props }: LinkToolbarButtonProps) => {\n const editor = useEditorRef();\n const isEnabled = !!isRangeInSameBlock(editor, {\n at: editor.selection,\n });\n\n const isLink = !!editor?.selection && someNode(editor, { match: { type } });\n\n return (\n <ToolbarButton\n tooltip={getTooltip(\n isEnabled\n ? `Button\\n${getHotkeyByPlatform('Ctrl+Shift+K')}`\n : 'Buttons can only be set for a single text block.',\n )}\n classNames={getButtonClassNames(isEnabled)}\n active={isLink}\n onMouseDown={async (event) => {\n if (!editor) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n focusEditor(editor, editor.selection ?? editor.prevSelection ?? undefined);\n\n setTimeout(() => {\n triggerFloatingButton(editor, { focused: true });\n }, 0);\n }}\n {...props}\n />\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconButton16, PluginButtonProps, buttonStyles } from '@frontify/fondue';\nimport { getPluginType } from '@udecode/plate';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\nimport { ButtonToolbarButton } from './ButtonToolbarButton';\n\nexport const ButtonButton = ({ editor, id }: PluginButtonProps) => (\n <div data-plugin-id={id}>\n <ButtonToolbarButton\n type={getPluginType(editor, ELEMENT_BUTTON)}\n icon={\n <span className=\"tw-p-2 tw-h-8 tw-justify-center tw-items-center tw-flex\">\n <IconButton16 />\n </span>\n }\n styles={buttonStyles}\n />\n </div>\n);\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconPen16, IconTrashBin16 } from '@frontify/fondue';\nimport { FloatingButton, useFloatingButtonUrlInput } from '..';\nimport { BlockStyles } from '../../../..';\n\nexport const EditModal = () => {\n const urlHtmlProps = useFloatingButtonUrlInput({});\n\n return (\n <div data-test-id=\"floating-button-edit\" className=\"tw-bg-white tw-rounded tw-shadow tw-p-4 tw-min-w-[400px]\">\n <span data-test-id=\"preview-button-flyout\" className=\"tw-flex tw-justify-between\">\n <span className=\"tw-pointer-events-none\" style={BlockStyles.p}>\n {urlHtmlProps.defaultValue}\n </span>\n <span className=\"tw-flex tw-gap-2\">\n <span\n role=\"button\"\n tabIndex={0}\n data-test-id=\"edit-button-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n >\n <FloatingButton.EditButton>\n <IconPen16 />\n </FloatingButton.EditButton>\n </span>\n\n <span\n role=\"button\"\n tabIndex={0}\n data-test-id=\"remove-button-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n >\n <FloatingButton.UnlinkButton>\n <IconTrashBin16 />\n </FloatingButton.UnlinkButton>\n </span>\n </span>\n </span>\n </div>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconDocumentText16, merge } from '@frontify/fondue';\n\ntype SectionLinkProps = {\n section: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n};\n\nexport const SectionLink = ({ section, selectedUrl, onSelectUrl }: SectionLinkProps) => {\n const isActive = section.permanentLink === selectedUrl;\n\n return (\n <button\n data-test-id=\"internal-link-selector-section-link\"\n className={merge([\n 'tw-py-2 tw-px-2.5 tw-pl-14 tw-leading-5 tw-cursor-pointer tw-w-full',\n isActive\n ? 'tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover'\n : 'hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover',\n ])}\n onClick={() => onSelectUrl(section.permanentLink)}\n onFocus={() => onSelectUrl(section.permanentLink)}\n >\n <div className=\"tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-h-6\">\n <IconDocumentText16 />\n <span className=\"tw-text-s\">{section.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-xs tw-text-right\">Section</span>\n </div>\n </button>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock, useDocumentSection } from '@frontify/app-bridge';\nimport { merge } from '@frontify/fondue';\nimport { useEffect, useState } from 'react';\nimport { InitiallyExpandedItems } from '../../LinkPlugin/FloatingLink/InsertLinkModal/types';\nimport { SectionLink } from './SectionLink';\n\ntype DocumentLinkProps = {\n page: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n appBridge: AppBridgeBlock;\n itemsToExpandInitially: InitiallyExpandedItems;\n};\n\nexport const PageLink = ({ page, selectedUrl, onSelectUrl, itemsToExpandInitially, appBridge }: DocumentLinkProps) => {\n const [isExpanded, setIsExpanded] = useState(page.id === itemsToExpandInitially.documentId);\n const isActive = page.permanentLink === selectedUrl;\n const { documentSections } = useDocumentSection(appBridge, page.id);\n const sectionsArray = [...documentSections.values()];\n const hasSections = sectionsArray.length > 0;\n\n useEffect(() => {\n if (page.id === itemsToExpandInitially.pageId) {\n setIsExpanded(true);\n }\n }, [itemsToExpandInitially, page.id]);\n\n return (\n <>\n <div\n tabIndex={0}\n data-test-id=\"internal-link-selector-page-link\"\n className={merge([\n 'tw-py-2 tw-px-2.5 tw-leading-5 tw-cursor-pointer',\n hasSections ? 'tw-pl-7' : 'tw-pl-12',\n isActive\n ? 'tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover'\n : 'hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover',\n ])}\n onClick={() => onSelectUrl(page.permanentLink)}\n onFocus={() => onSelectUrl(page.permanentLink)}\n >\n <div key={page.id} className=\"tw-flex tw-flex-1 tw-space-x-1 tw-items-center tw-h-6\">\n {hasSections && (\n <button\n data-test-id=\"tree-item-toggle\"\n className=\"tw-flex tw-items-center tw-justify-center tw-p-1.5 tw-cursor-pointer\"\n onClick={() => setIsExpanded(!isExpanded)}\n onFocus={() => setIsExpanded(!isExpanded)}\n >\n <div\n className={merge([\n '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 isExpanded ? 'tw-rotate-90' : '',\n ])}\n ></div>\n </button>\n )}\n <span className=\"tw-text-s\">{page.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-xs tw-text-right\">Page</span>\n </div>\n </div>\n {isExpanded &&\n sectionsArray.length > 0 &&\n sectionsArray.map((section) => {\n return (\n <SectionLink\n key={section.id}\n section={section}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n />\n );\n })}\n </>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock, DocumentPage } from '@frontify/app-bridge';\nimport { LoadingCircle } from '@frontify/fondue';\nimport { ReactElement, useEffect, useState } from 'react';\nimport { InitiallyExpandedItems } from '../../LinkPlugin/FloatingLink/InsertLinkModal/types';\nimport { PageLink } from './PageLink';\n\ntype PageLinksProps = {\n appBridge: AppBridgeBlock;\n documentId: number;\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n};\n\nexport const PageLinks = ({\n appBridge,\n documentId,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\n}: PageLinksProps): ReactElement => {\n const [pages, setPages] = useState<DocumentPage[]>([]);\n const [isLoading, setIsLoading] = useState(true);\n const pagesArray = [...pages.values()];\n const hasPages = !isLoading && pagesArray.length > 0;\n\n useEffect(() => {\n appBridge\n .getDocumentPagesByDocumentId(documentId)\n .then((_pages) => {\n setPages(_pages);\n })\n .finally(() => {\n setIsLoading(false);\n });\n }, []);\n\n if (isLoading) {\n return (\n <div className=\"tw-flex tw-justify-center tw-p-4\">\n <LoadingCircle />\n </div>\n );\n }\n\n return hasPages ? (\n <>\n {pagesArray.map((page) => {\n return (\n <PageLink\n key={page.id}\n page={page}\n appBridge={appBridge}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n />\n );\n })}\n </>\n ) : (\n <div className=\"tw-py-2 tw-px-2.5 tw-pl-7 tw-leading-5 tw-text-s tw-text-text-weak\">\n This document does not contain any pages.\n </div>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport { useEffect, useState } from 'react';\nimport { PageLinks } from './PageLinks';\nimport { IconColorFan16, merge } from '@frontify/fondue';\nimport { InitiallyExpandedItems } from '../../LinkPlugin/FloatingLink/InsertLinkModal/types';\n\ntype DocumentLinkProps = {\n document: {\n id: number;\n title: string;\n permanentLink: string;\n };\n appBridge: AppBridgeBlock;\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n};\n\nexport const DocumentLink = ({\n document,\n appBridge,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\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 setIsExpanded(true);\n }\n }, [itemsToExpandInitially, document.id]);\n\n return (\n <>\n <button\n data-test-id=\"internal-link-selector-document-link\"\n className={merge([\n 'tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-py-2 tw-px-2.5 tw-leading-5 tw-cursor-pointer tw-w-full',\n isActive\n ? 'tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover'\n : 'hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover',\n ])}\n onClick={() => onSelectUrl(document.permanentLink)}\n onFocus={() => onSelectUrl(document.permanentLink)}\n >\n <div\n role=\"button\"\n tabIndex={0}\n data-test-id=\"tree-item-toggle\"\n className=\"tw-flex tw-items-center tw-justify-center tw-p-1.5 tw-cursor-pointer\"\n onClick={() => setIsExpanded(!isExpanded)}\n onFocus={() => setIsExpanded(!isExpanded)}\n >\n <div\n className={merge([\n '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 isExpanded ? 'tw-rotate-90' : '',\n ])}\n ></div>\n </div>\n <IconColorFan16 />\n <span className=\"tw-text-s\">{document.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-xs tw-text-right\">Document</span>\n </button>\n {isExpanded && (\n <PageLinks\n appBridge={appBridge}\n documentId={document.id}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n />\n )}\n </>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock, Document } from '@frontify/app-bridge';\nimport { LoadingCircle } from '@frontify/fondue';\nimport { ReactElement, useEffect, useState } from 'react';\nimport { InitiallyExpandedItems } from '../../LinkPlugin/FloatingLink/InsertLinkModal/types';\nimport { DocumentLink } from './DocumentLink';\n\ntype DocumentLinksProps = {\n appBridge: AppBridgeBlock;\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n};\n\nexport const DocumentLinks = ({ appBridge, selectedUrl, onSelectUrl }: DocumentLinksProps): ReactElement => {\n const [isLoading, setIsLoading] = useState(true);\n const [documents, setDocuments] = useState<Document[]>([]);\n const [itemsToExpandInitially, setItemsToExpandInitially] = useState<InitiallyExpandedItems>({\n documentId: undefined,\n pageId: undefined,\n });\n\n const documentArray = [...documents.values()];\n\n useEffect(() => {\n if (selectedUrl && documentArray.length > 0) {\n findLocationOfSelectedUrl().then((items) => {\n setItemsToExpandInitially(items);\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [documentArray.length]);\n\n useEffect(() => {\n appBridge\n .getAllDocuments()\n .then((_documents) => {\n setDocuments(_documents);\n })\n .finally(() => {\n setIsLoading(false);\n });\n }, []);\n\n const findLocationOfSelectedUrl = async () => {\n const itemsToExpand: InitiallyExpandedItems = {\n documentId: undefined,\n pageId: undefined,\n };\n const selectedUrlIsDocument = documentArray.find((document) => document.permanentLink === selectedUrl);\n if (selectedUrlIsDocument) {\n return itemsToExpand;\n }\n for (const document of documentArray) {\n const pages = await appBridge.getDocumentPagesByDocumentId(document.id);\n appBridge.getAllDocuments();\n const pagesArray = [...pages.values()];\n const selectedUrlIsPage = !!pagesArray.find((page) => page.permanentLink === selectedUrl);\n if (selectedUrlIsPage) {\n itemsToExpand.documentId = document.id;\n return itemsToExpand;\n }\n for (const page of pagesArray) {\n const sections = await appBridge.getDocumentSectionsByDocumentPageId(page.id);\n const sectionsArray = [...sections.values()];\n const selectedUrlIsSection = !!sectionsArray.find((section) => section.permanentLink === selectedUrl);\n if (selectedUrlIsSection) {\n itemsToExpand.documentId = document.id;\n itemsToExpand.pageId = page.id;\n return itemsToExpand;\n }\n }\n }\n return itemsToExpand;\n };\n\n return isLoading ? (\n <div className=\"tw-flex tw-justify-center tw-p-4\">\n <LoadingCircle />\n </div>\n ) : (\n <>\n {documentArray.map((document) => {\n return (\n <DocumentLink\n key={document.id}\n document={document}\n appBridge={appBridge}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n />\n );\n })}\n </>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport { Button, ButtonEmphasis, ButtonSize, ButtonStyle, ButtonType, IconLink, Modal } from '@frontify/fondue';\nimport { useOverlayTriggerState } from '@react-stately/overlays';\nimport { KeyboardEvent, ReactElement, useEffect, useState } from 'react';\nimport { DocumentLinks } from './DocumentLinks';\n\ntype LinkSelectorProps = {\n appBridge: AppBridgeBlock;\n url: string;\n onUrlChange: (value: string) => void;\n};\n\nexport const LinkSelector = ({ appBridge, url, onUrlChange }: LinkSelectorProps): ReactElement => {\n const { open: openLinkTree, isOpen: isLinkTreeOpen, close: closeLinkTree } = useOverlayTriggerState({});\n const [selectedUrl, setSelectedUrl] = useState<string>(url);\n\n const onSelectUrl = (url: string) => {\n setSelectedUrl(url);\n };\n\n const onPressEnter = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n saveLink();\n }\n };\n\n useEffect(() => {\n if (url && !selectedUrl) {\n setSelectedUrl(url);\n }\n }, [url, selectedUrl]);\n\n const saveLink = () => {\n onUrlChange(selectedUrl);\n closeLinkTree();\n };\n\n return (\n <div data-test-id=\"internal-link-selector\" onKeyDown={onPressEnter}>\n <Button\n icon={<IconLink />}\n size={ButtonSize.Medium}\n type={ButtonType.Button}\n style={ButtonStyle.Default}\n emphasis={ButtonEmphasis.Default}\n onClick={() => openLinkTree()}\n >\n Internal link\n </Button>\n <Modal zIndex={1001} onClose={() => closeLinkTree()} isOpen={isLinkTreeOpen} isDismissable>\n <Modal.Header title=\"Select internal link\" />\n <Modal.Body>\n <DocumentLinks appBridge={appBridge} selectedUrl={selectedUrl} onSelectUrl={onSelectUrl} />\n </Modal.Body>\n <Modal.Footer\n buttons={[\n {\n children: 'Cancel',\n onClick: () => closeLinkTree(),\n style: ButtonStyle.Default,\n emphasis: ButtonEmphasis.Default,\n },\n {\n children: 'Choose',\n onClick: (event) => {\n event?.preventDefault();\n saveLink();\n },\n style: ButtonStyle.Default,\n emphasis: ButtonEmphasis.Strong,\n disabled: !selectedUrl,\n },\n ]}\n />\n </Modal>\n </div>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n Button,\n ButtonEmphasis,\n ButtonSize,\n ButtonStyle,\n Checkbox,\n FormControl,\n IconCheckMark20,\n TextInput,\n} from '@frontify/fondue';\nimport { FC, ReactNode } from 'react';\nimport { LinkSelector } from '../../../shared/LinkSelector';\nimport { InsertModalStateProps } from './types';\n\ntype Props = {\n state: InsertModalStateProps;\n onTextChange: (value: string) => void;\n onUrlChange: (value: string) => void;\n onToggleTab: (checked: boolean) => void;\n onCancel: () => void;\n onSave: (event: React.MouseEvent<HTMLButtonElement, MouseEvent> | KeyboardEvent | undefined) => void;\n hasValues: boolean;\n isValidUrlOrEmpty: (url: string) => boolean | undefined;\n testId?: string;\n children?: ReactNode;\n appBridge: AppBridgeBlock;\n};\n\nexport const InsertModal: FC<Props> = ({\n state,\n onTextChange,\n onUrlChange,\n onToggleTab,\n onCancel,\n onSave,\n isValidUrlOrEmpty,\n hasValues,\n testId,\n appBridge,\n children,\n}) => (\n <div data-test-id={testId} className=\"tw-bg-white tw-rounded tw-shadow tw-p-7 tw-min-w-[400px] tw-overflow-y-auto\">\n <FormControl\n label={{\n children: 'Text',\n htmlFor: 'linkText',\n required: true,\n }}\n >\n <TextInput id=\"linkText\" value={state.text} placeholder=\"Link Text\" onChange={onTextChange} />\n </FormControl>\n\n {children}\n\n <div className=\"tw-pt-5\">\n <FormControl\n label={{\n children: 'URL',\n htmlFor: 'url',\n required: true,\n }}\n >\n <TextInput\n id=\"url\"\n value={state.url}\n placeholder=\"https://example.com\"\n focusOnMount\n onChange={onUrlChange}\n />\n </FormControl>\n {!isValidUrlOrEmpty(state?.url) && <div className=\"tw-text-red-65 tw-mt-3\">Please enter a valid URL.</div>}\n </div>\n\n <div className=\"tw-mt-3\">\n <LinkSelector url={state.url} appBridge={appBridge} onUrlChange={onUrlChange} />\n </div>\n\n <div className=\"tw-mt-3\">\n <Checkbox value=\"new-tab\" label=\"Open in new tab\" state={state.newTab} onChange={onToggleTab} />\n </div>\n <div className=\"tw-mt-3\">\n <div className={'tw-pt-5 tw-flex tw-gap-x-3 tw-justify-end tw-border-t tw-border-t-black-10'}>\n <Button\n onClick={onCancel}\n size={ButtonSize.Medium}\n style={ButtonStyle.Default}\n emphasis={ButtonEmphasis.Default}\n >\n Cancel\n </Button>\n <Button\n onClick={onSave}\n size={ButtonSize.Medium}\n icon={<IconCheckMark20 />}\n disabled={!hasValues || !isValidUrlOrEmpty(state?.url)}\n >\n Save\n </Button>\n </div>\n </div>\n </div>\n);\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, getAboveNode } from '@udecode/plate';\nimport { ELEMENT_BUTTON, RichTextButtonStyle, TButtonElement } from '..';\n\nexport const getButtonStyle = (editor: PlateEditor): RichTextButtonStyle => {\n const linkNode = getAboveNode<TButtonElement>(editor, { match: { type: ELEMENT_BUTTON } });\n\n if (!Array.isArray(linkNode)) {\n return 'primary';\n }\n\n return (linkNode[0]?.buttonStyle as RichTextButtonStyle) || 'primary';\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Dispatch, Reducer, useEffect, useReducer } from 'react';\nimport { getPluginOptions, useEditorRef, useHotkeys } from '@udecode/plate';\nimport { InsertModalDispatchType, InsertModalStateProps } from './types';\nimport { floatingButtonActions, floatingButtonSelectors } from '../floatingButtonStore';\nimport { ELEMENT_BUTTON } from '../../../createButtonPlugin';\nimport { submitFloatingButton } from '../../../transforms/submitFloatingButton';\nimport { RichTextButtonStyle } from '../../../types';\nimport { getButtonStyle } from '../../../utils/getButtonStyle';\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport { CheckboxState } from '@frontify/fondue';\nimport { addHttps } from '../../../../../../../helpers';\nimport { isValidUrlOrEmpty } from '../../../../LinkPlugin/utils/url';\n\nconst initialState: InsertModalStateProps = {\n url: '',\n text: '',\n buttonStyle: 'primary',\n newTab: CheckboxState.Unchecked,\n};\n\nexport const InsertModalState = (): [InsertModalStateProps, Dispatch<InsertModalDispatchType>] => {\n const [state, dispatch] = useReducer<Reducer<InsertModalStateProps, InsertModalDispatchType>>((state, action) => {\n const { type, payload } = action;\n\n switch (type) {\n case 'NEW_TAB':\n return {\n ...state,\n newTab: CheckboxState.Checked,\n };\n case 'SAME_TAB':\n return {\n ...state,\n newTab: CheckboxState.Unchecked,\n };\n case 'URL':\n case 'TEXT':\n case 'BUTTON_STYLE':\n case 'INIT':\n return {\n ...state,\n ...payload,\n };\n default:\n return state;\n }\n }, initialState);\n\n return [state, dispatch];\n};\n\nexport const useInsertModal = () => {\n const editor = useEditorRef();\n const [state, dispatch] = InsertModalState();\n\n useEffect(() => {\n const buttonStyle = getButtonStyle(editor);\n\n dispatch({\n type: 'INIT',\n payload: {\n text: floatingButtonSelectors.text(),\n buttonStyle,\n newTab: floatingButtonSelectors.newTab() ? CheckboxState.Checked : CheckboxState.Unchecked,\n url: floatingButtonSelectors.url(),\n },\n });\n }, [dispatch, editor]);\n\n const onTextChange = (value: string) => {\n dispatch({\n type: 'TEXT',\n payload: { text: value },\n });\n };\n\n const onButtonStyleChange = (value: RichTextButtonStyle) => {\n dispatch({\n type: 'BUTTON_STYLE',\n payload: { buttonStyle: value },\n });\n };\n\n const onUrlChange = (value: string) => {\n dispatch({\n type: 'URL',\n payload: { url: value },\n });\n };\n\n const onToggleTab = (checked: boolean) => {\n checked ? dispatch({ type: 'NEW_TAB' }) : dispatch({ type: 'SAME_TAB' });\n };\n\n const onCancel = () => {\n floatingButtonActions.hide();\n };\n\n const onSave = (event: React.MouseEvent<HTMLButtonElement, MouseEvent> | KeyboardEvent | undefined) => {\n if (!isValidUrlOrEmpty(state.url) || !hasValues) {\n return;\n }\n\n const urlToSave = addHttps(state.url);\n\n floatingButtonActions.text(state.text);\n floatingButtonActions.url(urlToSave);\n floatingButtonActions.buttonStyle(state.buttonStyle);\n floatingButtonActions.newTab(state.newTab === CheckboxState.Checked);\n\n if (submitFloatingButton(editor)) {\n event?.preventDefault();\n }\n };\n\n const hasValues = state.url !== '' && state.text !== '';\n\n const { appBridge } = getPluginOptions<{ appBridge: AppBridgeBlock }>(editor, ELEMENT_BUTTON);\n\n useHotkeys(\n 'enter',\n onSave,\n {\n enableOnFormTags: ['INPUT'],\n },\n [],\n );\n\n return {\n state,\n onTextChange,\n onButtonStyleChange,\n onUrlChange,\n onToggleTab,\n onCancel,\n onSave,\n hasValues,\n isValidUrlOrEmpty,\n appBridge,\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { FormControl } from '@frontify/fondue';\nimport { CSSProperties, ReactElement, ReactNode, useState } from 'react';\nimport { InsertModal } from '../../../../LinkPlugin/FloatingLink/InsertLinkModal/InsertModal';\nimport { useInsertModal } from './useInsertModal';\nimport { BlockStyles } from '../../../../styles';\n\nexport const InsertButtonModal = () => {\n const modalProps = useInsertModal();\n const { state, onButtonStyleChange } = modalProps;\n\n return (\n <InsertModal {...modalProps} testId=\"floating-button-insert\">\n <div className=\"tw-pt-5\">\n <FormControl\n label={{\n children: 'Button Style',\n htmlFor: 'buttonStyle',\n required: true,\n }}\n >\n <HoverableButton\n id=\"primary\"\n styles={BlockStyles.buttonPrimary}\n isActive={state.buttonStyle === 'primary'}\n onClick={() => onButtonStyleChange('primary')}\n >\n {state.text || 'Primary Button'}\n </HoverableButton>\n\n <HoverableButton\n id=\"secondary\"\n styles={BlockStyles.buttonSecondary}\n isActive={state.buttonStyle === 'secondary'}\n onClick={() => onButtonStyleChange('secondary')}\n >\n {state.text || 'Secondary Button'}\n </HoverableButton>\n\n <HoverableButton\n id=\"tertiary\"\n styles={BlockStyles.buttonTertiary}\n isActive={state.buttonStyle === 'tertiary'}\n onClick={() => onButtonStyleChange('tertiary')}\n >\n {state.text || 'Tertiary Button'}\n </HoverableButton>\n </FormControl>\n </div>\n </InsertModal>\n );\n};\n\ntype Props = {\n id: string;\n styles?: CSSProperties & { hover?: CSSProperties };\n isActive: boolean;\n onClick: () => void;\n children: ReactNode;\n};\n\nconst HoverableButton = ({ id, styles, isActive, onClick, children }: Props): ReactElement => {\n const [hovered, setHovered] = useState(false);\n const getStyles = () => (styles && styles.hover && hovered ? { ...styles, ...styles.hover } : styles);\n\n return (\n <button\n data-test-id={`floating-button-insert-${id}`}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onClick={onClick}\n style={getStyles()}\n className={\n isActive ? 'tw-outline tw-outline-1 tw-outline-violet-60 tw-outline-offset-2 tw-w-fit' : 'tw-w-fit'\n }\n >\n {children}\n </button>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { EditModal } from './EditButtonModal/EditModal';\nimport { FloatingButton } from './FloatingButton';\nimport { useFloatingButtonSelectors } from './floatingButtonStore';\nimport { InsertButtonModal } from './InsertButtonModal/InsertButtonModal';\n\nexport const CustomFloatingButton = () => {\n const isEditing = useFloatingButtonSelectors().isEditing();\n\n const input = <InsertButtonModal />;\n const editContent = isEditing ? input : <EditModal />;\n return (\n <>\n <FloatingButton.InsertRoot>{input}</FloatingButton.InsertRoot>\n <FloatingButton.EditRoot>{editContent}</FloatingButton.EditRoot>\n </>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n AnyObject,\n EText,\n PlateEditor,\n Value,\n WithOverride,\n getAboveNode,\n getNextNodeStartPoint,\n getPluginType,\n getPreviousNodeEndPoint,\n insertNodes,\n isCollapsed,\n isEndPoint,\n isStartPoint,\n mockPlugin,\n select,\n withRemoveEmptyNodes,\n} from '@udecode/plate';\nimport { Path, Point, Range } from 'slate';\nimport { ELEMENT_BUTTON } from './createButtonPlugin';\n\n/**\n * Insert space after a url to wrap a button.\n * Lookup from the block start to the cursor to check if there is an url.\n * If not found, lookup before the cursor for a space character to check the url.\n *\n * On insert data:\n * Paste a string inside a button element will edit its children text but not its url.\n *\n */\n\nexport const withButton: WithOverride = (editor, { type }) => {\n const { apply, normalizeNode } = editor;\n\n editor.apply = (operation) => {\n if (operation.type !== 'set_selection') {\n apply(operation);\n return;\n }\n\n const range = operation.newProperties;\n if (!range?.focus || !range.anchor || !isCollapsed(range as Range)) {\n apply(operation);\n return;\n }\n\n const entry = getAboveNode(editor, {\n at: range as Range,\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n if (entry) {\n const [, path] = entry;\n\n let newPoint: Point | undefined;\n\n if (isStartPoint(editor, range.focus, path)) {\n newPoint = getPreviousNodeEndPoint(editor, path);\n }\n\n if (isEndPoint(editor, range.focus, path)) {\n newPoint = getNextNodeStartPoint(editor, path);\n }\n\n if (newPoint) {\n operation.newProperties = {\n anchor: newPoint,\n focus: newPoint,\n };\n }\n }\n\n apply(operation);\n };\n\n editor.normalizeNode = ([node, path]) => {\n if (node.type === getPluginType(editor, ELEMENT_BUTTON)) {\n const range = editor.selection as Range | null;\n\n if (range && isCollapsed(range) && isEndPoint(editor, range.focus, path)) {\n const nextPoint = getNextNodeStartPoint(editor, path);\n\n // select next text node if any\n if (nextPoint) {\n select(editor, nextPoint);\n } else {\n // insert text node then select\n const nextPath = Path.next(path);\n insertNodes(editor, { text: '' } as EText<Value>, { at: nextPath });\n select(editor, nextPath);\n }\n }\n }\n\n normalizeNode([node, path]);\n };\n\n return withRemoveEmptyNodes<Value, PlateEditor<Value>>(\n editor,\n mockPlugin<AnyObject, Value, PlateEditor<Value>>({\n options: { types: type },\n }),\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport { Plugin, PluginProps } from '@frontify/fondue';\nimport { RangeBeforeOptions, createPluginFactory } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport { isValidUrl } from '../LinkPlugin/utils/url';\nimport { ButtonMarkupElement } from './ButtonMarkupElement';\nimport { ButtonButton } from './components/ButtonButton';\nimport { CustomFloatingButton } from './components/FloatingButton/CustomFloatingButton';\nimport { BlockButtonStyles } from './utils';\nimport { withButton } from './withButton';\n\nexport const ELEMENT_BUTTON = 'button';\nexport const BUTTON_PLUGIN = 'button-plugin';\n\n// eslint-disable-next-line\nexport interface ButtonPlugin {\n forceSubmit?: boolean;\n\n /**\n * Allow custom config for rangeBeforeOptions.\n * @example default\n * {\n * matchString: ' ',\n * skipInvalid: true,\n * afterMatch: true,\n * }\n */\n rangeBeforeOptions?: RangeBeforeOptions;\n\n /**\n * Hotkeys to trigger floating button.\n * @default 'command+k, ctrl+k'\n */\n triggerFloatingButtonHotkeys: string;\n\n /**\n * Callback to validate an url.\n * @default isUrl\n */\n isUrl: (text: string) => boolean;\n\n /**\n * Callback to optionally get the href for a url\n * @returns href: an optional link to be used that is different from the text content (example https://google.com for google.com)\n */\n getUrlHref?: (url: string) => string | undefined;\n\n /**\n * On keyboard shortcut or toolbar mousedown, get the link url by calling this promise. The\n * default behavior is to use the browser's native `prompt`.\n */\n getLinkUrl?: (prevUrl: string | null) => Promise<string | null>;\n}\n\n/**\n * Enables support for hyperlinks.\n */\nexport const createButtonPlugin = (appBridge: AppBridgeBlock) =>\n createPluginFactory({\n key: ELEMENT_BUTTON,\n isElement: true,\n isInline: true,\n props: ({ element }) => ({\n nodeProps: { href: element?.url, target: element?.target },\n }),\n withOverrides: withButton,\n renderAfterEditable: CustomFloatingButton,\n options: {\n isUrl: isValidUrl,\n rangeBeforeOptions: {\n matchString: ' ',\n skipInvalid: true,\n afterMatch: true,\n },\n triggerFloatingButtonHotkeys: 'command+shift+k, ctrl+shift+k',\n appBridge,\n },\n then: (editor, { type }) => ({\n deserializeHtml: {\n rules: [\n {\n validNodeName: 'A',\n validClassName: 'btn',\n },\n ],\n getNode: (el) => ({\n type,\n url: el.getAttribute('href'),\n target: el.getAttribute('target') || '_blank',\n }),\n },\n }),\n })();\n\nexport type ButtonPluginProps = Omit<PluginProps, 'styles'> & {\n styles?: Record<string, CSSProperties & { hover?: CSSProperties }>;\n} & { appBridge: AppBridgeBlock };\n\n// eslint-disable-next-line\nexport class ButtonPlugin extends Plugin {\n public styles: CSSProperties = {};\n private appBridge: AppBridgeBlock;\n constructor({ styles = BlockButtonStyles, ...props }: ButtonPluginProps) {\n super(BUTTON_PLUGIN, {\n button: ButtonButton,\n markupElement: new ButtonMarkupElement(),\n ...props,\n });\n this.styles = styles;\n this.appBridge = props?.appBridge as AppBridgeBlock;\n }\n\n plugins() {\n return [createButtonPlugin(this.appBridge)];\n }\n}\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\nimport { LINK_PLUGIN } from './LinkPlugin/id';\nimport { BlockButtonStyles } from './ButtonPlugin';\n\nexport const enum TextStyles {\n heading1 = 'heading1',\n heading2 = 'heading2',\n heading3 = 'heading3',\n heading4 = 'heading4',\n custom1 = 'custom1',\n custom2 = 'custom2',\n custom3 = 'custom3',\n quote = 'quote',\n imageCaption = 'imageCaption',\n imageTitle = 'imageTitle',\n p = 'p',\n}\nexport const BlockStyles: Record<string, CSSProperties & { hover?: CSSProperties }> = {\n [TextStyles.heading1]: {\n display: 'inline-block',\n fontSize: 'var(--f-theme-settings-heading1-font-size)',\n lineHeight: 'var(--f-theme-settings-heading1-line-height)',\n marginTop: 'var(--f-theme-settings-heading1-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading1-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading1-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading1-font-style)',\n textTransform: 'var(--f-theme-settings-heading1-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading1-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading1-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading1-font-family)',\n color: 'var(--f-theme-settings-heading1-color)',\n },\n [TextStyles.heading2]: {\n fontSize: 'var(--f-theme-settings-heading2-font-size)',\n lineHeight: 'var(--f-theme-settings-heading2-line-height)',\n marginTop: 'var(--f-theme-settings-heading2-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading2-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading2-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading2-font-style)',\n textTransform: 'var(--f-theme-settings-heading2-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading2-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading2-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading2-font-family)',\n color: 'var(--f-theme-settings-heading2-color)',\n },\n [TextStyles.heading3]: {\n fontSize: 'var(--f-theme-settings-heading3-font-size)',\n lineHeight: 'var(--f-theme-settings-heading3-line-height)',\n marginTop: 'var(--f-theme-settings-heading3-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading3-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading3-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading3-font-style)',\n textTransform: 'var(--f-theme-settings-heading3-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading3-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading3-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading3-font-family)',\n color: 'var(--f-theme-settings-heading3-color)',\n },\n [TextStyles.heading4]: {\n fontSize: 'var(--f-theme-settings-heading4-font-size)',\n lineHeight: 'var(--f-theme-settings-heading4-line-height)',\n marginTop: 'var(--f-theme-settings-heading4-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading4-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading4-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading4-font-style)',\n textTransform: 'var(--f-theme-settings-heading4-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading4-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading4-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading4-font-family)',\n color: 'var(--f-theme-settings-heading4-color)',\n },\n [TextStyles.custom1]: {\n fontSize: 'var(--f-theme-settings-custom1-font-size)',\n lineHeight: 'var(--f-theme-settings-custom1-line-height)',\n marginTop: 'var(--f-theme-settings-custom1-margin-top)',\n marginBottom: 'var(--f-theme-settings-custom1-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-custom1-text-decoration)',\n fontStyle: 'var(--f-theme-settings-custom1-font-style)',\n textTransform: 'var(--f-theme-settings-custom1-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-custom1-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-custom1-font-weight)',\n fontFamily: 'var(--f-theme-settings-custom1-font-family)',\n color: 'var(--f-theme-settings-custom1-color)',\n },\n [TextStyles.custom2]: {\n fontSize: 'var(--f-theme-settings-custom2-font-size)',\n lineHeight: 'var(--f-theme-settings-custom2-line-height)',\n marginTop: 'var(--f-theme-settings-custom2-margin-top)',\n marginBottom: 'var(--f-theme-settings-custom2-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-custom2-text-decoration)',\n fontStyle: 'var(--f-theme-settings-custom2-font-style)',\n textTransform: 'var(--f-theme-settings-custom2-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-custom2-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-custom2-font-weight)',\n fontFamily: 'var(--f-theme-settings-custom2-font-family)',\n color: 'var(--f-theme-settings-custom2-color)',\n },\n [TextStyles.custom3]: {\n fontSize: 'var(--f-theme-settings-custom3-font-size)',\n lineHeight: 'var(--f-theme-settings-custom3-line-height)',\n marginTop: 'var(--f-theme-settings-custom3-margin-top)',\n marginBottom: 'var(--f-theme-settings-custom3-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-custom3-text-decoration)',\n fontStyle: 'var(--f-theme-settings-custom3-font-style)',\n textTransform: 'var(--f-theme-settings-custom3-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-custom3-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-custom3-font-weight)',\n fontFamily: 'var(--f-theme-settings-custom3-font-family)',\n color: 'var(--f-theme-settings-custom3-color)',\n },\n [TextStyles.p]: {\n fontSize: 'var(--f-theme-settings-body-font-size)',\n lineHeight: 'var(--f-theme-settings-body-line-height)',\n marginTop: 'var(--f-theme-settings-body-margin-top)',\n marginBottom: 'var(--f-theme-settings-body-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-body-text-decoration)',\n fontStyle: 'var(--f-theme-settings-body-font-style)',\n textTransform: 'var(--f-theme-settings-body-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-body-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-body-font-weight)',\n fontFamily: 'var(--f-theme-settings-body-font-family)',\n color: 'var(--f-theme-settings-body-color)',\n },\n [TextStyles.quote]: {\n fontSize: 'var(--f-theme-settings-quote-font-size)',\n lineHeight: 'var(--f-theme-settings-quote-line-height)',\n marginTop: 'var(--f-theme-settings-quote-margin-top)',\n marginBottom: 'var(--f-theme-settings-quote-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-quote-text-decoration)',\n fontStyle: 'var(--f-theme-settings-quote-font-style)',\n textTransform: 'var(--f-theme-settings-quote-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-quote-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-quote-font-weight)',\n fontFamily: 'var(--f-theme-settings-quote-font-family)',\n color: 'var(--f-theme-settings-quote-color)',\n },\n [TextStyles.imageCaption]: {\n fontSize: 'var(--f-theme-settings-image-caption-font-size)',\n lineHeight: 'var(--f-theme-settings-image-caption-line-height)',\n marginTop: 'var(--f-theme-settings-image-caption-margin-top)',\n marginBottom: 'var(--f-theme-settings-image-caption-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-image-caption-text-decoration)',\n fontStyle: 'var(--f-theme-settings-image-caption-font-style)',\n textTransform: 'var(--f-theme-settings-image-caption-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-image-caption-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-image-caption-font-weight)',\n fontFamily: 'var(--f-theme-settings-image-caption-font-family)',\n color: 'var(--f-theme-settings-image-caption-color)',\n },\n [TextStyles.imageTitle]: {\n fontSize: 'var(--f-theme-settings-image-title-font-size)',\n lineHeight: 'var(--f-theme-settings-image-title-line-height)',\n marginTop: 'var(--f-theme-settings-image-title-margin-top)',\n marginBottom: 'var(--f-theme-settings-image-title-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-image-title-text-decoration)',\n fontStyle: 'var(--f-theme-settings-image-title-font-style)',\n textTransform: 'var(--f-theme-settings-image-title-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-image-title-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-image-title-font-weight)',\n fontFamily: 'var(--f-theme-settings-image-title-font-family)',\n color: 'var(--f-theme-settings-image-title-color)',\n },\n [LINK_PLUGIN]: {\n fontSize: 'var(--f-theme-settings-link-font-size)',\n lineHeight: 'var(--f-theme-settings-link-line-height)',\n marginTop: 'var(--f-theme-settings-link-margin-top)',\n marginBottom: 'var(--f-theme-settings-link-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-link-text-decoration)',\n fontStyle: 'var(--f-theme-settings-link-font-style)',\n textTransform: 'var(--f-theme-settings-link-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-link-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-link-font-weight)',\n fontFamily: 'var(--f-theme-settings-link-font-family)',\n color: 'var(--f-theme-settings-link-color)',\n },\n ...BlockButtonStyles,\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconPen16, IconTrashBin16 } from '@frontify/fondue';\nimport { useFloatingLinkUrlInput } from '@udecode/plate';\nimport { FloatingLink } from '../FloatingLink';\nimport { BlockStyles } from '../../../styles';\n\nexport const EditModal = () => {\n const urlHtmlProps = useFloatingLinkUrlInput({});\n\n return (\n <div data-test-id=\"floating-link-edit\" className=\"tw-bg-white tw-rounded tw-shadow tw-p-4 tw-min-w-[400px]\">\n <span data-test-id={'preview-link-flyout'} className=\"tw-flex tw-justify-between\">\n <span className=\"tw-pointer-events-none\" style={BlockStyles.p}>\n {urlHtmlProps.defaultValue}\n </span>\n <span className=\"tw-flex tw-gap-2\">\n <span\n role=\"button\"\n tabIndex={0}\n data-test-id={'edit-link-button'}\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n >\n <FloatingLink.EditButton>\n <IconPen16 />\n </FloatingLink.EditButton>\n </span>\n\n <span\n role=\"button\"\n tabIndex={0}\n data-test-id={'remove-link-button'}\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n >\n <FloatingLink.UnlinkButton>\n <IconTrashBin16 />\n </FloatingLink.UnlinkButton>\n </span>\n </span>\n </span>\n </div>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ELEMENT_LINK,\n FloatingLinkProps,\n HTMLPropsAs,\n LinkPlugin,\n floatingLinkActions,\n floatingLinkSelectors,\n getAboveNode,\n getDefaultBoundingClientRect,\n getEndPoint,\n getPluginOptions,\n getPluginType,\n getRangeBoundingClientRect,\n getStartPoint,\n someNode,\n triggerFloatingLinkEdit,\n useComposedRef,\n useEditorRef,\n useFloatingLinkEnter,\n useFloatingLinkEscape,\n useFloatingLinkSelectors,\n useHotkeys,\n usePlateSelectors,\n useVirtualFloatingLink,\n} from '@udecode/plate';\nimport { useCallback, useEffect } from 'react';\nimport { getUrlFromEditor } from '../../utils';\n\nexport const useFloatingLinkEdit = ({ floatingOptions, ...props }: FloatingLinkProps): HTMLPropsAs<'div'> => {\n const editor = useEditorRef();\n const keyEditor = usePlateSelectors().keyEditor();\n const mode = useFloatingLinkSelectors().mode();\n const open = useFloatingLinkSelectors().isOpen(editor.id);\n\n const { triggerFloatingLinkHotkeys = 'command+k, ctrl+k' } = getPluginOptions<LinkPlugin>(editor, ELEMENT_LINK);\n\n const getBoundingClientRect = useCallback(() => {\n const entry = getAboveNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_LINK) },\n });\n\n if (entry) {\n const [, path] = entry;\n return getRangeBoundingClientRect(editor, {\n anchor: getStartPoint(editor, path),\n focus: getEndPoint(editor, path),\n });\n }\n\n return getDefaultBoundingClientRect();\n }, [editor]);\n\n const isOpen = open && mode === 'edit';\n\n const { update, style, floating } = useVirtualFloatingLink({\n editorId: editor.id,\n open: isOpen,\n getBoundingClientRect,\n ...floatingOptions,\n });\n\n useEffect(() => {\n const url = getUrlFromEditor(editor);\n if (url) {\n floatingLinkActions.url(url);\n }\n\n if (\n editor.selection &&\n someNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_LINK) },\n })\n ) {\n floatingLinkActions.show('edit', editor.id);\n update();\n return;\n }\n\n if (floatingLinkSelectors.mode() === 'edit') {\n floatingLinkActions.hide();\n }\n }, [editor, keyEditor, update]);\n\n useHotkeys(\n triggerFloatingLinkHotkeys,\n (e) => {\n e.preventDefault();\n\n if (floatingLinkSelectors.mode() === 'edit') {\n triggerFloatingLinkEdit(editor);\n }\n },\n {\n enableOnContentEditable: true,\n },\n [],\n );\n\n useFloatingLinkEnter();\n\n useFloatingLinkEscape();\n\n return {\n style: {\n ...style,\n zIndex: 1000,\n },\n ...props,\n ref: useComposedRef<HTMLElement | null>(props.ref, floating),\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport { CheckboxState } from '@frontify/fondue';\nimport {\n ELEMENT_LINK,\n floatingLinkActions,\n floatingLinkSelectors,\n getPluginOptions,\n submitFloatingLink,\n useEditorRef,\n useHotkeys,\n} from '@udecode/plate';\nimport { Dispatch, Reducer, useEffect, useReducer } from 'react';\nimport { getLegacyUrl, getUrl } from '../../utils';\nimport { InsertModalDispatchType, InsertModalStateProps } from './types';\nimport { addHttps } from '../../../../../../helpers';\nimport { isValidUrlOrEmpty } from '../../utils/url';\n\nconst initialState: InsertModalStateProps = {\n url: '',\n text: '',\n newTab: CheckboxState.Unchecked,\n};\n\nexport const InsertModalState = (): [InsertModalStateProps, Dispatch<InsertModalDispatchType>] => {\n const [state, dispatch] = useReducer<Reducer<InsertModalStateProps, InsertModalDispatchType>>((state, action) => {\n const { type, payload } = action;\n\n switch (type) {\n case 'NEW_TAB':\n return {\n ...state,\n newTab: CheckboxState.Checked,\n };\n case 'SAME_TAB':\n return {\n ...state,\n newTab: CheckboxState.Unchecked,\n };\n case 'URL':\n case 'TEXT':\n case 'INIT':\n return {\n ...state,\n ...payload,\n };\n default:\n return state;\n }\n }, initialState);\n\n return [state, dispatch];\n};\n\nexport const useInsertModal = () => {\n const editor = useEditorRef();\n const [state, dispatch] = InsertModalState();\n\n useEffect(() => {\n const legacyUrl = getLegacyUrl(editor);\n const url = getUrl(editor);\n\n dispatch({\n type: 'INIT',\n payload: {\n text: floatingLinkSelectors.text(),\n newTab: floatingLinkSelectors.newTab() ? CheckboxState.Checked : CheckboxState.Unchecked,\n url: legacyUrl && url === '' ? legacyUrl : floatingLinkSelectors.url(),\n },\n });\n }, [dispatch, editor]);\n\n const onTextChange = (value: string) => {\n dispatch({\n type: 'TEXT',\n payload: { text: value },\n });\n };\n\n const onUrlChange = (value: string) => {\n dispatch({\n type: 'URL',\n payload: { url: value },\n });\n };\n\n const onToggleTab = (checked: boolean) => {\n checked ? dispatch({ type: 'NEW_TAB' }) : dispatch({ type: 'SAME_TAB' });\n };\n\n const onCancel = () => {\n floatingLinkActions.hide();\n };\n\n const onSave = (event: React.MouseEvent<HTMLButtonElement, MouseEvent> | KeyboardEvent | undefined) => {\n if (!isValidUrlOrEmpty(state.url) || !hasValues) {\n return;\n }\n\n const urlToSave = addHttps(state.url);\n\n floatingLinkActions.text(state.text);\n floatingLinkActions.url(urlToSave);\n floatingLinkActions.newTab(state.newTab === CheckboxState.Checked);\n\n if (submitFloatingLink(editor)) {\n event?.preventDefault();\n }\n };\n\n const hasValues = state.url !== '' && state.text !== '';\n\n const { appBridge } = getPluginOptions<{ appBridge: AppBridgeBlock }>(editor, ELEMENT_LINK);\n\n useHotkeys(\n 'enter',\n onSave,\n {\n enableOnFormTags: ['INPUT'],\n },\n [],\n );\n\n return {\n state,\n onTextChange,\n onUrlChange,\n onToggleTab,\n onCancel,\n onSave,\n hasValues,\n isValidUrlOrEmpty,\n appBridge,\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { InsertModal, useInsertModal } from '.';\n\nexport const InsertLinkModal = () => <InsertModal {...useInsertModal()} testId=\"floating-link-insert\" />;\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TEditableProps, useFloatingLinkSelectors } from '@udecode/plate';\n\nimport { EditModal } from './EditLinkModal';\nimport { FloatingLink } from './FloatingLink';\nimport { InsertLinkModal } from './InsertLinkModal/InsertLinkModal';\n\nexport const CustomFloatingLink = ({ readOnly }: TEditableProps) => {\n const isEditing = useFloatingLinkSelectors().isEditing();\n\n if (readOnly) {\n return null;\n }\n\n const input = <InsertLinkModal />;\n const editContent = isEditing ? input : <EditModal />;\n\n return (\n <>\n <FloatingLink.InsertRoot>{input}</FloatingLink.InsertRoot>\n\n <FloatingLink.EditRoot>{editContent}</FloatingLink.EditRoot>\n </>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n IconLink,\n IconSize,\n PluginButtonProps,\n getButtonClassNames,\n getHotkeyByPlatform,\n getTooltip,\n} from '@frontify/fondue';\nimport { LinkToolbarButton, isRangeInSameBlock, useEventPlateId, usePlateEditorState } from '@udecode/plate';\n\nexport const LinkButton = ({ id, editorId }: PluginButtonProps) => {\n const editor = usePlateEditorState(useEventPlateId(editorId));\n const isEnabled = !!isRangeInSameBlock(editor, {\n at: editor.selection,\n });\n\n return (\n <div data-plugin-id={id}>\n <LinkToolbarButton\n tooltip={getTooltip(\n isEnabled\n ? `Link\\n${getHotkeyByPlatform('Ctrl+K')}`\n : 'Links can only be set for a single text block.',\n )}\n icon={\n <span className=\"tw-p-2 tw-h-8 tw-justify-center tw-items-center tw-flex\">\n <IconLink size={IconSize.Size16} />\n </span>\n }\n classNames={getButtonClassNames(isEnabled)}\n styles={{ root: { width: '24px', height: '24px' } }}\n actionHandler=\"onMouseDown\"\n />\n </div>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { HTMLPropsAs, LinkRootProps, useElementProps } from '@udecode/plate';\nimport { MouseEvent } from 'react';\nimport { TLinkElement } from '../types';\nimport { BlockStyles } from '../../styles';\nimport { LINK_PLUGIN } from '../id';\n\nconst useLink = (props: LinkRootProps): HTMLPropsAs<'a'> => {\n const _props = useElementProps<TLinkElement, 'a'>({\n ...props,\n elementToAttributes: (element) => ({\n href: element.url || element.chosenLink?.searchResult?.link || '',\n target: element.target || '_blank',\n }),\n });\n\n return {\n ..._props,\n // quick fix: hovering <a> with href loses the editor focus\n onMouseOver: (event: MouseEvent) => {\n event.stopPropagation();\n },\n };\n};\n\nexport const LinkMarkupElementNode = (props: LinkRootProps) => {\n const htmlProps = useLink(props);\n const { attributes, children } = props;\n\n return (\n <a {...attributes} href={htmlProps.href} target={htmlProps.target} style={BlockStyles[LINK_PLUGIN]}>\n {children}\n </a>\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { MarkupElement } from '@frontify/fondue';\nimport { ELEMENT_LINK } from '@udecode/plate';\nimport { LinkMarkupElementNode } from './LinkMarkupElementNode';\n\nexport class LinkMarkupElement extends MarkupElement {\n constructor(id = ELEMENT_LINK, node = LinkMarkupElementNode) {\n super(id, node);\n }\n}\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport { Plugin, PluginProps } from '@frontify/fondue';\nimport { createLinkPlugin as createPlateLinkPlugin, createPluginFactory } from '@udecode/plate';\nimport { CustomFloatingLink } from './FloatingLink/CustomFloatingLink';\nimport { LINK_PLUGIN } from './id';\nimport { LinkButton } from './LinkButton';\nimport { LinkMarkupElement } from './LinkMarkupElement';\nimport { isValidUrl } from './utils/url';\nimport { CSSProperties } from 'react';\nimport { BlockStyles } from '../styles';\n\nexport const createLinkPlugin = (appBridge: AppBridgeBlock) =>\n createPluginFactory({\n ...createPlateLinkPlugin(),\n renderAfterEditable: CustomFloatingLink,\n options: {\n isUrl: isValidUrl,\n rangeBeforeOptions: {\n matchString: ' ',\n skipInvalid: true,\n afterMatch: true,\n },\n triggerFloatingLinkHotkeys: 'command+k, ctrl+k',\n appBridge,\n },\n })();\n\nexport type LinkPluginProps = PluginProps & { appBridge: AppBridgeBlock };\n\nexport class LinkPlugin extends Plugin {\n private appBridge: AppBridgeBlock;\n public styles: CSSProperties = {};\n constructor(props?: LinkPluginProps, styles = BlockStyles[LINK_PLUGIN]) {\n super(LINK_PLUGIN, {\n button: LinkButton,\n markupElement: new LinkMarkupElement(),\n ...props,\n });\n this.styles = styles;\n this.appBridge = props?.appBridge as AppBridgeBlock;\n }\n\n plugins() {\n return [createLinkPlugin(this.appBridge)];\n }\n}\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createPluginFactory } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport {\n MarkupElement,\n Plugin,\n PluginProps,\n TextStyleRenderElementProps,\n alignmentClassnames,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue';\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-custom1-plugin';\n\nexport class Custom1Plugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.custom1, ...props }: PluginProps = {}) {\n super(TextStyles.custom1, {\n label: 'Custom 1',\n markupElement: new Custom1MarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins() {\n return [createCustom1Plugin(this.styles)];\n }\n}\n\nclass Custom1MarkupElement extends MarkupElement {\n constructor(id = ID, node = Custom1MarkupElementNode) {\n super(id, node);\n }\n}\n\nconst Custom1MarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <p\n {...attributes}\n className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element), 'a-custom1'])}\n >\n <span style={styles}>{children}</span>\n </p>\n );\n};\n\nconst createCustom1Plugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.custom1,\n isElement: true,\n deserializeHtml: {\n rules: [{ validClassName: TextStyles.custom1 }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <Custom1MarkupElementNode {...props} styles={styles} />,\n });\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createPluginFactory } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport {\n MarkupElement,\n Plugin,\n PluginProps,\n TextStyleRenderElementProps,\n alignmentClassnames,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue';\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-custom2-plugin';\n\nexport class Custom2Plugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.custom2, ...props }: PluginProps = {}) {\n super(TextStyles.custom2, {\n label: 'Custom 2',\n markupElement: new Custom2MarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins() {\n return [createCustom2Plugin(this.styles)];\n }\n}\n\nclass Custom2MarkupElement extends MarkupElement {\n constructor(id = ID, node = Custom2MarkupElementNode) {\n super(id, node);\n }\n}\n\nconst Custom2MarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <p\n {...attributes}\n className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element), 'a-custom2'])}\n >\n <span style={styles}>{children}</span>\n </p>\n );\n};\n\nconst createCustom2Plugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.custom2,\n isElement: true,\n deserializeHtml: {\n rules: [{ validClassName: TextStyles.custom2 }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <Custom2MarkupElementNode {...props} styles={styles} />,\n });\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateRenderElementProps, createPluginFactory } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport {\n MarkupElement,\n Plugin,\n PluginProps,\n TextStyleRenderElementProps,\n TextStyles,\n alignmentClassnames,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue';\nimport { BlockStyles } from '../styles';\n\nconst ID = 'textstyle-custom3-plugin';\n\nexport class Custom3Plugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.custom3, ...props }: PluginProps = {}) {\n super(TextStyles.custom3, {\n label: 'Custom 3',\n markupElement: new Custom3MarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins() {\n return [createCustom3Plugin(this.styles)];\n }\n}\n\nclass Custom3MarkupElement extends MarkupElement {\n constructor(id = ID, node = Custom3MarkupElementNode) {\n super(id, node);\n }\n}\n\nconst Custom3MarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <p\n {...attributes}\n className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element), 'a-custom3'])}\n >\n <span style={styles}>{children}</span>\n </p>\n );\n};\n\nconst createCustom3Plugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.custom3,\n isElement: true,\n deserializeHtml: {\n rules: [{ validClassName: TextStyles.custom3 }],\n },\n })({\n component: (props: PlateRenderElementProps) => <Custom3MarkupElementNode {...props} styles={styles} />,\n });\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateRenderElementProps, createPluginFactory } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport {\n MarkupElement,\n Plugin,\n PluginProps,\n TextStyleRenderElementProps,\n alignmentClassnames,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue';\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-heading1-plugin';\nexport class Heading1Plugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.heading1, ...props }: PluginProps = {}) {\n super(TextStyles.heading1, {\n label: 'Heading 1',\n markupElement: new Heading1MarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins() {\n return [createHeading1Plugin(this.styles)];\n }\n}\n\nclass Heading1MarkupElement extends MarkupElement {\n constructor(id = ID, node = Heading1MarkupElementNode) {\n super(id, node);\n }\n}\n\nconst Heading1MarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <h1\n {...attributes}\n className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element), 'a-h1'])}\n >\n <span style={styles}>{children}</span>\n </h1>\n );\n};\n\nconst createHeading1Plugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.heading1,\n isElement: true,\n component: Heading1MarkupElementNode,\n deserializeHtml: {\n rules: [{ validNodeName: ['h1', 'H1'] }],\n },\n })({\n component: (props: PlateRenderElementProps) => <Heading1MarkupElementNode {...props} styles={styles} />,\n });\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createPluginFactory } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport {\n MarkupElement,\n Plugin,\n PluginProps,\n TextStyleRenderElementProps,\n alignmentClassnames,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue';\nimport { BlockStyles, TextStyles } from '../styles';\nconst ID = 'textstyle-heading2-plugin';\n\nexport class Heading2Plugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.heading2, ...props }: PluginProps = {}) {\n super(TextStyles.heading2, {\n label: 'Heading 2',\n markupElement: new Heading2MarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins() {\n return [createHeading2Plugin(this.styles)];\n }\n}\n\nclass Heading2MarkupElement extends MarkupElement {\n constructor(id = ID, node = Heading2MarkupElementNode) {\n super(id, node);\n }\n}\n\nconst Heading2MarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <h2 {...attributes} className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element)])}>\n <span style={styles}>{children}</span>\n </h2>\n );\n};\n\nconst createHeading2Plugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.heading2,\n isElement: true,\n component: Heading2MarkupElementNode,\n deserializeHtml: {\n rules: [{ validNodeName: ['h2', 'H2'] }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <Heading2MarkupElementNode {...props} styles={styles} />,\n });\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createPluginFactory } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport {\n MarkupElement,\n Plugin,\n PluginProps,\n TextStyleRenderElementProps,\n alignmentClassnames,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue';\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-heading3-plugin';\n\nexport class Heading3Plugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.heading3, ...props }: PluginProps = {}) {\n super(TextStyles.heading3, {\n label: 'Heading 3',\n markupElement: new Heading3MarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins() {\n return [createHeading3Plugin(this.styles)];\n }\n}\n\nclass Heading3MarkupElement extends MarkupElement {\n constructor(id = ID, node = Heading3MarkupElementNode) {\n super(id, node);\n }\n}\nconst Heading3MarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <h3 {...attributes} className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element)])}>\n <span style={styles}>{children}</span>\n </h3>\n );\n};\n\nconst createHeading3Plugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.heading3,\n isElement: true,\n component: Heading3MarkupElementNode,\n deserializeHtml: {\n rules: [{ validNodeName: ['h3', 'H3'] }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <Heading3MarkupElementNode {...props} styles={styles} />,\n });\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createPluginFactory } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport {\n MarkupElement,\n Plugin,\n PluginProps,\n TextStyleRenderElementProps,\n alignmentClassnames,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue';\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-heading4-plugin';\n\nexport class Heading4Plugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.heading4, ...props }: PluginProps = {}) {\n super(TextStyles.heading4, {\n label: 'Heading 4',\n markupElement: new Heading4MarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins() {\n return [createHeading4Plugin(this.styles)];\n }\n}\n\nclass Heading4MarkupElement extends MarkupElement {\n constructor(id = ID, node = Heading4MarkupElementNode) {\n super(id, node);\n }\n}\n\nconst Heading4MarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <h4 {...attributes} className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element)])}>\n <span style={styles}>{children}</span>\n </h4>\n );\n};\n\nconst createHeading4Plugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.heading4,\n isElement: true,\n component: Heading4MarkupElementNode,\n deserializeHtml: {\n rules: [{ validNodeName: ['h4', 'H4'] }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <Heading4MarkupElementNode {...props} styles={styles} />,\n });\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createPluginFactory } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport {\n MarkupElement,\n Plugin,\n PluginProps,\n TextStyleRenderElementProps,\n alignmentClassnames,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue';\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-imageCaption-plugin';\n\nexport class ImageCaptionPlugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.imageCaption, ...props }: PluginProps = {}) {\n super(TextStyles.imageCaption, {\n label: 'Image Caption',\n markupElement: new ImageCaptionMarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins() {\n return [createImageCaptionPlugin(this.styles)];\n }\n}\n\nclass ImageCaptionMarkupElement extends MarkupElement {\n constructor(id = ID, node = ImageCaptionMarkupElementNode) {\n super(id, node);\n }\n}\nconst ImageCaptionMarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <p\n {...attributes}\n className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element), 'a-image-caption'])}\n >\n <span style={styles}>{children}</span>\n </p>\n );\n};\n\nconst createImageCaptionPlugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.imageCaption,\n isElement: true,\n component: ImageCaptionMarkupElementNode,\n deserializeHtml: {\n rules: [{ validClassName: TextStyles.imageCaption }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <ImageCaptionMarkupElementNode {...props} styles={styles} />,\n });\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createPluginFactory } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport {\n MarkupElement,\n Plugin,\n PluginProps,\n TextStyleRenderElementProps,\n alignmentClassnames,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue';\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-imageTitle-plugin';\n\nexport class ImageTitlePlugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.imageTitle, ...props }: PluginProps = {}) {\n super(TextStyles.imageTitle, {\n label: 'Image Title',\n markupElement: new ImageTitleMarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins() {\n return [createImageTitlePlugin(this.styles)];\n }\n}\n\nclass ImageTitleMarkupElement extends MarkupElement {\n constructor(id = ID, node = ImageTitleMarkupElementNode) {\n super(id, node);\n }\n}\nconst ImageTitleMarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <p\n {...attributes}\n className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element), 'a-image-title'])}\n >\n <span style={styles}>{children}</span>\n </p>\n );\n};\n\nconst createImageTitlePlugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.imageTitle,\n isElement: true,\n component: ImageTitleMarkupElementNode,\n deserializeHtml: {\n rules: [{ validClassName: TextStyles.imageTitle }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <ImageTitleMarkupElementNode {...props} styles={styles} />,\n });\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createParagraphPlugin as createPlateParagraphPlugin, createPluginFactory } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport {\n MarkupElement,\n Plugin,\n PluginProps,\n TextStyleRenderElementProps,\n alignmentClassnames,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue';\nimport { BlockStyles, TextStyles } from '../styles';\n\nexport class ParagraphPlugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.p, ...props }: PluginProps = {}) {\n super(TextStyles.p, {\n markupElement: new ParagraphMarkupElement(),\n label: 'Body Text',\n ...props,\n });\n this.styles = styles;\n }\n\n plugins() {\n return [createParagraphPlugin(this.styles)];\n }\n}\n\nexport const PARAGRAPH_CLASSES = 'tw-m-0 tw-px-0 tw-py-0';\n\nexport const ParagraphMarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n const className = merge([align && alignmentClassnames[align], PARAGRAPH_CLASSES, getColumnBreakClasses(element)]);\n return (\n <p {...attributes} className={className} style={styles}>\n {children}\n </p>\n );\n};\n\nexport class ParagraphMarkupElement extends MarkupElement {\n constructor(id = TextStyles.p, node = ParagraphMarkupElementNode) {\n super(id, node);\n }\n}\n\nexport const createParagraphPlugin = (styles: CSSProperties) =>\n createPluginFactory({\n ...createPlateParagraphPlugin(),\n key: TextStyles.p,\n isElement: true,\n component: ParagraphMarkupElementNode,\n })({\n component: (props: TextStyleRenderElementProps) => <ParagraphMarkupElementNode {...props} styles={styles} />,\n });\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createPluginFactory } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport {\n MarkupElement,\n Plugin,\n PluginProps,\n TextStyleRenderElementProps,\n alignmentClassnames,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue';\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-quote-plugin';\n\nexport class QuotePlugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.quote, ...props }: PluginProps = {}) {\n super(TextStyles.quote, {\n label: 'Quote',\n markupElement: new QuoteMarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins() {\n return [createQuotePlugin(this.styles)];\n }\n}\n\nclass QuoteMarkupElement extends MarkupElement {\n constructor(id = ID, node = QuoteMarkupElementNode) {\n super(id, node);\n }\n}\n\nexport const QuoteMarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <blockquote\n {...attributes}\n className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element), 'a-quote'])}\n >\n <span style={styles}>{children}</span>\n </blockquote>\n );\n};\n\nexport const createQuotePlugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.quote,\n isElement: true,\n component: QuoteMarkupElementNode,\n deserializeHtml: {\n rules: [{ validNodeName: ['blockquote', 'BLOCKQUOTE'] }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <QuoteMarkupElementNode {...props} styles={styles} />,\n });\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n Custom1Plugin,\n Custom2Plugin,\n Custom3Plugin,\n Heading1Plugin,\n Heading2Plugin,\n Heading3Plugin,\n Heading4Plugin,\n ImageCaptionPlugin,\n ImageTitlePlugin,\n ParagraphPlugin,\n QuotePlugin,\n} from '.';\nimport { TextStyles } from '../styles';\n\nexport const TextStylePluginsWithoutImage = [\n new Heading1Plugin(),\n new Heading2Plugin(),\n new Heading3Plugin(),\n new Heading4Plugin(),\n new Custom1Plugin(),\n new Custom2Plugin(),\n new Custom3Plugin(),\n new QuotePlugin(),\n new ParagraphPlugin(),\n];\n\nexport const TextStylesWithoutImage = [\n TextStyles.heading1,\n TextStyles.heading2,\n TextStyles.heading3,\n TextStyles.heading4,\n TextStyles.custom1,\n TextStyles.custom2,\n TextStyles.custom3,\n TextStyles.quote,\n TextStyles.p,\n];\n\nexport const AllTextStylePlugins = [...TextStylePluginsWithoutImage, new ImageCaptionPlugin(), new ImageTitlePlugin()];\n\nexport const AllTextStyles = [...TextStylesWithoutImage, TextStyles.imageCaption, TextStyles.imageTitle];\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { BOLD_CLASSES, CODE_CLASSES, ITALIC_CLASSES, STRIKETHROUGH_CLASSES, UNDERLINE_CLASSES } from '@frontify/fondue';\nimport { TText } from '@udecode/plate';\nimport escapeHtml from 'escape-html';\n\nexport const serializeLeafToHtml = (node: TText): string => {\n let string = escapeHtml(node.text);\n string = string.replaceAll('\\n', '<br />');\n const { bold, italic, underline, strikethrough, code, subscript, superscript } = node;\n if (bold) {\n string = `<span class=\"${BOLD_CLASSES}\">${string}</span>`;\n }\n if (italic) {\n string = `<span class=\"${ITALIC_CLASSES}\">${string}</span>`;\n }\n if (underline) {\n string = `<span class=\"${UNDERLINE_CLASSES}\">${string}</span>`;\n }\n if (strikethrough) {\n string = `<span class=\"${STRIKETHROUGH_CLASSES}\">${string}</span>`;\n }\n if (code) {\n string = `<span class=\"${CODE_CLASSES}\">${string}</span>`;\n }\n if (subscript) {\n string = `<sub>${string}</sub>`;\n } else if (superscript) {\n string = `<sup>${string}</sup>`;\n }\n return string;\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\n\nexport const reactCssPropsToCss = (props?: CSSProperties): string => {\n if (!props) {\n return '';\n }\n\n return Object.keys(props)\n .reduce<string>((acc, key) => {\n const value = props[key as keyof CSSProperties];\n return value ? `${acc}${convertCamelCaseToKebabCase(key)}: ${value}; ` : acc;\n }, '')\n .trim()\n .replaceAll('\"', \"'\");\n};\n\nconst convertCamelCaseToKebabCase = (str: string): string => {\n return str.replaceAll(/([A-Z])/g, '-$1').toLowerCase();\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TElement } from '@udecode/plate';\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\nimport { CSSProperties } from 'react';\nimport { BUTTON_PLUGIN } from '../../plugins';\n\nexport type ButtonStylesType = Record<string, Record<string, CSSProperties & { hover?: CSSProperties }>>;\n\nexport const buttonNode = (node: TElement, children: string, defaultClassNames: string, styles: ButtonStylesType) => {\n const buttonStyles = styles[BUTTON_PLUGIN];\n const buttonTypeString = (node.buttonStyle as string) ?? 'primary';\n const buttonType = `button${buttonTypeString.charAt(0).toUpperCase()}${buttonTypeString.slice(1)}`;\n const buttonStyle = buttonStyles[buttonType];\n\n const defaultStyles = reactCssPropsToCss(buttonStyle);\n\n return `<a href=\"${node.url}\"\n target=\"${node.target ?? '_blank'}\"\n style=\"${defaultStyles}\"\n class=\"${defaultClassNames}\"\n onmouseenter=\"this.setAttribute('style', '${defaultStyles} ${reactCssPropsToCss(buttonStyle?.hover)}');\"\n onmouseleave=\"this.setAttribute('style', '${reactCssPropsToCss(buttonStyle)}');\"\n >${children}</a>`;\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TElement } from '@udecode/plate';\nimport { LINK_PLUGIN } from '../../plugins/LinkPlugin/id';\nimport { TLinkElement } from '../../plugins/LinkPlugin/types';\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\nimport escapeHtml from 'escape-html';\nimport { CSSProperties } from 'react';\n\nexport const linkNode = (\n node: TElement,\n children: string,\n defaultClassNames: string,\n styles: Record<string, CSSProperties & { hover?: CSSProperties }>,\n) => {\n if (node.chosenLink) {\n const { chosenLink } = node as TLinkElement;\n return `<a class=\"${defaultClassNames}\" style=\"${reactCssPropsToCss(styles[LINK_PLUGIN])}\" target=${\n chosenLink?.openInNewTab ? '_blank' : '_self'\n } href=\"${escapeHtml(chosenLink?.searchResult?.link)}\">${children}</a>`;\n }\n return `<a class=\"${defaultClassNames}\" style=\"${reactCssPropsToCss(styles[LINK_PLUGIN])}\" target=\"${\n node?.target ?? '_blank'\n }\" href=\"${escapeHtml(node.url as string)}\">${children}</a>`;\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TElement } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport { TextStyles } from '../../plugins';\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\nimport { merge } from '@frontify/fondue';\n\nexport const defaultNode = (node: TElement, children: string, styles: CSSProperties, defaultClassNames: string) => {\n const defaultStyles = reactCssPropsToCss(styles);\n\n if (node.type === TextStyles.heading1) {\n return `<h1 class=\"${merge([defaultClassNames, 'a-h1'])}\">${getStyledChild(children, defaultStyles)}</h1>`;\n }\n if (node.type === TextStyles.heading2) {\n return `<h2 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h2>`;\n }\n if (node.type === TextStyles.heading3) {\n return `<h3 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h3>`;\n }\n if (node.type === TextStyles.heading4) {\n return `<h4 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h4>`;\n }\n if (node.type === TextStyles.custom1) {\n return `<p class=\"${merge([defaultClassNames, 'a-custom1'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.custom2) {\n return `<p class=\"${merge([defaultClassNames, 'a-custom2'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.custom3) {\n return `<p class=\"${merge([defaultClassNames, 'a-custom3'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.quote) {\n return `<p class=\"${merge([defaultClassNames, 'a-quote'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.imageTitle) {\n return `<p class=\"${merge([defaultClassNames, 'a-image-title'])}\">${getStyledChild(\n children,\n defaultStyles,\n )}</p>`;\n }\n if (node.type === TextStyles.imageCaption) {\n return `<p class=\"${merge([defaultClassNames, 'a-image-caption'])}\">${getStyledChild(\n children,\n defaultStyles,\n )}</p>`;\n }\n\n return `<p class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</p>`;\n};\n\nconst getStyledChild = (children: string, styles: string) => `<span style=\"${styles}\">${children}</span>`;\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { merge } from '@frontify/fondue';\nimport { TElement } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\n\nexport const checkItemNode = (\n node: TElement,\n children: string,\n defaultClassNames: string,\n styles: Record<string, CSSProperties & { hover?: CSSProperties }>,\n) => {\n return `<div disabled class=\"tw-flex tw-flex-row tw-pb-2 first-of-type:tw-ml-0 ${defaultClassNames}\" style=\"margin-left:${\n ((node.indent as number) ?? 0) * 24\n }px;\">\n <div class=\"tw-flex tw-items-center tw-justify-center tw-select-none tw-mr-1.5\">\n <input\n class=\"tw-w-4 tw-h-4 tw-m-0\"\n type=\"checkbox\"\n ${node.checked ? 'checked' : ''}\n onclick=\"return false;\" />\n </div>\n <span class=\"${merge([\n 'tw-flex-1 tw-focus:outline-none',\n node.checked ? '!tw-line-through' : '',\n ])}\" style=\"${reactCssPropsToCss(styles[node.children[0].textStyle as string])}\">${children}</span>\n</div>`;\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport ReactDOM from 'react-dom';\nimport { TElement, TMentionElement } from '@udecode/plate';\nimport { MappedMentionableItems, MentionMarkupElementNode } from '@frontify/fondue';\n\ntype MentionHtmlNodeProps = { mentionable?: MappedMentionableItems };\n\nexport const mentionHtmlNode = (node: TElement, { mentionable }: MentionHtmlNodeProps = {}) => {\n if (!mentionable) {\n return '';\n }\n\n const div = document.createElement('div');\n ReactDOM.render(MentionMarkupElementNode(mentionable)({ element: node as TMentionElement }), div);\n return div.innerHTML;\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ELEMENT_CHECK_ITEM,\n LI_CLASSNAMES,\n MappedMentionableItems,\n OL_STYLES,\n UL_CLASSES,\n alignmentClassnames,\n getLiStyles,\n getLicElementClassNames,\n getOrderedListClasses,\n merge,\n} from '@frontify/fondue';\nimport {\n ELEMENT_LI,\n ELEMENT_LIC,\n ELEMENT_LINK,\n ELEMENT_MENTION,\n ELEMENT_OL,\n ELEMENT_UL,\n TDescendant,\n TElement,\n isText,\n} from '@udecode/plate';\nimport { serializeLeafToHtml } from './utlis/serializeLeafToHtml';\nimport { reactCssPropsToCss } from './utlis/reactCssPropsToCss';\nimport { CSSProperties } from 'react';\nimport { ButtonStylesType, buttonNode } from './nodes/button';\nimport { linkNode } from './nodes/link';\nimport { defaultNode } from './nodes/default';\nimport { checkItemNode } from './nodes/checkItemNode';\nimport { mentionHtmlNode } from './nodes/mentionHtmlNode';\nimport { ELEMENT_BUTTON } from '../plugins';\n\nconst countNodesOfType = (nodes: TDescendant[], type: string): number => {\n return nodes.reduce((acc, node) => {\n if (node.type === type) {\n acc++;\n }\n if (node.children) {\n return acc + countNodesOfType(node.children as TDescendant[], type);\n }\n return acc;\n }, 0);\n};\n\ntype NestingCount = {\n [type: string]: number;\n};\n\ntype SerializeNodeToHtmlRecursiveOptions = {\n mappedMentionable?: MappedMentionableItems;\n nestingCount?: NestingCount;\n};\n\nexport const serializeNodeToHtmlRecursive = (\n node: TDescendant,\n styles: Record<string, CSSProperties & { hover?: CSSProperties }> | ButtonStylesType,\n { mappedMentionable, nestingCount = {} }: SerializeNodeToHtmlRecursiveOptions,\n): string => {\n if (isText(node)) {\n return serializeLeafToHtml(node);\n }\n\n const rootNestingCount = nestingCount[node.type] || countNodesOfType([node], node.type);\n let children = '';\n for (const element of node.children) {\n children += serializeNodeToHtmlRecursive(element, styles, {\n nestingCount: {\n ...nestingCount,\n [element.type as string]: rootNestingCount,\n },\n mappedMentionable,\n });\n }\n\n const htmlMapper = MapNodeTypesToHtml[node.type];\n if (typeof htmlMapper !== 'undefined') {\n return htmlMapper({\n classNames: getClassNames(node.breakAfterColumn as string | undefined, node.align as string | undefined),\n children,\n rootNestingCount,\n node,\n mappedMentionable,\n styles,\n });\n } else {\n return defaultNode(\n node,\n children,\n styles[node.type],\n getClassNames(node.breakAfterColumn as string | undefined, node.align as string | undefined),\n );\n }\n};\n\ntype Arguments = {\n classNames: string;\n children: string;\n rootNestingCount: number;\n node: TElement;\n mappedMentionable?: MappedMentionableItems;\n styles: Record<string, CSSProperties & { hover?: CSSProperties }> | ButtonStylesType;\n};\n\nconst MapNodeTypesToHtml: { [key: string]: ({ ...args }: Arguments) => string } = {\n [ELEMENT_UL]: (args) => `<ul class=\"${UL_CLASSES} ${args.classNames}\">${args.children}</ul>`,\n [ELEMENT_OL]: ({ classNames, children, node, rootNestingCount }) => {\n const nestingLevel = Math.max(rootNestingCount - countNodesOfType([node], ELEMENT_OL), 0);\n return `<ol class=\"${getOrderedListClasses(nestingLevel)} ${classNames}\" style=\"${reactCssPropsToCss(\n OL_STYLES,\n )}\">${children}</ol>`;\n },\n [ELEMENT_LI]: ({ classNames, children, node, styles }) =>\n `<li class=\"${classNames} ${LI_CLASSNAMES}\" style=\"${reactCssPropsToCss(\n getLiStyles(node, styles),\n )}\">${children}</li>`,\n [ELEMENT_LIC]: ({ classNames, children, node }) =>\n `<p class=\"${classNames} ${getLicElementClassNames(node)}\"><span>${children}</span></p>`,\n [ELEMENT_LINK]: ({ node, children, classNames, styles }) => linkNode(node, children, classNames, styles),\n [ELEMENT_BUTTON]: ({ node, children, classNames, styles }) =>\n buttonNode(node, children, classNames, styles as ButtonStylesType),\n [ELEMENT_CHECK_ITEM]: ({ node, children, classNames, styles }) => checkItemNode(node, children, classNames, styles),\n [ELEMENT_MENTION]: ({ node, mappedMentionable }) => mentionHtmlNode(node, { mentionable: mappedMentionable }),\n};\n\nconst getClassNames = (breakAfterColumn?: string, align?: string) => {\n const breakWordsClass = 'tw-break-words';\n const columnBreakClasses =\n breakAfterColumn === 'active' ? 'tw-break-after-column tw-break-inside-avoid-column' : '';\n const alignClass = align ? alignmentClassnames[align] : '';\n return merge([alignClass, breakWordsClass, columnBreakClasses]);\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TDescendant } from '@udecode/plate';\nimport { PluginComposer, SerializeNodesToHtmlOptions, mapMentionable, parseRawValue } from '@frontify/fondue';\nimport { BlockStyles } from '../plugins';\nimport { serializeNodeToHtmlRecursive } from './serializeNodesToHtmlRecursive';\n\nexport const serializeRawToHtmlAsync = async (\n raw: string,\n columns: SerializeNodesToHtmlOptions['columns'] = 1,\n columnGap: SerializeNodesToHtmlOptions['columnGap'] = 'normal',\n plugins: PluginComposer = new PluginComposer(),\n): Promise<string> => {\n const nodes = parseRawValue({ raw, plugins });\n const styles = plugins.getStyles;\n return Promise.resolve(serializeNodesToHtml(nodes, { columns, columnGap, styles }));\n};\n\nexport const serializeNodesToHtml = (\n nodes: TDescendant[],\n { mentionable, columns = 1, columnGap = 'normal', styles = BlockStyles }: SerializeNodesToHtmlOptions = {},\n): string => {\n const mappedMentionable = mentionable ? mapMentionable(mentionable) : new Map();\n\n let html = '';\n for (let i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n if (isEmptyNode(node)) {\n html += '<br />';\n } else {\n html += serializeNodeToHtmlRecursive(node, styles, {\n mappedMentionable,\n });\n }\n }\n\n if (columns > 1) {\n return `<div style=\"columns:${columns}; column-gap:${columnGap};\">${html}</div>`;\n }\n\n return html;\n};\n\nconst isEmptyNode = (node: TDescendant): boolean => {\n if (!Array.isArray(node?.children)) {\n return false;\n }\n return node?.children?.every((child) => child.text === '');\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useEffect, useState } from 'react';\nimport { SerializedTextProps } from './types';\nimport { serializeRawToHtmlAsync } from './serializer';\n\nexport const SerializedText = ({ value = '', gap, columns, show = true, plugins }: SerializedTextProps) => {\n const [html, setHtml] = useState<string | null>(null);\n\n useEffect(() => {\n (async () => {\n setHtml(await serializeRawToHtmlAsync(value, columns, gap, plugins));\n })();\n }, [value, columns, gap, plugins]);\n\n if (!show || html === '<br />') {\n return null;\n }\n\n return html !== null ? (\n <div className=\"tw-w-full\" data-test-id=\"rte-content-html\" dangerouslySetInnerHTML={{ __html: html }} />\n ) : (\n <div className=\"tw-rounded-sm tw-bg-base-alt tw-animate-pulse tw-h-full tw-min-h-[10px] tw-w-full\" />\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useEffect, useState } from 'react';\n\nimport { RichTextEditor as FondueRichTextEditor } from '@frontify/fondue';\nimport { RichTextEditorProps } from './types';\nimport { SerializedText } from './SerializedText';\nimport { floatingButtonActions, floatingButtonSelectors } from './plugins/ButtonPlugin/components';\n\nexport const RichTextEditor = ({\n id = 'rte',\n isEditing,\n value,\n columns,\n gap,\n placeholder,\n plugins,\n onTextChange,\n showSerializedText,\n}: RichTextEditorProps) => {\n const [shouldPreventPageLeave, setShouldPreventPageLeave] = useState(false);\n\n const saveText = (newContent: string) => {\n if (onTextChange && newContent !== value) {\n onTextChange(newContent);\n }\n setShouldPreventPageLeave(false);\n };\n\n useEffect(() => {\n const unloadHandler = (event: BeforeUnloadEvent) => {\n event.preventDefault();\n return (event.returnValue = 'Unprocessed changes');\n };\n\n if (shouldPreventPageLeave) {\n window.addEventListener('beforeunload', unloadHandler);\n }\n\n return () => window.removeEventListener('beforeunload', unloadHandler);\n }, [shouldPreventPageLeave]);\n\n if (isEditing) {\n return (\n <FondueRichTextEditor\n id={id}\n value={value}\n border={false}\n placeholder={placeholder}\n plugins={plugins}\n onValueChanged={() => setShouldPreventPageLeave(true)}\n onTextChange={saveText}\n hideExternalFloatingModals={(editorId: string) => {\n if (floatingButtonSelectors.isOpen(editorId)) {\n floatingButtonActions.reset();\n }\n }}\n />\n );\n }\n return <SerializedText value={value} columns={columns} gap={gap} show={showSerializedText} plugins={plugins} />;\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n AlignCenterPlugin,\n AlignJustifyPlugin,\n AlignLeftPlugin,\n AlignRightPlugin,\n BoldPlugin,\n CheckboxListPlugin,\n CodePlugin,\n ItalicPlugin,\n OrderedListPlugin,\n PluginComposer,\n ResetFormattingPlugin,\n SoftBreakPlugin,\n StrikethroughPlugin,\n TextStylePlugin,\n UnderlinePlugin,\n UnorderedListPlugin,\n} from '@frontify/fondue';\nimport { ButtonPlugin, LinkPlugin, TextStylePluginsWithoutImage, TextStylesWithoutImage } from '../plugins';\n\nexport const getDefaultPluginsWithLinkChooser = (appBridge: AppBridgeBlock) => {\n return new PluginComposer()\n .setPlugin(\n new SoftBreakPlugin(),\n new TextStylePlugin({\n textStyles: TextStylePluginsWithoutImage,\n }),\n )\n .setPlugin(\n [\n new BoldPlugin(),\n new ItalicPlugin(),\n new UnderlinePlugin(),\n new StrikethroughPlugin(),\n new LinkPlugin({ appBridge }),\n new ButtonPlugin({ appBridge }),\n new CodePlugin(),\n ],\n [\n new AlignLeftPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignCenterPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignRightPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignJustifyPlugin({ validTypes: TextStylesWithoutImage }),\n new UnorderedListPlugin(),\n new CheckboxListPlugin(),\n new OrderedListPlugin(),\n new ResetFormattingPlugin(),\n ],\n );\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const THEME_PREFIX = '--f-theme-settings-';\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock, Asset, useBlockAssets } from '@frontify/app-bridge';\n\nexport const useAttachments = (appBridge: AppBridgeBlock, assetId: string) => {\n const { blockAssets, updateAssetIdsFromKey } = useBlockAssets(appBridge);\n const attachments = blockAssets?.[assetId] || [];\n\n const onAddAttachments = async (newAssets: Asset[]) => {\n const newAssetIds = attachments.map((attachment) => attachment.id);\n for (const asset of newAssets) {\n newAssetIds.push(asset.id);\n }\n await updateAssetIdsFromKey(assetId, newAssetIds);\n };\n\n const onAttachmentDelete = async (assetToDelete: Asset) => {\n const newAssetIds = attachments\n .filter((attachment) => attachment.id !== assetToDelete.id)\n .map((attachment) => attachment.id);\n\n await updateAssetIdsFromKey(assetId, newAssetIds);\n };\n\n const onAttachmentReplace = async (attachmentToReplace: Asset, newAsset: Asset) => {\n const newAssetIds = attachments.map((attachment) =>\n attachment.id === attachmentToReplace.id ? newAsset.id : attachment.id,\n );\n\n await updateAssetIdsFromKey(assetId, newAssetIds);\n };\n\n const onAttachmentsSorted = async (assets: Asset[]) => {\n const newAssetIds = assets.map((asset) => asset.id);\n\n await updateAssetIdsFromKey(assetId, newAssetIds);\n };\n\n return {\n onAddAttachments,\n onAttachmentDelete,\n onAttachmentReplace,\n onAttachmentsSorted,\n attachments,\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { KeyboardSensor, PointerSensor, useSensor, useSensors } from '@dnd-kit/core';\nimport { customCoordinatesGetterFactory } from '../helpers/customCoordinatesGetterFactory';\n\nconst keyboardCodes = {\n start: ['Space', 'Enter'],\n cancel: [],\n end: ['Space', 'Enter', 'Escape'],\n};\n\nexport const useDndSensors = (columnGap = 0, rowGap = 0) => {\n const customCoordinatesGetter = customCoordinatesGetterFactory(columnGap, rowGap);\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: customCoordinatesGetter,\n keyboardCodes,\n }),\n );\n\n return sensors;\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Color } from '@frontify/fondue';\nimport { BACKGROUND_COLOR_DEFAULT_VALUE } from './defaultValues';\nimport { SettingBlock } from '../';\n\n/**\n * Returns background settings: background switch, background color\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @param options.defaultValue Default value for the background switch\n * @param options.defaultColor Default value for the background color\n * @param options.preventDefaultColor Whether the background color should be empty by default\n * @param options.switchLabel Label for the background switch\n * @returns {SettingBlock} Returns background settings\n */\n\ntype BackgroundSettingsType = {\n id?: string;\n defaultValue?: boolean;\n defaultColor?: Color;\n preventDefaultColor?: boolean;\n switchLabel?: string;\n};\n\nexport const getBackgroundSettings = (options?: BackgroundSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasBackground${options.id}` : 'hasBackground';\n const colorId = options?.id ? `backgroundColor${options.id}` : 'backgroundColor';\n const defaultColor = !!options?.preventDefaultColor\n ? undefined\n : options?.defaultColor || BACKGROUND_COLOR_DEFAULT_VALUE;\n const switchLabel = options?.switchLabel ? options.switchLabel : undefined;\n\n return {\n id: hasId,\n label: 'Background',\n type: 'switch',\n switchLabel,\n defaultValue: !!options?.defaultValue,\n on: [\n {\n id: colorId,\n defaultValue: defaultColor,\n type: 'colorInput',\n },\n ],\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n Color,\n MultiInputLayout,\n SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n} from '../';\nimport { BORDER_COLOR_DEFAULT_VALUE, BORDER_WIDTH_DEFAULT_VALUE } from './defaultValues';\nimport { BorderStyle } from './types';\n\n/**\n * Returns border settings: border switch, border style, border width, border color\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @param options.switchLabel Label for the border switch\n * @param options.defaultValue Default value for the border switch\n * @returns {SettingBlock} Returns border settings\n */\n\ntype BorderSettingsType = {\n id?: string;\n defaultValue?: boolean;\n defaultColor?: Color;\n switchLabel?: string;\n};\n\nexport const getBorderSettings = (options?: BorderSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasBorder_${options.id}` : 'hasBorder';\n const selectionId = options?.id ? `borderSelection_${options.id}` : 'borderSelection';\n const styleId = options?.id ? `borderStyle_${options.id}` : 'borderStyle';\n const widthId = options?.id ? `borderWidth_${options.id}` : 'borderWidth';\n const colorId = options?.id ? `borderColor_${options.id}` : 'borderColor';\n const defaultColor = options?.defaultColor || BORDER_COLOR_DEFAULT_VALUE;\n const switchLabel = options?.switchLabel ? options.switchLabel : undefined;\n\n return {\n id: hasId,\n label: 'Border',\n type: 'switch',\n switchLabel,\n defaultValue: !!options?.defaultValue,\n on: [\n {\n id: selectionId,\n type: 'multiInput',\n onChange: (bundle) => appendUnit(bundle, widthId),\n layout: MultiInputLayout.Columns,\n lastItemFullWidth: true,\n blocks: [\n {\n id: styleId,\n type: 'dropdown',\n defaultValue: BorderStyle.Solid,\n choices: [\n {\n value: BorderStyle.Solid,\n label: BorderStyle.Solid,\n },\n {\n value: BorderStyle.Dotted,\n label: BorderStyle.Dotted,\n },\n {\n value: BorderStyle.Dashed,\n label: BorderStyle.Dashed,\n },\n ],\n },\n {\n id: widthId,\n type: 'input',\n defaultValue: BORDER_WIDTH_DEFAULT_VALUE,\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n placeholder: 'e.g. 3px',\n },\n {\n id: colorId,\n type: 'colorInput',\n defaultValue: defaultColor,\n },\n ],\n },\n ],\n off: [],\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { SettingBlock, appendUnit, numericalOrPixelRule, presetCustomValue } from '../';\n\nimport { Radius, radiusStyleMap } from './types';\n\n/**\n * Returns border radius settings: border radius switch, radius slider, custom radius input\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @param options.dependentSettingId Id of setting which the border radius is dependent on\n * @returns {SettingBlock} Returns border settings\n */\n\ntype BorderRadiusSettingsType = {\n id?: string;\n dependentSettingId?: string;\n radiusStyleMap?: Record<Radius, string>;\n defaultRadius?: Radius;\n};\n\nexport const getBorderRadiusSlider = (id: string, defaultValue: Radius = Radius.None): SettingBlock => ({\n id,\n type: 'segmentedControls',\n defaultValue,\n choices: [\n {\n value: Radius.None,\n label: 'None',\n },\n {\n value: Radius.Small,\n label: 'S',\n },\n {\n value: Radius.Medium,\n label: 'M',\n },\n {\n value: Radius.Large,\n label: 'L',\n },\n ],\n});\n\nexport const getBorderRadiusSettings = (options?: BorderRadiusSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasRadius_${options.id}` : 'hasRadius';\n const valueId = options?.id ? `radiusValue_${options.id}` : 'radiusValue';\n const choiceId = options?.id ? `radiusChoice_${options.id}` : 'radiusChoice';\n const defaultValue = options?.defaultRadius || Radius.None;\n\n return {\n id: hasId,\n label: 'Corner radius',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'Determining how rounded the corners are.',\n show: (bundle) => (options?.dependentSettingId ? !!bundle.getBlock(options.dependentSettingId)?.value : true),\n onChange: (bundle) => presetCustomValue(bundle, choiceId, valueId, options?.radiusStyleMap || radiusStyleMap),\n on: [\n {\n id: valueId,\n type: 'input',\n placeholder: 'e.g. 10px',\n rules: [numericalOrPixelRule],\n onChange: (bundle) => appendUnit(bundle, valueId),\n },\n ],\n off: [getBorderRadiusSlider(choiceId, defaultValue)],\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { MultiInputLayout, SettingBlock, appendUnit, numericalOrPixelRule, presetCustomValue } from '../';\nimport { getBorderRadiusSlider } from './borderRadius';\nimport { Radius, radiusStyleMap } from './types';\n\n/**\n * Returns border radius settings: border radius switch, radius slider, custom radius inputs for every corner\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @param options.dependentSettingId Id of setting which the border radius is dependent on\n * @returns {SettingBlock} Returns border settings\n */\n\ntype BorderRadiusSettingsType = {\n id?: string;\n dependentSettingId?: string;\n defaultValue?: Radius;\n};\n\nexport const getExtendedBorderRadiusSettings = (options?: BorderRadiusSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasExtendedCustomRadius_${options.id}` : 'hasExtendedCustomRadius';\n const valueId = options?.id ? `extendedRadiusValue_${options.id}` : 'extendedRadiusValue';\n const choiceId = options?.id ? `extendedRadiusChoice_${options.id}` : 'extendedRadiusChoice';\n const topLeftId = options?.id ? `extendedRadiusTopLeft_${options.id}` : 'extendedRadiusTopLeft';\n const topRightId = options?.id ? `extendedRadiusTopRight_${options.id}` : 'extendedRadiusTopRight';\n const bottomLeftId = options?.id ? `extendedRadiusBottomLeft_${options.id}` : 'extendedRadiusBottomLeft';\n const bottomRightId = options?.id ? `extendedRadiusBottomRight_${options.id}` : 'extendedRadiusBottomRight';\n\n return {\n id: hasId,\n label: 'Corner radius',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'Determining how rounded the corners are.',\n show: (bundle) => (options?.dependentSettingId ? !!bundle.getBlock(options.dependentSettingId)?.value : true),\n onChange: (bundle) => {\n presetCustomValue(bundle, choiceId, topLeftId, radiusStyleMap);\n presetCustomValue(bundle, choiceId, topRightId, radiusStyleMap);\n presetCustomValue(bundle, choiceId, bottomLeftId, radiusStyleMap);\n presetCustomValue(bundle, choiceId, bottomRightId, radiusStyleMap);\n },\n on: [\n {\n id: valueId,\n type: 'multiInput',\n layout: MultiInputLayout.Columns,\n blocks: [\n {\n id: topLeftId,\n type: 'input',\n label: 'Top Left',\n rules: [numericalOrPixelRule],\n onChange: (bundle) => appendUnit(bundle, topLeftId),\n },\n {\n id: topRightId,\n type: 'input',\n label: 'Top Right',\n rules: [numericalOrPixelRule],\n onChange: (bundle) => appendUnit(bundle, topRightId),\n },\n {\n id: bottomLeftId,\n type: 'input',\n label: 'Bottom Left',\n rules: [numericalOrPixelRule],\n onChange: (bundle) => appendUnit(bundle, bottomLeftId),\n },\n {\n id: bottomRightId,\n type: 'input',\n label: 'Bottom Right',\n rules: [numericalOrPixelRule],\n onChange: (bundle) => appendUnit(bundle, bottomRightId),\n },\n ],\n },\n ],\n off: [getBorderRadiusSlider(choiceId, options?.defaultValue)],\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { SettingBlock, appendUnit, numericalOrPixelRule, presetCustomValue } from '../';\nimport { GutterSpacing, gutterSpacingStyleMap } from './types';\n\n/**\n * Returns gutter settings: gutter switch, gutter choices or gutter custom input\n *\n * @param options Options for the settings\n * @param options.id Custom id for the gutters switch\n * @param options.dependentSettingId Id of the dependent setting\n * @param options.spacingChoiceId Id of the spacing choice\n * @param options.defaultValueChoices Default value for the spacing choice\n * @returns {SettingBlock} Returns the gutter settings\n */\n\ntype GutterSettingsType = {\n id?: string;\n dependentSettingId?: string;\n spacingChoiceId?: string;\n spacingCustomId?: string;\n defaultValueChoices?: GutterSpacing;\n};\n\nexport const getGutterSettings = (options?: GutterSettingsType): SettingBlock => {\n const id = options?.id ? options.id : 'hasCustomSpacing';\n const dependentSettingId = options?.dependentSettingId ? options.dependentSettingId : 'columns';\n const spacingChoiceId = options?.spacingChoiceId ? options.spacingChoiceId : 'spacingChoice';\n const spacingCustomId = options?.spacingCustomId ? options.spacingCustomId : 'spacingCustom';\n const defaultValueChoices = options?.defaultValueChoices ? options.defaultValueChoices : GutterSpacing.M;\n\n return {\n id,\n type: 'switch',\n defaultValue: false,\n switchLabel: 'Custom',\n label: 'Gutter',\n info: 'An official nerds term for ‘gap’',\n onChange: (bundle) => presetCustomValue(bundle, spacingChoiceId, spacingCustomId, gutterSpacingStyleMap),\n show: (bundle) => bundle.getBlock(dependentSettingId)?.value !== '1',\n on: [\n {\n id: spacingCustomId,\n type: 'input',\n rules: [numericalOrPixelRule],\n onChange: (bundle) => appendUnit(bundle, spacingCustomId),\n },\n ],\n off: [\n {\n id: spacingChoiceId,\n type: 'slider',\n defaultValue: defaultValueChoices,\n choices: [\n {\n value: GutterSpacing.Auto,\n label: 'Auto',\n },\n {\n value: GutterSpacing.S,\n label: 'S',\n },\n {\n value: GutterSpacing.M,\n label: 'M',\n },\n {\n value: GutterSpacing.L,\n label: 'L',\n },\n ],\n },\n ],\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\nimport { MARGIN_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { Margin, marginStyleMap } from './types';\n\ntype MarginSettingsType = {\n id?: string;\n marginStyleMap?: Record<Margin, string>;\n};\n\n/**\n * Returns margin settings: margin switch, margin slider, custom margin input\n *\n * @param {string} id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns margin settings\n */\nexport const getMarginSlider = (id: string): SettingBlock => ({\n id,\n type: 'segmentedControls',\n defaultValue: Margin.None,\n choices: [\n {\n value: Margin.None,\n label: 'None',\n },\n {\n value: Margin.Small,\n label: 'S',\n },\n {\n value: Margin.Medium,\n label: 'M',\n },\n {\n value: Margin.Large,\n label: 'L',\n },\n ],\n});\n\nexport const getMarginSettings = (options?: MarginSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasCustomMarginValue_${options?.id}` : 'hasCustomMarginValue';\n const valueId = options?.id ? `marginValue_${options?.id}` : 'marginValue';\n const choiceId = options?.id ? `marginChoice_${options?.id}` : 'marginChoice';\n\n return {\n id: hasId,\n label: 'Margin',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more space',\n onChange: (bundle) => presetCustomValue(bundle, choiceId, valueId, options?.marginStyleMap || marginStyleMap),\n on: [\n {\n id: valueId,\n type: 'input',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n onChange: (bundle) => appendUnit(bundle, valueId),\n },\n ],\n off: [getMarginSlider(choiceId)],\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MultiInputLayout,\n SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\nimport { MARGIN_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { getMarginSlider } from './margin';\nimport { marginStyleMap } from './types';\n\ntype MarginSettingsType = {\n id?: string;\n};\n\n/**\n * Returns margin settings: margin switch, margin slider, custom margin input for every direction\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns margin settings\n */\nexport const getMarginExtendedSettings = (options?: MarginSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasExtendedCustomMargin_${options?.id}` : 'hasExtendedCustomMargin';\n const valueId = options?.id ? `extendedMarginValues_${options?.id}` : 'extendedMarginValues';\n const choiceId = options?.id ? `extendedMarginChoice_${options?.id}` : 'extendedMarginChoice';\n const topId = options?.id ? `extendedMarginTop_${options?.id}` : 'extendedMarginTop';\n const leftId = options?.id ? `extendedMarginLeft_${options?.id}` : 'extendedMarginLeft';\n const rightId = options?.id ? `extendedMarginRight_${options?.id}` : 'extendedMarginRight';\n const bottomId = options?.id ? `extendedMarginBottom_${options?.id}` : 'extendedMarginBottom';\n\n return {\n id: hasId,\n label: 'Margin',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => {\n presetCustomValue(bundle, choiceId, topId, marginStyleMap);\n presetCustomValue(bundle, choiceId, leftId, marginStyleMap);\n presetCustomValue(bundle, choiceId, rightId, marginStyleMap);\n presetCustomValue(bundle, choiceId, bottomId, marginStyleMap);\n },\n on: [\n {\n id: valueId,\n type: 'multiInput',\n layout: MultiInputLayout.Spider,\n blocks: [\n {\n id: topId,\n type: 'input',\n label: 'Top',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, topId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: leftId,\n type: 'input',\n label: 'Left',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, leftId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: rightId,\n type: 'input',\n label: 'Right',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, rightId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: bottomId,\n type: 'input',\n label: 'Bottom',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, bottomId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n ],\n },\n ],\n off: [getMarginSlider(choiceId)],\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\nimport { PADDING_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { Padding, paddingStyleMap } from './types';\n\ntype PaddingSettingsType = {\n id?: string;\n paddingStyleMap?: Record<Padding, string>;\n};\n\n/**\n * Returns padding settings: padding switch, padding slider, custom padding input\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns padding settings\n */\nexport const getPaddingSlider = (id: string): SettingBlock => ({\n id,\n type: 'segmentedControls',\n defaultValue: Padding.Small,\n choices: [\n {\n value: Padding.None,\n label: 'None',\n },\n {\n value: Padding.Small,\n label: 'S',\n },\n {\n value: Padding.Medium,\n label: 'M',\n },\n {\n value: Padding.Large,\n label: 'L',\n },\n ],\n});\n\nexport const getPaddingSettings = (options?: PaddingSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasCustomPaddingValue_${options?.id}` : 'hasCustomPaddingValue';\n const valueId = options?.id ? `paddingValue_${options?.id}` : 'paddingValue';\n const choiceId = options?.id ? `paddingChoice_${options?.id}` : 'paddingChoice';\n\n return {\n id: hasId,\n label: 'Padding',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => presetCustomValue(bundle, choiceId, valueId, options?.paddingStyleMap || paddingStyleMap),\n on: [\n {\n id: valueId,\n type: 'input',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n onChange: (bundle) => appendUnit(bundle, valueId),\n },\n ],\n off: [getPaddingSlider(choiceId)],\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MultiInputLayout,\n SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\nimport { PADDING_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { getPaddingSlider } from './padding';\nimport { paddingStyleMap } from './types';\n\ntype PaddingSettingsType = {\n id?: string;\n};\n\n/**\n * Returns padding settings: padding switch, padding slider, custom padding input for every direction\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns padding settings\n */\nexport const getPaddingExtendedSettings = (options?: PaddingSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasExtendedCustomPadding_${options?.id}` : 'hasExtendedCustomPadding';\n const valueId = options?.id ? `extendedPaddingValues_${options?.id}` : 'extendedPaddingValues';\n const choiceId = options?.id ? `extendedPaddingChoice_${options?.id}` : 'extendedPaddingChoice';\n const topId = options?.id ? `extendedPaddingTop_${options?.id}` : 'extendedPaddingTop';\n const leftId = options?.id ? `extendedPaddingLeft_${options?.id}` : 'extendedPaddingLeft';\n const rightId = options?.id ? `extendedPaddingRight_${options?.id}` : 'extendedPaddingRight';\n const bottomId = options?.id ? `extendedPaddingBottom_${options?.id}` : 'extendedPaddingBottom';\n\n return {\n id: hasId,\n label: 'Padding',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => {\n presetCustomValue(bundle, choiceId, topId, paddingStyleMap);\n presetCustomValue(bundle, choiceId, leftId, paddingStyleMap);\n presetCustomValue(bundle, choiceId, rightId, paddingStyleMap);\n presetCustomValue(bundle, choiceId, bottomId, paddingStyleMap);\n },\n on: [\n {\n id: valueId,\n type: 'multiInput',\n layout: MultiInputLayout.Spider,\n blocks: [\n {\n id: topId,\n type: 'input',\n label: 'Top',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, topId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: leftId,\n type: 'input',\n label: 'Left',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, leftId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: rightId,\n type: 'input',\n label: 'Right',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, rightId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: bottomId,\n type: 'input',\n label: 'Bottom',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, bottomId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n ],\n },\n ],\n off: [getPaddingSlider(choiceId)],\n };\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { SettingBlock } from '..';\nimport { Security } from './types';\n\n/**\n * Returns the downloadable security settings.\n *\n * @param {string} id custom id for the setting block\n * @param {string} globalControlId custom id for the global control setting block\n *\n * @returns {SettingBlock} Returns downloadable security settings.\n */\n\ntype SecurityDownloadableSettingType = {\n id?: string;\n globalControlId?: string;\n};\n\nexport const getSecurityDownloadableSetting = (options?: SecurityDownloadableSettingType): SettingBlock => {\n const securityId = getSecurityGlobalControlId(options?.globalControlId);\n return {\n id: options?.id ? options.id : 'downloadable',\n type: 'switch',\n defaultValue: false,\n label: 'Downloadable',\n show: (bundle) => bundle.getBlock(securityId)?.value === Security.Custom,\n };\n};\n\nexport const getSecurityGlobalControlId = (id?: string): string => {\n return id || 'security';\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { SettingBlock, createFooter } from '..';\nimport { Security } from './types';\nimport { getSecurityGlobalControlId } from './securityDownloadable';\n\n/**\n * Returns segment controls for global security settings.\n *\n * @param {string} id custom id for the setting block\n *\n * @returns {SettingBlock} Returns\n */\n\nexport const getSecurityGlobalControlSetting = (id?: string): SettingBlock[] => {\n const securityId = getSecurityGlobalControlId(id);\n return [\n {\n id: securityId,\n type: 'segmentedControls',\n defaultValue: Security.Global,\n choices: [\n {\n value: Security.Global,\n label: 'Global Settings',\n },\n {\n value: Security.Custom,\n label: 'Custom',\n },\n ],\n },\n {\n id: 'globalSettingsInfo',\n type: 'notification',\n footer: createFooter({\n label: 'Change global settings [here].',\n replace: { here: { event: 'general-settings.open' } },\n }),\n },\n ];\n};\n","/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport './styles.css';\n\nimport type { FC } from 'react';\nimport type { AppBridgeBlock } from '@frontify/app-bridge';\nimport type {\n AssetInputBlock as AssetInputBlockSidebarSettings,\n BaseBlock as BaseBlockSidebarSettings,\n Bundle as BundleSidebarSettings,\n ChecklistBlock as ChecklistBlockSidebarSettings,\n ChoicesType as ChoicesTypeSidebarSettings,\n ColorInputBlock as ColorInputBlockSidebarSettings,\n DropdownBlock as DropdownBlockSidebarSettings,\n DynamicSettingBlock as DynamicSettingBlockSidebarSettings,\n DynamicSupportedBlock as DynamicSupportedBlockSidebarSettings,\n FontInputBlock as FontInputBlockSidebarSettings,\n InputBlock as InputBlockSidebarSettings,\n LegacyAssetInputBlock as LegacyAssetInputBlockSidebarSettings,\n LinkChooserBlock as LinkChooserBlockSidebarSettings,\n MultiInputBlock as MultiInputBlockSidebarSettings,\n NotificationBlock as NotificationBlockSidebarSettings,\n SectionHeadingBlock as SectionHeadingBlockSidebarSettings,\n SegmentedControlsBlock as SegmentedControlsBlockSidebarSettings,\n SettingBlock as SettingBlockSidebarSettings,\n SimpleSettingBlock as SimpleSettingBlockSidebarSettings,\n SwitchBlock as SwitchBlockSidebarSettings,\n TemplateInputBlock as TemplateInputBlockSidebarSettings,\n TextareaBlock as TextareaBlockSidebarSettings,\n ValueOrPromisedValue as ValueOrPromisedValueSidebarSettings,\n} from '@frontify/sidebar-settings';\n\nexport * from '@frontify/sidebar-settings';\n\nexport type AssetInputBlock = AssetInputBlockSidebarSettings<AppBridgeBlock>;\nexport type BaseBlock<T = undefined> = BaseBlockSidebarSettings<AppBridgeBlock, T>;\nexport type Bundle = BundleSidebarSettings<AppBridgeBlock>;\nexport type ChecklistBlock = ChecklistBlockSidebarSettings<AppBridgeBlock>;\nexport type ChoicesType = ChoicesTypeSidebarSettings<AppBridgeBlock>;\nexport type ColorInputBlock = ColorInputBlockSidebarSettings<AppBridgeBlock>;\nexport type DropdownBlock = DropdownBlockSidebarSettings<AppBridgeBlock>;\nexport type DynamicSettingBlock<Block extends DynamicSupportedBlock = DynamicSupportedBlock> =\n DynamicSettingBlockSidebarSettings<AppBridgeBlock, Block>;\nexport type DynamicSupportedBlock = DynamicSupportedBlockSidebarSettings<AppBridgeBlock>;\nexport type FontInputBlock = FontInputBlockSidebarSettings<AppBridgeBlock>;\nexport type InputBlock = InputBlockSidebarSettings<AppBridgeBlock>;\nexport type LegacyAssetInputBlock = LegacyAssetInputBlockSidebarSettings<AppBridgeBlock>;\nexport type LinkChooserBlock = LinkChooserBlockSidebarSettings<AppBridgeBlock>;\nexport type MultiInputBlock = MultiInputBlockSidebarSettings<AppBridgeBlock>;\nexport type NotificationBlock = NotificationBlockSidebarSettings<AppBridgeBlock>;\nexport type SectionHeadingBlock = SectionHeadingBlockSidebarSettings<AppBridgeBlock>;\nexport type SegmentedControlsBlock = SegmentedControlsBlockSidebarSettings<AppBridgeBlock>;\nexport type SettingBlock = SettingBlockSidebarSettings<AppBridgeBlock>;\nexport type SimpleSettingBlock = SimpleSettingBlockSidebarSettings<AppBridgeBlock>;\nexport type SwitchBlock = SwitchBlockSidebarSettings<AppBridgeBlock>;\nexport type TemplateInputBlock = TemplateInputBlockSidebarSettings<AppBridgeBlock>;\nexport type TextareaBlock = TextareaBlockSidebarSettings<AppBridgeBlock>;\nexport type ValueOrPromisedValue<T> = ValueOrPromisedValueSidebarSettings<AppBridgeBlock, T>;\n\nexport enum Sections {\n Main = 'main',\n Basics = 'basics',\n Layout = 'layout',\n Style = 'style',\n Security = 'security',\n Targets = 'targets',\n}\n\nexport type BlockSettingsStructureExport = {\n [Sections.Main]?: SettingBlock[];\n [Sections.Basics]?: SettingBlock[];\n [Sections.Layout]?: SettingBlock[];\n [Sections.Style]?: SettingBlock[];\n [Sections.Security]?: SettingBlock[];\n} & { [customSectionName: string]: SettingBlock[] };\n\nexport type BlockProps = {\n /**\n * The Frontify App Bridge provides an interface to the Frontify app internals.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/content-blocks/introducing-the-app-bridge}\n */\n appBridge: AppBridgeBlock;\n};\n\nexport type BlockConfigExport = {\n /**\n * Block component to render.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/content-blocks}\n */\n block: FC<BlockProps>;\n /**\n * Contains the block settings and its structure.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/block-settings-1}\n */\n settings: ReturnType<typeof defineSettings>;\n /**\n * Block lifecycle hook ran before the block gets added in the Guideline.\n * The hook support both synchronous or asynchronous execution.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/block-lifecycle/on-block-creation}\n */\n onBlockCreated?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\n /**\n * Block lifecycle hook ran before the block gets deleted from the Guideline.\n * The hook support both synchronous or asynchronous execution.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/block-lifecycle/on-block-deletion}\n */\n onBlockDeleted?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\n};\n\n/**\n * Type helper to make it easier to export a theme, accepts a direct {@link BlockConfigExport} object.\n */\nexport const defineBlock = (config: BlockConfigExport): BlockConfigExport => config;\n\n/**\n * Type helper to make it easier to export block's settings structure, accepts a direct {@link BlockSettingsStructureExport} object\n * or a function return a direct {@link BlockSettingsStructureExport} or a function returning a Promise of {@link BlockSettingsStructureExport}.\n */\nexport const defineSettings = <\n T extends\n | BlockSettingsStructureExport\n | (() => Promise<BlockSettingsStructureExport>)\n | (() => BlockSettingsStructureExport),\n>(\n settingsStructure: T,\n): T => settingsStructure;\n\nexport * from './components';\nexport * from './helpers';\nexport * from './hooks';\nexport * from './settings';\nexport * from './utilities';\n"],"names":["f","require$$0","k","l","m","n","p","q","c","a","g","b","d","e","h","reactJsxRuntime_production_min","React","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_OFFSCREEN_TYPE","MAYBE_ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","getIteratorFn","maybeIterable","maybeIterator","ReactSharedInternals","error","format","_len2","args","_key2","printWarning","level","ReactDebugCurrentFrame","stack","argsWithFormat","item","enableScopeAPI","enableCacheElement","enableTransitionTracing","enableLegacyHidden","enableDebugTracing","REACT_MODULE_REFERENCE","isValidElementType","type","getWrappedName","outerType","innerType","wrapperName","displayName","functionName","getContextName","getComponentNameFromType","context","provider","outerName","lazyComponent","payload","init","assign","disabledDepth","prevLog","prevInfo","prevWarn","prevError","prevGroup","prevGroupCollapsed","prevGroupEnd","disabledLog","disableLogs","props","reenableLogs","ReactCurrentDispatcher","prefix","describeBuiltInComponentFrame","name","source","ownerFn","x","match","reentry","componentFrameCache","PossiblyWeakMap","describeNativeComponentFrame","fn","construct","frame","control","previousPrepareStackTrace","previousDispatcher","Fake","sample","sampleLines","controlLines","s","_frame","syntheticFrame","describeFunctionComponentFrame","shouldConstruct","Component","prototype","describeUnknownElementTypeFrameInDEV","hasOwnProperty","loggedTypeFailures","setCurrentlyValidatingElement","element","owner","checkPropTypes","typeSpecs","values","location","componentName","has","typeSpecName","error$1","err","ex","isArrayImpl","isArray","typeName","value","hasToStringTag","willCoercionThrow","testStringCoercion","checkKeyStringCoercion","ReactCurrentOwner","RESERVED_PROPS","specialPropKeyWarningShown","specialPropRefWarningShown","didWarnAboutStringRefs","hasValidRef","config","getter","hasValidKey","warnIfStringRefCannotBeAutoConverted","self","defineKeyPropWarningGetter","warnAboutAccessingKey","defineRefPropWarningGetter","warnAboutAccessingRef","ReactElement","key","ref","jsxDEV","maybeKey","propName","defaultProps","ReactCurrentOwner$1","ReactDebugCurrentFrame$1","setCurrentlyValidatingElement$1","propTypesMisspellWarningShown","isValidElement","object","getDeclarationErrorAddendum","getSourceInfoErrorAddendum","fileName","lineNumber","ownerHasKeyUseWarning","getCurrentComponentErrorInfo","parentType","info","parentName","validateExplicitKey","currentComponentErrorInfo","childOwner","validateChildKeys","node","i","child","iteratorFn","iterator","step","validatePropTypes","propTypes","_name","validateFragmentProps","fragment","keys","jsxWithValidation","isStaticChildren","validType","sourceInfo","typeString","children","jsxWithValidationStatic","jsxWithValidationDynamic","jsx","jsxs","reactJsxRuntime_development","jsxRuntimeModule","require$$1","joinClassNames","classNames","BlockInjectButton","onDrop","label","icon","secondaryLabel","isLoading","fillParentContainer","onAssetChooseClick","onUploadClick","withMenu","onClick","validFileType","verticalLayout","isDraggingOver","setIsDraggingOver","useState","menuPosition","setMenuPosition","buttonRef","useRef","errorMsg","setErrorMsg","handleDrop","event","isValidAsset","files","droppedFileExtension","FileExtensionSets","openMenu","left","top","XInsideComponent","YInsideComponent","_a","LoadingCircle","IconExclamationMarkTriangle","Fragment","Flyout","isOpen","ActionMenu","MenuItemContentSize","IconArrowCircleUp20","IconImageStack20","toShortRgba","color","isRgbaLongFormat","mapToShortFormat","alpha","isDark","threshold","inputColor","parsedColor","tinycolor","toHex8String","toHexString","toRgbaString","setAlpha","toColorObject","colorString","r","getReadableColor","textColor","backgroundColor","inputTextColor","inputBackgroundColor","parsedTextColor","parsedBackgroundColor","readability","moveItemInArray","array","from","to","newArray","toIndex","slice","getBackgroundColorStyles","BorderStyle","borderStyleMap","Radius","radiusStyleMap","Padding","paddingStyleMap","Margin","marginStyleMap","Security","GutterSpacing","gutterSpacingStyleMap","BACKGROUND_COLOR_DEFAULT_VALUE","BORDER_COLOR_DEFAULT_VALUE","BORDER_WIDTH_DEFAULT_VALUE","PADDING_DEFAULT_PLACEHOLDER","MARGIN_DEFAULT_PLACEHOLDER","getBorderStyles","style","borderWidth","getRadiusStyles","radiusChoice","hasRadius","radiusValue","DEFAULT_DRAG_TOOLTIP","DEFAULT_DRAGGING_TOOLTIP","Toolbar","items","flyoutItems","isFlyoutOpen","setIsFlyoutOpen","isDragging","isFlyoutDisabled","Tooltip","TooltipPosition","IconDotsHorizontal16","block","blockIndex","itemIndex","BlockItemWrapper","toolbarFlyoutItems","toolbarItems","shouldHideWrapper","shouldHideComponent","shouldFillContainer","outlineOffset","shouldBeShown","setIsFlyoutDisabled","wrapperRef","useEffect","getDecorator","IconImage24","IconPlayFrame24","IconMusicNote24","IconDocument24","AttachmentItem","forwardRef","isEditing","draggableProps","transformStyle","isOverlay","onDelete","onReplaceWithBrowse","onReplaceWithUpload","selectedAsset","setSelectedAsset","openFileDialog","selectedFiles","useFileInput","uploadFile","uploadResults","doneAll","useAssetUpload","focusProps","isFocusVisible","useFocusRing","download","url","filename","response","blob","showLoadingCircle","LoadingCircleSize","FOCUS_STYLE","IconGrabHandle20","FlyoutPlacement","_","Button","IconPen20","ButtonEmphasis","MenuItemStyle","IconTrashBin20","SortableAttachmentItem","attributes","listeners","setNodeRef","transform","transition","useSortable","Attachments","onBrowse","onUpload","onSorted","appBridge","internalItems","setInternalItems","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","draggedAssetId","setDraggedAssetId","isUploadLoading","setIsUploadLoading","assetIdsLoading","setAssetIdsLoading","setSelectedFiles","useEditorState","draggedItem","onOpenAssetChooser","result","internalItem","onReplaceItemWithBrowse","toReplace","id","onReplaceItemWithUpload","uploadedAsset","handleDragStart","active","handleDragEnd","over","oldIndex","newIndex","sortedItems","arrayMove","IconPaperclip16","IconCaretDown12","DndContext","closestCenter","restrictToWindowEdges","SortableContext","rectSortingStrategy","DragOverlay","AssetInput","AssetInputSize","fileList","DownloadButton","onDownload","isFocused","IconArrowCircleDown16","useFloatingLinkInsert","floatingOptions","editor","useEditorRef","focused","useFocused","mode","useFloatingLinkSelectors","open","triggerFloatingLinkHotkeys","getPluginOptions","ELEMENT_LINK","useHotkeys","triggerFloatingLinkInsert","update","floating","useVirtualFloatingLink","getSelectionBoundingClientRect","floatingLinkActions","useFloatingLinkEscape","useComposedRef","FloatingLinkInsertRoot","createComponentAs","htmlProps","createElementAs","FloatingLinkEditRoot","useFloatingLinkEdit","PlateFloatingLink","FloatingLink","LINK_PLUGIN","hasRichTextValue","string","hasText","json","convertToRteValue","textStyle","text","align","directions","KeyboardCode","customCoordinatesGetterFactory","columnGap","rowGap","currentCoordinates","activeNode","width","height","isDownloadable","security","downloadable","globalAssetDownloadEnabled","mapAppBridgeColorPalettesToFonduePalettes","colorPalettes","mapAppBridgeColorPaletteToFonduePalette","colorPalette","getLinkNode","cb","linkNode","getAboveNode","getLegacyUrl","link","_b","getUrl","getUrlFromLinkOrLegacyLink","getUrlFromEditor","relativeUrlRegex","addHttps","isValidUrl","parsedUrl","isValidUrlOrEmpty","ELEMENT_BUTTON","createButtonNode","buttonStyle","target","getPluginType","floatingButtonStore","createStore","set","editorId","state","floatingButtonActions","floatingButtonSelectors","useFloatingButtonSelectors","triggerFloatingButtonEdit","entry","findNode","path","getEditorString","useFloatingButtonEdit","keyEditor","usePlateSelectors","triggerFloatingButtonHotkeys","getBoundingClientRect","useCallback","getRangeBoundingClientRect","getStartPoint","getEndPoint","getDefaultBoundingClientRect","useVirtualFloatingButton","someNode","useFloatingButtonEnter","useFloatingButtonEscape","triggerFloatingButtonInsert","isRangeAcrossBlocks","useFloatingButtonInsert","useFloatingButtonEditButton","FloatingButtonEditButton","insertButton","createButtonNodeOptions","options","insertNodes","submitFloatingButton","isUrl","forceSubmit","upsertButton","_url","focusEditor","unwrapButton","withoutNormalizing","splitNodes","isElement","_c","_d","_e","_f","unwrapNodes","insertTextInButton","insertNodesOptions","at","buttonAbove","isDefined","editButtonUrlAndTarget","buttonEntry","buttonNode","buttonPath","shouldReplaceText","shouldReplaceButtonText","isExpanded","anchorAndFocusInButton","removeNodes","getNodeProps","leaf","getNodeLeaf","wrapButton","upsertButtonText","setNodes","newButton","newButtonNode","newButtonPath","firstText","replaceNodeChildren","wrapNodes","useUnlinkButton","UnlinkButton","FloatingButtonEditRoot","FloatingButtonInsertRoot","FloatingButton","useFloatingButtonUrlInput","updated","onChange","mergeProps","OFFSET_Y","OFFSET_X","PADDING","useVirtualFloating","offset","flip","triggerFloatingButton","BlockButtonStyles","useButton","useElementProps","ButtonMarkupElementNode","href","HoverableButtonLink","styles","hovered","setHovered","ButtonMarkupElement","MarkupElement","ButtonToolbarButton","isEnabled","isRangeInSameBlock","isLink","ToolbarButton","getTooltip","getHotkeyByPlatform","getButtonClassNames","ButtonButton","IconButton16","buttonStyles","EditModal","urlHtmlProps","BlockStyles","IconPen16","IconTrashBin16","SectionLink","section","selectedUrl","onSelectUrl","isActive","merge","IconDocumentText16","PageLink","page","itemsToExpandInitially","setIsExpanded","documentSections","useDocumentSection","sectionsArray","hasSections","PageLinks","documentId","pages","setPages","setIsLoading","pagesArray","hasPages","_pages","DocumentLink","document","IconColorFan16","DocumentLinks","documents","setDocuments","setItemsToExpandInitially","documentArray","findLocationOfSelectedUrl","_documents","itemsToExpand","LinkSelector","onUrlChange","openLinkTree","isLinkTreeOpen","closeLinkTree","useOverlayTriggerState","setSelectedUrl","onPressEnter","saveLink","IconLink","ButtonSize","ButtonType","ButtonStyle","Modal","InsertModal","onTextChange","onToggleTab","onCancel","onSave","hasValues","testId","FormControl","TextInput","Checkbox","IconCheckMark20","getButtonStyle","initialState","CheckboxState","InsertModalState","dispatch","useReducer","action","useInsertModal","onButtonStyleChange","checked","urlToSave","InsertButtonModal","modalProps","HoverableButton","getStyles","CustomFloatingButton","input","editContent","withButton","apply","normalizeNode","operation","range","isCollapsed","newPoint","isStartPoint","getPreviousNodeEndPoint","isEndPoint","getNextNodeStartPoint","nextPoint","select","nextPath","Path","withRemoveEmptyNodes","mockPlugin","BUTTON_PLUGIN","createButtonPlugin","createPluginFactory","el","ButtonPlugin","Plugin","TextStyles","useFloatingLinkUrlInput","floatingLinkSelectors","triggerFloatingLinkEdit","useFloatingLinkEnter","legacyUrl","submitFloatingLink","InsertLinkModal","CustomFloatingLink","readOnly","LinkButton","usePlateEditorState","useEventPlateId","LinkToolbarButton","IconSize","useLink","LinkMarkupElementNode","LinkMarkupElement","createLinkPlugin","createPlateLinkPlugin","LinkPlugin","ID","Custom1Plugin","Custom1MarkupElement","createCustom1Plugin","Custom1MarkupElementNode","alignmentClassnames","getColumnBreakClasses","Custom2Plugin","Custom2MarkupElement","createCustom2Plugin","Custom2MarkupElementNode","Custom3Plugin","Custom3MarkupElement","createCustom3Plugin","Custom3MarkupElementNode","Heading1Plugin","Heading1MarkupElement","createHeading1Plugin","Heading1MarkupElementNode","Heading2Plugin","Heading2MarkupElement","createHeading2Plugin","Heading2MarkupElementNode","Heading3Plugin","Heading3MarkupElement","createHeading3Plugin","Heading3MarkupElementNode","Heading4Plugin","Heading4MarkupElement","createHeading4Plugin","Heading4MarkupElementNode","ImageCaptionPlugin","ImageCaptionMarkupElement","createImageCaptionPlugin","ImageCaptionMarkupElementNode","ImageTitlePlugin","ImageTitleMarkupElement","createImageTitlePlugin","ImageTitleMarkupElementNode","ParagraphPlugin","ParagraphMarkupElement","createParagraphPlugin","PARAGRAPH_CLASSES","ParagraphMarkupElementNode","className","createPlateParagraphPlugin","QuotePlugin","QuoteMarkupElement","createQuotePlugin","QuoteMarkupElementNode","TextStylePluginsWithoutImage","TextStylesWithoutImage","AllTextStylePlugins","AllTextStyles","serializeLeafToHtml","escapeHtml","bold","italic","underline","strikethrough","code","subscript","superscript","BOLD_CLASSES","ITALIC_CLASSES","UNDERLINE_CLASSES","STRIKETHROUGH_CLASSES","CODE_CLASSES","reactCssPropsToCss","acc","convertCamelCaseToKebabCase","str","defaultClassNames","buttonTypeString","buttonType","defaultStyles","chosenLink","defaultNode","getStyledChild","checkItemNode","mentionHtmlNode","mentionable","div","ReactDOM","MentionMarkupElementNode","countNodesOfType","nodes","serializeNodeToHtmlRecursive","mappedMentionable","nestingCount","isText","rootNestingCount","htmlMapper","MapNodeTypesToHtml","getClassNames","ELEMENT_UL","UL_CLASSES","ELEMENT_OL","nestingLevel","getOrderedListClasses","OL_STYLES","ELEMENT_LI","LI_CLASSNAMES","getLiStyles","ELEMENT_LIC","getLicElementClassNames","ELEMENT_CHECK_ITEM","ELEMENT_MENTION","breakAfterColumn","breakWordsClass","columnBreakClasses","alignClass","serializeRawToHtmlAsync","raw","columns","plugins","PluginComposer","parseRawValue","serializeNodesToHtml","mapMentionable","html","len","isEmptyNode","SerializedText","gap","show","setHtml","RichTextEditor","placeholder","showSerializedText","shouldPreventPageLeave","setShouldPreventPageLeave","saveText","newContent","unloadHandler","FondueRichTextEditor","getDefaultPluginsWithLinkChooser","SoftBreakPlugin","TextStylePlugin","BoldPlugin","ItalicPlugin","UnderlinePlugin","StrikethroughPlugin","CodePlugin","AlignLeftPlugin","AlignCenterPlugin","AlignRightPlugin","AlignJustifyPlugin","UnorderedListPlugin","CheckboxListPlugin","OrderedListPlugin","ResetFormattingPlugin","THEME_PREFIX","useAttachments","assetId","blockAssets","updateAssetIdsFromKey","useBlockAssets","attachments","newAssets","newAssetIds","attachment","asset","assetToDelete","attachmentToReplace","newAsset","assets","keyboardCodes","useDndSensors","customCoordinatesGetter","getBackgroundSettings","hasId","colorId","defaultColor","switchLabel","getBorderSettings","selectionId","styleId","widthId","bundle","appendUnit","MultiInputLayout","numericalOrPixelRule","maximumNumericalOrPixelOrAutoRule","getBorderRadiusSlider","defaultValue","getBorderRadiusSettings","valueId","choiceId","presetCustomValue","getExtendedBorderRadiusSettings","topLeftId","topRightId","bottomLeftId","bottomRightId","getGutterSettings","dependentSettingId","spacingChoiceId","spacingCustomId","defaultValueChoices","getMarginSlider","getMarginSettings","getMarginExtendedSettings","topId","leftId","rightId","bottomId","getPaddingSlider","getPaddingSettings","getPaddingExtendedSettings","getSecurityDownloadableSetting","securityId","getSecurityGlobalControlId","getSecurityGlobalControlSetting","createFooter","Sections","defineBlock","defineSettings","settingsStructure"],"mappings":";;;;;;;;6CASa,IAAIA,EAAEC,EAA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