react-native-enriched-markdown-scaffold 0.6.0-scaffold.8 → 0.7.4-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 (213) hide show
  1. package/ReactNativeEnrichedMarkdown.podspec +62 -11
  2. package/android/build.gradle +5 -0
  3. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownManagerDelegate.java +3 -0
  4. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownManagerInterface.java +1 -0
  5. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownTextInputManagerDelegate.java +12 -0
  6. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownTextInputManagerInterface.java +4 -0
  7. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownTextManagerDelegate.java +3 -0
  8. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownTextManagerInterface.java +1 -0
  9. package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/Props.cpp +25 -0
  10. package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/Props.h +793 -0
  11. package/android/src/main/baseline-prof.txt +75 -2
  12. package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdown.kt +62 -0
  13. package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownInternalText.kt +10 -2
  14. package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownManager.kt +10 -0
  15. package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownText.kt +9 -2
  16. package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownTextManager.kt +10 -0
  17. package/android/src/main/java/com/swmansion/enriched/markdown/MeasurementStore.kt +6 -4
  18. package/android/src/main/java/com/swmansion/enriched/markdown/accessibility/AccessibilityLabels.kt +15 -0
  19. package/android/src/main/java/com/swmansion/enriched/markdown/accessibility/MarkdownAccessibilityHelper.kt +44 -7
  20. package/android/src/main/java/com/swmansion/enriched/markdown/input/EnrichedMarkdownTextInputManager.kt +72 -0
  21. package/android/src/main/java/com/swmansion/enriched/markdown/input/EnrichedMarkdownTextInputView.kt +110 -12
  22. package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/BlockSyntaxSentinel.kt +69 -0
  23. package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/FormattingStore.kt +19 -0
  24. package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/InputParser.kt +84 -6
  25. package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/InputRemend.kt +1 -0
  26. package/android/src/main/java/com/swmansion/enriched/markdown/input/layout/InputLayoutManager.kt +30 -2
  27. package/android/src/main/java/com/swmansion/enriched/markdown/input/layout/InputMeasurementStore.kt +13 -2
  28. package/android/src/main/java/com/swmansion/enriched/markdown/input/model/MathChipStyle.kt +3 -0
  29. package/android/src/main/java/com/swmansion/enriched/markdown/input/toolbar/InputContextMenu.kt +54 -13
  30. package/android/src/main/java/com/swmansion/enriched/markdown/parser/MarkdownASTNode.kt +17 -0
  31. package/android/src/main/java/com/swmansion/enriched/markdown/renderer/HeadingRenderer.kt +1 -0
  32. package/android/src/main/java/com/swmansion/enriched/markdown/renderer/SpanStyleCache.kt +4 -4
  33. package/android/src/main/java/com/swmansion/enriched/markdown/spans/HeadingSpan.kt +8 -1
  34. package/android/src/main/java/com/swmansion/enriched/markdown/spans/LineHeightSpan.kt +27 -1
  35. package/android/src/main/java/com/swmansion/enriched/markdown/styles/InlineMathStyle.kt +5 -1
  36. package/android/src/main/java/com/swmansion/enriched/markdown/styles/MathFontWeight.kt +25 -0
  37. package/android/src/main/java/com/swmansion/enriched/markdown/styles/MathStyle.kt +12 -1
  38. package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/MarkdownViewManagerUtils.kt +37 -7
  39. package/android/src/main/java/com/swmansion/enriched/markdown/utils/input/MarkdownStyleParser.kt +10 -0
  40. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/extensions/SpannableExtensions.kt +12 -4
  41. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/view/LinkEvents.kt +22 -0
  42. package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/view/SelectionActionMode.kt +36 -7
  43. package/android/src/main/java/com/swmansion/enriched/markdown/views/TableContainerView.kt +74 -4
  44. package/android/src/main/jni/CMakeLists.txt +15 -1
  45. package/android/src/math/java/com/swmansion/enriched/markdown/renderer/MathInlineRenderer.kt +2 -0
  46. package/android/src/math/java/com/swmansion/enriched/markdown/spans/MathChipSpan.kt +1 -1
  47. package/android/src/math/java/com/swmansion/enriched/markdown/spans/MathInlinePlaceholderSpan.kt +7 -3
  48. package/android/src/math/java/com/swmansion/enriched/markdown/spans/MathInlineSpan.kt +8 -5
  49. package/android/src/math/java/com/swmansion/enriched/markdown/spans/MathTypeface.kt +30 -0
  50. package/android/src/math/java/com/swmansion/enriched/markdown/views/MathContainerView.kt +27 -3
  51. package/app.plugin.js +2 -1
  52. package/cpp/parser/MD4CParser.cpp +1 -1
  53. package/cpp/wasm/build.sh +9 -9
  54. package/docs/ACCESSIBILITY.md +172 -0
  55. package/docs/API_REFERENCE.md +957 -0
  56. package/docs/COPY_OPTIONS.md +127 -0
  57. package/docs/ELEMENTS_STRUCTURE.md +112 -0
  58. package/docs/IMAGE_CACHING.md +25 -0
  59. package/docs/INPUT.md +281 -0
  60. package/docs/LATEX_MATH.md +198 -0
  61. package/docs/MACOS.md +19 -0
  62. package/docs/MARKDOWN_STREAMING.md +36 -0
  63. package/docs/MENTIONS.md +97 -0
  64. package/docs/RTL.md +82 -0
  65. package/docs/STYLES.md +522 -0
  66. package/docs/TEXT.md +110 -0
  67. package/docs/WEB.md +49 -0
  68. package/ios/EnrichedMarkdown.mm +126 -37
  69. package/ios/EnrichedMarkdownText.mm +84 -16
  70. package/ios/attachments/ENRMMathInlineAttachment+macOS.m +5 -1
  71. package/ios/attachments/ENRMMathInlineAttachment.h +3 -0
  72. package/ios/attachments/ENRMMathInlineAttachment.m +2 -1
  73. package/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/Props.cpp +25 -0
  74. package/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/Props.h +793 -0
  75. package/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/RCTComponentViewHelpers.h +15 -0
  76. package/ios/input/ENRMBlockSyntaxSentinel.h +25 -0
  77. package/ios/input/ENRMBlockSyntaxSentinel.mm +80 -0
  78. package/ios/input/ENRMFormattingStore.h +5 -0
  79. package/ios/input/ENRMFormattingStore.mm +34 -0
  80. package/ios/input/ENRMInputFormatter.h +4 -0
  81. package/ios/input/ENRMInputFormatter.mm +2 -0
  82. package/ios/input/ENRMInputParser.h +5 -0
  83. package/ios/input/ENRMInputParser.mm +79 -6
  84. package/ios/input/ENRMInputTextView.h +2 -0
  85. package/ios/input/ENRMInputTextView.mm +8 -17
  86. package/ios/input/ENRMMarkdownSerializer.mm +1 -1
  87. package/ios/input/EnrichedMarkdownTextInput+ContextMenu.mm +71 -53
  88. package/ios/input/EnrichedMarkdownTextInput+Internal.h +26 -0
  89. package/ios/input/EnrichedMarkdownTextInput.h +1 -0
  90. package/ios/input/EnrichedMarkdownTextInput.mm +249 -31
  91. package/ios/input/InputStylePropsUtils.h +13 -0
  92. package/ios/input/styles/ENRMBoldStyleHandler.mm +3 -2
  93. package/ios/input/styles/ENRMItalicStyleHandler.mm +3 -2
  94. package/ios/internals/MeasurementCache.h +1 -0
  95. package/ios/math/ENRMRaTeXBridge.swift +52 -3
  96. package/ios/parser/ENRMMarkdownParser.h +8 -0
  97. package/ios/parser/ENRMMarkdownParser.mm +11 -0
  98. package/ios/renderer/AttributedRenderer.m +51 -6
  99. package/ios/renderer/ENRMMathInlineRenderer.m +8 -1
  100. package/ios/renderer/ListItemRenderer.m +8 -5
  101. package/ios/styles/ENRMFontSlot.h +1 -1
  102. package/ios/styles/StyleConfig.h +6 -0
  103. package/ios/styles/StyleConfig.mm +36 -0
  104. package/ios/utils/ENRMAccessibilityLabels.h +36 -0
  105. package/ios/utils/ENRMAccessibilityLabels.m +5 -0
  106. package/ios/utils/ENRMMathFontWeight.h +18 -0
  107. package/ios/utils/EditMenuUtils+macOS.m +4 -5
  108. package/ios/utils/EditMenuUtils.h +70 -0
  109. package/ios/utils/EditMenuUtils.m +14 -11
  110. package/ios/utils/LastElementUtils.h +39 -2
  111. package/ios/utils/MarkdownAccessibilityElementBuilder.h +18 -16
  112. package/ios/utils/MarkdownAccessibilityElementBuilder.m +64 -32
  113. package/ios/utils/ParagraphStyleUtils.m +21 -2
  114. package/ios/utils/StylePropsUtils.h +21 -0
  115. package/ios/views/ENRMMathContainerView.h +8 -0
  116. package/ios/views/ENRMMathContainerView.m +10 -6
  117. package/ios/views/ENRMTableIOSGridView.h +40 -0
  118. package/ios/views/ENRMTableIOSGridView.m +216 -0
  119. package/ios/views/EnrichedMarkdownInternalText.h +2 -0
  120. package/ios/views/EnrichedMarkdownInternalText.m +2 -0
  121. package/ios/views/TableContainerView.h +8 -0
  122. package/ios/views/TableContainerView.m +72 -128
  123. package/lib/module/EnrichedMarkdownNativeComponent.ts +40 -0
  124. package/lib/module/EnrichedMarkdownTextInput.js +50 -1
  125. package/lib/module/EnrichedMarkdownTextInput.js.map +1 -1
  126. package/lib/module/EnrichedMarkdownTextInputNativeComponent.ts +47 -0
  127. package/lib/module/EnrichedMarkdownTextNativeComponent.ts +40 -0
  128. package/lib/module/accessibilityLabelDefaults.js +64 -0
  129. package/lib/module/accessibilityLabelDefaults.js.map +1 -0
  130. package/lib/module/index.js +1 -0
  131. package/lib/module/index.js.map +1 -1
  132. package/lib/module/native/EnrichedMarkdownText.js +72 -4
  133. package/lib/module/native/EnrichedMarkdownText.js.map +1 -1
  134. package/lib/module/normalizeMarkdownStyle.js +5 -2
  135. package/lib/module/normalizeMarkdownStyle.js.map +1 -1
  136. package/lib/module/normalizeMarkdownStyle.web.js +5 -2
  137. package/lib/module/normalizeMarkdownStyle.web.js.map +1 -1
  138. package/lib/module/normalizeMarkdownTextInputStyle.js +7 -3
  139. package/lib/module/normalizeMarkdownTextInputStyle.js.map +1 -1
  140. package/lib/module/normalizeMenuItem.js +38 -0
  141. package/lib/module/normalizeMenuItem.js.map +1 -0
  142. package/lib/module/types/AccessibilityLabels.js +2 -0
  143. package/lib/module/types/AccessibilityLabels.js.map +1 -0
  144. package/lib/module/web/globalStyles.js +8 -1
  145. package/lib/module/web/globalStyles.js.map +1 -1
  146. package/lib/module/web/styles.js +3 -1
  147. package/lib/module/web/styles.js.map +1 -1
  148. package/lib/typescript/src/EnrichedMarkdownNativeComponent.d.ts +37 -0
  149. package/lib/typescript/src/EnrichedMarkdownNativeComponent.d.ts.map +1 -1
  150. package/lib/typescript/src/EnrichedMarkdownTextInput.d.ts +57 -1
  151. package/lib/typescript/src/EnrichedMarkdownTextInput.d.ts.map +1 -1
  152. package/lib/typescript/src/EnrichedMarkdownTextInputNativeComponent.d.ts +42 -0
  153. package/lib/typescript/src/EnrichedMarkdownTextInputNativeComponent.d.ts.map +1 -1
  154. package/lib/typescript/src/EnrichedMarkdownTextNativeComponent.d.ts +37 -0
  155. package/lib/typescript/src/EnrichedMarkdownTextNativeComponent.d.ts.map +1 -1
  156. package/lib/typescript/src/accessibilityLabelDefaults.d.ts +16 -0
  157. package/lib/typescript/src/accessibilityLabelDefaults.d.ts.map +1 -0
  158. package/lib/typescript/src/index.d.ts +4 -2
  159. package/lib/typescript/src/index.d.ts.map +1 -1
  160. package/lib/typescript/src/native/EnrichedMarkdownText.d.ts +3 -3
  161. package/lib/typescript/src/native/EnrichedMarkdownText.d.ts.map +1 -1
  162. package/lib/typescript/src/normalizeMarkdownStyle.d.ts.map +1 -1
  163. package/lib/typescript/src/normalizeMarkdownStyle.web.d.ts.map +1 -1
  164. package/lib/typescript/src/normalizeMarkdownTextInputStyle.d.ts +1 -0
  165. package/lib/typescript/src/normalizeMarkdownTextInputStyle.d.ts.map +1 -1
  166. package/lib/typescript/src/normalizeMenuItem.d.ts +7 -0
  167. package/lib/typescript/src/normalizeMenuItem.d.ts.map +1 -0
  168. package/lib/typescript/src/types/AccessibilityLabels.d.ts +114 -0
  169. package/lib/typescript/src/types/AccessibilityLabels.d.ts.map +1 -0
  170. package/lib/typescript/src/types/MarkdownStyle.d.ts +32 -0
  171. package/lib/typescript/src/types/MarkdownStyle.d.ts.map +1 -1
  172. package/lib/typescript/src/types/MarkdownStyleInternal.d.ts +3 -0
  173. package/lib/typescript/src/types/MarkdownStyleInternal.d.ts.map +1 -1
  174. package/lib/typescript/src/types/MarkdownTextProps.d.ts +78 -9
  175. package/lib/typescript/src/types/MarkdownTextProps.d.ts.map +1 -1
  176. package/lib/typescript/src/web/styles.d.ts.map +1 -1
  177. package/package.json +4 -2
  178. package/plugin/build/withAndroidMath.js +19 -0
  179. package/plugin/build/withIosMath.js +28 -0
  180. package/plugin/build/withReactNativeEnrichedMarkdown.js +11 -0
  181. package/plugin/tsconfig.build.json +16 -0
  182. package/src/EnrichedMarkdownNativeComponent.ts +40 -0
  183. package/src/EnrichedMarkdownTextInput.tsx +121 -1
  184. package/src/EnrichedMarkdownTextInputNativeComponent.ts +47 -0
  185. package/src/EnrichedMarkdownTextNativeComponent.ts +40 -0
  186. package/src/accessibilityLabelDefaults.ts +83 -0
  187. package/src/index.tsx +11 -0
  188. package/src/native/EnrichedMarkdownText.tsx +120 -6
  189. package/src/normalizeMarkdownStyle.ts +6 -1
  190. package/src/normalizeMarkdownStyle.web.ts +6 -1
  191. package/src/normalizeMarkdownTextInputStyle.ts +5 -0
  192. package/src/normalizeMenuItem.ts +52 -0
  193. package/src/types/AccessibilityLabels.ts +118 -0
  194. package/src/types/MarkdownStyle.ts +32 -0
  195. package/src/types/MarkdownStyleInternal.ts +3 -0
  196. package/src/types/MarkdownTextProps.ts +74 -9
  197. package/src/web/globalStyles.ts +7 -0
  198. package/src/web/styles.ts +5 -1
  199. package/lib/module/plugin/withAndroidMath.js +0 -20
  200. package/lib/module/plugin/withAndroidMath.js.map +0 -1
  201. package/lib/module/plugin/withIosMath.js +0 -23
  202. package/lib/module/plugin/withIosMath.js.map +0 -1
  203. package/lib/module/plugin/withReactNativeEnrichedMarkdown.js +0 -16
  204. package/lib/module/plugin/withReactNativeEnrichedMarkdown.js.map +0 -1
  205. package/lib/typescript/src/plugin/withAndroidMath.d.ts +0 -5
  206. package/lib/typescript/src/plugin/withAndroidMath.d.ts.map +0 -1
  207. package/lib/typescript/src/plugin/withIosMath.d.ts +0 -5
  208. package/lib/typescript/src/plugin/withIosMath.d.ts.map +0 -1
  209. package/lib/typescript/src/plugin/withReactNativeEnrichedMarkdown.d.ts +0 -6
  210. package/lib/typescript/src/plugin/withReactNativeEnrichedMarkdown.d.ts.map +0 -1
  211. /package/{src/plugin → plugin/src}/withAndroidMath.ts +0 -0
  212. /package/{src/plugin → plugin/src}/withIosMath.ts +0 -0
  213. /package/{src/plugin → plugin/src}/withReactNativeEnrichedMarkdown.ts +0 -0
