@maplibre/maplibre-react-native 10.0.0-beta.18 → 10.0.0-beta.19

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 (46) hide show
  1. package/README.md +1 -0
  2. package/android/build.gradle +11 -11
  3. package/android/gradle.properties +6 -3
  4. package/lib/commonjs/plugin/MapLibrePluginProps.js +2 -0
  5. package/lib/commonjs/plugin/MapLibrePluginProps.js.map +1 -0
  6. package/lib/commonjs/plugin/android.js +41 -0
  7. package/lib/commonjs/plugin/android.js.map +1 -0
  8. package/lib/commonjs/plugin/ios.js +37 -3
  9. package/lib/commonjs/plugin/ios.js.map +1 -1
  10. package/lib/commonjs/plugin/withMapLibre.js +6 -1
  11. package/lib/commonjs/plugin/withMapLibre.js.map +1 -1
  12. package/lib/module/plugin/MapLibrePluginProps.js +2 -0
  13. package/lib/module/plugin/MapLibrePluginProps.js.map +1 -0
  14. package/lib/module/plugin/android.js +34 -0
  15. package/lib/module/plugin/android.js.map +1 -0
  16. package/lib/module/plugin/ios.js +33 -3
  17. package/lib/module/plugin/ios.js.map +1 -1
  18. package/lib/module/plugin/withMapLibre.js +6 -1
  19. package/lib/module/plugin/withMapLibre.js.map +1 -1
  20. package/lib/typescript/commonjs/src/MapLibreRN.d.ts +1 -0
  21. package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +1 -1
  22. package/lib/typescript/commonjs/src/plugin/MapLibrePluginProps.d.ts +77 -0
  23. package/lib/typescript/commonjs/src/plugin/MapLibrePluginProps.d.ts.map +1 -0
  24. package/lib/typescript/commonjs/src/plugin/android.d.ts +16 -0
  25. package/lib/typescript/commonjs/src/plugin/android.d.ts.map +1 -0
  26. package/lib/typescript/commonjs/src/plugin/ios.d.ts +4 -0
  27. package/lib/typescript/commonjs/src/plugin/ios.d.ts.map +1 -1
  28. package/lib/typescript/commonjs/src/plugin/withMapLibre.d.ts +2 -1
  29. package/lib/typescript/commonjs/src/plugin/withMapLibre.d.ts.map +1 -1
  30. package/lib/typescript/module/src/MapLibreRN.d.ts +1 -0
  31. package/lib/typescript/module/src/MapLibreRN.d.ts.map +1 -1
  32. package/lib/typescript/module/src/plugin/MapLibrePluginProps.d.ts +77 -0
  33. package/lib/typescript/module/src/plugin/MapLibrePluginProps.d.ts.map +1 -0
  34. package/lib/typescript/module/src/plugin/android.d.ts +16 -0
  35. package/lib/typescript/module/src/plugin/android.d.ts.map +1 -0
  36. package/lib/typescript/module/src/plugin/ios.d.ts +4 -0
  37. package/lib/typescript/module/src/plugin/ios.d.ts.map +1 -1
  38. package/lib/typescript/module/src/plugin/withMapLibre.d.ts +2 -1
  39. package/lib/typescript/module/src/plugin/withMapLibre.d.ts.map +1 -1
  40. package/maplibre-react-native.podspec +15 -14
  41. package/package.json +1 -1
  42. package/src/MapLibreRN.ts +2 -0
  43. package/src/plugin/MapLibrePluginProps.ts +83 -0
  44. package/src/plugin/android.ts +64 -0
  45. package/src/plugin/ios.ts +57 -3
  46. package/src/plugin/withMapLibre.ts +7 -1
package/README.md CHANGED
@@ -31,6 +31,7 @@ diverged, it has become necessary to separate the projects into specific wrapper
31
31
  - Installation
32
32
  - [Expo](/docs/guides/setup/Expo.md)
33
33
  - [React Native](/docs/guides/setup/React-Native.md)
34
+ - [Customization](/docs/guides/setup/Customization.md)
34
35
  - Migrations
35
36
  - [Migrating to v10](/docs/guides/migrations/v10.md)
36
37
 
@@ -116,24 +116,24 @@ dependencies {
116
116
  implementation "com.facebook.react:react-native:+"
117
117
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
118
118
 
119
- // MapLibre SDK
120
- implementation "org.maplibre.gl:android-sdk:11.7.1"
121
- implementation "org.maplibre.gl:android-sdk-turf:6.0.1"
119
+ // MapLibre Native
120
+ implementation "org.maplibre.gl:android-sdk:${getConfigurableExtOrDefault('nativeVersion')}"
121
+
122
+ // MapLibre Plugins
123
+ implementation "org.maplibre.gl:android-plugin-localization-v9:${getConfigurableExtOrDefault('pluginVersion')}"
124
+ implementation "org.maplibre.gl:android-plugin-annotation-v9:${getConfigurableExtOrDefault('pluginVersion')}"
125
+ implementation "org.maplibre.gl:android-plugin-markerview-v9:${getConfigurableExtOrDefault('pluginVersion')}"
122
126
 
123
127
  // Dependencies
128
+ implementation "org.maplibre.gl:android-sdk-turf:${getConfigurableExtOrDefault('turfVersion')}"
129
+ implementation "com.squareup.okhttp3:okhttp:${getConfigurableExtOrDefault('okhttpVersion')}"
130
+ implementation "com.squareup.okhttp3:okhttp-urlconnection:${getConfigurableExtOrDefault('okhttpVersion')}"
124
131
  implementation "androidx.vectordrawable:vectordrawable:1.1.0"
125
132
  implementation "androidx.annotation:annotation:1.7.0"
126
133
  implementation "androidx.appcompat:appcompat:1.6.1"
127
- implementation "com.squareup.okhttp3:okhttp:${getConfigurableExtOrDefault('okhttpVersion')}"
128
- implementation "com.squareup.okhttp3:okhttp-urlconnection:${getConfigurableExtOrDefault('okhttpVersion')}"
129
-
130
- // MapLibre Plugins
131
- implementation ("org.maplibre.gl:android-plugin-localization-v9:3.0.1")
132
- implementation ("org.maplibre.gl:android-plugin-annotation-v9:3.0.1")
133
- implementation ("org.maplibre.gl:android-plugin-markerview-v9:3.0.1")
134
134
 
135
135
  // Dependencies for Google Location Engine
136
136
  if (getConfigurableExtOrDefault("locationEngine") == "google") {
137
- implementation "com.google.android.gms:play-services-location:21.3.0"
137
+ implementation "com.google.android.gms:play-services-location:${getConfigurableExtOrDefault('googlePlayServicesLocationVersion')}"
138
138
  }
139
139
  }
@@ -4,9 +4,12 @@ org.maplibre.reactnative.targetSdkVersion=31
4
4
  org.maplibre.reactnative.compileSdkVersion=31
5
5
  org.maplibre.reactnative.ndkVersion=21.4.7075529
6
6
 
7
- # MapLibre React Native Customizations
8
-
7
+ # MapLibre React Native
8
+ org.maplibre.reactnative.nativeVersion=11.8.0
9
+ org.maplibre.reactnative.pluginVersion=3.0.2
10
+ org.maplibre.reactnative.turfVersion=6.0.1
9
11
  org.maplibre.reactnative.okhttpVersion=4.9.0
10
-
11
12
  # Available values: default, google
12
13
  org.maplibre.reactnative.locationEngine=default
