@frontify/guideline-blocks-settings 0.27.0 → 0.28.1

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 (485) hide show
  1. package/.eslintrc.js +1 -1
  2. package/CHANGELOG.md +21 -0
  3. package/README.md +24 -5
  4. package/dist/_virtual/_commonjsHelpers.es.js +7 -0
  5. package/dist/_virtual/_commonjsHelpers.es.js.map +1 -0
  6. package/dist/_virtual/index.es.js +5 -0
  7. package/dist/_virtual/index.es.js.map +1 -0
  8. package/dist/_virtual/index.es2.js +5 -0
  9. package/dist/_virtual/index.es2.js.map +1 -0
  10. package/dist/_virtual/index.es3.js +5 -0
  11. package/dist/_virtual/index.es3.js.map +1 -0
  12. package/dist/_virtual/jsx-runtime.es.js +5 -0
  13. package/dist/_virtual/jsx-runtime.es.js.map +1 -0
  14. package/dist/_virtual/react-dom.development.es.js +5 -0
  15. package/dist/_virtual/react-dom.development.es.js.map +1 -0
  16. package/dist/_virtual/react-dom.production.min.es.js +5 -0
  17. package/dist/_virtual/react-dom.production.min.es.js.map +1 -0
  18. package/dist/_virtual/react-jsx-runtime.development.es.js +5 -0
  19. package/dist/_virtual/react-jsx-runtime.development.es.js.map +1 -0
  20. package/dist/_virtual/react-jsx-runtime.production.min.es.js +5 -0
  21. package/dist/_virtual/react-jsx-runtime.production.min.es.js.map +1 -0
  22. package/dist/_virtual/react.development.es.js +5 -0
  23. package/dist/_virtual/react.development.es.js.map +1 -0
  24. package/dist/_virtual/react.production.min.es.js +5 -0
  25. package/dist/_virtual/react.production.min.es.js.map +1 -0
  26. package/dist/_virtual/scheduler.development.es.js +5 -0
  27. package/dist/_virtual/scheduler.development.es.js.map +1 -0
  28. package/dist/_virtual/scheduler.production.min.es.js +5 -0
  29. package/dist/_virtual/scheduler.production.min.es.js.map +1 -0
  30. package/dist/components/Attachments/AttachmentItem.es.js +180 -0
  31. package/dist/components/Attachments/AttachmentItem.es.js.map +1 -0
  32. package/dist/components/Attachments/Attachments.es.js +145 -0
  33. package/dist/components/Attachments/Attachments.es.js.map +1 -0
  34. package/dist/components/BlockInjectButton/BlockInjectButton.es.js +150 -0
  35. package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -0
  36. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +73 -0
  37. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -0
  38. package/dist/components/BlockItemWrapper/Toolbar.es.js +113 -0
  39. package/dist/components/BlockItemWrapper/Toolbar.es.js.map +1 -0
  40. package/dist/components/BlockItemWrapper/constants.es.js +6 -0
  41. package/dist/components/BlockItemWrapper/constants.es.js.map +1 -0
  42. package/dist/components/DownloadButton/DownloadButton.es.js +39 -0
  43. package/dist/components/DownloadButton/DownloadButton.es.js.map +1 -0
  44. package/dist/components/RichTextEditor/RichTextEditor.es.js +42 -0
  45. package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -0
  46. package/dist/components/RichTextEditor/SerializedText.es.js +13 -0
  47. package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -0
  48. package/dist/components/RichTextEditor/constants.es.js +5 -0
  49. package/dist/components/RichTextEditor/constants.es.js.map +1 -0
  50. package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js +34 -0
  51. package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -0
  52. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +54 -0
  53. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -0
  54. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js +12 -0
  55. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js.map +1 -0
  56. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +17 -0
  57. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -0
  58. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +30 -0
  59. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -0
  60. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +16 -0
  61. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js.map +1 -0
  62. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js +37 -0
  63. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -0
  64. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.es.js +25 -0
  65. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.es.js.map +1 -0
  66. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js +20 -0
  67. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js.map +1 -0
  68. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js +26 -0
  69. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js.map +1 -0
  70. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +69 -0
  71. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js.map +1 -0
  72. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +105 -0
  73. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -0
  74. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js +20 -0
  75. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js.map +1 -0
  76. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js +32 -0
  77. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js.map +1 -0
  78. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +58 -0
  79. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js.map +1 -0
  80. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js +19 -0
  81. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js.map +1 -0
  82. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js +26 -0
  83. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js.map +1 -0
  84. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js +43 -0
  85. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js.map +1 -0
  86. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js +18 -0
  87. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js.map +1 -0
  88. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js +62 -0
  89. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -0
  90. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js +13 -0
  91. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +1 -0
  92. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js +25 -0
  93. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js.map +1 -0
  94. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js +35 -0
  95. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -0
  96. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js +86 -0
  97. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -0
  98. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js +24 -0
  99. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -0
  100. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js +19 -0
  101. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +1 -0
  102. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js +13 -0
  103. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +1 -0
  104. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js +11 -0
  105. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js.map +1 -0
  106. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js +10 -0
  107. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js.map +1 -0
  108. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js +75 -0
  109. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js.map +1 -0
  110. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js +18 -0
  111. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +1 -0
  112. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js +17 -0
  113. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js.map +1 -0
  114. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js +14 -0
  115. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +1 -0
  116. package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js +53 -0
  117. package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -0
  118. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +19 -0
  119. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -0
  120. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +37 -0
  121. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -0
  122. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js +53 -0
  123. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js.map +1 -0
  124. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.es.js +29 -0
  125. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.es.js.map +1 -0
  126. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +8 -0
  127. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js.map +1 -0
  128. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +80 -0
  129. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -0
  130. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js +40 -0
  131. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js.map +1 -0
  132. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +93 -0
  133. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -0
  134. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +25 -0
  135. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -0
  136. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +27 -0
  137. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -0
  138. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js +12 -0
  139. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js.map +1 -0
  140. package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js +5 -0
  141. package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js.map +1 -0
  142. package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +39 -0
  143. package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -0
  144. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js +18 -0
  145. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js.map +1 -0
  146. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.es.js +5 -0
  147. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.es.js.map +1 -0
  148. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/url.es.js +17 -0
  149. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/url.es.js.map +1 -0
  150. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +45 -0
  151. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -0
  152. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +45 -0
  153. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -0
  154. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +45 -0
  155. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -0
  156. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +46 -0
  157. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -0
  158. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +39 -0
  159. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -0
  160. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +39 -0
  161. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -0
  162. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +39 -0
  163. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -0
  164. package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js +40 -0
  165. package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js.map +1 -0
  166. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +46 -0
  167. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -0
  168. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +46 -0
  169. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -0
  170. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +41 -0
  171. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -0
  172. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +48 -0
  173. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -0
  174. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js +68 -0
  175. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js.map +1 -0
  176. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js +55 -0
  177. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js.map +1 -0
  178. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js +62 -0
  179. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js.map +1 -0
  180. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js +61 -0
  181. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js.map +1 -0
  182. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js +34 -0
  183. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js.map +1 -0
  184. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js +26 -0
  185. package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js.map +1 -0
  186. package/dist/components/RichTextEditor/plugins/styles.es.js +168 -0
  187. package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -0
  188. package/dist/components/RichTextEditor/serializer/nodes/button.es.js +16 -0
  189. package/dist/components/RichTextEditor/serializer/nodes/button.es.js.map +1 -0
  190. package/dist/components/RichTextEditor/serializer/nodes/checkItemNode.es.js +19 -0
  191. package/dist/components/RichTextEditor/serializer/nodes/checkItemNode.es.js.map +1 -0
  192. package/dist/components/RichTextEditor/serializer/nodes/default.es.js +17 -0
  193. package/dist/components/RichTextEditor/serializer/nodes/default.es.js.map +1 -0
  194. package/dist/components/RichTextEditor/serializer/nodes/link.es.js +15 -0
  195. package/dist/components/RichTextEditor/serializer/nodes/link.es.js.map +1 -0
  196. package/dist/components/RichTextEditor/serializer/nodes/mentionHtmlNode.es.js +12 -0
  197. package/dist/components/RichTextEditor/serializer/nodes/mentionHtmlNode.es.js.map +1 -0
  198. package/dist/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.es.js +61 -0
  199. package/dist/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.es.js.map +1 -0
  200. package/dist/components/RichTextEditor/serializer/serializeToHtml.es.js +25 -0
  201. package/dist/components/RichTextEditor/serializer/serializeToHtml.es.js.map +1 -0
  202. package/dist/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.es.js +8 -0
  203. package/dist/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.es.js.map +1 -0
  204. package/dist/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.es.js +13 -0
  205. package/dist/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.es.js.map +1 -0
  206. package/dist/helpers/addHttps.es.js +14 -0
  207. package/dist/helpers/addHttps.es.js.map +1 -0
  208. package/dist/helpers/convertToRichTextValue.es.js +6 -0
  209. package/dist/helpers/convertToRichTextValue.es.js.map +1 -0
  210. package/dist/helpers/customCoordinatesGetterFactory.es.js +32 -0
  211. package/dist/helpers/customCoordinatesGetterFactory.es.js.map +1 -0
  212. package/dist/helpers/hasRichTextValue.es.js +15 -0
  213. package/dist/helpers/hasRichTextValue.es.js.map +1 -0
  214. package/dist/helpers/isDownloadable.es.js +6 -0
  215. package/dist/helpers/isDownloadable.es.js.map +1 -0
  216. package/dist/helpers/mapColorPalettes.es.js +16 -0
  217. package/dist/helpers/mapColorPalettes.es.js.map +1 -0
  218. package/dist/hooks/useAttachments.es.js +31 -0
  219. package/dist/hooks/useAttachments.es.js.map +1 -0
  220. package/dist/hooks/useDndSensors.es.js +20 -0
  221. package/dist/hooks/useDndSensors.es.js.map +1 -0
  222. package/dist/index.cjs.js +252 -1
  223. package/dist/index.cjs.js.map +1 -1
  224. package/dist/index.d.ts +816 -1
  225. package/dist/index.es.js +172 -3
  226. package/dist/index.es.js.map +1 -1
  227. package/dist/index.umd.js +252 -1
  228. package/dist/index.umd.js.map +1 -1
  229. package/dist/settings/background.es.js +22 -0
  230. package/dist/settings/background.es.js.map +1 -0
  231. package/dist/settings/border.es.js +61 -0
  232. package/dist/settings/border.es.js.map +1 -0
  233. package/dist/settings/borderRadius.es.js +56 -0
  234. package/dist/settings/borderRadius.es.js.map +1 -0
  235. package/dist/settings/borderRadiusExtended.es.js +64 -0
  236. package/dist/settings/borderRadiusExtended.es.js.map +1 -0
  237. package/dist/settings/defaultValues.es.js +19 -0
  238. package/dist/settings/defaultValues.es.js.map +1 -0
  239. package/dist/settings/gutter.es.js +56 -0
  240. package/dist/settings/gutter.es.js.map +1 -0
  241. package/dist/settings/margin.es.js +53 -0
  242. package/dist/settings/margin.es.js.map +1 -0
  243. package/dist/settings/marginExtended.es.js +65 -0
  244. package/dist/settings/marginExtended.es.js.map +1 -0
  245. package/dist/settings/padding.es.js +53 -0
  246. package/dist/settings/padding.es.js.map +1 -0
  247. package/dist/settings/paddingExtended.es.js +65 -0
  248. package/dist/settings/paddingExtended.es.js.map +1 -0
  249. package/dist/settings/securityDownloadable.es.js +19 -0
  250. package/dist/settings/securityDownloadable.es.js.map +1 -0
  251. package/dist/settings/securityGlobalControl.es.js +33 -0
  252. package/dist/settings/securityGlobalControl.es.js.map +1 -0
  253. package/dist/settings/types.es.js +48 -0
  254. package/dist/settings/types.es.js.map +1 -0
  255. package/dist/style.css +1 -0
  256. package/dist/utilities/color/getReadableColor.es.js +14 -0
  257. package/dist/utilities/color/getReadableColor.es.js.map +1 -0
  258. package/dist/utilities/color/isDark.es.js +10 -0
  259. package/dist/utilities/color/isDark.es.js.map +1 -0
  260. package/dist/utilities/color/setAlpha.es.js +6 -0
  261. package/dist/utilities/color/setAlpha.es.js.map +1 -0
  262. package/dist/utilities/color/toColorObject.es.js +9 -0
  263. package/dist/utilities/color/toColorObject.es.js.map +1 -0
  264. package/dist/utilities/color/toHex8String.es.js +7 -0
  265. package/dist/utilities/color/toHex8String.es.js.map +1 -0
  266. package/dist/utilities/color/toHexString.es.js +7 -0
  267. package/dist/utilities/color/toHexString.es.js.map +1 -0
  268. package/dist/utilities/color/toRgbaString.es.js +7 -0
  269. package/dist/utilities/color/toRgbaString.es.js.map +1 -0
  270. package/dist/utilities/color/toShortRgba.es.js +11 -0
  271. package/dist/utilities/color/toShortRgba.es.js.map +1 -0
  272. package/dist/utilities/moveItemInArray.es.js +12 -0
  273. package/dist/utilities/moveItemInArray.es.js.map +1 -0
  274. package/dist/utilities/react/getBackgroundColorStyles.es.js +8 -0
  275. package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -0
  276. package/dist/utilities/react/getBorderStyles.es.js +12 -0
  277. package/dist/utilities/react/getBorderStyles.es.js.map +1 -0
  278. package/dist/utilities/react/getRadiusStyles.es.js +8 -0
  279. package/dist/utilities/react/getRadiusStyles.es.js.map +1 -0
  280. package/dist/utilities/react/joinClassNames.es.js +5 -0
  281. package/dist/utilities/react/joinClassNames.es.js.map +1 -0
  282. package/package.json +46 -10
  283. package/postcss.config.js +8 -0
  284. package/setupTests.ts +13 -0
  285. package/src/components/Attachments/AttachmentItem.tsx +257 -0
  286. package/src/components/Attachments/Attachments.spec.ct.tsx +151 -0
  287. package/src/components/Attachments/Attachments.tsx +221 -0
  288. package/src/components/Attachments/index.ts +4 -0
  289. package/src/components/Attachments/types.ts +30 -0
  290. package/src/components/BlockInjectButton/BlockInjectButton.spec.ct.tsx +48 -0
  291. package/src/components/BlockInjectButton/BlockInjectButton.tsx +212 -0
  292. package/src/components/BlockInjectButton/index.ts +4 -0
  293. package/src/components/BlockInjectButton/types.ts +18 -0
  294. package/src/components/BlockItemWrapper/BlockItemWrapper.spec.ct.tsx +146 -0
  295. package/src/components/BlockItemWrapper/BlockItemWrapper.tsx +76 -0
  296. package/src/components/BlockItemWrapper/Toolbar.tsx +128 -0
  297. package/src/components/BlockItemWrapper/constants.ts +4 -0
  298. package/src/components/BlockItemWrapper/index.ts +5 -0
  299. package/src/components/BlockItemWrapper/types.ts +46 -0
  300. package/src/components/DownloadButton/DownloadButton.spec.ct.tsx +20 -0
  301. package/src/components/DownloadButton/DownloadButton.tsx +36 -0
  302. package/src/components/DownloadButton/index.ts +3 -0
  303. package/src/components/DownloadButton/types.ts +5 -0
  304. package/src/components/RichTextEditor/RichTextEditor.spec.ct.tsx +204 -0
  305. package/src/components/RichTextEditor/RichTextEditor.tsx +62 -0
  306. package/src/components/RichTextEditor/SerializedText.tsx +25 -0
  307. package/src/components/RichTextEditor/constants.ts +3 -0
  308. package/src/components/RichTextEditor/index.ts +6 -0
  309. package/src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx +53 -0
  310. package/src/components/RichTextEditor/pluginPresets/index.ts +3 -0
  311. package/src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.tsx +74 -0
  312. package/src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.ts +11 -0
  313. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.tsx +20 -0
  314. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx +56 -0
  315. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.tsx +19 -0
  316. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.tsx +42 -0
  317. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.tsx +37 -0
  318. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.tsx +22 -0
  319. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.tsx +30 -0
  320. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.tsx +81 -0
  321. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/types.ts +13 -0
  322. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts +143 -0
  323. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.tsx +31 -0
  324. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.ts +46 -0
  325. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/index.ts +12 -0
  326. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.ts +113 -0
  327. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.ts +21 -0
  328. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.ts +30 -0
  329. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.ts +71 -0
  330. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.ts +22 -0
  331. package/src/components/RichTextEditor/plugins/ButtonPlugin/components/index.ts +3 -0
  332. package/src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts +116 -0
  333. package/src/components/RichTextEditor/plugins/ButtonPlugin/index.ts +7 -0
  334. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/index.ts +8 -0
  335. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.ts +17 -0
  336. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.ts +40 -0
  337. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.ts +68 -0
  338. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.ts +198 -0
  339. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.ts +40 -0
  340. package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.ts +30 -0
  341. package/src/components/RichTextEditor/plugins/ButtonPlugin/types.ts +13 -0
  342. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.ts +28 -0
  343. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.ts +14 -0
  344. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.ts +18 -0
  345. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/index.ts +8 -0
  346. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.ts +77 -0
  347. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts +23 -0
  348. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.ts +30 -0
  349. package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts +45 -0
  350. package/src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts +106 -0
  351. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.tsx +26 -0
  352. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.tsx +43 -0
  353. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/index.ts +4 -0
  354. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts +113 -0
  355. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.tsx +45 -0
  356. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.tsx +5 -0
  357. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx +105 -0
  358. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/index.ts +4 -0
  359. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/types.ts +16 -0
  360. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.ts +73 -0
  361. package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts +136 -0
  362. package/src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx +38 -0
  363. package/src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx +36 -0
  364. package/src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.ts +11 -0
  365. package/src/components/RichTextEditor/plugins/LinkPlugin/id.ts +3 -0
  366. package/src/components/RichTextEditor/plugins/LinkPlugin/index.ts +48 -0
  367. package/src/components/RichTextEditor/plugins/LinkPlugin/types.ts +12 -0
  368. package/src/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.ts +30 -0
  369. package/src/components/RichTextEditor/plugins/LinkPlugin/utils/index.ts +4 -0
  370. package/src/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.spec.ts +35 -0
  371. package/src/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.ts +3 -0
  372. package/src/components/RichTextEditor/plugins/LinkPlugin/utils/url.spec.ts +75 -0
  373. package/src/components/RichTextEditor/plugins/LinkPlugin/utils/url.ts +21 -0
  374. package/src/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.tsx +61 -0
  375. package/src/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.tsx +61 -0
  376. package/src/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.tsx +62 -0
  377. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.tsx +61 -0
  378. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.tsx +58 -0
  379. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.tsx +58 -0
  380. package/src/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.tsx +59 -0
  381. package/src/components/RichTextEditor/plugins/TextStylePlugins/helpers.tsx +44 -0
  382. package/src/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.tsx +61 -0
  383. package/src/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.tsx +61 -0
  384. package/src/components/RichTextEditor/plugins/TextStylePlugins/index.ts +15 -0
  385. package/src/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.tsx +58 -0
  386. package/src/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.tsx +62 -0
  387. package/src/components/RichTextEditor/plugins/index.ts +6 -0
  388. package/src/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.tsx +80 -0
  389. package/src/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.tsx +97 -0
  390. package/src/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.spec.ct.tsx +138 -0
  391. package/src/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.tsx +80 -0
  392. package/src/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.tsx +83 -0
  393. package/src/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.tsx +68 -0
  394. package/src/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.tsx +37 -0
  395. package/src/components/RichTextEditor/plugins/shared/LinkSelector/index.ts +3 -0
  396. package/src/components/RichTextEditor/plugins/styles.ts +179 -0
  397. package/src/components/RichTextEditor/serializer/index.ts +3 -0
  398. package/src/components/RichTextEditor/serializer/nodes/button.ts +25 -0
  399. package/src/components/RichTextEditor/serializer/nodes/checkItemNode.ts +29 -0
  400. package/src/components/RichTextEditor/serializer/nodes/default.ts +52 -0
  401. package/src/components/RichTextEditor/serializer/nodes/link.ts +25 -0
  402. package/src/components/RichTextEditor/serializer/nodes/mentionHtmlNode.ts +17 -0
  403. package/src/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.ts +134 -0
  404. package/src/components/RichTextEditor/serializer/serializeToHtml.ts +49 -0
  405. package/src/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.ts +21 -0
  406. package/src/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.ts +32 -0
  407. package/src/components/RichTextEditor/types.ts +23 -0
  408. package/src/components/index.ts +7 -0
  409. package/src/helpers/addHttps.spec.ts +42 -0
  410. package/src/helpers/addHttps.ts +15 -0
  411. package/src/helpers/convertToRichTextValue.spec.ts +32 -0
  412. package/src/helpers/convertToRichTextValue.ts +6 -0
  413. package/src/helpers/customCoordinatesGetterFactory.spec.ts +69 -0
  414. package/src/helpers/customCoordinatesGetterFactory.ts +39 -0
  415. package/src/helpers/hasRichTextValue.spec.ts +63 -0
  416. package/src/helpers/hasRichTextValue.ts +29 -0
  417. package/src/helpers/index.ts +8 -0
  418. package/src/helpers/isDownloadable.spec.ts +47 -0
  419. package/src/helpers/isDownloadable.ts +7 -0
  420. package/src/helpers/mapColorPalettes.spec.ts +146 -0
  421. package/src/helpers/mapColorPalettes.ts +22 -0
  422. package/src/hooks/index.ts +4 -0
  423. package/src/hooks/useAttachments.spec.ts +79 -0
  424. package/src/hooks/useAttachments.ts +46 -0
  425. package/src/hooks/useDndSensors.spec.ts +40 -0
  426. package/src/hooks/useDndSensors.ts +23 -0
  427. package/src/index.ts +8 -0
  428. package/src/settings/background.spec.ts +173 -0
  429. package/src/settings/background.ts +49 -0
  430. package/src/settings/border.spec.ts +76 -0
  431. package/src/settings/border.ts +90 -0
  432. package/src/settings/borderRadius.spec.ts +30 -0
  433. package/src/settings/borderRadius.ts +73 -0
  434. package/src/settings/borderRadiusExtended.spec.ts +52 -0
  435. package/src/settings/borderRadiusExtended.ts +84 -0
  436. package/src/settings/defaultValues.ts +21 -0
  437. package/src/settings/gutter.spec.ts +60 -0
  438. package/src/settings/gutter.ts +75 -0
  439. package/src/settings/index.ts +14 -0
  440. package/src/settings/margin.spec.ts +42 -0
  441. package/src/settings/margin.ts +72 -0
  442. package/src/settings/marginExtended.spec.ts +45 -0
  443. package/src/settings/marginExtended.ts +91 -0
  444. package/src/settings/padding.spec.ts +42 -0
  445. package/src/settings/padding.ts +73 -0
  446. package/src/settings/paddingExtended.spec.ts +45 -0
  447. package/src/settings/paddingExtended.ts +91 -0
  448. package/src/settings/security.spec.ts +87 -0
  449. package/src/settings/security.ts +61 -0
  450. package/src/settings/securityDownloadable.spec.ts +46 -0
  451. package/src/settings/securityDownloadable.ts +33 -0
  452. package/src/settings/securityGlobalControl.ts +42 -0
  453. package/src/settings/types.ts +128 -0
  454. package/src/utilities/color/getReadableColor.spec.ts +32 -0
  455. package/src/utilities/color/getReadableColor.ts +34 -0
  456. package/src/utilities/color/index.ts +10 -0
  457. package/src/utilities/color/isDark.spec.ts +33 -0
  458. package/src/utilities/color/isDark.ts +29 -0
  459. package/src/utilities/color/setAlpha.spec.ts +28 -0
  460. package/src/utilities/color/setAlpha.ts +14 -0
  461. package/src/utilities/color/toColorObject.spec.ts +19 -0
  462. package/src/utilities/color/toColorObject.ts +16 -0
  463. package/src/utilities/color/toHex8String.spec.ts +17 -0
  464. package/src/utilities/color/toHex8String.ts +14 -0
  465. package/src/utilities/color/toHexString.spec.ts +17 -0
  466. package/src/utilities/color/toHexString.ts +10 -0
  467. package/src/utilities/color/toRgbaString.spec.ts +12 -0
  468. package/src/utilities/color/toRgbaString.ts +14 -0
  469. package/src/utilities/color/toShortRgba.spec.ts +16 -0
  470. package/src/utilities/color/toShortRgba.ts +35 -0
  471. package/src/utilities/index.ts +5 -0
  472. package/src/utilities/moveItemInArray.spec.ts +17 -0
  473. package/src/utilities/moveItemInArray.ts +21 -0
  474. package/src/utilities/react/getBackgroundColorStyles.spec.ts +18 -0
  475. package/src/utilities/react/getBackgroundColorStyles.ts +11 -0
  476. package/src/utilities/react/getBorderStyles.spec.ts +39 -0
  477. package/src/utilities/react/getBorderStyles.ts +21 -0
  478. package/src/utilities/react/getRadiusStyles.spec.ts +25 -0
  479. package/src/utilities/react/getRadiusStyles.ts +8 -0
  480. package/src/utilities/react/index.ts +6 -0
  481. package/src/utilities/react/joinClassNames.spec.ts +18 -0
  482. package/src/utilities/react/joinClassNames.ts +10 -0
  483. package/tailwind.config.js +27 -0
  484. package/tsconfig.json +3 -1
  485. package/vite.config.ts +11 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageLink.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock, useDocumentSection } from '@frontify/app-bridge';\nimport { merge } from '@frontify/fondue';\nimport { useEffect, useState } from 'react';\nimport { InitiallyExpandedItems } from '../../LinkPlugin/FloatingLink/InsertLinkModal/types';\nimport { SectionLink } from './SectionLink';\n\ntype DocumentLinkProps = {\n page: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n appBridge: AppBridgeBlock;\n itemsToExpandInitially: InitiallyExpandedItems;\n};\n\nexport const PageLink = ({ page, selectedUrl, onSelectUrl, itemsToExpandInitially, appBridge }: DocumentLinkProps) => {\n const [isExpanded, setIsExpanded] = useState(page.id === itemsToExpandInitially.documentId);\n const isActive = page.permanentLink === selectedUrl;\n const { documentSections } = useDocumentSection(appBridge, page.id);\n const sectionsArray = [...documentSections.values()];\n const hasSections = sectionsArray.length > 0;\n\n useEffect(() => {\n if (page.id === itemsToExpandInitially.pageId) {\n setIsExpanded(true);\n }\n }, [itemsToExpandInitially, page.id]);\n\n return (\n <>\n <div\n tabIndex={0}\n data-test-id=\"internal-link-selector-page-link\"\n className={merge([\n 'tw-py-2 tw-px-2.5 tw-leading-5 tw-cursor-pointer',\n hasSections ? 'tw-pl-7' : 'tw-pl-12',\n isActive\n ? 'tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover'\n : 'hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover',\n ])}\n onClick={() => onSelectUrl(page.permanentLink)}\n onFocus={() => onSelectUrl(page.permanentLink)}\n >\n <div key={page.id} className=\"tw-flex tw-flex-1 tw-space-x-1 tw-items-center tw-h-6\">\n {hasSections && (\n <button\n data-test-id=\"tree-item-toggle\"\n className=\"tw-flex tw-items-center tw-justify-center tw-p-1.5 tw-cursor-pointer\"\n onClick={() => setIsExpanded(!isExpanded)}\n onFocus={() => setIsExpanded(!isExpanded)}\n >\n <div\n className={merge([\n 'tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong',\n isExpanded ? 'tw-rotate-90' : '',\n ])}\n ></div>\n </button>\n )}\n <span className=\"tw-text-s\">{page.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-xs tw-text-right\">Page</span>\n </div>\n </div>\n {isExpanded &&\n sectionsArray.length > 0 &&\n sectionsArray.map((section) => {\n return (\n <SectionLink\n key={section.id}\n section={section}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n />\n );\n })}\n </>\n );\n};\n"],"names":["PageLink","page","selectedUrl","onSelectUrl","itemsToExpandInitially","appBridge","isExpanded","setIsExpanded","useState","isActive","documentSections","useDocumentSection","sectionsArray","hasSections","useEffect","jsxs","Fragment","jsx","merge","section","SectionLink"],"mappings":";;;;;AAoBa,MAAAA,IAAW,CAAC,EAAE,MAAAC,GAAM,aAAAC,GAAa,aAAAC,GAAa,wBAAAC,GAAwB,WAAAC,QAAmC;AAC5G,QAAA,CAACC,GAAYC,CAAa,IAAIC,EAAAA,SAASP,EAAK,OAAOG,EAAuB,UAAU,GACpFK,IAAWR,EAAK,kBAAkBC,GAClC,EAAE,kBAAAQ,EAAiB,IAAIC,EAAmBN,GAAWJ,EAAK,EAAE,GAC5DW,IAAgB,CAAC,GAAGF,EAAiB,OAAQ,CAAA,GAC7CG,IAAcD,EAAc,SAAS;AAE3CE,SAAAA,EAAAA,UAAU,MAAM;AACR,IAAAb,EAAK,OAAOG,EAAuB,UACnCG,EAAc,EAAI;AAAA,EAEvB,GAAA,CAACH,GAAwBH,EAAK,EAAE,CAAC,GAI5Bc,gBAAAA,EAAA,KAAAC,YAAA,EAAA,UAAA;AAAA,IAAAC,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,UAAU;AAAA,QACV,gBAAa;AAAA,QACb,WAAWC,EAAM;AAAA,UACb;AAAA,UACAL,IAAc,YAAY;AAAA,UAC1BJ,IACM,oKACA;AAAA,QAAA,CACT;AAAA,QACD,SAAS,MAAMN,EAAYF,EAAK,aAAa;AAAA,QAC7C,SAAS,MAAME,EAAYF,EAAK,aAAa;AAAA,QAE7C,UAAAc,gBAAAA,EAAA,KAAC,OAAkB,EAAA,WAAU,yDACxB,UAAA;AAAA,UACGF,KAAAI,gBAAAA,EAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,gBAAa;AAAA,cACb,WAAU;AAAA,cACV,SAAS,MAAMV,EAAc,CAACD,CAAU;AAAA,cACxC,SAAS,MAAMC,EAAc,CAACD,CAAU;AAAA,cAExC,UAAAW,gBAAAA,EAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WAAWC,EAAM;AAAA,oBACb;AAAA,oBACAZ,IAAa,iBAAiB;AAAA,kBAAA,CACjC;AAAA,gBAAA;AAAA,cACJ;AAAA,YAAA;AAAA,UACL;AAAA,UAEHW,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,aAAa,YAAK,OAAM;AAAA,UACvCA,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,sDAAqD,UAAI,QAAA;AAAA,QAAA,EAAA,GAjBnEhB,EAAK,EAkBf;AAAA,MAAA;AAAA,IACJ;AAAA,IACCK,KACGM,EAAc,SAAS,KACvBA,EAAc,IAAI,CAACO,MAEXF,gBAAAA,EAAA;AAAA,MAACG;AAAA,MAAA;AAAA,QAEG,SAAAD;AAAA,QACA,aAAAjB;AAAA,QACA,aAAAC;AAAA,MAAA;AAAA,MAHKgB,EAAQ;AAAA,IAAA,CAMxB;AAAA,EACT,EAAA,CAAA;AAER;"}
