react-native-enriched-markdown-scaffold 0.7.4-scaffold.9 → 1.0.2-scaffold.10

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 (505) hide show
  1. package/README.md +54 -8
  2. package/ReactNativeEnrichedMarkdown.podspec +82 -73
  3. package/android/build.gradle +188 -1
  4. package/android/consumer-rules.pro +1 -1
  5. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownManagerDelegate.java +27 -0
  6. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownManagerInterface.java +7 -0
  7. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownTextInputManagerDelegate.java +24 -0
  8. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownTextInputManagerInterface.java +8 -0
  9. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownTextManagerDelegate.java +27 -0
  10. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownTextManagerInterface.java +7 -0
  11. package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/EventEmitters.cpp +223 -0
  12. package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/EventEmitters.h +183 -0
  13. package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/Props.cpp +65 -0
  14. package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/Props.h +1086 -61
  15. package/android/src/main/baseline-prof.txt +1 -1
  16. package/android/src/main/cpp/jni-adapter.cpp +74 -0
  17. package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdown.kt +351 -13
  18. package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownInternalText.kt +62 -0
  19. package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownManager.kt +85 -0
  20. package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownText.kt +160 -1
  21. package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownTextLayoutManager.kt +10 -1
  22. package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownTextManager.kt +76 -0
  23. package/android/src/main/java/com/swmansion/enriched/markdown/MeasurementStore.kt +126 -10
  24. package/android/src/main/java/com/swmansion/enriched/markdown/events/CopyPressEvent.kt +24 -0
  25. package/android/src/main/java/com/swmansion/enriched/markdown/events/CopyRequestEvent.kt +28 -0
  26. package/android/src/main/java/com/swmansion/enriched/markdown/events/LinkLayoutEvent.kt +36 -0
  27. package/android/src/main/java/com/swmansion/enriched/markdown/events/SelectionChangeEvent.kt +43 -0
  28. package/android/src/main/java/com/swmansion/enriched/markdown/input/EnrichedMarkdownTextInputManager.kt +54 -4
  29. package/android/src/main/java/com/swmansion/enriched/markdown/input/EnrichedMarkdownTextInputView.kt +923 -462
  30. package/android/src/main/java/com/swmansion/enriched/markdown/input/MarkdownClipboard.kt +42 -0
  31. package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/BlockEditCoordinator.kt +196 -0
  32. package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/ClipboardCoordinator.kt +73 -0
  33. package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/EditContext.kt +19 -0
  34. package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/EditPipeline.kt +248 -0
  35. package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/EditSession.kt +52 -0
  36. package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/InputConnectionWrapper.kt +108 -7
  37. package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/LinkCoordinator.kt +69 -0
  38. package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/MarkdownTextWatcher.kt +3 -3
  39. package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/MentionCoordinator.kt +118 -0
  40. package/android/src/main/java/com/swmansion/enriched/markdown/input/events/OnChangeStateEvent.kt +26 -0
  41. package/android/src/main/java/com/swmansion/enriched/markdown/input/events/OnContextMenuItemPressEvent.kt +26 -0
  42. package/android/src/main/java/com/swmansion/enriched/markdown/input/events/OnInputKeyPressEvent.kt +24 -0
  43. package/android/src/main/java/com/swmansion/enriched/markdown/input/events/OnPasteEvent.kt +24 -0
  44. package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/BlockStore.kt +254 -0
  45. package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/FormattingStore.kt +80 -87
  46. package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/InputFormatter.kt +109 -1
  47. package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/InputParser.kt +116 -22
  48. package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/MarkdownSerializer.kt +167 -38
  49. package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/RangeEditAdjustment.kt +149 -0
  50. package/android/src/main/java/com/swmansion/enriched/markdown/input/layout/InputEventEmitter.kt +66 -5
  51. package/android/src/main/java/com/swmansion/enriched/markdown/input/layout/InputMeasurementStore.kt +4 -2
  52. package/android/src/main/java/com/swmansion/enriched/markdown/input/model/BlockRange.kt +27 -0
  53. package/android/src/main/java/com/swmansion/enriched/markdown/input/model/BlockType.kt +48 -0
  54. package/android/src/main/java/com/swmansion/enriched/markdown/input/model/FormattingRange.kt +9 -4
  55. package/android/src/main/java/com/swmansion/enriched/markdown/input/model/InputFormatterStyle.kt +39 -2
  56. package/android/src/main/java/com/swmansion/enriched/markdown/input/model/MathAtom.kt +20 -0
  57. package/android/src/main/java/com/swmansion/enriched/markdown/input/model/MathChipStyle.kt +1 -1
  58. package/android/src/main/java/com/swmansion/enriched/markdown/input/model/MutableRangeBounds.kt +11 -0
  59. package/android/src/main/java/com/swmansion/enriched/markdown/input/spans/InputBulletSpan.kt +82 -0
  60. package/android/src/main/java/com/swmansion/enriched/markdown/input/spans/InputHeadingSpan.kt +58 -0
  61. package/android/src/main/java/com/swmansion/enriched/markdown/input/spans/InputListItemSpacingSpan.kt +37 -0
  62. package/android/src/main/java/com/swmansion/enriched/markdown/input/spans/InputOrderedListMarkerSpan.kt +63 -0
  63. package/android/src/main/java/com/swmansion/enriched/markdown/input/styles/BlockHandler.kt +54 -0
  64. package/android/src/main/java/com/swmansion/enriched/markdown/input/styles/HeadingBlockHandler.kt +27 -0
  65. package/android/src/main/java/com/swmansion/enriched/markdown/input/styles/OrderedListBlockHandler.kt +38 -0
  66. package/android/src/main/java/com/swmansion/enriched/markdown/input/styles/UnorderedListBlockHandler.kt +37 -0
  67. package/android/src/main/java/com/swmansion/enriched/markdown/input/toolbar/InputContextMenu.kt +8 -26
  68. package/android/src/main/java/com/swmansion/enriched/markdown/parser/MarkdownASTNode.kt +1 -0
  69. package/android/src/main/java/com/swmansion/enriched/markdown/parser/Parser.kt +1 -0
  70. package/android/src/main/java/com/swmansion/enriched/markdown/renderer/BlockStyleContext.kt +9 -2
  71. package/android/src/main/java/com/swmansion/enriched/markdown/renderer/BlockquoteRenderer.kt +100 -12
  72. package/android/src/main/java/com/swmansion/enriched/markdown/renderer/CodeBlockRenderer.kt +16 -1
  73. package/android/src/main/java/com/swmansion/enriched/markdown/renderer/HeadingRenderer.kt +4 -0
  74. package/android/src/main/java/com/swmansion/enriched/markdown/renderer/LinkRenderer.kt +37 -7
  75. package/android/src/main/java/com/swmansion/enriched/markdown/renderer/ListContextManager.kt +2 -1
  76. package/android/src/main/java/com/swmansion/enriched/markdown/renderer/ListItemRenderer.kt +74 -18
  77. package/android/src/main/java/com/swmansion/enriched/markdown/renderer/ListRenderer.kt +43 -4
  78. package/android/src/main/java/com/swmansion/enriched/markdown/renderer/NodeRenderer.kt +9 -1
  79. package/android/src/main/java/com/swmansion/enriched/markdown/renderer/SoftBreakRenderer.kt +16 -0
  80. package/android/src/main/java/com/swmansion/enriched/markdown/renderer/SpanStyleCache.kt +35 -28
  81. package/android/src/main/java/com/swmansion/enriched/markdown/spans/BaseListSpan.kt +24 -0
  82. package/android/src/main/java/com/swmansion/enriched/markdown/spans/BlockquoteSpan.kt +174 -24
  83. package/android/src/main/java/com/swmansion/enriched/markdown/spans/CodeBackgroundSpan.kt +20 -82
  84. package/android/src/main/java/com/swmansion/enriched/markdown/spans/CodeBlockSpan.kt +13 -16
  85. package/android/src/main/java/com/swmansion/enriched/markdown/spans/CodeSpan.kt +1 -1
  86. package/android/src/main/java/com/swmansion/enriched/markdown/spans/EmphasisSpan.kt +1 -1
  87. package/android/src/main/java/com/swmansion/enriched/markdown/spans/ImageSpan.kt +182 -46
  88. package/android/src/main/java/com/swmansion/enriched/markdown/spans/InlineChipPainter.kt +140 -0
  89. package/android/src/main/java/com/swmansion/enriched/markdown/spans/LinkChipSpans.kt +177 -0
  90. package/android/src/main/java/com/swmansion/enriched/markdown/spans/LinkSpan.kt +1 -6
  91. package/android/src/main/java/com/swmansion/enriched/markdown/spans/ListItemSpacingSpan.kt +33 -0
  92. package/android/src/main/java/com/swmansion/enriched/markdown/spans/ListMarkerAnchorSpan.kt +38 -0
  93. package/android/src/main/java/com/swmansion/enriched/markdown/spans/OrderedListSpan.kt +2 -0
  94. package/android/src/main/java/com/swmansion/enriched/markdown/spans/StrongSpan.kt +1 -1
  95. package/android/src/main/java/com/swmansion/enriched/markdown/spans/TaskListSpan.kt +3 -2
  96. package/android/src/main/java/com/swmansion/enriched/markdown/spans/UnorderedListSpan.kt +3 -2
  97. package/android/src/main/java/com/swmansion/enriched/markdown/styles/BlockquoteStyle.kt +6 -0
  98. package/android/src/main/java/com/swmansion/enriched/markdown/styles/CodeBlockStyle.kt +26 -0
  99. package/android/src/main/java/com/swmansion/enriched/markdown/styles/ImageStyle.kt +7 -1
  100. package/android/src/main/java/com/swmansion/enriched/markdown/styles/InlineMathStyle.kt +16 -1
  101. package/android/src/main/java/com/swmansion/enriched/markdown/styles/LinkStyle.kt +36 -1
  102. package/android/src/main/java/com/swmansion/enriched/markdown/styles/LinkVariantEntry.kt +7 -3
  103. package/android/src/main/java/com/swmansion/enriched/markdown/styles/ListStyle.kt +4 -1
  104. package/android/src/main/java/com/swmansion/enriched/markdown/styles/MathStyle.kt +3 -0
  105. package/android/src/main/java/com/swmansion/enriched/markdown/styles/StyleConfig.kt +13 -4
  106. package/android/src/main/java/com/swmansion/enriched/markdown/styles/TableStyle.kt +6 -0
  107. package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/CodeBlockHighlighter.kt +90 -0
  108. package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/CodeBlockNode.kt +57 -0
  109. package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/FeatureFlags.kt +1 -0
  110. package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/MarkdownSegment.kt +9 -0
  111. package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/MarkdownViewManagerUtils.kt +84 -7
  112. package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/ReadableMapExtensions.kt +3 -0
  113. package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/RenderedSegment.kt +10 -0
  114. package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/SegmentSignature.kt +1 -0
  115. package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/StreamingMarkdownFilter.kt +83 -5
  116. package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/serialization/MarkdownASTSerializer.kt +4 -0
  117. package/android/src/main/java/com/swmansion/enriched/markdown/utils/input/MarkdownStyleParser.kt +74 -44
  118. package/android/src/main/java/com/swmansion/enriched/markdown/utils/input/PasteTextUtils.kt +52 -0
  119. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/ImageCache.kt +26 -3
  120. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/ImageDownloader.kt +22 -9
  121. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/LocalImageLoader.kt +161 -0
  122. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/conversion/HTMLGenerator.kt +2 -1
  123. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/conversion/MarkdownExtractor.kt +6 -0
  124. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/extensions/TextPaintExtensions.kt +23 -0
  125. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/interaction/CheckboxTouchHelper.kt +7 -0
  126. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/interaction/TaskListTapUtils.kt +41 -21
  127. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/span/BlockSpacing.kt +15 -8
  128. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/view/HeadlessActionMode.kt +88 -0
  129. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/view/LinkLayoutCollector.kt +100 -0
  130. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/view/LinkLongPressMovementMethod.kt +58 -27
  131. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/view/SelectionActionMode.kt +72 -16
  132. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/view/SelectionChangeReporter.kt +232 -0
  133. package/android/src/main/java/com/swmansion/enriched/markdown/views/BlockMenuOptions.kt +64 -0
  134. package/android/src/main/java/com/swmansion/enriched/markdown/views/CodeBlockContainerView.kt +414 -0
  135. package/android/src/main/java/com/swmansion/enriched/markdown/views/ContextMenuPopup.kt +9 -6
  136. package/android/src/main/java/com/swmansion/enriched/markdown/views/CopyGlyph.kt +101 -0
  137. package/android/src/main/java/com/swmansion/enriched/markdown/views/TableContainerView.kt +61 -11
  138. package/android/src/main/jni/CMakeLists.txt +53 -0
  139. package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownContainerShadowNode.cpp +10 -0
  140. package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownContainerShadowNode.h +11 -2
  141. package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownTextShadowNode.cpp +10 -0
  142. package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownTextShadowNode.h +12 -2
  143. package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownTextState.cpp +9 -0
  144. package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownTextState.h +24 -0
  145. package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/conversions.h +16 -0
  146. package/android/src/math/java/com/swmansion/enriched/markdown/input/math/MathChipControllerImpl.kt +21 -4
  147. package/android/src/math/java/com/swmansion/enriched/markdown/renderer/MathInlineRenderer.kt +8 -2
  148. package/android/src/math/java/com/swmansion/enriched/markdown/spans/MathChipSpan.kt +1 -1
  149. package/android/src/math/java/com/swmansion/enriched/markdown/spans/MathInlineSpan.kt +13 -6
  150. package/android/src/math/java/com/swmansion/enriched/markdown/spans/MathMeasureHelper.kt +2 -1
  151. package/android/src/math/java/com/swmansion/enriched/markdown/views/MathContainerView.kt +26 -8
  152. package/cpp/highlight/CodeBlockHighlighter.cpp +284 -0
  153. package/cpp/highlight/CodeBlockHighlighter.hpp +66 -0
  154. package/cpp/highlight/CodeBlockLanguages.cpp +138 -0
  155. package/cpp/highlight/CodeBlockLanguages.hpp +25 -0
  156. package/cpp/highlight/HighlightGrammars.hpp +28 -0
  157. package/cpp/highlight/code_highlight_podspec.rb +211 -0
  158. package/cpp/highlight/gen-registry.mjs +155 -0
  159. package/cpp/highlight/grammar-versions.json +159 -0
  160. package/cpp/highlight/vendor/generated/generated_queries.h +1665 -0
  161. package/cpp/highlight/vendor/generated/generated_registry.cpp +59 -0
  162. package/cpp/parser/MD4CParser.cpp +173 -61
  163. package/cpp/parser/MD4CParser.hpp +1 -0
  164. package/cpp/parser/MarkdownASTNode.hpp +2 -1
  165. package/cpp/wasm/ASTSerializer.cpp +2 -0
  166. package/cpp/wasm/build.sh +1 -0
  167. package/cpp/wasm/md4c_wasm.cpp +3 -1
  168. package/docs/ACCESSIBILITY.md +14 -2
  169. package/docs/API_REFERENCE.md +405 -12
  170. package/docs/BREAKING_CHANGES.md +129 -0
  171. package/docs/CODE_HIGHLIGHT.md +133 -0
  172. package/docs/COPY_OPTIONS.md +61 -3
  173. package/docs/ELEMENTS_STRUCTURE.md +52 -4
  174. package/docs/IMAGE_CACHING.md +30 -0
  175. package/docs/INPUT.md +110 -11
  176. package/docs/LATEX_MATH.md +87 -45
  177. package/docs/MACOS.md +1 -1
  178. package/docs/MARKDOWN_STREAMING.md +27 -1
  179. package/docs/MENTIONS.md +8 -1
  180. package/docs/NATIVE_ASSETS.md +127 -0
  181. package/docs/RTL.md +1 -1
  182. package/docs/STYLES.md +73 -6
  183. package/docs/TESTING.md +112 -0
  184. package/docs/TEXT.md +18 -6
  185. package/docs/WEB.md +4 -1
  186. package/ios/EnrichedMarkdown.h +7 -0
  187. package/ios/EnrichedMarkdown.mm +583 -76
  188. package/ios/EnrichedMarkdownText.h +7 -0
  189. package/ios/EnrichedMarkdownText.mm +299 -73
  190. package/ios/attachments/ENRMImageAttachment.h +9 -0
  191. package/ios/attachments/ENRMImageAttachment.m +143 -40
  192. package/ios/attachments/ENRMMathInlineAttachment+macOS.m +2 -1
  193. package/ios/attachments/ENRMMathInlineAttachment.h +5 -0
  194. package/ios/attachments/ENRMMathInlineAttachment.m +50 -82
  195. package/ios/attachments/ENRMMathInlineAttachmentShared.h +2 -0
  196. package/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/EventEmitters.cpp +223 -0
  197. package/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/EventEmitters.h +183 -0
  198. package/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/Props.cpp +65 -0
  199. package/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/Props.h +1086 -61
  200. package/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/RCTComponentViewHelpers.h +181 -2
  201. package/ios/input/ENRMAutoLinkDetector.h +2 -1
  202. package/ios/input/ENRMAutoLinkDetector.mm +79 -41
  203. package/ios/input/ENRMBlockEditCoordinator.h +71 -0
  204. package/ios/input/ENRMBlockEditCoordinator.mm +195 -0
  205. package/ios/input/ENRMBlockRange.h +28 -0
  206. package/ios/input/ENRMBlockRange.mm +30 -0
  207. package/ios/input/ENRMBlockStore.h +56 -0
  208. package/ios/input/ENRMBlockStore.mm +275 -0
  209. package/ios/input/ENRMClipboardCoordinator.h +45 -0
  210. package/ios/input/ENRMClipboardCoordinator.mm +120 -0
  211. package/ios/input/ENRMDetectorPipeline.h +2 -1
  212. package/ios/input/ENRMEditPipeline.h +76 -0
  213. package/ios/input/ENRMEditPipeline.mm +228 -0
  214. package/ios/input/ENRMEditSession.h +36 -0
  215. package/ios/input/ENRMEditSession.mm +63 -0
  216. package/ios/input/ENRMFormattingStore.h +17 -0
  217. package/ios/input/ENRMFormattingStore.mm +95 -105
  218. package/ios/input/ENRMInputBlockType.h +91 -0
  219. package/ios/input/ENRMInputBlockType.mm +5 -0
  220. package/ios/input/ENRMInputDecorationDrawer.h +18 -0
  221. package/ios/input/ENRMInputEventEmitter.h +56 -0
  222. package/ios/input/ENRMInputEventEmitter.mm +308 -0
  223. package/ios/input/ENRMInputFormatter.h +29 -69
  224. package/ios/input/ENRMInputFormatter.mm +216 -124
  225. package/ios/input/ENRMInputFormatterStyle.h +99 -0
  226. package/ios/input/ENRMInputFormatterStyle.mm +188 -0
  227. package/ios/input/ENRMInputLayoutManager.h +9 -0
  228. package/ios/input/ENRMInputLayoutManager.mm +30 -0
  229. package/ios/input/ENRMInputListMarkerDrawer.h +32 -0
  230. package/ios/input/ENRMInputListMarkerDrawer.mm +426 -0
  231. package/ios/input/ENRMInputParser.h +5 -6
  232. package/ios/input/ENRMInputParser.mm +461 -178
  233. package/ios/input/ENRMInputRemend.mm +2 -2
  234. package/ios/input/ENRMInputStyleStateBuilder.h +40 -0
  235. package/ios/input/ENRMInputStyleStateBuilder.mm +60 -0
  236. package/ios/input/ENRMInputTextView.mm +103 -8
  237. package/ios/input/ENRMInputTypingAttributesController.h +42 -0
  238. package/ios/input/ENRMInputTypingAttributesController.mm +203 -0
  239. package/ios/input/ENRMLinkCoordinator.h +41 -0
  240. package/ios/input/ENRMLinkCoordinator.mm +89 -0
  241. package/ios/input/ENRMMarkdownSerializer.h +29 -5
  242. package/ios/input/ENRMMarkdownSerializer.mm +170 -48
  243. package/ios/input/ENRMMathAtom.h +26 -0
  244. package/ios/input/ENRMMathAtom.mm +12 -0
  245. package/ios/input/ENRMMentionCoordinator.h +45 -0
  246. package/ios/input/ENRMMentionCoordinator.mm +167 -0
  247. package/ios/input/ENRMRangeEditAdjustment.h +38 -0
  248. package/ios/input/ENRMRangeEditAdjustment.mm +91 -0
  249. package/ios/input/ENRMRangeStoreUtils.h +39 -0
  250. package/ios/input/EnrichedMarkdownTextInput+ContextMenu.mm +6 -6
  251. package/ios/input/EnrichedMarkdownTextInput+Internal.h +11 -3
  252. package/ios/input/EnrichedMarkdownTextInput.h +7 -1
  253. package/ios/input/EnrichedMarkdownTextInput.mm +1089 -1023
  254. package/ios/input/InputStylePropsUtils.h +109 -68
  255. package/ios/input/internals/EnrichedMarkdownTextInputShadowNode.mm +2 -1
  256. package/ios/input/styles/ENRMBlockHandler.h +46 -0
  257. package/ios/input/styles/ENRMHeadingBlockHandler.h +15 -0
  258. package/ios/input/styles/ENRMHeadingBlockHandler.mm +38 -0
  259. package/ios/input/styles/ENRMOrderedListBlockHandler.h +14 -0
  260. package/ios/input/styles/ENRMOrderedListBlockHandler.mm +48 -0
  261. package/ios/input/styles/ENRMUnorderedListBlockHandler.h +15 -0
  262. package/ios/input/styles/ENRMUnorderedListBlockHandler.mm +51 -0
  263. package/ios/internals/ENRMViewFreeMeasurement.h +331 -0
  264. package/ios/internals/EnrichedMarkdownShadowNode.h +1 -3
  265. package/ios/internals/EnrichedMarkdownShadowNode.mm +16 -20
  266. package/ios/internals/EnrichedMarkdownTextShadowNode.h +1 -3
  267. package/ios/internals/EnrichedMarkdownTextShadowNode.mm +15 -20
  268. package/ios/internals/MeasurementCache.h +41 -9
  269. package/ios/internals/ShadowMeasurementUtils.h +63 -58
  270. package/ios/math/ENRMMathChipController.h +74 -0
  271. package/ios/math/ENRMMathChipController.mm +476 -0
  272. package/ios/math/ENRMRaTeXBridge.swift +27 -6
  273. package/ios/parser/ENRMMarkdownParser.h +1 -8
  274. package/ios/parser/ENRMMarkdownParser.mm +2 -11
  275. package/ios/parser/MarkdownASTNode.h +2 -1
  276. package/ios/parser/MarkdownParserBridge.mm +4 -0
  277. package/ios/renderer/AttributedRenderer.m +20 -2
  278. package/ios/renderer/BaseRenderer.h +17 -2
  279. package/ios/renderer/BaseRenderer.m +30 -0
  280. package/ios/renderer/BlockquoteRenderer.h +1 -1
  281. package/ios/renderer/BlockquoteRenderer.m +144 -35
  282. package/ios/renderer/CodeBlockRenderer.h +1 -1
  283. package/ios/renderer/CodeBlockRenderer.m +27 -23
  284. package/ios/renderer/CodeRenderer.h +1 -1
  285. package/ios/renderer/CodeRenderer.m +3 -1
  286. package/ios/renderer/ENRMImageRenderer.h +1 -1
  287. package/ios/renderer/ENRMImageRenderer.m +5 -1
  288. package/ios/renderer/ENRMMathInlineRenderer.h +1 -1
  289. package/ios/renderer/ENRMMathInlineRenderer.m +6 -1
  290. package/ios/renderer/ENRMSpoilerRenderer.h +1 -1
  291. package/ios/renderer/ENRMSpoilerRenderer.m +3 -1
  292. package/ios/renderer/EmphasisRenderer.h +1 -1
  293. package/ios/renderer/EmphasisRenderer.m +3 -1
  294. package/ios/renderer/HeadingRenderer.h +1 -1
  295. package/ios/renderer/HeadingRenderer.m +13 -6
  296. package/ios/renderer/HighlightRenderer.h +1 -1
  297. package/ios/renderer/HighlightRenderer.m +3 -1
  298. package/ios/renderer/LinkRenderer.h +1 -1
  299. package/ios/renderer/LinkRenderer.m +50 -16
  300. package/ios/renderer/ListItemRenderer.h +13 -1
  301. package/ios/renderer/ListItemRenderer.m +102 -44
  302. package/ios/renderer/ListRenderer.h +2 -2
  303. package/ios/renderer/ListRenderer.m +63 -25
  304. package/ios/renderer/ParagraphRenderer.h +1 -1
  305. package/ios/renderer/ParagraphRenderer.m +16 -8
  306. package/ios/renderer/RenderContext.h +10 -0
  307. package/ios/renderer/RenderContext.m +44 -0
  308. package/ios/renderer/RendererFactory.m +14 -0
  309. package/ios/renderer/StrikethroughRenderer.h +1 -1
  310. package/ios/renderer/StrikethroughRenderer.m +3 -1
  311. package/ios/renderer/StrongRenderer.h +1 -1
  312. package/ios/renderer/StrongRenderer.m +3 -1
  313. package/ios/renderer/SubscriptRenderer.h +1 -1
  314. package/ios/renderer/SubscriptRenderer.m +3 -1
  315. package/ios/renderer/SuperscriptRenderer.h +1 -1
  316. package/ios/renderer/SuperscriptRenderer.m +3 -1
  317. package/ios/renderer/TextRenderer.h +2 -2
  318. package/ios/renderer/TextRenderer.m +3 -1
  319. package/ios/renderer/ThematicBreakRenderer.h +1 -1
  320. package/ios/renderer/ThematicBreakRenderer.m +3 -1
  321. package/ios/renderer/UnderlineRenderer.h +1 -1
  322. package/ios/renderer/UnderlineRenderer.m +3 -1
  323. package/ios/styles/StyleConfig.h +42 -0
  324. package/ios/styles/StyleConfig.mm +216 -0
  325. package/ios/utils/BlockquoteBorder.h +6 -0
  326. package/ios/utils/BlockquoteBorder.m +249 -52
  327. package/ios/utils/CodeBackground.m +3 -65
  328. package/ios/utils/CodeBlockBackground.m +16 -2
  329. package/ios/utils/ENRMAtomicSize.h +65 -0
  330. package/ios/utils/ENRMBlockMenu.h +66 -0
  331. package/ios/utils/ENRMChipDrawing.h +24 -0
  332. package/ios/utils/ENRMChipDrawing.m +83 -0
  333. package/ios/utils/ENRMCodeBlockContent.h +37 -0
  334. package/ios/utils/ENRMCodeBlockContent.mm +79 -0
  335. package/ios/utils/ENRMCodeBlockHighlighter.h +37 -0
  336. package/ios/utils/ENRMCodeBlockHighlighter.mm +51 -0
  337. package/ios/utils/ENRMFeatureFlags.h +7 -0
  338. package/ios/utils/ENRMImageDownloader.h +11 -1
  339. package/ios/utils/ENRMImageDownloader.m +60 -16
  340. package/ios/utils/ENRMLinkChip.h +70 -0
  341. package/ios/utils/ENRMLinkChip.m +213 -0
  342. package/ios/utils/ENRMLinkLayout.h +50 -0
  343. package/ios/utils/ENRMLinkLayout.m +45 -0
  344. package/ios/utils/ENRMLocalImageLoader.h +31 -0
  345. package/ios/utils/ENRMLocalImageLoader.m +68 -0
  346. package/ios/utils/ENRMMathFallback.h +26 -0
  347. package/ios/utils/ENRMMathFallback.m +18 -0
  348. package/ios/utils/ENRMSelectionChange.h +120 -0
  349. package/ios/utils/ENRMSelectionChange.m +282 -0
  350. package/ios/utils/ENRMTextViewSetup.h +35 -17
  351. package/ios/utils/EditMenuUtils+macOS.m +4 -1
  352. package/ios/utils/EditMenuUtils.h +35 -6
  353. package/ios/utils/EditMenuUtils.m +188 -11
  354. package/ios/utils/HTMLGenerator.m +2 -1
  355. package/ios/utils/ImageRequestHeaderUtils.h +35 -0
  356. package/ios/utils/LastElementUtils.h +1 -0
  357. package/ios/utils/ListMarkerDrawer.m +29 -42
  358. package/ios/utils/MarkdownASTSerializer.m +4 -0
  359. package/ios/utils/MarkdownAccessibilityElementBuilder.m +3 -1
  360. package/ios/utils/MarkdownExtractor.m +2 -1
  361. package/ios/utils/ParagraphStyleUtils.h +5 -0
  362. package/ios/utils/ParagraphStyleUtils.m +77 -17
  363. package/ios/utils/RTFExportUtils.m +2 -0
  364. package/ios/utils/RenderedMarkdownSegment.h +13 -1
  365. package/ios/utils/RenderedMarkdownSegment.m +20 -0
  366. package/ios/utils/SegmentRenderer.m +17 -4
  367. package/ios/utils/StreamingMarkdownFilter.h +11 -1
  368. package/ios/utils/StreamingMarkdownFilter.m +98 -2
  369. package/ios/utils/StylePropsUtils.h +110 -1
  370. package/ios/utils/TaskListTapUtils.m +24 -0
  371. package/ios/utils/TextViewLayoutManager.mm +3 -0
  372. package/ios/views/ENRMCodeBlockContainerView.h +60 -0
  373. package/ios/views/ENRMCodeBlockContainerView.m +569 -0
  374. package/ios/views/ENRMMathContainerView.h +23 -0
  375. package/ios/views/ENRMMathContainerView.m +87 -20
  376. package/ios/views/TableContainerView.h +32 -0
  377. package/ios/views/TableContainerView.m +291 -175
  378. package/jest.d.ts +1 -0
  379. package/jest.js +5 -0
  380. package/lib/module/EnrichedMarkdownNativeComponent.ts +203 -1
  381. package/lib/module/EnrichedMarkdownTextInput.js +84 -5
  382. package/lib/module/EnrichedMarkdownTextInput.js.map +1 -1
  383. package/lib/module/EnrichedMarkdownTextInputNativeComponent.ts +78 -5
  384. package/lib/module/EnrichedMarkdownTextNativeComponent.ts +204 -1
  385. package/lib/module/headingDefaults.js +34 -0
  386. package/lib/module/headingDefaults.js.map +1 -0
  387. package/lib/module/index.js.map +1 -1
  388. package/lib/module/jest/index.js +205 -0
  389. package/lib/module/jest/index.js.map +1 -0
  390. package/lib/module/native/EnrichedMarkdownText.js +199 -15
  391. package/lib/module/native/EnrichedMarkdownText.js.map +1 -1
  392. package/lib/module/normalizeMarkdownStyle.js +98 -23
  393. package/lib/module/normalizeMarkdownStyle.js.map +1 -1
  394. package/lib/module/normalizeMarkdownStyle.web.js +73 -22
  395. package/lib/module/normalizeMarkdownStyle.web.js.map +1 -1
  396. package/lib/module/normalizeMarkdownTextInputStyle.js +62 -15
  397. package/lib/module/normalizeMarkdownTextInputStyle.js.map +1 -1
  398. package/lib/module/normalizeMenuItem.js +1 -1
  399. package/lib/module/utils/textInputState.js +26 -0
  400. package/lib/module/utils/textInputState.js.map +1 -0
  401. package/lib/module/web/EnrichedMarkdownText.js +15 -8
  402. package/lib/module/web/EnrichedMarkdownText.js.map +1 -1
  403. package/lib/module/web/parseMarkdown.js +4 -3
  404. package/lib/module/web/parseMarkdown.js.map +1 -1
  405. package/lib/module/web/renderers/InlineRenderers.js +102 -3
  406. package/lib/module/web/renderers/InlineRenderers.js.map +1 -1
  407. package/lib/module/web/renderers/ListRenderers.js +7 -2
  408. package/lib/module/web/renderers/ListRenderers.js.map +1 -1
  409. package/lib/module/web/renderers/index.js +7 -4
  410. package/lib/module/web/renderers/index.js.map +1 -1
  411. package/lib/module/web/styles.js +101 -6
  412. package/lib/module/web/styles.js.map +1 -1
  413. package/lib/module/web/utils.js +14 -0
  414. package/lib/module/web/utils.js.map +1 -1
  415. package/lib/module/web/wasm/md4c.js +0 -0
  416. package/lib/module/web/wasm/md4c.js.map +1 -1
  417. package/lib/typescript/src/EnrichedMarkdownNativeComponent.d.ts +185 -2
  418. package/lib/typescript/src/EnrichedMarkdownNativeComponent.d.ts.map +1 -1
  419. package/lib/typescript/src/EnrichedMarkdownTextInput.d.ts +94 -9
  420. package/lib/typescript/src/EnrichedMarkdownTextInput.d.ts.map +1 -1
  421. package/lib/typescript/src/EnrichedMarkdownTextInputNativeComponent.d.ts +69 -5
  422. package/lib/typescript/src/EnrichedMarkdownTextInputNativeComponent.d.ts.map +1 -1
  423. package/lib/typescript/src/EnrichedMarkdownTextNativeComponent.d.ts +185 -2
  424. package/lib/typescript/src/EnrichedMarkdownTextNativeComponent.d.ts.map +1 -1
  425. package/lib/typescript/src/headingDefaults.d.ts +9 -0
  426. package/lib/typescript/src/headingDefaults.d.ts.map +1 -0
  427. package/lib/typescript/src/index.d.ts +3 -3
  428. package/lib/typescript/src/index.d.ts.map +1 -1
  429. package/lib/typescript/src/index.web.d.ts +2 -2
  430. package/lib/typescript/src/index.web.d.ts.map +1 -1
  431. package/lib/typescript/src/jest/index.d.ts +6 -0
  432. package/lib/typescript/src/jest/index.d.ts.map +1 -0
  433. package/lib/typescript/src/native/EnrichedMarkdownText.d.ts +5 -5
  434. package/lib/typescript/src/native/EnrichedMarkdownText.d.ts.map +1 -1
  435. package/lib/typescript/src/normalizeMarkdownStyle.d.ts.map +1 -1
  436. package/lib/typescript/src/normalizeMarkdownStyle.web.d.ts.map +1 -1
  437. package/lib/typescript/src/normalizeMarkdownTextInputStyle.d.ts +19 -5
  438. package/lib/typescript/src/normalizeMarkdownTextInputStyle.d.ts.map +1 -1
  439. package/lib/typescript/src/types/MarkdownStyle.d.ts +122 -5
  440. package/lib/typescript/src/types/MarkdownStyle.d.ts.map +1 -1
  441. package/lib/typescript/src/types/MarkdownStyleInternal.d.ts +39 -0
  442. package/lib/typescript/src/types/MarkdownStyleInternal.d.ts.map +1 -1
  443. package/lib/typescript/src/types/MarkdownTextProps.d.ts +207 -10
  444. package/lib/typescript/src/types/MarkdownTextProps.d.ts.map +1 -1
  445. package/lib/typescript/src/types/MarkdownTextProps.web.d.ts +60 -1
  446. package/lib/typescript/src/types/MarkdownTextProps.web.d.ts.map +1 -1
  447. package/lib/typescript/src/types/events.d.ts +85 -0
  448. package/lib/typescript/src/types/events.d.ts.map +1 -1
  449. package/lib/typescript/src/utils/textInputState.d.ts +24 -0
  450. package/lib/typescript/src/utils/textInputState.d.ts.map +1 -0
  451. package/lib/typescript/src/web/EnrichedMarkdownText.d.ts +1 -1
  452. package/lib/typescript/src/web/EnrichedMarkdownText.d.ts.map +1 -1
  453. package/lib/typescript/src/web/parseMarkdown.d.ts +1 -1
  454. package/lib/typescript/src/web/parseMarkdown.d.ts.map +1 -1
  455. package/lib/typescript/src/web/renderers/InlineRenderers.d.ts.map +1 -1
  456. package/lib/typescript/src/web/renderers/ListRenderers.d.ts.map +1 -1
  457. package/lib/typescript/src/web/renderers/index.d.ts +2 -1
  458. package/lib/typescript/src/web/renderers/index.d.ts.map +1 -1
  459. package/lib/typescript/src/web/styles.d.ts +2 -1
  460. package/lib/typescript/src/web/styles.d.ts.map +1 -1
  461. package/lib/typescript/src/web/types.d.ts +10 -2
  462. package/lib/typescript/src/web/types.d.ts.map +1 -1
  463. package/lib/typescript/src/web/utils.d.ts +4 -0
  464. package/lib/typescript/src/web/utils.d.ts.map +1 -1
  465. package/package.json +36 -9
  466. package/postinstall.mjs +131 -0
  467. package/ratex-version.json +21 -0
  468. package/src/EnrichedMarkdownNativeComponent.ts +203 -1
  469. package/src/EnrichedMarkdownTextInput.tsx +159 -8
  470. package/src/EnrichedMarkdownTextInputNativeComponent.ts +78 -5
  471. package/src/EnrichedMarkdownTextNativeComponent.ts +204 -1
  472. package/src/headingDefaults.ts +21 -0
  473. package/src/index.tsx +15 -0
  474. package/src/index.web.tsx +6 -1
  475. package/src/jest/index.tsx +236 -0
  476. package/src/native/EnrichedMarkdownText.tsx +260 -11
  477. package/src/normalizeMarkdownStyle.ts +117 -16
  478. package/src/normalizeMarkdownStyle.web.ts +76 -15
  479. package/src/normalizeMarkdownTextInputStyle.ts +110 -35
  480. package/src/normalizeMenuItem.ts +1 -1
  481. package/src/types/MarkdownStyle.ts +125 -5
  482. package/src/types/MarkdownStyleInternal.ts +51 -0
  483. package/src/types/MarkdownTextProps.ts +215 -10
  484. package/src/types/MarkdownTextProps.web.ts +62 -1
  485. package/src/types/events.ts +90 -0
  486. package/src/utils/textInputState.ts +35 -0
  487. package/src/web/EnrichedMarkdownText.tsx +26 -5
  488. package/src/web/parseMarkdown.ts +6 -2
  489. package/src/web/renderers/InlineRenderers.tsx +116 -3
  490. package/src/web/renderers/ListRenderers.tsx +14 -2
  491. package/src/web/renderers/index.tsx +6 -2
  492. package/src/web/styles.ts +114 -5
  493. package/src/web/types.ts +10 -1
  494. package/src/web/utils.ts +9 -0
  495. package/src/web/wasm/md4c.js +0 -0
  496. package/vendor-grammars.mjs +511 -0
  497. package/vendor-ratex.mjs +173 -0
  498. package/app.plugin.js +0 -2
  499. package/plugin/build/withAndroidMath.js +0 -19
  500. package/plugin/build/withIosMath.js +0 -28
  501. package/plugin/build/withReactNativeEnrichedMarkdown.js +0 -11
  502. package/plugin/src/withAndroidMath.ts +0 -24
  503. package/plugin/src/withIosMath.ts +0 -35
  504. package/plugin/src/withReactNativeEnrichedMarkdown.ts +0 -17
  505. package/plugin/tsconfig.build.json +0 -16