@@ -2,6 +2,9 @@ require "json"
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
4
 
5
+ monorepo = File.exist?(File.expand_path("../core/EnrichedMarkdownCore.podspec", __dir__))
6
+ cpp_root = monorepo ? "$(PODS_TARGET_SRCROOT)/../core/cpp" : "$(PODS_TARGET_SRCROOT)/cpp"
7
+
5
8
  Pod::Spec.new do |s|
6
9
  s.name = "ReactNativeEnrichedMarkdown"
7
10
  s.version = package["version"]
@@ -13,13 +16,30 @@ Pod::Spec.new do |s|
13
16
  s.platforms = { :ios => min_ios_version_supported, :osx => '14.0' }
14
17
  s.source = { :git => "https://github.com/software-mansion/react-native-enriched-markdown.git", :tag => "#{s.version}" }
15
18
 
16
- s.private_header_files = "ios/**/*.h", "cpp/**/*.{h,hpp}"
19
+ if monorepo
20
+ s.private_header_files = "ios/**/*.h"
21
+ s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
22
+ s.dependency "EnrichedMarkdownCore"
23
+ else
24
+ s.private_header_files = "ios/**/*.h", "cpp/**/*.{h,hpp}"
25
+ s.source_files = "ios/**/*.{h,m,mm,cpp,swift}", "cpp/md4c/*.{c,h}", "cpp/parser/*.{hpp,cpp}"
26
+ end
17
27
 