@@ -0,0 +1,34 @@
1
+ import { j as t } from "../../../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
2
+ import { LoadingCircle as d } from "@frontify/fondue";
3
+ import { r as s } from "../../../../../node_modules/.pnpm/react@18.2.0/node_modules/react/index.es.js";
4
+ import { PageLink as p } from "./PageLink.es.js";
5
+ const y = ({
6
+ appBridge: n,
7
+ documentId: o,
8
+ selectedUrl: i,
9
+ onSelectUrl: c,
10
+ itemsToExpandInitially: m
11
+ }) => {
12
+ const [l, x] = s.useState([]), [a, g] = s.useState(!0), r = [...l.values()], u = !a && r.length > 0;
13
+ return s.useEffect(() => {
14
+ n.getDocumentPagesByDocumentId(o).then((e) => {
15
+ x(e);
16
+ }).finally(() => {
17
+ g(!1);
18
+ });
19
+ }, []), a ? /* @__PURE__ */ t.jsx("div", { className: "tw-flex tw-justify-center tw-p-4", children: /* @__PURE__ */ t.jsx(d, {}) }) : u ? /* @__PURE__ */ t.jsx(t.Fragment, { children: r.map((e) => /* @__PURE__ */ t.jsx(
20
+ p,
21
+ {
22
+ page: e,
23
+ appBridge: n,
24
+ selectedUrl: i,
25
+ onSelectUrl: c,
26
+ itemsToExpandInitially: m
27
+ },
28
+ e.id
29
+ )) }) : /* @__PURE__ */ t.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." });
30
+ };
31
+ export {
32
+ y as PageLinks
33
+ };
34
+ //# sourceMappingURL=PageLinks.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageLinks.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock, DocumentPage } from '@frontify/app-bridge';\nimport { LoadingCircle } from '@frontify/fondue';\nimport { ReactElement, useEffect, useState } from 'react';\nimport { InitiallyExpandedItems } from '../../LinkPlugin/FloatingLink/InsertLinkModal/types';\nimport { PageLink } from './PageLink';\n\ntype PageLinksProps = {\n appBridge: AppBridgeBlock;\n documentId: number;\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n};\n\nexport const PageLinks = ({\n appBridge,\n documentId,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\n}: PageLinksProps): ReactElement => {\n const [pages, setPages] = useState<DocumentPage[]>([]);\n const [isLoading, setIsLoading] = useState(true);\n const pagesArray = [...pages.values()];\n const hasPages = !isLoading && pagesArray.length > 0;\n\n useEffect(() => {\n appBridge\n .getDocumentPagesByDocumentId(documentId)\n .then((_pages) => {\n setPages(_pages);\n })\n .finally(() => {\n setIsLoading(false);\n });\n }, []);\n\n if (isLoading) {\n return (\n <div className=\"tw-flex tw-justify-center tw-p-4\">\n <LoadingCircle />\n </div>\n );\n }\n\n return hasPages ? (\n <>\n {pagesArray.map((page) => {\n return (\n <PageLink\n key={page.id}\n page={page}\n appBridge={appBridge}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n />\n );\n })}\n </>\n ) : (\n <div className=\"tw-py-2 tw-px-2.5 tw-pl-7 tw-leading-5 tw-text-s tw-text-text-weak\">\n This document does not contain any pages.\n </div>\n );\n};\n"],"names":["PageLinks","appBridge","documentId","selectedUrl","onSelectUrl","itemsToExpandInitially","pages","setPages","useState","isLoading","setIsLoading","pagesArray","hasPages","useEffect","_pages","jsx","LoadingCircle","Fragment","page","PageLink"],"mappings":";;;;AAgBO,MAAMA,IAAY,CAAC;AAAA,EACtB,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;AACJ,MAAoC;AAChC,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAA,SAAyB,CAAE,CAAA,GAC/C,CAACC,GAAWC,CAAY,IAAIF,WAAS,EAAI,GACzCG,IAAa,CAAC,GAAGL,EAAM,OAAQ,CAAA,GAC/BM,IAAW,CAACH,KAAaE,EAAW,SAAS;AAanD,SAXAE,EAAAA,UAAU,MAAM;AACZ,IAAAZ,EACK,6BAA6BC,CAAU,EACvC,KAAK,CAACY,MAAW;AACd,MAAAP,EAASO,CAAM;AAAA,IAAA,CAClB,EACA,QAAQ,MAAM;AACX,MAAAJ,EAAa,EAAK;AAAA,IAAA,CACrB;AAAA,EACT,GAAG,CAAE,CAAA,GAEDD,0BAEK,OAAI,EAAA,WAAU,oCACX,UAAAM,gBAAAA,EAAAA,IAACC,KAAc,EACnB,CAAA,IAIDJ,IACHG,gBAAAA,EAAA,IAAAE,YAAA,EACK,UAAWN,EAAA,IAAI,CAACO,MAETH,gBAAAA,EAAA;AAAA,IAACI;AAAA,IAAA;AAAA,MAEG,MAAAD;AAAA,MACA,WAAAjB;AAAA,MACA,aAAAE;AAAA,MACA,aAAAC;AAAA,MACA,wBAAAC;AAAA,IAAA;AAAA,IALKa,EAAK;AAAA,EAAA,CAQrB,EACL,CAAA,0BAEC,OAAI,EAAA,WAAU,sEAAqE,UAEpF,4CAAA,CAAA;AAER;"}
@@ -0,0 +1,26 @@
1
+ import { j as t } from "../../../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
2
+ import { merge as o, IconDocumentText16 as i } from "@frontify/fondue";
3
+ const a = ({ section: e, selectedUrl: r, onSelectUrl: n }) => {
4
+ const s = e.permanentLink === r;
5
+ return /* @__PURE__ */ t.jsx(
6
+ "button",
7
+ {
8
+ "data-test-id": "internal-link-selector-section-link",
9
+ className: o([
10
+ "tw-py-2 tw-px-2.5 tw-pl-14 tw-leading-5 tw-cursor-pointer tw-w-full",
11
+ s ? "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"
12
+ ]),
13
+ onClick: () => n(e.permanentLink),
14
+ onFocus: () => n(e.permanentLink),
15
+ children: /* @__PURE__ */ t.jsxs("div", { className: "tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-h-6", children: [
16
+ /* @__PURE__ */ t.jsx(i, {}),
17
+ /* @__PURE__ */ t.jsx("span", { className: "tw-text-s", children: e.title }),
18
+ /* @__PURE__ */ t.jsx("span", { className: "tw-flex-auto tw-font-sans tw-text-xs tw-text-right", children: "Section" })
19
+ ] })
20
+ }
21
+ );
22
+ };
23
+ export {
24
+ a as SectionLink
25
+ };
26
+ //# sourceMappingURL=SectionLink.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionLink.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconDocumentText16, merge } from '@frontify/fondue';\n\ntype SectionLinkProps = {\n section: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n};\n\nexport const SectionLink = ({ section, selectedUrl, onSelectUrl }: SectionLinkProps) => {\n const isActive = section.permanentLink === selectedUrl;\n\n return (\n <button\n data-test-id=\"internal-link-selector-section-link\"\n className={merge([\n 'tw-py-2 tw-px-2.5 tw-pl-14 tw-leading-5 tw-cursor-pointer tw-w-full',\n isActive\n ? 'tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover'\n : 'hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover',\n ])}\n onClick={() => onSelectUrl(section.permanentLink)}\n onFocus={() => onSelectUrl(section.permanentLink)}\n >\n <div className=\"tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-h-6\">\n <IconDocumentText16 />\n <span className=\"tw-text-s\">{section.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-xs tw-text-right\">Section</span>\n </div>\n </button>\n );\n};\n"],"names":["SectionLink","section","selectedUrl","onSelectUrl","isActive","jsx","merge","jsxs","IconDocumentText16"],"mappings":";;AAcO,MAAMA,IAAc,CAAC,EAAE,SAAAC,GAAS,aAAAC,GAAa,aAAAC,QAAoC;AAC9E,QAAAC,IAAWH,EAAQ,kBAAkBC;AAGvC,SAAAG,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,gBAAa;AAAA,MACb,WAAWC,EAAM;AAAA,QACb;AAAA,QACAF,IACM,oKACA;AAAA,MAAA,CACT;AAAA,MACD,SAAS,MAAMD,EAAYF,EAAQ,aAAa;AAAA,MAChD,SAAS,MAAME,EAAYF,EAAQ,aAAa;AAAA,MAEhD,UAAAM,gBAAAA,EAAA,KAAC,OAAI,EAAA,WAAU,yDACX,UAAA;AAAA,QAAAF,gBAAAA,EAAA,IAACG,GAAmB,EAAA;AAAA,QACnBH,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,aAAa,YAAQ,OAAM;AAAA,QAC1CA,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,sDAAqD,UAAO,WAAA;AAAA,MAAA,GAChF;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
@@ -0,0 +1,168 @@
1
+ import { LINK_PLUGIN as e } from "./LinkPlugin/id.es.js";
2
+ import { BlockButtonStyles as i } from "./ButtonPlugin/utils/styles.es.js";
3
+ var n = /* @__PURE__ */ ((t) => (t.heading1 = "heading1", t.heading2 = "heading2", t.heading3 = "heading3", t.heading4 = "heading4", t.custom1 = "custom1", t.custom2 = "custom2", t.custom3 = "custom3", t.quote = "quote", t.imageCaption = "imageCaption", t.imageTitle = "imageTitle", t.p = "p", t))(n || {});
4
+ const s = {
5
+ heading1: {
6
+ display: "inline-block",
7
+ fontSize: "var(--f-theme-settings-heading1-font-size)",
8
+ lineHeight: "var(--f-theme-settings-heading1-line-height)",
9
+ marginTop: "var(--f-theme-settings-heading1-margin-top)",
10
+ marginBottom: "var(--f-theme-settings-heading1-margin-bottom)",
11
+ textDecoration: "var(--f-theme-settings-heading1-text-decoration)",
12
+ fontStyle: "var(--f-theme-settings-heading1-font-style)",
13
+ textTransform: "var(--f-theme-settings-heading1-text-transform)",
14
+ letterSpacing: "var(--f-theme-settings-heading1-letter-spacing)",
15
+ fontWeight: "var(--f-theme-settings-heading1-font-weight)",
16
+ fontFamily: "var(--f-theme-settings-heading1-font-family)",
17
+ color: "var(--f-theme-settings-heading1-color)"
18
+ },
19
+ heading2: {
20
+ fontSize: "var(--f-theme-settings-heading2-font-size)",
21
+ lineHeight: "var(--f-theme-settings-heading2-line-height)",
22
+ marginTop: "var(--f-theme-settings-heading2-margin-top)",
23
+ marginBottom: "var(--f-theme-settings-heading2-margin-bottom)",
24
+ textDecoration: "var(--f-theme-settings-heading2-text-decoration)",
25
+ fontStyle: "var(--f-theme-settings-heading2-font-style)",
26
+ textTransform: "var(--f-theme-settings-heading2-text-transform)",
27
+ letterSpacing: "var(--f-theme-settings-heading2-letter-spacing)",
28
+ fontWeight: "var(--f-theme-settings-heading2-font-weight)",
29
+ fontFamily: "var(--f-theme-settings-heading2-font-family)",
30
+ color: "var(--f-theme-settings-heading2-color)"
31
+ },
32
+ heading3: {
33
+ fontSize: "var(--f-theme-settings-heading3-font-size)",
34
+ lineHeight: "var(--f-theme-settings-heading3-line-height)",
35
+ marginTop: "var(--f-theme-settings-heading3-margin-top)",
36
+ marginBottom: "var(--f-theme-settings-heading3-margin-bottom)",
37
+ textDecoration: "var(--f-theme-settings-heading3-text-decoration)",
38
+ fontStyle: "var(--f-theme-settings-heading3-font-style)",
39
+ textTransform: "var(--f-theme-settings-heading3-text-transform)",
40
+ letterSpacing: "var(--f-theme-settings-heading3-letter-spacing)",
41
+ fontWeight: "var(--f-theme-settings-heading3-font-weight)",
42
+ fontFamily: "var(--f-theme-settings-heading3-font-family)",
43
+ color: "var(--f-theme-settings-heading3-color)"
44
+ },
45
+ heading4: {
46
+ fontSize: "var(--f-theme-settings-heading4-font-size)",
47
+ lineHeight: "var(--f-theme-settings-heading4-line-height)",
48
+ marginTop: "var(--f-theme-settings-heading4-margin-top)",
49
+ marginBottom: "var(--f-theme-settings-heading4-margin-bottom)",
50
+ textDecoration: "var(--f-theme-settings-heading4-text-decoration)",
51
+ fontStyle: "var(--f-theme-settings-heading4-font-style)",
52
+ textTransform: "var(--f-theme-settings-heading4-text-transform)",
53
+ letterSpacing: "var(--f-theme-settings-heading4-letter-spacing)",
54
+ fontWeight: "var(--f-theme-settings-heading4-font-weight)",
55
+ fontFamily: "var(--f-theme-settings-heading4-font-family)",
56
+ color: "var(--f-theme-settings-heading4-color)"
57
+ },
58
+ custom1: {
59
+ fontSize: "var(--f-theme-settings-custom1-font-size)",
60
+ lineHeight: "var(--f-theme-settings-custom1-line-height)",
61
+ marginTop: "var(--f-theme-settings-custom1-margin-top)",
62
+ marginBottom: "var(--f-theme-settings-custom1-margin-bottom)",
63
+ textDecoration: "var(--f-theme-settings-custom1-text-decoration)",
64
+ fontStyle: "var(--f-theme-settings-custom1-font-style)",
65
+ textTransform: "var(--f-theme-settings-custom1-text-transform)",
66
+ letterSpacing: "var(--f-theme-settings-custom1-letter-spacing)",
67
+ fontWeight: "var(--f-theme-settings-custom1-font-weight)",
68
+ fontFamily: "var(--f-theme-settings-custom1-font-family)",
69
+ color: "var(--f-theme-settings-custom1-color)"
70
+ },
71
+ custom2: {
72
+ fontSize: "var(--f-theme-settings-custom2-font-size)",
73
+ lineHeight: "var(--f-theme-settings-custom2-line-height)",
74
+ marginTop: "var(--f-theme-settings-custom2-margin-top)",
75
+ marginBottom: "var(--f-theme-settings-custom2-margin-bottom)",
76
+ textDecoration: "var(--f-theme-settings-custom2-text-decoration)",
77
+ fontStyle: "var(--f-theme-settings-custom2-font-style)",
78
+ textTransform: "var(--f-theme-settings-custom2-text-transform)",
79
+ letterSpacing: "var(--f-theme-settings-custom2-letter-spacing)",
80
+ fontWeight: "var(--f-theme-settings-custom2-font-weight)",
81
+ fontFamily: "var(--f-theme-settings-custom2-font-family)",
82
+ color: "var(--f-theme-settings-custom2-color)"
83
+ },
84
+ custom3: {
85
+ fontSize: "var(--f-theme-settings-custom3-font-size)",
86
+ lineHeight: "var(--f-theme-settings-custom3-line-height)",
87
+ marginTop: "var(--f-theme-settings-custom3-margin-top)",
88
+ marginBottom: "var(--f-theme-settings-custom3-margin-bottom)",
89
+ textDecoration: "var(--f-theme-settings-custom3-text-decoration)",
90
+ fontStyle: "var(--f-theme-settings-custom3-font-style)",
91
+ textTransform: "var(--f-theme-settings-custom3-text-transform)",
92
+ letterSpacing: "var(--f-theme-settings-custom3-letter-spacing)",
93
+ fontWeight: "var(--f-theme-settings-custom3-font-weight)",
94
+ fontFamily: "var(--f-theme-settings-custom3-font-family)",
95
+ color: "var(--f-theme-settings-custom3-color)"
96
+ },
97
+ p: {
98
+ fontSize: "var(--f-theme-settings-body-font-size)",
99
+ lineHeight: "var(--f-theme-settings-body-line-height)",
100
+ marginTop: "var(--f-theme-settings-body-margin-top)",
101
+ marginBottom: "var(--f-theme-settings-body-margin-bottom)",
102
+ textDecoration: "var(--f-theme-settings-body-text-decoration)",
103
+ fontStyle: "var(--f-theme-settings-body-font-style)",
104
+ textTransform: "var(--f-theme-settings-body-text-transform)",
105
+ letterSpacing: "var(--f-theme-settings-body-letter-spacing)",
106
+ fontWeight: "var(--f-theme-settings-body-font-weight)",
107
+ fontFamily: "var(--f-theme-settings-body-font-family)",
108
+ color: "var(--f-theme-settings-body-color)"
109
+ },
110
+ quote: {
111
+ fontSize: "var(--f-theme-settings-quote-font-size)",
112
+ lineHeight: "var(--f-theme-settings-quote-line-height)",
113
+ marginTop: "var(--f-theme-settings-quote-margin-top)",
114
+ marginBottom: "var(--f-theme-settings-quote-margin-bottom)",
115
+ textDecoration: "var(--f-theme-settings-quote-text-decoration)",
116
+ fontStyle: "var(--f-theme-settings-quote-font-style)",
117
+ textTransform: "var(--f-theme-settings-quote-text-transform)",
118
+ letterSpacing: "var(--f-theme-settings-quote-letter-spacing)",
119
+ fontWeight: "var(--f-theme-settings-quote-font-weight)",
120
+ fontFamily: "var(--f-theme-settings-quote-font-family)",
121
+ color: "var(--f-theme-settings-quote-color)"
122
+ },
123
+ imageCaption: {
124
+ fontSize: "var(--f-theme-settings-image-caption-font-size)",
125
+ lineHeight: "var(--f-theme-settings-image-caption-line-height)",
126
+ marginTop: "var(--f-theme-settings-image-caption-margin-top)",
127
+ marginBottom: "var(--f-theme-settings-image-caption-margin-bottom)",
128
+ textDecoration: "var(--f-theme-settings-image-caption-text-decoration)",
129
+ fontStyle: "var(--f-theme-settings-image-caption-font-style)",
130
+ textTransform: "var(--f-theme-settings-image-caption-text-transform)",
131
+ letterSpacing: "var(--f-theme-settings-image-caption-letter-spacing)",
132
+ fontWeight: "var(--f-theme-settings-image-caption-font-weight)",
133
+ fontFamily: "var(--f-theme-settings-image-caption-font-family)",
134
+ color: "var(--f-theme-settings-image-caption-color)"
135
+ },
136
+ imageTitle: {
137
+ fontSize: "var(--f-theme-settings-image-title-font-size)",
138
+ lineHeight: "var(--f-theme-settings-image-title-line-height)",
139
+ marginTop: "var(--f-theme-settings-image-title-margin-top)",
140
+ marginBottom: "var(--f-theme-settings-image-title-margin-bottom)",
141
+ textDecoration: "var(--f-theme-settings-image-title-text-decoration)",
142
+ fontStyle: "var(--f-theme-settings-image-title-font-style)",
143
+ textTransform: "var(--f-theme-settings-image-title-text-transform)",
144
+ letterSpacing: "var(--f-theme-settings-image-title-letter-spacing)",
145
+ fontWeight: "var(--f-theme-settings-image-title-font-weight)",
146
+ fontFamily: "var(--f-theme-settings-image-title-font-family)",
147
+ color: "var(--f-theme-settings-image-title-color)"
148
+ },
149
+ [e]: {
150
+ fontSize: "var(--f-theme-settings-link-font-size)",
151
+ lineHeight: "var(--f-theme-settings-link-line-height)",
152
+ marginTop: "var(--f-theme-settings-link-margin-top)",
153
+ marginBottom: "var(--f-theme-settings-link-margin-bottom)",
154
+ textDecoration: "var(--f-theme-settings-link-text-decoration)",
155
+ fontStyle: "var(--f-theme-settings-link-font-style)",
156
+ textTransform: "var(--f-theme-settings-link-text-transform)",
157
+ letterSpacing: "var(--f-theme-settings-link-letter-spacing)",
158
+ fontWeight: "var(--f-theme-settings-link-font-weight)",
159
+ fontFamily: "var(--f-theme-settings-link-font-family)",
160
+ color: "var(--f-theme-settings-link-color)"
161
+ },
162
+ ...i
163
+ };
164
+ export {
165
+ s as BlockStyles,
166
+ n as TextStyles
167
+ };
168
+ //# sourceMappingURL=styles.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.es.js","sources":["../../../../src/components/RichTextEditor/plugins/styles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\nimport { LINK_PLUGIN } from './LinkPlugin/id';\nimport { BlockButtonStyles } from './ButtonPlugin';\n\nexport const enum TextStyles {\n heading1 = 'heading1',\n heading2 = 'heading2',\n heading3 = 'heading3',\n heading4 = 'heading4',\n custom1 = 'custom1',\n custom2 = 'custom2',\n custom3 = 'custom3',\n quote = 'quote',\n imageCaption = 'imageCaption',\n imageTitle = 'imageTitle',\n p = 'p',\n}\nexport const BlockStyles: Record<string, CSSProperties & { hover?: CSSProperties }> = {\n [TextStyles.heading1]: {\n display: 'inline-block',\n fontSize: 'var(--f-theme-settings-heading1-font-size)',\n lineHeight: 'var(--f-theme-settings-heading1-line-height)',\n marginTop: 'var(--f-theme-settings-heading1-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading1-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading1-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading1-font-style)',\n textTransform: 'var(--f-theme-settings-heading1-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading1-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading1-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading1-font-family)',\n color: 'var(--f-theme-settings-heading1-color)',\n },\n [TextStyles.heading2]: {\n fontSize: 'var(--f-theme-settings-heading2-font-size)',\n lineHeight: 'var(--f-theme-settings-heading2-line-height)',\n marginTop: 'var(--f-theme-settings-heading2-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading2-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading2-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading2-font-style)',\n textTransform: 'var(--f-theme-settings-heading2-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading2-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading2-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading2-font-family)',\n color: 'var(--f-theme-settings-heading2-color)',\n },\n [TextStyles.heading3]: {\n fontSize: 'var(--f-theme-settings-heading3-font-size)',\n lineHeight: 'var(--f-theme-settings-heading3-line-height)',\n marginTop: 'var(--f-theme-settings-heading3-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading3-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading3-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading3-font-style)',\n textTransform: 'var(--f-theme-settings-heading3-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading3-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading3-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading3-font-family)',\n color: 'var(--f-theme-settings-heading3-color)',\n },\n [TextStyles.heading4]: {\n fontSize: 'var(--f-theme-settings-heading4-font-size)',\n lineHeight: 'var(--f-theme-settings-heading4-line-height)',\n marginTop: 'var(--f-theme-settings-heading4-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading4-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading4-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading4-font-style)',\n textTransform: 'var(--f-theme-settings-heading4-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading4-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading4-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading4-font-family)',\n color: 'var(--f-theme-settings-heading4-color)',\n },\n [TextStyles.custom1]: {\n fontSize: 'var(--f-theme-settings-custom1-font-size)',\n lineHeight: 'var(--f-theme-settings-custom1-line-height)',\n marginTop: 'var(--f-theme-settings-custom1-margin-top)',\n marginBottom: 'var(--f-theme-settings-custom1-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-custom1-text-decoration)',\n fontStyle: 'var(--f-theme-settings-custom1-font-style)',\n textTransform: 'var(--f-theme-settings-custom1-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-custom1-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-custom1-font-weight)',\n fontFamily: 'var(--f-theme-settings-custom1-font-family)',\n color: 'var(--f-theme-settings-custom1-color)',\n },\n [TextStyles.custom2]: {\n fontSize: 'var(--f-theme-settings-custom2-font-size)',\n lineHeight: 'var(--f-theme-settings-custom2-line-height)',\n marginTop: 'var(--f-theme-settings-custom2-margin-top)',\n marginBottom: 'var(--f-theme-settings-custom2-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-custom2-text-decoration)',\n fontStyle: 'var(--f-theme-settings-custom2-font-style)',\n textTransform: 'var(--f-theme-settings-custom2-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-custom2-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-custom2-font-weight)',\n fontFamily: 'var(--f-theme-settings-custom2-font-family)',\n color: 'var(--f-theme-settings-custom2-color)',\n },\n [TextStyles.custom3]: {\n fontSize: 'var(--f-theme-settings-custom3-font-size)',\n lineHeight: 'var(--f-theme-settings-custom3-line-height)',\n marginTop: 'var(--f-theme-settings-custom3-margin-top)',\n marginBottom: 'var(--f-theme-settings-custom3-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-custom3-text-decoration)',\n fontStyle: 'var(--f-theme-settings-custom3-font-style)',\n textTransform: 'var(--f-theme-settings-custom3-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-custom3-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-custom3-font-weight)',\n fontFamily: 'var(--f-theme-settings-custom3-font-family)',\n color: 'var(--f-theme-settings-custom3-color)',\n },\n [TextStyles.p]: {\n fontSize: 'var(--f-theme-settings-body-font-size)',\n lineHeight: 'var(--f-theme-settings-body-line-height)',\n marginTop: 'var(--f-theme-settings-body-margin-top)',\n marginBottom: 'var(--f-theme-settings-body-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-body-text-decoration)',\n fontStyle: 'var(--f-theme-settings-body-font-style)',\n textTransform: 'var(--f-theme-settings-body-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-body-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-body-font-weight)',\n fontFamily: 'var(--f-theme-settings-body-font-family)',\n color: 'var(--f-theme-settings-body-color)',\n },\n [TextStyles.quote]: {\n fontSize: 'var(--f-theme-settings-quote-font-size)',\n lineHeight: 'var(--f-theme-settings-quote-line-height)',\n marginTop: 'var(--f-theme-settings-quote-margin-top)',\n marginBottom: 'var(--f-theme-settings-quote-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-quote-text-decoration)',\n fontStyle: 'var(--f-theme-settings-quote-font-style)',\n textTransform: 'var(--f-theme-settings-quote-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-quote-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-quote-font-weight)',\n fontFamily: 'var(--f-theme-settings-quote-font-family)',\n color: 'var(--f-theme-settings-quote-color)',\n },\n [TextStyles.imageCaption]: {\n fontSize: 'var(--f-theme-settings-image-caption-font-size)',\n lineHeight: 'var(--f-theme-settings-image-caption-line-height)',\n marginTop: 'var(--f-theme-settings-image-caption-margin-top)',\n marginBottom: 'var(--f-theme-settings-image-caption-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-image-caption-text-decoration)',\n fontStyle: 'var(--f-theme-settings-image-caption-font-style)',\n textTransform: 'var(--f-theme-settings-image-caption-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-image-caption-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-image-caption-font-weight)',\n fontFamily: 'var(--f-theme-settings-image-caption-font-family)',\n color: 'var(--f-theme-settings-image-caption-color)',\n },\n [TextStyles.imageTitle]: {\n fontSize: 'var(--f-theme-settings-image-title-font-size)',\n lineHeight: 'var(--f-theme-settings-image-title-line-height)',\n marginTop: 'var(--f-theme-settings-image-title-margin-top)',\n marginBottom: 'var(--f-theme-settings-image-title-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-image-title-text-decoration)',\n fontStyle: 'var(--f-theme-settings-image-title-font-style)',\n textTransform: 'var(--f-theme-settings-image-title-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-image-title-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-image-title-font-weight)',\n fontFamily: 'var(--f-theme-settings-image-title-font-family)',\n color: 'var(--f-theme-settings-image-title-color)',\n },\n [LINK_PLUGIN]: {\n fontSize: 'var(--f-theme-settings-link-font-size)',\n lineHeight: 'var(--f-theme-settings-link-line-height)',\n marginTop: 'var(--f-theme-settings-link-margin-top)',\n marginBottom: 'var(--f-theme-settings-link-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-link-text-decoration)',\n fontStyle: 'var(--f-theme-settings-link-font-style)',\n textTransform: 'var(--f-theme-settings-link-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-link-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-link-font-weight)',\n fontFamily: 'var(--f-theme-settings-link-font-family)',\n color: 'var(--f-theme-settings-link-color)',\n },\n ...BlockButtonStyles,\n};\n"],"names":["TextStyles","BlockStyles","LINK_PLUGIN","BlockButtonStyles"],"mappings":"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"}
@@ -0,0 +1,16 @@
1
+ import { reactCssPropsToCss as s } from "../utlis/reactCssPropsToCss.es.js";
2
+ import { BUTTON_PLUGIN as $ } from "../../plugins/ButtonPlugin/createButtonPlugin.es.js";
3
+ const b = (e, n, a, u) => {
4
+ const l = u[$], o = e.buttonStyle ?? "primary", c = `button${o.charAt(0).toUpperCase()}${o.slice(1)}`, t = l[c], r = s(t);
5
+ return `<a href="${e.url}"
6
+ target="${e.target ?? "_blank"}"
7
+ style="${r}"
8
+ class="${a}"
9
+ onmouseenter="this.setAttribute('style', '${r} ${s(t == null ? void 0 : t.hover)}');"
10
+ onmouseleave="this.setAttribute('style', '${s(t)}');"
11
+ >${n}</a>`;
12
+ };
13
+ export {
14
+ b as buttonNode
15
+ };
16
+ //# sourceMappingURL=button.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/button.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TElement } from '@udecode/plate';\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\nimport { CSSProperties } from 'react';\nimport { BUTTON_PLUGIN } from '../../plugins';\n\nexport type ButtonStylesType = Record<string, Record<string, CSSProperties & { hover?: CSSProperties }>>;\n\nexport const buttonNode = (node: TElement, children: string, defaultClassNames: string, styles: ButtonStylesType) => {\n const buttonStyles = styles[BUTTON_PLUGIN];\n const buttonTypeString = (node.buttonStyle as string) ?? 'primary';\n const buttonType = `button${buttonTypeString.charAt(0).toUpperCase()}${buttonTypeString.slice(1)}`;\n const buttonStyle = buttonStyles[buttonType];\n\n const defaultStyles = reactCssPropsToCss(buttonStyle);\n\n return `<a href=\"${node.url}\"\n target=\"${node.target ?? '_blank'}\"\n style=\"${defaultStyles}\"\n class=\"${defaultClassNames}\"\n onmouseenter=\"this.setAttribute('style', '${defaultStyles} ${reactCssPropsToCss(buttonStyle?.hover)}');\"\n onmouseleave=\"this.setAttribute('style', '${reactCssPropsToCss(buttonStyle)}');\"\n >${children}</a>`;\n};\n"],"names":["buttonNode","node","children","defaultClassNames","styles","buttonStyles","BUTTON_PLUGIN","buttonTypeString","buttonType","buttonStyle","defaultStyles","reactCssPropsToCss"],"mappings":";;AASO,MAAMA,IAAa,CAACC,GAAgBC,GAAkBC,GAA2BC,MAA6B;AAC3G,QAAAC,IAAeD,EAAOE,CAAa,GACnCC,IAAoBN,EAAK,eAA0B,WACnDO,IAAa,SAASD,EAAiB,OAAO,CAAC,EAAE,YAAY,IAAIA,EAAiB,MAAM,CAAC,KACzFE,IAAcJ,EAAaG,CAAU,GAErCE,IAAgBC,EAAmBF,CAAW;AAEpD,SAAO,YAAYR,EAAK;AAAA,0BACFA,EAAK,UAAU;AAAA,yBAChBS;AAAA,yBACAP;AAAA,4DACmCO,KAAiBC,EAAmBF,KAAA,gBAAAA,EAAa,KAAK;AAAA,4DACtDE,EAAmBF,CAAW;AAAA,mBACvEP;AACnB;"}
@@ -0,0 +1,19 @@
1
+ import { merge as l } from "@frontify/fondue";
2
+ import { reactCssPropsToCss as r } from "../utlis/reactCssPropsToCss.es.js";
3
+ const n = (t, e, s, c) => `<div disabled class="tw-flex tw-flex-row tw-pb-2 first-of-type:tw-ml-0 ${s}" style="margin-left:${(t.indent ?? 0) * 24}px;">
4
+ <div class="tw-flex tw-items-center tw-justify-center tw-select-none tw-mr-1.5">
5
+ <input
6
+ class="tw-w-4 tw-h-4 tw-m-0"
7
+ type="checkbox"
8
+ ${t.checked ? "checked" : ""}
9
+ onclick="return false;" />
10
+ </div>
11
+ <span class="${l([
12
+ "tw-flex-1 tw-focus:outline-none",
13
+ t.checked ? "!tw-line-through" : ""
14
+ ])}" style="${r(c[t.children[0].textStyle])}">${e}</span>
15
+ </div>`;
16
+ export {
17
+ n as checkItemNode
18
+ };
19
+ //# sourceMappingURL=checkItemNode.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkItemNode.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/checkItemNode.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { merge } from '@frontify/fondue';\nimport { TElement } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\n\nexport const checkItemNode = (\n node: TElement,\n children: string,\n defaultClassNames: string,\n styles: Record<string, CSSProperties & { hover?: CSSProperties }>\n) => {\n return `<div disabled class=\"tw-flex tw-flex-row tw-pb-2 first-of-type:tw-ml-0 ${defaultClassNames}\" style=\"margin-left:${\n ((node.indent as number) ?? 0) * 24\n }px;\">\n <div class=\"tw-flex tw-items-center tw-justify-center tw-select-none tw-mr-1.5\">\n <input\n class=\"tw-w-4 tw-h-4 tw-m-0\"\n type=\"checkbox\"\n ${node.checked ? 'checked' : ''}\n onclick=\"return false;\" />\n </div>\n <span class=\"${merge([\n 'tw-flex-1 tw-focus:outline-none',\n node.checked ? '!tw-line-through' : '',\n ])}\" style=\"${reactCssPropsToCss(styles[node.children[0].textStyle as string])}\">${children}</span>\n</div>`;\n};\n"],"names":["checkItemNode","node","children","defaultClassNames","styles","merge","reactCssPropsToCss"],"mappings":";;AAOO,MAAMA,IAAgB,CACzBC,GACAC,GACAC,GACAC,MAEO,0EAA0ED,0BAC3EF,EAAK,UAAqB,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,cAM3BA,EAAK,UAAU,YAAY;AAAA;AAAA;AAAA,mBAGtBI,EAAM;AAAA,EACjB;AAAA,EACAJ,EAAK,UAAU,qBAAqB;AACvC,CAAA,aAAaK,EAAmBF,EAAOH,EAAK,SAAS,CAAC,EAAE,SAAmB,CAAC,MAAMC;AAAA;"}
@@ -0,0 +1,17 @@
1
+ import { reactCssPropsToCss as s } from "../utlis/reactCssPropsToCss.es.js";
2
+ import { merge as y } from "@frontify/fondue";
3
+ import { TextStyles as o } from "../../plugins/styles.es.js";
4
+ const m = (p, t, c, $) => {
5
+ const r = s(c);
6
+ return p.type === o.heading1 ? `<h1 class="${y([$, "a-h1"])}">${i(t, r)}</h1>` : p.type === o.heading2 ? `<h2 class="${$}">${i(t, r)}</h2>` : p.type === o.heading3 ? `<h3 class="${$}">${i(t, r)}</h3>` : p.type === o.heading4 ? `<h4 class="${$}">${i(t, r)}</h4>` : p.type === o.custom1 ? `<p class="${y([$, "a-custom1"])}">${i(t, r)}</p>` : p.type === o.custom2 ? `<p class="${y([$, "a-custom2"])}">${i(t, r)}</p>` : p.type === o.custom3 ? `<p class="${y([$, "a-custom3"])}">${i(t, r)}</p>` : p.type === o.quote ? `<p class="${y([$, "a-quote"])}">${i(t, r)}</p>` : p.type === o.imageTitle ? `<p class="${y([$, "a-image-title"])}">${i(
7
+ t,
8
+ r
9
+ )}</p>` : p.type === o.imageCaption ? `<p class="${y([$, "a-image-caption"])}">${i(
10
+ t,
11
+ r
12
+ )}</p>` : `<p class="${$}">${i(t, r)}</p>`;
13
+ }, i = (p, t) => `<span style="${t}">${p}</span>`;
14
+ export {
15
+ m as defaultNode
16
+ };
17
+ //# sourceMappingURL=default.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/default.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TElement } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport { TextStyles } from '../../plugins';\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\nimport { merge } from '@frontify/fondue';\n\nexport const defaultNode = (node: TElement, children: string, styles: CSSProperties, defaultClassNames: string) => {\n const defaultStyles = reactCssPropsToCss(styles);\n\n if (node.type === TextStyles.heading1) {\n return `<h1 class=\"${merge([defaultClassNames, 'a-h1'])}\">${getStyledChild(children, defaultStyles)}</h1>`;\n }\n if (node.type === TextStyles.heading2) {\n return `<h2 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h2>`;\n }\n if (node.type === TextStyles.heading3) {\n return `<h3 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h3>`;\n }\n if (node.type === TextStyles.heading4) {\n return `<h4 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h4>`;\n }\n if (node.type === TextStyles.custom1) {\n return `<p class=\"${merge([defaultClassNames, 'a-custom1'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.custom2) {\n return `<p class=\"${merge([defaultClassNames, 'a-custom2'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.custom3) {\n return `<p class=\"${merge([defaultClassNames, 'a-custom3'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.quote) {\n return `<p class=\"${merge([defaultClassNames, 'a-quote'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.imageTitle) {\n return `<p class=\"${merge([defaultClassNames, 'a-image-title'])}\">${getStyledChild(\n children,\n defaultStyles\n )}</p>`;\n }\n if (node.type === TextStyles.imageCaption) {\n return `<p class=\"${merge([defaultClassNames, 'a-image-caption'])}\">${getStyledChild(\n children,\n defaultStyles\n )}</p>`;\n }\n\n return `<p class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</p>`;\n};\n\nconst getStyledChild = (children: string, styles: string) => `<span style=\"${styles}\">${children}</span>`;\n"],"names":["defaultNode","node","children","styles","defaultClassNames","defaultStyles","reactCssPropsToCss","TextStyles","merge","getStyledChild"],"mappings":";;;AAQO,MAAMA,IAAc,CAACC,GAAgBC,GAAkBC,GAAuBC,MAA8B;AACzG,QAAAC,IAAgBC,EAAmBH,CAAM;AAE3C,SAAAF,EAAK,SAASM,EAAW,WAClB,cAAcC,EAAM,CAACJ,GAAmB,MAAM,CAAC,MAAMK,EAAeP,GAAUG,CAAa,WAElGJ,EAAK,SAASM,EAAW,WAClB,cAAcH,MAAsBK,EAAeP,GAAUG,CAAa,WAEjFJ,EAAK,SAASM,EAAW,WAClB,cAAcH,MAAsBK,EAAeP,GAAUG,CAAa,WAEjFJ,EAAK,SAASM,EAAW,WAClB,cAAcH,MAAsBK,EAAeP,GAAUG,CAAa,WAEjFJ,EAAK,SAASM,EAAW,UAClB,aAAaC,EAAM,CAACJ,GAAmB,WAAW,CAAC,MAAMK,EAAeP,GAAUG,CAAa,UAEtGJ,EAAK,SAASM,EAAW,UAClB,aAAaC,EAAM,CAACJ,GAAmB,WAAW,CAAC,MAAMK,EAAeP,GAAUG,CAAa,UAEtGJ,EAAK,SAASM,EAAW,UAClB,aAAaC,EAAM,CAACJ,GAAmB,WAAW,CAAC,MAAMK,EAAeP,GAAUG,CAAa,UAEtGJ,EAAK,SAASM,EAAW,QAClB,aAAaC,EAAM,CAACJ,GAAmB,SAAS,CAAC,MAAMK,EAAeP,GAAUG,CAAa,UAEpGJ,EAAK,SAASM,EAAW,aAClB,aAAaC,EAAM,CAACJ,GAAmB,eAAe,CAAC,MAAMK;AAAA,IAChEP;AAAA,IACAG;AAAA,EACJ,UAEAJ,EAAK,SAASM,EAAW,eAClB,aAAaC,EAAM,CAACJ,GAAmB,iBAAiB,CAAC,MAAMK;AAAA,IAClEP;AAAA,IACAG;AAAA,EACJ,UAGG,aAAaD,MAAsBK,EAAeP,GAAUG,CAAa;AACpF,GAEMI,IAAiB,CAACP,GAAkBC,MAAmB,gBAAgBA,MAAWD;"}
@@ -0,0 +1,15 @@
1
+ import { LINK_PLUGIN as p } from "../../plugins/LinkPlugin/id.es.js";
2
+ import { reactCssPropsToCss as e } from "../utlis/reactCssPropsToCss.es.js";
3
+ import f from "escape-html";
4
+ const _ = (r, a, s, $) => {
5
+ var l;
6
+ if (r.chosenLink) {
7
+ const { chosenLink: t } = r;
8
+ return `<a class="${s}" style="${e($[p])}" target=${t != null && t.openInNewTab ? "_blank" : "_self"} href="${f((l = t == null ? void 0 : t.searchResult) == null ? void 0 : l.link)}">${a}</a>`;
9
+ }
10
+ return `<a class="${s}" style="${e($[p])}" target="${(r == null ? void 0 : r.target) ?? "_blank"}" href="${f(r.url)}">${a}</a>`;
11
+ };
12
+ export {
13
+ _ as linkNode
14
+ };
15
+ //# sourceMappingURL=link.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/link.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TElement } from '@udecode/plate';\nimport { LINK_PLUGIN } from '../../plugins/LinkPlugin/id';\nimport { TLinkElement } from '../../plugins/LinkPlugin/types';\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\nimport escapeHtml from 'escape-html';\nimport { CSSProperties } from 'react';\n\nexport const linkNode = (\n node: TElement,\n children: string,\n defaultClassNames: string,\n styles: Record<string, CSSProperties & { hover?: CSSProperties }>\n) => {\n if (node.chosenLink) {\n const { chosenLink } = node as TLinkElement;\n return `<a class=\"${defaultClassNames}\" style=\"${reactCssPropsToCss(styles[LINK_PLUGIN])}\" target=${\n chosenLink?.openInNewTab ? '_blank' : '_self'\n } href=\"${escapeHtml(chosenLink?.searchResult?.link)}\">${children}</a>`;\n }\n return `<a class=\"${defaultClassNames}\" style=\"${reactCssPropsToCss(styles[LINK_PLUGIN])}\" target=\"${\n node?.target ?? '_blank'\n }\" href=\"${escapeHtml(node.url as string)}\">${children}</a>`;\n};\n"],"names":["linkNode","node","children","defaultClassNames","styles","chosenLink","reactCssPropsToCss","LINK_PLUGIN","escapeHtml","_a"],"mappings":";;;AASO,MAAMA,IAAW,CACpBC,GACAC,GACAC,GACAC,MACC;;AACD,MAAIH,EAAK,YAAY;AACX,UAAA,EAAE,YAAAI,EAAe,IAAAJ;AACvB,WAAO,aAAaE,aAA6BG,EAAmBF,EAAOG,CAAW,CAAC,aACnFF,KAAA,QAAAA,EAAY,eAAe,WAAW,iBAChCG,GAAWC,IAAAJ,KAAA,gBAAAA,EAAY,iBAAZ,gBAAAI,EAA0B,IAAI,MAAMP;AAAA;AAE7D,SAAO,aAAaC,aAA6BG,EAAmBF,EAAOG,CAAW,CAAC,eACnFN,KAAA,gBAAAA,EAAM,WAAU,mBACTO,EAAWP,EAAK,GAAa,MAAMC;AAClD;"}
@@ -0,0 +1,12 @@
1
+ import n from "../../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/index.es.js";
2
+ import { MentionMarkupElementNode as o } from "@frontify/fondue";
3
+ const d = (r, { mentionable: e } = {}) => {
4
+ if (!e)
5
+ return "";
6
+ const t = document.createElement("div");
7
+ return n.render(o(e)({ element: r }), t), t.innerHTML;
8
+ };
9
+ export {
10
+ d as mentionHtmlNode
11
+ };
12
+ //# sourceMappingURL=mentionHtmlNode.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mentionHtmlNode.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/mentionHtmlNode.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport ReactDOM from 'react-dom';\nimport { TElement, TMentionElement } from '@udecode/plate';\nimport { MappedMentionableItems, MentionMarkupElementNode } from '@frontify/fondue';\n\ntype MentionHtmlNodeProps = { mentionable?: MappedMentionableItems };\n\nexport const mentionHtmlNode = (node: TElement, { mentionable }: MentionHtmlNodeProps = {}) => {\n if (!mentionable) {\n return '';\n }\n\n const div = document.createElement('div');\n ReactDOM.render(MentionMarkupElementNode(mentionable)({ element: node as TMentionElement }), div);\n return div.innerHTML;\n};\n"],"names":["mentionHtmlNode","node","mentionable","div","ReactDOM","MentionMarkupElementNode"],"mappings":";;AAQO,MAAMA,IAAkB,CAACC,GAAgB,EAAE,aAAAC,EAAY,IAA0B,CAAA,MAAO;AAC3F,MAAI,CAACA;AACM,WAAA;AAGL,QAAAC,IAAM,SAAS,cAAc,KAAK;AAC/B,SAAAC,EAAA,OAAOC,EAAyBH,CAAW,EAAE,EAAE,SAASD,EAAA,CAAyB,GAAGE,CAAG,GACzFA,EAAI;AACf;"}
@@ -0,0 +1,61 @@
1
+ import { UL_CLASSES as N, getOrderedListClasses as p, LI_CLASSNAMES as f, getLiStyles as L, getLicElementClassNames as u, ELEMENT_CHECK_ITEM as T, alignmentClassnames as C, merge as $, OL_STYLES as M } from "@frontify/fondue";
2
+ import { isText as _, ELEMENT_UL as g, ELEMENT_OL as n, ELEMENT_LI as k, ELEMENT_LIC as y, ELEMENT_LINK as S, ELEMENT_MENTION as h } from "@udecode/plate";
3
+ import { serializeLeafToHtml as b } from "./utlis/serializeLeafToHtml.es.js";
4
+ import { reactCssPropsToCss as E } from "./utlis/reactCssPropsToCss.es.js";
5
+ import { buttonNode as d } from "./nodes/button.es.js";
6
+ import { linkNode as I } from "./nodes/link.es.js";
7
+ import { defaultNode as O } from "./nodes/default.es.js";
8
+ import { checkItemNode as A } from "./nodes/checkItemNode.es.js";
9
+ import { mentionHtmlNode as H } from "./nodes/mentionHtmlNode.es.js";
10
+ import { ELEMENT_BUTTON as v } from "../plugins/ButtonPlugin/createButtonPlugin.es.js";
11
+ const i = (e, t) => e.reduce((r, s) => (s.type === t && r++, s.children ? r + i(s.children, t) : r), 0), w = (e, t, { mappedMentionable: r, nestingCount: s = {} }) => {
12
+ if (_(e))
13
+ return b(e);
14
+ const o = s[e.type] || i([e], e.type);
15
+ let l = "";
16
+ for (const a of e.children)
17
+ l += w(a, t, {
18
+ nestingCount: {
19
+ ...s,
20
+ [a.type]: o
21
+ },
22
+ mappedMentionable: r
23
+ });
24
+ const m = x[e.type];
25
+ return typeof m < "u" ? m({
26
+ classNames: c(e.breakAfterColumn, e.align),
27
+ children: l,
28
+ rootNestingCount: o,
29
+ node: e,
30
+ mappedMentionable: r,
31
+ styles: t
32
+ }) : O(
33
+ e,
34
+ l,
35
+ t[e.type],
36
+ c(e.breakAfterColumn, e.align)
37
+ );
38
+ }, x = {
39
+ [g]: (e) => `<ul class="${N} ${e.classNames}">${e.children}</ul>`,
40
+ [n]: ({ classNames: e, children: t, node: r, rootNestingCount: s }) => {
41
+ const o = Math.max(s - i([r], n), 0);
42
+ return `<ol class="${p(o)} ${e}" style="${E(
43
+ M
44
+ )}">${t}</ol>`;
45
+ },
46
+ [k]: ({ classNames: e, children: t, node: r, styles: s }) => `<li class="${e} ${f}" style="${E(
47
+ L(r, s)
48
+ )}">${t}</li>`,
49
+ [y]: ({ classNames: e, children: t, node: r }) => `<p class="${e} ${u(r)}"><span>${t}</span></p>`,
50
+ [S]: ({ node: e, children: t, classNames: r, styles: s }) => I(e, t, r, s),
51
+ [v]: ({ node: e, children: t, classNames: r, styles: s }) => d(e, t, r, s),
52
+ [T]: ({ node: e, children: t, classNames: r, styles: s }) => A(e, t, r, s),
53
+ [h]: ({ node: e, mappedMentionable: t }) => H(e, { mentionable: t })
54
+ }, c = (e, t) => {
55
+ const r = "tw-break-words", s = e === "active" ? "tw-break-after-column tw-break-inside-avoid-column" : "", o = t ? C[t] : "";
56
+ return $([o, r, s]);
57
+ };
58
+ export {
59
+ w as serializeNodeToHtmlRecursive
60
+ };
61
+ //# sourceMappingURL=serializeNodesToHtmlRecursive.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializeNodesToHtmlRecursive.es.js","sources":["../../../../src/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ELEMENT_CHECK_ITEM,\n LI_CLASSNAMES,\n MappedMentionableItems,\n OL_STYLES,\n UL_CLASSES,\n alignmentClassnames,\n getLiStyles,\n getLicElementClassNames,\n getOrderedListClasses,\n merge,\n} from '@frontify/fondue';\nimport {\n ELEMENT_LI,\n ELEMENT_LIC,\n ELEMENT_LINK,\n ELEMENT_MENTION,\n ELEMENT_OL,\n ELEMENT_UL,\n TDescendant,\n TElement,\n isText,\n} from '@udecode/plate';\nimport { serializeLeafToHtml } from './utlis/serializeLeafToHtml';\nimport { reactCssPropsToCss } from './utlis/reactCssPropsToCss';\nimport { CSSProperties } from 'react';\nimport { ButtonStylesType, buttonNode } from './nodes/button';\nimport { linkNode } from './nodes/link';\nimport { defaultNode } from './nodes/default';\nimport { checkItemNode } from './nodes/checkItemNode';\nimport { mentionHtmlNode } from './nodes/mentionHtmlNode';\nimport { ELEMENT_BUTTON } from '../plugins';\n\nconst countNodesOfType = (nodes: TDescendant[], type: string): number => {\n return nodes.reduce((acc, node) => {\n if (node.type === type) {\n acc++;\n }\n if (node.children) {\n return acc + countNodesOfType(node.children as TDescendant[], type);\n }\n return acc;\n }, 0);\n};\n\ntype NestingCount = {\n [type: string]: number;\n};\n\ntype SerializeNodeToHtmlRecursiveOptions = {\n mappedMentionable?: MappedMentionableItems;\n nestingCount?: NestingCount;\n};\n\nexport const serializeNodeToHtmlRecursive = (\n node: TDescendant,\n styles: Record<string, CSSProperties & { hover?: CSSProperties }> | ButtonStylesType,\n { mappedMentionable, nestingCount = {} }: SerializeNodeToHtmlRecursiveOptions\n): string => {\n if (isText(node)) {\n return serializeLeafToHtml(node);\n }\n\n const rootNestingCount = nestingCount[node.type] || countNodesOfType([node], node.type);\n let children = '';\n for (const element of node.children) {\n children += serializeNodeToHtmlRecursive(element, styles, {\n nestingCount: {\n ...nestingCount,\n [element.type as string]: rootNestingCount,\n },\n mappedMentionable,\n });\n }\n\n const htmlMapper = MapNodeTypesToHtml[node.type];\n if (typeof htmlMapper !== 'undefined') {\n return htmlMapper({\n classNames: getClassNames(node.breakAfterColumn as string | undefined, node.align as string | undefined),\n children,\n rootNestingCount,\n node,\n mappedMentionable,\n styles,\n });\n } else {\n return defaultNode(\n node,\n children,\n styles[node.type],\n getClassNames(node.breakAfterColumn as string | undefined, node.align as string | undefined)\n );\n }\n};\n\ntype Arguments = {\n classNames: string;\n children: string;\n rootNestingCount: number;\n node: TElement;\n mappedMentionable?: MappedMentionableItems;\n styles: Record<string, CSSProperties & { hover?: CSSProperties }> | ButtonStylesType;\n};\n\nconst MapNodeTypesToHtml: { [key: string]: ({ ...args }: Arguments) => string } = {\n [ELEMENT_UL]: (args) => `<ul class=\"${UL_CLASSES} ${args.classNames}\">${args.children}</ul>`,\n [ELEMENT_OL]: ({ classNames, children, node, rootNestingCount }) => {\n const nestingLevel = Math.max(rootNestingCount - countNodesOfType([node], ELEMENT_OL), 0);\n return `<ol class=\"${getOrderedListClasses(nestingLevel)} ${classNames}\" style=\"${reactCssPropsToCss(\n OL_STYLES\n )}\">${children}</ol>`;\n },\n [ELEMENT_LI]: ({ classNames, children, node, styles }) =>\n `<li class=\"${classNames} ${LI_CLASSNAMES}\" style=\"${reactCssPropsToCss(\n getLiStyles(node, styles)\n )}\">${children}</li>`,\n [ELEMENT_LIC]: ({ classNames, children, node }) =>\n `<p class=\"${classNames} ${getLicElementClassNames(node)}\"><span>${children}</span></p>`,\n [ELEMENT_LINK]: ({ node, children, classNames, styles }) => linkNode(node, children, classNames, styles),\n [ELEMENT_BUTTON]: ({ node, children, classNames, styles }) =>\n buttonNode(node, children, classNames, styles as ButtonStylesType),\n [ELEMENT_CHECK_ITEM]: ({ node, children, classNames, styles }) => checkItemNode(node, children, classNames, styles),\n [ELEMENT_MENTION]: ({ node, mappedMentionable }) => mentionHtmlNode(node, { mentionable: mappedMentionable }),\n};\n\nconst getClassNames = (breakAfterColumn?: string, align?: string) => {\n const breakWordsClass = 'tw-break-words';\n const columnBreakClasses =\n breakAfterColumn === 'active' ? 'tw-break-after-column tw-break-inside-avoid-column' : '';\n const alignClass = align ? alignmentClassnames[align] : '';\n return merge([alignClass, breakWordsClass, columnBreakClasses]);\n};\n"],"names":["countNodesOfType","nodes","type","acc","node","serializeNodeToHtmlRecursive","styles","mappedMentionable","nestingCount","isText","serializeLeafToHtml","rootNestingCount","children","element","htmlMapper","MapNodeTypesToHtml","getClassNames","defaultNode","ELEMENT_UL","args","UL_CLASSES","ELEMENT_OL","classNames","nestingLevel","getOrderedListClasses","reactCssPropsToCss","OL_STYLES","ELEMENT_LI","LI_CLASSNAMES","getLiStyles","ELEMENT_LIC","getLicElementClassNames","ELEMENT_LINK","linkNode","ELEMENT_BUTTON","buttonNode","ELEMENT_CHECK_ITEM","checkItemNode","ELEMENT_MENTION","mentionHtmlNode","breakAfterColumn","align","breakWordsClass","columnBreakClasses","alignClass","alignmentClassnames","merge"],"mappings":"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"}
@@ -0,0 +1,25 @@
1
+ import { parseRawValue as c, PluginComposer as p, mapMentionable as y } from "@frontify/fondue";
2
+ import { serializeNodeToHtmlRecursive as f } from "./serializeNodesToHtmlRecursive.es.js";
3
+ import { BlockStyles as u } from "../plugins/styles.es.js";
4
+ const A = async (e, r = 1, t = "normal", l = new p()) => {
5
+ const i = c({ raw: e, plugins: l }), o = l.getStyles;
6
+ return Promise.resolve(v(i, { columns: r, columnGap: t, styles: o }));
7
+ }, v = (e, { mentionable: r, columns: t = 1, columnGap: l = "normal", styles: i = u } = {}) => {
8
+ const o = r ? y(r) : /* @__PURE__ */ new Map();
9
+ let s = "";
10
+ for (let a = 0, n = e.length; a < n; a++) {
11
+ const m = e[a];
12
+ h(m) ? s += "<br />" : s += f(m, i, {
13
+ mappedMentionable: o
14
+ });
15
+ }
16
+ return t > 1 ? `<div style="columns:${t}; column-gap:${l};">${s}</div>` : s;
17
+ }, h = (e) => {
18
+ var r;
19
+ return Array.isArray(e == null ? void 0 : e.children) ? (r = e == null ? void 0 : e.children) == null ? void 0 : r.every((t) => t.text === "") : !1;
20
+ };
21
+ export {
22
+ v as serializeNodesToHtml,
23
+ A as serializeRawToHtmlAsync
24
+ };
25
+ //# sourceMappingURL=serializeToHtml.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializeToHtml.es.js","sources":["../../../../src/components/RichTextEditor/serializer/serializeToHtml.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TDescendant } from '@udecode/plate';\nimport { PluginComposer, SerializeNodesToHtmlOptions, mapMentionable, parseRawValue } from '@frontify/fondue';\nimport { BlockStyles } from '../plugins';\nimport { serializeNodeToHtmlRecursive } from './serializeNodesToHtmlRecursive';\n\nexport const serializeRawToHtmlAsync = async (\n raw: string,\n columns: SerializeNodesToHtmlOptions['columns'] = 1,\n columnGap: SerializeNodesToHtmlOptions['columnGap'] = 'normal',\n plugins: PluginComposer = new PluginComposer()\n): Promise<string> => {\n const nodes = parseRawValue({ raw, plugins });\n const styles = plugins.getStyles;\n return Promise.resolve(serializeNodesToHtml(nodes, { columns, columnGap, styles }));\n};\n\nexport const serializeNodesToHtml = (\n nodes: TDescendant[],\n { mentionable, columns = 1, columnGap = 'normal', styles = BlockStyles }: SerializeNodesToHtmlOptions = {}\n): string => {\n const mappedMentionable = mentionable ? mapMentionable(mentionable) : new Map();\n\n let html = '';\n for (let i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n if (isEmptyNode(node)) {\n html += '<br />';\n } else {\n html += serializeNodeToHtmlRecursive(node, styles, {\n mappedMentionable,\n });\n }\n }\n\n if (columns > 1) {\n return `<div style=\"columns:${columns}; column-gap:${columnGap};\">${html}</div>`;\n }\n\n return html;\n};\n\nconst isEmptyNode = (node: TDescendant): boolean => {\n if (!Array.isArray(node?.children)) {\n return false;\n }\n return node?.children?.every((child) => child.text === '');\n};\n"],"names":["serializeRawToHtmlAsync","raw","columns","columnGap","plugins","PluginComposer","nodes","parseRawValue","styles","serializeNodesToHtml","mentionable","BlockStyles","mappedMentionable","mapMentionable","html","i","len","node","isEmptyNode","serializeNodeToHtmlRecursive","_a","child"],"mappings":";;;AAOa,MAAAA,IAA0B,OACnCC,GACAC,IAAkD,GAClDC,IAAsD,UACtDC,IAA0B,IAAIC,QACZ;AAClB,QAAMC,IAAQC,EAAc,EAAE,KAAAN,GAAK,SAAAG,EAAS,CAAA,GACtCI,IAASJ,EAAQ;AAChB,SAAA,QAAQ,QAAQK,EAAqBH,GAAO,EAAE,SAAAJ,GAAS,WAAAC,GAAW,QAAAK,EAAQ,CAAA,CAAC;AACtF,GAEaC,IAAuB,CAChCH,GACA,EAAE,aAAAI,GAAa,SAAAR,IAAU,GAAG,WAAAC,IAAY,UAAU,QAAAK,IAASG,EAAY,IAAiC,CAAA,MAC/F;AACT,QAAMC,IAAoBF,IAAcG,EAAeH,CAAW,wBAAQ;AAE1E,MAAII,IAAO;AACX,WAASC,IAAI,GAAGC,IAAMV,EAAM,QAAQS,IAAIC,GAAKD,KAAK;AACxC,UAAAE,IAAOX,EAAMS,CAAC;AAChB,IAAAG,EAAYD,CAAI,IACRH,KAAA,WAEAA,KAAAK,EAA6BF,GAAMT,GAAQ;AAAA,MAC/C,mBAAAI;AAAA,IAAA,CACH;AAAA;AAIT,SAAIV,IAAU,IACH,uBAAuBA,iBAAuBC,OAAeW,YAGjEA;AACX,GAEMI,IAAc,CAACD,MAA+B;;AAChD,SAAK,MAAM,QAAQA,KAAA,gBAAAA,EAAM,QAAQ,KAG1BG,IAAAH,KAAA,gBAAAA,EAAM,aAAN,gBAAAG,EAAgB,MAAM,CAACC,MAAUA,EAAM,SAAS,MAF5C;AAGf;"}
@@ -0,0 +1,8 @@
1
+ const l = (e) => e ? Object.keys(e).reduce((r, t) => {
2
+ const s = e[t];
3
+ return s ? `${r}${a(t)}: ${s}; ` : r;
4
+ }, "").trim().replaceAll('"', "'") : "", a = (e) => e.replaceAll(/([A-Z])/g, "-$1").toLowerCase();
5
+ export {
6
+ l as reactCssPropsToCss
7
+ };
8
+ //# sourceMappingURL=reactCssPropsToCss.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactCssPropsToCss.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\n\nexport const reactCssPropsToCss = (props?: CSSProperties): string => {\n if (!props) {\n return '';\n }\n\n return Object.keys(props)\n .reduce<string>((acc, key) => {\n const value = props[key as keyof CSSProperties];\n return value ? `${acc}${convertCamelCaseToKebabCase(key)}: ${value}; ` : acc;\n }, '')\n .trim()\n .replaceAll('\"', \"'\");\n};\n\nconst convertCamelCaseToKebabCase = (str: string): string => {\n return str.replaceAll(/([A-Z])/g, '-$1').toLowerCase();\n};\n"],"names":["reactCssPropsToCss","props","acc","key","value","convertCamelCaseToKebabCase","str"],"mappings":"AAIa,MAAAA,IAAqB,CAACC,MAC1BA,IAIE,OAAO,KAAKA,CAAK,EACnB,OAAe,CAACC,GAAKC,MAAQ;AACpB,QAAAC,IAAQH,EAAME,CAA0B;AAC9C,SAAOC,IAAQ,GAAGF,IAAMG,EAA4BF,CAAG,MAAMC,QAAYF;AAAA,GAC1E,EAAE,EACJ,OACA,WAAW,KAAK,GAAG,IATb,IAYTG,IAA8B,CAACC,MAC1BA,EAAI,WAAW,YAAY,KAAK,EAAE,YAAY;"}
@@ -0,0 +1,13 @@
1
+ import { BOLD_CLASSES as S, ITALIC_CLASSES as c, UNDERLINE_CLASSES as $, STRIKETHROUGH_CLASSES as f, CODE_CLASSES as o } from "@frontify/fondue";
2
+ import u from "escape-html";
3
+ const A = (a) => {
4
+ let s = u(a.text);
5
+ s = s.replaceAll(`
6
+ `, "<br />");
7
+ const { bold: p, italic: i, underline: e, strikethrough: r, code: t, subscript: l, superscript: n } = a;
8
+ return p && (s = `<span class="${S}">${s}</span>`), i && (s = `<span class="${c}">${s}</span>`), e && (s = `<span class="${$}">${s}</span>`), r && (s = `<span class="${f}">${s}</span>`), t && (s = `<span class="${o}">${s}</span>`), l ? s = `<sub>${s}</sub>` : n && (s = `<sup>${s}</sup>`), s;
9
+ };
10
+ export {
11
+ A as serializeLeafToHtml
12
+ };
13
+ //# sourceMappingURL=serializeLeafToHtml.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializeLeafToHtml.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { BOLD_CLASSES, CODE_CLASSES, ITALIC_CLASSES, STRIKETHROUGH_CLASSES, UNDERLINE_CLASSES } from '@frontify/fondue';\nimport { TText } from '@udecode/plate';\nimport escapeHtml from 'escape-html';\n\nexport const serializeLeafToHtml = (node: TText): string => {\n let string = escapeHtml(node.text);\n string = string.replaceAll('\\n', '<br />');\n const { bold, italic, underline, strikethrough, code, subscript, superscript } = node;\n if (bold) {\n string = `<span class=\"${BOLD_CLASSES}\">${string}</span>`;\n }\n if (italic) {\n string = `<span class=\"${ITALIC_CLASSES}\">${string}</span>`;\n }\n if (underline) {\n string = `<span class=\"${UNDERLINE_CLASSES}\">${string}</span>`;\n }\n if (strikethrough) {\n string = `<span class=\"${STRIKETHROUGH_CLASSES}\">${string}</span>`;\n }\n if (code) {\n string = `<span class=\"${CODE_CLASSES}\">${string}</span>`;\n }\n if (subscript) {\n string = `<sub>${string}</sub>`;\n } else if (superscript) {\n string = `<sup>${string}</sup>`;\n }\n return string;\n};\n"],"names":["serializeLeafToHtml","node","string","escapeHtml","bold","italic","underline","strikethrough","code","subscript","superscript","BOLD_CLASSES","ITALIC_CLASSES","UNDERLINE_CLASSES","STRIKETHROUGH_CLASSES","CODE_CLASSES"],"mappings":";;AAMa,MAAAA,IAAsB,CAACC,MAAwB;AACpD,MAAAC,IAASC,EAAWF,EAAK,IAAI;AACxB,EAAAC,IAAAA,EAAO,WAAW;AAAA,GAAM,QAAQ;AACnC,QAAA,EAAE,MAAAE,GAAM,QAAAC,GAAQ,WAAAC,GAAW,eAAAC,GAAe,MAAAC,GAAM,WAAAC,GAAW,aAAAC,EAAgB,IAAAT;AACjF,SAAIG,MACAF,IAAS,gBAAgBS,MAAiBT,aAE1CG,MACAH,IAAS,gBAAgBU,MAAmBV,aAE5CI,MACAJ,IAAS,gBAAgBW,MAAsBX,aAE/CK,MACAL,IAAS,gBAAgBY,MAA0BZ,aAEnDM,MACAN,IAAS,gBAAgBa,MAAiBb,aAE1CO,IACAP,IAAS,QAAQA,YACVQ,MACPR,IAAS,QAAQA,YAEdA;AACX;"}
@@ -0,0 +1,14 @@
1
+ import { relativeUrlRegex as e } from "../components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.es.js";
2
+ const n = (t) => {
3
+ if (e.test(t))
4
+ return t;
5
+ try {
6
+ return new URL(t), t;
7
+ } catch {
8
+ return `https://${t}`;
9
+ }
10
+ };
11
+ export {
12
+ n as addHttps
13
+ };
14
+ //# sourceMappingURL=addHttps.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addHttps.es.js","sources":["../../src/helpers/addHttps.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { relativeUrlRegex } from '../components/RichTextEditor/plugins/LinkPlugin/utils';\n\nexport const addHttps = (url: string) => {\n if (relativeUrlRegex.test(url)) {\n return url;\n }\n try {\n new URL(url);\n return url;\n } catch {\n return `https://${url}`;\n }\n};\n"],"names":["addHttps","url","relativeUrlRegex"],"mappings":";AAIa,MAAAA,IAAW,CAACC,MAAgB;AACjC,MAAAC,EAAiB,KAAKD,CAAG;AAClB,WAAAA;AAEP,MAAA;AACA,eAAI,IAAIA,CAAG,GACJA;AAAA,EAAA,QACT;AACE,WAAO,WAAWA;AAAA,EACtB;AACJ;"}