@@ -1,7 +1,45 @@
1
- import type { ColorValue, ViewProps, ViewStyle, TextStyle } from 'react-native';
1
+ import type { ReactNode, RefObject } from 'react';
2
+ import type { ColorValue, HostInstance, ViewProps, ViewStyle, TextStyle } from 'react-native';
2
3
  import type { MarkdownStyle, Md4cFlags } from './MarkdownStyle';
3
4
  import type { AccessibilityLabels } from './AccessibilityLabels';
4
- import type { LinkPressEvent, LinkLongPressEvent, TaskListItemPressEvent } from './events';
5
+ import type { LinkPressEvent, LinkLongPressEvent, TaskListItemPressEvent, CopyPressEvent, CopyEvent, SelectionChangeEvent } from './events';
6
+ /** Imperative handle of `EnrichedMarkdownText`, reached through its `ref`. */
7
+ export interface EnrichedMarkdownTextInstance {
8
+ /**
9
+ * Clears the text selection (and any long-pressed block) and fires
10
+ * `onSelectionChange` with `active: false`.
11
+ * @platform ios, android
12
+ */
13
+ clearSelection: () => void;
14
+ measure: HostInstance['measure'];
15
+ measureInWindow: HostInstance['measureInWindow'];
16
+ measureLayout: HostInstance['measureLayout'];
17
+ }
18
+ /**
19
+ * A rect in dp, relative to the component's content box (inside any
20
+ * `containerStyle` padding).
21
+ */
22
+ export interface LinkRect {
23
+ x: number;
24
+ y: number;
25
+ width: number;
26
+ height: number;
27
+ }
28
+ /** Layout of one rendered link, passed to `renderLinkDecoration`. */
29
+ export interface LinkDecorationInfo {
30
+ /** Position of the link in the document (0-based) — stable key for a link. */
31
+ index: number;
32
+ url: string;
33
+ /** The link's visible text. */
34
+ text: string;
35
+ /**
36
+ * Anchor rect. Native: the drawn chip (glyphs + padding) of the link's last
37
+ * line fragment. Web: the link's inline box.
38
+ */
39
+ rect: LinkRect;
40
+ /** Every line fragment of the link (several when it wraps). Web: `[rect]`. */
41
+ rects: LinkRect[];
42
+ }
5
43
  /**
6
44
  * Public context menu item. Each item includes a JS-side `onPress` callback
7
45
  * that is called when the user taps the item in the selection context menu.
@@ -52,24 +90,35 @@ export interface SelectionMenuPluralLabels {
52
90
  * Controls the built-in items added to the native text selection menu and
53
91
  * lets you localize their labels.
54
92
  *
55
- * Each item accepts an object: `{ enabled }` toggles visibility (the system
56
- * `copy` item can't be hidden — only relabeled) and `label` overrides the
57
- * English default. Wire `label` to your i18n library to match the rest of your
58
- * app's UI. Labels apply to the main text selection menu as well as the table
59
- * and math block copy menus.
93
+ * Each item accepts an object: `{ enabled }` toggles visibility and `label`
94
+ * overrides the English default. Wire `label` to your i18n library to match
95
+ * the rest of your app's UI. Items and labels apply to the main text selection
96
+ * menu as well as the table, math and code block copy menus.
97
+ *
98
+ * `copy.enabled`, `copy.format` and `systemItems` are ignored on macOS.
60
99
  *
61
100
  * @platform ios, android, macos
62
101
  */