18
28
  # To disable LaTeX math rendering (RaTeX, iOS only), add ENV['ENRICHED_MARKDOWN_ENABLE_MATH'] = '0' to your Podfile.
19
29
  # When math is enabled, consumers must use `use_frameworks! :linkage => :dynamic` (required for SPM interop).
20
30
  enable_math = ENV['ENRICHED_MARKDOWN_ENABLE_MATH'] != '0'
21
31
 
22
- s.source_files = "ios/**/*.{h,m,mm,cpp,swift}", "cpp/md4c/*.{c,h}", "cpp/parser/*.{hpp,cpp}"
32
+ # RaTeX is wired in through React Native's `spm_dependency` helper (SPM interop).
33
+ # On React Native versions that don't provide it, disable math entirely so the
34
+ # RaTeX-importing sources under ios/math are excluded from the build. Otherwise
35
+ # the failure would just move from `pod install` to a build-time
36
+ # "missing module 'RaTeX'" error.
37
+ if enable_math && !defined?(spm_dependency)
38
+ Pod::UI.warn '[ReactNativeEnrichedMarkdown] `spm_dependency` is unavailable in this ' \
39
+ 'React Native version; disabling LaTeX math (RaTeX). Upgrade React Native to enable it.'
40
+ enable_math = false
41
+ end
42
+
23
43
  unless enable_math