14
+ # Only applied if locationEngine=google
15
+ org.maplibre.reactnative.googlePlayServicesLocationVersion=21.3.0
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=MapLibrePluginProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["plugin/MapLibrePluginProps.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.withGradleProperties = exports.mergeGradleProperties = exports.getGradleProperties = exports.android = void 0;
7
+ var _configPlugins = require("@expo/config-plugins");
8
+ const getGradleProperties = props => {
9
+ return Object.entries(props?.android || {}).reduce((properties, [key, value]) => {
10
+ if (key && value) {
11
+ properties.push({
12
+ type: "property",
13
+ key: `org.maplibre.reactnative.${key}`,
14
+ value: value.toString()
15
+ });
16
+ }
17
+ return properties;
18
+ }, []);
19
+ };
20
+ exports.getGradleProperties = getGradleProperties;
21
+ const mergeGradleProperties = (oldProperties, newProperties) => {
22
+ const newPropertiesKeys = newProperties.map(({
23
+ key
24
+ }) => key);
25
+ const merged = oldProperties.filter(item => !(item.type === "property" && newPropertiesKeys.includes(item.key)));
26
+ merged.push(...newProperties);
27
+ return merged;
28
+ };
29
+ exports.mergeGradleProperties = mergeGradleProperties;
30
+ const withGradleProperties = (config, props) => {
31
+ const gradleProperties = getGradleProperties(props);
32
+ return (0, _configPlugins.withGradleProperties)(config, c => {
33
+ c.modResults = mergeGradleProperties(c.modResults, gradleProperties);
34
+ return c;
35
+ });
36
+ };
37
+ exports.withGradleProperties = withGradleProperties;
38
+ const android = exports.android = {
39
+ withGradleProperties
40
+ };
41
+ //# sourceMappingURL=android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_configPlugins","require","getGradleProperties","props","Object","entries","android","reduce","properties","key","value","push","type","toString","exports","mergeGradleProperties","oldProperties","newProperties","newPropertiesKeys","map","merged","filter","item","includes","withGradleProperties","config","gradleProperties","withGradlePropertiesExpo","c","modResults"],"sourceRoot":"../../../src","sources":["plugin/android.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAcO,MAAMC,mBAAmB,GAC9BC,KAA0B,IACP;EACnB,OAAOC,MAAM,CAACC,OAAO,CAACF,KAAK,EAAEG,OAAO,IAAI,CAAC,CAAC,CAAC,CAACC,MAAM,CAChD,CAACC,UAAU,EAAE,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK;IAC5B,IAAID,GAAG,IAAIC,KAAK,EAAE;MAChBF,UAAU,CAACG,IAAI,CAAC;QACdC,IAAI,EAAE,UAAU;QAChBH,GAAG,EAAE,4BAA4BA,GAAG,EAAE;QACtCC,KAAK,EAAEA,KAAK,CAACG,QAAQ,CAAC;MACxB,CAAC,CAAC;IACJ;IAEA,OAAOL,UAAU;EACnB,CAAC,EACD,EACF,CAAC;AACH,CAAC;AAACM,OAAA,CAAAZ,mBAAA,GAAAA,mBAAA;AAEK,MAAMa,qBAAqB,GAAGA,CACnCC,aAA+B,EAC/BC,aAA6B,KACR;EACrB,MAAMC,iBAAiB,GAAGD,aAAa,CAACE,GAAG,CAAC,CAAC;IAAEV;EAAI,CAAC,KAAKA,GAAG,CAAC;EAC7D,MAAMW,MAAM,GAAGJ,aAAa,CAACK,MAAM,CAChCC,IAAI,IACH,EAAEA,IAAI,CAACV,IAAI,KAAK,UAAU,IAAIM,iBAAiB,CAACK,QAAQ,CAACD,IAAI,CAACb,GAAG,CAAC,CACtE,CAAC;EAEDW,MAAM,CAACT,IAAI,CAAC,GAAGM,aAAa,CAAC;EAE7B,OAAOG,MAAM;AACf,CAAC;AAACN,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AAEK,MAAMS,oBAAuD,GAAGA,CACrEC,MAAM,EACNtB,KAAK,KACF;EACH,MAAMuB,gBAAgB,GAAGxB,mBAAmB,CAACC,KAAK,CAAC;EAEnD,OAAO,IAAAwB,mCAAwB,EAACF,MAAM,EAAGG,CAAC,IAAK;IAC7CA,CAAC,CAACC,UAAU,GAAGd,qBAAqB,CAACa,CAAC,CAACC,UAAU,EAAEH,gBAAgB,CAAC;IAEpE,OAAOE,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;AAACd,OAAA,CAAAU,oBAAA,GAAAA,oBAAA;AAEK,MAAMlB,OAAO,GAAAQ,OAAA,CAAAR,OAAA,GAAG;EACrBkB;AACF,CAAC","ignoreList":[]}
@@ -3,20 +3,23 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.applyPodfileGlobalVariables = void 0;
6
7
  exports.applyPodfilePostInstall = applyPodfilePostInstall;
7
- exports.ios = void 0;
8
+ exports.withPodfileGlobalVariables = exports.ios = void 0;
8
9
  var _configPlugins = require("@expo/config-plugins");
9
10
  var _generateCode = require("@expo/config-plugins/build/utils/generateCode");
11
+ const TAG_PREFIX = `@maplibre/maplibre-react-native`;
12
+
10
13
  /**
11
14
  * Only the post-install block is required, the post installer block is used for SPM (Swift Package Manager) which Expo
12
15
  * doesn't currently support.
13
16
  */
14
17
  function applyPodfilePostInstall(contents) {
15
18
  const result = (0, _generateCode.mergeContents)({
16
- tag: `@maplibre/maplibre-react-native-post_installer`,
19
+ tag: `${TAG_PREFIX}:post-install`,
17
20
  src: contents,
18
21
  newSrc: ` $MLRN.post_install(installer)`,
19
- anchor: new RegExp(`post_install do \\|installer\\|`),
22
+ anchor: /post_install do \|installer\|/,
20
23
  offset: 1,
21
24
  comment: "#"
22
25
  });
@@ -31,11 +34,41 @@ const withPodfilePostInstall = config => {
31
34
  return c;
32
35
  });
33
36
  };
37
+ const applyPodfileGlobalVariables = (contents, props) => {
38
+ const tag = `${TAG_PREFIX}:global-variables`;
39
+ const globalVariables = [];
40
+ if (props?.ios?.nativeVersion) {
41
+ globalVariables.push(`$MLRN_NATIVE_VERSION = "${props.ios.nativeVersion}"`);
42
+ }
43
+ if (props?.ios?.spmSpec) {
44
+ globalVariables.push(`$MLRN_SPM_SPEC = ${props.ios.spmSpec}`);
45
+ }
46
+ if (globalVariables.length > 0) {
47
+ return (0, _generateCode.mergeContents)({
48
+ tag,
49
+ src: contents,
50
+ newSrc: globalVariables.join("\n"),
51
+ anchor: /target .+ do/,
52
+ offset: 0,
53
+ comment: "#"
54
+ }).contents;
55
+ }
56
+ const modified = (0, _generateCode.removeGeneratedContents)(contents, tag);
57
+ return modified ?? contents;
58
+ };
59
+ exports.applyPodfileGlobalVariables = applyPodfileGlobalVariables;
60
+ const withPodfileGlobalVariables = (config, props) => {
61
+ return (0, _configPlugins.withPodfile)(config, c => {
62
+ c.modResults.contents = applyPodfileGlobalVariables(c.modResults.contents, props);
63
+ return c;
64
+ });
65
+ };
34
66
 
35
67
  /**
36
68
  * Exclude building for arm64 on simulator devices in the pbxproj project.
37
69
  * Without this, production builds targeting simulators will fail.
38
70
  */
