@maplibre/maplibre-react-native 10.0.0-alpha.26 → 10.0.0-alpha.27

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 (47) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/android/src/main/java/com/maplibre/rctmln/components/styles/RCTMLNStyleFactory.java +1 -1
  3. package/docs/Annotation.md +1 -1
  4. package/docs/BackgroundLayer.md +1 -1
  5. package/docs/Callout.md +1 -1
  6. package/docs/Camera.md +1 -1
  7. package/docs/CircleLayer.md +1 -1
  8. package/docs/FillExtrusionLayer.md +1 -1
  9. package/docs/FillLayer.md +1 -1
  10. package/docs/HeadingIndicator.md +1 -1
  11. package/docs/HeatmapLayer.md +1 -1
  12. package/docs/ImageSource.md +1 -1
  13. package/docs/Images.md +1 -1
  14. package/docs/Light.md +1 -1
  15. package/docs/LineLayer.md +1 -1
  16. package/docs/MapView.md +1 -1
  17. package/docs/MarkerView.md +1 -1
  18. package/docs/NativeUserLocation.md +1 -1
  19. package/docs/PointAnnotation.md +1 -1
  20. package/docs/RasterLayer.md +1 -1
  21. package/docs/RasterSource.md +1 -1
  22. package/docs/ShapeSource.md +1 -1
  23. package/docs/Style.md +1 -1
  24. package/docs/SymbolLayer.md +1 -1
  25. package/docs/UserLocation.md +1 -1
  26. package/docs/VectorSource.md +1 -1
  27. package/docs/coordinates.md +1 -1
  28. package/docs/location.md +1 -1
  29. package/docs/offlineManager.md +1 -1
  30. package/docs/snapshotManager.md +1 -1
  31. package/ios/RCTMLN/RCTMLNStyle.h +1 -1
  32. package/ios/RCTMLN/RCTMLNStyle.m +1 -1
  33. package/javascript/utils/MaplibreStyles.d.ts +3 -1
  34. package/javascript/utils/index.ts +8 -7
  35. package/javascript/utils/styleMap.ts +1 -1
  36. package/package.json +1 -1
  37. package/scripts/codegen.ts +12 -8
  38. package/scripts/templates/MaplibreStyles.ts.ejs +3 -1
  39. package/scripts/templates/RCTMLNStyle.h.ejs +2 -2
  40. package/scripts/templates/RCTMLNStyle.m.ejs +2 -2
  41. package/scripts/templates/RCTMLNStyleFactory.java.ejs +2 -2
  42. package/scripts/templates/component.md.ejs +2 -2
  43. package/scripts/templates/styleMap.ts.ejs +2 -2
  44. package/scripts/utils/MarkdownBuilder.ts +4 -4
  45. package/scripts/utils/TemplateHelpers.ts +6 -0
  46. package/ios/RCTMLN/index.d.ts +0 -1183
  47. package/scripts/templates/index.d.ts.ejs +0 -86
@@ -1,86 +0,0 @@
1
- <%
2
- const layers = locals.layers;
3
- const helpers = locals.helpers;
4
- -%>
5
- // DO NOT MODIFY
6
- // THIS FILE IS AUTOGENERATED
7
-
8
- import { isAndroid } from './index';
9
-
10
- export const StyleTypes = {
11
- Constant: 'constant',
12
- Color: 'color',
13
- Transition: 'transition',
14
- Translation: 'translation',
15
- Function: 'function',
16
- Image: 'image',
17
- Enum: 'enum',
18
- };
19
-
20
- const styleMap = {
21
- <%_ for (let layer of layers) { _%>
22
- <%_ for (let prop of layer.properties) { _%>
23
- <%_ if (!['color', 'colorTransition', 'visibility'].includes(prop.name)) { _%>
24
- <%= prop.name %>: <%- helpers.jsStyleType(prop) %>,
25
- <%_ if (prop.transition) { _%>
26
- <%= prop.name %>Transition: StyleTypes.Transition,
27
- <%_ } _%>
28
- <%_ } _%>
29
- <%_ } _%>
30
-
31
- <%_ } _%>
32
-
33
- color: StyleTypes.Color,
34
- colorTransition: StyleTypes.Transition,
35
- visibility: StyleTypes.Constant,
36
- };
37
-
38
- export const styleExtras = {
39
- // padding
40
- iconTextFitPadding: {
41
- iosType: 'edgeinsets',
42
- },
43
-
44
- // offsets
45
- iconOffset: {
46
- iosType: 'vector',
47
- },
48
- textOffset: {
49
- iosType: 'vector',
50
- },
51
- lineOffset: {
52
- iosType: 'vector',
53
- },
54
-
55
- // translates
56
- fillTranslate: {
57
- iosType: 'vector',
58
- },
59
- lineTranslate: {
60
- iosType: 'vector',
61
- },
62
- iconTranslate: {
63
- iosType: 'vector',
64
- },
65
- textTranslate: {
66
- iosType: 'vector',
67
- },
68
- circleTranslate: {
69
- iosType: 'vector',
70
- },
71
- fillExtrusionTranslate: {
72
- iosType: 'vector',
73
- },
74
- };
75
-
76
- export function getStyleType(styleProp: keyof typeof styleExtras) {
77
- if (!isAndroid() && styleExtras[styleProp]) {
78
- return styleExtras[styleProp].iosType;
79
- }
80
-
81
- if (styleMap[styleProp]) {
82
- return styleMap[styleProp];
83
- }
84
-
85
- throw new Error(`${styleProp} is not a valid Mapbox layer style`);
86
- }