24
44
  s.exclude_files = "ios/math/**/*.swift"
25
45
  end
@@ -27,22 +47,39 @@ Pod::Spec.new do |s|
27
47
  preprocessor_defs = '$(inherited) MD4C_USE_UTF8=1'
28
48
  if enable_math
29
49
  preprocessor_defs += ' ENRICHED_MARKDOWN_MATH=1'
30
- if defined?(:spm_dependency)
31
- spm_dependency(s,
32
- url: 'https://github.com/erweixin/RaTeX.git',
33
- requirement: {kind: 'upToNextMajorVersion', minimumVersion: '0.1.9'},
34
- products: ['RaTeX']
35
- )
36
- end
50
+ spm_dependency(s,
51
+ url: 'https://github.com/erweixin/RaTeX.git',
52
+ requirement: {kind: 'upToNextMajorVersion', minimumVersion: '0.1.12'},
53
+ products: ['RaTeX']
54
+ )
37
55
  end
38
56
 
39
- s.pod_target_xcconfig = {
40
- 'HEADER_SEARCH_PATHS' => '"$(PODS_TARGET_SRCROOT)/cpp/md4c" "$(PODS_TARGET_SRCROOT)/cpp/parser" "$(PODS_TARGET_SRCROOT)/ios/internals" "$(PODS_TARGET_SRCROOT)/ios/input/internals"',
57
+ pod_xcconfig = {
58
+ 'HEADER_SEARCH_PATHS' => "\"#{cpp_root}/md4c\" \"#{cpp_root}/parser\" \"$(PODS_TARGET_SRCROOT)/ios/internals\" \"$(PODS_TARGET_SRCROOT)/ios/input/internals\"",
41
59
  'GCC_PREPROCESSOR_DEFINITIONS' => preprocessor_defs,
42
60
  'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
43
61
  'DEFINES_MODULE' => 'YES'
44
62
  }
45
63
 
64
+ # Detect Apple Silicon on the host running `pod install`. `sysctl hw.optional.arm64`
65
+ # reports the real hardware even under a Rosetta-translated Ruby, unlike `uname -m`.
66
+ apple_silicon = `sysctl -n hw.optional.arm64 2>/dev/null`.strip == '1'
67
+
68
+ if enable_math && apple_silicon
69
+ # RaTeX's Swift wrapper is compiled from SPM source, so its RaTeX.swiftmodule
70
+ # is emitted only for the arch(es) the build requests. Under ONLY_ACTIVE_ARCH
71
+ # on Apple Silicon that is arm64 only, but universal simulator builds (archive,
72
+ # "Any iOS Simulator Device", Release) also compile this pod for x86_64 and then
73
+ # fail with "could not find module 'RaTeX' for target 'x86_64-apple-ios-simulator'".
74
+ # Excluding x86_64 for the simulator keeps the pod and the app target arch sets in
75
+ # sync. Guarded to Apple Silicon so Intel Macs (which build x86_64 simulator slices)
76
+ # are unaffected; `$(inherited)` preserves exclusions from the user project / other pods.
77
+ pod_xcconfig['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = '$(inherited) x86_64'
78
+ s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => '$(inherited) x86_64' }
79
+ end
80
+
81
+ s.pod_target_xcconfig = pod_xcconfig
82
+
46
83
  if enable_math
47
84
  # React Native's spm_dependency generates a module.modulemap at
48
85
  # ${BUILT_PRODUCTS_DIR}/include/ that re-declares RaTeXFFI, but the RaTeX
@@ -59,6 +96,20 @@ Pod::Spec.new do |s|
59
96
  sed -i '' -E '/^(framework )?module RaTeXFFI /,/^\}/d' "$MODULEMAP"
60
97
  SCRIPT
61
98
  execution_position: :before_compile
99
+ },
100
+ {
101
+ name: 'Dedupe RaTeX XCFramework Signature',
102
+ script: <<~'SCRIPT',
103
+ # Xcode 26 generates a .signature file for each signed XCFramework.
104
+ # When the RaTeX XCFramework is consumed via spm_dependency inside a
105
+ # CocoaPods target, both the SPM product and the pod target produce a
106
+ # copy. During archive assembly Xcode copies all signatures into a flat
107
+ # Signatures/ directory, and the second copy collides with the first.
108
+ # Removing the pod-target copy prevents the collision. This is a no-op
109
+ # on older Xcode versions or simulator builds where the file is absent.
110
+ rm -f "${CONFIGURATION_BUILD_DIR}/RaTeX.xcframework-ios.signature"
111
+ SCRIPT
112
+ execution_position: :after_compile
62
113
  }