71
+ exports.withPodfileGlobalVariables = withPodfileGlobalVariables;
39
72
  function setExcludedArchitectures(project) {
40
73
  const configurations = project.pbxXCBuildConfigurationSection();
41
74
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -90,6 +123,7 @@ const withExcludedSimulatorArchitectures = config => {
90
123
  };
91
124
  const ios = exports.ios = {
92
125
  withPodfilePostInstall,
126
+ withPodfileGlobalVariables,
93
127
  withoutSignatures,
94
128
  withDwarfDsym,
95
129
  withExcludedSimulatorArchitectures
@@ -1 +1 @@
1
- {"version":3,"names":["_configPlugins","require","_generateCode","applyPodfilePostInstall","contents","result","mergeContents","tag","src","newSrc","anchor","RegExp","offset","comment","didMerge","didClear","withPodfilePostInstall","config","withPodfile","c","modResults","setExcludedArchitectures","project","configurations","pbxXCBuildConfigurationSection","name","buildSettings","Object","values","PRODUCT_NAME","withoutSignatures","withXcodeProject","addBuildPhase","shellPath","shellScript","withDwarfDsym","debugInformationFormat","withExcludedSimulatorArchitect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EA,MAAMQ,iBAA+B,GAAIb,MAAM,IAAK;EAClD,OAAO,IAAAc,+BAAgB,EAACd,MAAM,EAAE,MAAOE,CAAC,IAAK;IAC3CA,CAAC,CAACC,UAAU,CAACY,aAAa,CACxB,EAAE,EACF,0BAA0B,EAC1B,2CAA2C,EAC3C,IAAI,EACJ;MACEC,SAAS,EAAE,SAAS;MACpBC,WAAW,EAAE;AACrB;AACA;AACA;IACM,CACF,CAAC;IAED,OAAOf,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMgB,aAA2B,GAAIlB,MAAM,IAAK;EAC9C,OAAO,IAAAc,+BAAgB,EAACd,MAAM,EAAE,MAAOE,CAAC,IAAK;IAC3CA,CAAC,CAACC,UAAU,CAACgB,sBAAsB,GAAG,iBAAiB;IAEvD,OAAOjB,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;AAED,MAAMkB,kCAAgD,GAAIpB,MAAM,IAAK;EACnE,OAAO,IAAAc,+BAAgB,EAACd,MAAM,EAAGE,CAAC,IAAK;IACrCA,CAAC,CAACC,UAAU,GAAGC,wBAAwB,CAACF,CAAC,CAACC,UAAU,CAAC;IAErD,OAAOD,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;AAEM,MAAMmB,GAAG,GAAAC,OAAA,CAAAD,GAAA,GAAG;EACjBtB,sBAAsB;EACtBc,iBAAiB;EACjBK,aAAa;EACbE;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_configPlugins","require","_generateCode","TAG_PREFIX","applyPodfilePostInstall","contents","result","mergeContents","tag","src","newSrc","anchor","offset","comment","didMerge","didClear","withPodfilePostInstall","config","withPodfile","c","modResults","applyPodfileGlobalVariables","props","globalVariables","ios","nativeVersion","push","spmSpec","length","join","modified","removeGeneratedContents","exports","withPodfileGlobalVariables","setExcludedArchitectures","project","configurations","pbxXCBuildConfigurationSection","name","buildSettings","Object","values","PRODUCT_NAME","withoutSignatures","withXcodeProject","addBuildPhase","shellPath","shellScript","withDwarfDsym","debugInformationFormat","withExcludedSimulatorArchitectures"],"sourceRoot":"../../../src","sources":["plugin/ios.ts"],"mappings":";;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAMA,IAAAC,aAAA,GAAAD,OAAA;AAOA,MAAME,UAAU,GAAG,iCAAiC;;AAEpD;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAACC,QAAgB,EAAU;EAChE,MAAMC,MAAM,GAAG,IAAAC,2BAAa,EAAC;IAC3BC,GAAG,EAAE,GAAGL,UAAU,eAAe;IACjCM,GAAG,EAAEJ,QAAQ;IACbK,MAAM,EAAE,mCAAmC;IAC3CC,MAAM,EAAE,+BAA+B;IACvCC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE;EACX,CAAC,CAAC;EAEF,IAAIP,MAAM,CAACQ,QAAQ,IAAIR,MAAM,CAACS,QAAQ,EAAE;IACtC,OAAOT,MAAM,CAACD,QAAQ;EACxB;EAEA,OAAOA,QAAQ;AACjB;AAEA,MAAMW,sBAAoC,GAAIC,MAAM,IAAK;EACvD,OAAO,IAAAC,0BAAW,EAACD,MAAM,EAAGE,CAAC,IAAK;IAChCA,CAAC,CAACC,UAAU,CAACf,QAAQ,GAAGD,uBAAuB,CAACe,CAAC,CAACC,UAAU,CAACf,QAAQ,CAAC;IAEtE,OAAOc,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;AAEM,MAAME,2BAA2B,GAAGA,CACzChB,QAAgB,EAChBiB,KAA0B,KACf;EACX,MAAMd,GAAG,GAAG,GAAGL,UAAU,mBAAmB;EAE5C,MAAMoB,eAAe,GAAG,EAAE;EAE1B,IAAID,KAAK,EAAEE,GAAG,EAAEC,aAAa,EAAE;IAC7BF,eAAe,CAACG,IAAI,CAAC,2BAA2BJ,KAAK,CAACE,GAAG,CAACC,aAAa,GAAG,CAAC;EAC7E;EAEA,IAAIH,KAAK,EAAEE,GAAG,EAAEG,O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a,CAAC,wCAAwC,CAAC,GAAG,SAAS;IACrE;EACF;EAEA,OAAOJ,OAAO;AAChB;AAEA,MAAMQ,iBAA+B,GAAI1B,MAAM,IAAK;EAClD,OAAO,IAAA2B,+BAAgB,EAAC3B,MAAM,EAAE,MAAOE,CAAC,IAAK;IAC3CA,CAAC,CAACC,UAAU,CAACyB,aAAa,CACxB,EAAE,EACF,0BAA0B,EAC1B,2CAA2C,EAC3C,IAAI,EACJ;MACEC,SAAS,EAAE,SAAS;MACpBC,WAAW,EAAE;AACrB;AACA;AACA;IACM,CACF,CAAC;IAED,OAAO5B,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM6B,aAA2B,GAAI/B,MAAM,IAAK;EAC9C,OAAO,IAAA2B,+BAAgB,EAAC3B,MAAM,EAAE,MAAOE,CAAC,IAAK;IAC3CA,CAAC,CAACC,UAAU,CAAC6B,sBAAsB,GAAG,iBAAiB;IAEvD,OAAO9B,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;AAED,MAAM+B,kCAAgD,GAAIjC,MAAM,IAAK;EACnE,OAAO,IAAA2B,+BAAgB,EAAC3B,MAAM,EAAGE,CAAC,IAAK;IACrCA,CAAC,CAACC,UAAU,GAAGc,wBAAwB,CAACf,CAAC,CAACC,UAAU,CAAC;IAErD,OAAOD,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;AAEM,MAAMK,GAAG,GAAAQ,OAAA,CAAAR,GAAA,GAAG;EACjBR,sBAAsB;EACtBiB,0BAA0B;EAC1BU,iBAAiB;EACjBK,aAAa;EACbE;AACF,CAAC","ignoreList":[]}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _configPlugins = require("@expo/config-plugins");
8
+ var _android = require("./android.js");
8
9
  var _ios = require("./ios.js");
9
10
  let pkg = {
10
11
  name: "@maplibre/maplibre-react-native"
@@ -14,11 +15,15 @@ try {
14
15
  } catch {
15
16
  // empty catch block
16
17
  }
17
- const withMapLibre = config => {
18
+ const withMapLibre = (config, props) => {
19
+ // Android
20
+ config = _android.android.withGradleProperties(config, props);
21
+
18
22
  // iOS
19
23
  config = _ios.ios.withExcludedSimulatorArchitectures(config);
20
24
  config = _ios.ios.withDwarfDsym(config);
21
25
  config = _ios.ios.withoutSignatures(config);
26
+ config = _ios.ios.withPodfileGlobalVariables(config, props);
22
27
  config = _ios.ios.withPodfilePostInstall(config);
23
28
  return config;
24
29
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_configPlugins","require","_ios","pkg","name","withMapLibre","config","ios","withExcludedSimulatorArchitectures","withDwarfDsym","withoutSignatures","withPodfilePostInstall","_default","exports","default","createRunOncePlugin","version"],"sourceRoot":"../../../src","sources":["plugin/withMapLibre.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAEA,IAAAC,IAAA,GAAAD,OAAA;AAEA,IAAIE,GAAuC,GAAG;EAC5CC,IAAI,EAAE;AACR,CAAC;AACD,IAAI;EACFD,GAAG,GAAGF,OAAO,CAAC,8CAA8C,CAAC;AAC/D,CAAC,CAAC,MAAM;EACN;AAAA;AAGF,MAAMI,YAA0B,GAAIC,MAAM,IAAK;EAC7C;EACAA,MAAM,GAAGC,QAAG,CAACC,kCAAkC,CAACF,MAAM,CAAC;EACvDA,MAAM,GAAGC,QAAG,CAACE,aAAa,CAACH,MAAM,CAAC;EAClCA,MAAM,GAAGC,QAAG,CAACG,iBAAiB,CAACJ,MAAM,CAAC;EACtCA,MAAM,GAAGC,QAAG,CAACI,sBAAsB,CAACL,MAAM,CAAC;EAE3C,OAAOA,MAAM;AACf,CAAC;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,kCAAmB,EAACV,YAAY,EAAEF,GAAG,CAACC,IAAI,EAAED,GAAG,CAACa,OAAO,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_configPlugins","require","_android","_ios","pkg","name","withMapLibre","config","props","android","withGradleProperties","ios","withExcludedSimulatorArchitectures","withDwarfDsym","withoutSignatures","withPodfileGlobalVariables","withPodfilePostInstall","_default","exports","default","createRunOncePlugin","version"],"sourceRoot":"../../../src","sources":["plugin/withMapLibre.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAGA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AAEA,IAAIG,GAAuC,GAAG;EAC5CC,IAAI,EAAE;AACR,CAAC;AACD,IAAI;EACFD,GAAG,GAAGH,OAAO,CAAC,8CAA8C,CAAC;AAC/D,CAAC,CAAC,MAAM;EACN;AAAA;AAGF,MAAMK,YAA+C,GAAGA,CAACC,MAAM,EAAEC,KAAK,KAAK;EACzE;EACAD,MAAM,GAAGE,gBAAO,CAACC,oBAAoB,CAACH,MAAM,EAAEC,KAAK,CAAC;;EAEpD;EACAD,MAAM,GAAGI,QAAG,CAACC,kCAAkC,CAACL,MAAM,CAAC;EACvDA,MAAM,GAAGI,QAAG,CAACE,aAAa,CAACN,MAAM,CAAC;EAClCA,MAAM,GAAGI,QAAG,CAACG,iBAAiB,CAACP,MAAM,CAAC;EACtCA,MAAM,GAAGI,QAAG,CAACI,0BAA0B,CAACR,MAAM,EAAEC,KAAK,CAAC;EACtDD,MAAM,GAAGI,QAAG,CAACK,sBAAsB,CAACT,MAAM,CAAC;EAE3C,OAAOA,MAAM;AACf,CAAC;AAAC,IAAAU,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,kCAAmB,EAACd,YAAY,EAAEF,GAAG,CAACC,IAAI,EAAED,GAAG,CAACiB,OAAO,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=MapLibrePluginProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["plugin/MapLibrePluginProps.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ import { withGradleProperties as withGradlePropertiesExpo } from "@expo/config-plugins";
4
+ export const getGradleProperties = props => {
5
+ return Object.entries(props?.android || {}).reduce((properties, [key, value]) => {
6
+ if (key && value) {
7
+ properties.push({
8
+ type: "property",
9
+ key: `org.maplibre.reactnative.${key}`,
10
+ value: value.toString()
11
+ });
12
+ }
13
+ return properties;
14
+ }, []);
15
+ };
16
+ export const mergeGradleProperties = (oldProperties, newProperties) => {
17
+ const newPropertiesKeys = newProperties.map(({
18
+ key
19
+ }) => key);
20
+ const merged = oldProperties.filter(item => !(item.type === "property" && newPropertiesKeys.includes(item.key)));
21
+ merged.push(...newProperties);
22
+ return merged;
23
+ };
24
+ export const withGradleProperties = (config, props) => {
25
+ const gradleProperties = getGradleProperties(props);
26
+ return withGradlePropertiesExpo(config, c => {
27
+ c.modResults = mergeGradleProperties(c.modResults, gradleProperties);
28
+ return c;
29
+ });
30
+ };
31
+ export const android = {
32
+ withGradleProperties
33
+ };
34
+ //# sourceMappingURL=android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["withGradleProperties","withGradlePropertiesExpo","getGradleProperties","props","Object","entries","android","reduce","properties","key","value","push","type","toString","mergeGradleProperties","oldProperties","newProperties","newPropertiesKeys","map","merged","filter","item","includes","config","gradleProperties","c","modResults"],"sourceRoot":"../../../src","sources":["plugin/android.ts"],"mappings":";;AAAA,SAEEA,oBAAoB,IAAIC,wBAAwB,QAC3C,sBAAsB;AAW7B,OAAO,MAAMC,mBAAmB,GAC9BC,KAA0B,IACP;EACnB,OAAOC,MAAM,CAACC,OAAO,CAACF,KAAK,EAAEG,OAAO,IAAI,CAAC,CAAC,CAAC,CAACC,MAAM,CAChD,CAACC,UAAU,EAAE,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK;IAC5B,IAAID,GAAG,IAAIC,KAAK,EAAE;MAChBF,UAAU,CAACG,IAAI,CAAC;QACdC,IAAI,EAAE,UAAU;QAChBH,GAAG,EAAE,4BAA4BA,GAAG,EAAE;QACtCC,KAAK,EAAEA,KAAK,CAACG,QAAQ,CAAC;MACxB,CAAC,CAAC;IACJ;IAEA,OAAOL,UAAU;EACnB,CAAC,EACD,EACF,CAAC;AACH,CAAC;AAED,OAAO,MAAMM,qBAAqB,GAAGA,CACnCC,aAA+B,EAC/BC,aAA6B,KACR;EACrB,MAAMC,iBAAiB,GAAGD,aAAa,CAACE,GAAG,CAAC,CAAC;IAAET;EAAI,CAAC,KAAKA,GAAG,CAAC;EAC7D,MAAMU,MAAM,GAAGJ,aAAa,CAACK,MAAM,CAChCC,IAAI,IACH,EAAEA,IAAI,CAACT,IAAI,KAAK,UAAU,IAAIK,iBAAiB,CAACK,QAAQ,CAACD,IAAI,CAACZ,GAAG,CAAC,CACtE,CAAC;EAEDU,MAAM,CAACR,IAAI,CAAC,GAAGK,aAAa,CAAC;EAE7B,OAAOG,MAAM;AACf,CAAC;AAED,OAAO,MAAMnB,oBAAuD,GAAGA,CACrEuB,MAAM,EACNpB,KAAK,KACF;EACH,MAAMqB,gBAAgB,GAAGtB,mBAAmB,CAACC,KAAK,CAAC;EAEnD,OAAOF,wBAAwB,CAACsB,MAAM,EAAGE,CAAC,IAAK;IAC7CA,CAAC,CAACC,UAAU,GAAGZ,qBAAqB,CAACW,CAAC,CAACC,UAAU,EAAEF,gBAAgB,CAAC;IAEpE,OAAOC,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,MAAMnB,OAAO,GAAG;EACrBN;AACF,CAAC","ignoreList":[]}
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  import { withPodfile, withXcodeProject } from "@expo/config-plugins";
4
- import { mergeContents } from "@expo/config-plugins/build/utils/generateCode";
4
+ import { mergeContents, removeGeneratedContents } from "@expo/config-plugins/build/utils/generateCode";
5
+ const TAG_PREFIX = `@maplibre/maplibre-react-native`;
5
6
 
6
7
  /**
7
8
  * Only the post-install block is required, the post installer block is used for SPM (Swift Package Manager) which Expo
@@ -9,10 +10,10 @@ import { mergeContents } from "@expo/config-plugins/build/utils/generateCode";
9
10
  */
10
11
  export function applyPodfilePostInstall(contents) {
11
12
  const result = mergeContents({
12
- tag: `@maplibre/maplibre-react-native-post_installer`,
13
+ tag: `${TAG_PREFIX}:post-install`,
13
14
  src: contents,
14
15
  newSrc: ` $MLRN.post_install(installer)`,
15
- anchor: new RegExp(`post_install do \\|installer\\|`),
16
+ anchor: /post_install do \|installer\|/,
16
17
  offset: 1,
17
18
  comment: "#"
18
19
  });
@@ -27,6 +28,34 @@ const withPodfilePostInstall = config => {
27
28
  return c;
28
29
  });
29
30
  };
31
+ export const applyPodfileGlobalVariables = (contents, props) => {
32
+ const tag = `${TAG_PREFIX}:global-variables`;
33
+ const globalVariables = [];
34
+ if (props?.ios?.nativeVersion) {
35
+ globalVariables.push(`$MLRN_NATIVE_VERSION = "${props.ios.nativeVersion}"`);
36
+ }
37
+ if (props?.ios?.spmSpec) {
38
+ globalVariables.push(`$MLRN_SPM_SPEC = ${props.ios.spmSpec}`);
39
+ }
40
+ if (globalVariables.length > 0) {
41
+ return mergeContents({
42
+ tag,
43
+ src: contents,
44
+ newSrc: globalVariables.join("\n"),
45
+ anchor: /target .+ do/,
46
+ offset: 0,
47
+ comment: "#"
48
+ }).contents;
49
+ }
50
+ const modified = removeGeneratedContents(contents, tag);
51
+ return modified ?? contents;
52
+ };
53
+ export const withPodfileGlobalVariables = (config, props) => {
54
+ return withPodfile(config, c => {
55
+ c.modResults.contents = applyPodfileGlobalVariables(c.modResults.contents, props);
56
+ return c;
57
+ });
58
+ };
30
59
 
31
60
  /**
32
61
  * Exclude building for arm64 on simulator devices in the pbxproj project.
@@ -86,6 +115,7 @@ const withExcludedSimulatorArchitectures = config => {
86
115
  };
87
116
  export const ios = {
88
117
  withPodfilePostInstall,
118
+ withPodfileGlobalVariables,
89
119
  withoutSignatures,
90
120
  withDwarfDsym,
91
121
  withExcludedSimulatorArchitectures
@@ -1 +1 @@
1
- {"version":3,"names":["withPodfile","withXcodeProject","mergeContents","applyPodfilePostInstall","contents","result","tag","src","newSrc","anchor","RegExp","offset","comment","didMerge","didClear","withPodfilePostInstall","config","c","modResults","setExcludedArchitectures","project","configurations","pbxXCBuildConfigurationSection","name","buildSettings","Object","values","PRODUCT_NAME","withoutSignatures","addBuildPhase","shellPath","shellScript","withDwarfDsym","debugInformationFormat","withExcludedSimulatorArchitectures","ios"],"sourceRoot":"../../../src","sources":["plugin/ios.ts"],"mappings":";;AAAA,SAEEA,WAAW,EACXC,gBAAgB,QAEX,sBAAsB;AAC7B,SAASC,aAAa,QAAQ,+CAA+C;;AAE7E;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CAACC,QAAgB,EAAU;EAChE,MAAMC,MAAM,GAAGH,aAAa,CAAC;IAC3BI,GAAG,EAAE,gDAAgD;IACrDC,GAAG,EAAEH,QAAQ;IACbI,MAAM,EAAE,mCAAmC;IAC3CC,MAAM,EAAE,IAAIC,MAAM,CAAC,iCAAiC,CAAC;IACrDC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE;EACX,CAAC,CAAC;EAEF,IAAIP,MAAM,CAACQ,QAAQ,IAAIR,MAAM,CAACS,QAAQ,EAAE;IACtC,OAAOT,MAAM,CAACD,QAAQ;EACxB;EAEA,OAAOA,QAAQ;AACjB;AAEA,MAAMW,sBAAoC,GAAIC,MAAM,IAAK;EACvD,OAAOhB,WAAW,CAACgB,MAAM,EAAGC,CAAC,IAAK;IAChCA,CAAC,CAACC,UAAU,CAACd,QAAQ,GAAGD,uBAAuB,CAACc,CAAC,CAACC,UAAU,CAACd,QAAQ,CAAC;IAEtE,OAAOa,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA,SAASE,wBAAwBA,CAACC,OAAqB,EAAgB;EACrE,MAAMC,cAAc,GAAGD,OAAO,CAACE,8BAA8B,CAAC,CAAC;EAC/D;EACA;EACA,KAAK,MAAM;IAAEC,IAAI;IAAEC;EAAc,CAAC,IAAIC,MAAM,CAACC,MAAM,CAACL,cAAc,IAAI,CAAC,CAAC,CAAC,EAAE;IACzE;IACA;IACA,IACEE,IAAI,KAAK,SAAS,IAClB,OAAOC,aAAa,EAAEG,YAAY,KAAK,WAAW,EAClD;MACAH,aAAa,CAAC,wCAAwC,CAAC,GAAG,SAAS;IACrE;EACF;EAEA,OAAOJ,OAAO;AAChB;AAEA,MAAMQ,iBAA+B,GAAIZ,MAAM,IAAK;EAClD,OAAOf,gBAAgB,CAACe,MAAM,EAAE,MAAOC,CAAC,IAAK;IAC3CA,CAAC,CAACC,UAAU,CAACW,aAAa,CACxB,EAAE,EACF,0BAA0B,EAC1B,2CAA2C,EAC3C,IAAI,EACJ;MACEC,SAAS,EAAE,SAAS;MACpBC,WAAW,EAAE;AACrB;AACA;AACA;IACM,CACF,CAAC;IAED,OAAOd,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMe,aAA2B,GAAIhB,MAAM,IAAK;EAC9C,OAAOf,gBAAgB,CAACe,MAAM,EAAE,MAAOC,CAAC,IAAK;IAC3CA,CAAC,CAACC,UAAU,CAACe,sBAAsB,GAAG,iBAAiB;IAEvD,OAAOhB,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;AAED,MAAMiB,kCAAgD,GAAIlB,MAAM,IAAK;EACnE,OAAOf,gBAAgB,CAACe,MAAM,EAAGC,CAAC,IAAK;IACrCA,CAAC,CAACC,UAAU,GAAGC,wBAAwB,CAACF,CAAC,CAACC,UAAU,CAAC;IAErD,OAAOD,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,MAAMkB,GAAG,GAAG;EACjBpB,sBAAsB;EACtBa,iBAAiB;EACjBI,aAAa;EACbE;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["withPodfile","withXcodeProject","mergeContents","removeGeneratedContents","TAG_PREFIX","applyPodfilePostInstall","contents","result","tag","src","newSrc","anchor","offset","comment","didMerge","didClear","withPodfilePostInstall","config","c","modResults","applyPodfileGlobalVariables","props","globalVariables","ios","nativeVersion","push","spmSpec","length","join","modified","withPodfileGlobalVariables","setExcludedArchitectures","project","configurations","pbxXCBuildConfigurationSection","name","buildSettings","Object","values","PRODUCT_NAME","withoutSignatures","addBuildPhase","shellPath","shellScript","withDwarfDsym","debugInformationFormat","withExcludedSimulatorArchitectures"],"sourceRoot":"../../../src","sources":["plugin/ios.ts"],"mappings":";;AAAA,SAEEA,WAAW,EACXC,gBAAgB,QAEX,sBAAsB;AAC7B,SACEC,aAAa,EACbC,uBAAuB,QAClB,+CAA+C;AAItD,MAAMC,UAAU,GAAG,iCAAiC;;AAEpD;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CAACC,QAAgB,EAAU;EAChE,MAAMC,MAAM,GAAGL,aAAa,CAAC;IAC3BM,GAAG,EAAE,GAAGJ,UAAU,eAAe;IACjCK,GAAG,EAAEH,QAAQ;IACbI,MAAM,EAAE,mCAAmC;IAC3CC,MAAM,EAAE,+BAA+B;IACvCC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE;EACX,CAAC,CAAC;EAEF,IAAIN,MAAM,CAACO,QAAQ,IAAIP,MAAM,CAACQ,QAAQ,EAAE;IACtC,OAAOR,MAAM,CAACD,QAAQ;EACxB;EAEA,OAAOA,QAAQ;AACjB;AAEA,MAAMU,sBAAoC,GAAIC,MAAM,IAAK;EACvD,OAAOjB,WAAW,CAACiB,MAAM,EAAGC,CAAC,IAAK;IAChCA,CAAC,CAACC,UAAU,CAACb,QAAQ,GAAGD,uBAAuB,CAACa,CAAC,CAACC,UAAU,CAACb,QAAQ,CAAC;IAEtE,OAAOY,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,MAAME,2BAA2B,GAAGA,CACzCd,QAAgB,EAChBe,KAA0B,KACf;EACX,MAAMb,GAAG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AAM,CAACL,cAAc,IAAI,CAAC,CAAC,CAAC,EAAE;IACzE;IACA;IACA,IACEE,IAAI,KAAK,SAAS,IAClB,OAAOC,aAAa,EAAEG,YAAY,KAAK,WAAW,EAClD;MACAH,aAAa,CAAC,wCAAwC,CAAC,GAAG,SAAS;IACrE;EACF;EAEA,OAAOJ,OAAO;AAChB;AAEA,MAAMQ,iBAA+B,GAAIvB,MAAM,IAAK;EAClD,OAAOhB,gBAAgB,CAACgB,MAAM,EAAE,MAAOC,CAAC,IAAK;IAC3CA,CAAC,CAACC,UAAU,CAACsB,aAAa,CACxB,EAAE,EACF,0BAA0B,EAC1B,2CAA2C,EAC3C,IAAI,EACJ;MACEC,SAAS,EAAE,SAAS;MACpBC,WAAW,EAAE;AACrB;AACA;AACA;IACM,CACF,CAAC;IAED,OAAOzB,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM0B,aAA2B,GAAI3B,MAAM,IAAK;EAC9C,OAAOhB,gBAAgB,CAACgB,MAAM,EAAE,MAAOC,CAAC,IAAK;IAC3CA,CAAC,CAACC,UAAU,CAAC0B,sBAAsB,GAAG,iBAAiB;IAEvD,OAAO3B,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;AAED,MAAM4B,kCAAgD,GAAI7B,MAAM,IAAK;EACnE,OAAOhB,gBAAgB,CAACgB,MAAM,EAAGC,CAAC,IAAK;IACrCA,CAAC,CAACC,UAAU,GAAGY,wBAAwB,CAACb,CAAC,CAACC,UAAU,CAAC;IAErD,OAAOD,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,MAAMK,GAAG,GAAG;EACjBP,sBAAsB;EACtBc,0BAA0B;EAC1BU,iBAAiB;EACjBI,aAAa;EACbE;AACF,CAAC","ignoreList":[]}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  import { createRunOncePlugin } from "@expo/config-plugins";
4
+ import { android } from "./android.js";
4
5
  import { ios } from "./ios.js";
5
6
  let pkg = {
6
7
  name: "@maplibre/maplibre-react-native"
@@ -10,11 +11,15 @@ try {
10
11
  } catch {
11
12
  // empty catch block
12
13
  }
13
- const withMapLibre = config => {
14
+ const withMapLibre = (config, props) => {
15
+ // Android
16
+ config = android.withGradleProperties(config, props);
17
+
14
18
  // iOS
15
19
  config = ios.withExcludedSimulatorArchitectures(config);
16
20
  config = ios.withDwarfDsym(config);
17
21
  config = ios.withoutSignatures(config);
22
+ config = ios.withPodfileGlobalVariables(config, props);
18
23
  config = ios.withPodfilePostInstall(config);
19
24
  return config;
20
25
  };
@@ -1 +1 @@
1
- {"version":3,"names":["createRunOncePlugin","ios","pkg","name","require","withMapLibre","config","withExcludedSimulatorArchitectures","withDwarfDsym","withoutSignatures","withPodfilePostInstall","version"],"sourceRoot":"../../../src","sources":["plugin/withMapLibre.ts"],"mappings":";;AAAA,SAA4BA,mBAAmB,QAAQ,sBAAsB;AAE7E,SAASC,GAAG,QAAQ,UAAO;AAE3B,IAAIC,GAAuC,GAAG;EAC5CC,IAAI,EAAE;AACR,CAAC;AACD,IAAI;EACFD,GAAG,GAAGE,OAAO,CAAC,8CAA8C,CAAC;AAC/D,CAAC,CAAC,MAAM;EACN;AAAA;AAGF,MAAMC,YAA0B,GAAIC,MAAM,IAAK;EAC7C;EACAA,MAAM,GAAGL,GAAG,CAACM,kCAAkC,CAACD,MAAM,CAAC;EACvDA,MAAM,GAAGL,GAAG,CAACO,aAAa,CAACF,MAAM,CAAC;EAClCA,MAAM,GAAGL,GAAG,CAACQ,iBAAiB,CAACH,MAAM,CAAC;EACtCA,MAAM,GAAGL,GAAG,CAACS,sBAAsB,CAACJ,MAAM,CAAC;EAE3C,OAAOA,MAAM;AACf,CAAC;AAED,eAAeN,mBAAmB,CAACK,YAAY,EAAEH,GAAG,CAACC,IAAI,EAAED,GAAG,CAACS,OAAO,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createRunOncePlugin","android","ios","pkg","name","require","withMapLibre","config","props","withGradleProperties","withExcludedSimulatorArchitectures","withDwarfDsym","withoutSignatures","withPodfileGlobalVariables","withPodfilePostInstall","version"],"sourceRoot":"../../../src","sources":["plugin/withMapLibre.ts"],"mappings":";;AAAA,SAA4BA,mBAAmB,QAAQ,sBAAsB;AAG7E,SAASC,OAAO,QAAQ,cAAW;AACnC,SAASC,GAAG,QAAQ,UAAO;AAE3B,IAAIC,GAAuC,GAAG;EAC5CC,IAAI,EAAE;AACR,CAAC;AACD,IAAI;EACFD,GAAG,GAAGE,OAAO,CAAC,8CAA8C,CAAC;AAC/D,CAAC,CAAC,MAAM;EACN;AAAA;AAGF,MAAMC,YAA+C,GAAGA,CAACC,MAAM,EAAEC,KAAK,KAAK;EACzE;EACAD,MAAM,GAAGN,OAAO,CAACQ,oBAAoB,CAACF,MAAM,EAAEC,KAAK,CAAC;;EAEpD;EACAD,MAAM,GAAGL,GAAG,CAACQ,kCAAkC,CAACH,MAAM,CAAC;EACvDA,MAAM,GAAGL,GAAG,CAACS,aAAa,CAACJ,MAAM,CAAC;EAClCA,MAAM,GAAGL,GAAG,CAACU,iBAAiB,CAACL,MAAM,CAAC;EACtCA,MAAM,GAAGL,GAAG,CAACW,0BAA0B,CAACN,MAAM,EAAEC,KAAK,CAAC;EACtDD,MAAM,GAAGL,GAAG,CAACY,sBAAsB,CAACP,MAAM,CAAC;EAE3C,OAAOA,MAAM;AACf,CAAC;AAED,eAAeP,mBAAmB,CAACM,YAAY,EAAEH,GAAG,CAACC,IAAI,EAAED,GAAG,CAACY,OAAO,CAAC","ignoreList":[]}
@@ -48,4 +48,5 @@ export type { MapLibreRNEvent } from "./types/MapLibreRNEvent";
48
48
  export { Animated } from "./utils/animated/Animated";
49
49
  export { Logger, type LogLevel } from "./utils/Logger";
50
50
  export type { FillLayerStyle, LineLayerStyle, SymbolLayerStyle, CircleLayerStyle, HeatmapLayerStyle, FillExtrusionLayerStyle, RasterLayerStyle, HillshadeLayerStyle, BackgroundLayerStyle, LightLayerStyle, } from "./types/MapLibreRNStyles";
51
+ export type { MapLibrePluginProps } from "./plugin/MapLibrePluginProps";
51
52
  //# sourceMappingURL=MapLibreRN.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MapLibreRN.d.ts","sourceRoot":"","sources":["../../../../src/MapLibreRN.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,SAAS,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,OAAO,EACP,KAAK,UAAU,EACf,KAAK,aAAa,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,YAAY,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EACL,YAAY,EACZ,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE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ChB,MAAM,0BAA0B,CAAC;AAElC,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,77 @@
1
+ type VersionString = `${number}.${number}.${number}` | `${number}.${number}.${number}-${string}`;
2
+ export type MapLibrePluginProps = {
3
+ /**
4
+ * Properties relevant only for Android
5
+ *
6
+ * @platform android
7
+ */
8
+ android?: {
9
+ /**
10
+ * Version for `org.maplibre.gl:android-sdk`
11
+ */
12
+ nativeVersion?: VersionString;
13
+ /**
14
+ * Version for `org.maplibre.gl:android-plugin-*-v9`
15
+ */
16
+ pluginVersion?: VersionString;
17
+ /**
18
+ * Version for `org.maplibre.gl:android-sdk-turf`
19
+ */
20
+ turfVersion?: VersionString;
21
+ /**
22
+ * Version for `com.squareup.okhttp3:okhttp`
23
+ */
24
+ okhttpVersion?: VersionString;
25
+ /**
26
+ * Location engine to be used
27
+ *
28
+ * - `default`: Used per default from MapLibre; F-Droid compatible
29
+ * - `google`: Google Play Services Location Engine for higher precision; F-Droid incompatible
30
+ *
31
+ * @default "default"
32
+ */
33
+ locationEngine?: "default" | "google";
34
+ /**
35
+ * Version for `com.google.android.gms:play-services-location`, only used with `locationEngine: "google"`
36
+ */
37
+ googlePlayServicesLocationVersion?: VersionString;
38
+ };
39
+ /**
40
+ * Properties relevant only for iOS
41
+ *
42
+ * @platform ios
43
+ */
44
+ ios?: {
45
+ /**
46
+ * Version for `maplibre-gl-native-distribution`
47
+ */
48
+ nativeVersion?: VersionString;
49
+ /**
50
+ * Swift Package Manager spec to override the selected version range
51
+ *
52
+ * @default `{
53
+ * url: "https://github.com/maplibre/maplibre-gl-native-distribution",
54
+ * requirement: {
55
+ * kind: "exactVersion",
56
+ * version: $MLRN_NATIVE_VERSION
57
+ * },
58
+ * product_name: "MapLibre"
59
+ * }`
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * spmSpec: `{
64
+ * url: "https://github.com/maplibre/maplibre-gl-native-distribution",
65
+ * requirement: {
66
+ * kind: "upToNextMajorVersion",
67
+ * minimumVersion: "x.x.x"
68
+ * },
69
+ * product_name: "MapLibre"
70
+ * }`
71
+ * ```
72
+ */
73
+ spmSpec?: string;
74
+ };
75
+ } | undefined;
76
+ export {};
77
+ //# sourceMappingURL=MapLibrePluginProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapLibrePluginProps.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/MapLibrePluginProps.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,GACd,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,GAC/B,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAE9C,MAAM,MAAM,mBAAmB,GAC3B;IACE;;;;OAIG;IACH,OAAO,CAAC,EAAE;QACR;;WAEG;QACH,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B;;WAEG;QACH,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B;;WAEG;QACH,WAAW,CAAC,EAAE,aAAa,CAAC;QAC5B;;WAEG;QACH,aAAa,CAAC,EAAE,aAAa,CAAC;QAE9B;;;;;;;WAOG;QACH,cAAc,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;QACtC;;WAEG;QACH,iCAAiC,CAAC,EAAE,aAAa,CAAC;KACnD,CAAC;IAEF;;;;OAIG;IACH,GAAG,CAAC,EAAE;QACJ;;WAEG;QACH,aAAa,CAAC,EAAE,aAAa,CAAC;QAE9B;;;;;;;;;;;;;;;;;;;;;;;WAuBG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,GACD,SAAS,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type ConfigPlugin } from "@expo/config-plugins";
2
+ import type { PropertiesItem } from "@expo/config-plugins/build/android/Properties";
3
+ import type { MapLibrePluginProps } from "./MapLibrePluginProps";
4
+ type PropertyItem = {
5
+ type: "property";
6
+ key: string;
7
+ value: string;
8
+ };
9
+ export declare const getGradleProperties: (props: MapLibrePluginProps) => PropertyItem[];
10
+ export declare const mergeGradleProperties: (oldProperties: PropertiesItem[], newProperties: PropertyItem[]) => PropertiesItem[];
11
+ export declare const withGradleProperties: ConfigPlugin<MapLibrePluginProps>;
12
+ export declare const android: {
13
+ withGradleProperties: ConfigPlugin<MapLibrePluginProps>;
14
+ };
15
+ export {};
16
+ //# sourceMappingURL=android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/android.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAElB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,mBAAmB,UACvB,mBAAmB,KACzB,YAAY,EAed,CAAC;AAEF,eAAO,MAAM,qBAAqB,kBACjB,cAAc,EAAE,iBAChB,YAAY,EAAE,KAC5B,cAAc,EAUhB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,mBAAmB,CAWlE,CAAC;AAEF,eAAO,MAAM,OAAO;;CAEnB,CAAC"}
@@ -1,11 +1,15 @@
1
1
  import { type ConfigPlugin } from "@expo/config-plugins";
2
+ import type { MapLibrePluginProps } from "./MapLibrePluginProps";
2
3
  /**
3
4
  * Only the post-install block is required, the post installer block is used for SPM (Swift Package Manager) which Expo
4
5
  * doesn't currently support.
5
6
  */
6
7
  export declare function applyPodfilePostInstall(contents: string): string;
8
+ export declare const applyPodfileGlobalVariables: (contents: string, props: MapLibrePluginProps) => string;
9
+ export declare const withPodfileGlobalVariables: ConfigPlugin<MapLibrePluginProps>;
7
10
  export declare const ios: {
8
11
  withPodfilePostInstall: ConfigPlugin;
12
+ withPodfileGlobalVariables: ConfigPlugin<MapLibrePluginProps>;
9
13
  withoutSignatures: ConfigPlugin;
10
14
  withDwarfDsym: ConfigPlugin;
11
15
  withExcludedSimulatorArchitectures: ConfigPlugin;
@@ -1 +1 @@
1
- {"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/ios.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAIlB,MAAM,sBAAsB,CAAC;AAG9B;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAehE;AA+ED,eAAO,MAAM,GAAG;;;;;CAKf,CAAC"}
1
+ {"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/ios.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAIlB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAIjE;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAehE;AAUD,eAAO,MAAM,2BAA2B,aAC5B,MAAM,SACT,mBAAmB,KACzB,MA2BF,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,YAAY,CAAC,mBAAmB,CAYxE,CAAC;AAuEF,eAAO,MAAM,GAAG;;;;;;CAMf,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { type ConfigPlugin } from "@expo/config-plugins";
2
- declare const _default: ConfigPlugin<void>;
2
+ import type { MapLibrePluginProps } from "./MapLibrePluginProps";
3
+ declare const _default: ConfigPlugin<MapLibrePluginProps>;
3
4
  export default _default;
4
5
  //# sourceMappingURL=withMapLibre.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withMapLibre.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/withMapLibre.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,sBAAsB,CAAC;;AAuB9E,wBAAwE"}
1
+ {"version":3,"file":"withMapLibre.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/withMapLibre.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,sBAAsB,CAAC;AAE9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;;AA2BjE,wBAAwE"}
@@ -48,4 +48,5 @@ export type { MapLibreRNEvent } from "./types/MapLibreRNEvent";
48
48
  export { Animated } from "./utils/animated/Animated";
49
49
  export { Logger, type LogLevel } from "./utils/Logger";
50
50
  export type { FillLayerStyle, LineLayerStyle, SymbolLayerStyle, CircleLayerStyle, HeatmapLayerStyle, FillExtrusionLayerStyle, RasterLayerStyle, HillshadeLayerStyle, BackgroundLayerStyle, LightLayerStyle, } from "./types/MapLibreRNStyles";
51
+ export type { MapLibrePluginProps } from "./plugin/MapLibrePluginProps";
51
52
  //# sourceMappingURL=MapLibreRN.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MapLibreRN.d.ts","sourceRoot":"","sources":["../../../../src/MapLibreRN.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,SAAS,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,OAAO,EACP,KAAK,UAAU,EACf,KAAK,aAAa,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,YAAY,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,OAAO,E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BAA+B,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EACL,eAAe;AACf;;GAEG;AACH,eAAe,IAAI,eAAe,GACnC,MAAM,oCAAoC,CAAC;AAC5C,YAAY,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE/E,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACvD,YAAY,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAElC,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,77 @@
1
+ type VersionString = `${number}.${number}.${number}` | `${number}.${number}.${number}-${string}`;
2
+ export type MapLibrePluginProps = {
3
+ /**
4
+ * Properties relevant only for Android
5
+ *
6
+ * @platform android
7
+ */
8
+ android?: {
9
+ /**
10
+ * Version for `org.maplibre.gl:android-sdk`
11
+ */
12
+ nativeVersion?: VersionString;
13
+ /**
14
+ * Version for `org.maplibre.gl:android-plugin-*-v9`
15
+ */
16
+ pluginVersion?: VersionString;
17
+ /**
18
+ * Version for `org.maplibre.gl:android-sdk-turf`
19
+ */
20
+ turfVersion?: VersionString;
21
+ /**
22
+ * Version for `com.squareup.okhttp3:okhttp`
23
+ */
24
+ okhttpVersion?: VersionString;
25
+ /**
26
+ * Location engine to be used
27
+ *
28
+ * - `default`: Used per default from MapLibre; F-Droid compatible
29
+ * - `google`: Google Play Services Location Engine for higher precision; F-Droid incompatible
30
+ *
31
+ * @default "default"
32
+ */
33
+ locationEngine?: "default" | "google";
34
+ /**
35
+ * Version for `com.google.android.gms:play-services-location`, only used with `locationEngine: "google"`
36
+ */
37
+ googlePlayServicesLocationVersion?: VersionString;
38
+ };
39
+ /**
40
+ * Properties relevant only for iOS
41
+ *
42
+ * @platform ios
43
+ */
44
+ ios?: {
45
+ /**
46
+ * Version for `maplibre-gl-native-distribution`
47
+ */
48
+ nativeVersion?: VersionString;
49
+ /**
50
+ * Swift Package Manager spec to override the selected version range
51
+ *
52
+ * @default `{
53
+ * url: "https://github.com/maplibre/maplibre-gl-native-distribution",
54
+ * requirement: {
55
+ * kind: "exactVersion",
56
+ * version: $MLRN_NATIVE_VERSION
57
+ * },
58
+ * product_name: "MapLibre"
59
+ * }`
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * spmSpec: `{
64
+ * url: "https://github.com/maplibre/maplibre-gl-native-distribution",
65
+ * requirement: {
66
+ * kind: "upToNextMajorVersion",
67
+ * minimumVersion: "x.x.x"
68
+ * },
69
+ * product_name: "MapLibre"
70
+ * }`
71
+ * ```
72
+ */
73
+ spmSpec?: string;
74
+ };
75
+ } | undefined;
76
+ export {};
77
+ //# sourceMappingURL=MapLibrePluginProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapLibrePluginProps.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/MapLibrePluginProps.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,GACd,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,GAC/B,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAE9C,MAAM,MAAM,mBAAmB,GAC3B;IACE;;;;OAIG;IACH,OAAO,CAAC,EAAE;QACR;;WAEG;QACH,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B;;WAEG;QACH,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B;;WAEG;QACH,WAAW,CAAC,EAAE,aAAa,CAAC;QAC5B;;WAEG;QACH,aAAa,CAAC,EAAE,aAAa,CAAC;QAE9B;;;;;;;WAOG;QACH,cAAc,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;QACtC;;WAEG;QACH,iCAAiC,CAAC,EAAE,aAAa,CAAC;KACnD,CAAC;IAEF;;;;OAIG;IACH,GAAG,CAAC,EAAE;QACJ;;WAEG;QACH,aAAa,CAAC,EAAE,aAAa,CAAC;QAE9B;;;;;;;;;;;;;;;;;;;;;;;WAuBG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,GACD,SAAS,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type ConfigPlugin } from "@expo/config-plugins";
2
+ import type { PropertiesItem } from "@expo/config-plugins/build/android/Properties";
3
+ import type { MapLibrePluginProps } from "./MapLibrePluginProps";
4
+ type PropertyItem = {
5
+ type: "property";
6
+ key: string;
7
+ value: string;
8
+ };
9
+ export declare const getGradleProperties: (props: MapLibrePluginProps) => PropertyItem[];
10
+ export declare const mergeGradleProperties: (oldProperties: PropertiesItem[], newProperties: PropertyItem[]) => PropertiesItem[];
11
+ export declare const withGradleProperties: ConfigPlugin<MapLibrePluginProps>;
12
+ export declare const android: {
13
+ withGradleProperties: ConfigPlugin<MapLibrePluginProps>;
14
+ };
15
+ export {};
16
+ //# sourceMappingURL=android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/android.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAElB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,mBAAmB,UACvB,mBAAmB,KACzB,YAAY,EAed,CAAC;AAEF,eAAO,MAAM,qBAAqB,kBACjB,cAAc,EAAE,iBAChB,YAAY,EAAE,KAC5B,cAAc,EAUhB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,mBAAmB,CAWlE,CAAC;AAEF,eAAO,MAAM,OAAO;;CAEnB,CAAC"}
@@ -1,11 +1,15 @@
1
1
  import { type ConfigPlugin } from "@expo/config-plugins";
2
+ import type { MapLibrePluginProps } from "./MapLibrePluginProps";
2
3
  /**
3
4
  * Only the post-install block is required, the post installer block is used for SPM (Swift Package Manager) which Expo
4
5
  * doesn't currently support.
5
6
  */
6
7
  export declare function applyPodfilePostInstall(contents: string): string;
8
+ export declare const applyPodfileGlobalVariables: (contents: string, props: MapLibrePluginProps) => string;
9
+ export declare const withPodfileGlobalVariables: ConfigPlugin<MapLibrePluginProps>;
7
10
  export declare const ios: {
8
11
  withPodfilePostInstall: ConfigPlugin;
12
+ withPodfileGlobalVariables: ConfigPlugin<MapLibrePluginProps>;
9
13
  withoutSignatures: ConfigPlugin;
10
14
  withDwarfDsym: ConfigPlugin;
11
15
  withExcludedSimulatorArchitectures: ConfigPlugin;
@@ -1 +1 @@
1
- {"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/ios.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAIlB,MAAM,sBAAsB,CAAC;AAG9B;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAehE;AA+ED,eAAO,MAAM,GAAG;;;;;CAKf,CAAC"}
1
+ {"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/ios.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAIlB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAIjE;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAehE;AAUD,eAAO,MAAM,2BAA2B,aAC5B,MAAM,SACT,mBAAmB,KACzB,MA2BF,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,YAAY,CAAC,mBAAmB,CAYxE,CAAC;AAuEF,eAAO,MAAM,GAAG;;;;;;CAMf,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { type ConfigPlugin } from "@expo/config-plugins";
2
- declare const _default: ConfigPlugin<void>;
2
+ import type { MapLibrePluginProps } from "./MapLibrePluginProps";
3
+ declare const _default: ConfigPlugin<MapLibrePluginProps>;
3
4
  export default _default;
4
5
  //# sourceMappingURL=withMapLibre.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withMapLibre.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/withMapLibre.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,sBAAsB,CAAC;;AAuB9E,wBAAwE"}
1
+ {"version":3,"file":"withMapLibre.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/withMapLibre.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,sBAAsB,CAAC;AAE9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;;AA2BjE,wBAAwE"}
@@ -2,6 +2,17 @@ require 'json'
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
4
 
5
+ # Global Variable Defaults
6
+ $MLRN_NATIVE_VERSION ||= "6.10.0"
7
+ $MLRN_SPM_SPEC ||= {
8
+ url: "https://github.com/maplibre/maplibre-gl-native-distribution",
9
+ requirement: {
10
+ kind: "exactVersion",
11
+ version: $MLRN_NATIVE_VERSION
12
+ },
13
+ product_name: "MapLibre"
14
+ }
15
+
5
16
  $MLRN = Object.new
6
17
 
7
18
  def $MLRN._add_spm_to_target(project, target, url, requirement, product_name)
@@ -24,18 +35,8 @@ def $MLRN._add_spm_to_target(project, target, url, requirement, product_name)
24
35
  end
25
36
 
26
37
  def $MLRN.post_install(installer)
27
- spm_spec = {
28
- url: "https://github.com/maplibre/maplibre-gl-native-distribution",
29
- requirement: {
30
- kind: "exactVersion",
31
- version: "6.9.0"
32
- },
33
- product_name: "MapLibre"
34
- }
38
+ spm_spec = $MLRN_SPM_SPEC
35
39
 
36
- if $MLRN_SPM_Spec.is_a?(Hash)
37
- spm_spec = $MLRN_SPM_Spec
38
- end
39
40
  project = installer.pods_project
40
41
  self._add_spm_to_target(
41
42
  project,
@@ -61,9 +62,9 @@ def $MLRN.post_install(installer)
61
62
  end
62
63
 
63
64
  Pod::Spec.new do |s|
64
- s.name = "maplibre-react-native"
65
- s.summary = "React Native library for creating maps with MapLibre Native"
66
- s.version = package['version']
65
+ s.name = "maplibre-react-native"
66
+ s.summary = "React Native library for creating maps with MapLibre Native"
67
+ s.version = package['version']
67
68
  s.authors = { "MapLibre" => "" }
68
69
  s.homepage = "https://github.com/maplibre/maplibre-react-native"
69
70
  s.source = { :git => "https://github.com/maplibre/maplibre-react-native.git" }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maplibre/maplibre-react-native",
3
3
  "description": "React Native library for creating maps with MapLibre Native for Android & iOS",
4
- "version": "10.0.0-beta.18",
4
+ "version": "10.0.0-beta.19",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "provenance": true
package/src/MapLibreRN.ts CHANGED
@@ -83,3 +83,5 @@ export type {
83
83
  BackgroundLayerStyle,
84
84
  LightLayerStyle,
85
85
  } from "./types/MapLibreRNStyles";
86
+
87
+ export type { MapLibrePluginProps } from "./plugin/MapLibrePluginProps";
@@ -0,0 +1,83 @@
1
+ type VersionString =
2
+ | `${number}.${number}.${number}`
3
+ | `${number}.${number}.${number}-${string}`;
4
+
5
+ export type MapLibrePluginProps =
6
+ | {
7
+ /**
8
+ * Properties relevant only for Android
9
+ *
10
+ * @platform android
11
+ */
12
+ android?: {
13
+ /**
14
+ * Version for `org.maplibre.gl:android-sdk`
15
+ */
16
+ nativeVersion?: VersionString;
17
+ /**
18
+ * Version for `org.maplibre.gl:android-plugin-*-v9`
19
+ */
20
+ pluginVersion?: VersionString;
21
+ /**
22
+ * Version for `org.maplibre.gl:android-sdk-turf`
23
+ */
24
+ turfVersion?: VersionString;
25
+ /**
26
+ * Version for `com.squareup.okhttp3:okhttp`
27
+ */
28
+ okhttpVersion?: VersionString;
29
+
30
+ /**
31
+ * Location engine to be used
32
+ *
33
+ * - `default`: Used per default from MapLibre; F-Droid compatible
34
+ * - `google`: Google Play Services Location Engine for higher precision; F-Droid incompatible
35
+ *
36
+ * @default "default"
37
+ */
38
+ locationEngine?: "default" | "google";
39
+ /**
40
+ * Version for `com.google.android.gms:play-services-location`, only used with `locationEngine: "google"`
41
+ */
42
+ googlePlayServicesLocationVersion?: VersionString;
43
+ };
44
+
45
+ /**
46
+ * Properties relevant only for iOS
47
+ *
48
+ * @platform ios
49
+ */
50
+ ios?: {
51
+ /**
52
+ * Version for `maplibre-gl-native-distribution`
53
+ */
54
+ nativeVersion?: VersionString;
55
+
56
+ /**
57
+ * Swift Package Manager spec to override the selected version range
58
+ *
59
+ * @default `{
60
+ * url: "https://github.com/maplibre/maplibre-gl-native-distribution",
61
+ * requirement: {
62
+ * kind: "exactVersion",
63
+ * version: $MLRN_NATIVE_VERSION
64
+ * },
65
+ * product_name: "MapLibre"
66
+ * }`
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * spmSpec: `{
71
+ * url: "https://github.com/maplibre/maplibre-gl-native-distribution",
72
+ * requirement: {
73
+ * kind: "upToNextMajorVersion",
74
+ * minimumVersion: "x.x.x"
75
+ * },
76
+ * product_name: "MapLibre"
77
+ * }`
78
+ * ```
79
+ */
80
+ spmSpec?: string;
81
+ };
82
+ }
83
+ | undefined;
@@ -0,0 +1,64 @@
1
+ import {
2
+ type ConfigPlugin,
3
+ withGradleProperties as withGradlePropertiesExpo,
4
+ } from "@expo/config-plugins";
5
+ import type { PropertiesItem } from "@expo/config-plugins/build/android/Properties";
6
+
7
+ import type { MapLibrePluginProps } from "./MapLibrePluginProps";
8
+
9
+ type PropertyItem = {
10
+ type: "property";
11
+ key: string;
12
+ value: string;
13
+ };
14
+
15
+ export const getGradleProperties = (
16
+ props: MapLibrePluginProps,
17
+ ): PropertyItem[] => {
18
+ return Object.entries(props?.android || {}).reduce(
19
+ (properties, [key, value]) => {
20
+ if (key && value) {
21
+ properties.push({
22
+ type: "property",
23
+ key: `org.maplibre.reactnative.${key}`,
24
+ value: value.toString(),
25
+ });
26
+ }
27
+
28
+ return properties;
29
+ },
30
+ [] as PropertyItem[],
31
+ );
32
+ };
33
+
34
+ export const mergeGradleProperties = (
35
+ oldProperties: PropertiesItem[],
36
+ newProperties: PropertyItem[],
37
+ ): PropertiesItem[] => {
38
+ const newPropertiesKeys = newProperties.map(({ key }) => key);
39
+ const merged = oldProperties.filter(
40
+ (item) =>
41
+ !(item.type === "property" && newPropertiesKeys.includes(item.key)),
42
+ );
43
+
44
+ merged.push(...newProperties);
45
+
46
+ return merged;
47
+ };
48
+
49
+ export const withGradleProperties: ConfigPlugin<MapLibrePluginProps> = (
50
+ config,
51
+ props,
52
+ ) => {
53
+ const gradleProperties = getGradleProperties(props);
54
+
55
+ return withGradlePropertiesExpo(config, (c) => {
56
+ c.modResults = mergeGradleProperties(c.modResults, gradleProperties);
57
+
58
+ return c;
59
+ });
60
+ };
61
+
62
+ export const android = {
63
+ withGradleProperties,
64
+ };
package/src/plugin/ios.ts CHANGED
@@ -4,7 +4,14 @@ import {
4
4
  withXcodeProject,
5
5
  type XcodeProject,
6
6
  } from "@expo/config-plugins";
7
- import { mergeContents } from "@expo/config-plugins/build/utils/generateCode";
7
+ import {
8
+ mergeContents,
9
+ removeGeneratedContents,
10
+ } from "@expo/config-plugins/build/utils/generateCode";
11
+
12
+ import type { MapLibrePluginProps } from "./MapLibrePluginProps";
13
+
14
+ const TAG_PREFIX = `@maplibre/maplibre-react-native`;
8
15
 
9
16
  /**
10
17
  * Only the post-install block is required, the post installer block is used for SPM (Swift Package Manager) which Expo
@@ -12,10 +19,10 @@ import { mergeContents } from "@expo/config-plugins/build/utils/generateCode";
12
19
  */
13
20
  export function applyPodfilePostInstall(contents: string): string {
14
21
  const result = mergeContents({
15
- tag: `@maplibre/maplibre-react-native-post_installer`,
22
+ tag: `${TAG_PREFIX}:post-install`,
16
23
  src: contents,
17
24
  newSrc: ` $MLRN.post_install(installer)`,
18
- anchor: new RegExp(`post_install do \\|installer\\|`),
25
+ anchor: /post_install do \|installer\|/,
19
26
  offset: 1,
20
27
  comment: "#",
21
28
  });
@@ -35,6 +42,52 @@ const withPodfilePostInstall: ConfigPlugin = (config) => {
35
42
  });
36
43
  };
37
44
 
45
+ export const applyPodfileGlobalVariables = (
46
+ contents: string,
47
+ props: MapLibrePluginProps,
48
+ ): string => {
49
+ const tag = `${TAG_PREFIX}:global-variables`;
50
+
51
+ const globalVariables = [];
52
+
53
+ if (props?.ios?.nativeVersion) {
54
+ globalVariables.push(`$MLRN_NATIVE_VERSION = "${props.ios.nativeVersion}"`);
55
+ }
56
+
57
+ if (props?.ios?.spmSpec) {
58
+ globalVariables.push(`$MLRN_SPM_SPEC = ${props.ios.spmSpec}`);
59
+ }
60
+
61
+ if (globalVariables.length > 0) {
62
+ return mergeContents({
63
+ tag,
64
+ src: contents,
65
+ newSrc: globalVariables.join("\n"),
66
+ anchor: /target .+ do/,
67
+ offset: 0,
68
+ comment: "#",
69
+ }).contents;
70
+ }
71
+
72
+ const modified = removeGeneratedContents(contents, tag);
73
+
74
+ return modified ?? contents;
75
+ };
76
+
77
+ export const withPodfileGlobalVariables: ConfigPlugin<MapLibrePluginProps> = (
78
+ config,
79
+ props,
80
+ ) => {
81
+ return withPodfile(config, (c) => {
82
+ c.modResults.contents = applyPodfileGlobalVariables(
83
+ c.modResults.contents,
84
+ props,
85
+ );
86
+
87
+ return c;
88
+ });
89
+ };
90
+
38
91
  /**
39
92
  * Exclude building for arm64 on simulator devices in the pbxproj project.
40
93
  * Without this, production builds targeting simulators will fail.
@@ -106,6 +159,7 @@ const withExcludedSimulatorArchitectures: ConfigPlugin = (config) => {
106
159
 
107
160
  export const ios = {
108
161
  withPodfilePostInstall,
162
+ withPodfileGlobalVariables,
109
163
  withoutSignatures,
110
164
  withDwarfDsym,
111
165
  withExcludedSimulatorArchitectures,
@@ -1,5 +1,7 @@
1
1
  import { type ConfigPlugin, createRunOncePlugin } from "@expo/config-plugins";
2
2
 
3
+ import type { MapLibrePluginProps } from "./MapLibrePluginProps";
4
+ import { android } from "./android";
3
5
  import { ios } from "./ios";
4
6
 
5
7
  let pkg: { name: string; version?: string } = {
@@ -11,11 +13,15 @@ try {
11
13
  // empty catch block
12
14
  }
13
15
 
14
- const withMapLibre: ConfigPlugin = (config) => {
16
+ const withMapLibre: ConfigPlugin<MapLibrePluginProps> = (config, props) => {
17
+ // Android
18
+ config = android.withGradleProperties(config, props);
19
+
15
20
  // iOS
16
21
  config = ios.withExcludedSimulatorArchitectures(config);
17
22
  config = ios.withDwarfDsym(config);
18
23
  config = ios.withoutSignatures(config);
24
+ config = ios.withPodfileGlobalVariables(config, props);
19
25
  config = ios.withPodfilePostInstall(config);
20
26
 
21
27
  return config;