@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,178 @@
1
+ import "./styles.css.es.js";
2
+ export * from "@frontify/sidebar-settings";
3
+ import { BlockInjectButton as i } from "./components/BlockInjectButton/BlockInjectButton.es.js";
4
+ import { BlockItemWrapper as l } from "./components/BlockItemWrapper/BlockItemWrapper.es.js";
5
+ import { DEFAULT_DRAGGING_TOOLTIP as u, DEFAULT_DRAG_TOOLTIP as f } from "./components/BlockItemWrapper/constants.es.js";
6
+ import { Attachments as s } from "./components/Attachments/Attachments.es.js";
7
+ import { DownloadButton as P } from "./components/DownloadButton/DownloadButton.es.js";
8
+ import { RichTextEditor as c } from "./components/RichTextEditor/RichTextEditor.es.js";
9
+ import { LinkPlugin as T, createLinkPlugin as E } from "./components/RichTextEditor/plugins/LinkPlugin/index.es.js";
10
+ import { BUTTON_PLUGIN as A, ButtonPlugin as R, ELEMENT_BUTTON as C, createButtonPlugin as I } from "./components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js";
11
+ import { withButton as k } from "./components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js";
12
+ import { insertButton as F } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js";
13
+ import { submitFloatingButton as L } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js";
14
+ import { unwrapButton as H } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js";
15
+ import { upsertButton as _ } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js";
16
+ import { upsertButtonText as w } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js";
17
+ import { wrapButton as W } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js";
18
+ import { getUrlFromEditor as v } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js";
19
+ import { createButtonNode as V } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js";
20
+ import { triggerFloatingButton as q } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js";
21
+ import { triggerFloatingButtonEdit as J } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js";
22
+ import { triggerFloatingButtonInsert as Y } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js";
23
+ import { BlockButtonStyles as $ } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js";
24
+ import { Custom1Plugin as rt } from "./components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js";
25
+ import { Custom2Plugin as ot } from "./components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js";
26
+ import { Custom3Plugin as pt } from "./components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js";
27
+ import { Heading1Plugin as gt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js";
28
+ import { Heading2Plugin as mt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js";
29
+ import { Heading3Plugin as xt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js";
30
+ import { Heading4Plugin as ft } from "./components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js";
31
+ import { ImageCaptionPlugin as st } from "./components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js";
32
+ import { ImageTitlePlugin as Pt } from "./components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js";
33
+ import { PARAGRAPH_CLASSES as ct, ParagraphMarkupElement as yt, ParagraphMarkupElementNode as Tt, ParagraphPlugin as Et, createParagraphPlugin as ht } from "./components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js";
34
+ import { QuoteMarkupElementNode as Rt, QuotePlugin as Ct, createQuotePlugin as It } from "./components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js";
35
+ import { AllTextStylePlugins as kt, AllTextStyles as bt, TextStylePluginsWithoutImage as Ft, TextStylesWithoutImage as Gt } from "./components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js";
36
+ import { BlockStyles as Dt, TextStyles as Ht } from "./components/RichTextEditor/plugins/styles.es.js";
37
+ import { getDefaultPluginsWithLinkChooser as _t } from "./components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js";
38
+ import { THEME_PREFIX as wt } from "./components/RichTextEditor/constants.es.js";
39
+ import { convertToRteValue as Wt } from "./helpers/convertToRichTextValue.es.js";
40
+ import { customCoordinatesGetterFactory as vt } from "./helpers/customCoordinatesGetterFactory.es.js";
41
+ import { hasRichTextValue as Vt } from "./helpers/hasRichTextValue.es.js";
42
+ import { isDownloadable as qt } from "./helpers/isDownloadable.es.js";
43
+ import { mapAppBridgeColorPaletteToFonduePalette as Jt, mapAppBridgeColorPalettesToFonduePalettes as Kt } from "./helpers/mapColorPalettes.es.js";
44
+ import { addHttps as Zt } from "./helpers/addHttps.es.js";
45
+ import { useAttachments as tr } from "./hooks/useAttachments.es.js";
46
+ import { useDndSensors as er } from "./hooks/useDndSensors.es.js";
47
+ import { getBackgroundSettings as nr } from "./settings/background.es.js";
48
+ import { getBorderSettings as ar } from "./settings/border.es.js";
49
+ import { getBorderRadiusSettings as ir, getBorderRadiusSlider as mr } from "./settings/borderRadius.es.js";
50
+ import { getExtendedBorderRadiusSettings as xr } from "./settings/borderRadiusExtended.es.js";
51
+ import { getGutterSettings as fr } from "./settings/gutter.es.js";
52
+ import { getMarginSettings as sr, getMarginSlider as Sr } from "./settings/margin.es.js";
53
+ import { getMarginExtendedSettings as Br } from "./settings/marginExtended.es.js";
54
+ import { getPaddingSettings as yr, getPaddingSlider as Tr } from "./settings/padding.es.js";
55
+ import { getPaddingExtendedSettings as hr } from "./settings/paddingExtended.es.js";
56
+ import { BorderStyle as Rr, GutterSpacing as Cr, Margin as Ir, Padding as Mr, Radius as kr, Security as br, borderStyleMap as Fr, gutterSpacingStyleMap as Gr, marginStyleMap as Lr, paddingStyleMap as Dr, radiusStyleMap as Hr } from "./settings/types.es.js";
57
+ import { getSecurityDownloadableSetting as _r, getSecurityGlobalControlId as Or } from "./settings/securityDownloadable.es.js";
58
+ import { getSecurityGlobalControlSetting as Ur } from "./settings/securityGlobalControl.es.js";
59
+ import { isDark as jr } from "./utilities/color/isDark.es.js";
60
+ import { toHex8String as Qr } from "./utilities/color/toHex8String.es.js";
61
+ import { toHexString as Xr } from "./utilities/color/toHexString.es.js";
62
+ import { toRgbaString as zr } from "./utilities/color/toRgbaString.es.js";
63
+ import { setAlpha as Kr } from "./utilities/color/setAlpha.es.js";
64
+ import { toColorObject as Zr } from "./utilities/color/toColorObject.es.js";
65
+ import { getReadableColor as te } from "./utilities/color/getReadableColor.es.js";
66
+ import { toShortRgba as ee } from "./utilities/color/toShortRgba.es.js";
67
+ import { moveItemInArray as ne } from "./utilities/moveItemInArray.es.js";
68
+ import { getBackgroundColorStyles as ae } from "./utilities/react/getBackgroundColorStyles.es.js";
69
+ import { getBorderStyles as ie } from "./utilities/react/getBorderStyles.es.js";
70
+ import { getRadiusStyles as le } from "./utilities/react/getRadiusStyles.es.js";
71
+ import { joinClassNames as ue } from "./utilities/react/joinClassNames.es.js";
72
+ var r = /* @__PURE__ */ ((t) => (t.Main = "main", t.Basics = "basics", t.Layout = "layout", t.Style = "style", t.Security = "security", t.Targets = "targets", t))(r || {});
73
+ const o = (t) => t, n = (t) => t;
74
+ export {
75
+ kt as AllTextStylePlugins,
76
+ bt as AllTextStyles,
77
+ s as Attachments,
78
+ A as BUTTON_PLUGIN,
79
+ $ as BlockButtonStyles,
80
+ i as BlockInjectButton,
81
+ l as BlockItemWrapper,
82
+ Dt as BlockStyles,
83
+ Rr as BorderStyle,
84
+ R as ButtonPlugin,
85
+ rt as Custom1Plugin,
86
+ ot as Custom2Plugin,
87
+ pt as Custom3Plugin,
88
+ u as DEFAULT_DRAGGING_TOOLTIP,
89
+ f as DEFAULT_DRAG_TOOLTIP,
90
+ P as DownloadButton,
91
+ C as ELEMENT_BUTTON,
92
+ Cr as GutterSpacing,
93
+ gt as Heading1Plugin,
94
+ mt as Heading2Plugin,
95
+ xt as Heading3Plugin,
96
+ ft as Heading4Plugin,
97
+ st as ImageCaptionPlugin,
98
+ Pt as ImageTitlePlugin,
99
+ T as LinkPlugin,
100
+ Ir as Margin,
101
+ ct as PARAGRAPH_CLASSES,
102
+ Mr as Padding,
103
+ yt as ParagraphMarkupElement,
104
+ Tt as ParagraphMarkupElementNode,
105
+ Et as ParagraphPlugin,
106
+ Rt as QuoteMarkupElementNode,
107
+ Ct as QuotePlugin,
108
+ kr as Radius,
109
+ c as RichTextEditor,
110
+ r as Sections,
111
+ br as Security,
112
+ wt as THEME_PREFIX,
113
+ Ft as TextStylePluginsWithoutImage,
114
+ Ht as TextStyles,
115
+ Gt as TextStylesWithoutImage,
116
+ Zt as addHttps,
117
+ Fr as borderStyleMap,
118
+ Wt as convertToRteValue,
119
+ V as createButtonNode,
120
+ I as createButtonPlugin,
121
+ E as createLinkPlugin,
122
+ ht as createParagraphPlugin,
123
+ It as createQuotePlugin,
124
+ vt as customCoordinatesGetterFactory,
125
+ o as defineBlock,
126
+ n as defineSettings,
127
+ ae as getBackgroundColorStyles,
128
+ nr as getBackgroundSettings,
129
+ ir as getBorderRadiusSettings,
130
+ mr as getBorderRadiusSlider,
131
+ ar as getBorderSettings,
132
+ ie as getBorderStyles,
133
+ _t as getDefaultPluginsWithLinkChooser,
134
+ xr as getExtendedBorderRadiusSettings,
135
+ fr as getGutterSettings,
136
+ Br as getMarginExtendedSettings,
137
+ sr as getMarginSettings,
138
+ Sr as getMarginSlider,
139
+ hr as getPaddingExtendedSettings,
140
+ yr as getPaddingSettings,
141
+ Tr as getPaddingSlider,
142
+ le as getRadiusStyles,
143
+ te as getReadableColor,
144
+ _r as getSecurityDownloadableSetting,
145
+ Or as getSecurityGlobalControlId,
146
+ Ur as getSecurityGlobalControlSetting,
147
+ v as getUrlFromEditor,
148
+ Gr as gutterSpacingStyleMap,
149
+ Vt as hasRichTextValue,
150
+ F as insertButton,
151
+ jr as isDark,
152
+ qt as isDownloadable,
153
+ ue as joinClassNames,
154
+ Jt as mapAppBridgeColorPaletteToFonduePalette,
155
+ Kt as mapAppBridgeColorPalettesToFonduePalettes,
156
+ Lr as marginStyleMap,
157
+ ne as moveItemInArray,
158
+ Dr as paddingStyleMap,
159
+ Hr as radiusStyleMap,
160
+ Kr as setAlpha,
161
+ L as submitFloatingButton,
162
+ Zr as toColorObject,
163
+ Qr as toHex8String,
164
+ Xr as toHexString,
165
+ zr as toRgbaString,
166
+ ee as toShortRgba,
167
+ q as triggerFloatingButton,
168
+ J as triggerFloatingButtonEdit,
169
+ Y as triggerFloatingButtonInsert,
170
+ H as unwrapButton,
171
+ _ as upsertButton,
172
+ w as upsertButtonText,
173
+ tr as useAttachments,
174
+ er as useDndSensors,
175
+ k as withButton,
176
+ W as wrapButton
177
+ };
178
+ //# sourceMappingURL=index.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es.js","sources":["../src/index.ts"],"sourcesContent":["/* (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":["Sections","defineBlock","config","defineSettings","settingsStructure"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DY,IAAAA,sBAAAA,OACRA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,QAAQ,SACRA,EAAA,WAAW,YACXA,EAAA,UAAU,WANFA,IAAAA,KAAA,CAAA,CAAA;AAyDC,MAAAC,IAAc,CAACC,MAAiDA,GAMhEC,IAAiB,CAM1BC,MACIA;"}
@@ -0,0 +1,46 @@
1
+ (function(g,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("@frontify/sidebar-settings"),require("react"),require("@frontify/fondue"),require("@frontify/app-bridge"),require("@dnd-kit/core"),require("@dnd-kit/sortable"),require("@react-aria/focus"),require("@dnd-kit/modifiers"),require("@udecode/plate"),require("escape-html"),require("slate-react"),require("@react-stately/overlays"),require("slate"),require("react-dom"),require("@ctrl/tinycolor")):typeof define=="function"&&define.amd?define(["exports","@frontify/sidebar-settings","react","@frontify/fondue","@frontify/app-bridge","@dnd-kit/core","@dnd-kit/sortable","@react-aria/focus","@dnd-kit/modifiers","@udecode/plate","escape-html","slate-react","@react-stately/overlays","slate","react-dom","@ctrl/tinycolor"],b):(g=typeof globalThis<"u"?globalThis:g||self,b(g.GuidelineBlocksSettings={},g.sidebarSettings,g.React,g.fondue,g.appBridge,g.core,g.sortable,g.focus,g.modifiers,g.plate,g.escapeHtml,g.slateReact,g.overlays,g.slate,g.ReactDOM,g.tinycolor))})(this,function(g,b,x,l,ce,_,Ae,Pt,Dn,o,Xe,It,Un,Hn,Vn,ee){"use strict";const Ya="";var Je={exports:{}},Te={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Rt;function zn(){if(Rt)return Te;Rt=1;var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function d(m,u,w){var y,f={},p=null,P=null;w!==void 0&&(p=""+w),u.key!==void 0&&(p=""+u.key),u.ref!==void 0&&(P=u.ref);for(y in u)r.call(u,y)&&!c.hasOwnProperty(y)&&(f[y]=u[y]);if(m&&m.defaultProps)for(y in u=m.defaultProps,u)f[y]===void 0&&(f[y]=u[y]);return{$$typeof:t,type:m,key:p,ref:P,props:f,_owner:s.current}}return Te.Fragment=n,Te.jsx=d,Te.jsxs=d,Te}var Pe={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var jt;function Wn(){return jt||(jt=1,process.env.NODE_ENV!=="production"&&function(){var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),m=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),B=Symbol.iterator,U="@@iterator";function z(i){if(i===null||typeof i!="object")return null;var h=B&&i[B]||i[U];return typeof h=="function"?h:null}var R=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function j(i){{for(var h=arguments.length,v=new Array(h>1?h-1:0),E=1;E<h;E++)v[E-1]=arguments[E];J("error",i,v)}}function J(i,h,v){{var E=R.ReactDebugCurrentFrame,I=E.getStackAddendum();I!==""&&(h+="%s",v=v.concat([I]));var A=v.map(function(T){return String(T)});A.unshift("Warning: "+h),Function.prototype.apply.call(console[i],console,A)}}var le=!1,K=!1,L=!1,H=!1,G=!1,re;re=Symbol.for("react.module.reference");function ye(i){return!!(typeof i=="string"||typeof i=="function"||i===r||i===c||G||i===s||i===w||i===y||H||i===P||le||K||L||typeof i=="object"&&i!==null&&(i.$$typeof===p||i.$$typeof===f||i.$$typeof===d||i.$$typeof===m||i.$$typeof===u||i.$$typeof===re||i.getModuleId!==void 0))}function oe(i,h,v){var E=i.displayName;if(E)return E;var I=h.displayName||h.name||"";return I!==""?v+"("+I+")":v}function je(i){return i.displayName||"Context"}function Q(i){if(i==null)return null;if(typeof i.tag=="number"&&j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case r:return"Fragment";case n:return"Portal";case c:return"Profiler";case s:return"StrictMode";case w:return"Suspense";case y:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case m:var h=i;return je(h)+".Consumer";case d:var v=i;return je(v._context)+".Provider";case u:return oe(i,i.render,"ForwardRef");case f:var E=i.displayName||null;return E!==null?E:Q(i.type)||"Memo";case p:{var I=i,A=I._payload,T=I._init;try{return Q(T(A))}catch{return null}}}return null}var se=Object.assign,C=0,W,q,Ve,ze,Le,Ee,En;function Cn(){}Cn.__reactDisabledLog=!0;function Ea(){{if(C===0){W=console.log,q=console.info,Ve=console.warn,ze=console.error,Le=console.group,Ee=console.groupCollapsed,En=console.groupEnd;var i={configurable:!0,enumerable:!0,value:Cn,writable:!0};Object.defineProperties(console,{info:i,log:i,warn:i,error:i,group:i,groupCollapsed:i,groupEnd:i})}C++}}function Ca(){{if(C--,C===0){var i={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:se({},i,{value:W}),info:se({},i,{value:q}),warn:se({},i,{value:Ve}),error:se({},i,{value:ze}),group:se({},i,{value:Le}),groupCollapsed:se({},i,{value:Ee}),groupEnd:se({},i,{value:En})})}C<0&&j("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var bt=R.ReactCurrentDispatcher,xt;function We(i,h,v){{if(xt===void 0)try{throw Error()}catch(I){var E=I.stack.trim().match(/\n( *(at )?)/);xt=E&&E[1]||""}return`
18
+ `+xt+i}}var pt=!1,$e;{var Sa=typeof WeakMap=="function"?WeakMap:Map;$e=new Sa}function Sn(i,h){if(!i||pt)return"";{var v=$e.get(i);if(v!==void 0)return v}var E;pt=!0;var I=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var A;A=bt.current,bt.current=null,Ea();try{if(h){var T=function(){throw Error()};if(Object.defineProperty(T.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(T,[])}catch(ae){E=ae}Reflect.construct(i,[],T)}else{try{T.call()}catch(ae){E=ae}i.call(T.prototype)}}else{try{throw Error()}catch(ae){E=ae}i()}}catch(ae){if(ae&&E&&typeof ae.stack=="string"){for(var S=ae.stack.split(`
19
+ `),$=E.stack.split(`
20
+ `),O=S.length-1,D=$.length-1;O>=1&&D>=0&&S[O]!==$[D];)D--;for(;O>=1&&D>=0;O--,D--)if(S[O]!==$[D]){if(O!==1||D!==1)do if(O--,D--,D<0||S[O]!==$[D]){var Y=`
21
+ `+S[O].replace(" at new "," at ");return i.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",i.displayName)),typeof i=="function"&&$e.set(i,Y),Y}while(O>=1&&D>=0);break}}}finally{pt=!1,bt.current=A,Ca(),Error.prepareStackTrace=I}var Se=i?i.displayName||i.name:"",Mn=Se?We(Se):"";return typeof i=="function"&&$e.set(i,Mn),Mn}function Ta(i,h,v){return Sn(i,!1)}function Pa(i){var h=i.prototype;return!!(h&&h.isReactComponent)}function Ge(i,h,v){if(i==null)return"";if(typeof i=="function")return Sn(i,Pa(i));if(typeof i=="string")return We(i);switch(i){case w:return We("Suspense");case y:return We("SuspenseList")}if(typeof i=="object")switch(i.$$typeof){case u:return Ta(i.render);case f:return Ge(i.type,h,v);case p:{var E=i,I=E._payload,A=E._init;try{return Ge(A(I),h,v)}catch{}}}return""}var Ke=Object.prototype.hasOwnProperty,Tn={},Pn=R.ReactDebugCurrentFrame;function Ye(i){if(i){var h=i._owner,v=Ge(i.type,i._source,h?h.type:null);Pn.setExtraStackFrame(v)}else Pn.setExtraStackFrame(null)}function Ia(i,h,v,E,I){{var A=Function.call.bind(Ke);for(var T in i)if(A(i,T)){var S=void 0;try{if(typeof i[T]!="function"){var $=Error((E||"React class")+": "+v+" type `"+T+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[T]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw $.name="Invariant Violation",$}S=i[T](h,T,E,v,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(O){S=O}S&&!(S instanceof Error)&&(Ye(I),j("%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).",E||"React class",v,T,typeof S),Ye(null)),S instanceof Error&&!(S.message in Tn)&&(Tn[S.message]=!0,Ye(I),j("Failed %s type: %s",v,S.message),Ye(null))}}}var Ra=Array.isArray;function kt(i){return Ra(i)}function ja(i){{var h=typeof Symbol=="function"&&Symbol.toStringTag,v=h&&i[Symbol.toStringTag]||i.constructor.name||"Object";return v}}function La(i){try{return In(i),!1}catch{return!0}}function In(i){return""+i}function Rn(i){if(La(i))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ja(i)),In(i)}var Ne=R.ReactCurrentOwner,Na={key:!0,ref:!0,__self:!0,__source:!0},jn,Ln,Et;Et={};function Aa(i){if(Ke.call(i,"ref")){var h=Object.getOwnPropertyDescriptor(i,"ref").get;if(h&&h.isReactWarning)return!1}return i.ref!==void 0}function Ba(i){if(Ke.call(i,"key")){var h=Object.getOwnPropertyDescriptor(i,"key").get;if(h&&h.isReactWarning)return!1}return i.key!==void 0}function _a(i,h){if(typeof i.ref=="string"&&Ne.current&&h&&Ne.current.stateNode!==h){var v=Q(Ne.current.type);Et[v]||(j('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',Q(Ne.current.type),i.ref),Et[v]=!0)}}function Oa(i,h){{var v=function(){jn||(jn=!0,j("%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)",h))};v.isReactWarning=!0,Object.defineProperty(i,"key",{get:v,configurable:!0})}}function Fa(i,h){{var v=function(){Ln||(Ln=!0,j("%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)",h))};v.isReactWarning=!0,Object.defineProperty(i,"ref",{get:v,configurable:!0})}}var Ma=function(i,h,v,E,I,A,T){var S={$$typeof:t,type:i,key:h,ref:v,props:T,_owner:A};return S._store={},Object.defineProperty(S._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(S,"_self",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.defineProperty(S,"_source",{configurable:!1,enumerable:!1,writable:!1,value:I}),Object.freeze&&(Object.freeze(S.props),Object.freeze(S)),S};function Da(i,h,v,E,I){{var A,T={},S=null,$=null;v!==void 0&&(Rn(v),S=""+v),Ba(h)&&(Rn(h.key),S=""+h.key),Aa(h)&&($=h.ref,_a(h,I));for(A in h)Ke.call(h,A)&&!Na.hasOwnProperty(A)&&(T[A]=h[A]);if(i&&i.defaultProps){var O=i.defaultProps;for(A in O)T[A]===void 0&&(T[A]=O[A])}if(S||$){var D=typeof i=="function"?i.displayName||i.name||"Unknown":i;S&&Oa(T,D),$&&Fa(T,D)}return Ma(i,S,$,I,E,Ne.current,T)}}var Ct=R.ReactCurrentOwner,Nn=R.ReactDebugCurrentFrame;function Ce(i){if(i){var h=i._owner,v=Ge(i.type,i._source,h?h.type:null);Nn.setExtraStackFrame(v)}else Nn.setExtraStackFrame(null)}var St;St=!1;function Tt(i){return typeof i=="object"&&i!==null&&i.$$typeof===t}function An(){{if(Ct.current){var i=Q(Ct.current.type);if(i)return`
22
+
23
+ Check the render method of \``+i+"`."}return""}}function Ua(i){{if(i!==void 0){var h=i.fileName.replace(/^.*[\\\/]/,""),v=i.lineNumber;return`
24
+
25
+ Check your code at `+h+":"+v+"."}return""}}var Bn={};function Ha(i){{var h=An();if(!h){var v=typeof i=="string"?i:i.displayName||i.name;v&&(h=`
26
+
27
+ Check the top-level render call using <`+v+">.")}return h}}function _n(i,h){{if(!i._store||i._store.validated||i.key!=null)return;i._store.validated=!0;var v=Ha(h);if(Bn[v])return;Bn[v]=!0;var E="";i&&i._owner&&i._owner!==Ct.current&&(E=" It was passed a child from "+Q(i._owner.type)+"."),Ce(i),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',v,E),Ce(null)}}function On(i,h){{if(typeof i!="object")return;if(kt(i))for(var v=0;v<i.length;v++){var E=i[v];Tt(E)&&_n(E,h)}else if(Tt(i))i._store&&(i._store.validated=!0);else if(i){var I=z(i);if(typeof I=="function"&&I!==i.entries)for(var A=I.call(i),T;!(T=A.next()).done;)Tt(T.value)&&_n(T.value,h)}}}function Va(i){{var h=i.type;if(h==null||typeof h=="string")return;var v;if(typeof h=="function")v=h.propTypes;else if(typeof h=="object"&&(h.$$typeof===u||h.$$typeof===f))v=h.propTypes;else return;if(v){var E=Q(h);Ia(v,i.props,"prop",E,i)}else if(h.PropTypes!==void 0&&!St){St=!0;var I=Q(h);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",I||"Unknown")}typeof h.getDefaultProps=="function"&&!h.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function za(i){{for(var h=Object.keys(i.props),v=0;v<h.length;v++){var E=h[v];if(E!=="children"&&E!=="key"){Ce(i),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",E),Ce(null);break}}i.ref!==null&&(Ce(i),j("Invalid attribute `ref` supplied to `React.Fragment`."),Ce(null))}}function Fn(i,h,v,E,I,A){{var T=ye(i);if(!T){var S="";(i===void 0||typeof i=="object"&&i!==null&&Object.keys(i).length===0)&&(S+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var $=Ua(I);$?S+=$:S+=An();var O;i===null?O="null":kt(i)?O="array":i!==void 0&&i.$$typeof===t?(O="<"+(Q(i.type)||"Unknown")+" />",S=" Did you accidentally export a JSX literal instead of a component?"):O=typeof i,j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",O,S)}var D=Da(i,h,v,I,A);if(D==null)return D;if(T){var Y=h.children;if(Y!==void 0)if(E)if(kt(Y)){for(var Se=0;Se<Y.length;Se++)On(Y[Se],i);Object.freeze&&Object.freeze(Y)}else j("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else On(Y,i)}return i===r?za(D):Va(D),D}}function Wa(i,h,v){return Fn(i,h,v,!0)}function $a(i,h,v){return Fn(i,h,v,!1)}var Ga=$a,Ka=Wa;Pe.Fragment=r,Pe.jsx=Ga,Pe.jsxs=Ka}()),Pe}process.env.NODE_ENV==="production"?Je.exports=zn():Je.exports=Wn();var a=Je.exports;const te=e=>e.filter(Boolean).join(" "),$n=({onDrop:e,label:t,icon:n,secondaryLabel:r,isLoading:s,fillParentContainer:c,onAssetChooseClick:d,onUploadClick:m,withMenu:u=!0,onClick:w,validFileType:y,verticalLayout:f})=>{const[p,P]=x.useState(!1),[B,U]=x.useState(),z=x.useRef(null),[R,j]=x.useState(void 0),J=L=>{if(L.preventDefault(),P(!1),!le(L.dataTransfer.files)){j("Invalid"),setTimeout(()=>{j(void 0)},1e3);return}e==null||e(L.dataTransfer.files)},le=L=>{if(!y)return!0;for(let H=0;H<L.length;H++){const G=L[H].name.split(".").pop()??"";if(!ce.FileExtensionSets[y].includes(G))return!1}return!0},K=L=>{if(!z.current||s)return;const{left:H,top:G}=z.current.getBoundingClientRect(),re=L.clientX-H,ye=L.clientY-G;U([re,ye])};return a.jsxs("button",{ref:z,"data-test-id":"block-inject-button",className:te(["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",f?"[&:not(:first-child)]:tw-border-t-0 first:tw-rounded-tr last:tw-rounded-bl":"[&:not(:first-child)]:tw-border-l-0 first:tw-rounded-bl last:tw-rounded-tr",c?"tw-h-full":"tw-h-[72px]",p&&!s?"tw-border-dashed":"tw-border-solid",B&&"tw-bg-blank-state-pressed-inverse",p&&"tw-bg-blank-state-weak-inverse",R?"!tw-border-red-50 !tw-cursor-not-allowed":" tw-border-blank-state-line",s||B||p||R?"":"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",(p||B)&&!R?"[&>*]:tw-pointer-events-none tw-border-blank-state-line-hover":"tw-bg-blank-state-shaded-inverse tw-text-blank-state-shaded"]),onDragEnter:e?L=>{var H;if(P(!0),y==="Images")for(const G of Array.from(L.dataTransfer.items))(H=G==null?void 0:G.type)!=null&&H.startsWith("image/")?j(void 0):j("Invalid")}:void 0,onDragLeave:e?()=>{P(!1),j(void 0)}:void 0,onDrop:e?J:void 0,onClick:L=>{u&&K(L),w==null||w()},children:[s?a.jsx(l.LoadingCircle,{}):R?a.jsxs("div",{className:" tw-flex tw-items-center tw-justify-center tw-text-red-60 tw-font-medium",children:[a.jsx(l.IconExclamationMarkTriangle,{}),R]}):a.jsxs(a.Fragment,{children:[n&&a.jsx("div",{children:n}),(t||r)&&a.jsxs("div",{className:"tw-flex tw-flex-col tw-items-start",children:[t&&a.jsx("div",{className:"tw-font-medium",children:t}),r&&a.jsx("div",{className:"tw-font-normal",children:r})]})]}),B&&a.jsx("div",{className:"tw-absolute tw-left-0 tw-top-full tw-z-20",style:{left:B[0],top:B[1]},children:a.jsx(l.Flyout,{onOpenChange:L=>!L&&U(void 0),isOpen:!0,fitContent:!0,hug:!1,legacyFooter:!1,trigger:a.jsx("div",{}),children:a.jsx(l.ActionMenu,{menuBlocks:[{id:"menu",menuItems:[...m?[{id:"upload",size:l.MenuItemContentSize.XSmall,title:"Upload asset",onClick:()=>{m(),U(void 0)},initialValue:!0,decorator:a.jsx("div",{className:"tw-mr-2",children:a.jsx(l.IconArrowCircleUp20,{})})}]:[],...d?[{id:"asset",size:l.MenuItemContentSize.XSmall,title:"Browse asset",onClick:()=>{d(),U(void 0)},initialValue:!0,decorator:a.jsx("div",{className:"tw-mr-2",children:a.jsx(l.IconImageStack20,{})})}]:[]]}]})})})]})},ue=e=>{const t=r=>typeof r=="object"&&["red","green","blue"].every(c=>r.hasOwnProperty(c)),n=r=>{const s=typeof r.alpha=="number"?r.alpha:1;return{r:r.red,g:r.green,b:r.blue,a:s}};return t(e)?n(e):e},Gn=e=>typeof e=="object"&&["red","green","blue"].every(n=>e==null?void 0:e.hasOwnProperty(n)),Kn=(e,t)=>{const n=Gn(e)?ue(e):e,r=ee(n);return t?r.getBrightness()<t:r.isDark()||r.getAlpha()>.25&&r.getAlpha()<1},Yn=e=>ee(ue(e)).toHex8String(),Xn=e=>ee(ue(e)).toHexString(),Qe=e=>ee(ue(e)).toRgbString(),Jn=(e,t)=>ee(t).setAlpha(e).toRgbString(),Qn=e=>{const{r:t,g:n,b:r,a:s}=ee(e);return{red:t,green:n,blue:r,alpha:s}},Lt=e=>typeof e=="object"&&["red","green","blue"].every(n=>e==null?void 0:e.hasOwnProperty(n)),Zn=(e,t)=>{const n=Lt(e)?ue(e):e,r=Lt(t)?ue(t):t;let s=ee(n);const c=ee(r);for(;ee.readability(s,c)<4.5;)s=s.darken(1);return s.toRgbString()},qn=(e,t,n)=>{const r=[...e],s=n<0?r.length+n:n;if(s>=0&&s<r.length){const c=r.splice(t,1)[0];r.splice(s,0,c)}return r},er=e=>({backgroundColor:Qe(e)});var Z=(e=>(e.Solid="Solid",e.Dashed="Dashed",e.Dotted="Dotted",e))(Z||{});const Nt={Solid:"solid",Dotted:"dotted",Dashed:"dashed"};var ie=(e=>(e.None="None",e.Small="Small",e.Medium="Medium",e.Large="Large",e))(ie||{});const de={None:"0px",Small:"2px",Medium:"4px",Large:"12px"};var ge=(e=>(e.None="None",e.Small="Small",e.Medium="Medium",e.Large="Large",e))(ge||{});const we={None:"0px",Small:"24px",Medium:"36px",Large:"60px"};var me=(e=>(e.None="None",e.Small="Small",e.Medium="Medium",e.Large="Large",e))(me||{});const ve={None:"0px",Small:"24px",Medium:"36px",Large:"60px"};var he=(e=>(e.Global="Global",e.Custom="Custom",e))(he||{}),fe=(e=>(e.Auto="Auto",e.S="S",e.M="M",e.L="L",e))(fe||{});const At={Auto:"4px",S:"10px",M:"30px",L:"50px"},tr={red:241,green:241,blue:241,alpha:1},Bt={red:234,green:235,blue:235,alpha:1},nr="1px",Ie="24px",Re="24px",rr=(e=Z.Solid,t="1px",n=Bt)=>({borderStyle:Nt[e],borderWidth:t,borderColor:Qe(n)}),sr=(e,t=!1,n)=>({borderRadius:t?n:de[e]}),_t="Drag or press ↵ to move",Ot="Move with ↑↓←→ and confirm with ↵",ar=({items:e,flyoutItems:t,isFlyoutOpen:n,setIsFlyoutOpen:r,isDragging:s,isFlyoutDisabled:c})=>a.jsx("div",{"data-test-id":"block-item-wrapper-toolbar",className:"tw-flex tw-justify-end",children:a.jsxs("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",children:[e.map((d,m)=>"draggableProps"in d?a.jsx(l.Tooltip,{withArrow:!0,hoverDelay:0,enterDelay:300,open:s,position:l.TooltipPosition.Top,content:a.jsx("div",{children:s?Ot:d.tooltip??_t}),triggerElement:a.jsx("button",{ref:d.setActivatorNodeRef,"data-test-id":"block-item-wrapper-toolbar-btn",...d.draggableProps,className:te(["tw-bg-base tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm",s?"tw-cursor-grabbing tw-bg-box-selected-pressed":"tw-cursor-grab hover:tw-bg-box-selected-hover"]),children:d.icon})},m):a.jsx(l.Tooltip,{withArrow:!0,enterDelay:300,hoverDelay:0,disabled:s,position:l.TooltipPosition.Top,content:a.jsx("div",{children:d.tooltip??""}),triggerElement:a.jsx("button",{"data-test-id":"block-item-wrapper-toolbar-btn",onClick:d.onClick,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",children:d.icon})},m)),t.length>0&&a.jsx("div",{className:"tw-flex tw-flex-shrink-0 tw-flex-1 tw-h-6",children:a.jsx(l.Flyout,{isOpen:n&&!s,isTriggerDisabled:c,legacyFooter:!1,fitContent:!0,hug:!1,onOpenChange:r,trigger:a.jsx(l.Tooltip,{withArrow:!0,hoverDelay:0,enterDelay:300,disabled:s,position:l.TooltipPosition.Top,content:a.jsx("div",{children:"Options"}),triggerElement:a.jsx("div",{"data-test-id":"block-item-wrapper-toolbar-flyout",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",children:a.jsx(l.IconDotsHorizontal16,{})})}),children:a.jsx(l.ActionMenu,{menuBlocks:t.map((d,m)=>({id:m.toString(),menuItems:d.map((u,w)=>({id:m.toString()+w.toString(),size:l.MenuItemContentSize.XSmall,title:u.title,style:u.style,onClick:()=>{r(!1),u.onClick()},initialValue:!0,decorator:a.jsx("div",{className:"tw-mr-2",children:u.icon})}))}))})})})]})}),ir=({children:e,toolbarFlyoutItems:t,toolbarItems:n,shouldHideWrapper:r,shouldHideComponent:s=!1,isDragging:c,shouldFillContainer:d,outlineOffset:m=2,shouldBeShown:u=!1})=>{const[w,y]=x.useState(u),[f,p]=x.useState(!1),P=x.useRef(null);if(x.useEffect(()=>{w||p(!0)},[w]),r)return e;const B=n==null?void 0:n.filter(U=>U!==void 0);return a.jsxs("div",{ref:P,onFocus:()=>p(!1),onPointerEnter:()=>p(!1),"data-test-id":"block-item-wrapper",style:{outlineOffset:m},className:te(["tw-relative tw-group tw-outline-1 tw-outline-box-selected-inverse",d&&"tw-flex-1 tw-h-full tw-w-full","hover:tw-outline focus-within:tw-outline",(w||u)&&"tw-outline",s&&"tw-opacity-0"]),children:[a.jsx("div",{style:{right:-1-m,bottom:`calc(100% - ${2+m}px)`},className:te(["tw-pointer-events-none tw-absolute tw-bottom-[calc(100%-4px)] tw-right-[-3px] tw-w-full tw-opacity-0 tw-z-10","group-hover:tw-opacity-100 group-focus:tw-opacity-100 focus-within:tw-opacity-100",(w||u)&&"tw-opacity-100"]),children:a.jsx(ar,{isFlyoutOpen:w,isFlyoutDisabled:f,setIsFlyoutOpen:y,flyoutItems:t,items:B,isDragging:c})}),e]})},lr=e=>e==="IMAGE"?a.jsx(l.IconImage24,{}):e==="VIDEO"?a.jsx(l.IconPlayFrame24,{}):e==="AUDIO"?a.jsx(l.IconMusicNote24,{}):a.jsx(l.IconDocument24,{}),Ze=x.forwardRef(({item:e,isEditing:t,draggableProps:n,transformStyle:r,isDragging:s,isOverlay:c,isLoading:d,onDelete:m,onReplaceWithBrowse:u,onReplaceWithUpload:w},y)=>{const[f,p]=x.useState(),[P,{selectedFiles:B}]=ce.useFileInput({multiple:!0,accept:"image/*"}),[U,{results:z,doneAll:R}]=ce.useAssetUpload(),{focusProps:j,isFocusVisible:J}=Pt.useFocusRing();x.useEffect(()=>{B&&U(B[0])},[B]),x.useEffect(()=>{R&&w(z[0])},[R,z]);const le=(L,H)=>{fetch(L).then(G=>{G.blob().then(re=>{const ye=URL.createObjectURL(re),oe=document.createElement("a");oe.href=ye,oe.download=H,oe.click()})})},K=d||B&&!R;return a.jsxs("button",{"aria-label":"Download attachment","data-test-id":"attachments-item",onClick:()=>le(e.genericUrl,e.fileName),ref:y,style:{...r,opacity:s&&!c?.3:1,fontFamily:"var(-f-theme-settings-body-font-family)"},className:te(["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",s?"tw-bg-box-neutral-hover":""]),children:[a.jsx("div",{className:"tw-text-text-weak group-hover:tw-text-box-neutral-inverse-hover",children:K?a.jsx(l.LoadingCircle,{size:l.LoadingCircleSize.Small}):lr(e.objectType)}),a.jsxs("div",{className:"tw-text-s tw-flex-1 tw-min-w-0",children:[a.jsx("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",children:e.title}),a.jsx("div",{className:"tw-text-text-weak",children:`${e.fileSizeHumanReadable} - ${e.extension}`})]}),t&&a.jsxs("div",{"data-test-id":"attachments-actionbar",className:te(["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",c||(f==null?void 0:f.id)===e.id?"tw-opacity-100":"tw-opacity-0"]),children:[a.jsx("button",{...j,...n,"aria-label":"Drag attachment",className:te([" 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 ",s||c?"tw-cursor-grabbing tw-bg-button-background-pressed hover:tw-bg-button-background-pressed":"tw-cursor-grab hover:tw-bg-button-background-hover",J&&l.FOCUS_STYLE,J&&"tw-z-[2]"]),children:a.jsx(l.IconGrabHandle20,{})}),a.jsx("div",{"data-test-id":"attachments-actionbar-flyout",children:a.jsx(l.Flyout,{placement:l.FlyoutPlacement.Right,isOpen:(f==null?void 0:f.id)===e.id,fitContent:!0,legacyFooter:!1,onOpenChange:L=>p(L?e:void 0),trigger:(L,H)=>a.jsx(l.Button,{ref:H,icon:a.jsx(l.IconPen20,{}),emphasis:l.ButtonEmphasis.Default,onClick:()=>p(e)}),children:a.jsx(l.ActionMenu,{menuBlocks:[{id:"menu",menuItems:[{id:"upload",size:l.MenuItemContentSize.XSmall,title:"Replace with upload",onClick:()=>{P(),p(void 0)},initialValue:!0,decorator:a.jsx("div",{className:"tw-mr-2",children:a.jsx(l.IconArrowCircleUp20,{})})},{id:"asset",size:l.MenuItemContentSize.XSmall,title:"Replace with asset",onClick:()=>{u(),p(void 0)},initialValue:!0,decorator:a.jsx("div",{className:"tw-mr-2",children:a.jsx(l.IconImageStack20,{})})}]},{id:"menu-delete",menuItems:[{id:"delete",size:l.MenuItemContentSize.XSmall,title:"Delete",style:l.MenuItemStyle.Danger,onClick:()=>{m(),p(void 0)},initialValue:!0,decorator:a.jsx("div",{className:"tw-mr-2",children:a.jsx(l.IconTrashBin20,{})})}]}]})})})]})]})});Ze.displayName="AttachmentItem";const or=e=>{const{attributes:t,listeners:n,setNodeRef:r,transform:s,transition:c,isDragging:d}=Ae.useSortable({id:e.item.id}),m={transform:s?`translate(${s.x}px, ${s.y}px)`:"",transition:c,zIndex:d?2:1},u={...t,...n};return a.jsx(Ze,{ref:r,isDragging:d,transformStyle:m,draggableProps:u,...e})},cr=({items:e=[],onDelete:t,onReplaceWithBrowse:n,onReplaceWithUpload:r,onBrowse:s,onUpload:c,onSorted:d,appBridge:m})=>{const[u,w]=x.useState(e),[y,f]=x.useState(!1),p=_.useSensors(_.useSensor(_.PointerSensor),_.useSensor(_.KeyboardSensor)),[P,B]=x.useState(void 0),[U,z]=x.useState(!1),[R,j]=x.useState([]),[J,le]=x.useState(null),K=ce.useEditorState(m),L=u==null?void 0:u.find(C=>C.id===P),[H,{results:G,doneAll:re}]=ce.useAssetUpload({onUploadProgress:()=>!U&&z(!0)});x.useEffect(()=>{w(e)},[e]),x.useEffect(()=>{J&&(z(!0),H(J))},[J]),x.useEffect(()=>{(async()=>{re&&(await c(G),z(!1))})()},[re,G]);const ye=()=>{f(!1),m.openAssetChooser(C=>{s(C),m.closeAssetChooser(),f(!0)},{multiSelection:!0,selectedValueIds:u.map(C=>C.id)})},oe=C=>{f(!1),m.openAssetChooser(async W=>{f(!0),m.closeAssetChooser(),j([...R,C.id]),await n(C,W[0]),j(R.filter(q=>q!==C.id))},{multiSelection:!1,selectedValueIds:u.map(W=>W.id)})},je=async(C,W)=>{j([...R,C.id]),await r(C,W),j(R.filter(q=>q!==C.id))},Q=C=>{const{active:W}=C;B(W.id)},se=C=>{const{active:W,over:q}=C;if(q&&W.id!==q.id&&u){const Ve=u.findIndex(Ee=>Ee.id===W.id),ze=u.findIndex(Ee=>Ee.id===q.id),Le=Ae.arrayMove(u,Ve,ze);w(Le),d(Le)}B(void 0)};return K||((u==null?void 0:u.length)??0)>0?a.jsx(l.Tooltip,{withArrow:!0,position:l.TooltipPosition.Top,content:"Attachments",disabled:y,enterDelay:500,triggerElement:a.jsx("div",{"data-test-id":"attachments-flyout-button",children:a.jsx(l.Flyout,{placement:l.FlyoutPlacement.BottomRight,onOpenChange:C=>f(L?!0:C),isOpen:y,hug:!1,fitContent:!0,legacyFooter:!1,trigger:a.jsxs("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",children:[a.jsx(l.IconPaperclip16,{}),a.jsx("div",{children:e.length>0?e.length:"Add"}),a.jsx(l.IconCaretDown12,{})]}),children:a.jsxs("div",{className:"tw-w-[300px]",children:[u.length>0&&a.jsxs(_.DndContext,{sensors:p,collisionDetection:_.closestCenter,onDragStart:Q,onDragEnd:se,modifiers:[Dn.restrictToWindowEdges],children:[a.jsx(Ae.SortableContext,{items:u,strategy:Ae.rectSortingStrategy,children:a.jsx("div",{className:"tw-border-b tw-border-b-line",children:u.map(C=>a.jsx(or,{isEditing:K,isLoading:R.includes(C.id),item:C,onDelete:()=>t(C),onReplaceWithBrowse:()=>oe(C),onReplaceWithUpload:W=>je(C,W)},C.id))})}),a.jsx(_.DragOverlay,{children:L&&a.jsx(Ze,{isOverlay:!0,isEditing:K,item:L,isDragging:!0,onDelete:()=>t(L),onReplaceWithBrowse:()=>oe(L),onReplaceWithUpload:C=>je(L,C)},P)})]}),K&&a.jsxs("div",{className:"tw-px-5 tw-py-3",children:[a.jsx("div",{className:"tw-font-body tw-font-medium tw-text-text tw-text-s tw-my-4",children:"Add attachments"}),a.jsx(l.AssetInput,{isLoading:U,size:l.AssetInputSize.Small,onUploadClick:C=>le(C),onLibraryClick:ye})]})]})})})}):null},ur=({onDownload:e})=>{const{isFocused:t,focusProps:n}=Pt.useFocusRing();return a.jsx(l.Tooltip,{withArrow:!0,position:l.TooltipPosition.Top,content:"Download",enterDelay:500,triggerElement:a.jsx("button",{tabIndex:0,"aria-label":"Download",...n,className:te(["tw-outline-none tw-rounded",t&&l.FOCUS_STYLE]),onClick:e,onPointerDown:r=>r.preventDefault(),children:a.jsx("span",{"data-test-id":"download-button",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",children:a.jsx(l.IconArrowCircleDown16,{})})})})},dr=({floatingOptions:e,...t})=>{const n=o.useEditorRef(),r=It.useFocused(),s=o.useFloatingLinkSelectors().mode(),c=o.useFloatingLinkSelectors().isOpen(n.id),{triggerFloatingLinkHotkeys:d}=o.getPluginOptions(n,o.ELEMENT_LINK);o.useHotkeys(d,y=>{o.triggerFloatingLinkInsert(n,{focused:r})&&y.preventDefault()},{enableOnContentEditable:!0},[r]);const{update:m,style:u,floating:w}=o.useVirtualFloatingLink({editorId:n.id,open:c&&s==="insert",getBoundingClientRect:o.getSelectionBoundingClientRect,whileElementsMounted:()=>{},...e});return x.useEffect(()=>{c?(m(),o.floatingLinkActions.updated(!0)):o.floatingLinkActions.updated(!1)},[c,m]),o.useFloatingLinkEscape(),{style:{...u,zIndex:1e3},...t,ref:o.useComposedRef(t.ref,w)}},gr=o.createComponentAs(e=>{var n;const t=dr({...e,floatingOptions:{strategy:"absolute"}});return((n=t.style)==null?void 0:n.display)==="none"?null:o.createElementAs("div",t)}),mr=o.createComponentAs(e=>{var n;const t=as({...e,floatingOptions:{strategy:"absolute"}});return((n=t.style)==null?void 0:n.display)==="none"?null:o.createElementAs("div",t)});o.FloatingLink.EditRoot=mr,o.FloatingLink.InsertRoot=gr;const Be=o.FloatingLink,be="link-plugin",Ft=e=>{if(!e)return!1;const t=n=>n.some(r=>r.text?r.text!=="":r.children?t(r.children):!1);try{const n=JSON.parse(e);return t(n)}catch{return!1}},hr=(e="p",t="",n)=>Ft(t)?t:JSON.stringify([{type:e,children:[{text:t,textStyle:e}],align:n}]),fr=[_.KeyboardCode.Down,_.KeyboardCode.Right,_.KeyboardCode.Up,_.KeyboardCode.Left],Mt=(e,t)=>(n,{currentCoordinates:r,context:{activeNode:s}})=>{if(n.preventDefault(),fr.includes(n.code)){const c=(s==null?void 0:s.offsetWidth)??0,d=(s==null?void 0:s.offsetHeight)??0;switch(n.code){case _.KeyboardCode.Right:return{...r,x:r.x+c+e};case _.KeyboardCode.Left:return{...r,x:r.x-c-e};case _.KeyboardCode.Down:return{...r,y:r.y+d+t};case _.KeyboardCode.Up:return{...r,y:r.y-d-t}}}},yr=(e,t,n)=>e===he.Custom?t:n,wr=e=>e.map(Dt),Dt=e=>({id:e.id,title:e.name,colors:e.colors.map(t=>({alpha:t.alpha?t.alpha/255:1,red:t.red??0,green:t.green??0,blue:t.blue??0,name:t.name??""}))}),qe=(e,t)=>{const n=o.getAboveNode(e,{match:{type:o.ELEMENT_LINK}});return Array.isArray(n)?t(n[0]):""},vr=e=>qe(e,t=>{var n,r;return((r=(n=t.chosenLink)==null?void 0:n.searchResult)==null?void 0:r.link)||""}),br=e=>qe(e,t=>t.url||""),xr=e=>{var t,n;return e.url||((n=(t=e.chosenLink)==null?void 0:t.searchResult)==null?void 0:n.link)||""},pr=e=>qe(e,xr),Ut=/^\/(document|r)\/\S+$/i,_e=e=>{if(Ut.test(e))return e;try{return new URL(e),e}catch{return`https://${e}`}},et=e=>{if(Ut.test(e))return!0;try{const t=new URL(e);return["http:","https:","mailto:","tel:"].includes(t.protocol)&&t.pathname!==""}catch{return!1}},Oe=e=>et(_e(e))||e==="",kr=(e,t)=>{const n=o.getAboveNode(e,{match:{type:N}});return Array.isArray(n)?t(n[0]):""},Ht=e=>kr(e,t=>t.url??""),Vt=(e,{url:t,text:n="",buttonStyle:r="primary",target:s,children:c})=>({type:o.getPluginType(e,N),url:t,target:s,buttonStyle:r,children:c??[{text:n}]}),tt=o.createStore("floatingButton")({openEditorId:null,mouseDown:!1,updated:!1,url:"",text:"",buttonStyle:"primary",newTab:!1,mode:"",isEditing:!1}).extendActions(e=>({reset:()=>{e.url(""),e.text(""),e.buttonStyle("primary"),e.newTab(!1),e.mode(""),e.isEditing(!1)}})).extendActions(e=>({show:(t,n)=>{e.mode(t),e.isEditing(!1),e.openEditorId(n)},hide:()=>{e.reset(),e.openEditorId(null)}})).extendSelectors(e=>({isOpen:t=>e.openEditorId===t})),F=tt.set,V=tt.get,xe=()=>tt.use,Fe=e=>{const t=o.findNode(e,{match:{type:o.getPluginType(e,N)}});if(!t)return;const[n,r]=t;let s=o.getEditorString(e,r);F.url(n.url),F.newTab(n.target===void 0),s===n.url&&(s=""),F.text(s),F.isEditing(!0)},Er=({floatingOptions:e,...t})=>{const n=o.useEditorRef(),r=o.usePlateSelectors(n.id).keyEditor(),s=xe().mode(),c=xe().isOpen(n.id),{triggerFloatingButtonHotkeys:d}=o.getPluginOptions(n,N),m=x.useCallback(()=>{const p=o.getAboveNode(n,{match:{type:o.getPluginType(n,N)}});if(p){const[,P]=p;return o.getRangeBoundingClientRect(n,{anchor:o.getStartPoint(n,P),focus:o.getEndPoint(n,P)})}return o.getDefaultBoundingClientRect()},[n]),u=c&&s==="edit",{update:w,style:y,floating:f}=Kt({open:u,getBoundingClientRect:m,...e});return x.useEffect(()=>{const p=Ht(n);if(p&&F.url(p),n.selection&&o.someNode(n,{match:{type:o.getPluginType(n,N)}})){F.show("edit",n.id),w();return}V.mode()==="edit"&&F.hide()},[n,r,w]),o.useHotkeys(d,p=>{p.preventDefault(),V.mode()==="edit"&&Fe(n)},{enableOnContentEditable:!0},[]),_r(),Gt(),{style:{...y,zIndex:1e3},...t,ref:o.useComposedRef(t.ref,f)}},nt=(e,{focused:t}={})=>{V.mode()||!t||o.isRangeAcrossBlocks(e,{at:e.selection})||o.someNode(e,{match:{type:o.getPluginType(e,N)}})||(F.text(o.getEditorString(e,e.selection)),F.show("insert",e.id))},Cr=({floatingOptions:e,...t})=>{const n=o.useEditorRef(),r=It.useFocused(),s=xe().mode(),c=xe().isOpen(n.id),{triggerFloatingButtonHotkeys:d}=o.getPluginOptions(n,N);o.useHotkeys(d,y=>{y.preventDefault(),nt(n,{focused:r})},{enableOnContentEditable:!0},[r]);const{update:m,style:u,floating:w}=Kt({open:c&&s==="insert",getBoundingClientRect:o.getSelectionBoundingClientRect,whileElementsMounted:void 0,...e});return x.useEffect(()=>{c&&m(),F.updated(c)},[c,m]),Gt(),{style:{...u,zIndex:1e3},...t,ref:o.useComposedRef(t.ref,w)}},Sr=e=>{const t=o.useEditorRef();return{onClick:x.useCallback(()=>{Fe(t)},[t]),...e}},Tr=o.createComponentAs(e=>{const t=Sr(e);return o.createElementAs("button",t)}),zt=(e,t,n)=>{o.insertNodes(e,[Vt(e,t)],n)},rt=e=>{if(!e.selection)return;const{isUrl:t,forceSubmit:n}=o.getPluginOptions(e,N),r=V.url();if(!((t==null?void 0:t(r))||n))return;const c=V.text(),d=V.buttonStyle(),m=V.newTab()?void 0:"_self";return F.hide(),Wt(e,{url:r,text:c,buttonStyle:d,target:m,isUrl:u=>n||!t?!0:t(u)}),setTimeout(()=>{o.focusEditor(e,e.selection??void 0)},0),!0},pe=(e,t)=>o.withoutNormalizing(e,()=>{var n,r,s,c,d,m;if(t!=null&&t.split){if(o.getAboveNode(e,{at:(n=e.selection)==null?void 0:n.anchor,match:{type:o.getPluginType(e,N)}}))return o.splitNodes(e,{at:(r=e.selection)==null?void 0:r.anchor,match:y=>o.isElement(y)&&y.type===o.getPluginType(e,N)}),pe(e,{at:(s=e.selection)==null?void 0:s.anchor}),!0;if(o.getAboveNode(e,{at:(c=e.selection)==null?void 0:c.focus,match:{type:o.getPluginType(e,N)}}))return o.splitNodes(e,{at:(d=e.selection)==null?void 0:d.focus,match:y=>o.isElement(y)&&y.type===o.getPluginType(e,N)}),pe(e,{at:(m=e.selection)==null?void 0:m.focus}),!0}o.unwrapNodes(e,{match:{type:o.getPluginType(e,N)},...t})}),Wt=(e,{url:t,text:n,buttonStyle:r,target:s,insertTextInButton:c,insertNodesOptions:d,isUrl:m=o.getPluginOptions(e,N).isUrl})=>{var R;const u=e.selection;if(!u)return;const w=o.getAboveNode(e,{at:u,match:{type:o.getPluginType(e,N)}});if(c&&w)return e.insertText(t),!0;if(!(m!=null&&m(t)))return;if(o.isDefined(n)&&n.length===0&&(n=t),w)return Rr(t,e,w,s,r,n),!0;const y=o.findNode(e,{at:u,match:{type:o.getPluginType(e,N)}}),[f,p]=y??[],P=Pr(e,p,n);if(o.isExpanded(u))return Ir(w,e,t,r,s,n),!0;P&&o.removeNodes(e,{at:p});const B=o.getNodeProps(f??{}),U=(R=e.selection)==null?void 0:R.focus.path;if(!U)return;const z=o.getNodeLeaf(e,U);return n!=null&&n.length||(n=t),zt(e,{...B,url:t,target:s,children:[{...z,text:n}]},d),!0};function Pr(e,t,n){return t&&(n==null?void 0:n.length)&&n!==o.getEditorString(e,t)}function Ir(e,t,n,r,s,c){e?pe(t,{at:e[1]}):pe(t,{split:!0}),$t(t,{url:n,buttonStyle:r,target:s}),st(t,{url:n,target:s,text:c})}function Rr(e,t,n,r,s,c){var d,m,u;(e!==((d=n[0])==null?void 0:d.url)||r!==((m=n[0])==null?void 0:m.target)||s!==((u=n[0])==null?void 0:u.buttonStyle))&&o.setNodes(t,{url:e,target:r,buttonStyle:s},{at:n[1]}),st(t,{url:e,text:c,target:r})}const st=(e,{text:t})=>{const n=o.getAboveNode(e,{match:{type:o.getPluginType(e,N)}});if(n){const[r,s]=n;if(t!=null&&t.length&&t!==o.getEditorString(e,s)){const c=r.children[0];o.replaceNodeChildren(e,{at:s,nodes:{...c,text:t},insertOptions:{select:!0}})}}},$t=(e,{url:t,buttonStyle:n,target:r,...s})=>{o.wrapNodes(e,{type:o.getPluginType(e,N),url:t,buttonStyle:n,target:r,children:[]},{split:!0,...s})},jr=e=>{const t=o.useEditorRef();return{onClick:x.useCallback(()=>{pe(t),o.focusEditor(t,t.selection??void 0)},[t]),...e}},Lr=o.createComponentAs(e=>{const t=jr(e);return o.createElementAs(o.Button,t)}),Nr=o.createComponentAs(e=>{var n;const t=Er(e);return((n=t.style)==null?void 0:n.display)==="none"?null:o.createElementAs("div",t)}),Ar=o.createComponentAs(e=>{var n;const t=Cr(e);return((n=t.style)==null?void 0:n.display)==="none"?null:o.createElementAs("div",t)}),Me={EditRoot:Nr,InsertRoot:Ar,EditButton:Tr,UnlinkButton:Lr},Br=e=>{const t=xe().updated(),n=x.useRef(null);x.useEffect(()=>{n.current&&t&&setTimeout(()=>{var s;(s=n.current)==null||s.focus()},0)},[t]);const r=x.useCallback(s=>{F.url(s.target.value)},[]);return o.mergeProps({onChange:r,defaultValue:V.url()},{...e,ref:o.useComposedRef(e.ref,n)})},_r=()=>{const e=o.useEditorRef();o.useHotkeys("*",t=>{t.key==="Enter"&&rt(e)&&t.preventDefault()},{enableOnFormTags:["INPUT"]},[])},Gt=()=>{const e=o.useEditorRef();o.useHotkeys("escape",()=>{if(V.mode()==="edit"){if(V.isEditing()){F.show("edit",e.id),o.focusEditor(e,e.selection??void 0);return}F.hide()}},{enableOnFormTags:["INPUT"],enableOnContentEditable:!0},[])},Or=12,Fr=-22,Mr=96,Kt=e=>o.useVirtualFloating({placement:"bottom-start",middleware:[o.offset({mainAxis:Or,alignmentAxis:Fr}),o.flip({padding:Mr})],...e}),Yt=(e,{focused:t}={})=>{if(V.mode()==="edit"){Fe(e);return}nt(e,{focused:t})},De={buttonPrimary:{fontFamily:"var(--f-theme-settings-button-primary-font-family)",fontSize:"var(--f-theme-settings-button-primary-font-size)",fontWeight:"var(--f-theme-settings-button-primary-font-weight)",lineHeight:"var(--f-theme-settings-button-primary-line-height)",paddingTop:"var(--f-theme-settings-button-primary-padding-top)",paddingRight:"var(--f-theme-settings-button-primary-padding-right)",paddingBottom:"var(--f-theme-settings-button-primary-padding-bottom)",paddingLeft:"var(--f-theme-settings-button-primary-padding-left)",fontStyle:"var(--f-theme-settings-button-primary-font-style)",textTransform:"var(--f-theme-settings-button-primary-text-transform)",backgroundColor:"var(--f-theme-settings-button-primary-background-color)",borderColor:"var(--f-theme-settings-button-primary-border-color)",borderRadius:"var(--f-theme-settings-button-primary-border-radius)",borderWidth:"var(--f-theme-settings-button-primary-border-width)",color:"var(--f-theme-settings-button-primary-color)",display:"inline-block",hover:{backgroundColor:"var(--f-theme-settings-button-primary-background-color-hover)",borderColor:"var(--f-theme-settings-button-primary-border-color-hover)",color:"var(--f-theme-settings-button-primary-color-hover)"}},buttonSecondary:{fontFamily:"var(--f-theme-settings-button-secondary-font-family)",fontSize:"var(--f-theme-settings-button-secondary-font-size)",fontWeight:"var(--f-theme-settings-button-secondary-font-weight)",lineHeight:"var(--f-theme-settings-button-secondary-line-height)",paddingTop:"var(--f-theme-settings-button-secondary-padding-top)",paddingRight:"var(--f-theme-settings-button-secondary-padding-right)",paddingBottom:"var(--f-theme-settings-button-secondary-padding-bottom)",paddingLeft:"var(--f-theme-settings-button-secondary-padding-left)",fontStyle:"var(--f-theme-settings-button-secondary-font-style)",textTransform:"var(--f-theme-settings-button-secondary-text-transform)",backgroundColor:"var(--f-theme-settings-button-secondary-background-color)",borderColor:"var(--f-theme-settings-button-secondary-border-color)",borderRadius:"var(--f-theme-settings-button-secondary-border-radius)",borderWidth:"var(--f-theme-settings-button-secondary-border-width)",color:"var(--f-theme-settings-button-secondary-color)",display:"inline-block",hover:{backgroundColor:"var(--f-theme-settings-button-secondary-background-color-hover)",borderColor:"var(--f-theme-settings-button-secondary-border-color-hover)",color:"var(--f-theme-settings-button-secondary-color-hover)"}},buttonTertiary:{fontFamily:"var(--f-theme-settings-button-tertiary-font-family)",fontSize:"var(--f-theme-settings-button-tertiary-font-size)",fontWeight:"var(--f-theme-settings-button-tertiary-font-weight)",lineHeight:"var(--f-theme-settings-button-tertiary-line-height)",paddingTop:"var(--f-theme-settings-button-tertiary-padding-top)",paddingRight:"var(--f-theme-settings-button-tertiary-padding-right)",paddingBottom:"var(--f-theme-settings-button-tertiary-padding-bottom)",paddingLeft:"var(--f-theme-settings-button-tertiary-padding-left)",fontStyle:"var(--f-theme-settings-button-tertiary-font-style)",textTransform:"var(--f-theme-settings-button-tertiary-text-transform)",backgroundColor:"var(--f-theme-settings-button-tertiary-background-color)",borderColor:"var(--f-theme-settings-button-tertiary-border-color)",borderRadius:"var(--f-theme-settings-button-tertiary-border-radius)",borderWidth:"var(--f-theme-settings-button-tertiary-border-width)",color:"var(--f-theme-settings-button-tertiary-color)",display:"inline-block",hover:{backgroundColor:"var(--f-theme-settings-button-tertiary-background-color-hover)",borderColor:"var(--f-theme-settings-button-tertiary-border-color-hover)",color:"var(--f-theme-settings-button-tertiary-color-hover)"}}},Dr=e=>({...o.useElementProps({...e,elementToAttributes:n=>({url:n.href,buttonStyle:n.buttonStyle||"primary",target:n.target||"_blank"})}),onMouseOver:n=>{n.stopPropagation()}}),Ur=e=>{const{href:t,target:n,buttonStyle:r}=Dr(e),{attributes:s,children:c}=e;return a.jsx(Hr,{attributes:s,href:t,target:n,styles:De[`button${r.charAt(0).toUpperCase()+r.slice(1)}`],children:c})},Hr=({attributes:e,styles:t={hover:{}},children:n,href:r="#",target:s})=>{const[c,d]=x.useState(!1);return a.jsx("a",{...e,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),href:r,target:s,style:c?{...t,...t.hover}:t,children:n})};class Vr extends l.MarkupElement{constructor(t=N,n=Ur){super(t,n)}}const zr=({type:e,...t})=>{const n=o.useEditorRef(),r=!!o.isRangeInSameBlock(n,{at:n.selection}),s=!!(n!=null&&n.selection)&&o.someNode(n,{match:{type:e}});return a.jsx(o.ToolbarButton,{tooltip:l.getTooltip(r?`Button
28
+ ${l.getHotkeyByPlatform("Ctrl+Shift+K")}`:"Buttons can only be set for a single text block."),classNames:l.getButtonClassNames(r),active:s,onMouseDown:async c=>{n&&(c.preventDefault(),c.stopPropagation(),o.focusEditor(n,n.selection??n.prevSelection??void 0),setTimeout(()=>{Yt(n,{focused:!0})},0))},...t})},Wr=({editor:e,id:t})=>a.jsx("div",{"data-plugin-id":t,children:a.jsx(zr,{type:o.getPluginType(e,N),icon:a.jsx("span",{className:"tw-p-2 tw-h-8 tw-justify-center tw-items-center tw-flex",children:a.jsx(l.IconButton16,{})}),styles:l.buttonStyles})}),$r=()=>{const e=Br({});return a.jsx("div",{"data-test-id":"floating-button-edit",className:"tw-bg-white tw-rounded tw-shadow tw-p-4 tw-min-w-[400px]",children:a.jsxs("span",{"data-test-id":"preview-button-flyout",className:"tw-flex tw-justify-between",children:[a.jsx("span",{className:"tw-pointer-events-none",style:M.p,children:e.defaultValue}),a.jsxs("span",{className:"tw-flex tw-gap-2",children:[a.jsx("span",{role:"button",tabIndex:0,"data-test-id":"edit-button-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",children:a.jsx(Me.EditButton,{children:a.jsx(l.IconPen16,{})})}),a.jsx("span",{role:"button",tabIndex:0,"data-test-id":"remove-button-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",children:a.jsx(Me.UnlinkButton,{children:a.jsx(l.IconTrashBin16,{})})})]})]})})},Gr=({section:e,selectedUrl:t,onSelectUrl:n})=>{const r=e.permanentLink===t;return a.jsx("button",{"data-test-id":"internal-link-selector-section-link",className:l.merge(["tw-py-2 tw-px-2.5 tw-pl-14 tw-leading-5 tw-cursor-pointer tw-w-full",r?"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":"hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover"]),onClick:()=>n(e.permanentLink),onFocus:()=>n(e.permanentLink),children:a.jsxs("div",{className:"tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-h-6",children:[a.jsx(l.IconDocumentText16,{}),a.jsx("span",{className:"tw-text-s",children:e.title}),a.jsx("span",{className:"tw-flex-auto tw-font-sans tw-text-xs tw-text-right",children:"Section"})]})})},Kr=({page:e,selectedUrl:t,onSelectUrl:n,itemsToExpandInitially:r,appBridge:s})=>{const[c,d]=x.useState(e.id===r.documentId),m=e.permanentLink===t,{documentSections:u}=ce.useDocumentSection(s,e.id),w=[...u.values()],y=w.length>0;return x.useEffect(()=>{e.id===r.pageId&&d(!0)},[r,e.id]),a.jsxs(a.Fragment,{children:[a.jsx("div",{tabIndex:0,"data-test-id":"internal-link-selector-page-link",className:l.merge(["tw-py-2 tw-px-2.5 tw-leading-5 tw-cursor-pointer",y?"tw-pl-7":"tw-pl-12",m?"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":"hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover"]),onClick:()=>n(e.permanentLink),onFocus:()=>n(e.permanentLink),children:a.jsxs("div",{className:"tw-flex tw-flex-1 tw-space-x-1 tw-items-center tw-h-6",children:[y&&a.jsx("button",{"data-test-id":"tree-item-toggle",className:"tw-flex tw-items-center tw-justify-center tw-p-1.5 tw-cursor-pointer",onClick:()=>d(!c),onFocus:()=>d(!c),children:a.jsx("div",{className:l.merge(["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",c?"tw-rotate-90":""])})}),a.jsx("span",{className:"tw-text-s",children:e.title}),a.jsx("span",{className:"tw-flex-auto tw-font-sans tw-text-xs tw-text-right",children:"Page"})]},e.id)}),c&&w.length>0&&w.map(f=>a.jsx(Gr,{section:f,selectedUrl:t,onSelectUrl:n},f.id))]})},Yr=({appBridge:e,documentId:t,selectedUrl:n,onSelectUrl:r,itemsToExpandInitially:s})=>{const[c,d]=x.useState([]),[m,u]=x.useState(!0),w=[...c.values()],y=!m&&w.length>0;return x.useEffect(()=>{e.getDocumentPagesByDocumentId(t).then(f=>{d(f)}).finally(()=>{u(!1)})},[]),m?a.jsx("div",{className:"tw-flex tw-justify-center tw-p-4",children:a.jsx(l.LoadingCircle,{})}):y?a.jsx(a.Fragment,{children:w.map(f=>a.jsx(Kr,{page:f,appBridge:e,selectedUrl:n,onSelectUrl:r,itemsToExpandInitially:s},f.id))}):a.jsx("div",{className:"tw-py-2 tw-px-2.5 tw-pl-7 tw-leading-5 tw-text-s tw-text-text-weak",children:"This document does not contain any pages."})},Xr=({document:e,appBridge:t,selectedUrl:n,onSelectUrl:r,itemsToExpandInitially:s})=>{const[c,d]=x.useState(e.id===s.documentId),m=e.permanentLink===n;return x.useEffect(()=>{e.id===s.documentId&&d(!0)},[s,e.id]),a.jsxs(a.Fragment,{children:[a.jsxs("button",{"data-test-id":"internal-link-selector-document-link",className:l.merge(["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",m?"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":"hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover"]),onClick:()=>r(e.permanentLink),onFocus:()=>r(e.permanentLink),children:[a.jsx("div",{role:"button",tabIndex:0,"data-test-id":"tree-item-toggle",className:"tw-flex tw-items-center tw-justify-center tw-p-1.5 tw-cursor-pointer",onClick:()=>d(!c),onFocus:()=>d(!c),children:a.jsx("div",{className:l.merge(["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",c?"tw-rotate-90":""])})}),a.jsx(l.IconColorFan16,{}),a.jsx("span",{className:"tw-text-s",children:e.title}),a.jsx("span",{className:"tw-flex-auto tw-font-sans tw-text-xs tw-text-right",children:"Document"})]}),c&&a.jsx(Yr,{appBridge:t,documentId:e.id,selectedUrl:n,onSelectUrl:r,itemsToExpandInitially:s})]})},Jr=({appBridge:e,selectedUrl:t,onSelectUrl:n})=>{const[r,s]=x.useState(!0),[c,d]=x.useState([]),[m,u]=x.useState({documentId:void 0,pageId:void 0}),w=[...c.values()];x.useEffect(()=>{t&&w.length>0&&y().then(f=>{u(f)})},[w.length]),x.useEffect(()=>{e.getAllDocuments().then(f=>{d(f)}).finally(()=>{s(!1)})},[]);const y=async()=>{const f={documentId:void 0,pageId:void 0};if(w.find(P=>P.permanentLink===t))return f;for(const P of w){const B=await e.getDocumentPagesByDocumentId(P.id);e.getAllDocuments();const U=[...B.values()];if(!!U.find(R=>R.permanentLink===t))return f.documentId=P.id,f;for(const R of U)if(!![...(await e.getDocumentSectionsByDocumentPageId(R.id)).values()].find(K=>K.permanentLink===t))return f.documentId=P.id,f.pageId=R.id,f}return f};return r?a.jsx("div",{className:"tw-flex tw-justify-center tw-p-4",children:a.jsx(l.LoadingCircle,{})}):a.jsx(a.Fragment,{children:w.map(f=>a.jsx(Xr,{document:f,appBridge:e,selectedUrl:t,onSelectUrl:n,itemsToExpandInitially:m},f.id))})},Qr=({appBridge:e,url:t,onUrlChange:n})=>{const{open:r,isOpen:s,close:c}=Un.useOverlayTriggerState({}),[d,m]=x.useState(t),u=f=>{m(f)},w=f=>{f.key==="Enter"&&y()};x.useEffect(()=>{t&&!d&&m(t)},[t,d]);const y=()=>{n(d),c()};return a.jsxs("div",{"data-test-id":"internal-link-selector",onKeyDown:w,children:[a.jsx(l.Button,{icon:a.jsx(l.IconLink,{}),size:l.ButtonSize.Medium,type:l.ButtonType.Button,style:l.ButtonStyle.Default,emphasis:l.ButtonEmphasis.Default,onClick:()=>r(),children:"Internal link"}),a.jsxs(l.Modal,{zIndex:1001,onClose:()=>c(),isOpen:s,isDismissable:!0,children:[a.jsx(l.Modal.Header,{title:"Select internal link"}),a.jsx(l.Modal.Body,{children:a.jsx(Jr,{appBridge:e,selectedUrl:d,onSelectUrl:u})}),a.jsx(l.Modal.Footer,{buttons:[{children:"Cancel",onClick:()=>c(),style:l.ButtonStyle.Default,emphasis:l.ButtonEmphasis.Default},{children:"Choose",onClick:f=>{f==null||f.preventDefault(),y()},style:l.ButtonStyle.Default,emphasis:l.ButtonEmphasis.Strong,disabled:!d}]})]})]})},Xt=({state:e,onTextChange:t,onUrlChange:n,onToggleTab:r,onCancel:s,onSave:c,isValidUrlOrEmpty:d,hasValues:m,testId:u,appBridge:w,children:y})=>a.jsxs("div",{"data-test-id":u,className:"tw-bg-white tw-rounded tw-shadow tw-p-7 tw-min-w-[400px] tw-overflow-y-auto",children:[a.jsx(l.FormControl,{label:{children:"Text",htmlFor:"linkText",required:!0},children:a.jsx(l.TextInput,{id:"linkText",value:e.text,placeholder:"Link Text",onChange:t})}),y,a.jsxs("div",{className:"tw-pt-5",children:[a.jsx(l.FormControl,{label:{children:"URL",htmlFor:"url",required:!0},children:a.jsx(l.TextInput,{id:"url",value:e.url,placeholder:"https://example.com",focusOnMount:!0,onChange:n})}),!d(e==null?void 0:e.url)&&a.jsx("div",{className:"tw-text-red-65 tw-mt-3",children:"Please enter a valid URL."})]}),a.jsx("div",{className:"tw-mt-3",children:a.jsx(Qr,{url:e.url,appBridge:w,onUrlChange:n})}),a.jsx("div",{className:"tw-mt-3",children:a.jsx(l.Checkbox,{value:"new-tab",label:"Open in new tab",state:e.newTab,onChange:r})}),a.jsx("div",{className:"tw-mt-3",children:a.jsxs("div",{className:"tw-pt-5 tw-flex tw-gap-x-3 tw-justify-end tw-border-t tw-border-t-black-10",children:[a.jsx(l.Button,{onClick:s,size:l.ButtonSize.Medium,style:l.ButtonStyle.Default,emphasis:l.ButtonEmphasis.Default,children:"Cancel"}),a.jsx(l.Button,{onClick:c,size:l.ButtonSize.Medium,icon:a.jsx(l.IconCheckMark20,{}),disabled:!m||!d(e==null?void 0:e.url),children:"Save"})]})})]}),Zr=e=>{var n;const t=o.getAboveNode(e,{match:{type:N}});return Array.isArray(t)&&((n=t[0])==null?void 0:n.buttonStyle)||"primary"},qr={url:"",text:"",buttonStyle:"primary",newTab:l.CheckboxState.Unchecked},es=()=>{const[e,t]=x.useReducer((n,r)=>{const{type:s,payload:c}=r;switch(s){case"NEW_TAB":return{...n,newTab:l.CheckboxState.Checked};case"SAME_TAB":return{...n,newTab:l.CheckboxState.Unchecked};case"URL":case"TEXT":case"BUTTON_STYLE":case"INIT":return{...n,...c};default:return n}},qr);return[e,t]},ts=()=>{const e=o.useEditorRef(),[t,n]=es();x.useEffect(()=>{const f=Zr(e);n({type:"INIT",payload:{text:V.text(),buttonStyle:f,newTab:V.newTab()?l.CheckboxState.Checked:l.CheckboxState.Unchecked,url:V.url()}})},[n,e]);const r=f=>{n({type:"TEXT",payload:{text:f}})},s=f=>{n({type:"BUTTON_STYLE",payload:{buttonStyle:f}})},c=f=>{n({type:"URL",payload:{url:f}})},d=f=>{n(f?{type:"NEW_TAB"}:{type:"SAME_TAB"})},m=()=>{F.hide()},u=f=>{if(!Oe(t.url)||!w)return;const p=_e(t.url);F.text(t.text),F.url(p),F.buttonStyle(t.buttonStyle),F.newTab(t.newTab===l.CheckboxState.Checked),rt(e)&&(f==null||f.preventDefault())},w=t.url!==""&&t.text!=="",{appBridge:y}=o.getPluginOptions(e,N);return o.useHotkeys("enter",u,{enableOnFormTags:["INPUT"]},[]),{state:t,onTextChange:r,onButtonStyleChange:s,onUrlChange:c,onToggleTab:d,onCancel:m,onSave:u,hasValues:w,isValidUrlOrEmpty:Oe,appBridge:y}},ns=()=>{const e=ts(),{state:t,onButtonStyleChange:n}=e;return a.jsx(Xt,{...e,testId:"floating-button-insert",children:a.jsx("div",{className:"tw-pt-5",children:a.jsxs(l.FormControl,{label:{children:"Button Style",htmlFor:"buttonStyle",required:!0},children:[a.jsx(at,{id:"primary",styles:M.buttonPrimary,isActive:t.buttonStyle==="primary",onClick:()=>n("primary"),children:t.text||"Primary Button"}),a.jsx(at,{id:"secondary",styles:M.buttonSecondary,isActive:t.buttonStyle==="secondary",onClick:()=>n("secondary"),children:t.text||"Secondary Button"}),a.jsx(at,{id:"tertiary",styles:M.buttonTertiary,isActive:t.buttonStyle==="tertiary",onClick:()=>n("tertiary"),children:t.text||"Tertiary Button"})]})})})},at=({id:e,styles:t,isActive:n,onClick:r,children:s})=>{const[c,d]=x.useState(!1),m=()=>t&&t.hover&&c?{...t,...t.hover}:t;return a.jsx("button",{"data-test-id":`floating-button-insert-${e}`,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:r,style:m(),className:n?"tw-outline tw-outline-1 tw-outline-violet-60 tw-outline-offset-2 tw-w-fit":"tw-w-fit",children:s})},rs=()=>{const e=xe().isEditing(),t=a.jsx(ns,{}),n=e?t:a.jsx($r,{});return a.jsxs(a.Fragment,{children:[a.jsx(Me.InsertRoot,{children:t}),a.jsx(Me.EditRoot,{children:n})]})},Jt=(e,{type:t})=>{const{apply:n,normalizeNode:r}=e;return e.apply=s=>{if(s.type!=="set_selection"){n(s);return}const c=s.newProperties;if(!(c!=null&&c.focus)||!c.anchor||!o.isCollapsed(c)){n(s);return}const d=o.getAboveNode(e,{at:c,match:{type:o.getPluginType(e,N)}});if(d){const[,m]=d;let u;o.isStartPoint(e,c.focus,m)&&(u=o.getPreviousNodeEndPoint(e,m)),o.isEndPoint(e,c.focus,m)&&(u=o.getNextNodeStartPoint(e,m)),u&&(s.newProperties={anchor:u,focus:u})}n(s)},e.normalizeNode=([s,c])=>{if(s.type===o.getPluginType(e,N)){const d=e.selection;if(d&&o.isCollapsed(d)&&o.isEndPoint(e,d.focus,c)){const m=o.getNextNodeStartPoint(e,c);if(m)o.select(e,m);else{const u=Hn.Path.next(c);o.insertNodes(e,{text:""},{at:u}),o.select(e,u)}}}r([s,c])},o.withRemoveEmptyNodes(e,o.mockPlugin({options:{types:t}}))},N="button",it="button-plugin",Qt=e=>o.createPluginFactory({key:N,isElement:!0,isInline:!0,props:({element:t})=>({nodeProps:{href:t==null?void 0:t.url,target:t==null?void 0:t.target}}),withOverrides:Jt,renderAfterEditable:rs,options:{isUrl:et,rangeBeforeOptions:{matchString:" ",skipInvalid:!0,afterMatch:!0},triggerFloatingButtonHotkeys:"command+shift+k, ctrl+shift+k",appBridge:e},then:(t,{type:n})=>({deserializeHtml:{rules:[{validNodeName:"A",validClassName:"btn"}],getNode:r=>({type:n,url:r.getAttribute("href"),target:r.getAttribute("target")||"_blank"})}})})();class Zt extends l.Plugin{constructor({styles:t=De,...n}){super(it,{button:Wr,markupElement:new Vr,...n}),this.styles={},this.styles=t,this.appBridge=n==null?void 0:n.appBridge}plugins(){return[Qt(this.appBridge)]}}var k=(e=>(e.heading1="heading1",e.heading2="heading2",e.heading3="heading3",e.heading4="heading4",e.custom1="custom1",e.custom2="custom2",e.custom3="custom3",e.quote="quote",e.imageCaption="imageCaption",e.imageTitle="imageTitle",e.p="p",e))(k||{});const M={heading1:{display:"inline-block",fontSize:"var(--f-theme-settings-heading1-font-size)",lineHeight:"var(--f-theme-settings-heading1-line-height)",marginTop:"var(--f-theme-settings-heading1-margin-top)",marginBottom:"var(--f-theme-settings-heading1-margin-bottom)",textDecoration:"var(--f-theme-settings-heading1-text-decoration)",fontStyle:"var(--f-theme-settings-heading1-font-style)",textTransform:"var(--f-theme-settings-heading1-text-transform)",letterSpacing:"var(--f-theme-settings-heading1-letter-spacing)",fontWeight:"var(--f-theme-settings-heading1-font-weight)",fontFamily:"var(--f-theme-settings-heading1-font-family)",color:"var(--f-theme-settings-heading1-color)"},heading2:{fontSize:"var(--f-theme-settings-heading2-font-size)",lineHeight:"var(--f-theme-settings-heading2-line-height)",marginTop:"var(--f-theme-settings-heading2-margin-top)",marginBottom:"var(--f-theme-settings-heading2-margin-bottom)",textDecoration:"var(--f-theme-settings-heading2-text-decoration)",fontStyle:"var(--f-theme-settings-heading2-font-style)",textTransform:"var(--f-theme-settings-heading2-text-transform)",letterSpacing:"var(--f-theme-settings-heading2-letter-spacing)",fontWeight:"var(--f-theme-settings-heading2-font-weight)",fontFamily:"var(--f-theme-settings-heading2-font-family)",color:"var(--f-theme-settings-heading2-color)"},heading3:{fontSize:"var(--f-theme-settings-heading3-font-size)",lineHeight:"var(--f-theme-settings-heading3-line-height)",marginTop:"var(--f-theme-settings-heading3-margin-top)",marginBottom:"var(--f-theme-settings-heading3-margin-bottom)",textDecoration:"var(--f-theme-settings-heading3-text-decoration)",fontStyle:"var(--f-theme-settings-heading3-font-style)",textTransform:"var(--f-theme-settings-heading3-text-transform)",letterSpacing:"var(--f-theme-settings-heading3-letter-spacing)",fontWeight:"var(--f-theme-settings-heading3-font-weight)",fontFamily:"var(--f-theme-settings-heading3-font-family)",color:"var(--f-theme-settings-heading3-color)"},heading4:{fontSize:"var(--f-theme-settings-heading4-font-size)",lineHeight:"var(--f-theme-settings-heading4-line-height)",marginTop:"var(--f-theme-settings-heading4-margin-top)",marginBottom:"var(--f-theme-settings-heading4-margin-bottom)",textDecoration:"var(--f-theme-settings-heading4-text-decoration)",fontStyle:"var(--f-theme-settings-heading4-font-style)",textTransform:"var(--f-theme-settings-heading4-text-transform)",letterSpacing:"var(--f-theme-settings-heading4-letter-spacing)",fontWeight:"var(--f-theme-settings-heading4-font-weight)",fontFamily:"var(--f-theme-settings-heading4-font-family)",color:"var(--f-theme-settings-heading4-color)"},custom1:{fontSize:"var(--f-theme-settings-custom1-font-size)",lineHeight:"var(--f-theme-settings-custom1-line-height)",marginTop:"var(--f-theme-settings-custom1-margin-top)",marginBottom:"var(--f-theme-settings-custom1-margin-bottom)",textDecoration:"var(--f-theme-settings-custom1-text-decoration)",fontStyle:"var(--f-theme-settings-custom1-font-style)",textTransform:"var(--f-theme-settings-custom1-text-transform)",letterSpacing:"var(--f-theme-settings-custom1-letter-spacing)",fontWeight:"var(--f-theme-settings-custom1-font-weight)",fontFamily:"var(--f-theme-settings-custom1-font-family)",color:"var(--f-theme-settings-custom1-color)"},custom2:{fontSize:"var(--f-theme-settings-custom2-font-size)",lineHeight:"var(--f-theme-settings-custom2-line-height)",marginTop:"var(--f-theme-settings-custom2-margin-top)",marginBottom:"var(--f-theme-settings-custom2-margin-bottom)",textDecoration:"var(--f-theme-settings-custom2-text-decoration)",fontStyle:"var(--f-theme-settings-custom2-font-style)",textTransform:"var(--f-theme-settings-custom2-text-transform)",letterSpacing:"var(--f-theme-settings-custom2-letter-spacing)",fontWeight:"var(--f-theme-settings-custom2-font-weight)",fontFamily:"var(--f-theme-settings-custom2-font-family)",color:"var(--f-theme-settings-custom2-color)"},custom3:{fontSize:"var(--f-theme-settings-custom3-font-size)",lineHeight:"var(--f-theme-settings-custom3-line-height)",marginTop:"var(--f-theme-settings-custom3-margin-top)",marginBottom:"var(--f-theme-settings-custom3-margin-bottom)",textDecoration:"var(--f-theme-settings-custom3-text-decoration)",fontStyle:"var(--f-theme-settings-custom3-font-style)",textTransform:"var(--f-theme-settings-custom3-text-transform)",letterSpacing:"var(--f-theme-settings-custom3-letter-spacing)",fontWeight:"var(--f-theme-settings-custom3-font-weight)",fontFamily:"var(--f-theme-settings-custom3-font-family)",color:"var(--f-theme-settings-custom3-color)"},p:{fontSize:"var(--f-theme-settings-body-font-size)",lineHeight:"var(--f-theme-settings-body-line-height)",marginTop:"var(--f-theme-settings-body-margin-top)",marginBottom:"var(--f-theme-settings-body-margin-bottom)",textDecoration:"var(--f-theme-settings-body-text-decoration)",fontStyle:"var(--f-theme-settings-body-font-style)",textTransform:"var(--f-theme-settings-body-text-transform)",letterSpacing:"var(--f-theme-settings-body-letter-spacing)",fontWeight:"var(--f-theme-settings-body-font-weight)",fontFamily:"var(--f-theme-settings-body-font-family)",color:"var(--f-theme-settings-body-color)"},quote:{fontSize:"var(--f-theme-settings-quote-font-size)",lineHeight:"var(--f-theme-settings-quote-line-height)",marginTop:"var(--f-theme-settings-quote-margin-top)",marginBottom:"var(--f-theme-settings-quote-margin-bottom)",textDecoration:"var(--f-theme-settings-quote-text-decoration)",fontStyle:"var(--f-theme-settings-quote-font-style)",textTransform:"var(--f-theme-settings-quote-text-transform)",letterSpacing:"var(--f-theme-settings-quote-letter-spacing)",fontWeight:"var(--f-theme-settings-quote-font-weight)",fontFamily:"var(--f-theme-settings-quote-font-family)",color:"var(--f-theme-settings-quote-color)"},imageCaption:{fontSize:"var(--f-theme-settings-image-caption-font-size)",lineHeight:"var(--f-theme-settings-image-caption-line-height)",marginTop:"var(--f-theme-settings-image-caption-margin-top)",marginBottom:"var(--f-theme-settings-image-caption-margin-bottom)",textDecoration:"var(--f-theme-settings-image-caption-text-decoration)",fontStyle:"var(--f-theme-settings-image-caption-font-style)",textTransform:"var(--f-theme-settings-image-caption-text-transform)",letterSpacing:"var(--f-theme-settings-image-caption-letter-spacing)",fontWeight:"var(--f-theme-settings-image-caption-font-weight)",fontFamily:"var(--f-theme-settings-image-caption-font-family)",color:"var(--f-theme-settings-image-caption-color)"},imageTitle:{fontSize:"var(--f-theme-settings-image-title-font-size)",lineHeight:"var(--f-theme-settings-image-title-line-height)",marginTop:"var(--f-theme-settings-image-title-margin-top)",marginBottom:"var(--f-theme-settings-image-title-margin-bottom)",textDecoration:"var(--f-theme-settings-image-title-text-decoration)",fontStyle:"var(--f-theme-settings-image-title-font-style)",textTransform:"var(--f-theme-settings-image-title-text-transform)",letterSpacing:"var(--f-theme-settings-image-title-letter-spacing)",fontWeight:"var(--f-theme-settings-image-title-font-weight)",fontFamily:"var(--f-theme-settings-image-title-font-family)",color:"var(--f-theme-settings-image-title-color)"},[be]:{fontSize:"var(--f-theme-settings-link-font-size)",lineHeight:"var(--f-theme-settings-link-line-height)",marginTop:"var(--f-theme-settings-link-margin-top)",marginBottom:"var(--f-theme-settings-link-margin-bottom)",textDecoration:"var(--f-theme-settings-link-text-decoration)",fontStyle:"var(--f-theme-settings-link-font-style)",textTransform:"var(--f-theme-settings-link-text-transform)",letterSpacing:"var(--f-theme-settings-link-letter-spacing)",fontWeight:"var(--f-theme-settings-link-font-weight)",fontFamily:"var(--f-theme-settings-link-font-family)",color:"var(--f-theme-settings-link-color)"},...De},ss=()=>{const e=o.useFloatingLinkUrlInput({});return a.jsx("div",{"data-test-id":"floating-link-edit",className:"tw-bg-white tw-rounded tw-shadow tw-p-4 tw-min-w-[400px]",children:a.jsxs("span",{"data-test-id":"preview-link-flyout",className:"tw-flex tw-justify-between",children:[a.jsx("span",{className:"tw-pointer-events-none",style:M.p,children:e.defaultValue}),a.jsxs("span",{className:"tw-flex tw-gap-2",children:[a.jsx("span",{role:"button",tabIndex:0,"data-test-id":"edit-link-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",children:a.jsx(Be.EditButton,{children:a.jsx(l.IconPen16,{})})}),a.jsx("span",{role:"button",tabIndex:0,"data-test-id":"remove-link-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",children:a.jsx(Be.UnlinkButton,{children:a.jsx(l.IconTrashBin16,{})})})]})]})})},as=({floatingOptions:e,...t})=>{const n=o.useEditorRef(),r=o.usePlateSelectors().keyEditor(),s=o.useFloatingLinkSelectors().mode(),c=o.useFloatingLinkSelectors().isOpen(n.id),{triggerFloatingLinkHotkeys:d="command+k, ctrl+k"}=o.getPluginOptions(n,o.ELEMENT_LINK),m=x.useCallback(()=>{const p=o.getAboveNode(n,{match:{type:o.getPluginType(n,o.ELEMENT_LINK)}});if(p){const[,P]=p;return o.getRangeBoundingClientRect(n,{anchor:o.getStartPoint(n,P),focus:o.getEndPoint(n,P)})}return o.getDefaultBoundingClientRect()},[n]),u=c&&s==="edit",{update:w,style:y,floating:f}=o.useVirtualFloatingLink({editorId:n.id,open:u,getBoundingClientRect:m,...e});return x.useEffect(()=>{const p=pr(n);if(p&&o.floatingLinkActions.url(p),n.selection&&o.someNode(n,{match:{type:o.getPluginType(n,o.ELEMENT_LINK)}})){o.floatingLinkActions.show("edit",n.id),w();return}o.floatingLinkSelectors.mode()==="edit"&&o.floatingLinkActions.hide()},[n,r,w]),o.useHotkeys(d,p=>{p.preventDefault(),o.floatingLinkSelectors.mode()==="edit"&&o.triggerFloatingLinkEdit(n)},{enableOnContentEditable:!0},[]),o.useFloatingLinkEnter(),o.useFloatingLinkEscape(),{style:{...y,zIndex:1e3},...t,ref:o.useComposedRef(t.ref,f)}},is={url:"",text:"",newTab:l.CheckboxState.Unchecked},ls=()=>{const[e,t]=x.useReducer((n,r)=>{const{type:s,payload:c}=r;switch(s){case"NEW_TAB":return{...n,newTab:l.CheckboxState.Checked};case"SAME_TAB":return{...n,newTab:l.CheckboxState.Unchecked};case"URL":case"TEXT":case"INIT":return{...n,...c};default:return n}},is);return[e,t]},os=()=>{const e=o.useEditorRef(),[t,n]=ls();x.useEffect(()=>{const y=vr(e),f=br(e);n({type:"INIT",payload:{text:o.floatingLinkSelectors.text(),newTab:o.floatingLinkSelectors.newTab()?l.CheckboxState.Checked:l.CheckboxState.Unchecked,url:y&&f===""?y:o.floatingLinkSelectors.url()}})},[n,e]);const r=y=>{n({type:"TEXT",payload:{text:y}})},s=y=>{n({type:"URL",payload:{url:y}})},c=y=>{n(y?{type:"NEW_TAB"}:{type:"SAME_TAB"})},d=()=>{o.floatingLinkActions.hide()},m=y=>{if(!Oe(t.url)||!u)return;const f=_e(t.url);o.floatingLinkActions.text(t.text),o.floatingLinkActions.url(f),o.floatingLinkActions.newTab(t.newTab===l.CheckboxState.Checked),o.submitFloatingLink(e)&&(y==null||y.preventDefault())},u=t.url!==""&&t.text!=="",{appBridge:w}=o.getPluginOptions(e,o.ELEMENT_LINK);return o.useHotkeys("enter",m,{enableOnFormTags:["INPUT"]},[]),{state:t,onTextChange:r,onUrlChange:s,onToggleTab:c,onCancel:d,onSave:m,hasValues:u,isValidUrlOrEmpty:Oe,appBridge:w}},cs=()=>a.jsx(Xt,{...os(),testId:"floating-link-insert"}),us=({readOnly:e})=>{const t=o.useFloatingLinkSelectors().isEditing();if(e)return null;const n=a.jsx(cs,{}),r=t?n:a.jsx(ss,{});return a.jsxs(a.Fragment,{children:[a.jsx(Be.InsertRoot,{children:n}),a.jsx(Be.EditRoot,{children:r})]})},ds=({id:e,editorId:t})=>{const n=o.usePlateEditorState(o.useEventPlateId(t)),r=!!o.isRangeInSameBlock(n,{at:n.selection});return a.jsx("div",{"data-plugin-id":e,children:a.jsx(o.LinkToolbarButton,{tooltip:l.getTooltip(r?`Link
29
+ ${l.getHotkeyByPlatform("Ctrl+K")}`:"Links can only be set for a single text block."),icon:a.jsx("span",{className:"tw-p-2 tw-h-8 tw-justify-center tw-items-center tw-flex",children:a.jsx(l.IconLink,{size:l.IconSize.Size16})}),classNames:l.getButtonClassNames(r),styles:{root:{width:"24px",height:"24px"}},actionHandler:"onMouseDown"})})},gs=e=>({...o.useElementProps({...e,elementToAttributes:n=>{var r,s;return{href:n.url||((s=(r=n.chosenLink)==null?void 0:r.searchResult)==null?void 0:s.link)||"",target:n.target||"_blank"}}}),onMouseOver:n=>{n.stopPropagation()}}),ms=e=>{const t=gs(e),{attributes:n,children:r}=e;return a.jsx("a",{...n,href:t.href,target:t.target,style:M[be],children:r})};class hs extends l.MarkupElement{constructor(t=o.ELEMENT_LINK,n=ms){super(t,n)}}const qt=e=>o.createPluginFactory({...o.createLinkPlugin(),renderAfterEditable:us,options:{isUrl:et,rangeBeforeOptions:{matchString:" ",skipInvalid:!0,afterMatch:!0},triggerFloatingLinkHotkeys:"command+k, ctrl+k",appBridge:e}})();class en extends l.Plugin{constructor(t,n=M[be]){super(be,{button:ds,markupElement:new hs,...t}),this.styles={},this.styles=n,this.appBridge=t==null?void 0:t.appBridge}plugins(){return[qt(this.appBridge)]}}const fs="textstyle-custom1-plugin";class tn extends l.Plugin{constructor({styles:t=M.custom1,...n}={}){super(k.custom1,{label:"Custom 1",markupElement:new ys,...n}),this.styles={},this.styles=t}plugins(){return[ws(this.styles)]}}class ys extends l.MarkupElement{constructor(t=fs,n=nn){super(t,n)}}const nn=({element:e,attributes:t,children:n,styles:r})=>{const s=e.align;return a.jsx("p",{...t,className:l.merge([s&&l.alignmentClassnames[s],l.getColumnBreakClasses(e),"a-custom1"]),children:a.jsx("span",{style:r,children:n})})},ws=e=>o.createPluginFactory({key:k.custom1,isElement:!0,deserializeHtml:{rules:[{validClassName:k.custom1}]}})({component:t=>a.jsx(nn,{...t,styles:e})}),vs="textstyle-custom2-plugin";class rn extends l.Plugin{constructor({styles:t=M.custom2,...n}={}){super(k.custom2,{label:"Custom 2",markupElement:new bs,...n}),this.styles={},this.styles=t}plugins(){return[xs(this.styles)]}}class bs extends l.MarkupElement{constructor(t=vs,n=sn){super(t,n)}}const sn=({element:e,attributes:t,children:n,styles:r})=>{const s=e.align;return a.jsx("p",{...t,className:l.merge([s&&l.alignmentClassnames[s],l.getColumnBreakClasses(e),"a-custom2"]),children:a.jsx("span",{style:r,children:n})})},xs=e=>o.createPluginFactory({key:k.custom2,isElement:!0,deserializeHtml:{rules:[{validClassName:k.custom2}]}})({component:t=>a.jsx(sn,{...t,styles:e})}),ps="textstyle-custom3-plugin";class an extends l.Plugin{constructor({styles:t=M.custom3,...n}={}){super(l.TextStyles.custom3,{label:"Custom 3",markupElement:new ks,...n}),this.styles={},this.styles=t}plugins(){return[Es(this.styles)]}}class ks extends l.MarkupElement{constructor(t=ps,n=ln){super(t,n)}}const ln=({element:e,attributes:t,children:n,styles:r})=>{const s=e.align;return a.jsx("p",{...t,className:l.merge([s&&l.alignmentClassnames[s],l.getColumnBreakClasses(e),"a-custom3"]),children:a.jsx("span",{style:r,children:n})})},Es=e=>o.createPluginFactory({key:l.TextStyles.custom3,isElement:!0,deserializeHtml:{rules:[{validClassName:l.TextStyles.custom3}]}})({component:t=>a.jsx(ln,{...t,styles:e})}),Cs="textstyle-heading1-plugin";class on extends l.Plugin{constructor({styles:t=M.heading1,...n}={}){super(k.heading1,{label:"Heading 1",markupElement:new Ss,...n}),this.styles={},this.styles=t}plugins(){return[Ts(this.styles)]}}class Ss extends l.MarkupElement{constructor(t=Cs,n=lt){super(t,n)}}const lt=({element:e,attributes:t,children:n,styles:r})=>{const s=e.align;return a.jsx("h1",{...t,className:l.merge([s&&l.alignmentClassnames[s],l.getColumnBreakClasses(e),"a-h1"]),children:a.jsx("span",{style:r,children:n})})},Ts=e=>o.createPluginFactory({key:k.heading1,isElement:!0,component:lt,deserializeHtml:{rules:[{validNodeName:["h1","H1"]}]}})({component:t=>a.jsx(lt,{...t,styles:e})}),Ps="textstyle-heading2-plugin";class cn extends l.Plugin{constructor({styles:t=M.heading2,...n}={}){super(k.heading2,{label:"Heading 2",markupElement:new Is,...n}),this.styles={},this.styles=t}plugins(){return[Rs(this.styles)]}}class Is extends l.MarkupElement{constructor(t=Ps,n=ot){super(t,n)}}const ot=({element:e,attributes:t,children:n,styles:r})=>{const s=e.align;return a.jsx("h2",{...t,className:l.merge([s&&l.alignmentClassnames[s],l.getColumnBreakClasses(e)]),children:a.jsx("span",{style:r,children:n})})},Rs=e=>o.createPluginFactory({key:k.heading2,isElement:!0,component:ot,deserializeHtml:{rules:[{validNodeName:["h2","H2"]}]}})({component:t=>a.jsx(ot,{...t,styles:e})}),js="textstyle-heading3-plugin";class un extends l.Plugin{constructor({styles:t=M.heading3,...n}={}){super(k.heading3,{label:"Heading 3",markupElement:new Ls,...n}),this.styles={},this.styles=t}plugins(){return[Ns(this.styles)]}}class Ls extends l.MarkupElement{constructor(t=js,n=ct){super(t,n)}}const ct=({element:e,attributes:t,children:n,styles:r})=>{const s=e.align;return a.jsx("h3",{...t,className:l.merge([s&&l.alignmentClassnames[s],l.getColumnBreakClasses(e)]),children:a.jsx("span",{style:r,children:n})})},Ns=e=>o.createPluginFactory({key:k.heading3,isElement:!0,component:ct,deserializeHtml:{rules:[{validNodeName:["h3","H3"]}]}})({component:t=>a.jsx(ct,{...t,styles:e})}),As="textstyle-heading4-plugin";class dn extends l.Plugin{constructor({styles:t=M.heading4,...n}={}){super(k.heading4,{label:"Heading 4",markupElement:new Bs,...n}),this.styles={},this.styles=t}plugins(){return[_s(this.styles)]}}class Bs extends l.MarkupElement{constructor(t=As,n=ut){super(t,n)}}const ut=({element:e,attributes:t,children:n,styles:r})=>{const s=e.align;return a.jsx("h4",{...t,className:l.merge([s&&l.alignmentClassnames[s],l.getColumnBreakClasses(e)]),children:a.jsx("span",{style:r,children:n})})},_s=e=>o.createPluginFactory({key:k.heading4,isElement:!0,component:ut,deserializeHtml:{rules:[{validNodeName:["h4","H4"]}]}})({component:t=>a.jsx(ut,{...t,styles:e})}),Os="textstyle-imageCaption-plugin";class gn extends l.Plugin{constructor({styles:t=M.imageCaption,...n}={}){super(k.imageCaption,{label:"Image Caption",markupElement:new Fs,...n}),this.styles={},this.styles=t}plugins(){return[Ms(this.styles)]}}class Fs extends l.MarkupElement{constructor(t=Os,n=dt){super(t,n)}}const dt=({element:e,attributes:t,children:n,styles:r})=>{const s=e.align;return a.jsx("p",{...t,className:l.merge([s&&l.alignmentClassnames[s],l.getColumnBreakClasses(e),"a-image-caption"]),children:a.jsx("span",{style:r,children:n})})},Ms=e=>o.createPluginFactory({key:k.imageCaption,isElement:!0,component:dt,deserializeHtml:{rules:[{validClassName:k.imageCaption}]}})({component:t=>a.jsx(dt,{...t,styles:e})}),Ds="textstyle-imageTitle-plugin";class mn extends l.Plugin{constructor({styles:t=M.imageTitle,...n}={}){super(k.imageTitle,{label:"Image Title",markupElement:new Us,...n}),this.styles={},this.styles=t}plugins(){return[Hs(this.styles)]}}class Us extends l.MarkupElement{constructor(t=Ds,n=gt){super(t,n)}}const gt=({element:e,attributes:t,children:n,styles:r})=>{const s=e.align;return a.jsx("p",{...t,className:l.merge([s&&l.alignmentClassnames[s],l.getColumnBreakClasses(e),"a-image-title"]),children:a.jsx("span",{style:r,children:n})})},Hs=e=>o.createPluginFactory({key:k.imageTitle,isElement:!0,component:gt,deserializeHtml:{rules:[{validClassName:k.imageTitle}]}})({component:t=>a.jsx(gt,{...t,styles:e})});class hn extends l.Plugin{constructor({styles:t=M.p,...n}={}){super(k.p,{markupElement:new yn,label:"Body Text",...n}),this.styles={},this.styles=t}plugins(){return[wn(this.styles)]}}const fn="tw-m-0 tw-px-0 tw-py-0",Ue=({element:e,attributes:t,children:n,styles:r})=>{const s=e.align,c=l.merge([s&&l.alignmentClassnames[s],fn,l.getColumnBreakClasses(e)]);return a.jsx("p",{...t,className:c,style:r,children:n})};class yn extends l.MarkupElement{constructor(t=k.p,n=Ue){super(t,n)}}const wn=e=>o.createPluginFactory({...o.createParagraphPlugin(),key:k.p,isElement:!0,component:Ue})({component:t=>a.jsx(Ue,{...t,styles:e})}),Vs="textstyle-quote-plugin";class vn extends l.Plugin{constructor({styles:t=M.quote,...n}={}){super(k.quote,{label:"Quote",markupElement:new zs,...n}),this.styles={},this.styles=t}plugins(){return[bn(this.styles)]}}class zs extends l.MarkupElement{constructor(t=Vs,n=He){super(t,n)}}const He=({element:e,attributes:t,children:n,styles:r})=>{const s=e.align;return a.jsx("blockquote",{...t,className:l.merge([s&&l.alignmentClassnames[s],l.getColumnBreakClasses(e),"a-quote"]),children:a.jsx("span",{style:r,children:n})})},bn=e=>o.createPluginFactory({key:k.quote,isElement:!0,component:He,deserializeHtml:{rules:[{validNodeName:["blockquote","BLOCKQUOTE"]}]}})({component:t=>a.jsx(He,{...t,styles:e})}),mt=[new on,new cn,new un,new dn,new tn,new rn,new an,new vn,new hn],ke=[k.heading1,k.heading2,k.heading3,k.heading4,k.custom1,k.custom2,k.custom3,k.quote,k.p],Ws=[...mt,new gn,new mn],$s=[...ke,k.imageCaption,k.imageTitle],Gs=e=>{let t=Xe(e.text);t=t.replaceAll(`
30
+ `,"<br />");const{bold:n,italic:r,underline:s,strikethrough:c,code:d,subscript:m,superscript:u}=e;return n&&(t=`<span class="${l.BOLD_CLASSES}">${t}</span>`),r&&(t=`<span class="${l.ITALIC_CLASSES}">${t}</span>`),s&&(t=`<span class="${l.UNDERLINE_CLASSES}">${t}</span>`),c&&(t=`<span class="${l.STRIKETHROUGH_CLASSES}">${t}</span>`),d&&(t=`<span class="${l.CODE_CLASSES}">${t}</span>`),m?t=`<sub>${t}</sub>`:u&&(t=`<sup>${t}</sup>`),t},ne=e=>e?Object.keys(e).reduce((t,n)=>{const r=e[n];return r?`${t}${Ks(n)}: ${r}; `:t},"").trim().replaceAll('"',"'"):"",Ks=e=>e.replaceAll(/([A-Z])/g,"-$1").toLowerCase(),Ys=(e,t,n,r)=>{const s=r[it],c=e.buttonStyle??"primary",d=`button${c.charAt(0).toUpperCase()}${c.slice(1)}`,m=s[d],u=ne(m);return`<a href="${e.url}"
31
+ target="${e.target??"_blank"}"
32
+ style="${u}"
33
+ class="${n}"
34
+ onmouseenter="this.setAttribute('style', '${u} ${ne(m==null?void 0:m.hover)}');"
35
+ onmouseleave="this.setAttribute('style', '${ne(m)}');"
36
+ >${t}</a>`},Xs=(e,t,n,r)=>{var s;if(e.chosenLink){const{chosenLink:c}=e;return`<a class="${n}" style="${ne(r[be])}" target=${c!=null&&c.openInNewTab?"_blank":"_self"} href="${Xe((s=c==null?void 0:c.searchResult)==null?void 0:s.link)}">${t}</a>`}return`<a class="${n}" style="${ne(r[be])}" target="${(e==null?void 0:e.target)??"_blank"}" href="${Xe(e.url)}">${t}</a>`},Js=(e,t,n,r)=>{const s=ne(n);return e.type===k.heading1?`<h1 class="${l.merge([r,"a-h1"])}">${X(t,s)}</h1>`:e.type===k.heading2?`<h2 class="${r}">${X(t,s)}</h2>`:e.type===k.heading3?`<h3 class="${r}">${X(t,s)}</h3>`:e.type===k.heading4?`<h4 class="${r}">${X(t,s)}</h4>`:e.type===k.custom1?`<p class="${l.merge([r,"a-custom1"])}">${X(t,s)}</p>`:e.type===k.custom2?`<p class="${l.merge([r,"a-custom2"])}">${X(t,s)}</p>`:e.type===k.custom3?`<p class="${l.merge([r,"a-custom3"])}">${X(t,s)}</p>`:e.type===k.quote?`<p class="${l.merge([r,"a-quote"])}">${X(t,s)}</p>`:e.type===k.imageTitle?`<p class="${l.merge([r,"a-image-title"])}">${X(t,s)}</p>`:e.type===k.imageCaption?`<p class="${l.merge([r,"a-image-caption"])}">${X(t,s)}</p>`:`<p class="${r}">${X(t,s)}</p>`},X=(e,t)=>`<span style="${t}">${e}</span>`,Qs=(e,t,n,r)=>`<div disabled class="tw-flex tw-flex-row tw-pb-2 first-of-type:tw-ml-0 ${n}" style="margin-left:${(e.indent??0)*24}px;">
37
+ <div class="tw-flex tw-items-center tw-justify-center tw-select-none tw-mr-1.5">
38
+ <input
39
+ class="tw-w-4 tw-h-4 tw-m-0"
40
+ type="checkbox"
41
+ ${e.checked?"checked":""}
42
+ onclick="return false;" />
43
+ </div>
44
+ <span class="${l.merge(["tw-flex-1 tw-focus:outline-none",e.checked?"!tw-line-through":""])}" style="${ne(r[e.children[0].textStyle])}">${t}</span>
45
+ </div>`,Zs=(e,{mentionable:t}={})=>{if(!t)return"";const n=document.createElement("div");return Vn.render(l.MentionMarkupElementNode(t)({element:e}),n),n.innerHTML},ht=(e,t)=>e.reduce((n,r)=>(r.type===t&&n++,r.children?n+ht(r.children,t):n),0),xn=(e,t,{mappedMentionable:n,nestingCount:r={}})=>{if(o.isText(e))return Gs(e);const s=r[e.type]||ht([e],e.type);let c="";for(const m of e.children)c+=xn(m,t,{nestingCount:{...r,[m.type]:s},mappedMentionable:n});const d=qs[e.type];return typeof d<"u"?d({classNames:pn(e.breakAfterColumn,e.align),children:c,rootNestingCount:s,node:e,mappedMentionable:n,styles:t}):Js(e,c,t[e.type],pn(e.breakAfterColumn,e.align))},qs={[o.ELEMENT_UL]:e=>`<ul class="${l.UL_CLASSES} ${e.classNames}">${e.children}</ul>`,[o.ELEMENT_OL]:({classNames:e,children:t,node:n,rootNestingCount:r})=>{const s=Math.max(r-ht([n],o.ELEMENT_OL),0);return`<ol class="${l.getOrderedListClasses(s)} ${e}" style="${ne(l.OL_STYLES)}">${t}</ol>`},[o.ELEMENT_LI]:({classNames:e,children:t,node:n,styles:r})=>`<li class="${e} ${l.LI_CLASSNAMES}" style="${ne(l.getLiStyles(n,r))}">${t}</li>`,[o.ELEMENT_LIC]:({classNames:e,children:t,node:n})=>`<p class="${e} ${l.getLicElementClassNames(n)}"><span>${t}</span></p>`,[o.ELEMENT_LINK]:({node:e,children:t,classNames:n,styles:r})=>Xs(e,t,n,r),[N]:({node:e,children:t,classNames:n,styles:r})=>Ys(e,t,n,r),[l.ELEMENT_CHECK_ITEM]:({node:e,children:t,classNames:n,styles:r})=>Qs(e,t,n,r),[o.ELEMENT_MENTION]:({node:e,mappedMentionable:t})=>Zs(e,{mentionable:t})},pn=(e,t)=>{const n="tw-break-words",r=e==="active"?"tw-break-after-column tw-break-inside-avoid-column":"",s=t?l.alignmentClassnames[t]:"";return l.merge([s,n,r])},ea=async(e,t=1,n="normal",r=new l.PluginComposer)=>{const s=l.parseRawValue({raw:e,plugins:r}),c=r.getStyles;return Promise.resolve(ta(s,{columns:t,columnGap:n,styles:c}))},ta=(e,{mentionable:t,columns:n=1,columnGap:r="normal",styles:s=M}={})=>{const c=t?l.mapMentionable(t):new Map;let d="";for(let m=0,u=e.length;m<u;m++){const w=e[m];na(w)?d+="<br />":d+=xn(w,s,{mappedMentionable:c})}return n>1?`<div style="columns:${n}; column-gap:${r};">${d}</div>`:d},na=e=>{var t;return Array.isArray(e==null?void 0:e.children)?(t=e==null?void 0:e.children)==null?void 0:t.every(n=>n.text===""):!1},ra=({value:e="",gap:t,columns:n,show:r=!0,plugins:s})=>{const[c,d]=x.useState(null);return x.useEffect(()=>{(async()=>d(await ea(e,n,t,s)))()},[e,n,t,s]),!r||c==="<br />"?null:c!==null?a.jsx("div",{className:"tw-w-full","data-test-id":"rte-content-html",dangerouslySetInnerHTML:{__html:c}}):a.jsx("div",{className:"tw-rounded-sm tw-bg-base-alt tw-animate-pulse tw-h-full tw-min-h-[10px] tw-w-full"})},sa=({id:e="rte",isEditing:t,value:n,columns:r,gap:s,placeholder:c,plugins:d,onTextChange:m,showSerializedText:u})=>{const[w,y]=x.useState(!1),f=p=>{m&&p!==n&&m(p),y(!1)};return x.useEffect(()=>{const p=P=>(P.preventDefault(),P.returnValue="Unprocessed changes");return w&&window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[w]),t?a.jsx(l.RichTextEditor,{id:e,value:n,border:!1,placeholder:c,plugins:d,onValueChanged:()=>y(!0),onTextChange:f,hideExternalFloatingModals:p=>{V.isOpen(p)&&F.reset()}}):a.jsx(ra,{value:n,columns:r,gap:s,show:u,plugins:d})},aa=e=>new l.PluginComposer().setPlugin(new l.SoftBreakPlugin,new l.TextStylePlugin({textStyles:mt})).setPlugin([new l.BoldPlugin,new l.ItalicPlugin,new l.UnderlinePlugin,new l.StrikethroughPlugin,new en({appBridge:e}),new Zt({appBridge:e}),new l.CodePlugin],[new l.AlignLeftPlugin({validTypes:ke}),new l.AlignCenterPlugin({validTypes:ke}),new l.AlignRightPlugin({validTypes:ke}),new l.AlignJustifyPlugin({validTypes:ke}),new l.UnorderedListPlugin,new l.CheckboxListPlugin,new l.OrderedListPlugin,new l.ResetFormattingPlugin]),ia="--f-theme-settings-",la=(e,t)=>{const{blockAssets:n,updateAssetIdsFromKey:r}=ce.useBlockAssets(e),s=(n==null?void 0:n[t])||[];return{onAddAttachments:async w=>{const y=s.map(f=>f.id);for(const f of w)y.push(f.id);await r(t,y)},onAttachmentDelete:async w=>{const y=s.filter(f=>f.id!==w.id).map(f=>f.id);await r(t,y)},onAttachmentReplace:async(w,y)=>{const f=s.map(p=>p.id===w.id?y.id:p.id);await r(t,f)},onAttachmentsSorted:async w=>{const y=w.map(f=>f.id);await r(t,y)},attachments:s}},oa={start:["Space","Enter"],cancel:[],end:["Space","Enter","Escape"]},ca=(e=0,t=0)=>{const n=Mt(e,t);return _.useSensors(_.useSensor(_.PointerSensor),_.useSensor(_.KeyboardSensor,{coordinateGetter:n,keyboardCodes:oa}))},ua=e=>{const t=e!=null&&e.id?`hasBackground${e.id}`:"hasBackground",n=e!=null&&e.id?`backgroundColor${e.id}`:"backgroundColor",r=e!=null&&e.preventDefaultColor?void 0:(e==null?void 0:e.defaultColor)||tr,s=e!=null&&e.switchLabel?e.switchLabel:void 0;return{id:t,label:"Background",type:"switch",switchLabel:s,defaultValue:!!(e!=null&&e.defaultValue),on:[{id:n,defaultValue:r,type:"colorInput"}]}},da=e=>{const t=e!=null&&e.id?`hasBorder_${e.id}`:"hasBorder",n=e!=null&&e.id?`borderSelection_${e.id}`:"borderSelection",r=e!=null&&e.id?`borderStyle_${e.id}`:"borderStyle",s=e!=null&&e.id?`borderWidth_${e.id}`:"borderWidth",c=e!=null&&e.id?`borderColor_${e.id}`:"borderColor",d=(e==null?void 0:e.defaultColor)||Bt,m=e!=null&&e.switchLabel?e.switchLabel:void 0;return{id:t,label:"Border",type:"switch",switchLabel:m,defaultValue:!!(e!=null&&e.defaultValue),on:[{id:n,type:"multiInput",onChange:u=>b.appendUnit(u,s),layout:b.MultiInputLayout.Columns,lastItemFullWidth:!0,blocks:[{id:r,type:"dropdown",defaultValue:Z.Solid,choices:[{value:Z.Solid,label:Z.Solid},{value:Z.Dotted,label:Z.Dotted},{value:Z.Dashed,label:Z.Dashed}]},{id:s,type:"input",defaultValue:nr,rules:[b.numericalOrPixelRule,b.maximumNumericalOrPixelOrAutoRule(500)],placeholder:"e.g. 3px"},{id:c,type:"colorInput",defaultValue:d}]}],off:[]}},ft=(e,t=ie.None)=>({id:e,type:"segmentedControls",defaultValue:t,choices:[{value:ie.None,label:"None"},{value:ie.Small,label:"S"},{value:ie.Medium,label:"M"},{value:ie.Large,label:"L"}]}),ga=e=>{const t=e!=null&&e.id?`hasRadius_${e.id}`:"hasRadius",n=e!=null&&e.id?`radiusValue_${e.id}`:"radiusValue",r=e!=null&&e.id?`radiusChoice_${e.id}`:"radiusChoice",s=(e==null?void 0:e.defaultRadius)||ie.None;return{id:t,label:"Corner radius",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"Determining how rounded the corners are.",show:c=>{var d;return e!=null&&e.dependentSettingId?!!((d=c.getBlock(e.dependentSettingId))!=null&&d.value):!0},onChange:c=>b.presetCustomValue(c,r,n,(e==null?void 0:e.radiusStyleMap)||de),on:[{id:n,type:"input",placeholder:"e.g. 10px",rules:[b.numericalOrPixelRule],onChange:c=>b.appendUnit(c,n)}],off:[ft(r,s)]}},ma=e=>{const t=e!=null&&e.id?`hasExtendedCustomRadius_${e.id}`:"hasExtendedCustomRadius",n=e!=null&&e.id?`extendedRadiusValue_${e.id}`:"extendedRadiusValue",r=e!=null&&e.id?`extendedRadiusChoice_${e.id}`:"extendedRadiusChoice",s=e!=null&&e.id?`extendedRadiusTopLeft_${e.id}`:"extendedRadiusTopLeft",c=e!=null&&e.id?`extendedRadiusTopRight_${e.id}`:"extendedRadiusTopRight",d=e!=null&&e.id?`extendedRadiusBottomLeft_${e.id}`:"extendedRadiusBottomLeft",m=e!=null&&e.id?`extendedRadiusBottomRight_${e.id}`:"extendedRadiusBottomRight";return{id:t,label:"Corner radius",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"Determining how rounded the corners are.",show:u=>{var w;return e!=null&&e.dependentSettingId?!!((w=u.getBlock(e.dependentSettingId))!=null&&w.value):!0},onChange:u=>{b.presetCustomValue(u,r,s,de),b.presetCustomValue(u,r,c,de),b.presetCustomValue(u,r,d,de),b.presetCustomValue(u,r,m,de)},on:[{id:n,type:"multiInput",layout:b.MultiInputLayout.Columns,blocks:[{id:s,type:"input",label:"Top Left",rules:[b.numericalOrPixelRule],onChange:u=>b.appendUnit(u,s)},{id:c,type:"input",label:"Top Right",rules:[b.numericalOrPixelRule],onChange:u=>b.appendUnit(u,c)},{id:d,type:"input",label:"Bottom Left",rules:[b.numericalOrPixelRule],onChange:u=>b.appendUnit(u,d)},{id:m,type:"input",label:"Bottom Right",rules:[b.numericalOrPixelRule],onChange:u=>b.appendUnit(u,m)}]}],off:[ft(r,e==null?void 0:e.defaultValue)]}},ha=e=>{const t=e!=null&&e.id?e.id:"hasCustomSpacing",n=e!=null&&e.dependentSettingId?e.dependentSettingId:"columns",r=e!=null&&e.spacingChoiceId?e.spacingChoiceId:"spacingChoice",s=e!=null&&e.spacingCustomId?e.spacingCustomId:"spacingCustom",c=e!=null&&e.defaultValueChoices?e.defaultValueChoices:fe.M;return{id:t,type:"switch",defaultValue:!1,switchLabel:"Custom",label:"Gutter",info:"An official nerds term for ‘gap’",onChange:d=>b.presetCustomValue(d,r,s,At),show:d=>{var m;return((m=d.getBlock(n))==null?void 0:m.value)!=="1"},on:[{id:s,type:"input",rules:[b.numericalOrPixelRule],onChange:d=>b.appendUnit(d,s)}],off:[{id:r,type:"slider",defaultValue:c,choices:[{value:fe.Auto,label:"Auto"},{value:fe.S,label:"S"},{value:fe.M,label:"M"},{value:fe.L,label:"L"}]}]}},yt=e=>({id:e,type:"segmentedControls",defaultValue:me.None,choices:[{value:me.None,label:"None"},{value:me.Small,label:"S"},{value:me.Medium,label:"M"},{value:me.Large,label:"L"}]}),fa=e=>{const t=e!=null&&e.id?`hasCustomMarginValue_${e==null?void 0:e.id}`:"hasCustomMarginValue",n=e!=null&&e.id?`marginValue_${e==null?void 0:e.id}`:"marginValue",r=e!=null&&e.id?`marginChoice_${e==null?void 0:e.id}`:"marginChoice";return{id:t,label:"Margin",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"The spacing around UI elements to create more space",onChange:s=>b.presetCustomValue(s,r,n,(e==null?void 0:e.marginStyleMap)||ve),on:[{id:n,type:"input",placeholder:Re,rules:[b.numericalOrPixelRule,b.maximumNumericalOrPixelOrAutoRule(500)],onChange:s=>b.appendUnit(s,n)}],off:[yt(r)]}},ya=e=>{const t=e!=null&&e.id?`hasExtendedCustomMargin_${e==null?void 0:e.id}`:"hasExtendedCustomMargin",n=e!=null&&e.id?`extendedMarginValues_${e==null?void 0:e.id}`:"extendedMarginValues",r=e!=null&&e.id?`extendedMarginChoice_${e==null?void 0:e.id}`:"extendedMarginChoice",s=e!=null&&e.id?`extendedMarginTop_${e==null?void 0:e.id}`:"extendedMarginTop",c=e!=null&&e.id?`extendedMarginLeft_${e==null?void 0:e.id}`:"extendedMarginLeft",d=e!=null&&e.id?`extendedMarginRight_${e==null?void 0:e.id}`:"extendedMarginRight",m=e!=null&&e.id?`extendedMarginBottom_${e==null?void 0:e.id}`:"extendedMarginBottom";return{id:t,label:"Margin",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"The spacing around UI elements to create more negative space",onChange:u=>{b.presetCustomValue(u,r,s,ve),b.presetCustomValue(u,r,c,ve),b.presetCustomValue(u,r,d,ve),b.presetCustomValue(u,r,m,ve)},on:[{id:n,type:"multiInput",layout:b.MultiInputLayout.Spider,blocks:[{id:s,type:"input",label:"Top",placeholder:Re,onChange:u=>b.appendUnit(u,s),rules:[b.numericalOrPixelRule,b.maximumNumericalOrPixelOrAutoRule(500)]},{id:c,type:"input",label:"Left",placeholder:Re,onChange:u=>b.appendUnit(u,c),rules:[b.numericalOrPixelRule,b.maximumNumericalOrPixelOrAutoRule(500)]},{id:d,type:"input",label:"Right",placeholder:Re,onChange:u=>b.appendUnit(u,d),rules:[b.numericalOrPixelRule,b.maximumNumericalOrPixelOrAutoRule(500)]},{id:m,type:"input",label:"Bottom",placeholder:Re,onChange:u=>b.appendUnit(u,m),rules:[b.numericalOrPixelRule,b.maximumNumericalOrPixelOrAutoRule(500)]}]}],off:[yt(r)]}},wt=e=>({id:e,type:"segmentedControls",defaultValue:ge.Small,choices:[{value:ge.None,label:"None"},{value:ge.Small,label:"S"},{value:ge.Medium,label:"M"},{value:ge.Large,label:"L"}]}),wa=e=>{const t=e!=null&&e.id?`hasCustomPaddingValue_${e==null?void 0:e.id}`:"hasCustomPaddingValue",n=e!=null&&e.id?`paddingValue_${e==null?void 0:e.id}`:"paddingValue",r=e!=null&&e.id?`paddingChoice_${e==null?void 0:e.id}`:"paddingChoice";return{id:t,label:"Padding",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"The spacing around UI elements to create more negative space",onChange:s=>b.presetCustomValue(s,r,n,(e==null?void 0:e.paddingStyleMap)||we),on:[{id:n,type:"input",placeholder:Ie,rules:[b.numericalOrPixelRule,b.maximumNumericalOrPixelOrAutoRule(500)],onChange:s=>b.appendUnit(s,n)}],off:[wt(r)]}},va=e=>{const t=e!=null&&e.id?`hasExtendedCustomPadding_${e==null?void 0:e.id}`:"hasExtendedCustomPadding",n=e!=null&&e.id?`extendedPaddingValues_${e==null?void 0:e.id}`:"extendedPaddingValues",r=e!=null&&e.id?`extendedPaddingChoice_${e==null?void 0:e.id}`:"extendedPaddingChoice",s=e!=null&&e.id?`extendedPaddingTop_${e==null?void 0:e.id}`:"extendedPaddingTop",c=e!=null&&e.id?`extendedPaddingLeft_${e==null?void 0:e.id}`:"extendedPaddingLeft",d=e!=null&&e.id?`extendedPaddingRight_${e==null?void 0:e.id}`:"extendedPaddingRight",m=e!=null&&e.id?`extendedPaddingBottom_${e==null?void 0:e.id}`:"extendedPaddingBottom";return{id:t,label:"Padding",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"The spacing around UI elements to create more negative space",onChange:u=>{b.presetCustomValue(u,r,s,we),b.presetCustomValue(u,r,c,we),b.presetCustomValue(u,r,d,we),b.presetCustomValue(u,r,m,we)},on:[{id:n,type:"multiInput",layout:b.MultiInputLayout.Spider,blocks:[{id:s,type:"input",label:"Top",placeholder:Ie,onChange:u=>b.appendUnit(u,s),rules:[b.numericalOrPixelRule,b.maximumNumericalOrPixelOrAutoRule(500)]},{id:c,type:"input",label:"Left",placeholder:Ie,onChange:u=>b.appendUnit(u,c),rules:[b.numericalOrPixelRule,b.maximumNumericalOrPixelOrAutoRule(500)]},{id:d,type:"input",label:"Right",placeholder:Ie,onChange:u=>b.appendUnit(u,d),rules:[b.numericalOrPixelRule,b.maximumNumericalOrPixelOrAutoRule(500)]},{id:m,type:"input",label:"Bottom",placeholder:Ie,onChange:u=>b.appendUnit(u,m),rules:[b.numericalOrPixelRule,b.maximumNumericalOrPixelOrAutoRule(500)]}]}],off:[wt(r)]}},ba=e=>{const t=vt(e==null?void 0:e.globalControlId);return{id:e!=null&&e.id?e.id:"downloadable",type:"switch",defaultValue:!1,label:"Downloadable",show:n=>{var r;return((r=n.getBlock(t))==null?void 0:r.value)===he.Custom}}},vt=e=>e||"security",xa=e=>[{id:vt(e),type:"segmentedControls",defaultValue:he.Global,choices:[{value:he.Global,label:"Global Settings"},{value:he.Custom,label:"Custom"}]},{id:"globalSettingsInfo",type:"notification",footer:b.createFooter({label:"Change global settings [here].",replace:{here:{event:"general-settings.open"}}})}];var kn=(e=>(e.Main="main",e.Basics="basics",e.Layout="layout",e.Style="style",e.Security="security",e.Targets="targets",e))(kn||{});const pa=e=>e,ka=e=>e;g.AllTextStylePlugins=Ws,g.AllTextStyles=$s,g.Attachments=cr,g.BUTTON_PLUGIN=it,g.BlockButtonStyles=De,g.BlockInjectButton=$n,g.BlockItemWrapper=ir,g.BlockStyles=M,g.BorderStyle=Z,g.ButtonPlugin=Zt,g.Custom1Plugin=tn,g.Custom2Plugin=rn,g.Custom3Plugin=an,g.DEFAULT_DRAGGING_TOOLTIP=Ot,g.DEFAULT_DRAG_TOOLTIP=_t,g.DownloadButton=ur,g.ELEMENT_BUTTON=N,g.GutterSpacing=fe,g.Heading1Plugin=on,g.Heading2Plugin=cn,g.Heading3Plugin=un,g.Heading4Plugin=dn,g.ImageCaptionPlugin=gn,g.ImageTitlePlugin=mn,g.LinkPlugin=en,g.Margin=me,g.PARAGRAPH_CLASSES=fn,g.Padding=ge,g.ParagraphMarkupElement=yn,g.ParagraphMarkupElementNode=Ue,g.ParagraphPlugin=hn,g.QuoteMarkupElementNode=He,g.QuotePlugin=vn,g.Radius=ie,g.RichTextEditor=sa,g.Sections=kn,g.Security=he,g.THEME_PREFIX=ia,g.TextStylePluginsWithoutImage=mt,g.TextStyles=k,g.TextStylesWithoutImage=ke,g.addHttps=_e,g.borderStyleMap=Nt,g.convertToRteValue=hr,g.createButtonNode=Vt,g.createButtonPlugin=Qt,g.createLinkPlugin=qt,g.createParagraphPlugin=wn,g.createQuotePlugin=bn,g.customCoordinatesGetterFactory=Mt,g.defineBlock=pa,g.defineSettings=ka,g.getBackgroundColorStyles=er,g.getBackgroundSettings=ua,g.getBorderRadiusSettings=ga,g.getBorderRadiusSlider=ft,g.getBorderSettings=da,g.getBorderStyles=rr,g.getDefaultPluginsWithLinkChooser=aa,g.getExtendedBorderRadiusSettings=ma,g.getGutterSettings=ha,g.getMarginExtendedSettings=ya,g.getMarginSettings=fa,g.getMarginSlider=yt,g.getPaddingExtendedSettings=va,g.getPaddingSettings=wa,g.getPaddingSlider=wt,g.getRadiusStyles=sr,g.getReadableColor=Zn,g.getSecurityDownloadableSetting=ba,g.getSecurityGlobalControlId=vt,g.getSecurityGlobalControlSetting=xa,g.getUrlFromEditor=Ht,g.gutterSpacingStyleMap=At,g.hasRichTextValue=Ft,g.insertButton=zt,g.isDark=Kn,g.isDownloadable=yr,g.joinClassNames=te,g.mapAppBridgeColorPaletteToFonduePalette=Dt,g.mapAppBridgeColorPalettesToFonduePalettes=wr,g.marginStyleMap=ve,g.moveItemInArray=qn,g.paddingStyleMap=we,g.radiusStyleMap=de,g.setAlpha=Jn,g.submitFloatingButton=rt,g.toColorObject=Qn,g.toHex8String=Yn,g.toHexString=Xn,g.toRgbaString=Qe,g.toShortRgba=ue,g.triggerFloatingButton=Yt,g.triggerFloatingButtonEdit=Fe,g.triggerFloatingButtonInsert=nt,g.unwrapButton=pe,g.upsertButton=Wt,g.upsertButtonText=st,g.useAttachments=la,g.useDndSensors=ca,g.withButton=Jt,g.wrapButton=$t,Object.keys(b).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(g,e)&&Object.defineProperty(g,e,{enumerable:!0,get:()=>b[e]})}),Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
46
+ //# sourceMappingURL=index.umd.js.map