63
102
  export interface SelectionMenuConfig {
64
103
  /**
65
- * The system "Copy" item. It can't be hidden — only its label is configurable.
66
- * @default { label: "Copy" }
104
+ * The "Copy" item.
105
+ * - `enabled`: `false` removes it from the text selection menu, the table /
106
+ * math / code block menus and the code block VoiceOver copy action.
107
+ * - `format`: `'rich'` copies rich text (plain + HTML, plus RTF on iOS) from
108
+ * text selections and the raw content from blocks; `'markdown'` copies
109
+ * Markdown as plain text everywhere the item appears (inline math becomes
110
+ * `$…$`, math blocks `$$…$$`, code blocks are fenced). The code block header
111
+ * button and VoiceOver action always copy the raw code.
112
+ * @default { enabled: true, label: "Copy", format: "rich" }
67
113
  */
68
114
  copy?: {
115
+ enabled?: boolean;
69
116
  label?: string;
117
+ format?: 'rich' | 'markdown';
70
118
  };
71
119
  /**
72
- * The built-in "Copy as Markdown" action for text selections.
120
+ * The built-in "Copy as Markdown" action, in the text selection menu and in
121
+ * the table / math / code block menus.
73
122
  * @default { enabled: true, label: "Copy as Markdown" }
74
123
  */
75
124
  copyAsMarkdown?: {
@@ -87,6 +136,25 @@ export interface SelectionMenuConfig {
87
136
  label?: string;
88
137
  pluralLabels?: SelectionMenuPluralLabels;
89
138
  };
139
+ /**
140
+ * Which system items the text selection menu keeps.
141
+ * - `'default'`: keep everything the OS adds (Select All, Look Up, Share,
142
+ * Translate, app text actions…), with Copy replaced by the built-in one.
143
+ * - `'none'`: drop every system item; the menu only holds the built-in items
144
+ * above and `contextMenuItems`.
145
+ * @default 'default'
146
+ * @platform ios, android
147
+ */
148
+ systemItems?: 'default' | 'none';
149
+ /**
150
+ * The copy button in the code block header. `false` hides the button; the
151
+ * header and language label stay.
152
+ * @default { enabled: true }
153
+ * @platform ios, android, macos
154
+ */
155
+ codeBlockCopyButton?: {
156
+ enabled?: boolean;
157
+ };
90
158
  }
91
159
  export interface StreamingConfig {
92
160
  /**
@@ -98,8 +166,25 @@ export interface StreamingConfig {
98
166
  * @platform ios, android
99
167
  */
100
168
  tableMode?: 'hidden' | 'progressive';
169
+ /**
170
+ * Controls how a fenced code block whose closing fence has not arrived yet
171
+ * is handled during streaming.
172
+ * - `'hidden'`: hide the entire code block until its closing fence arrives.
173
+ * - `'progressive'` (default): show the code as it streams in with its header
174
+ * visible but non-interactive (copying is disabled); syntax highlighting is
175
+ * deferred until the closing fence arrives, so it appears once atomically.
176
+ * Only effective when `streamingAnimation` is `true`.
177
+ * @default 'progressive'
178
+ * @platform ios, android
179
+ */
180
+ codeBlockMode?: 'hidden' | 'progressive';
101
181
  }
102
182
  export interface EnrichedMarkdownTextProps extends Omit<ViewProps, 'style'> {
183
+ /**
184
+ * Imperative handle: `clearSelection()` plus the host `measure*` methods.
185
+ * @platform ios, android
186
+ */
187
+ ref?: RefObject<EnrichedMarkdownTextInstance | null>;
103
188
  /**
104
189
  * Markdown content to render.
105
190
  * @platform ios, android, web
@@ -137,6 +222,21 @@ export interface EnrichedMarkdownTextProps extends Omit<ViewProps, 'style'> {
137
222
  * @platform ios, android, web
138
223
  */
139
224
  onLinkLongPress?: (event: LinkLongPressEvent) => void;
225
+ /**
226
+ * Renders a decoration (e.g. a badge or icon) over each link. The returned
227
+ * node is placed in an absolutely positioned box matching `info.rect` (the
228
+ * link's last line fragment, including chip padding) with
229
+ * `pointerEvents="box-none"`; position content relative to it (negative
230
+ * offsets overflow the box). Return `null` to leave a link undecorated.
231
+ *
232
+ * Native caveats: rects arrive from native after layout, so decorations
233
+ * appear one frame after the text; links inside tables (`flavor="github"`)
234
+ * are not reported; content overflowing the component bounds does not
235
+ * receive touches on Android. Toggling this prop between set and unset
236
+ * remounts the native view.
237
+ * @platform ios, android, web
238
+ */
239
+ renderLinkDecoration?: (info: LinkDecorationInfo) => ReactNode | null;
140
240
  /**
141
241
  * Callback fired when a task list checkbox is tapped.
142
242
  *
@@ -148,6 +248,61 @@ export interface EnrichedMarkdownTextProps extends Omit<ViewProps, 'style'> {
148
248
  * @platform ios, android, web
149
249
  */
150
250
  onTaskListItemPress?: (event: TaskListItemPressEvent) => void;
251
+ /**
252
+ * Controls whether tapping a task list checkbox toggles its checked state.
253
+ *
254
+ * When `true` (default), tapping the checkbox toggles it and fires
255
+ * `onTaskListItemPress`. When `false`, the checkbox renders its markdown
256
+ * state read-only: the tap is fully inert — no visual toggle and no
257
+ * `onTaskListItemPress` emission. Text selection and links in the same row
258
+ * are unaffected.
259
+ *
260
+ * @default true
261
+ * @platform ios, android, web
262
+ */
263
+ enableTaskListItemToggle?: boolean;
264
+ /**
265
+ * Callback fired when code is copied from a fenced code block, via the header
266
+ * copy button, the long-press context-menu "Copy" action, or the VoiceOver
267
+ * copy action. Receives the copied code and its language. Does not fire for
268
+ * "Copy as Markdown", nor for the context-menu "Copy" when
269
+ * `selectionMenuConfig.copy.format` is `'markdown'`.
270
+ *
271
+ * Only fires when `flavor="github"` (the copy button is part of the GitHub
272
+ * flavor's container-based code block renderer).
273
+ * @platform ios, android, macos
274
+ */
275
+ onCopyPress?: (event: CopyPressEvent) => void;
276
+ /**
277
+ * Takes over the "Copy" item of the text selection menu and of the table /
278
+ * math / code block menus. When set, native does **not** write the
279
+ * clipboard: it calls this with the copied content and the handler writes
280
+ * whatever it wants (e.g. with `expo-clipboard`). Overrides
281
+ * `selectionMenuConfig.copy.format`; `copy.enabled: false` still hides the
282
+ * item. "Copy as Markdown", the code block header button and the VoiceOver
283
+ * copy action are unaffected, and `onCopyPress` does not fire for an
284
+ * intercepted Copy.
285
+ * @platform ios, android
286
+ */
287
+ onCopy?: (event: CopyEvent) => void;
288
+ /**
289
+ * Reports the text selection so the app can draw its own menu (pair it with
290
+ * `contextMenuHidden`). Fires at most once per frame while the selection
291
+ * changes, and with `active: false` once it is gone. With
292
+ * `contextMenuHidden`, a long press on a table / math / code block fires it
293
+ * too (`source` is the block kind, `whole: true`), since those blocks have no
294
+ * text selection of their own. Only one part of a component holds a
295
+ * selection at a time; clearing the selection of *other* components is up to
296
+ * the app (`ref.current.clearSelection()`).
297
+ *
298
+ * Rects are relative to the view that `ref.current.measureInWindow`
299
+ * measures — add that origin to position UI on screen. On iOS, `adjusting`
300
+ * is `true` while a selection handle is dragged: hide the menu until it is
301
+ * `false` again. Android reports every step of the drag instead (with
302
+ * `adjusting: false`), so debounce before showing a menu there.
303
+ * @platform ios, android
304
+ */
305
+ onSelectionChange?: (event: SelectionChangeEvent) => void;
151
306
  /**
152
307
  * Controls whether the system link preview is shown on long press (iOS only).
153
308
  *
@@ -161,6 +316,16 @@ export interface EnrichedMarkdownTextProps extends Omit<ViewProps, 'style'> {
161
316
  * @platform ios
162
317
  */
163
318
  enableLinkPreview?: boolean;
319
+ /**
320
+ * When `true`, long-pressing a link selects its label and shows the
321
+ * selection edit menu, like a manual text selection, instead of the system
322
+ * link preview. Takes precedence over `enableLinkPreview` and
323
+ * `onLinkLongPress`.
324
+ *
325
+ * @default false
326
+ * @platform ios
327
+ */
328
+ linkLongPressSelects?: boolean;
164
329
  /**
165
330
  * Controls text selection.
166
331
  * - iOS: Controls text selection and link previews on long press.
@@ -253,6 +418,38 @@ export interface EnrichedMarkdownTextProps extends Omit<ViewProps, 'style'> {
253
418
  * @platform ios, android
254
419
  */
255
420
  contextMenuItems?: ContextMenuItem[];
421
+ /**
422
+ * HTTP headers to attach to remote image requests, e.g. a `Referer`
423
+ * required by CDN hotlink protection or an `Authorization` token.
424
+ *
425
+ * Headers participate in image cache identity, so the same URL requested
426
+ * with different headers is fetched and cached separately.
427
+ *
428
+ * Not supported on web — browsers don't allow custom headers on `<img>`
429
+ * requests.
430
+ * @platform ios, android
431
+ */
432
+ imageRequestHeaders?: Record<string, string>;
433
+ /**
434
+ * Hides the text selection context menu. Text stays selectable (and stays
435
+ * reachable by TalkBack / VoiceOver) — only the menu is suppressed. Use
436
+ * `selectable={false}` instead if you want to disable selection itself.
437
+ *
438
+ * This hides the whole menu, including the custom items from
439
+ * `contextMenuItems` and the built-in items from `selectionMenuConfig`,
440
+ * since they all share one menu. It also covers the copy menus on table,
441
+ * math and code blocks.
442
+ *
443
+ * It does not suppress the system "Save to Camera Roll / Copy" sheet that
444
+ * UIKit shows when long-pressing an image.
445
+ *
446
+ * On Android no selection toolbar is created at all, so ROMs that draw
447
+ * their own (MIUI) stay hidden too. A selection made while this is on
448
+ * keeps no menu if it is turned off mid-selection; the next one gets it.
449
+ * @default false
450
+ * @platform ios, android, macos
451
+ */
452
+ contextMenuHidden?: boolean;
256
453
  /**
257
454
  * Controls the built-in items added to the native text selection menu and
258
455
  * lets you localize their labels. Custom app-provided actions are controlled
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownTextProps.d.ts","sourceRoot":"","sources":["../../../../src/types/MarkdownTextProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,KAAK,EAAE;QACf,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC;KAC3C,KAAK,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CA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E;;;;;;;;;;;;;OAaG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,cAAc,CAAC;CAC5D"}
@@ -1,6 +1,31 @@
1
- import type { CSSProperties, HTMLAttributes } from 'react';
1
+ import type { CSSProperties, HTMLAttributes, ReactNode } from 'react';
2
2
  import type { MarkdownStyle, Md4cFlags } from './MarkdownStyle';
3
3
  import type { LinkPressEvent, LinkLongPressEvent, TaskListItemPressEvent } from './events';
4
+ /**
5
+ * A rect in dp, relative to the component's content box (inside any
6
+ * `containerStyle` padding).
7
+ */
8
+ export interface LinkRect {
9
+ x: number;
10
+ y: number;
11
+ width: number;
12
+ height: number;
13
+ }
14
+ /** Layout of one rendered link, passed to `renderLinkDecoration`. */
15
+ export interface LinkDecorationInfo {
16
+ /** Position of the link in the document (0-based) — stable key for a link. */
17
+ index: number;
18
+ url: string;
19
+ /** The link's visible text. */
20
+ text: string;
21
+ /**
22
+ * Anchor rect. Native: the drawn chip (glyphs + padding) of the link's last
23
+ * line fragment. Web: the link's inline box.
24
+ */
25
+ rect: LinkRect;
26
+ /** Every line fragment of the link (several when it wraps). Web: `[rect]`. */
27
+ rects: LinkRect[];
28
+ }
4
29
  export interface EnrichedMarkdownTextProps extends Omit<HTMLAttributes<HTMLDivElement>, 'style' | 'dir'> {
5
30
  /**
6
31
  * Markdown content to render.
@@ -39,6 +64,21 @@ export interface EnrichedMarkdownTextProps extends Omit<HTMLAttributes<HTMLDivEl
39
64
  * @platform ios, android, web
40
65
  */
41
66
  onLinkLongPress?: (event: LinkLongPressEvent) => void;
67
+ /**
68
+ * Renders a decoration (e.g. a badge or icon) over each link. The returned
69
+ * node is placed in an absolutely positioned box matching `info.rect` (the
70
+ * link's last line fragment, including chip padding) with
71
+ * `pointerEvents="box-none"`; position content relative to it (negative
72
+ * offsets overflow the box). Return `null` to leave a link undecorated.
73
+ *
74
+ * Native caveats: rects arrive from native after layout, so decorations
75
+ * appear one frame after the text; links inside tables (`flavor="github"`)
76
+ * are not reported; content overflowing the component bounds does not
77
+ * receive touches on Android. Toggling this prop between set and unset
78
+ * remounts the native view.
79
+ * @platform ios, android, web
80
+ */
81
+ renderLinkDecoration?: (info: LinkDecorationInfo) => ReactNode | null;
42
82
  /**
43
83
  * Callback fired when a task list checkbox is tapped.
44
84
  *
@@ -50,6 +90,25 @@ export interface EnrichedMarkdownTextProps extends Omit<HTMLAttributes<HTMLDivEl
50
90
  * @platform ios, android, web
51
91
  */
52
92
  onTaskListItemPress?: (event: TaskListItemPressEvent) => void;
93
+ /**
94
+ * Controls whether tapping a task list checkbox toggles its checked state.
95
+ *
96
+ * When `true` (default), tapping the checkbox toggles it and fires
97
+ * `onTaskListItemPress`. When `false`, the checkbox renders its markdown
98
+ * state read-only: the tap is fully inert — no visual toggle and no
99
+ * `onTaskListItemPress` emission. Text selection and links in the same row
100
+ * are unaffected.
101
+ *
102
+ * On web the checkbox keeps its normal appearance and is marked
103
+ * `readOnly` / `aria-disabled` rather than `disabled`, so it stays visually
104
+ * consistent with iOS and Android. It is also made pointer-inert
105
+ * (`pointer-events: none`) so the browser cannot paint hover or active
106
+ * states on a checkbox that cannot be toggled.
107
+ *
108
+ * @default true
109
+ * @platform ios, android, web
110
+ */
111
+ enableTaskListItemToggle?: boolean;
53
112
  /**
54
113
  * Controls text selection.
55
114
  * - iOS: Controls text selection and link previews on long press.
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownTextProps.web.d.ts","sourceRoot":"","sources":["../../../../src/types/MarkdownTextProps.web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CACrD,cAAc,CAAC,cAAc,CAAC,EAC9B,OAAO,GAAG,KAAK,CAChB;IACC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACtD;;;;;;;;;OASG;IACH,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC9D;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;CAC9B"}
1
+ {"version":3,"file":"MarkdownTextProps.web.d.ts","sourceRoot":"","sources":["../../../../src/types/MarkdownTextProps.web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB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CAC9B"}
@@ -9,6 +9,76 @@ export interface TaskListItemPressEvent {
9
9
  checked: boolean;
10
10
  text: string;
11
11
  }
12
+ export interface CopyPressEvent {
13
+ code: string;
14
+ language: string;
15
+ }
16
+ /**
17
+ * Payload of `onCopy`: what the Copy item would have copied. With `onCopy`
18
+ * set, native writes nothing to the clipboard — the handler owns the write.
19
+ */
20
+ export interface CopyEvent {
21
+ /** Which menu the Copy item belongs to. */
22
+ source: 'selection' | 'math' | 'table' | 'code';
23
+ /**
24
+ * Markdown of the copied content — what `copy.format: 'markdown'` writes.
25
+ * Text selections: the original source when `whole`, otherwise rebuilt from
26
+ * the rendered styles (falls back to `text`). Blocks: `$$…$$`, the table as
27
+ * Markdown, or the fenced code block.
28
+ */
29
+ markdown: string;
30
+ /** Rendered text of the selection, or the block's raw content. */
31
+ text: string;
32
+ /**
33
+ * `true` when the selection covers the whole component, so `markdown` is the
34
+ * original source. Always `true` for blocks.
35
+ */
36
+ whole: boolean;
37
+ }
38
+ /**
39
+ * A rect in dp, relative to the component's native view: add the origin from
40
+ * the component ref's `measureInWindow` to get window coordinates.
41
+ */
42
+ export interface SelectionRect {
43
+ x: number;
44
+ y: number;
45
+ width: number;
46
+ height: number;
47
+ }
48
+ /**
49
+ * Payload of `onSelectionChange`: the current text selection, or a table /
50
+ * math / code block long-pressed while `contextMenuHidden` is on. Content
51
+ * fields carry what `onCopy` would receive for the same selection.
52
+ */
53
+ export interface SelectionChangeEvent {
54
+ /** `false` once the selection is gone; every other field is then empty / zero. */
55
+ active: boolean;
56
+ /** `'selection'` for text; the block kind for a long-pressed block. */
57
+ source: CopyEvent['source'];
58
+ /** Rendered text of the selection, or the block's raw content. */
59
+ text: string;
60
+ /** Same as `CopyEvent.markdown` for this selection. */
61
+ markdown: string;
62
+ /** Same as `CopyEvent.whole`. Always `true` for blocks. */
63
+ whole: boolean;
64
+ /**
65
+ * Bounding box of the selection (full content width when it spans several
66
+ * lines); the block's frame for blocks.
67
+ */
68
+ rect: SelectionRect;
69
+ /** Selected part of the first line (block: same as `rect`). */
70
+ startRect: SelectionRect;
71
+ /** Selected part of the last line (block: same as `rect`). */
72
+ endRect: SelectionRect;
73
+ /**
74
+ * `true` while a selection handle is dragged (or the loupe is held), with the
75
+ * selection as it was when the drag began; `false` again, with the new
76
+ * selection, once the finger lifts. Hide your menu while it is `true`.
77
+ * Always `false` on Android, which reports the selection continuously
78
+ * during the drag.
79
+ */
80
+ adjusting: boolean;
81
+ }
12
82
  /**
13
83
  * Native-level context menu item config sent to the native component.
14
84
  * Does not include the `onPress` callback — callbacks are managed on the JS side.
@@ -26,4 +96,19 @@ export interface OnContextMenuItemPressEvent {
26
96
  selectionStart: number;
27
97
  selectionEnd: number;
28
98
  }
99
+ /**
100
+ * Event payload fired by the native component when the user pastes while
101
+ * `interceptPaste` is on. Native does not touch the buffer — it only reports
102
+ * what the clipboard held. The handler must call `resolvePaste` exactly once,
103
+ * or the paste is dropped.
104
+ */
105
+ export interface OnPasteEvent {
106
+ /** Plain text from the clipboard, verbatim, before the text view sees it. */
107
+ text: string;
108
+ /**
109
+ * Markdown flavor, set only when the copy source was an input of this
110
+ * component. iOS-only; Android always reports `''`.
111
+ */
112
+ markdown: string;
113
+ }
29
114
  //# sourceMappingURL=events.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/types/events.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;A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,KAAK,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,IAAI,EAAE,aAAa,CAAC;IACpB,+DAA+D;IAC/D,SAAS,EAAE,aAAa,CAAC;IACzB,8DAA8D;IAC9D,OAAO,EAAE,aAAa,CAAC;IACvB;;;;;;OAMG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Bridges EnrichedMarkdownTextInput into React Native's TextInputState focus
3
+ * registry so it participates in RN's keyboard-dismiss behavior (issue #577).
4
+ *
5
+ * Registering a non-TextInput host component is safe: TextInputState's
6
+ * blurTextInput dispatches the built-in TextInput's "blur" command at the
7
+ * registered instance, and Fabric command dispatch is name-based — it works
8
+ * as long as the component ships a command with that name, which ours does.
9
+ *
10
+ * A deep import is required because the public TextInput.State API lacks the
11
+ * registerInput/focusInput/blurInput bookkeeping functions.
12
+ */
13
+ import type { HostInstance } from 'react-native';
14
+ interface TextInputStateModule {
15
+ registerInput(input: HostInstance): void;
16
+ unregisterInput(input: HostInstance): void;
17
+ focusInput(input: HostInstance | null): void;
18
+ blurInput(input: HostInstance | null): void;
19
+ blurTextInput(input: HostInstance | null): void;
20
+ currentlyFocusedInput(): HostInstance | null;
21
+ }
22
+ export declare const TextInputState: TextInputStateModule;
23
+ export {};
24
+ //# sourceMappingURL=textInputState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textInputState.d.ts","sourceRoot":"","sources":["../../../../src/utils/textInputState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,UAAU,oBAAoB;IAC5B,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACzC,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3C,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;IAC7C,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;IAC5C,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;IAChD,qBAAqB,IAAI,YAAY,GAAG,IAAI,CAAC;CAC9C;AAYD,eAAO,MAAM,cAAc,EACI,oBAAoB,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import type { EnrichedMarkdownTextProps } from '../types/MarkdownTextProps.web';
2
- export declare const EnrichedMarkdownText: ({ markdown, markdownStyle, md4cFlags, onLinkPress, onLinkLongPress, onTaskListItemPress, allowTrailingMargin, containerStyle, selectable, dir, selectionColor, ...rest }: EnrichedMarkdownTextProps) => import("react/jsx-runtime").JSX.Element | null;
2
+ export declare const EnrichedMarkdownText: ({ markdown, markdownStyle, md4cFlags, onLinkPress, onLinkLongPress, onTaskListItemPress, enableTaskListItemToggle, allowTrailingMargin, containerStyle, selectable, dir, selectionColor, renderLinkDecoration, ...rest }: EnrichedMarkdownTextProps) => import("react/jsx-runtime").JSX.Element | null;
3
3
  export default EnrichedMarkdownText;
4
4
  //# sourceMappingURL=EnrichedMarkdownText.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EnrichedMarkdownText.d.ts","sourceRoot":"","sources":["../../../../src/web/EnrichedMarkdownText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAehF,eAAO,MAAM,oBAAoB,GAAI,0KAalC,yBAAyB,mDA0H3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"EnrichedMarkdownText.d.ts","sourceRoot":"","sources":["../../../../src/web/EnrichedMarkdownText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAehF,eAAO,MAAM,oBAAoB,GAAI,0NAelC,yBAAyB,mDA6I3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import type { ASTNode } from './types';
2
2
  import type { Md4cFlags } from '../types/MarkdownStyle';
3
- export declare function parseMarkdown(markdown: string, { underline, latexMath, superscript, subscript, highlight, }?: Md4cFlags): Promise<ASTNode>;
3
+ export declare function parseMarkdown(markdown: string, { underline, latexMath, superscript, subscript, highlight, hardSoftBreaks, }?: Md4cFlags): Promise<ASTNode>;
4
4
  //# sourceMappingURL=parseMarkdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parseMarkdown.d.ts","sourceRoot":"","sources":["../../../../src/web/parseMarkdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAgDxD,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,EACE,SAAiB,EACjB,SAAgB,EAChB,WAAmB,EACnB,SAAiB,EACjB,SAAiB,GAClB,GAAE,SAAc,GAChB,OAAO,CAAC,OAAO,CAAC,CAmBlB"}
1
+ {"version":3,"file":"parseMarkdown.d.ts","sourceRoot":"","sources":["../../../../src/web/parseMarkdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAkDxD,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,EACE,SAAiB,EACjB,SAAgB,EAChB,WAAmB,EACnB,SAAiB,EACjB,SAAiB,EACjB,cAAsB,GACvB,GAAE,SAAc,GAChB,OAAO,CAAC,OAAO,CAAC,CAoBlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"InlineRenderers.d.ts","sourceRoot":"","sources":["../../../../../src/web/renderers/InlineRenderers.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,WAAW,EAAE,MAAM,UAAU,CAAC;AA0G3D,eAAO,MAAM,eAAe,EAAE,WAa7B,CAAC"}
1
+ {"version":3,"file":"InlineRenderers.d.ts","sourceRoot":"","sources":["../../../../../src/web/renderers/InlineRenderers.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAiB,WAAW,EAAE,MAAM,UAAU,CAAC;AAmN3D,eAAO,MAAM,eAAe,EAAE,WAc7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ListRenderers.d.ts","sourceRoot":"","sources":["../../../../../src/web/renderers/ListRenderers.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,WAAW,EAAqB,MAAM,UAAU,CAAC;AAuG9E,eAAO,MAAM,aAAa,EAAE,WAI3B,CAAC"}
1
+ {"version":3,"file":"ListRenderers.d.ts","sourceRoot":"","sources":["../../../../../src/web/renderers/ListRenderers.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,WAAW,EAAqB,MAAM,UAAU,CAAC;AAmH9E,eAAO,MAAM,aAAa,EAAE,WAI3B,CAAC"}
@@ -9,6 +9,7 @@ export interface RenderNodeProps {
9
9
  callbacks: RendererCallbacks;
10
10
  capabilities: RenderCapabilities;
11
11
  parentType?: NodeType;
12
+ index?: number;
12
13
  }
13
- export declare function RenderNode({ node, style, styles, callbacks, capabilities, parentType, }: RenderNodeProps): ReactNode;
14
+ export declare function RenderNode({ node, style, styles, callbacks, capabilities, parentType, index, }: RenderNodeProps): ReactNode;
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/web/renderers/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,OAAO,EACP,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAEnB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAqBxC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,qBAAqB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,iBAAiB,CAAC;IAC7B,YAAY,EAAE,kBAAkB,CAAC;IACjC,UAAU,CAAC,EAAE,QAAQ,CAAC;CACvB;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,KAAK,EACL,MAAM,EACN,SAAS,EACT,YAAY,EACZ,UAAU,GACX,EAAE,eAAe,GAAG,SAAS,CA4B7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/web/renderers/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,OAAO,EACP,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAEnB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAqBxC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,qBAAqB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,iBAAiB,CAAC;IAC7B,YAAY,EAAE,kBAAkB,CAAC;IACjC,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,KAAK,EACL,MAAM,EACN,SAAS,EACT,YAAY,EACZ,UAAU,EACV,KAAK,GACN,EAAE,eAAe,GAAG,SAAS,CA8B7B"}
@@ -4,7 +4,7 @@ export declare function zeroTrailingMargins(style: MarkdownStyleInternal): Markd
4
4
  type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
5
5
  export declare function toHeadingLevel(level: string): HeadingLevel;
6
6
  export declare function linkStyleForUrl(style: MarkdownStyleInternal, url: string): CSSProperties;
7
- export declare function listItemStyle(isTask: boolean): CSSProperties | undefined;
7
+ export declare function listItemStyle(style: MarkdownStyleInternal, isTask: boolean, isFirstChild: boolean): CSSProperties | undefined;
8
8
  export declare function checkedTaskTextStyle(style: MarkdownStyleInternal): CSSProperties;
9
9
  export declare function tableBodyRowStyle(style: MarkdownStyleInternal, rowIndex: number): CSSProperties;
10
10
  export declare const parseErrorFallbackStyle: CSSProperties;
@@ -42,6 +42,7 @@ export interface Styles {
42
42
  tableHeaderCell: Record<ColumnAlign, CSSProperties>;
43
43
  tableCell: Record<ColumnAlign, CSSProperties>;
44
44
  taskCheckbox: CSSProperties;
45
+ taskCheckboxDisabled: CSSProperties;
45
46
  }
46
47
  type ColumnAlign = 'left' | 'center' | 'right' | 'default';
47
48
  export declare function buildStyles(style: MarkdownStyleInternal): Styles;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/web/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAEV,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;A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