63
114
  ]
64
115
  end
@@ -67,6 +67,10 @@ android {
67
67
  }
68
68
  }
69
69
  }
70
+
71
+ testOptions {
72
+ unitTests.includeAndroidResources = true
73
+ }
70
74
  }
71
75
 
72
76
  repositories {
@@ -85,6 +89,7 @@ dependencies {
85
89
  if (enableMath) {
86
90
  implementation("io.github.erweixin:ratex-android:0.1.10")
87
91
  }
92
+ testImplementation "junit:junit:4.13.2"
88
93
  }
89
94
 
90
95
  react {
@@ -71,6 +71,9 @@ public class EnrichedMarkdownManagerDelegate<T extends View, U extends BaseViewM
71
71
  case "selectionMenuConfig":
72
72
  mViewManager.setSelectionMenuConfig(view, (ReadableMap) value);
73
73
  break;
74
+ case "accessibilityLabels":
75
+ mViewManager.setAccessibilityLabels(view, (ReadableMap) value);
76
+ break;
74
77
  case "textBreakStrategy":
75
78
  mViewManager.setTextBreakStrategy(view, value == null ? "highQuality" : (String) value);
76
79
  break;
@@ -31,6 +31,7 @@ public interface EnrichedMarkdownManagerInterface<T extends View> extends ViewMa
31
31
  void setSpoilerOverlay(T view, @Nullable String value);
32
32
  void setContextMenuItems(T view, @Nullable ReadableArray value);
33
33
  void setSelectionMenuConfig(T view, @Nullable ReadableMap value);
34
+ void setAccessibilityLabels(T view, @Nullable ReadableMap value);
34
35
  void setTextBreakStrategy(T view, @Nullable String value);
35
36
  void setLineBreakStrategyIOS(T view, @Nullable String value);
36
37
  void setWritingDirection(T view, @Nullable String value);
@@ -44,6 +44,9 @@ public class EnrichedMarkdownTextInputManagerDelegate<T extends View, U extends
44
44
  case "scrollEnabled":
45
45
  mViewManager.setScrollEnabled(view, value == null ? false : (boolean) value);
46
46
  break;
47
+ case "blockSyntax":
48
+ mViewManager.setBlockSyntax(view, value == null ? false : (boolean) value);
49
+ break;
47
50
  case "autoCapitalize":
48
51
  mViewManager.setAutoCapitalize(view, value == null ? null : (String) value);
49
52
  break;
@@ -80,6 +83,12 @@ public class EnrichedMarkdownTextInputManagerDelegate<T extends View, U extends
80
83
  case "contextMenuItems":
81
84
  mViewManager.setContextMenuItems(view, (ReadableArray) value);
82
85
  break;
86
+ case "selectionMenuConfig":
87
+ mViewManager.setSelectionMenuConfig(view, (ReadableMap) value);
88
+ break;
89
+ case "formatMenuConfig":
90
+ mViewManager.setFormatMenuConfig(view, (ReadableMap) value);
91
+ break;
83
92
  case "linkRegex":
84
93
  mViewManager.setLinkRegex(view, (ReadableMap) value);
85
94
  break;
@@ -148,6 +157,9 @@ public class EnrichedMarkdownTextInputManagerDelegate<T extends View, U extends
148
157
  case "removeMath":
149
158
  mViewManager.removeMath(view, args.getInt(0));
150
159
  break;
160
+ case "copyToClipboard":
161
+ mViewManager.copyToClipboard(view);
162
+ break;
151
163
  case "requestMarkdown":
152
164
  mViewManager.requestMarkdown(view, args.getInt(0));
153
165
  break;
@@ -22,6 +22,7 @@ public interface EnrichedMarkdownTextInputManagerInterface<T extends View> exten
22
22
  void setEditable(T view, boolean value);
23
23
  void setAutoFocus(T view, boolean value);
24
24
  void setScrollEnabled(T view, boolean value);
25
+ void setBlockSyntax(T view, boolean value);
25
26
  void setAutoCapitalize(T view, @Nullable String value);
26
27
  void setMultiline(T view, boolean value);
27
28
  void setCursorColor(T view, @Nullable Integer value);
@@ -34,6 +35,8 @@ public interface EnrichedMarkdownTextInputManagerInterface<T extends View> exten
34
35
  void setFontWeight(T view, @Nullable String value);
35
36
  void setIsOnChangeMarkdownSet(T view, boolean value);
36
37
  void setContextMenuItems(T view, @Nullable ReadableArray value);
38
+ void setSelectionMenuConfig(T view, @Nullable ReadableMap value);
39
+ void setFormatMenuConfig(T view, @Nullable ReadableMap value);
37
40
  void setLinkRegex(T view, @Nullable ReadableMap value);
38
41
  void setMentionIndicators(T view, @Nullable ReadableArray value);
39
42
  void setWritingDirection(T view, @Nullable String value);
@@ -54,6 +57,7 @@ public interface EnrichedMarkdownTextInputManagerInterface<T extends View> exten
54
57
  void insertMath(T view, String latex, boolean displayMode);
55
58
  void updateMath(T view, int start, String latex, boolean displayMode);
56
59
  void removeMath(T view, int start);
60
+ void copyToClipboard(T view);
57
61
  void requestMarkdown(T view, int requestId);
58
62
  void requestCaretRect(T view, int requestId);
59
63
  }
@@ -71,6 +71,9 @@ public class EnrichedMarkdownTextManagerDelegate<T extends View, U extends BaseV
71
71
  case "selectionMenuConfig":
72
72
  mViewManager.setSelectionMenuConfig(view, (ReadableMap) value);
73
73
  break;
74
+ case "accessibilityLabels":
75
+ mViewManager.setAccessibilityLabels(view, (ReadableMap) value);
76
+ break;
74
77
  case "textBreakStrategy":
75
78
  mViewManager.setTextBreakStrategy(view, value == null ? "highQuality" : (String) value);
76
79
  break;
@@ -31,6 +31,7 @@ public interface EnrichedMarkdownTextManagerInterface<T extends View> extends Vi
31
31
  void setSpoilerOverlay(T view, @Nullable String value);
32
32
  void setContextMenuItems(T view, @Nullable ReadableArray value);
33
33
  void setSelectionMenuConfig(T view, @Nullable ReadableMap value);
34
+ void setAccessibilityLabels(T view, @Nullable ReadableMap value);
34
35
  void setTextBreakStrategy(T view, @Nullable String value);
35
36
  void setLineBreakStrategyIOS(T view, @Nullable String value);
36
37
  void setWritingDirection(T view, @Nullable String value);
@@ -34,6 +34,7 @@ EnrichedMarkdownProps::EnrichedMarkdownProps(
34
34
  spoilerOverlay(convertRawProp(context, rawProps, "spoilerOverlay", sourceProps.spoilerOverlay, {std::string{"particles"}})),
35
35
  contextMenuItems(convertRawProp(context, rawProps, "contextMenuItems", sourceProps.contextMenuItems, {})),
36
36
  selectionMenuConfig(convertRawProp(context, rawProps, "selectionMenuConfig", sourceProps.selectionMenuConfig, {})),
37
+ accessibilityLabels(convertRawProp(context, rawProps, "accessibilityLabels", sourceProps.accessibilityLabels, {})),
37
38
  textBreakStrategy(convertRawProp(context, rawProps, "textBreakStrategy", sourceProps.textBreakStrategy, {std::string{"highQuality"}})),
38
39
  lineBreakStrategyIOS(convertRawProp(context, rawProps, "lineBreakStrategyIOS", sourceProps.lineBreakStrategyIOS, {std::string{"none"}})),
39
40
  writingDirection(convertRawProp(context, rawProps, "writingDirection", sourceProps.writingDirection, {std::string{"first-strong"}})) {}
@@ -114,6 +115,10 @@ folly::dynamic EnrichedMarkdownProps::getDiffProps(
114
115
  result["selectionMenuConfig"] = toDynamic(selectionMenuConfig);
115
116
  }
116
117
 
118
+ if (accessibilityLabels != oldProps->accessibilityLabels) {
119
+ result["accessibilityLabels"] = toDynamic(accessibilityLabels);
120
+ }
121
+
117
122
  if (textBreakStrategy != oldProps->textBreakStrategy) {
118
123
  result["textBreakStrategy"] = textBreakStrategy;
119
124
  }
@@ -139,6 +144,7 @@ EnrichedMarkdownTextInputProps::EnrichedMarkdownTextInputProps(
139
144
  editable(convertRawProp(context, rawProps, "editable", sourceProps.editable, {false})),
140
145
  autoFocus(convertRawProp(context, rawProps, "autoFocus", sourceProps.autoFocus, {false})),
141
146
  scrollEnabled(convertRawProp(context, rawProps, "scrollEnabled", sourceProps.scrollEnabled, {false})),
147
+ blockSyntax(convertRawProp(context, rawProps, "blockSyntax", sourceProps.blockSyntax, {false})),
142
148
  autoCapitalize(convertRawProp(context, rawProps, "autoCapitalize", sourceProps.autoCapitalize, {})),
143
149
  multiline(convertRawProp(context, rawProps, "multiline", sourceProps.multiline, {false})),
144
150
  cursorColor(convertRawProp(context, rawProps, "cursorColor", sourceProps.cursorColor, {})),
@@ -151,6 +157,8 @@ EnrichedMarkdownTextInputProps::EnrichedMarkdownTextInputProps(
151
157
  fontWeight(convertRawProp(context, rawProps, "fontWeight", sourceProps.fontWeight, {})),
152
158
  isOnChangeMarkdownSet(convertRawProp(context, rawProps, "isOnChangeMarkdownSet", sourceProps.isOnChangeMarkdownSet, {false})),
153
159
  contextMenuItems(convertRawProp(context, rawProps, "contextMenuItems", sourceProps.contextMenuItems, {})),
160
+ selectionMenuConfig(convertRawProp(context, rawProps, "selectionMenuConfig", sourceProps.selectionMenuConfig, {})),
161
+ formatMenuConfig(convertRawProp(context, rawProps, "formatMenuConfig", sourceProps.formatMenuConfig, {})),
154
162
  linkRegex(convertRawProp(context, rawProps, "linkRegex", sourceProps.linkRegex, {})),
155
163
  mentionIndicators(convertRawProp(context, rawProps, "mentionIndicators", sourceProps.mentionIndicators, {})),
156
164
  writingDirection(convertRawProp(context, rawProps, "writingDirection", sourceProps.writingDirection, {std::string{"first-strong"}})) {}
@@ -195,6 +203,10 @@ folly::dynamic EnrichedMarkdownTextInputProps::getDiffProps(
195
203
  result["scrollEnabled"] = scrollEnabled;
196
204
  }
197
205
 
206
+ if (blockSyntax != oldProps->blockSyntax) {
207
+ result["blockSyntax"] = blockSyntax;
208
+ }
209
+
198
210
  if (autoCapitalize != oldProps->autoCapitalize) {
199
211
  result["autoCapitalize"] = autoCapitalize;
200
212
  }
@@ -243,6 +255,14 @@ folly::dynamic EnrichedMarkdownTextInputProps::getDiffProps(
243
255
  result["contextMenuItems"] = toDynamic(contextMenuItems);
244
256
  }
245
257
 
258
+ if (selectionMenuConfig != oldProps->selectionMenuConfig) {
259
+ result["selectionMenuConfig"] = toDynamic(selectionMenuConfig);
260
+ }
261
+
262
+ if (formatMenuConfig != oldProps->formatMenuConfig) {
263
+ result["formatMenuConfig"] = toDynamic(formatMenuConfig);
264
+ }
265
+
246
266
  if (linkRegex != oldProps->linkRegex) {
247
267
  result["linkRegex"] = toDynamic(linkRegex);
248
268
  }
@@ -277,6 +297,7 @@ EnrichedMarkdownTextProps::EnrichedMarkdownTextProps(
277
297
  spoilerOverlay(convertRawProp(context, rawProps, "spoilerOverlay", sourceProps.spoilerOverlay, {std::string{"particles"}})),
278
298
  contextMenuItems(convertRawProp(context, rawProps, "contextMenuItems", sourceProps.contextMenuItems, {})),
279
299
  selectionMenuConfig(convertRawProp(context, rawProps, "selectionMenuConfig", sourceProps.selectionMenuConfig, {})),
300
+ accessibilityLabels(convertRawProp(context, rawProps, "accessibilityLabels", sourceProps.accessibilityLabels, {})),
280
301
  textBreakStrategy(convertRawProp(context, rawProps, "textBreakStrategy", sourceProps.textBreakStrategy, {std::string{"highQuality"}})),
281
302
  lineBreakStrategyIOS(convertRawProp(context, rawProps, "lineBreakStrategyIOS", sourceProps.lineBreakStrategyIOS, {std::string{"none"}})),
282
303
  writingDirection(convertRawProp(context, rawProps, "writingDirection", sourceProps.writingDirection, {std::string{"first-strong"}})) {}
@@ -357,6 +378,10 @@ folly::dynamic EnrichedMarkdownTextProps::getDiffProps(
357
378
  result["selectionMenuConfig"] = toDynamic(selectionMenuConfig);
358
379
  }
359
380
 
381
+ if (accessibilityLabels != oldProps->accessibilityLabels) {
382
+ result["accessibilityLabels"] = toDynamic(accessibilityLabels);
383
+ }
384
+
360
385
  if (textBreakStrategy != oldProps->textBreakStrategy) {
361
386
  result["textBreakStrategy"] = textBreakStrategy;
362
387
  }