react-native-advanced-text 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,16 @@ require "json"
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
4
 
5
+ # Resolve the react-native source dir so we can point at the Fabric text
6
+ # headers directly (they are not exposed by `install_modules_dependencies`).
7
+ react_common_dir =
8
+ begin
9
+ resolved = `cd "#{__dir__}" && node --print "require.resolve('react-native/package.json')" 2>/dev/null`.strip
10
+ (resolved.empty? || !File.exist?(resolved)) ? "" : File.join(File.dirname(resolved), "ReactCommon")
11
+ rescue StandardError
12
+ ""
13
+ end
14
+
5
15
  Pod::Spec.new do |s|
6
16
  s.name = "AdvancedText"
7
17
  s.version = package["version"]
@@ -22,16 +32,30 @@ Pod::Spec.new do |s|
22
32
  install_modules_dependencies(s)
23
33
 
24
34
  # `install_modules_dependencies` sets `s.pod_target_xcconfig`; extend it
25
- # (rather than replace it) so our headers win over the generated ones and
26
- # so `React-FabricComponents` headers (TextLayoutManager) resolve.
27
- xcconfig = s.attributes_hash["pod_target_xcconfig"] || {}
28
- existing_header_paths = xcconfig["HEADER_SEARCH_PATHS"] || "$(inherited)"
35
+ # (rather than replace it) so:
36
+ # 1. our `common/cpp` headers win over the codegen output, and
37
+ # 2. <react/renderer/textlayoutmanager/*.h> resolves (TextLayoutManager /
38
+ # TextLayoutContext), which `install_modules_dependencies` does NOT add.
39
+ xcconfig = s.to_hash["pod_target_xcconfig"] || {}
40
+
41
+ # `common/cpp` MUST stay first so our ShadowNodes.h shadows the codegen one.
42
+ leading_paths = ["\"$(PODS_TARGET_SRCROOT)/common/cpp\""]
43
+
44
+ # Extra paths for the Fabric text headers (append order is fine here).
45
+ trailing_paths = [
46
+ "\"$(PODS_ROOT)/Headers/Public/React-FabricComponents\"",
47
+ "\"$(PODS_ROOT)/Headers/Private/React-FabricComponents\"",
48
+ ]
49
+ unless react_common_dir.empty?
50
+ trailing_paths << "\"#{react_common_dir}\""
51
+ trailing_paths << "\"#{File.join(react_common_dir, "react/renderer/textlayoutmanager/platform/ios")}\""
52
+ end
53
+
54
+ existing_header_paths = xcconfig["HEADER_SEARCH_PATHS"]
29
55
  xcconfig["HEADER_SEARCH_PATHS"] =
30
- "\"$(PODS_TARGET_SRCROOT)/common/cpp\" #{existing_header_paths}"
56
+ (leading_paths + [existing_header_paths].compact + trailing_paths).join(" ")
31
57
  xcconfig["CLANG_CXX_LANGUAGE_STANDARD"] ||= "c++20"
32
58
  s.pod_target_xcconfig = xcconfig
33
59
 
34
- # Needed for <react/renderer/textlayoutmanager/TextLayoutManager.h>, which is
35
- # not pulled in by `install_modules_dependencies`.
36
60
  s.dependency "React-FabricComponents"
37
61
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-advanced-text",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": " Advanced text component for React Native with custom select options.",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",