react-native-enriched-html 0.0.0 → 1.0.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 (747) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +402 -0
  3. package/ReactNativeEnrichedHtml.podspec +31 -0
  4. package/android/build.gradle +106 -0
  5. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedTextInputViewManagerDelegate.java +203 -0
  6. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedTextInputViewManagerInterface.java +74 -0
  7. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedTextViewManagerDelegate.java +70 -0
  8. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedTextViewManagerInterface.java +31 -0
  9. package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/ComponentDescriptors.cpp +22 -0
  10. package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/ComponentDescriptors.h +24 -0
  11. package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/EventEmitters.cpp +456 -0
  12. package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/EventEmitters.h +410 -0
  13. package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/Props.cpp +272 -0
  14. package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/Props.h +1595 -0
  15. package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/ShadowNodes.cpp +17 -0
  16. package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/ShadowNodes.h +23 -0
  17. package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/States.cpp +16 -0
  18. package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/States.h +20 -0
  19. package/android/gradle.properties +5 -0
  20. package/android/lint.gradle +70 -0
  21. package/android/src/main/AndroidManifest.xml +3 -0
  22. package/android/src/main/AndroidManifestNew.xml +2 -0
  23. package/android/src/main/java/com/swmansion/enriched/ReactNativeEnrichedPackage.kt +22 -0
  24. package/android/src/main/java/com/swmansion/enriched/common/AllowFontScaling.kt +36 -0
  25. package/android/src/main/java/com/swmansion/enriched/common/AsyncDrawable.kt +126 -0
  26. package/android/src/main/java/com/swmansion/enriched/common/CheckboxDrawable.kt +81 -0
  27. package/android/src/main/java/com/swmansion/enriched/common/EnrichedConstants.kt +16 -0
  28. package/android/src/main/java/com/swmansion/enriched/common/EnrichedSpanFlags.kt +39 -0
  29. package/android/src/main/java/com/swmansion/enriched/common/EnrichedStyle.kt +57 -0
  30. package/android/src/main/java/com/swmansion/enriched/common/ForceRedrawSpan.kt +14 -0
  31. package/android/src/main/java/com/swmansion/enriched/common/GumboNormalizer.kt +5 -0
  32. package/android/src/main/java/com/swmansion/enriched/common/MentionStyle.kt +9 -0
  33. package/android/src/main/java/com/swmansion/enriched/common/ResourceManager.kt +26 -0
  34. package/android/src/main/java/com/swmansion/enriched/common/parser/EnrichedParser.java +1057 -0
  35. package/android/src/main/java/com/swmansion/enriched/common/parser/EnrichedSpanFactory.kt +83 -0
  36. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedAlignmentSpan.kt +19 -0
  37. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedBlockQuoteSpan.kt +53 -0
  38. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedBoldSpan.kt +12 -0
  39. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedCheckboxListSpan.kt +92 -0
  40. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedCodeBlockSpan.kt +81 -0
  41. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedH1Span.kt +20 -0
  42. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedH2Span.kt +20 -0
  43. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedH3Span.kt +20 -0
  44. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedH4Span.kt +21 -0
  45. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedH5Span.kt +20 -0
  46. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedH6Span.kt +20 -0
  47. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedImageSpan.kt +185 -0
  48. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedInlineCodeSpan.kt +24 -0
  49. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedItalicSpan.kt +12 -0
  50. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedLinkSpan.kt +29 -0
  51. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedMentionSpan.kt +35 -0
  52. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedOrderedListSpan.kt +79 -0
  53. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedStrikeThroughSpan.kt +11 -0
  54. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedUnderlineSpan.kt +11 -0
  55. package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedUnorderedListSpan.kt +62 -0
  56. package/android/src/main/java/com/swmansion/enriched/common/spans/interfaces/EnrichedBlockSpan.kt +5 -0
  57. package/android/src/main/java/com/swmansion/enriched/common/spans/interfaces/EnrichedHeadingSpan.kt +3 -0
  58. package/android/src/main/java/com/swmansion/enriched/common/spans/interfaces/EnrichedInlineSpan.kt +3 -0
  59. package/android/src/main/java/com/swmansion/enriched/common/spans/interfaces/EnrichedParagraphSpan.kt +5 -0
  60. package/android/src/main/java/com/swmansion/enriched/common/spans/interfaces/EnrichedSpan.kt +3 -0
  61. package/android/src/main/java/com/swmansion/enriched/common/spans/interfaces/EnrichedZeroWidthSpaceSpan.kt +4 -0
  62. package/android/src/main/java/com/swmansion/enriched/text/EnrichedTextMovementMethod.kt +75 -0
  63. package/android/src/main/java/com/swmansion/enriched/text/EnrichedTextSpanFactory.kt +84 -0
  64. package/android/src/main/java/com/swmansion/enriched/text/EnrichedTextStyle.kt +202 -0
  65. package/android/src/main/java/com/swmansion/enriched/text/EnrichedTextView.kt +362 -0
  66. package/android/src/main/java/com/swmansion/enriched/text/EnrichedTextViewManager.kt +157 -0
  67. package/android/src/main/java/com/swmansion/enriched/text/MeasurementStore.kt +170 -0
  68. package/android/src/main/java/com/swmansion/enriched/text/events/OnLinkPressEvent.kt +23 -0
  69. package/android/src/main/java/com/swmansion/enriched/text/events/OnMentionPressEvent.kt +32 -0
  70. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextAlignmentSpan.kt +14 -0
  71. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextBlockQuoteSpan.kt +14 -0
  72. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextBoldSpan.kt +14 -0
  73. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextCheckboxListSpan.kt +15 -0
  74. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextCodeBlockSpan.kt +14 -0
  75. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextH1Span.kt +14 -0
  76. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextH2Span.kt +14 -0
  77. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextH3Span.kt +15 -0
  78. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextH4Span.kt +15 -0
  79. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextH5Span.kt +14 -0
  80. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextH6Span.kt +14 -0
  81. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextImageSpan.kt +57 -0
  82. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextInlineCodeSpan.kt +14 -0
  83. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextItalicSpan.kt +14 -0
  84. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextLinkSpan.kt +41 -0
  85. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextMentionSpan.kt +63 -0
  86. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextOrderedListSpan.kt +16 -0
  87. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextStrikeThroughSpan.kt +15 -0
  88. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextUnderlineSpan.kt +15 -0
  89. package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextUnorderedListSpan.kt +15 -0
  90. package/android/src/main/java/com/swmansion/enriched/text/spans/interfaces/EnrichedTextClickableSpan.kt +9 -0
  91. package/android/src/main/java/com/swmansion/enriched/text/spans/interfaces/EnrichedTextSpan.kt +10 -0
  92. package/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputConnectionWrapper.kt +140 -0
  93. package/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputSpannableFactory.kt +86 -0
  94. package/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputView.kt +1144 -0
  95. package/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputViewLayoutManager.kt +27 -0
  96. package/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputViewManager.kt +500 -0
  97. package/android/src/main/java/com/swmansion/enriched/textinput/MeasurementStore.kt +230 -0
  98. package/android/src/main/java/com/swmansion/enriched/textinput/events/MentionHandler.kt +65 -0
  99. package/android/src/main/java/com/swmansion/enriched/textinput/events/OnChangeHtmlEvent.kt +27 -0
  100. package/android/src/main/java/com/swmansion/enriched/textinput/events/OnChangeSelectionEvent.kt +30 -0
  101. package/android/src/main/java/com/swmansion/enriched/textinput/events/OnChangeStateEvent.kt +21 -0
  102. package/android/src/main/java/com/swmansion/enriched/textinput/events/OnChangeTextEvent.kt +30 -0
  103. package/android/src/main/java/com/swmansion/enriched/textinput/events/OnContextMenuItemPressEvent.kt +35 -0
  104. package/android/src/main/java/com/swmansion/enriched/textinput/events/OnInputBlurEvent.kt +25 -0
  105. package/android/src/main/java/com/swmansion/enriched/textinput/events/OnInputFocusEvent.kt +25 -0
  106. package/android/src/main/java/com/swmansion/enriched/textinput/events/OnInputKeyPressEvent.kt +27 -0
  107. package/android/src/main/java/com/swmansion/enriched/textinput/events/OnLinkDetectedEvent.kt +32 -0
  108. package/android/src/main/java/com/swmansion/enriched/textinput/events/OnMentionDetectedEvent.kt +30 -0
  109. package/android/src/main/java/com/swmansion/enriched/textinput/events/OnMentionEvent.kt +40 -0
  110. package/android/src/main/java/com/swmansion/enriched/textinput/events/OnPasteImagesEvent.kt +47 -0
  111. package/android/src/main/java/com/swmansion/enriched/textinput/events/OnRequestHtmlResultEvent.kt +32 -0
  112. package/android/src/main/java/com/swmansion/enriched/textinput/events/OnSubmitEditingEvent.kt +29 -0
  113. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputAlignmentSpan.kt +14 -0
  114. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputBlockQuoteSpan.kt +14 -0
  115. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputBoldSpan.kt +14 -0
  116. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputCheckboxListSpan.kt +15 -0
  117. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputCodeBlockSpan.kt +14 -0
  118. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputH1Span.kt +14 -0
  119. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputH2Span.kt +14 -0
  120. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputH3Span.kt +14 -0
  121. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputH4Span.kt +14 -0
  122. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputH5Span.kt +14 -0
  123. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputH6Span.kt +14 -0
  124. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputImageSpan.kt +36 -0
  125. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputInlineCodeSpan.kt +14 -0
  126. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputItalicSpan.kt +14 -0
  127. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputLinkSpan.kt +16 -0
  128. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputMentionSpan.kt +18 -0
  129. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputOrderedListSpan.kt +21 -0
  130. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputStrikeThroughSpan.kt +14 -0
  131. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputUnderlineSpan.kt +14 -0
  132. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputUnorderedListSpan.kt +14 -0
  133. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedLineHeightSpan.kt +45 -0
  134. package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedSpans.kt +240 -0
  135. package/android/src/main/java/com/swmansion/enriched/textinput/spans/interfaces/EnrichedInputSpan.kt +10 -0
  136. package/android/src/main/java/com/swmansion/enriched/textinput/styles/AlignmentStyles.kt +366 -0
  137. package/android/src/main/java/com/swmansion/enriched/textinput/styles/HtmlStyle.kt +371 -0
  138. package/android/src/main/java/com/swmansion/enriched/textinput/styles/InlineStyles.kt +244 -0
  139. package/android/src/main/java/com/swmansion/enriched/textinput/styles/ListStyles.kt +261 -0
  140. package/android/src/main/java/com/swmansion/enriched/textinput/styles/ParagraphStyles.kt +440 -0
  141. package/android/src/main/java/com/swmansion/enriched/textinput/styles/ParametrizedStyles.kt +435 -0
  142. package/android/src/main/java/com/swmansion/enriched/textinput/utils/EnrichedEditableFactory.kt +17 -0
  143. package/android/src/main/java/com/swmansion/enriched/textinput/utils/EnrichedSelection.kt +342 -0
  144. package/android/src/main/java/com/swmansion/enriched/textinput/utils/EnrichedSpanState.kt +318 -0
  145. package/android/src/main/java/com/swmansion/enriched/textinput/utils/EnrichedSpannable.kt +157 -0
  146. package/android/src/main/java/com/swmansion/enriched/textinput/utils/EnrichedSpannableStringBuilder.kt +59 -0
  147. package/android/src/main/java/com/swmansion/enriched/textinput/utils/RichContentReceiver.kt +127 -0
  148. package/android/src/main/java/com/swmansion/enriched/textinput/utils/ShortcutsHandler.kt +150 -0
  149. package/android/src/main/java/com/swmansion/enriched/textinput/utils/StyleUtils.kt +51 -0
  150. package/android/src/main/java/com/swmansion/enriched/textinput/utils/Utils.kt +107 -0
  151. package/android/src/main/java/com/swmansion/enriched/textinput/watchers/EnrichedSpanWatcher.kt +109 -0
  152. package/android/src/main/java/com/swmansion/enriched/textinput/watchers/EnrichedTextWatcher.kt +106 -0
  153. package/android/src/main/new_arch/CMakeLists.txt +62 -0
  154. package/android/src/main/new_arch/GumboNormalizerJni.cpp +14 -0
  155. package/android/src/main/new_arch/ReactNativeEnrichedSpec.cpp +11 -0
  156. package/android/src/main/new_arch/ReactNativeEnrichedSpec.h +16 -0
  157. package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextComponentDescriptor.h +32 -0
  158. package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextInputComponentDescriptor.h +35 -0
  159. package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextInputMeasurementManager.cpp +53 -0
  160. package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextInputMeasurementManager.h +25 -0
  161. package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextInputShadowNode.cpp +35 -0
  162. package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextInputShadowNode.h +53 -0
  163. package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextInputState.cpp +9 -0
  164. package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextInputState.h +24 -0
  165. package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextMeasurementManager.cpp +45 -0
  166. package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextMeasurementManager.h +25 -0
  167. package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextShadowNode.cpp +21 -0
  168. package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextShadowNode.h +39 -0
  169. package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/conversions.h +44 -0
  170. package/android/src/main/res/drawable/broken_image.xml +10 -0
  171. package/cpp/CMakeLists.txt +50 -0
  172. package/cpp/GumboParser/GumboParser.h +34043 -0
  173. package/cpp/README.md +59 -0
  174. package/cpp/parser/GumboNormalizer.c +973 -0
  175. package/cpp/parser/GumboParser.cpp +16 -0
  176. package/cpp/parser/GumboParser.hpp +23 -0
  177. package/cpp/tests/GumboParserTest.cpp +511 -0
  178. package/ios/EnrichedTextInputView.h +54 -0
  179. package/ios/EnrichedTextInputView.mm +2182 -0
  180. package/ios/EnrichedTextInputViewManager.mm +13 -0
  181. package/ios/EnrichedTextView.h +35 -0
  182. package/ios/EnrichedTextView.mm +806 -0
  183. package/ios/EnrichedTextViewManager.mm +13 -0
  184. package/ios/config/EnrichedConfig.h +114 -0
  185. package/ios/config/EnrichedConfig.mm +727 -0
  186. package/ios/enrichedInputTextView/EnrichedInputTextView.h +6 -0
  187. package/ios/enrichedInputTextView/EnrichedInputTextView.mm +334 -0
  188. package/ios/enrichedTextTextView/EnrichedTextTextView.h +16 -0
  189. package/ios/enrichedTextTextView/EnrichedTextTextView.mm +71 -0
  190. package/ios/extensions/ColorExtension.h +8 -0
  191. package/ios/extensions/ColorExtension.mm +48 -0
  192. package/ios/extensions/FontExtension.h +11 -0
  193. package/ios/extensions/FontExtension.mm +72 -0
  194. package/ios/extensions/ImageExtension.h +33 -0
  195. package/ios/extensions/ImageExtension.mm +176 -0
  196. package/ios/extensions/LayoutManagerExtension.h +6 -0
  197. package/ios/extensions/LayoutManagerExtension.mm +465 -0
  198. package/ios/extensions/StringExtension.h +15 -0
  199. package/ios/extensions/StringExtension.mm +144 -0
  200. package/ios/generated/ReactNativeEnrichedSpec/ComponentDescriptors.cpp +22 -0
  201. package/ios/generated/ReactNativeEnrichedSpec/ComponentDescriptors.h +24 -0
  202. package/ios/generated/ReactNativeEnrichedSpec/EventEmitters.cpp +456 -0
  203. package/ios/generated/ReactNativeEnrichedSpec/EventEmitters.h +410 -0
  204. package/ios/generated/ReactNativeEnrichedSpec/Props.cpp +272 -0
  205. package/ios/generated/ReactNativeEnrichedSpec/Props.h +1595 -0
  206. package/ios/generated/ReactNativeEnrichedSpec/RCTComponentViewHelpers.h +570 -0
  207. package/ios/generated/ReactNativeEnrichedSpec/ShadowNodes.cpp +17 -0
  208. package/ios/generated/ReactNativeEnrichedSpec/ShadowNodes.h +23 -0
  209. package/ios/generated/ReactNativeEnrichedSpec/States.cpp +16 -0
  210. package/ios/generated/ReactNativeEnrichedSpec/States.h +20 -0
  211. package/ios/htmlParser/HtmlParser.h +14 -0
  212. package/ios/htmlParser/HtmlParser.mm +1486 -0
  213. package/ios/inputAttributesManager/InputAttributesManager.h +18 -0
  214. package/ios/inputAttributesManager/InputAttributesManager.mm +222 -0
  215. package/ios/inputHtmlParser/InputHtmlParser.h +10 -0
  216. package/ios/inputHtmlParser/InputHtmlParser.mm +228 -0
  217. package/ios/interfaces/AlignmentEntry.h +9 -0
  218. package/ios/interfaces/AlignmentEntry.mm +4 -0
  219. package/ios/interfaces/AttributeEntry.h +9 -0
  220. package/ios/interfaces/AttributeEntry.mm +4 -0
  221. package/ios/interfaces/BaseStyleProtocol.h +17 -0
  222. package/ios/interfaces/EnrichedTextStyleHeaders.h +62 -0
  223. package/ios/interfaces/EnrichedViewHost.h +26 -0
  224. package/ios/interfaces/ImageAttachment.h +11 -0
  225. package/ios/interfaces/ImageAttachment.mm +107 -0
  226. package/ios/interfaces/ImageData.h +10 -0
  227. package/ios/interfaces/ImageData.mm +4 -0
  228. package/ios/interfaces/LinkData.h +11 -0
  229. package/ios/interfaces/LinkData.mm +43 -0
  230. package/ios/interfaces/LinkRegexConfig.h +19 -0
  231. package/ios/interfaces/LinkRegexConfig.mm +37 -0
  232. package/ios/interfaces/MediaAttachment.h +23 -0
  233. package/ios/interfaces/MediaAttachment.mm +31 -0
  234. package/ios/interfaces/MentionParams.h +8 -0
  235. package/ios/interfaces/MentionParams.mm +4 -0
  236. package/ios/interfaces/MentionStyleProps.h +17 -0
  237. package/ios/interfaces/MentionStyleProps.mm +80 -0
  238. package/ios/interfaces/StyleBase.h +38 -0
  239. package/ios/interfaces/StyleBase.mm +279 -0
  240. package/ios/interfaces/StyleHeaders.h +114 -0
  241. package/ios/interfaces/StylePair.h +9 -0
  242. package/ios/interfaces/StylePair.mm +4 -0
  243. package/ios/interfaces/StyleTypeEnum.h +27 -0
  244. package/ios/interfaces/TextDecorationLineEnum.h +6 -0
  245. package/ios/interfaces/TextDecorationLineEnum.mm +4 -0
  246. package/ios/internals/EnrichedTextComponentDescriptor.h +19 -0
  247. package/ios/internals/EnrichedTextInputViewComponentDescriptor.h +19 -0
  248. package/ios/internals/EnrichedTextInputViewShadowNode.h +44 -0
  249. package/ios/internals/EnrichedTextInputViewShadowNode.mm +103 -0
  250. package/ios/internals/EnrichedTextInputViewState.cpp +10 -0
  251. package/ios/internals/EnrichedTextInputViewState.h +22 -0
  252. package/ios/internals/EnrichedTextViewShadowNode.h +34 -0
  253. package/ios/internals/EnrichedTextViewShadowNode.mm +72 -0
  254. package/ios/internals/EnrichedTextViewState.cpp +7 -0
  255. package/ios/internals/EnrichedTextViewState.h +18 -0
  256. package/ios/styles/AlignmentStyle.mm +203 -0
  257. package/ios/styles/BlockQuoteStyle.mm +54 -0
  258. package/ios/styles/BoldStyle.mm +37 -0
  259. package/ios/styles/CheckboxListStyle.mm +154 -0
  260. package/ios/styles/CodeBlockStyle.mm +49 -0
  261. package/ios/styles/EnrichedTextStyles.mm +61 -0
  262. package/ios/styles/H1Style.mm +20 -0
  263. package/ios/styles/H2Style.mm +20 -0
  264. package/ios/styles/H3Style.mm +20 -0
  265. package/ios/styles/H4Style.mm +20 -0
  266. package/ios/styles/H5Style.mm +20 -0
  267. package/ios/styles/H6Style.mm +20 -0
  268. package/ios/styles/HeadingStyleBase.mm +96 -0
  269. package/ios/styles/ImageStyle.mm +150 -0
  270. package/ios/styles/InlineCodeStyle.mm +65 -0
  271. package/ios/styles/ItalicStyle.mm +37 -0
  272. package/ios/styles/LinkStyle.mm +518 -0
  273. package/ios/styles/MentionStyle.mm +592 -0
  274. package/ios/styles/OrderedListStyle.mm +48 -0
  275. package/ios/styles/StrikethroughStyle.mm +25 -0
  276. package/ios/styles/UnderlineStyle.mm +24 -0
  277. package/ios/styles/UnorderedListStyle.mm +48 -0
  278. package/ios/textHtmlParser/TextHtmlParser.h +10 -0
  279. package/ios/textHtmlParser/TextHtmlParser.mm +182 -0
  280. package/ios/utils/AlignmentUtils.h +20 -0
  281. package/ios/utils/AlignmentUtils.mm +111 -0
  282. package/ios/utils/AttachmentLayoutUtils.h +24 -0
  283. package/ios/utils/AttachmentLayoutUtils.mm +144 -0
  284. package/ios/utils/CheckboxHitTestUtils.h +10 -0
  285. package/ios/utils/CheckboxHitTestUtils.mm +122 -0
  286. package/ios/utils/DotReplacementUtils.h +10 -0
  287. package/ios/utils/DotReplacementUtils.mm +68 -0
  288. package/ios/utils/EnrichedTextTouchHandler.h +14 -0
  289. package/ios/utils/EnrichedTextTouchHandler.mm +152 -0
  290. package/ios/utils/KeyboardUtils.h +7 -0
  291. package/ios/utils/KeyboardUtils.mm +30 -0
  292. package/ios/utils/OccurenceUtils.h +44 -0
  293. package/ios/utils/OccurenceUtils.mm +185 -0
  294. package/ios/utils/ParagraphAttributesUtils.h +18 -0
  295. package/ios/utils/ParagraphAttributesUtils.mm +296 -0
  296. package/ios/utils/RangeUtils.h +12 -0
  297. package/ios/utils/RangeUtils.mm +183 -0
  298. package/ios/utils/ShortcutsUtils.h +21 -0
  299. package/ios/utils/ShortcutsUtils.mm +486 -0
  300. package/ios/utils/StyleUtils.h +33 -0
  301. package/ios/utils/StyleUtils.mm +290 -0
  302. package/ios/utils/TextBlockTapGestureRecognizer.h +17 -0
  303. package/ios/utils/TextBlockTapGestureRecognizer.mm +56 -0
  304. package/ios/utils/TextInsertionUtils.h +17 -0
  305. package/ios/utils/TextInsertionUtils.mm +60 -0
  306. package/ios/utils/TextListsUtils.h +40 -0
  307. package/ios/utils/TextListsUtils.mm +93 -0
  308. package/ios/utils/WeakBox.h +3 -0
  309. package/ios/utils/WeakBox.m +4 -0
  310. package/ios/utils/WordsUtils.h +7 -0
  311. package/ios/utils/WordsUtils.mm +98 -0
  312. package/ios/utils/ZeroWidthSpaceUtils.h +14 -0
  313. package/ios/utils/ZeroWidthSpaceUtils.mm +310 -0
  314. package/lib/module/index.js +5 -0
  315. package/lib/module/index.js.map +1 -0
  316. package/lib/module/index.native.js +7 -0
  317. package/lib/module/index.native.js.map +1 -0
  318. package/lib/module/native/EnrichedText.js +76 -0
  319. package/lib/module/native/EnrichedText.js.map +1 -0
  320. package/lib/module/native/EnrichedTextInput.js +306 -0
  321. package/lib/module/native/EnrichedTextInput.js.map +1 -0
  322. package/lib/module/package.json +1 -0
  323. package/lib/module/spec/EnrichedTextInputNativeComponent.ts +524 -0
  324. package/lib/module/spec/EnrichedTextNativeComponent.ts +110 -0
  325. package/lib/module/types.js +4 -0
  326. package/lib/module/types.js.map +1 -0
  327. package/lib/module/utils/EnrichedTextInputDefaultProps.js +20 -0
  328. package/lib/module/utils/EnrichedTextInputDefaultProps.js.map +1 -0
  329. package/lib/module/utils/defaultHtmlStyle.js +83 -0
  330. package/lib/module/utils/defaultHtmlStyle.js.map +1 -0
  331. package/lib/module/utils/expandMentionStylesForIndicators.js +14 -0
  332. package/lib/module/utils/expandMentionStylesForIndicators.js.map +1 -0
  333. package/lib/module/utils/isMentionStyleRecord.js +10 -0
  334. package/lib/module/utils/isMentionStyleRecord.js.map +1 -0
  335. package/lib/module/utils/normalizeHtmlStyle.js +126 -0
  336. package/lib/module/utils/normalizeHtmlStyle.js.map +1 -0
  337. package/lib/module/utils/nullthrows.js +9 -0
  338. package/lib/module/utils/nullthrows.js.map +1 -0
  339. package/lib/module/utils/regexParser.js +46 -0
  340. package/lib/module/utils/regexParser.js.map +1 -0
  341. package/lib/module/web/EnrichedText.css +343 -0
  342. package/lib/module/web/EnrichedText.js +55 -0
  343. package/lib/module/web/EnrichedText.js.map +1 -0
  344. package/lib/module/web/EnrichedTextInput.js +316 -0
  345. package/lib/module/web/EnrichedTextInput.js.map +1 -0
  346. package/lib/module/web/adaptWebToNativeEvent.js +34 -0
  347. package/lib/module/web/adaptWebToNativeEvent.js.map +1 -0
  348. package/lib/module/web/constants/brokenImageGlyph.js +9 -0
  349. package/lib/module/web/constants/brokenImageGlyph.js.map +1 -0
  350. package/lib/module/web/constants/classNames.js +5 -0
  351. package/lib/module/web/constants/classNames.js.map +1 -0
  352. package/lib/module/web/emitLinkDetected.js +12 -0
  353. package/lib/module/web/emitLinkDetected.js.map +1 -0
  354. package/lib/module/web/formats/EnrichedBlockquote.js +32 -0
  355. package/lib/module/web/formats/EnrichedBlockquote.js.map +1 -0
  356. package/lib/module/web/formats/EnrichedBold.js +22 -0
  357. package/lib/module/web/formats/EnrichedBold.js.map +1 -0
  358. package/lib/module/web/formats/EnrichedCheckboxItem.js +32 -0
  359. package/lib/module/web/formats/EnrichedCheckboxItem.js.map +1 -0
  360. package/lib/module/web/formats/EnrichedCheckboxList.js +35 -0
  361. package/lib/module/web/formats/EnrichedCheckboxList.js.map +1 -0
  362. package/lib/module/web/formats/EnrichedCode.js +15 -0
  363. package/lib/module/web/formats/EnrichedCode.js.map +1 -0
  364. package/lib/module/web/formats/EnrichedCodeBlock.js +43 -0
  365. package/lib/module/web/formats/EnrichedCodeBlock.js.map +1 -0
  366. package/lib/module/web/formats/EnrichedHeading.js +27 -0
  367. package/lib/module/web/formats/EnrichedHeading.js.map +1 -0
  368. package/lib/module/web/formats/EnrichedImage.js +57 -0
  369. package/lib/module/web/formats/EnrichedImage.js.map +1 -0
  370. package/lib/module/web/formats/EnrichedImageNodeView.js +90 -0
  371. package/lib/module/web/formats/EnrichedImageNodeView.js.map +1 -0
  372. package/lib/module/web/formats/EnrichedItalic.js +22 -0
  373. package/lib/module/web/formats/EnrichedItalic.js.map +1 -0
  374. package/lib/module/web/formats/EnrichedLink.js +180 -0
  375. package/lib/module/web/formats/EnrichedLink.js.map +1 -0
  376. package/lib/module/web/formats/EnrichedListItem.js +19 -0
  377. package/lib/module/web/formats/EnrichedListItem.js.map +1 -0
  378. package/lib/module/web/formats/EnrichedMention.js +50 -0
  379. package/lib/module/web/formats/EnrichedMention.js.map +1 -0
  380. package/lib/module/web/formats/EnrichedOrderedList.js +32 -0
  381. package/lib/module/web/formats/EnrichedOrderedList.js.map +1 -0
  382. package/lib/module/web/formats/EnrichedStrike.js +22 -0
  383. package/lib/module/web/formats/EnrichedStrike.js.map +1 -0
  384. package/lib/module/web/formats/EnrichedTextAlign.js +82 -0
  385. package/lib/module/web/formats/EnrichedTextAlign.js.map +1 -0
  386. package/lib/module/web/formats/EnrichedUnderline.js +22 -0
  387. package/lib/module/web/formats/EnrichedUnderline.js.map +1 -0
  388. package/lib/module/web/formats/EnrichedUnorderedList.js +33 -0
  389. package/lib/module/web/formats/EnrichedUnorderedList.js.map +1 -0
  390. package/lib/module/web/formats/applyWrappingListToSelection.js +64 -0
  391. package/lib/module/web/formats/applyWrappingListToSelection.js.map +1 -0
  392. package/lib/module/web/formats/formatRules.js +84 -0
  393. package/lib/module/web/formats/formatRules.js.map +1 -0
  394. package/lib/module/web/formats/listKeyboard.js +53 -0
  395. package/lib/module/web/formats/listKeyboard.js.map +1 -0
  396. package/lib/module/web/formats/wrappedBlockKeyboard.js +58 -0
  397. package/lib/module/web/formats/wrappedBlockKeyboard.js.map +1 -0
  398. package/lib/module/web/normalization/checkboxHtmlNormalizer.js +54 -0
  399. package/lib/module/web/normalization/checkboxHtmlNormalizer.js.map +1 -0
  400. package/lib/module/web/normalization/htmlNormalizer.js +514 -0
  401. package/lib/module/web/normalization/htmlNormalizer.js.map +1 -0
  402. package/lib/module/web/normalization/prepareHtmlForWeb.js +78 -0
  403. package/lib/module/web/normalization/prepareHtmlForWeb.js.map +1 -0
  404. package/lib/module/web/normalization/tiptapHtmlNormalizer.js +34 -0
  405. package/lib/module/web/normalization/tiptapHtmlNormalizer.js.map +1 -0
  406. package/lib/module/web/pasteImages.js +78 -0
  407. package/lib/module/web/pasteImages.js.map +1 -0
  408. package/lib/module/web/pastedImageDimensions.js +49 -0
  409. package/lib/module/web/pastedImageDimensions.js.map +1 -0
  410. package/lib/module/web/pmPlugins/AutolinkPlugin/autolinkRegex.js +27 -0
  411. package/lib/module/web/pmPlugins/AutolinkPlugin/autolinkRegex.js.map +1 -0
  412. package/lib/module/web/pmPlugins/AutolinkPlugin/index.js +178 -0
  413. package/lib/module/web/pmPlugins/AutolinkPlugin/index.js.map +1 -0
  414. package/lib/module/web/pmPlugins/MentionPlugin/index.js +36 -0
  415. package/lib/module/web/pmPlugins/MentionPlugin/index.js.map +1 -0
  416. package/lib/module/web/pmPlugins/MentionPlugin/isCaretInBlockedContext.js +11 -0
  417. package/lib/module/web/pmPlugins/MentionPlugin/isCaretInBlockedContext.js.map +1 -0
  418. package/lib/module/web/pmPlugins/MentionPlugin/makeMentionPluginState.js +86 -0
  419. package/lib/module/web/pmPlugins/MentionPlugin/makeMentionPluginState.js.map +1 -0
  420. package/lib/module/web/pmPlugins/MentionPlugin/mentionPluginKey.js +5 -0
  421. package/lib/module/web/pmPlugins/MentionPlugin/mentionPluginKey.js.map +1 -0
  422. package/lib/module/web/pmPlugins/MentionPlugin/removeMentionMarksIfSpansResized.js +56 -0
  423. package/lib/module/web/pmPlugins/MentionPlugin/removeMentionMarksIfSpansResized.js.map +1 -0
  424. package/lib/module/web/pmPlugins/MentionPlugin/setMention.js +57 -0
  425. package/lib/module/web/pmPlugins/MentionPlugin/setMention.js.map +1 -0
  426. package/lib/module/web/pmPlugins/MentionPlugin/startMention.js +9 -0
  427. package/lib/module/web/pmPlugins/MentionPlugin/startMention.js.map +1 -0
  428. package/lib/module/web/pmPlugins/MentionPlugin/stripPartialMentionMarks.js +9 -0
  429. package/lib/module/web/pmPlugins/MentionPlugin/stripPartialMentionMarks.js.map +1 -0
  430. package/lib/module/web/pmPlugins/MentionPlugin/types.js +4 -0
  431. package/lib/module/web/pmPlugins/MentionPlugin/types.js.map +1 -0
  432. package/lib/module/web/pmPlugins/MentionPlugin/useMentionEvents.js +105 -0
  433. package/lib/module/web/pmPlugins/MentionPlugin/useMentionEvents.js.map +1 -0
  434. package/lib/module/web/pmPlugins/MergeAdjacentSameKindBlocksPlugin.js +42 -0
  435. package/lib/module/web/pmPlugins/MergeAdjacentSameKindBlocksPlugin.js.map +1 -0
  436. package/lib/module/web/pmPlugins/ShortcutPlugin.js +134 -0
  437. package/lib/module/web/pmPlugins/ShortcutPlugin.js.map +1 -0
  438. package/lib/module/web/pmPlugins/StrictMarksPlugin.js +100 -0
  439. package/lib/module/web/pmPlugins/StrictMarksPlugin.js.map +1 -0
  440. package/lib/module/web/pmPlugins/StripBoldInStyledHeadingsPlugin.js +56 -0
  441. package/lib/module/web/pmPlugins/StripBoldInStyledHeadingsPlugin.js.map +1 -0
  442. package/lib/module/web/pmPlugins/StripMarksInCodeBlockPlugin.js +28 -0
  443. package/lib/module/web/pmPlugins/StripMarksInCodeBlockPlugin.js.map +1 -0
  444. package/lib/module/web/pmPlugins/StripMarksOnImagePlugin.js +29 -0
  445. package/lib/module/web/pmPlugins/StripMarksOnImagePlugin.js.map +1 -0
  446. package/lib/module/web/positionMapping.js +76 -0
  447. package/lib/module/web/positionMapping.js.map +1 -0
  448. package/lib/module/web/returnKeyTypeToEnterKeyHint.js +20 -0
  449. package/lib/module/web/returnKeyTypeToEnterKeyHint.js.map +1 -0
  450. package/lib/module/web/sanitization/htmlSanitizer.js +10 -0
  451. package/lib/module/web/sanitization/htmlSanitizer.js.map +1 -0
  452. package/lib/module/web/styleConversion/buildMentionRulesCSS.js +39 -0
  453. package/lib/module/web/styleConversion/buildMentionRulesCSS.js.map +1 -0
  454. package/lib/module/web/styleConversion/enrichedBaseStyleToCSSProperties.js +159 -0
  455. package/lib/module/web/styleConversion/enrichedBaseStyleToCSSProperties.js.map +1 -0
  456. package/lib/module/web/styleConversion/enrichedInputStyleToCSSProperties.js +7 -0
  457. package/lib/module/web/styleConversion/enrichedInputStyleToCSSProperties.js.map +1 -0
  458. package/lib/module/web/styleConversion/enrichedTextStyleToCSSProperties.js +44 -0
  459. package/lib/module/web/styleConversion/enrichedTextStyleToCSSProperties.js.map +1 -0
  460. package/lib/module/web/styleConversion/enrichedThemingToCSSProperties.js +18 -0
  461. package/lib/module/web/styleConversion/enrichedThemingToCSSProperties.js.map +1 -0
  462. package/lib/module/web/styleConversion/htmlStyleToCSSVariables.js +168 -0
  463. package/lib/module/web/styleConversion/htmlStyleToCSSVariables.js.map +1 -0
  464. package/lib/module/web/styleConversion/inlineImageCSSVariables.js +7 -0
  465. package/lib/module/web/styleConversion/inlineImageCSSVariables.js.map +1 -0
  466. package/lib/module/web/styleConversion/mentionIndicatorCssKey.js +15 -0
  467. package/lib/module/web/styleConversion/mentionIndicatorCssKey.js.map +1 -0
  468. package/lib/module/web/styleConversion/toColor.js +18 -0
  469. package/lib/module/web/styleConversion/toColor.js.map +1 -0
  470. package/lib/module/web/useImageErrorFallback.js +33 -0
  471. package/lib/module/web/useImageErrorFallback.js.map +1 -0
  472. package/lib/module/web/useOnChangeHtml.js +8 -0
  473. package/lib/module/web/useOnChangeHtml.js.map +1 -0
  474. package/lib/module/web/useOnChangeState.js +91 -0
  475. package/lib/module/web/useOnChangeState.js.map +1 -0
  476. package/lib/module/web/useOnChangeText.js +11 -0
  477. package/lib/module/web/useOnChangeText.js.map +1 -0
  478. package/lib/module/web/useOnEditorChange.js +25 -0
  479. package/lib/module/web/useOnEditorChange.js.map +1 -0
  480. package/lib/module/web/useOnLinkDetected.js +55 -0
  481. package/lib/module/web/useOnLinkDetected.js.map +1 -0
  482. package/lib/module/web/usePressInteractions.js +19 -0
  483. package/lib/module/web/usePressInteractions.js.map +1 -0
  484. package/lib/module/web/useStableRef.js +13 -0
  485. package/lib/module/web/useStableRef.js.map +1 -0
  486. package/lib/typescript/package.json +1 -0
  487. package/lib/typescript/src/index.d.ts +4 -0
  488. package/lib/typescript/src/index.d.ts.map +1 -0
  489. package/lib/typescript/src/index.native.d.ts +5 -0
  490. package/lib/typescript/src/index.native.d.ts.map +1 -0
  491. package/lib/typescript/src/native/EnrichedText.d.ts +3 -0
  492. package/lib/typescript/src/native/EnrichedText.d.ts.map +1 -0
  493. package/lib/typescript/src/native/EnrichedTextInput.d.ts +3 -0
  494. package/lib/typescript/src/native/EnrichedTextInput.d.ts.map +1 -0
  495. package/lib/typescript/src/spec/EnrichedTextInputNativeComponent.d.ts +405 -0
  496. package/lib/typescript/src/spec/EnrichedTextInputNativeComponent.d.ts.map +1 -0
  497. package/lib/typescript/src/spec/EnrichedTextNativeComponent.d.ts +88 -0
  498. package/lib/typescript/src/spec/EnrichedTextNativeComponent.d.ts.map +1 -0
  499. package/lib/typescript/src/types.d.ts +721 -0
  500. package/lib/typescript/src/types.d.ts.map +1 -0
  501. package/lib/typescript/src/utils/EnrichedTextInputDefaultProps.d.ts +13 -0
  502. package/lib/typescript/src/utils/EnrichedTextInputDefaultProps.d.ts.map +1 -0
  503. package/lib/typescript/src/utils/defaultHtmlStyle.d.ts +4 -0
  504. package/lib/typescript/src/utils/defaultHtmlStyle.d.ts.map +1 -0
  505. package/lib/typescript/src/utils/expandMentionStylesForIndicators.d.ts +3 -0
  506. package/lib/typescript/src/utils/expandMentionStylesForIndicators.d.ts.map +1 -0
  507. package/lib/typescript/src/utils/isMentionStyleRecord.d.ts +3 -0
  508. package/lib/typescript/src/utils/isMentionStyleRecord.d.ts.map +1 -0
  509. package/lib/typescript/src/utils/normalizeHtmlStyle.d.ts +6 -0
  510. package/lib/typescript/src/utils/normalizeHtmlStyle.d.ts.map +1 -0
  511. package/lib/typescript/src/utils/nullthrows.d.ts +2 -0
  512. package/lib/typescript/src/utils/nullthrows.d.ts.map +1 -0
  513. package/lib/typescript/src/utils/regexParser.d.ts +3 -0
  514. package/lib/typescript/src/utils/regexParser.d.ts.map +1 -0
  515. package/lib/typescript/src/web/EnrichedText.d.ts +4 -0
  516. package/lib/typescript/src/web/EnrichedText.d.ts.map +1 -0
  517. package/lib/typescript/src/web/EnrichedTextInput.d.ts +4 -0
  518. package/lib/typescript/src/web/EnrichedTextInput.d.ts.map +1 -0
  519. package/lib/typescript/src/web/adaptWebToNativeEvent.d.ts +3 -0
  520. package/lib/typescript/src/web/adaptWebToNativeEvent.d.ts.map +1 -0
  521. package/lib/typescript/src/web/constants/brokenImageGlyph.d.ts +3 -0
  522. package/lib/typescript/src/web/constants/brokenImageGlyph.d.ts.map +1 -0
  523. package/lib/typescript/src/web/constants/classNames.d.ts +3 -0
  524. package/lib/typescript/src/web/constants/classNames.d.ts.map +1 -0
  525. package/lib/typescript/src/web/emitLinkDetected.d.ts +10 -0
  526. package/lib/typescript/src/web/emitLinkDetected.d.ts.map +1 -0
  527. package/lib/typescript/src/web/formats/EnrichedBlockquote.d.ts +2 -0
  528. package/lib/typescript/src/web/formats/EnrichedBlockquote.d.ts.map +1 -0
  529. package/lib/typescript/src/web/formats/EnrichedBold.d.ts +2 -0
  530. package/lib/typescript/src/web/formats/EnrichedBold.d.ts.map +1 -0
  531. package/lib/typescript/src/web/formats/EnrichedCheckboxItem.d.ts +2 -0
  532. package/lib/typescript/src/web/formats/EnrichedCheckboxItem.d.ts.map +1 -0
  533. package/lib/typescript/src/web/formats/EnrichedCheckboxList.d.ts +9 -0
  534. package/lib/typescript/src/web/formats/EnrichedCheckboxList.d.ts.map +1 -0
  535. package/lib/typescript/src/web/formats/EnrichedCode.d.ts +2 -0
  536. package/lib/typescript/src/web/formats/EnrichedCode.d.ts.map +1 -0
  537. package/lib/typescript/src/web/formats/EnrichedCodeBlock.d.ts +9 -0
  538. package/lib/typescript/src/web/formats/EnrichedCodeBlock.d.ts.map +1 -0
  539. package/lib/typescript/src/web/formats/EnrichedHeading.d.ts +5 -0
  540. package/lib/typescript/src/web/formats/EnrichedHeading.d.ts.map +1 -0
  541. package/lib/typescript/src/web/formats/EnrichedImage.d.ts +2 -0
  542. package/lib/typescript/src/web/formats/EnrichedImage.d.ts.map +1 -0
  543. package/lib/typescript/src/web/formats/EnrichedImageNodeView.d.ts +3 -0
  544. package/lib/typescript/src/web/formats/EnrichedImageNodeView.d.ts.map +1 -0
  545. package/lib/typescript/src/web/formats/EnrichedItalic.d.ts +2 -0
  546. package/lib/typescript/src/web/formats/EnrichedItalic.d.ts.map +1 -0
  547. package/lib/typescript/src/web/formats/EnrichedLink.d.ts +8 -0
  548. package/lib/typescript/src/web/formats/EnrichedLink.d.ts.map +1 -0
  549. package/lib/typescript/src/web/formats/EnrichedListItem.d.ts +2 -0
  550. package/lib/typescript/src/web/formats/EnrichedListItem.d.ts.map +1 -0
  551. package/lib/typescript/src/web/formats/EnrichedMention.d.ts +4 -0
  552. package/lib/typescript/src/web/formats/EnrichedMention.d.ts.map +1 -0
  553. package/lib/typescript/src/web/formats/EnrichedOrderedList.d.ts +2 -0
  554. package/lib/typescript/src/web/formats/EnrichedOrderedList.d.ts.map +1 -0
  555. package/lib/typescript/src/web/formats/EnrichedStrike.d.ts +2 -0
  556. package/lib/typescript/src/web/formats/EnrichedStrike.d.ts.map +1 -0
  557. package/lib/typescript/src/web/formats/EnrichedTextAlign.d.ts +2 -0
  558. package/lib/typescript/src/web/formats/EnrichedTextAlign.d.ts.map +1 -0
  559. package/lib/typescript/src/web/formats/EnrichedUnderline.d.ts +2 -0
  560. package/lib/typescript/src/web/formats/EnrichedUnderline.d.ts.map +1 -0
  561. package/lib/typescript/src/web/formats/EnrichedUnorderedList.d.ts +9 -0
  562. package/lib/typescript/src/web/formats/EnrichedUnorderedList.d.ts.map +1 -0
  563. package/lib/typescript/src/web/formats/applyWrappingListToSelection.d.ts +18 -0
  564. package/lib/typescript/src/web/formats/applyWrappingListToSelection.d.ts.map +1 -0
  565. package/lib/typescript/src/web/formats/formatRules.d.ts +12 -0
  566. package/lib/typescript/src/web/formats/formatRules.d.ts.map +1 -0
  567. package/lib/typescript/src/web/formats/listKeyboard.d.ts +4 -0
  568. package/lib/typescript/src/web/formats/listKeyboard.d.ts.map +1 -0
  569. package/lib/typescript/src/web/formats/wrappedBlockKeyboard.d.ts +12 -0
  570. package/lib/typescript/src/web/formats/wrappedBlockKeyboard.d.ts.map +1 -0
  571. package/lib/typescript/src/web/normalization/checkboxHtmlNormalizer.d.ts +3 -0
  572. package/lib/typescript/src/web/normalization/checkboxHtmlNormalizer.d.ts.map +1 -0
  573. package/lib/typescript/src/web/normalization/htmlNormalizer.d.ts +2 -0
  574. package/lib/typescript/src/web/normalization/htmlNormalizer.d.ts.map +1 -0
  575. package/lib/typescript/src/web/normalization/prepareHtmlForWeb.d.ts +2 -0
  576. package/lib/typescript/src/web/normalization/prepareHtmlForWeb.d.ts.map +1 -0
  577. package/lib/typescript/src/web/normalization/tiptapHtmlNormalizer.d.ts +3 -0
  578. package/lib/typescript/src/web/normalization/tiptapHtmlNormalizer.d.ts.map +1 -0
  579. package/lib/typescript/src/web/pasteImages.d.ts +10 -0
  580. package/lib/typescript/src/web/pasteImages.d.ts.map +1 -0
  581. package/lib/typescript/src/web/pastedImageDimensions.d.ts +9 -0
  582. package/lib/typescript/src/web/pastedImageDimensions.d.ts.map +1 -0
  583. package/lib/typescript/src/web/pmPlugins/AutolinkPlugin/autolinkRegex.d.ts +7 -0
  584. package/lib/typescript/src/web/pmPlugins/AutolinkPlugin/autolinkRegex.d.ts.map +1 -0
  585. package/lib/typescript/src/web/pmPlugins/AutolinkPlugin/index.d.ts +8 -0
  586. package/lib/typescript/src/web/pmPlugins/AutolinkPlugin/index.d.ts.map +1 -0
  587. package/lib/typescript/src/web/pmPlugins/MentionPlugin/index.d.ts +9 -0
  588. package/lib/typescript/src/web/pmPlugins/MentionPlugin/index.d.ts.map +1 -0
  589. package/lib/typescript/src/web/pmPlugins/MentionPlugin/isCaretInBlockedContext.d.ts +3 -0
  590. package/lib/typescript/src/web/pmPlugins/MentionPlugin/isCaretInBlockedContext.d.ts.map +1 -0
  591. package/lib/typescript/src/web/pmPlugins/MentionPlugin/makeMentionPluginState.d.ts +4 -0
  592. package/lib/typescript/src/web/pmPlugins/MentionPlugin/makeMentionPluginState.d.ts.map +1 -0
  593. package/lib/typescript/src/web/pmPlugins/MentionPlugin/mentionPluginKey.d.ts +4 -0
  594. package/lib/typescript/src/web/pmPlugins/MentionPlugin/mentionPluginKey.d.ts.map +1 -0
  595. package/lib/typescript/src/web/pmPlugins/MentionPlugin/removeMentionMarksIfSpansResized.d.ts +9 -0
  596. package/lib/typescript/src/web/pmPlugins/MentionPlugin/removeMentionMarksIfSpansResized.d.ts.map +1 -0
  597. package/lib/typescript/src/web/pmPlugins/MentionPlugin/setMention.d.ts +3 -0
  598. package/lib/typescript/src/web/pmPlugins/MentionPlugin/setMention.d.ts.map +1 -0
  599. package/lib/typescript/src/web/pmPlugins/MentionPlugin/startMention.d.ts +3 -0
  600. package/lib/typescript/src/web/pmPlugins/MentionPlugin/startMention.d.ts.map +1 -0
  601. package/lib/typescript/src/web/pmPlugins/MentionPlugin/stripPartialMentionMarks.d.ts +3 -0
  602. package/lib/typescript/src/web/pmPlugins/MentionPlugin/stripPartialMentionMarks.d.ts.map +1 -0
  603. package/lib/typescript/src/web/pmPlugins/MentionPlugin/types.d.ts +20 -0
  604. package/lib/typescript/src/web/pmPlugins/MentionPlugin/types.d.ts.map +1 -0
  605. package/lib/typescript/src/web/pmPlugins/MentionPlugin/useMentionEvents.d.ts +4 -0
  606. package/lib/typescript/src/web/pmPlugins/MentionPlugin/useMentionEvents.d.ts.map +1 -0
  607. package/lib/typescript/src/web/pmPlugins/MergeAdjacentSameKindBlocksPlugin.d.ts +3 -0
  608. package/lib/typescript/src/web/pmPlugins/MergeAdjacentSameKindBlocksPlugin.d.ts.map +1 -0
  609. package/lib/typescript/src/web/pmPlugins/ShortcutPlugin.d.ts +7 -0
  610. package/lib/typescript/src/web/pmPlugins/ShortcutPlugin.d.ts.map +1 -0
  611. package/lib/typescript/src/web/pmPlugins/StrictMarksPlugin.d.ts +3 -0
  612. package/lib/typescript/src/web/pmPlugins/StrictMarksPlugin.d.ts.map +1 -0
  613. package/lib/typescript/src/web/pmPlugins/StripBoldInStyledHeadingsPlugin.d.ts +15 -0
  614. package/lib/typescript/src/web/pmPlugins/StripBoldInStyledHeadingsPlugin.d.ts.map +1 -0
  615. package/lib/typescript/src/web/pmPlugins/StripMarksInCodeBlockPlugin.d.ts +3 -0
  616. package/lib/typescript/src/web/pmPlugins/StripMarksInCodeBlockPlugin.d.ts.map +1 -0
  617. package/lib/typescript/src/web/pmPlugins/StripMarksOnImagePlugin.d.ts +3 -0
  618. package/lib/typescript/src/web/pmPlugins/StripMarksOnImagePlugin.d.ts.map +1 -0
  619. package/lib/typescript/src/web/positionMapping.d.ts +39 -0
  620. package/lib/typescript/src/web/positionMapping.d.ts.map +1 -0
  621. package/lib/typescript/src/web/returnKeyTypeToEnterKeyHint.d.ts +4 -0
  622. package/lib/typescript/src/web/returnKeyTypeToEnterKeyHint.d.ts.map +1 -0
  623. package/lib/typescript/src/web/sanitization/htmlSanitizer.d.ts +2 -0
  624. package/lib/typescript/src/web/sanitization/htmlSanitizer.d.ts.map +1 -0
  625. package/lib/typescript/src/web/styleConversion/buildMentionRulesCSS.d.ts +3 -0
  626. package/lib/typescript/src/web/styleConversion/buildMentionRulesCSS.d.ts.map +1 -0
  627. package/lib/typescript/src/web/styleConversion/enrichedBaseStyleToCSSProperties.d.ts +8 -0
  628. package/lib/typescript/src/web/styleConversion/enrichedBaseStyleToCSSProperties.d.ts.map +1 -0
  629. package/lib/typescript/src/web/styleConversion/enrichedInputStyleToCSSProperties.d.ts +5 -0
  630. package/lib/typescript/src/web/styleConversion/enrichedInputStyleToCSSProperties.d.ts.map +1 -0
  631. package/lib/typescript/src/web/styleConversion/enrichedTextStyleToCSSProperties.d.ts +4 -0
  632. package/lib/typescript/src/web/styleConversion/enrichedTextStyleToCSSProperties.d.ts.map +1 -0
  633. package/lib/typescript/src/web/styleConversion/enrichedThemingToCSSProperties.d.ts +9 -0
  634. package/lib/typescript/src/web/styleConversion/enrichedThemingToCSSProperties.d.ts.map +1 -0
  635. package/lib/typescript/src/web/styleConversion/htmlStyleToCSSVariables.d.ts +11 -0
  636. package/lib/typescript/src/web/styleConversion/htmlStyleToCSSVariables.d.ts.map +1 -0
  637. package/lib/typescript/src/web/styleConversion/inlineImageCSSVariables.d.ts +3 -0
  638. package/lib/typescript/src/web/styleConversion/inlineImageCSSVariables.d.ts.map +1 -0
  639. package/lib/typescript/src/web/styleConversion/mentionIndicatorCssKey.d.ts +3 -0
  640. package/lib/typescript/src/web/styleConversion/mentionIndicatorCssKey.d.ts.map +1 -0
  641. package/lib/typescript/src/web/styleConversion/toColor.d.ts +3 -0
  642. package/lib/typescript/src/web/styleConversion/toColor.d.ts.map +1 -0
  643. package/lib/typescript/src/web/useImageErrorFallback.d.ts +3 -0
  644. package/lib/typescript/src/web/useImageErrorFallback.d.ts.map +1 -0
  645. package/lib/typescript/src/web/useOnChangeHtml.d.ts +5 -0
  646. package/lib/typescript/src/web/useOnChangeHtml.d.ts.map +1 -0
  647. package/lib/typescript/src/web/useOnChangeState.d.ts +6 -0
  648. package/lib/typescript/src/web/useOnChangeState.d.ts.map +1 -0
  649. package/lib/typescript/src/web/useOnChangeText.d.ts +5 -0
  650. package/lib/typescript/src/web/useOnChangeText.d.ts.map +1 -0
  651. package/lib/typescript/src/web/useOnEditorChange.d.ts +6 -0
  652. package/lib/typescript/src/web/useOnEditorChange.d.ts.map +1 -0
  653. package/lib/typescript/src/web/useOnLinkDetected.d.ts +4 -0
  654. package/lib/typescript/src/web/useOnLinkDetected.d.ts.map +1 -0
  655. package/lib/typescript/src/web/usePressInteractions.d.ts +2 -0
  656. package/lib/typescript/src/web/usePressInteractions.d.ts.map +1 -0
  657. package/lib/typescript/src/web/useStableRef.d.ts +3 -0
  658. package/lib/typescript/src/web/useStableRef.d.ts.map +1 -0
  659. package/package.json +258 -1
  660. package/react-native.config.js +16 -0
  661. package/src/index.native.tsx +34 -0
  662. package/src/index.tsx +25 -0
  663. package/src/native/EnrichedText.tsx +115 -0
  664. package/src/native/EnrichedTextInput.tsx +374 -0
  665. package/src/spec/EnrichedTextInputNativeComponent.ts +524 -0
  666. package/src/spec/EnrichedTextNativeComponent.ts +110 -0
  667. package/src/types.ts +866 -0
  668. package/src/utils/EnrichedTextInputDefaultProps.ts +16 -0
  669. package/src/utils/defaultHtmlStyle.ts +83 -0
  670. package/src/utils/expandMentionStylesForIndicators.ts +19 -0
  671. package/src/utils/isMentionStyleRecord.ts +22 -0
  672. package/src/utils/normalizeHtmlStyle.ts +182 -0
  673. package/src/utils/nullthrows.ts +7 -0
  674. package/src/utils/regexParser.ts +56 -0
  675. package/src/web/EnrichedText.css +343 -0
  676. package/src/web/EnrichedText.tsx +82 -0
  677. package/src/web/EnrichedTextInput.tsx +417 -0
  678. package/src/web/adaptWebToNativeEvent.ts +37 -0
  679. package/src/web/constants/brokenImageGlyph.ts +7 -0
  680. package/src/web/constants/classNames.ts +2 -0
  681. package/src/web/emitLinkDetected.ts +29 -0
  682. package/src/web/formats/EnrichedBlockquote.ts +37 -0
  683. package/src/web/formats/EnrichedBold.ts +16 -0
  684. package/src/web/formats/EnrichedCheckboxItem.ts +35 -0
  685. package/src/web/formats/EnrichedCheckboxList.ts +50 -0
  686. package/src/web/formats/EnrichedCode.ts +13 -0
  687. package/src/web/formats/EnrichedCodeBlock.ts +54 -0
  688. package/src/web/formats/EnrichedHeading.ts +37 -0
  689. package/src/web/formats/EnrichedImage.ts +59 -0
  690. package/src/web/formats/EnrichedImageNodeView.tsx +87 -0
  691. package/src/web/formats/EnrichedItalic.ts +16 -0
  692. package/src/web/formats/EnrichedLink.ts +204 -0
  693. package/src/web/formats/EnrichedListItem.ts +17 -0
  694. package/src/web/formats/EnrichedMention.ts +55 -0
  695. package/src/web/formats/EnrichedOrderedList.ts +43 -0
  696. package/src/web/formats/EnrichedStrike.ts +16 -0
  697. package/src/web/formats/EnrichedTextAlign.ts +88 -0
  698. package/src/web/formats/EnrichedUnderline.ts +16 -0
  699. package/src/web/formats/EnrichedUnorderedList.ts +53 -0
  700. package/src/web/formats/applyWrappingListToSelection.ts +76 -0
  701. package/src/web/formats/formatRules.ts +128 -0
  702. package/src/web/formats/listKeyboard.ts +63 -0
  703. package/src/web/formats/wrappedBlockKeyboard.ts +76 -0
  704. package/src/web/normalization/checkboxHtmlNormalizer.ts +62 -0
  705. package/src/web/normalization/htmlNormalizer.ts +656 -0
  706. package/src/web/normalization/prepareHtmlForWeb.ts +93 -0
  707. package/src/web/normalization/tiptapHtmlNormalizer.ts +43 -0
  708. package/src/web/pasteImages.ts +96 -0
  709. package/src/web/pastedImageDimensions.ts +40 -0
  710. package/src/web/pmPlugins/AutolinkPlugin/autolinkRegex.ts +43 -0
  711. package/src/web/pmPlugins/AutolinkPlugin/index.ts +274 -0
  712. package/src/web/pmPlugins/MentionPlugin/index.ts +45 -0
  713. package/src/web/pmPlugins/MentionPlugin/isCaretInBlockedContext.ts +17 -0
  714. package/src/web/pmPlugins/MentionPlugin/makeMentionPluginState.ts +102 -0
  715. package/src/web/pmPlugins/MentionPlugin/mentionPluginKey.ts +4 -0
  716. package/src/web/pmPlugins/MentionPlugin/removeMentionMarksIfSpansResized.ts +68 -0
  717. package/src/web/pmPlugins/MentionPlugin/setMention.ts +73 -0
  718. package/src/web/pmPlugins/MentionPlugin/startMention.ts +14 -0
  719. package/src/web/pmPlugins/MentionPlugin/stripPartialMentionMarks.ts +20 -0
  720. package/src/web/pmPlugins/MentionPlugin/types.ts +22 -0
  721. package/src/web/pmPlugins/MentionPlugin/useMentionEvents.ts +114 -0
  722. package/src/web/pmPlugins/MergeAdjacentSameKindBlocksPlugin.ts +57 -0
  723. package/src/web/pmPlugins/ShortcutPlugin.ts +105 -0
  724. package/src/web/pmPlugins/StrictMarksPlugin.ts +134 -0
  725. package/src/web/pmPlugins/StripBoldInStyledHeadingsPlugin.ts +84 -0
  726. package/src/web/pmPlugins/StripMarksInCodeBlockPlugin.ts +34 -0
  727. package/src/web/pmPlugins/StripMarksOnImagePlugin.ts +33 -0
  728. package/src/web/positionMapping.ts +81 -0
  729. package/src/web/returnKeyTypeToEnterKeyHint.ts +29 -0
  730. package/src/web/sanitization/htmlSanitizer.ts +8 -0
  731. package/src/web/styleConversion/buildMentionRulesCSS.ts +61 -0
  732. package/src/web/styleConversion/enrichedBaseStyleToCSSProperties.ts +228 -0
  733. package/src/web/styleConversion/enrichedInputStyleToCSSProperties.ts +13 -0
  734. package/src/web/styleConversion/enrichedTextStyleToCSSProperties.ts +53 -0
  735. package/src/web/styleConversion/enrichedThemingToCSSProperties.ts +34 -0
  736. package/src/web/styleConversion/htmlStyleToCSSVariables.ts +277 -0
  737. package/src/web/styleConversion/inlineImageCSSVariables.ts +6 -0
  738. package/src/web/styleConversion/mentionIndicatorCssKey.ts +14 -0
  739. package/src/web/styleConversion/toColor.ts +17 -0
  740. package/src/web/useImageErrorFallback.ts +37 -0
  741. package/src/web/useOnChangeHtml.ts +14 -0
  742. package/src/web/useOnChangeState.ts +127 -0
  743. package/src/web/useOnChangeText.ts +15 -0
  744. package/src/web/useOnEditorChange.ts +33 -0
  745. package/src/web/useOnLinkDetected.ts +70 -0
  746. package/src/web/usePressInteractions.tsx +22 -0
  747. package/src/web/useStableRef.ts +12 -0
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ import { Extension } from '@tiptap/core';
4
+ import { Plugin, PluginKey } from '@tiptap/pm/state';
5
+ export const StripMarksOnImagePlugin = Extension.create({
6
+ name: 'stripMarksOnImage',
7
+ addProseMirrorPlugins() {
8
+ return [new Plugin({
9
+ key: new PluginKey('stripMarksOnImage'),
10
+ appendTransaction: (transactions, _oldState, newState) => {
11
+ if (!transactions.some(tr => tr.docChanged)) {
12
+ return null;
13
+ }
14
+ const tr = newState.tr;
15
+ let modified = false;
16
+ newState.doc.descendants((node, pos) => {
17
+ if (node.type.name === 'image' && node.marks.length > 0) {
18
+ node.marks.forEach(mark => {
19
+ tr.removeMark(pos, pos + node.nodeSize, mark);
20
+ });
21
+ modified = true;
22
+ }
23
+ });
24
+ return modified ? tr : null;
25
+ }
26
+ })];
27
+ }
28
+ });
29
+ //# sourceMappingURL=StripMarksOnImagePlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Extension","Plugin","PluginKey","StripMarksOnImagePlugin","create","name","addProseMirrorPlugins","key","appendTransaction","transactions","_oldState","newState","some","tr","docChanged","modified","doc","descendants","node","pos","type","marks","length","forEach","mark","removeMark","nodeSize"],"sourceRoot":"../../../../src","sources":["web/pmPlugins/StripMarksOnImagePlugin.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,cAAc;AACxC,SAASC,MAAM,EAAEC,SAAS,QAAQ,kBAAkB;AAEpD,OAAO,MAAMC,uBAAuB,GAAGH,SAAS,CAACI,MAAM,CAAC;EACtDC,IAAI,EAAE,mBAAmB;EAEzBC,qBAAqBA,CAAA,EAAG;IACtB,OAAO,CACL,IAAIL,MAAM,CAAC;MACTM,GAAG,EAAE,IAAIL,SAAS,CAAC,mBAAmB,CAAC;MACvCM,iBAAiB,EAAEA,CAACC,YAAY,EAAEC,SAAS,EAAEC,QAAQ,KAAK;QACxD,IAAI,CAACF,YAAY,CAACG,IAAI,CAAEC,EAAE,IAAKA,EAAE,CAACC,UAAU,CAAC,EAAE;UAC7C,OAAO,IAAI;QACb;QAEA,MAAMD,EAAE,GAAGF,QAAQ,CAACE,EAAE;QACtB,IAAIE,QAAQ,GAAG,KAAK;QAEpBJ,QAAQ,CAACK,GAAG,CAACC,WAAW,CAAC,CAACC,IAAI,EAAEC,GAAG,KAAK;UACtC,IAAID,IAAI,CAACE,IAAI,CAACf,IAAI,KAAK,OAAO,IAAIa,IAAI,CAACG,KAAK,CAACC,MAAM,GAAG,CAAC,EAAE;YACvDJ,IAAI,CAACG,KAAK,CAACE,OAAO,CAAEC,IAAI,IAAK;cAC3BX,EAAE,CAACY,UAAU,CAACN,GAAG,EAAEA,GAAG,GAAGD,IAAI,CAACQ,QAAQ,EAAEF,IAAI,CAAC;YAC/C,CAAC,CAAC;YACFT,QAAQ,GAAG,IAAI;UACjB;QACF,CAAC,CAAC;QAEF,OAAOA,QAAQ,GAAGF,EAAE,GAAG,IAAI;MAC7B;IACF,CAAC,CAAC,CACH;EACH;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Position model mismatch: ProseMirror vs native (iOS/Android)
5
+ *
6
+ * Native selection/cursor offsets are plain string indices in rendered text
7
+ * Block boundaries are represented by a single '\n'.
8
+ *
9
+ * ProseMirror positions are tree positions. Entering/leaving block nodes
10
+ * consumes extra positions that do not map to extra native characters.
11
+ * Crossing one paragraph boundary is 1 native char ('\n') but usually 2 PM
12
+ * positions (close paragraph + open next paragraph).
13
+ *
14
+ * Example for three paragraphs "AAAA", "BBBB", "CCCC":
15
+ *
16
+ * PM: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
17
+ * Native: 0 1 2 3 4 4 5 6 7 8 9 9 10 11 12 13 14
18
+ *
19
+ * PM 5 and PM 6 both map to native 4, PM 11 and PM 12 both map to native 9.
20
+ *
21
+ * Inline images occupy one index in the native plain string as a '\ufffc' character,
22
+ * we do the same for the web implementation.
23
+ */
24
+
25
+ /**
26
+ * Plain text in the native coordinate model for [from, to), including '\ufffc' per inline image.
27
+ */
28
+ export function nativeLeafText(doc, from, to) {
29
+ return doc.textBetween(from, to, '\n', () => '\ufffc');
30
+ }
31
+ function nativeTextLength(doc, from, to) {
32
+ return nativeLeafText(doc, from, to).length;
33
+ }
34
+
35
+ /**
36
+ * Returns the native position for a given TipTap document position.
37
+ */
38
+ export function tiptapPosToNativePos(doc, tiptapPos) {
39
+ if (tiptapPos <= 1) return 0;
40
+ return nativeTextLength(doc, 0, tiptapPos);
41
+ }
42
+
43
+ /**
44
+ * Returns the TipTap document position for a given native position.
45
+ *
46
+ * Traverses only text-bearing block nodes (paragraphs, headings, etc.),
47
+ * skipping wrapper nodes like block quotes and lists. This ensures the result
48
+ * is always a valid cursor position drilled down to the innermost content node.
49
+ */
50
+ export function nativePosToTiptapPos(doc, nativePos) {
51
+ let currentNativePos = 0;
52
+ let targetTiptapPos = -1;
53
+ let lastValidTiptapPos = -1;
54
+ doc.descendants((node, pos) => {
55
+ if (targetTiptapPos !== -1) return false;
56
+
57
+ // Only consider text-bearing leaf blocks (paragraphs, headings, code blocks).
58
+ // Wrapper nodes (lists, list items, block quotes) are skipped
59
+ if (node.isTextblock) {
60
+ const textLen = node.textContent.length;
61
+ if (currentNativePos + textLen >= nativePos) {
62
+ // pos is before the opening tag; pos+1 is the first position inside.
63
+ const offset = Math.max(0, nativePos - currentNativePos);
64
+ targetTiptapPos = pos + 1 + offset;
65
+ return false;
66
+ }
67
+ currentNativePos += textLen + 1; // +1 for the '\n' block separator
68
+ lastValidTiptapPos = pos + 1 + textLen;
69
+ }
70
+ return true;
71
+ });
72
+ if (targetTiptapPos !== -1) return targetTiptapPos;
73
+ if (lastValidTiptapPos !== -1) return lastValidTiptapPos;
74
+ return 1;
75
+ }
76
+ //# sourceMappingURL=positionMapping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["nativeLeafText","doc","from","to","textBetween","nativeTextLength","length","tiptapPosToNativePos","tiptapPos","nativePosToTiptapPos","nativePos","currentNativePos","targetTiptapPos","lastValidTiptapPos","descendants","node","pos","isTextblock","textLen","textContent","offset","Math","max"],"sourceRoot":"../../../src","sources":["web/positionMapping.ts"],"mappings":";;AAEA;AACA;AACA;AAC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,GAAG,CAAC,GAAGI,MAAM;QAClC,OAAO,KAAK;MACd;MAEAT,gBAAgB,IAAIO,OAAO,GAAG,CAAC,CAAC,CAAC;MACjCL,kBAAkB,GAAGG,GAAG,GAAG,CAAC,GAAGE,OAAO;IACxC;IAEA,OAAO,IAAI;EACb,CAAC,CAAC;EAEF,IAAIN,eAAe,KAAK,CAAC,CAAC,EAAE,OAAOA,eAAe;EAClD,IAAIC,kBAAkB,KAAK,CAAC,CAAC,EAAE,OAAOA,kBAAkB;EACxD,OAAO,CAAC;AACV","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ // Keywords for the HTML global [`enterkeyhint`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/enterkeyhint) attribute
4
+
5
+ // Maps React Native `returnKeyType` to the HTML global `enterkeyhint` attribute
6
+ // if possible, otherwise falls back to enter.
7
+ export function returnKeyTypeToEnterKeyHint(returnKeyType) {
8
+ switch (returnKeyType) {
9
+ case 'done':
10
+ case 'go':
11
+ case 'next':
12
+ case 'previous':
13
+ case 'search':
14
+ case 'send':
15
+ return returnKeyType;
16
+ default:
17
+ return 'enter';
18
+ }
19
+ }
20
+ //# sourceMappingURL=returnKeyTypeToEnterKeyHint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["returnKeyTypeToEnterKeyHint","returnKeyType"],"sourceRoot":"../../../src","sources":["web/returnKeyTypeToEnterKeyHint.ts"],"mappings":";;AAEA;;AAUA;AACA;AACA,OAAO,SAASA,2BAA2BA,CACzCC,aAA+C,EACjC;EACd,QAAQA,aAAa;IACnB,KAAK,MAAM;IACX,KAAK,IAAI;IACT,KAAK,MAAM;IACX,KAAK,UAAU;IACf,KAAK,QAAQ;IACb,KAAK,MAAM;MACT,OAAOA,aAAa;IACtB;MACE,OAAO,OAAO;EAClB;AACF","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ import DOMPurify from 'dompurify';
4
+ export function sanitizeHtml(html) {
5
+ return DOMPurify.sanitize(html, {
6
+ ADD_TAGS: ['mention', 'codeblock'],
7
+ ADD_ATTR: ['text', 'indicator']
8
+ });
9
+ }
10
+ //# sourceMappingURL=htmlSanitizer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DOMPurify","sanitizeHtml","html","sanitize","ADD_TAGS","ADD_ATTR"],"sourceRoot":"../../../../src","sources":["web/sanitization/htmlSanitizer.ts"],"mappings":";;AAAA,OAAOA,SAAS,MAAM,WAAW;AAEjC,OAAO,SAASC,YAAYA,CAACC,IAAY,EAAE;EACzC,OAAOF,SAAS,CAACG,QAAQ,CAACD,IAAI,EAAE;IAC9BE,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;IAClCC,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW;EAChC,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ import { isMentionStyleRecord } from "../../utils/isMentionStyleRecord.js";
4
+ import { ENRICHED_TEXT_CLASSNAME, ENRICHED_TEXT_INPUT_CLASSNAME } from "../constants/classNames.js";
5
+ import { ET_MENTION_CSS_VARS } from "./htmlStyleToCSSVariables.js";
6
+ import { MENTION_STYLE_DEFAULT_KEY } from "./mentionIndicatorCssKey.js";
7
+ function escapeIndicatorForCssAttributeSelector(indicator) {
8
+ if (typeof CSS !== 'undefined' && typeof CSS.escape === 'function') {
9
+ return CSS.escape(indicator);
10
+ }
11
+ return indicator.replace(/["\\]/g, '\\$&');
12
+ }
13
+ function mentionSelector(className, indicator) {
14
+ return indicator === MENTION_STYLE_DEFAULT_KEY ? `.${className} mention` : `.${className} mention[indicator="${escapeIndicatorForCssAttributeSelector(indicator)}"]`;
15
+ }
16
+ export function buildMentionRulesCSS(htmlStyle) {
17
+ const mapRaw = htmlStyle?.mention;
18
+ if (!mapRaw || typeof mapRaw !== 'object' || !isMentionStyleRecord(mapRaw)) {
19
+ return '';
20
+ }
21
+ const map = mapRaw;
22
+ const keys = Object.keys(map);
23
+ if (keys.length === 0) {
24
+ return '';
25
+ }
26
+ const lines = [];
27
+ for (const indicator of keys) {
28
+ const inputSelector = mentionSelector(ENRICHED_TEXT_INPUT_CLASSNAME, indicator);
29
+ const textSelector = mentionSelector(ENRICHED_TEXT_CLASSNAME, indicator);
30
+ lines.push(`${inputSelector},
31
+ ${textSelector} {
32
+ color: var(${ET_MENTION_CSS_VARS.color(indicator)});
33
+ background-color: var(${ET_MENTION_CSS_VARS.backgroundColor(indicator)});
34
+ text-decoration-line: var(${ET_MENTION_CSS_VARS.textDecorationLine(indicator)});
35
+ }`.trim());
36
+ }
37
+ return lines.join('\n');
38
+ }
39
+ //# sourceMappingURL=buildMentionRulesCSS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isMentionStyleRecord","ENRICHED_TEXT_CLASSNAME","ENRICHED_TEXT_INPUT_CLASSNAME","ET_MENTION_CSS_VARS","MENTION_STYLE_DEFAULT_KEY","escapeIndicatorForCssAttributeSelector","indicator","CSS","escape","replace","mentionSelector","className","buildMentionRulesCSS","htmlStyle","mapRaw","mention","map","keys","Object","length","lines","inputSelector","textSelector","push","color","backgroundColor","textDecorationLine","trim","join"],"sourceRoot":"../../../../src","sources":["web/styleConversion/buildMentionRulesCSS.ts"],"mappings":";;AAKA,SAASA,oBAAoB,QAAQ,qCAAkC;AACvE,SACEC,uBAAuB,EACvBC,6BAA6B,QACxB,4BAAyB;AAChC,SAASC,mBAAmB,QAAQ,8BAA2B;AAC/D,SAASC,yBAAyB,QAAQ,6BAA0B;AAEpE,SAASC,sCAAsCA,CAACC,SAAiB,EAAU;EACzE,IAAI,OAAOC,GAAG,KAAK,WAAW,IAAI,OAAOA,GAAG,CAACC,MAAM,KAAK,UAAU,EAAE;IAClE,OAAOD,GAAG,CAACC,MAAM,CAACF,SAAS,CAAC;EAC9B;EACA,OAAOA,SAAS,CAACG,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC;AAC5C;AAEA,SAASC,eAAeA,CAACC,SAAiB,EAAEL,SAAiB,EAAU;EACrE,OAAOA,SAAS,KAAKF,yBAAyB,GAC1C,IAAIO,SAAS,UAAU,GACvB,IAAIA,SAAS,uBAAuBN,sCAAsC,CAACC,SAAS,CAAC,IAAI;AAC/F;AAEA,OAAO,SAASM,oBAAoBA,CAClCC,SAA6C,EACrC;EACR,MAAMC,MAAM,GAAGD,SAAS,EAAEE,OAAO;EACjC,IAAI,CAACD,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAI,CAACd,oBAAoB,CAACc,MAAM,CAAC,EAAE;IAC1E,OAAO,EAAE;EACX;EAEA,MAAME,GAA2C,GAAGF,MAAM;EAC1D,MAAMG,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACD,GAAG,CAAC;EAC7B,IAAIC,IAAI,CAACE,MAAM,KAAK,CAAC,EAAE;IACrB,OAAO,EAAE;EACX;EAEA,MAAMC,KAAe,GAAG,EAAE;EAE1B,KAAK,MAAMd,SAAS,IAAIW,IAAI,EAAE;IAC5B,MAAMI,aAAa,GAAGX,eAAe,CACnCR,6BAA6B,EAC7BI,SACF,CAAC;IACD,MAAMgB,YAAY,GAAGZ,eAAe,CAACT,uBAAuB,EAAEK,SAAS,CAAC;IAExEc,KAAK,CAACG,IAAI,CACR,GAAGF,aAAa;AACtB,EAAEC,YAAY;AACd,eAAenB,mBAAmB,CAACqB,KAAK,CAAClB,SAAS,CAAC;AACnD,0BAA0BH,mBAAmB,CAACsB,eAAe,CAACnB,SAAS,CAAC;AACxE,8BAA8BH,mBAAmB,CAACuB,kBAAkB,CAACpB,SAAS,CAAC;AAC/E,EAAE,CAACqB,IAAI,CAAC,CACJ,CAAC;EACH;EAEA,OAAOP,KAAK,CAACQ,IAAI,CAAC,IAAI,CAAC;AACzB","ignoreList":[]}
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+
3
+ import { toColor } from "./toColor.js";
4
+ export function enrichedBaseStyleToCSSProperties(style, extraOptions = {}) {
5
+ const css = {
6
+ // Dimensions
7
+ width: toPx(style.width),
8
+ height: toPx(style.height),
9
+ minWidth: toPx(style.minWidth),
10
+ maxWidth: toPx(style.maxWidth),
11
+ minHeight: toPx(style.minHeight),
12
+ maxHeight: toPx(style.maxHeight),
13
+ top: toPx(style.top),
14
+ bottom: toPx(style.bottom),
15
+ left: toPx(style.left),
16
+ right: toPx(style.right),
17
+ inset: toPx(style.inset),
18
+ insetBlock: toPx(style.insetBlock),
19
+ insetBlockEnd: toPx(style.insetBlockEnd),
20
+ insetBlockStart: toPx(style.insetBlockStart),
21
+ insetInline: toPx(style.insetInline),
22
+ insetInlineEnd: toPx(style.insetInlineEnd ?? style.end),
23
+ insetInlineStart: toPx(style.insetInlineStart ?? style.start),
24
+ // Margin - specific properties take precedence over shorthands (RN behavior)
25
+ margin: toPx(style.margin),
26
+ marginTop: toPx(style.marginTop ?? style.marginVertical),
27
+ marginBottom: toPx(style.marginBottom ?? style.marginVertical),
28
+ marginLeft: toPx(style.marginLeft ?? style.marginHorizontal),
29
+ marginRight: toPx(style.marginRight ?? style.marginHorizontal),
30
+ marginBlock: toPx(style.marginBlock),
31
+ marginBlockEnd: toPx(style.marginBlockEnd),
32
+ marginBlockStart: toPx(style.marginBlockStart),
33
+ marginInline: toPx(style.marginInline),
34
+ marginInlineEnd: toPx(style.marginInlineEnd ?? style.marginEnd),
35
+ marginInlineStart: toPx(style.marginInlineStart ?? style.marginStart),
36
+ // Padding - specific properties take precedence over shorthands (RN behavior)
37
+ padding: toPx(style.padding),
38
+ paddingTop: toPx(style.paddingTop ?? style.paddingVertical),
39
+ paddingBottom: toPx(style.paddingBottom ?? style.paddingVertical),
40
+ paddingLeft: toPx(style.paddingLeft ?? style.paddingHorizontal),
41
+ paddingRight: toPx(style.paddingRight ?? style.paddingHorizontal),
42
+ paddingBlock: toPx(style.paddingBlock),
43
+ paddingBlockEnd: toPx(style.paddingBlockEnd),
44
+ paddingBlockStart: toPx(style.paddingBlockStart),
45
+ paddingInline: toPx(style.paddingInline),
46
+ paddingInlineEnd: toPx(style.paddingInlineEnd ?? style.paddingEnd),
47
+ paddingInlineStart: toPx(style.paddingInlineStart ?? style.paddingStart),
48
+ // Border widths
49
+ borderInlineStartWidth: toPx(style.borderStartWidth),
50
+ borderInlineEndWidth: toPx(style.borderEndWidth),
51
+ borderWidth: toPx(style.borderWidth),
52
+ borderTopWidth: toPx(style.borderTopWidth),
53
+ borderBottomWidth: toPx(style.borderBottomWidth),
54
+ borderLeftWidth: toPx(style.borderLeftWidth),
55
+ borderRightWidth: toPx(style.borderRightWidth),
56
+ // Border radius (physical)
57
+ borderRadius: toPx(style.borderRadius),
58
+ borderTopLeftRadius: toPx(style.borderTopLeftRadius),
59
+ borderTopRightRadius: toPx(style.borderTopRightRadius),
60
+ borderBottomLeftRadius: toPx(style.borderBottomLeftRadius),
61
+ borderBottomRightRadius: toPx(style.borderBottomRightRadius),
62
+ // Border radius (logical)
63
+ borderStartStartRadius: toPx(style.borderStartStartRadius ?? style.borderTopStartRadius),
64
+ borderStartEndRadius: toPx(style.borderStartEndRadius ?? style.borderTopEndRadius),
65
+ borderEndStartRadius: toPx(style.borderEndStartRadius ?? style.borderBottomStartRadius),
66
+ borderEndEndRadius: toPx(style.borderEndEndRadius ?? style.borderBottomEndRadius),
67
+ // Border colors
68
+ borderColor: toColor(style.borderColor),
69
+ borderBlockColor: toColor(style.borderBlockColor),
70
+ borderBlockEndColor: toColor(style.borderBlockEndColor),
71
+ borderBlockStartColor: toColor(style.borderBlockStartColor),
72
+ borderBottomColor: toColor(style.borderBottomColor),
73
+ borderInlineEndColor: toColor(style.borderEndColor),
74
+ borderLeftColor: toColor(style.borderLeftColor),
75
+ borderRightColor: toColor(style.borderRightColor),
76
+ borderInlineStartColor: toColor(style.borderStartColor),
77
+ borderTopColor: toColor(style.borderTopColor),
78
+ borderStyle: style.borderStyle ?? (style.borderWidth != null || style.borderTopWidth != null || style.borderBottomWidth != null || style.borderLeftWidth != null || style.borderRightWidth != null || style.borderStartWidth != null || style.borderEndWidth != null || style.borderColor != null ? 'solid' : undefined),
79
+ // Typography
80
+ color: toColor(style.color),
81
+ fontFamily: style.fontFamily,
82
+ fontSize: toPx(style.fontSize),
83
+ fontStyle: style.fontStyle,
84
+ fontWeight: style.fontWeight,
85
+ lineHeight: toPx(style.lineHeight),
86
+ letterSpacing: toPx(style.letterSpacing),
87
+ // View appearance
88
+ backgroundColor: toColor(style.backgroundColor),
89
+ // boxShadow/filter: RN accepts arrays, CSS only strings
90
+ boxShadow: typeof style.boxShadow === 'string' ? style.boxShadow : undefined,
91
+ display: style.display,
92
+ position: style.position,
93
+ alignSelf: style.alignSelf,
94
+ backfaceVisibility: style.backfaceVisibility,
95
+ cursor: style.cursor,
96
+ filter: typeof style.filter === 'string' ? style.filter : undefined,
97
+ mixBlendMode: style.mixBlendMode,
98
+ boxSizing: style.boxSizing,
99
+ // pointerEvents: RN 'box-none'/'box-only' have no CSS equivalent
100
+ pointerEvents: style.pointerEvents === 'auto' || style.pointerEvents === 'none' ? style.pointerEvents : undefined,
101
+ // Outline
102
+ outlineColor: toColor(style.outlineColor),
103
+ outlineStyle: style.outlineStyle ?? (style.outlineWidth != null ? 'solid' : undefined),
104
+ outlineOffset: toPx(style.outlineOffset),
105
+ outlineWidth: toPx(style.outlineWidth),
106
+ // Transforms
107
+ transform: resolveTransform(style.transform),
108
+ // transformOrigin: RN accepts strings or arrays, CSS only strings
109
+ transformOrigin: typeof style.transformOrigin === 'string' ? style.transformOrigin : undefined,
110
+ // Flex
111
+ flex: style.flex,
112
+ flexGrow: style.flexGrow,
113
+ flexShrink: style.flexShrink,
114
+ flexBasis: toPx(style.flexBasis),
115
+ // Misc
116
+ zIndex: style.zIndex,
117
+ // opacity: RN AnimatableNumericValue includes AnimatedNode; CSS only number
118
+ opacity: typeof style.opacity === 'number' ? style.opacity : undefined,
119
+ aspectRatio: style.aspectRatio,
120
+ // Extra options
121
+ overflowY: extraOptions.scrollEnabled != null ? extraOptions.scrollEnabled ? 'auto' : 'hidden' : undefined
122
+ };
123
+
124
+ // Clean undefined values
125
+ return Object.fromEntries(Object.entries(css).filter(([, v]) => v !== undefined));
126
+ }
127
+ function toPx(value) {
128
+ if (value == null) return undefined;
129
+ if (typeof value === 'number') return `${value}px`;
130
+ if (typeof value === 'string') return value;
131
+ return undefined;
132
+ }
133
+ function resolveTransform(transform) {
134
+ if (typeof transform === 'string') return transform;
135
+ if (!Array.isArray(transform)) return undefined;
136
+ const parts = transform.map(item => {
137
+ if ('translateX' in item) return `translateX(${item.translateX}px)`;
138
+ if ('translateY' in item) return `translateY(${item.translateY}px)`;
139
+ if ('translateZ' in item) return `translateZ(${item.translateZ}px)`;
140
+ if ('scale' in item) return `scale(${item.scale})`;
141
+ if ('scaleX' in item) return `scaleX(${item.scaleX})`;
142
+ if ('scaleY' in item) return `scaleY(${item.scaleY})`;
143
+ if ('scaleZ' in item) return `scaleZ(${item.scaleZ})`;
144
+ if ('rotate' in item) return `rotate(${item.rotate})`;
145
+ if ('rotateX' in item) return `rotateX(${item.rotateX})`;
146
+ if ('rotateY' in item) return `rotateY(${item.rotateY})`;
147
+ if ('rotateZ' in item) return `rotateZ(${item.rotateZ})`;
148
+ if ('skewX' in item) return `skewX(${item.skewX})`;
149
+ if ('skewY' in item) return `skewY(${item.skewY})`;
150
+ if ('perspective' in item) return `perspective(${item.perspective}px)`;
151
+ if ('matrix' in item) {
152
+ return item.matrix.length === 16 ? `matrix3d(${item.matrix.join(', ')})` : `matrix(${item.matrix.join(', ')})`;
153
+ }
154
+ return null;
155
+ });
156
+ const css = parts.filter(Boolean).join(' ');
157
+ return css || undefined;
158
+ }
159
+ //# sourceMappingURL=enrichedBaseStyleToCSSProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["toColor","enrichedBaseStyleToCSSProperties","style","extraOptions","css","width","toPx","height","minWidth","maxWidth","minHeight","maxHeight","top","bottom","left","right","inset","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","end","insetInlineStart","start","margin","marginTop","marginVertical","marginBottom","marginLeft","marginHorizontal","marginRight","marginBlock","marginBlockEnd","marginBlockStart","marginInline","marginInlineEnd","marginEnd","marginInlineStart","marginStart","padding","paddingTop","paddingVertical","paddingBottom","paddingLeft","paddingHorizontal","paddingRight","paddingBlock","paddingBlockEnd","paddingBlockStart","paddingInline","paddingInlineEnd","paddingEnd","paddingInlineStart","paddingStart","borderInlineStartWidth","borderStartWidth","borderInlineEndWidth","borderEndWidth","borderWidth","borderTopWidth","borderBottomWidth","borderLeftWidth","borderRightWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderStartStartRadius","borderTopStartRadius","borderStartEndRadius","borderTopEndRadius","borderEndStartRadius","borderBottomStartRadius","borderEndEndRadius","borderBottomEndRadius","borderColor","borderBlockColor","borderBlockEndColor","borderBlockStartColor","borderBottomColor","borderInlineEndColor","borderEndColor","borderLeftColor","borderRightColor","borderInlineStartColor","borderStartColor","borderTopColor","borderStyle","undefined","color","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","letterSpacing","backgroundColor","boxShadow","display","position","alignSelf","backfaceVisibility","cursor","filter","mixBlendMode","boxSizing","pointerEvents","outlineColor","outlineStyle","outlineWidth","outlineOffset","transform","resolveTransform","transformOrigin","flex","flexGrow","flexShrink","flexBasis","zIndex","opacity","aspectRatio","overflowY","scrollEnabled","Object","fromEntries","entries","v","value","Array","isArray","parts","map","item","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skewX","skewY","perspective","matrix","length","join","Boolean"],"sourceRoot":"../../../../src","sources":["web/styleConversion/enrichedBaseStyleToCSSProperties.ts"],"mappings":";;AAOA,SAASA,OAAO,QAAQ,cAAW;AAMnC,OAAO,SAASC,gCAAgCA,CAC9CC,KAAqC,EACrCC,YAAyC,GAAG,CAAC,CAAC,EAC/B;EACf,MAAMC,GAAkB,GAAG;IACzB;IACAC,KAAK,E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IAClD,IAAI,OAAO,IAAIZ,IAAI,EAAE,OAAO,SAASA,IAAI,CAACa,KAAK,GAAG;IAClD,IAAI,aAAa,IAAIb,IAAI,EAAE,OAAO,eAAeA,IAAI,CAACc,WAAW,KAAK;IACtE,IAAI,QAAQ,IAAId,IAAI,EAAE;MACpB,OAAOA,IAAI,CAACe,MAAM,CAACC,MAAM,KAAK,EAAE,GAC5B,YAAYhB,IAAI,CAACe,MAAM,CAACE,IAAI,CAAC,IAAI,CAAC,GAAG,GACrC,UAAUjB,IAAI,CAACe,MAAM,CAACE,IAAI,CAAC,IAAI,CAAC,GAAG;IACzC;IACA,OAAO,IAAI;EACb,CAAC,CAAC;EAEF,MAAMnJ,GAAG,GAAGgI,KAAK,CAAC3B,MAAM,CAAC+C,OAAO,CAAC,CAACD,IAAI,CAAC,GAAG,CAAC;EAC3C,OAAOnJ,GAAG,IAAIsF,SAAS;AACzB","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ import { enrichedBaseStyleToCSSProperties } from "./enrichedBaseStyleToCSSProperties.js";
4
+ export function enrichedInputStyleToCSSProperties(style, extraOptions) {
5
+ return enrichedBaseStyleToCSSProperties(style, extraOptions);
6
+ }
7
+ //# sourceMappingURL=enrichedInputStyleToCSSProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["enrichedBaseStyleToCSSProperties","enrichedInputStyleToCSSProperties","style","extraOptions"],"sourceRoot":"../../../../src","sources":["web/styleConversion/enrichedInputStyleToCSSProperties.ts"],"mappings":";;AAEA,SACEA,gCAAgC,QAE3B,uCAAoC;AAE3C,OAAO,SAASC,iCAAiCA,CAC/CC,KAAyB,EACzBC,YAA0C,EAC3B;EACf,OAAOH,gCAAgC,CAACE,KAAK,EAAEC,YAAY,CAAC;AAC9D","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ import { enrichedBaseStyleToCSSProperties } from "./enrichedBaseStyleToCSSProperties.js";
4
+ import { toColor } from "./toColor.js";
5
+ export function enrichedTextStyleToCSSProperties(style) {
6
+ const css = {
7
+ ...enrichedBaseStyleToCSSProperties(style, {
8
+ scrollEnabled: false
9
+ }),
10
+ // Text-only properties
11
+ // textAlign: RN 'auto' has no CSS equivalent
12
+ textAlign: style.textAlign !== 'auto' ? style.textAlign : undefined,
13
+ textTransform: style.textTransform,
14
+ textDecorationLine: style.textDecorationLine,
15
+ textDecorationStyle: style.textDecorationStyle,
16
+ textDecorationColor: toColor(style.textDecorationColor),
17
+ textShadow: resolveTextShadow(style),
18
+ // userSelect: RN 'contain' has no CSS equivalent
19
+ userSelect: style.userSelect !== 'contain' ? style.userSelect : undefined,
20
+ fontVariant: Array.isArray(style.fontVariant) ? style.fontVariant.join(' ') : undefined,
21
+ // writingDirection: RN 'auto' has no CSS equivalent
22
+ direction: style.writingDirection !== 'auto' ? style.writingDirection : undefined,
23
+ // verticalAlign: RN 'auto' has no CSS equivalent
24
+ verticalAlign: style.verticalAlign !== 'auto' ? style.verticalAlign : undefined
25
+ };
26
+ return Object.fromEntries(Object.entries(css).filter(([, v]) => v !== undefined));
27
+ }
28
+ function resolveTextShadow(style) {
29
+ const {
30
+ textShadowColor,
31
+ textShadowOffset,
32
+ textShadowRadius
33
+ } = style;
34
+ if (textShadowColor == null && textShadowOffset == null && textShadowRadius == null) {
35
+ return undefined;
36
+ }
37
+ const x = textShadowOffset?.width ?? 0;
38
+ const y = textShadowOffset?.height ?? 0;
39
+ const blur = textShadowRadius ?? 0;
40
+ const color = toColor(textShadowColor);
41
+ const offset = `${x}px ${y}px ${blur}px`;
42
+ return color ? `${offset} ${color}` : offset;
43
+ }
44
+ //# sourceMappingURL=enrichedTextStyleToCSSProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["enrichedBaseStyleToCSSProperties","toColor","enrichedTextStyleToCSSProperties","style","css","scrollEnabled","textAlign","undefined","textTransform","textDecorationLine","textDecorationStyle","textDecorationColor","textShadow","resolveTextShadow","userSelect","fontVariant","Array","isArray","join","direction","writingDirection","verticalAlign","Object","fromEntries","entries","filter","v","textShadowColor","textShadowOffset","textShadowRadius","x","width","y","height","blur","color","offset"],"sourceRoot":"../../../../src","sources":["web/styleConversion/enrichedTextStyleToCSSProperties.ts"],"mappings":";;AAEA,SAASA,gCAAgC,QAAQ,uCAAoC;AACrF,SAASC,OAAO,QAAQ,cAAW;AAEnC,OAAO,SAASC,gCAAgCA,CAC9CC,KAAgB,EACD;EACf,MAAMC,GAAkB,GAAG;IACzB,GAAGJ,gCAAgC,CAACG,KAAK,EAAE;MAAEE,aAAa,EAAE;IAAM,CAAC,CAAC;IAEpE;IACA;IACAC,SAAS,EAAEH,KAAK,CAACG,SAAS,KAAK,MAAM,GAAGH,KAAK,CAACG,SAAS,GAAGC,SAAS;IACnEC,aAAa,EAAEL,KAAK,CAACK,aAAa;IAClCC,kBAAkB,EAAEN,KAAK,CAACM,kBAAkB;IAC5CC,mBAAmB,EAAEP,KAAK,CAACO,mBAAmB;IAC9CC,mBAAmB,EAAEV,OAAO,CAACE,KAAK,CAACQ,mBAAmB,CAAC;IACvDC,UAAU,EAAEC,iBAAiB,CAACV,KAAK,CAAC;IACpC;IACAW,UAAU,EAAEX,KAAK,CAACW,UAAU,KAAK,SAAS,GAAGX,KAAK,CAACW,UAAU,GAAGP,SAAS;IACzEQ,WAAW,EAAEC,KAAK,CAACC,OAAO,CAACd,KAAK,CAACY,WAAW,CAAC,GACzCZ,KAAK,CAACY,WAAW,CAACG,IAAI,CAAC,GAAG,CAAC,GAC3BX,SAAS;IACb;IACAY,SAAS,EACPhB,KAAK,CAACiB,gBAAgB,KAAK,MAAM,GAAGjB,KAAK,CAACiB,gBAAgB,GAAGb,SAAS;IACxE;IACAc,aAAa,EACXlB,KAAK,CAACkB,aAAa,KAAK,MAAM,GAAGlB,KAAK,CAACkB,aAAa,GAAGd;EAC3D,CAAC;EAED,OAAOe,MAAM,CAACC,WAAW,CACvBD,MAAM,CAACE,OAAO,CAACpB,GAAG,CAAC,CAACqB,MAAM,CAAC,CAAC,GAAGC,CAAC,CAAC,KAAKA,CAAC,KAAKnB,SAAS,CACvD,CAAC;AACH;AAEA,SAASM,iBAAiBA,CAACV,KAAgB,EAAsB;EAC/D,MAAM;IAAEwB,eAAe;IAAEC,gBAAgB;IAAEC;EAAiB,CAAC,GAAG1B,KAAK;EACrE,IACEwB,eAAe,IAAI,IAAI,IACvBC,gBAAgB,IAAI,IAAI,IACxBC,gBAAgB,IAAI,IAAI,EACxB;IACA,OAAOtB,SAAS;EAClB;EACA,MAAMuB,CAAC,GAAGF,gBAAgB,EAAEG,KAAK,IAAI,CAAC;EACtC,MAAMC,CAAC,GAAGJ,gBAAgB,EAAEK,MAAM,IAAI,CAAC;EACvC,MAAMC,IAAI,GAAGL,gBAAgB,IAAI,CAAC;EAClC,MAAMM,KAAK,GAAGlC,OAAO,CAAC0B,eAAe,CAAC;EACtC,MAAMS,MAAM,GAAG,GAAGN,CAAC,MAAME,CAAC,MAAME,IAAI,IAAI;EACxC,OAAOC,KAAK,GAAG,GAAGC,MAAM,IAAID,KAAK,EAAE,GAAGC,MAAM;AAC9C","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ import { toColor } from "./toColor.js";
4
+ export function enrichedInputThemingToCSSProperties({
5
+ cursorColor,
6
+ placeholderTextColor,
7
+ selectionColor
8
+ }) {
9
+ const extra = {};
10
+ const caret = toColor(cursorColor);
11
+ if (caret) extra.caretColor = caret;
12
+ const placeholderCss = toColor(placeholderTextColor);
13
+ if (placeholderCss) extra['--et-placeholder-text-color'] = placeholderCss;
14
+ const selectionCss = toColor(selectionColor);
15
+ if (selectionCss) extra['--et-selection-color'] = selectionCss;
16
+ return extra;
17
+ }
18
+ //# sourceMappingURL=enrichedThemingToCSSProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["toColor","enrichedInputThemingToCSSProperties","cursorColor","placeholderTextColor","selectionColor","extra","caret","caretColor","placeholderCss","selectionCss"],"sourceRoot":"../../../../src","sources":["web/styleConversion/enrichedThemingToCSSProperties.ts"],"mappings":";;AAEA,SAASA,OAAO,QAAQ,cAAW;AAenC,OAAO,SAASC,mCAAmCA,CAAC;EAClDC,WAAW;EACXC,oBAAoB;EACpBC;AAC0B,CAAC,EAAiB;EAC5C,MAAMC,KAAgC,GAAG,CAAC,CAAC;EAC3C,MAAMC,KAAK,GAAGN,OAAO,CAACE,WAAW,CAAC;EAClC,IAAII,KAAK,EAAED,KAAK,CAACE,UAAU,GAAGD,KAAK;EAEnC,MAAME,cAAc,GAAGR,OAAO,CAACG,oBAAoB,CAAC;EACpD,IAAIK,cAAc,EAAEH,KAAK,CAAC,6BAA6B,CAAC,GAAGG,cAAc;EAEzE,MAAMC,YAAY,GAAGT,OAAO,CAACI,cAAc,CAAC;EAC5C,IAAIK,YAAY,EAAEJ,KAAK,CAAC,sBAAsB,CAAC,GAAGI,YAAY;EAE9D,OAAOJ,KAAK;AACd","ignoreList":[]}
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+
3
+ import { DEFAULT_ENRICHED_TEXT_STYLE, DEFAULT_HTML_STYLE } from "../../utils/defaultHtmlStyle.js";
4
+ import { expandMentionStylesForIndicators } from "../../utils/expandMentionStylesForIndicators.js";
5
+ import { HEADING_TAGS } from "../formats/EnrichedHeading.js";
6
+ import { indicatorToMentionCssKey, MENTION_STYLE_DEFAULT_KEY } from "./mentionIndicatorCssKey.js";
7
+ import { toColor } from "./toColor.js";
8
+ import { isMentionStyleRecord } from "../../utils/isMentionStyleRecord.js";
9
+ export function mergeWithDefaultHtmlStyle(htmlStyle, htmlStyleToMergeWith = DEFAULT_HTML_STYLE) {
10
+ const style = htmlStyle ?? {};
11
+ const mentionMap = expandMentionStylesForIndicatorsIncludeDefault(style, htmlStyleToMergeWith);
12
+ const converted = {
13
+ ...style,
14
+ mention: mentionMap
15
+ };
16
+ const merged = {
17
+ ...htmlStyleToMergeWith
18
+ };
19
+ for (const key in converted) {
20
+ if (key === 'mention') {
21
+ merged[key] = {
22
+ ...converted.mention
23
+ };
24
+ continue;
25
+ }
26
+ merged[key] = {
27
+ ...htmlStyleToMergeWith[key],
28
+ ...converted[key]
29
+ };
30
+ }
31
+ return merged;
32
+ }
33
+ export function mergeWithDefaultEnrichedTextHtmlStyle(htmlStyle) {
34
+ const merged = mergeWithDefaultHtmlStyle(htmlStyle, DEFAULT_ENRICHED_TEXT_STYLE);
35
+ const a = {
36
+ ...DEFAULT_ENRICHED_TEXT_STYLE.a,
37
+ ...htmlStyle?.a
38
+ };
39
+ const mentionDefaults = DEFAULT_ENRICHED_TEXT_STYLE.mention;
40
+ const passedMentionMap = htmlStyle?.mention;
41
+ const mergedMentionMap = merged.mention;
42
+ const mention = {};
43
+ for (const indicator in mergedMentionMap) {
44
+ mention[indicator] = {
45
+ ...mentionDefaults,
46
+ ...(isMentionStyleRecord(passedMentionMap) ? passedMentionMap[indicator] ?? passedMentionMap[MENTION_STYLE_DEFAULT_KEY] : passedMentionMap)
47
+ };
48
+ }
49
+ return {
50
+ ...merged,
51
+ a,
52
+ mention
53
+ };
54
+ }
55
+ const ET_CSS_VARS = {
56
+ codeColor: '--et-code-color',
57
+ codeBgColor: '--et-code-bg-color',
58
+ blockquoteBorderColor: '--et-blockquote-border-color',
59
+ blockquoteBorderWidth: '--et-blockquote-border-width',
60
+ blockquoteGapWidth: '--et-blockquote-gap-width',
61
+ blockquoteColor: '--et-blockquote-color',
62
+ codeblockBgColor: '--et-codeblock-bg-color',
63
+ codeblockColor: '--et-codeblock-color',
64
+ codeblockBorderRadius: '--et-codeblock-border-radius',
65
+ linkColor: '--et-link-color',
66
+ linkTextDecorationLine: '--et-link-text-decoration-line',
67
+ ulBulletColor: '--et-ul-bullet-color',
68
+ ulBulletSize: '--et-ul-bullet-size',
69
+ ulMarginLeft: '--et-ul-margin-left',
70
+ ulGapWidth: '--et-ul-gap-width',
71
+ olMarginLeft: '--et-ol-margin-left',
72
+ olGapWidth: '--et-ol-gap-width',
73
+ olMarkerColor: '--et-ol-marker-color',
74
+ olMarkerFontWeight: '--et-ol-marker-font-weight',
75
+ checkboxBoxSize: '--et-checkbox-box-size',
76
+ checkboxGapWidth: '--et-checkbox-gap-width',
77
+ checkboxMarginLeft: '--et-checkbox-margin-left',
78
+ checkboxBoxColor: '--et-checkbox-box-color'
79
+ };
80
+ export const ET_MENTION_CSS_VARS = {
81
+ color: indicator => `--et-mention-${indicatorToMentionCssKey(indicator)}-color`,
82
+ backgroundColor: indicator => `--et-mention-${indicatorToMentionCssKey(indicator)}-background-color`,
83
+ textDecorationLine: indicator => `--et-mention-${indicatorToMentionCssKey(indicator)}-text-decoration-line`
84
+ };
85
+ function setColorVar(vars, name, value) {
86
+ const c = toColor(value);
87
+ if (c) vars[name] = c;
88
+ }
89
+ function setPxVar(vars, name, n) {
90
+ if (n != null) vars[name] = `${n}px`;
91
+ }
92
+ function applyCodeVars(vars, code) {
93
+ setColorVar(vars, ET_CSS_VARS.codeColor, code?.color);
94
+ setColorVar(vars, ET_CSS_VARS.codeBgColor, code?.backgroundColor);
95
+ }
96
+ function applyHeadingVars(vars, htmlStyle) {
97
+ for (const level of HEADING_TAGS) {
98
+ const h = htmlStyle?.[level];
99
+ if (h?.fontSize != null) vars[`--et-${level}-font-size`] = `${h.fontSize}px`;
100
+ if (h?.bold != null) vars[`--et-${level}-font-weight`] = h.bold ? 'bold' : 'normal';
101
+ }
102
+ }
103
+ function applyBlockquoteVars(vars, bq) {
104
+ setColorVar(vars, ET_CSS_VARS.blockquoteBorderColor, bq?.borderColor);
105
+ setPxVar(vars, ET_CSS_VARS.blockquoteBorderWidth, bq?.borderWidth);
106
+ setPxVar(vars, ET_CSS_VARS.blockquoteGapWidth, bq?.gapWidth);
107
+ setColorVar(vars, ET_CSS_VARS.blockquoteColor, bq?.color);
108
+ }
109
+ function applyCodeblockVars(vars, cb) {
110
+ setColorVar(vars, ET_CSS_VARS.codeblockBgColor, cb?.backgroundColor);
111
+ setColorVar(vars, ET_CSS_VARS.codeblockColor, cb?.color);
112
+ setPxVar(vars, ET_CSS_VARS.codeblockBorderRadius, cb?.borderRadius);
113
+ }
114
+ function applyLinkVars(vars, anchor) {
115
+ setColorVar(vars, ET_CSS_VARS.linkColor, anchor?.color);
116
+ if (anchor?.textDecorationLine != null) {
117
+ vars[ET_CSS_VARS.linkTextDecorationLine] = anchor.textDecorationLine;
118
+ }
119
+ }
120
+ function applyUnorderedListVars(vars, ul) {
121
+ setColorVar(vars, ET_CSS_VARS.ulBulletColor, ul?.bulletColor);
122
+ setPxVar(vars, ET_CSS_VARS.ulBulletSize, ul?.bulletSize);
123
+ setPxVar(vars, ET_CSS_VARS.ulMarginLeft, ul?.marginLeft);
124
+ setPxVar(vars, ET_CSS_VARS.ulGapWidth, ul?.gapWidth);
125
+ }
126
+ function applyOrderedListVars(vars, ol) {
127
+ setPxVar(vars, ET_CSS_VARS.olMarginLeft, ol?.marginLeft);
128
+ setPxVar(vars, ET_CSS_VARS.olGapWidth, ol?.gapWidth);
129
+ setColorVar(vars, ET_CSS_VARS.olMarkerColor, ol?.markerColor);
130
+ if (ol?.markerFontWeight != null) {
131
+ vars[ET_CSS_VARS.olMarkerFontWeight] = String(ol.markerFontWeight);
132
+ }
133
+ }
134
+ function applyCheckboxListVars(vars, ulCheckbox) {
135
+ setPxVar(vars, ET_CSS_VARS.checkboxBoxSize, ulCheckbox?.boxSize);
136
+ setPxVar(vars, ET_CSS_VARS.checkboxGapWidth, ulCheckbox?.gapWidth);
137
+ setPxVar(vars, ET_CSS_VARS.checkboxMarginLeft, ulCheckbox?.marginLeft);
138
+ setColorVar(vars, ET_CSS_VARS.checkboxBoxColor, ulCheckbox?.boxColor);
139
+ }
140
+ function applyMentionVars(vars, mention) {
141
+ if (!mention) return;
142
+ for (const [indicator, mentionStyle] of Object.entries(mention)) {
143
+ setColorVar(vars, ET_MENTION_CSS_VARS.color(indicator), mentionStyle.color);
144
+ setColorVar(vars, ET_MENTION_CSS_VARS.backgroundColor(indicator), mentionStyle.backgroundColor);
145
+ if (mentionStyle.textDecorationLine != null) {
146
+ vars[ET_MENTION_CSS_VARS.textDecorationLine(indicator)] = mentionStyle.textDecorationLine;
147
+ }
148
+ }
149
+ }
150
+ function expandMentionStylesForIndicatorsIncludeDefault(htmlStyle, htmlStyleToMergeWith) {
151
+ const mentionIndicators = isMentionStyleRecord(htmlStyle?.mention) ? Object.keys(htmlStyle?.mention) : [];
152
+ if (!mentionIndicators.includes(MENTION_STYLE_DEFAULT_KEY)) mentionIndicators.push(MENTION_STYLE_DEFAULT_KEY);
153
+ return expandMentionStylesForIndicators(htmlStyle?.mention, mentionIndicators, htmlStyleToMergeWith);
154
+ }
155
+ export function htmlStyleToCSSVariables(htmlStyle) {
156
+ const vars = {};
157
+ applyCodeVars(vars, htmlStyle?.code);
158
+ applyHeadingVars(vars, htmlStyle);
159
+ applyBlockquoteVars(vars, htmlStyle?.blockquote);
160
+ applyCodeblockVars(vars, htmlStyle?.codeblock);
161
+ applyLinkVars(vars, htmlStyle?.a);
162
+ applyUnorderedListVars(vars, htmlStyle?.ul);
163
+ applyOrderedListVars(vars, htmlStyle?.ol);
164
+ applyCheckboxListVars(vars, htmlStyle?.ulCheckbox);
165
+ applyMentionVars(vars, htmlStyle.mention);
166
+ return vars;
167
+ }
168
+ //# sourceMappingURL=htmlStyleToCSSVariables.js.map