@maplibre/maplibre-react-native 10.0.0-alpha.27 → 10.0.0-alpha.28
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.
- package/CHANGELOG.md +4 -0
- package/README.md +2 -2
- package/lib/commonjs/MLNModule.js +27 -0
- package/lib/commonjs/MLNModule.js.map +1 -0
- package/lib/commonjs/MapLibreRN.js +281 -0
- package/lib/commonjs/MapLibreRN.js.map +1 -0
- package/lib/commonjs/assets/png.d.js +2 -0
- package/lib/commonjs/assets/png.d.js.map +1 -0
- package/lib/commonjs/components/Annotation.js +109 -0
- package/lib/commonjs/components/Annotation.js.map +1 -0
- package/lib/commonjs/components/BackgroundLayer.js +33 -0
- package/lib/commonjs/components/BackgroundLayer.js.map +1 -0
- package/lib/commonjs/components/Callout.js +101 -0
- package/lib/commonjs/components/Callout.js.map +1 -0
- package/lib/commonjs/components/Camera.js +285 -0
- package/lib/commonjs/components/Camera.js.map +1 -0
- package/lib/commonjs/components/CircleLayer.js +37 -0
- package/lib/commonjs/components/CircleLayer.js.map +1 -0
- package/lib/commonjs/components/FillExtrusionLayer.js +36 -0
- package/lib/commonjs/components/FillExtrusionLayer.js.map +1 -0
- package/lib/commonjs/components/FillLayer.js +36 -0
- package/lib/commonjs/components/FillLayer.js.map +1 -0
- package/lib/commonjs/components/HeadingIndicator.js +28 -0
- package/lib/commonjs/components/HeadingIndicator.js.map +1 -0
- package/lib/commonjs/components/HeatmapLayer.js +35 -0
- package/lib/commonjs/components/HeatmapLayer.js.map +1 -0
- package/lib/commonjs/components/ImageSource.js +42 -0
- package/lib/commonjs/components/ImageSource.js.map +1 -0
- package/lib/commonjs/components/Images.js +80 -0
- package/lib/commonjs/components/Images.js.map +1 -0
- package/lib/commonjs/components/Light.js +32 -0
- package/lib/commonjs/components/Light.js.map +1 -0
- package/lib/commonjs/components/LineLayer.js +36 -0
- package/lib/commonjs/components/LineLayer.js.map +1 -0
- package/lib/commonjs/components/MapView.js +463 -0
- package/lib/commonjs/components/MapView.js.map +1 -0
- package/lib/commonjs/components/MarkerView.js +61 -0
- package/lib/commonjs/components/MarkerView.js.map +1 -0
- package/lib/commonjs/components/NativeUserLocation.js +17 -0
- package/lib/commonjs/components/NativeUserLocation.js.map +1 -0
- package/lib/commonjs/components/PointAnnotation.js +121 -0
- package/lib/commonjs/components/PointAnnotation.js.map +1 -0
- package/lib/commonjs/components/RasterLayer.js +32 -0
- package/lib/commonjs/components/RasterLayer.js.map +1 -0
- package/lib/commonjs/components/RasterSource.js +67 -0
- package/lib/commonjs/components/RasterSource.js.map +1 -0
- package/lib/commonjs/components/ShapeSource.js +203 -0
- package/lib/commonjs/components/ShapeSource.js.map +1 -0
- package/lib/commonjs/components/Style.js +266 -0
- package/lib/commonjs/components/Style.js.map +1 -0
- package/lib/commonjs/components/SymbolLayer.js +53 -0
- package/lib/commonjs/components/SymbolLayer.js.map +1 -0
- package/lib/commonjs/components/UserLocation.js +188 -0
- package/lib/commonjs/components/UserLocation.js.map +1 -0
- package/lib/commonjs/components/VectorSource.js +129 -0
- package/lib/commonjs/components/VectorSource.js.map +1 -0
- package/lib/commonjs/hooks/useAbstractLayer.js +53 -0
- package/lib/commonjs/hooks/useAbstractLayer.js.map +1 -0
- package/lib/commonjs/hooks/useAbstractSource.js +24 -0
- package/lib/commonjs/hooks/useAbstractSource.js.map +1 -0
- package/lib/commonjs/hooks/useNativeBridge.js +84 -0
- package/lib/commonjs/hooks/useNativeBridge.js.map +1 -0
- package/lib/commonjs/hooks/useNativeRef.js +14 -0
- package/lib/commonjs/hooks/useNativeRef.js.map +1 -0
- package/lib/commonjs/hooks/useOnce.js +16 -0
- package/lib/commonjs/hooks/useOnce.js.map +1 -0
- package/lib/commonjs/index.js +23 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/modules/location/locationManager.js +91 -0
- package/lib/commonjs/modules/location/locationManager.js.map +1 -0
- package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js +37 -0
- package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js.map +1 -0
- package/lib/commonjs/modules/offline/OfflinePack.js +40 -0
- package/lib/commonjs/modules/offline/OfflinePack.js.map +1 -0
- package/lib/commonjs/modules/offline/offlineManager.js +346 -0
- package/lib/commonjs/modules/offline/offlineManager.js.map +1 -0
- package/lib/commonjs/modules/snapshot/SnapshotOptions.js +58 -0
- package/lib/commonjs/modules/snapshot/SnapshotOptions.js.map +1 -0
- package/lib/commonjs/modules/snapshot/snapshotManager.js +66 -0
- package/lib/commonjs/modules/snapshot/snapshotManager.js.map +1 -0
- package/lib/commonjs/requestAndroidLocationPermissions.js +25 -0
- package/lib/commonjs/requestAndroidLocationPermissions.js.map +1 -0
- package/lib/commonjs/types/BaseProps.js +2 -0
- package/lib/commonjs/types/BaseProps.js.map +1 -0
- package/lib/commonjs/types/CameraMode.js +14 -0
- package/lib/commonjs/types/CameraMode.js.map +1 -0
- package/lib/commonjs/types/MapLibreRNEvent.js +6 -0
- package/lib/commonjs/types/MapLibreRNEvent.js.map +1 -0
- package/lib/commonjs/types/OnPressEvent.js +2 -0
- package/lib/commonjs/types/OnPressEvent.js.map +1 -0
- package/lib/commonjs/types/StyleURL.js +11 -0
- package/lib/commonjs/types/StyleURL.js.map +1 -0
- package/lib/commonjs/utils/BridgeValue.js +59 -0
- package/lib/commonjs/utils/BridgeValue.js.map +1 -0
- package/lib/commonjs/utils/Logger.js +118 -0
- package/lib/commonjs/utils/Logger.js.map +1 -0
- package/lib/commonjs/utils/MapLibreRNStyles.d.js +181 -0
- package/lib/commonjs/utils/MapLibreRNStyles.d.js.map +1 -0
- package/lib/commonjs/utils/StyleValue.js +39 -0
- package/lib/commonjs/utils/StyleValue.js.map +1 -0
- package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js +95 -0
- package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js.map +1 -0
- package/lib/commonjs/utils/animated/Animated.js +47 -0
- package/lib/commonjs/utils/animated/Animated.js.map +1 -0
- package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js +92 -0
- package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js.map +1 -0
- package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js +40 -0
- package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -0
- package/lib/commonjs/utils/animated/AnimatedPoint.js +111 -0
- package/lib/commonjs/utils/animated/AnimatedPoint.js.map +1 -0
- package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js +137 -0
- package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -0
- package/lib/commonjs/utils/animated/AnimatedShape.js +75 -0
- package/lib/commonjs/utils/animated/AnimatedShape.js.map +1 -0
- package/lib/commonjs/utils/deprecation.js +31 -0
- package/lib/commonjs/utils/deprecation.js.map +1 -0
- package/lib/commonjs/utils/filterUtils.js +13 -0
- package/lib/commonjs/utils/filterUtils.js.map +1 -0
- package/lib/commonjs/utils/index.js +97 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/commonjs/utils/makeNativeBounds.js +11 -0
- package/lib/commonjs/utils/makeNativeBounds.js.map +1 -0
- package/lib/commonjs/utils/styleMap.js +255 -0
- package/lib/commonjs/utils/styleMap.js.map +1 -0
- package/lib/module/MLNModule.js +15 -0
- package/lib/module/MLNModule.js.map +1 -0
- package/lib/module/MapLibreRN.js +37 -0
- package/lib/module/MapLibreRN.js.map +1 -0
- package/lib/module/assets/heading.png +0 -0
- package/lib/module/assets/heading@2x.png +0 -0
- package/lib/module/assets/heading@3x.png +0 -0
- package/lib/module/assets/png.d.js +2 -0
- package/lib/module/assets/png.d.js.map +1 -0
- package/lib/module/components/Annotation.js +104 -0
- package/lib/module/components/Annotation.js.map +1 -0
- package/lib/module/components/BackgroundLayer.js +28 -0
- package/lib/module/components/BackgroundLayer.js.map +1 -0
- package/lib/module/components/Callout.js +97 -0
- package/lib/module/components/Callout.js.map +1 -0
- package/lib/module/components/Camera.js +280 -0
- package/lib/module/components/Camera.js.map +1 -0
- package/lib/module/components/CircleLayer.js +32 -0
- package/lib/module/components/CircleLayer.js.map +1 -0
- package/lib/module/components/FillExtrusionLayer.js +31 -0
- package/lib/module/components/FillExtrusionLayer.js.map +1 -0
- package/lib/module/components/FillLayer.js +31 -0
- package/lib/module/components/FillLayer.js.map +1 -0
- package/lib/module/components/HeadingIndicator.js +23 -0
- package/lib/module/components/HeadingIndicator.js.map +1 -0
- package/lib/module/components/HeatmapLayer.js +30 -0
- package/lib/module/components/HeatmapLayer.js.map +1 -0
- package/lib/module/components/ImageSource.js +37 -0
- package/lib/module/components/ImageSource.js.map +1 -0
- package/lib/module/components/Images.js +76 -0
- package/lib/module/components/Images.js.map +1 -0
- package/lib/module/components/Light.js +27 -0
- package/lib/module/components/Light.js.map +1 -0
- package/lib/module/components/LineLayer.js +31 -0
- package/lib/module/components/LineLayer.js.map +1 -0
- package/lib/module/components/MapView.js +458 -0
- package/lib/module/components/MapView.js.map +1 -0
- package/lib/module/components/MarkerView.js +56 -0
- package/lib/module/components/MarkerView.js.map +1 -0
- package/lib/module/components/NativeUserLocation.js +13 -0
- package/lib/module/components/NativeUserLocation.js.map +1 -0
- package/lib/module/components/PointAnnotation.js +116 -0
- package/lib/module/components/PointAnnotation.js.map +1 -0
- package/lib/module/components/RasterLayer.js +27 -0
- package/lib/module/components/RasterLayer.js.map +1 -0
- package/lib/module/components/RasterSource.js +62 -0
- package/lib/module/components/RasterSource.js.map +1 -0
- package/lib/module/components/ShapeSource.js +198 -0
- package/lib/module/components/ShapeSource.js.map +1 -0
- package/lib/module/components/Style.js +261 -0
- package/lib/module/components/Style.js.map +1 -0
- package/lib/module/components/SymbolLayer.js +48 -0
- package/lib/module/components/SymbolLayer.js.map +1 -0
- package/lib/module/components/UserLocation.js +182 -0
- package/lib/module/components/UserLocation.js.map +1 -0
- package/lib/module/components/VectorSource.js +124 -0
- package/lib/module/components/VectorSource.js.map +1 -0
- package/lib/module/hooks/useAbstractLayer.js +49 -0
- package/lib/module/hooks/useAbstractLayer.js.map +1 -0
- package/lib/module/hooks/useAbstractSource.js +20 -0
- package/lib/module/hooks/useAbstractSource.js.map +1 -0
- package/lib/module/hooks/useNativeBridge.js +80 -0
- package/lib/module/hooks/useNativeBridge.js.map +1 -0
- package/lib/module/hooks/useNativeRef.js +10 -0
- package/lib/module/hooks/useNativeRef.js.map +1 -0
- package/lib/module/hooks/useOnce.js +12 -0
- package/lib/module/hooks/useOnce.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/modules/location/locationManager.js +87 -0
- package/lib/module/modules/location/locationManager.js.map +1 -0
- package/lib/module/modules/offline/OfflineCreatePackOptions.js +33 -0
- package/lib/module/modules/offline/OfflineCreatePackOptions.js.map +1 -0
- package/lib/module/modules/offline/OfflinePack.js +36 -0
- package/lib/module/modules/offline/OfflinePack.js.map +1 -0
- package/lib/module/modules/offline/offlineManager.js +341 -0
- package/lib/module/modules/offline/offlineManager.js.map +1 -0
- package/lib/module/modules/snapshot/SnapshotOptions.js +53 -0
- package/lib/module/modules/snapshot/SnapshotOptions.js.map +1 -0
- package/lib/module/modules/snapshot/snapshotManager.js +61 -0
- package/lib/module/modules/snapshot/snapshotManager.js.map +1 -0
- package/lib/module/requestAndroidLocationPermissions.js +21 -0
- package/lib/module/requestAndroidLocationPermissions.js.map +1 -0
- package/lib/module/types/BaseProps.js +2 -0
- package/lib/module/types/BaseProps.js.map +1 -0
- package/lib/module/types/CameraMode.js +10 -0
- package/lib/module/types/CameraMode.js.map +1 -0
- package/lib/module/types/MapLibreRNEvent.js +4 -0
- package/lib/module/types/MapLibreRNEvent.js.map +1 -0
- package/lib/module/types/OnPressEvent.js +2 -0
- package/lib/module/types/OnPressEvent.js.map +1 -0
- package/lib/module/types/StyleURL.js +7 -0
- package/lib/module/types/StyleURL.js.map +1 -0
- package/lib/module/utils/BridgeValue.js +54 -0
- package/lib/module/utils/BridgeValue.js.map +1 -0
- package/lib/module/utils/Logger.js +114 -0
- package/lib/module/utils/Logger.js.map +1 -0
- package/lib/module/utils/MapLibreRNStyles.d.js +180 -0
- package/lib/module/utils/MapLibreRNStyles.d.js.map +1 -0
- package/lib/module/utils/StyleValue.js +34 -0
- package/lib/module/utils/StyleValue.js.map +1 -0
- package/lib/module/utils/animated/AbstractAnimatedCoordinates.js +92 -0
- package/lib/module/utils/animated/AbstractAnimatedCoordinates.js.map +1 -0
- package/lib/module/utils/animated/Animated.js +42 -0
- package/lib/module/utils/animated/Animated.js.map +1 -0
- package/lib/module/utils/animated/AnimatedCoordinatesArray.js +87 -0
- package/lib/module/utils/animated/AnimatedCoordinatesArray.js.map +1 -0
- package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js +36 -0
- package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -0
- package/lib/module/utils/animated/AnimatedPoint.js +107 -0
- package/lib/module/utils/animated/AnimatedPoint.js.map +1 -0
- package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js +131 -0
- package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -0
- package/lib/module/utils/animated/AnimatedShape.js +71 -0
- package/lib/module/utils/animated/AnimatedShape.js.map +1 -0
- package/lib/module/utils/deprecation.js +27 -0
- package/lib/module/utils/deprecation.js.map +1 -0
- package/lib/module/utils/filterUtils.js +9 -0
- package/lib/module/utils/filterUtils.js.map +1 -0
- package/lib/module/utils/index.js +81 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/module/utils/makeNativeBounds.js +7 -0
- package/lib/module/utils/makeNativeBounds.js.map +1 -0
- package/lib/module/utils/styleMap.js +249 -0
- package/lib/module/utils/styleMap.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/MLNModule.d.ts +21 -0
- package/lib/typescript/commonjs/src/MLNModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts +42 -0
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Annotation.d.ts +21 -0
- package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts +14 -0
- package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Callout.d.ts +35 -0
- package/lib/typescript/commonjs/src/components/Callout.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Camera.d.ts +134 -0
- package/lib/typescript/commonjs/src/components/Camera.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/CircleLayer.d.ts +17 -0
- package/lib/typescript/commonjs/src/components/CircleLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts +17 -0
- package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/FillLayer.d.ts +17 -0
- package/lib/typescript/commonjs/src/components/FillLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts +8 -0
- package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts +17 -0
- package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/ImageSource.d.ts +31 -0
- package/lib/typescript/commonjs/src/components/ImageSource.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Images.d.ts +33 -0
- package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Light.d.ts +17 -0
- package/lib/typescript/commonjs/src/components/Light.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/LineLayer.d.ts +17 -0
- package/lib/typescript/commonjs/src/components/LineLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/MapView.d.ts +235 -0
- package/lib/typescript/commonjs/src/components/MapView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/MarkerView.d.ts +44 -0
- package/lib/typescript/commonjs/src/components/MarkerView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/NativeUserLocation.d.ts +26 -0
- package/lib/typescript/commonjs/src/components/NativeUserLocation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts +91 -0
- package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/RasterLayer.d.ts +14 -0
- package/lib/typescript/commonjs/src/components/RasterLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/RasterSource.d.ts +53 -0
- package/lib/typescript/commonjs/src/components/RasterSource.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +124 -0
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Style.d.ts +81 -0
- package/lib/typescript/commonjs/src/components/Style.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts +22 -0
- package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/UserLocation.d.ts +70 -0
- package/lib/typescript/commonjs/src/components/UserLocation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/VectorSource.d.ts +70 -0
- package/lib/typescript/commonjs/src/components/VectorSource.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts +62 -0
- package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useAbstractSource.d.ts +7 -0
- package/lib/typescript/commonjs/src/hooks/useAbstractSource.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useNativeBridge.d.ts +21 -0
- package/lib/typescript/commonjs/src/hooks/useNativeBridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts +8 -0
- package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useOnce.d.ts +3 -0
- package/lib/typescript/commonjs/src/hooks/useOnce.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/location/locationManager.d.ts +64 -0
- package/lib/typescript/commonjs/src/modules/location/locationManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/offline/OfflineCreatePackOptions.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts +24 -0
- package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts +210 -0
- package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/snapshot/SnapshotOptions.d.ts +42 -0
- package/lib/typescript/commonjs/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/snapshot/snapshotManager.d.ts +52 -0
- package/lib/typescript/commonjs/src/modules/snapshot/snapshotManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/requestAndroidLocationPermissions.d.ts +2 -0
- package/lib/typescript/commonjs/src/requestAndroidLocationPermissions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/BaseProps.d.ts +4 -0
- package/lib/typescript/commonjs/src/types/BaseProps.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/CameraMode.d.ts +7 -0
- package/lib/typescript/commonjs/src/types/CameraMode.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/MapLibreRNEvent.d.ts +6 -0
- package/lib/typescript/commonjs/src/types/MapLibreRNEvent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/OnPressEvent.d.ts +12 -0
- package/lib/typescript/commonjs/src/types/OnPressEvent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/StyleURL.d.ts +4 -0
- package/lib/typescript/commonjs/src/types/StyleURL.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/BridgeValue.d.ts +29 -0
- package/lib/typescript/commonjs/src/utils/BridgeValue.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/Logger.d.ts +52 -0
- package/lib/typescript/commonjs/src/utils/Logger.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/StyleValue.d.ts +10 -0
- package/lib/typescript/commonjs/src/utils/StyleValue.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts +36 -0
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts +33 -0
- package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedCoordinatesArray.d.ts +40 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +11 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts +31 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +54 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts +27 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/deprecation.d.ts +6 -0
- package/lib/typescript/commonjs/src/utils/deprecation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/filterUtils.d.ts +3 -0
- package/lib/typescript/commonjs/src/utils/filterUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/index.d.ts +21 -0
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/makeNativeBounds.d.ts +2 -0
- package/lib/typescript/commonjs/src/utils/makeNativeBounds.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/styleMap.d.ts +231 -0
- package/lib/typescript/commonjs/src/utils/styleMap.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/MLNModule.d.ts +21 -0
- package/lib/typescript/module/src/MLNModule.d.ts.map +1 -0
- package/lib/typescript/module/src/MapLibreRN.d.ts +42 -0
- package/lib/typescript/module/src/MapLibreRN.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Annotation.d.ts +21 -0
- package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -0
- package/lib/typescript/module/src/components/BackgroundLayer.d.ts +14 -0
- package/lib/typescript/module/src/components/BackgroundLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Callout.d.ts +35 -0
- package/lib/typescript/module/src/components/Callout.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Camera.d.ts +134 -0
- package/lib/typescript/module/src/components/Camera.d.ts.map +1 -0
- package/lib/typescript/module/src/components/CircleLayer.d.ts +17 -0
- package/lib/typescript/module/src/components/CircleLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts +17 -0
- package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/FillLayer.d.ts +17 -0
- package/lib/typescript/module/src/components/FillLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/HeadingIndicator.d.ts +8 -0
- package/lib/typescript/module/src/components/HeadingIndicator.d.ts.map +1 -0
- package/lib/typescript/module/src/components/HeatmapLayer.d.ts +17 -0
- package/lib/typescript/module/src/components/HeatmapLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/ImageSource.d.ts +31 -0
- package/lib/typescript/module/src/components/ImageSource.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Images.d.ts +33 -0
- package/lib/typescript/module/src/components/Images.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Light.d.ts +17 -0
- package/lib/typescript/module/src/components/Light.d.ts.map +1 -0
- package/lib/typescript/module/src/components/LineLayer.d.ts +17 -0
- package/lib/typescript/module/src/components/LineLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/MapView.d.ts +235 -0
- package/lib/typescript/module/src/components/MapView.d.ts.map +1 -0
- package/lib/typescript/module/src/components/MarkerView.d.ts +44 -0
- package/lib/typescript/module/src/components/MarkerView.d.ts.map +1 -0
- package/lib/typescript/module/src/components/NativeUserLocation.d.ts +26 -0
- package/lib/typescript/module/src/components/NativeUserLocation.d.ts.map +1 -0
- package/lib/typescript/module/src/components/PointAnnotation.d.ts +91 -0
- package/lib/typescript/module/src/components/PointAnnotation.d.ts.map +1 -0
- package/lib/typescript/module/src/components/RasterLayer.d.ts +14 -0
- package/lib/typescript/module/src/components/RasterLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/RasterSource.d.ts +53 -0
- package/lib/typescript/module/src/components/RasterSource.d.ts.map +1 -0
- package/lib/typescript/module/src/components/ShapeSource.d.ts +124 -0
- package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Style.d.ts +81 -0
- package/lib/typescript/module/src/components/Style.d.ts.map +1 -0
- package/lib/typescript/module/src/components/SymbolLayer.d.ts +22 -0
- package/lib/typescript/module/src/components/SymbolLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/UserLocation.d.ts +70 -0
- package/lib/typescript/module/src/components/UserLocation.d.ts.map +1 -0
- package/lib/typescript/module/src/components/VectorSource.d.ts +70 -0
- package/lib/typescript/module/src/components/VectorSource.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts +62 -0
- package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useAbstractSource.d.ts +7 -0
- package/lib/typescript/module/src/hooks/useAbstractSource.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useNativeBridge.d.ts +21 -0
- package/lib/typescript/module/src/hooks/useNativeBridge.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useNativeRef.d.ts +8 -0
- package/lib/typescript/module/src/hooks/useNativeRef.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useOnce.d.ts +3 -0
- package/lib/typescript/module/src/hooks/useOnce.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +4 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/location/locationManager.d.ts +64 -0
- package/lib/typescript/module/src/modules/location/locationManager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/offline/OfflineCreatePackOptions.d.ts +21 -0
- package/lib/typescript/module/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts +24 -0
- package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/offline/offlineManager.d.ts +210 -0
- package/lib/typescript/module/src/modules/offline/offlineManager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/snapshot/SnapshotOptions.d.ts +42 -0
- package/lib/typescript/module/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/snapshot/snapshotManager.d.ts +52 -0
- package/lib/typescript/module/src/modules/snapshot/snapshotManager.d.ts.map +1 -0
- package/lib/typescript/module/src/requestAndroidLocationPermissions.d.ts +2 -0
- package/lib/typescript/module/src/requestAndroidLocationPermissions.d.ts.map +1 -0
- package/lib/typescript/module/src/types/BaseProps.d.ts +4 -0
- package/lib/typescript/module/src/types/BaseProps.d.ts.map +1 -0
- package/lib/typescript/module/src/types/CameraMode.d.ts +7 -0
- package/lib/typescript/module/src/types/CameraMode.d.ts.map +1 -0
- package/lib/typescript/module/src/types/MapLibreRNEvent.d.ts +6 -0
- package/lib/typescript/module/src/types/MapLibreRNEvent.d.ts.map +1 -0
- package/lib/typescript/module/src/types/OnPressEvent.d.ts +12 -0
- package/lib/typescript/module/src/types/OnPressEvent.d.ts.map +1 -0
- package/lib/typescript/module/src/types/StyleURL.d.ts +4 -0
- package/lib/typescript/module/src/types/StyleURL.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/BridgeValue.d.ts +29 -0
- package/lib/typescript/module/src/utils/BridgeValue.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/Logger.d.ts +52 -0
- package/lib/typescript/module/src/utils/Logger.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/StyleValue.d.ts +10 -0
- package/lib/typescript/module/src/utils/StyleValue.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts +36 -0
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/Animated.d.ts +33 -0
- package/lib/typescript/module/src/utils/animated/Animated.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedCoordinatesArray.d.ts +40 -0
- package/lib/typescript/module/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +11 -0
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts +31 -0
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +54 -0
- package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts +27 -0
- package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/deprecation.d.ts +6 -0
- package/lib/typescript/module/src/utils/deprecation.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/filterUtils.d.ts +3 -0
- package/lib/typescript/module/src/utils/filterUtils.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/index.d.ts +21 -0
- package/lib/typescript/module/src/utils/index.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/makeNativeBounds.d.ts +2 -0
- package/lib/typescript/module/src/utils/makeNativeBounds.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/styleMap.d.ts +231 -0
- package/lib/typescript/module/src/utils/styleMap.d.ts.map +1 -0
- package/package.json +83 -6
- package/plugin/build/withMapLibre.d.ts +1 -1
- package/{javascript/Maplibre.ts → src/MapLibreRN.ts} +1 -1
- package/src/assets/heading.png +0 -0
- package/src/assets/heading@2x.png +0 -0
- package/src/assets/heading@3x.png +0 -0
- package/src/assets/png.d.ts +4 -0
- package/{javascript → src}/components/Annotation.tsx +8 -8
- package/{javascript → src}/components/BackgroundLayer.tsx +4 -4
- package/{javascript → src}/components/Callout.tsx +5 -5
- package/{javascript → src}/components/Camera.tsx +5 -5
- package/{javascript → src}/components/CircleLayer.tsx +4 -4
- package/{javascript → src}/components/FillExtrusionLayer.tsx +4 -4
- package/{javascript → src}/components/FillLayer.tsx +4 -4
- package/{javascript → src}/components/HeadingIndicator.tsx +3 -4
- package/{javascript → src}/components/HeatmapLayer.tsx +4 -4
- package/{javascript → src}/components/ImageSource.tsx +2 -2
- package/{javascript → src}/components/Images.tsx +7 -7
- package/{javascript → src}/components/Light.tsx +6 -4
- package/{javascript → src}/components/LineLayer.tsx +4 -4
- package/{javascript → src}/components/MapView.tsx +12 -11
- package/{javascript → src}/components/MarkerView.tsx +2 -2
- package/{javascript → src}/components/NativeUserLocation.tsx +1 -1
- package/{javascript → src}/components/PointAnnotation.tsx +5 -5
- package/{javascript → src}/components/RasterLayer.tsx +4 -4
- package/{javascript → src}/components/RasterSource.tsx +1 -1
- package/{javascript → src}/components/ShapeSource.tsx +13 -9
- package/{javascript → src}/components/Style.tsx +32 -29
- package/{javascript → src}/components/SymbolLayer.tsx +7 -7
- package/{javascript → src}/components/UserLocation.tsx +18 -8
- package/{javascript → src}/components/VectorSource.tsx +6 -6
- package/{javascript → src}/hooks/useAbstractLayer.ts +9 -9
- package/{javascript → src}/hooks/useAbstractSource.ts +2 -2
- package/{javascript → src}/hooks/useNativeBridge.ts +2 -2
- package/{javascript → src}/hooks/useNativeRef.ts +2 -2
- package/src/index.ts +4 -0
- package/{javascript → src}/modules/location/locationManager.ts +1 -1
- package/{javascript → src}/modules/offline/offlineManager.ts +18 -13
- package/{javascript → src}/modules/snapshot/snapshotManager.ts +1 -1
- package/{javascript → src}/requestAndroidLocationPermissions.ts +3 -3
- package/src/types/BaseProps.ts +3 -0
- package/src/types/MapLibreRNEvent.ts +7 -0
- package/{javascript → src}/types/OnPressEvent.ts +1 -3
- package/src/types/StyleURL.ts +3 -0
- package/{javascript → src}/utils/BridgeValue.ts +8 -8
- package/{javascript → src}/utils/Logger.ts +1 -1
- package/{javascript/utils/MaplibreStyles.d.ts → src/utils/MapLibreRNStyles.d.ts} +1 -1
- package/{javascript → src}/utils/StyleValue.ts +2 -2
- package/{javascript → src}/utils/animated/Animated.ts +2 -2
- package/{javascript → src}/utils/animated/AnimatedCoordinatesArray.ts +24 -19
- package/{javascript → src}/utils/animated/AnimatedPoint.ts +4 -4
- package/{javascript → src}/utils/animated/AnimatedRouteCoordinatesArray.ts +14 -9
- package/{javascript → src}/utils/filterUtils.ts +1 -1
- package/{javascript → src}/utils/index.ts +5 -5
- package/.eslintrc.js +0 -5
- package/.git-blame-ignore-revs +0 -3
- package/.gitattributes +0 -1
- package/.nvmrc +0 -1
- package/.sonarcloud.properties +0 -15
- package/CODE_OF_CONDUCT.md +0 -2
- package/CONTRIBUTING.md +0 -61
- package/RELEASE.md +0 -30
- package/assets/indoor_building_map_android.png +0 -0
- package/assets/indoor_building_map_ios.png +0 -0
- package/babel.config.js +0 -12
- package/docs/Annotation.md +0 -29
- package/docs/Annotations.md +0 -12
- package/docs/BackgroundLayer.md +0 -166
- package/docs/Callout.md +0 -16
- package/docs/Camera.md +0 -132
- package/docs/CircleLayer.md +0 -487
- package/docs/CustomHttpHeaders.md +0 -87
- package/docs/FillExtrusionLayer.md +0 -349
- package/docs/FillLayer.md +0 -317
- package/docs/GettingStarted.md +0 -113
- package/docs/HeadingIndicator.md +0 -11
- package/docs/HeatmapLayer.md +0 -214
- package/docs/ImageSource.md +0 -14
- package/docs/Images.md +0 -15
- package/docs/Light.md +0 -167
- package/docs/LineLayer.md +0 -603
- package/docs/Logger.md +0 -23
- package/docs/MapLibreGL.md +0 -65
- package/docs/MapView.md +0 -178
- package/docs/MarkerView.md +0 -17
- package/docs/NativeUserLocation.md +0 -13
- package/docs/PointAnnotation.md +0 -28
- package/docs/RasterLayer.md +0 -357
- package/docs/RasterSource.md +0 -19
- package/docs/ShapeSource.md +0 -104
- package/docs/Style.md +0 -11
- package/docs/StyleSheet.md +0 -451
- package/docs/SymbolLayer.md +0 -1752
- package/docs/UserLocation.md +0 -43
- package/docs/VectorSource.md +0 -50
- package/docs/coordinates.md +0 -7
- package/docs/docs.json +0 -5390
- package/docs/location.md +0 -7
- package/docs/offlineManager.md +0 -231
- package/docs/snapshotManager.md +0 -54
- package/javascript/index.ts +0 -4
- package/javascript/types/BaseProps.ts +0 -5
- package/javascript/types/index.ts +0 -11
- package/jest-setup.ts +0 -113
- package/jest.config.js +0 -8
- package/plugin/install.md +0 -25
- package/scripts/.eslintrc.js +0 -3
- package/scripts/codegen.ts +0 -344
- package/scripts/templates/MaplibreStyles.ts.ejs +0 -102
- package/scripts/templates/RCTMLNStyle.h.ejs +0 -34
- package/scripts/templates/RCTMLNStyle.m.ejs +0 -98
- package/scripts/templates/RCTMLNStyleFactory.java.ejs +0 -108
- package/scripts/templates/component.md.ejs +0 -125
- package/scripts/templates/styleMap.ts.ejs +0 -86
- package/scripts/utils/DocJSONBuilder.ts +0 -463
- package/scripts/utils/JSDocNodeTree.ts +0 -135
- package/scripts/utils/MarkdownBuilder.ts +0 -44
- package/scripts/utils/TemplateHelpers.ts +0 -505
- package/scripts/utils/getNativeVersion.ts +0 -53
- package/tsconfig.json +0 -22
- /package/{assets → lib/commonjs/assets}/heading.png +0 -0
- /package/{assets → lib/commonjs/assets}/heading@2x.png +0 -0
- /package/{assets → lib/commonjs/assets}/heading@3x.png +0 -0
- /package/{javascript → src}/MLNModule.ts +0 -0
- /package/{javascript → src}/hooks/useOnce.ts +0 -0
- /package/{javascript → src}/modules/offline/OfflineCreatePackOptions.ts +0 -0
- /package/{javascript → src}/modules/offline/OfflinePack.ts +0 -0
- /package/{javascript → src}/modules/snapshot/SnapshotOptions.ts +0 -0
- /package/{javascript → src}/types/CameraMode.ts +0 -0
- /package/{javascript → src}/utils/animated/AbstractAnimatedCoordinates.ts +0 -0
- /package/{javascript → src}/utils/animated/AnimatedExtractCoordinateFromArray.ts +0 -0
- /package/{javascript → src}/utils/animated/AnimatedShape.ts +0 -0
- /package/{javascript → src}/utils/deprecation.ts +0 -0
- /package/{javascript → src}/utils/makeNativeBounds.ts +0 -0
- /package/{javascript → src}/utils/styleMap.ts +0 -0
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
const component = locals.component;
|
|
3
|
-
const helpers = locals.helpers;
|
|
4
|
-
-%>
|
|
5
|
-
<!-- <%= helpers.autoGeneratedHeader.doNotModify %> -->
|
|
6
|
-
<!-- <%= helpers.autoGeneratedHeader.generatedFrom(component.filePath) %> -->
|
|
7
|
-
# `<MapLibreGL.<%- component.name %> />`
|
|
8
|
-
<%- helpers.replaceNewLine(component.description) %>
|
|
9
|
-
|
|
10
|
-
<%_ if (component.props && component.props.length) { _%>
|
|
11
|
-
## Props
|
|
12
|
-
| Prop | Type | Default | Required | Description |
|
|
13
|
-
| ---- | :--: | :-----: | :------: | :----------: |
|
|
14
|
-
<%- helpers.propMarkdownTableRows(component) %>
|
|
15
|
-
<%_ } _%>
|
|
16
|
-
|
|
17
|
-
<%_ if (component.methods && component.methods.length) { _%>
|
|
18
|
-
## Methods
|
|
19
|
-
<%_ for (let method of component.methods) { _%>
|
|
20
|
-
### <%- helpers.getMarkdownMethodSignature(method) %>
|
|
21
|
-
|
|
22
|
-
<%- helpers.replaceNewLine(method.description) %>
|
|
23
|
-
|
|
24
|
-
<%_ if (method.params && method.params.length) { _%>
|
|
25
|
-
#### Arguments
|
|
26
|
-
| Name | Type | Required | Description |
|
|
27
|
-
| ---- | :--: | :------: | :----------: |
|
|
28
|
-
<%- helpers.methodMarkdownTableRow(method) %>
|
|
29
|
-
<%_ } _%>
|
|
30
|
-
|
|
31
|
-
<%- helpers.getMarkdownMethodExamples(method) %>
|
|
32
|
-
<%_ } _%>
|
|
33
|
-
<%_ } _%>
|
|
34
|
-
|
|
35
|
-
<%_ if (component.styles && component.styles.length) { _%>
|
|
36
|
-
## Styles
|
|
37
|
-
|
|
38
|
-
<%_ for (let i = 0; i < component.styles.length; i++) { _%>
|
|
39
|
-
<%
|
|
40
|
-
const style = component.styles[i];
|
|
41
|
-
-%>
|
|
42
|
-
* <a href="#name<%- i > 0 ? '-' + i : '' -%>">`<%- style.name %>`</a><br/>
|
|
43
|
-
<%_ } _%>
|
|
44
|
-
|
|
45
|
-
<%_ for (let style of component.styles) { _%>
|
|
46
|
-
|
|
47
|
-
### `<%- style.name %>`
|
|
48
|
-
|
|
49
|
-
<%- style.description %>
|
|
50
|
-
|
|
51
|
-
<dl>
|
|
52
|
-
<dt>Type</dt>
|
|
53
|
-
<dd>
|
|
54
|
-
<code><%- style.type %></code>
|
|
55
|
-
</dd>
|
|
56
|
-
<%_ if (helpers.exists(style.default)) { _%>
|
|
57
|
-
<dt>Default Value</dt>
|
|
58
|
-
<dd><code><%= helpers.getStyleDefaultValue(style) %></code></dd>
|
|
59
|
-
<%_ } _%>
|
|
60
|
-
<%_ if (style.type === 'enum') { _%>
|
|
61
|
-
<dt>Supported Values</dt>
|
|
62
|
-
<dd>
|
|
63
|
-
<ul>
|
|
64
|
-
<%_ for (var i = 0; i < style.values.length; i++) { _%>
|
|
65
|
-
<li>
|
|
66
|
-
<code><%- style.values[i].value %></code>: <%- style.values[i].doc %>
|
|
67
|
-
</li>
|
|
68
|
-
<%_ } _%>
|
|
69
|
-
<%_ } _%>
|
|
70
|
-
</ul>
|
|
71
|
-
</dd>
|
|
72
|
-
<%_ if (helpers.exists(style.units)) { _%>
|
|
73
|
-
<dt>Units</dt>
|
|
74
|
-
<dd><code><%- style.units %></code></dd>
|
|
75
|
-
<%_ } _%>
|
|
76
|
-
<%_ if (helpers.exists(style.minimum)) { _%>
|
|
77
|
-
<dt>Minimum</dt>
|
|
78
|
-
<dd><code><%- style.minimum %></code></dd>
|
|
79
|
-
<%_ } _%>
|
|
80
|
-
<%_ if (helpers.exists(style.maximum)) { _%>
|
|
81
|
-
<dt>Maximum</dt>
|
|
82
|
-
<dd><code><%- style.maximum %></code></dd>
|
|
83
|
-
<%_ } _%>
|
|
84
|
-
<%_ if (style.requires.length) { _%>
|
|
85
|
-
<dt>Requires</dt>
|
|
86
|
-
<dd><code><%- style.requires.join(', ') %></code></dd>
|
|
87
|
-
<%_ } _%>
|
|
88
|
-
<%_ if (style.disabledBy.length) { _%>
|
|
89
|
-
<dt>Disabled By</dt>
|
|
90
|
-
<dd><code><%- style.disabledBy.join(', ') %></code></dd>
|
|
91
|
-
<%_ } _%>
|
|
92
|
-
<%_ if (style.allowedFunctionTypes.length) { _%>
|
|
93
|
-
<dt>Supported Style Functions</dt>
|
|
94
|
-
<dd><code><%- style.allowedFunctionTypes.join(', ') %></code></dd>
|
|
95
|
-
<%_ } _%>
|
|
96
|
-
<%_ if (style.expression) { _%>
|
|
97
|
-
<dt>Expression Parameters</dt>
|
|
98
|
-
<dd><code><%- (style.expression.parameters || []).join(', ') %></code></dd>
|
|
99
|
-
<%_ } _%>
|
|
100
|
-
</dl>
|
|
101
|
-
|
|
102
|
-
<%_ if (style.transition) { _%>
|
|
103
|
-
### `<%- style.name %>Transition`
|
|
104
|
-
|
|
105
|
-
The transition affecting any changes to this layer’s <%- style.name %> property.
|
|
106
|
-
|
|
107
|
-
<dl>
|
|
108
|
-
<dt>Type</dt>
|
|
109
|
-
<dd>
|
|
110
|
-
<code>{ duration, delay }</code>
|
|
111
|
-
</dd>
|
|
112
|
-
|
|
113
|
-
<dt>Units</dt>
|
|
114
|
-
<dd>
|
|
115
|
-
<code>milliseconds</code>
|
|
116
|
-
</dd>
|
|
117
|
-
|
|
118
|
-
<dt>Default Value</dt>
|
|
119
|
-
<dd>
|
|
120
|
-
<code>{duration: 300, delay: 0}</code>
|
|
121
|
-
</dd>
|
|
122
|
-
</dl>
|
|
123
|
-
<%_ } %>
|
|
124
|
-
<%_ } _%>
|
|
125
|
-
<%_ } _%>
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
const layers = locals.layers;
|
|
3
|
-
const helpers = locals.helpers;
|
|
4
|
-
-%>
|
|
5
|
-
/* eslint-disable */
|
|
6
|
-
// <%= helpers.autoGeneratedHeader.doNotModify %>
|
|
7
|
-
// <%= helpers.autoGeneratedHeader.generatedFrom(locals.filePath) %>
|
|
8
|
-
|
|
9
|
-
import { isAndroid } from './index';
|
|
10
|
-
|
|
11
|
-
export const StyleTypes = {
|
|
12
|
-
Constant: 'constant',
|
|
13
|
-
Color: 'color',
|
|
14
|
-
Transition: 'transition',
|
|
15
|
-
Translation: 'translation',
|
|
16
|
-
Function: 'function',
|
|
17
|
-
Image: 'image',
|
|
18
|
-
Enum: 'enum',
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export function getStyleType(styleProp: keyof typeof styleExtras): string {
|
|
22
|
-
if (!isAndroid() && styleExtras[styleProp]) {
|
|
23
|
-
return styleExtras[styleProp].iosType;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (styleMap[styleProp]) {
|
|
27
|
-
return styleMap[styleProp];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
throw new Error(`${styleProp} is not a valid MapLibre layer style`);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const styleMap = {
|
|
34
|
-
<%_ for (let layer of layers) { _%>
|
|
35
|
-
<%_ for (let prop of layer.properties) { _%>
|
|
36
|
-
<%_ if (prop.name !== 'visibility') { _%>
|
|
37
|
-
<%= prop.name %>: <%- helpers.jsStyleType(prop) %>,
|
|
38
|
-
<%_ if (prop.transition) { _%>
|
|
39
|
-
<%= prop.name %>Transition: StyleTypes.Transition,
|
|
40
|
-
<%_ } _%>
|
|
41
|
-
<%_ } _%>
|
|
42
|
-
<%_ } _%>
|
|
43
|
-
|
|
44
|
-
<%_ } _%>
|
|
45
|
-
visibility: StyleTypes.Constant,
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const styleExtras = {
|
|
49
|
-
// padding
|
|
50
|
-
iconTextFitPadding: {
|
|
51
|
-
iosType: 'edgeinsets',
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
// offsets
|
|
55
|
-
iconOffset: {
|
|
56
|
-
iosType: 'vector',
|
|
57
|
-
},
|
|
58
|
-
textOffset: {
|
|
59
|
-
iosType: 'vector',
|
|
60
|
-
},
|
|
61
|
-
lineOffset: {
|
|
62
|
-
iosType: 'vector',
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
// translates
|
|
66
|
-
fillTranslate: {
|
|
67
|
-
iosType: 'vector',
|
|
68
|
-
},
|
|
69
|
-
lineTranslate: {
|
|
70
|
-
iosType: 'vector',
|
|
71
|
-
},
|
|
72
|
-
iconTranslate: {
|
|
73
|
-
iosType: 'vector',
|
|
74
|
-
},
|
|
75
|
-
textTranslate: {
|
|
76
|
-
iosType: 'vector',
|
|
77
|
-
},
|
|
78
|
-
circleTranslate: {
|
|
79
|
-
iosType: 'vector',
|
|
80
|
-
},
|
|
81
|
-
fillExtrusionTranslate: {
|
|
82
|
-
iosType: 'vector',
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export default styleMap;
|
|
@@ -1,463 +0,0 @@
|
|
|
1
|
-
import { exec } from "child_process";
|
|
2
|
-
import { promises as fs } from "node:fs";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import * as docgen from "react-docgen";
|
|
5
|
-
import { parseJsDoc } from "react-docgen/dist/utils";
|
|
6
|
-
|
|
7
|
-
import { JSDocNodeTree } from "./JSDocNodeTree";
|
|
8
|
-
import { pascalCase } from "./TemplateHelpers";
|
|
9
|
-
|
|
10
|
-
const WORKSPACE_ROOT = path.join(__dirname, "..", "..");
|
|
11
|
-
|
|
12
|
-
const COMPONENT_DIRECTORY = path.join(
|
|
13
|
-
WORKSPACE_ROOT,
|
|
14
|
-
"javascript",
|
|
15
|
-
"components",
|
|
16
|
-
);
|
|
17
|
-
const MODULES_DIRECTORY = path.join(WORKSPACE_ROOT, "javascript", "modules");
|
|
18
|
-
const OUTPUT_PATH = path.join(WORKSPACE_ROOT, "docs", "docs.json");
|
|
19
|
-
|
|
20
|
-
const IGNORE_METHODS = ["setNativeProps"];
|
|
21
|
-
|
|
22
|
-
const fileExtensionsRegex = /.(js|tsx|(?<!d.)ts)$/;
|
|
23
|
-
|
|
24
|
-
export class DocJSONBuilder {
|
|
25
|
-
_styledLayers: any;
|
|
26
|
-
|
|
27
|
-
constructor(styledLayers: any) {
|
|
28
|
-
this._styledLayers = {};
|
|
29
|
-
|
|
30
|
-
for (const styleLayer of styledLayers) {
|
|
31
|
-
const ComponentName = pascalCase(styleLayer.name);
|
|
32
|
-
const fakeLayers = ["Light", "Atmosphere", "Terrain"];
|
|
33
|
-
if (fakeLayers.includes(ComponentName)) {
|
|
34
|
-
this._styledLayers[ComponentName] = styleLayer;
|
|
35
|
-
} else {
|
|
36
|
-
this._styledLayers[ComponentName + "Layer"] = styleLayer;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
get options() {
|
|
42
|
-
return {
|
|
43
|
-
match: fileExtensionsRegex,
|
|
44
|
-
shortName: true,
|
|
45
|
-
sort: true,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
isPrivateMethod(methodName = "") {
|
|
50
|
-
return !methodName || methodName.charAt(0) === "_";
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
postprocess(component: any, name: string) {
|
|
54
|
-
// Remove all private methods and parse examples from docblock
|
|
55
|
-
|
|
56
|
-
if (!Array.isArray(component.methods)) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
component.name = name;
|
|
61
|
-
|
|
62
|
-
// Main description
|
|
63
|
-
component.description = component.description?.replace(
|
|
64
|
-
/(\n*)(@\w+) (\{.*})/g,
|
|
65
|
-
"",
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
// Styles
|
|
69
|
-
if (this._styledLayers[name] && this._styledLayers[name].properties) {
|
|
70
|
-
component.styles = [];
|
|
71
|
-
|
|
72
|
-
for (const prop of this._styledLayers[name].properties) {
|
|
73
|
-
const docStyle = {
|
|
74
|
-
name: prop.name,
|
|
75
|
-
type: prop.type,
|
|
76
|
-
values: [] as any[],
|
|
77
|
-
minimum: prop.doc.minimum,
|
|
78
|
-
maximum: prop.doc.maximum,
|
|
79
|
-
units: prop.doc.units,
|
|
80
|
-
default: prop.doc.default,
|
|
81
|
-
description: prop.doc.description,
|
|
82
|
-
requires: prop.doc.requires,
|
|
83
|
-
disabledBy: prop.doc.disabledBy,
|
|
84
|
-
allowedFunctionTypes: prop.allowedFunctionTypes || [],
|
|
85
|
-
expression: prop.expression,
|
|
86
|
-
transition: prop.transition,
|
|
87
|
-
};
|
|
88
|
-
if (prop.type === "enum") {
|
|
89
|
-
docStyle.values = Object.keys(prop.doc.values).map((value) => {
|
|
90
|
-
return { value, doc: prop.doc.values[value].doc };
|
|
91
|
-
});
|
|
92
|
-
} else if (prop.type === "array") {
|
|
93
|
-
docStyle.type = `${docStyle.type}<${prop.value}>`;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
component.styles.push(docStyle);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function mapNestedProp(propMeta: any) {
|
|
101
|
-
const result = {
|
|
102
|
-
type: {
|
|
103
|
-
name: propMeta.name,
|
|
104
|
-
value: propMeta.value,
|
|
105
|
-
},
|
|
106
|
-
description: propMeta.description,
|
|
107
|
-
required: propMeta.required,
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
if (propMeta.value) {
|
|
111
|
-
result.type.value = propMeta.value;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return result;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function tsTypeDesc(tsType: TSType) {
|
|
118
|
-
if (!tsType?.name) {
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (tsType.name === "signature") {
|
|
123
|
-
if (tsType.raw.length < 200) {
|
|
124
|
-
return `${tsType.raw
|
|
125
|
-
.replace(/(\n|\s)/g, "")
|
|
126
|
-
.replace(/(\|)/g, "\\|")}`;
|
|
127
|
-
} else {
|
|
128
|
-
return "FIX ME FORMAT BIG OBJECT";
|
|
129
|
-
}
|
|
130
|
-
} else if (tsType.name === "union") {
|
|
131
|
-
if (tsType.raw) {
|
|
132
|
-
// Props
|
|
133
|
-
return tsType.raw.replace(/\|/g, "\\|");
|
|
134
|
-
} else if (tsType.elements) {
|
|
135
|
-
// Methods
|
|
136
|
-
return tsType.elements.map((element) => element.name).join(" \\| ");
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return tsType.name;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
type TSTypeType = {
|
|
144
|
-
name: string;
|
|
145
|
-
raw: string;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
type TSFuncSignature = {
|
|
149
|
-
arguments: { type: TSType; name: string }[];
|
|
150
|
-
return: TSType;
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
type TSKVProperties = { key: string; value: TSType; description: string }[];
|
|
154
|
-
|
|
155
|
-
type TSObjectSignature = {
|
|
156
|
-
properties: TSKVProperties;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
interface TSVoidType extends TSTypeType {
|
|
160
|
-
name: "void";
|
|
161
|
-
type: never;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
interface TSUnionType extends TSTypeType {
|
|
165
|
-
name: "union";
|
|
166
|
-
type: never;
|
|
167
|
-
elements: any[];
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
interface TSFunctionType extends TSTypeType {
|
|
171
|
-
name: "signature";
|
|
172
|
-
type: "function";
|
|
173
|
-
signature: TSFuncSignature;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
interface TSObjectType extends TSTypeType {
|
|
177
|
-
name: "signature";
|
|
178
|
-
type: "object";
|
|
179
|
-
signature: TSObjectSignature;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
type TSType = TSVoidType | TSUnionType | TSFunctionType | TSObjectType;
|
|
183
|
-
|
|
184
|
-
function tsTypeIsFunction(tsType: TSType): tsType is TSFunctionType {
|
|
185
|
-
return "type" in tsType && tsType.type === "function";
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
function tsTypeIsObject(tsType: TSType): tsType is TSObjectType {
|
|
189
|
-
return "type" in tsType && tsType.type === "object";
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function tsTypeDump(tsType: TSType): string {
|
|
193
|
-
if (tsTypeIsFunction(tsType)) {
|
|
194
|
-
const { signature } = tsType;
|
|
195
|
-
return `(${signature.arguments
|
|
196
|
-
.map(({ name, type }) => `${name}:${tsTypeDump(type)}`)
|
|
197
|
-
.join(", ")}) => ${tsTypeDump(signature.return)}`;
|
|
198
|
-
} else if (tsTypeIsObject(tsType)) {
|
|
199
|
-
const { signature } = tsType;
|
|
200
|
-
return `{${signature.properties
|
|
201
|
-
.map(({ key, value }) => `${key}: ${tsTypeDump(value)}`)
|
|
202
|
-
.join(", ")}}`;
|
|
203
|
-
} else {
|
|
204
|
-
return tsType.name;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
function tsTypeDescType(tsType?: TSType) {
|
|
209
|
-
if (!tsType) {
|
|
210
|
-
return null;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
if (tsType.name === "signature" && tsType.type === "object") {
|
|
214
|
-
const { properties } = tsType.signature;
|
|
215
|
-
if (properties) {
|
|
216
|
-
const value = properties.map((kv) => {
|
|
217
|
-
return mapProp(
|
|
218
|
-
mapNestedProp({ ...kv.value, description: kv.description }),
|
|
219
|
-
kv.key,
|
|
220
|
-
false,
|
|
221
|
-
);
|
|
222
|
-
});
|
|
223
|
-
return { name: "shape", value };
|
|
224
|
-
} else if (tsType.raw.length < 200) {
|
|
225
|
-
return `${tsType.raw
|
|
226
|
-
.replace(/(\n|\s)/g, "")
|
|
227
|
-
.replace(/(\|)/g, "\\|")}`;
|
|
228
|
-
} else {
|
|
229
|
-
return "FIX ME FORMAT BIG OBJECT";
|
|
230
|
-
}
|
|
231
|
-
} else if (tsType.name === "signature" && tsType.type === "function") {
|
|
232
|
-
return { name: "func", funcSignature: tsTypeDump(tsType) };
|
|
233
|
-
} else if (tsType.name === "union") {
|
|
234
|
-
if (tsType.raw) {
|
|
235
|
-
// Props
|
|
236
|
-
return tsType.raw.replace(/\|/g, "\\|");
|
|
237
|
-
} else if (tsType.elements) {
|
|
238
|
-
// Methods
|
|
239
|
-
return tsType.elements.map((e) => e.name).join(" \\| ");
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
return tsType.name;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
function mapProp(
|
|
247
|
-
propMeta: any,
|
|
248
|
-
propName: string | undefined,
|
|
249
|
-
array: boolean,
|
|
250
|
-
) {
|
|
251
|
-
let result: Record<string, any> = {};
|
|
252
|
-
if (!array) {
|
|
253
|
-
result = {
|
|
254
|
-
name: propName || "FIX ME NO NAME",
|
|
255
|
-
required: propMeta.required || false,
|
|
256
|
-
type:
|
|
257
|
-
propMeta.type?.name ||
|
|
258
|
-
tsTypeDescType(propMeta.tsType) ||
|
|
259
|
-
"FIX ME UNKNOWN TYPE",
|
|
260
|
-
default: !propMeta.defaultValue
|
|
261
|
-
? "none"
|
|
262
|
-
: propMeta.defaultValue.value.replace(/\n/g, ""),
|
|
263
|
-
description: propMeta.description || "FIX ME NO DESCRIPTION",
|
|
264
|
-
};
|
|
265
|
-
if (
|
|
266
|
-
result.type &&
|
|
267
|
-
result.type.name === "func" &&
|
|
268
|
-
result.type.funcSignature
|
|
269
|
-
) {
|
|
270
|
-
result.description = `${result.description}\n*signature:*\`${result.type.funcSignature}\``;
|
|
271
|
-
}
|
|
272
|
-
} else {
|
|
273
|
-
if (propName) {
|
|
274
|
-
result.name = propName;
|
|
275
|
-
}
|
|
276
|
-
if (propMeta.required !== undefined) {
|
|
277
|
-
result.required = propMeta.required;
|
|
278
|
-
}
|
|
279
|
-
result.type =
|
|
280
|
-
(propMeta.type && propMeta.type.name) ||
|
|
281
|
-
tsTypeDescType(propMeta.tsType) ||
|
|
282
|
-
"FIX ME UNKNOWN TYPE";
|
|
283
|
-
if (propMeta.defaultValue) {
|
|
284
|
-
result.default = propMeta.defaultValue.value.replace(/\n/g, "");
|
|
285
|
-
}
|
|
286
|
-
if (propMeta.description) {
|
|
287
|
-
result.description = propMeta.description;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
if (
|
|
292
|
-
propMeta.type &&
|
|
293
|
-
propMeta.type.name === "arrayOf" &&
|
|
294
|
-
propMeta.type.value
|
|
295
|
-
) {
|
|
296
|
-
result.type = {
|
|
297
|
-
name: "array",
|
|
298
|
-
value: mapProp(mapNestedProp(propMeta.type.value), undefined, true),
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
if (propMeta.type && propMeta.type.name === "func") {
|
|
303
|
-
const jsdoc = parseJsDoc(propMeta.description);
|
|
304
|
-
if (jsdoc && jsdoc.description) {
|
|
305
|
-
result.description = jsdoc.description;
|
|
306
|
-
}
|
|
307
|
-
if (jsdoc && jsdoc.params && jsdoc.params.length > 0) {
|
|
308
|
-
result.params = jsdoc.params;
|
|
309
|
-
}
|
|
310
|
-
if (jsdoc && jsdoc.returns) {
|
|
311
|
-
result.returns = jsdoc.returns;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
if (
|
|
315
|
-
propMeta.type &&
|
|
316
|
-
propMeta.type.name === "shape" &&
|
|
317
|
-
propMeta.type.value
|
|
318
|
-
) {
|
|
319
|
-
const type = propMeta.type.value;
|
|
320
|
-
const value = Object.keys(type).map((_name) =>
|
|
321
|
-
mapProp(mapNestedProp(type[_name]), _name, false),
|
|
322
|
-
);
|
|
323
|
-
result.type = { name: "shape", value };
|
|
324
|
-
}
|
|
325
|
-
return result;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
// props
|
|
329
|
-
component.props = Object.keys(component.props).map((propName) => {
|
|
330
|
-
const propMeta = component.props[propName];
|
|
331
|
-
|
|
332
|
-
return mapProp(propMeta, propName, false);
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
// methods
|
|
336
|
-
const privateMethods: string[] = [];
|
|
337
|
-
for (const method of component.methods) {
|
|
338
|
-
if (this.isPrivateMethod(method.name)) {
|
|
339
|
-
privateMethods.push(method.name);
|
|
340
|
-
continue;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
if (method.docblock) {
|
|
344
|
-
const examples = method.docblock
|
|
345
|
-
.split("@")
|
|
346
|
-
.filter((block: string) => block.startsWith("example"));
|
|
347
|
-
method.examples = examples.map((example: any) =>
|
|
348
|
-
example.substring("example".length),
|
|
349
|
-
);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
privateMethods.push(...IGNORE_METHODS);
|
|
353
|
-
|
|
354
|
-
component.methods = component.methods.filter(
|
|
355
|
-
(method: any) => !privateMethods.includes(method.name),
|
|
356
|
-
);
|
|
357
|
-
|
|
358
|
-
component.methods.forEach((method: any) => {
|
|
359
|
-
method.params.forEach((param: any) => {
|
|
360
|
-
param.type = { name: tsTypeDesc(param.type) };
|
|
361
|
-
});
|
|
362
|
-
});
|
|
363
|
-
|
|
364
|
-
console.log(
|
|
365
|
-
`Processed ${component.name} (${component.props?.length ?? 0} props, ${
|
|
366
|
-
component.methods?.length ?? 0
|
|
367
|
-
} methods)`,
|
|
368
|
-
);
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
async generateReactComponentsTask(results: Record<string, any>) {
|
|
372
|
-
const filesNames = await fs.readdir(COMPONENT_DIRECTORY);
|
|
373
|
-
|
|
374
|
-
const files = await Promise.all(
|
|
375
|
-
filesNames.map(async (base) => {
|
|
376
|
-
return {
|
|
377
|
-
base,
|
|
378
|
-
content: await fs.readFile(
|
|
379
|
-
path.join(COMPONENT_DIRECTORY, base),
|
|
380
|
-
"utf-8",
|
|
381
|
-
),
|
|
382
|
-
};
|
|
383
|
-
}),
|
|
384
|
-
);
|
|
385
|
-
|
|
386
|
-
files.forEach(({ base, content }) => {
|
|
387
|
-
const parsedComponents = docgen.parse(content, {
|
|
388
|
-
babelOptions: {
|
|
389
|
-
filename: base,
|
|
390
|
-
},
|
|
391
|
-
});
|
|
392
|
-
|
|
393
|
-
const [parsed] = parsedComponents;
|
|
394
|
-
|
|
395
|
-
results[path.parse(base).name] = {
|
|
396
|
-
...parsed,
|
|
397
|
-
filePath: path.relative(
|
|
398
|
-
WORKSPACE_ROOT,
|
|
399
|
-
path.join(COMPONENT_DIRECTORY, base),
|
|
400
|
-
),
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
this.postprocess(results[path.parse(base).name], path.parse(base).name);
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
async generateModulesTask(results: Record<string, any>) {
|
|
408
|
-
return new Promise<void>((resolve, reject) => {
|
|
409
|
-
exec(
|
|
410
|
-
`yarn run documentation build ${MODULES_DIRECTORY} -f json`,
|
|
411
|
-
(err, stdout, stderr) => {
|
|
412
|
-
if (err || stderr) {
|
|
413
|
-
reject(err || stderr);
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
const modules = JSON.parse(stdout);
|
|
418
|
-
for (const module of modules) {
|
|
419
|
-
const node = new JSDocNodeTree(module);
|
|
420
|
-
const name = `${module.name
|
|
421
|
-
.charAt(0)
|
|
422
|
-
.toLowerCase()}${module.name.substring(1)}`;
|
|
423
|
-
|
|
424
|
-
results[name] = {
|
|
425
|
-
name,
|
|
426
|
-
filePath: path.relative(WORKSPACE_ROOT, module.context.file),
|
|
427
|
-
description: node.getText(),
|
|
428
|
-
props: [],
|
|
429
|
-
styles: [],
|
|
430
|
-
methods: node.getMethods(),
|
|
431
|
-
};
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
resolve();
|
|
435
|
-
},
|
|
436
|
-
);
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
sortObject(unsorted: Record<string, any>) {
|
|
441
|
-
return Object.keys(unsorted)
|
|
442
|
-
.sort()
|
|
443
|
-
.reduce(
|
|
444
|
-
(acc, key) => ({
|
|
445
|
-
...acc,
|
|
446
|
-
[key]: unsorted[key],
|
|
447
|
-
}),
|
|
448
|
-
{},
|
|
449
|
-
);
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
async generate() {
|
|
453
|
-
const results = {};
|
|
454
|
-
|
|
455
|
-
await this.generateReactComponentsTask(results);
|
|
456
|
-
await this.generateModulesTask(results);
|
|
457
|
-
|
|
458
|
-
await fs.writeFile(
|
|
459
|
-
OUTPUT_PATH,
|
|
460
|
-
JSON.stringify(this.sortObject(results), null, 2),
|
|
461
|
-
);
|
|
462
|
-
}
|
|
463
|
-
}
|