react-native-share 7.6.4 → 7.7.0
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/README.md +1 -1
- package/android/src/main/java/cl/json/social/InstagramStoriesShare.java +3 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/types.d.ts +1 -1
- package/package.json +5 -2
- package/src/types.ts +1 -1
- package/windows/.gitignore +16 -2
- package/windows/ExperimentalFeatures.props +10 -0
- package/windows/NuGet.Config +14 -0
- package/windows/ReactNativeShare/PropertySheet.props +16 -0
- package/windows/ReactNativeShare/ReactNativeModule.h +108 -0
- package/windows/ReactNativeShare/ReactNativeShare.def +3 -0
- package/windows/ReactNativeShare/ReactNativeShare.vcxproj +160 -0
- package/windows/ReactNativeShare/ReactNativeShare.vcxproj.filters +20 -0
- package/windows/ReactNativeShare/ReactPackageProvider.cpp +19 -0
- package/windows/ReactNativeShare/ReactPackageProvider.h +21 -0
- package/windows/ReactNativeShare/ReactPackageProvider.idl +9 -0
- package/windows/ReactNativeShare/packages.config +6 -0
- package/windows/ReactNativeShare/pch.cpp +1 -0
- package/windows/ReactNativeShare/pch.h +18 -0
- package/windows/ReactNativeShare.sln +156 -0
- package/windows/RNShare/Properties/AssemblyInfo.cs +0 -29
- package/windows/RNShare/Properties/RNShare.rd.xml +0 -33
- package/windows/RNShare/RNShare.csproj +0 -183
- package/windows/RNShare/RNShareModule.cs +0 -118
- package/windows/RNShare/RNSharePackage.cs +0 -53
- package/windows/RNShare/project.json +0 -16
- package/windows/RNShare.sln +0 -86
package/README.md
CHANGED
|
@@ -52,4 +52,4 @@ Which you do something similar to this:
|
|
|
52
52
|
|
|
53
53
|
# Documentation
|
|
54
54
|
|
|
55
|
-
If you are using a older version of `react-native` or `react-native-share`, having any problem or want to know how use `Share.open` and other functions, please refer to our new [docs](https://react-native-share.github.io/react-native-share) and help us improve that
|
|
55
|
+
If you are using a older version of `react-native` or `react-native-share`, having any problem or want to know how use `Share.open` and other functions, please refer to our new [docs](https://react-native-share.github.io/react-native-share) and help us improve that.🚀
|
|
@@ -86,14 +86,16 @@ public class InstagramStoriesShare extends SingleShareIntent {
|
|
|
86
86
|
|
|
87
87
|
if (hasBackgroundAsset) {
|
|
88
88
|
String backgroundFileName = "";
|
|
89
|
+
String backgroundType = "image/jpeg";
|
|
89
90
|
|
|
90
91
|
if (this.hasValidKey("backgroundImage", options)) {
|
|
91
92
|
backgroundFileName = options.getString("backgroundImage");
|
|
92
93
|
} else if (this.hasValidKey("backgroundVideo", options)) {
|
|
93
94
|
backgroundFileName = options.getString("backgroundVideo");
|
|
95
|
+
backgroundType = "video/*";
|
|
94
96
|
}
|
|
95
97
|
|
|
96
|
-
ShareFile backgroundAsset = new ShareFile(backgroundFileName,
|
|
98
|
+
ShareFile backgroundAsset = new ShareFile(backgroundFileName, backgroundType, "background", useInternalStorage, this.reactContext);
|
|
97
99
|
|
|
98
100
|
this.intent.setDataAndType(backgroundAsset.getURI(), backgroundAsset.getType());
|
|
99
101
|
this.intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["types.ts"],"names":["Social","ShareAsset"],"mappings":";;;;;;IAAYA,M;;;WAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;GAAAA,M,sBAAAA,M;;IAoBAC,U;;;WAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;GAAAA,U,0BAAAA,U","sourcesContent":["export enum Social {\n Facebook = 'facebook',\n FacebookStories = 'facebookstories',\n Pagesmanager = 'pagesmanager',\n Twitter = 'twitter',\n Whatsapp = 'whatsapp',\n Whatsappbusiness = 'whatsappbusiness',\n Instagram = 'instagram',\n InstagramStories = 'instagramstories',\n Googleplus = 'googleplus',\n Email = 'email',\n Pinterest = 'pinterest',\n Linkedin = 'linkedin',\n Sms = 'sms',\n Telegram = 'telegram',\n Snapchat = 'snapchat',\n Messenger = 'messenger',\n Viber = 'viber',\n}\n\nexport enum ShareAsset {\n BackgroundImage = 'shareBackgroundImage',\n BackgroundVideo = 'shareBackgroundVideo',\n StickerImage = 'shareStickerImage',\n BackgroundAndStickerImage = 'shareBackgroundAndStickerImage',\n}\n\nexport interface LinkMetadata {\n originalUrl?: string;\n url?: string;\n title?: string;\n icon?: string;\n image?: string;\n remoteVideoUrl?: string;\n video?: string;\n}\n\nexport interface ActivityItem {\n type: 'text' | 'url';\n content: string;\n}\n\nexport interface ActivityItemSource {\n placeholderItem: ActivityItem;\n item: { [key in ActivityType]?: ActivityItem | null | undefined };\n subject?: { [key in ActivityType]?: string };\n dataTypeIdentifier?: { [key in ActivityType]?: string };\n thumbnailImage?: { [key in ActivityType]?: string };\n linkMetadata?: LinkMetadata;\n}\n\ninterface BaseShareSingleOptions {\n urls?: string[];\n url?: string;\n type?: string;\n filename?: string;\n message?: string;\n title?: string;\n subject?: string;\n email?: string;\n recipient?: string;\n social: Exclude<Social, Social.FacebookStories | Social.InstagramStories>;\n forceDialog?: boolean;\n}\n\ninterface BaseSocialStoriesShareSingleOptions extends Omit<BaseShareSingleOptions, 'social'> {\n backgroundImage?: string;\n stickerImage?: string;\n backgroundBottomColor?: string;\n backgroundTopColor?: string;\n attributionURL?: string;\n backgroundVideo?: string;\n}\n\nexport interface InstagramStoriesShareSingleOptions extends BaseSocialStoriesShareSingleOptions {\n social: Social.InstagramStories;\n}\n\nexport interface FacebookStoriesShareSingleOptions extends BaseSocialStoriesShareSingleOptions {\n social: Social.FacebookStories;\n appId: string;\n}\n\nexport type ShareSingleOptions =\n | BaseShareSingleOptions\n | InstagramStoriesShareSingleOptions\n | FacebookStoriesShareSingleOptions;\n\nexport interface ShareOptions {\n message?: string;\n title?: string;\n url?: string;\n urls?: string[];\n type?: string;\n subject?: string;\n email?: string;\n recipient?: string;\n excludedActivityTypes?: ActivityType[];\n failOnCancel?: boolean;\n showAppsToView?: boolean;\n filename?: string;\n filenames?: string[];\n saveToFiles?: boolean;\n activityItemSources?: ActivityItemSource[];\n isNewTask?: boolean;\n}\n\nexport type ActivityType =\n | 'default'\n | 'addToReadingList'\n | 'airDrop'\n | 'assignToContact'\n | 'copyToPasteBoard'\n | 'mail'\n | 'message'\n | 'openInIBooks' // iOS 9 or later\n | 'postToFacebook'\n | 'postToFlickr'\n | 'postToTencentWeibo'\n | 'postToTwitter'\n | 'postToVimeo'\n | 'postToWeibo'\n | 'print'\n | 'saveToCameraRoll'\n | 'markupAsPDF'; // iOS 11 or late\n\nexport interface ShareSingleResult {\n message: string;\n success: boolean;\n}\n\nexport interface ShareOpenResult extends ShareSingleResult {\n dismissedAction?: boolean;\n}\nexport interface IsPackageInstalledResult {\n message: string;\n isInstalled: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["types.ts"],"names":["Social","ShareAsset"],"mappings":";;;;;;IAAYA,M;;;WAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;GAAAA,M,sBAAAA,M;;IAoBAC,U;;;WAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;GAAAA,U,0BAAAA,U","sourcesContent":["export enum Social {\n Facebook = 'facebook',\n FacebookStories = 'facebookstories',\n Pagesmanager = 'pagesmanager',\n Twitter = 'twitter',\n Whatsapp = 'whatsapp',\n Whatsappbusiness = 'whatsappbusiness',\n Instagram = 'instagram',\n InstagramStories = 'instagramstories',\n Googleplus = 'googleplus',\n Email = 'email',\n Pinterest = 'pinterest',\n Linkedin = 'linkedin',\n Sms = 'sms',\n Telegram = 'telegram',\n Snapchat = 'snapchat',\n Messenger = 'messenger',\n Viber = 'viber',\n}\n\nexport enum ShareAsset {\n BackgroundImage = 'shareBackgroundImage',\n BackgroundVideo = 'shareBackgroundVideo',\n StickerImage = 'shareStickerImage',\n BackgroundAndStickerImage = 'shareBackgroundAndStickerImage',\n}\n\nexport interface LinkMetadata {\n originalUrl?: string;\n url?: string;\n title?: string;\n icon?: string;\n image?: string;\n remoteVideoUrl?: string;\n video?: string;\n}\n\nexport interface ActivityItem {\n type: 'text' | 'url';\n content: string;\n}\n\nexport interface ActivityItemSource {\n placeholderItem: ActivityItem;\n item: { [key in ActivityType]?: ActivityItem | null | undefined };\n subject?: { [key in ActivityType]?: string };\n dataTypeIdentifier?: { [key in ActivityType]?: string };\n thumbnailImage?: { [key in ActivityType]?: string };\n linkMetadata?: LinkMetadata;\n}\n\ninterface BaseShareSingleOptions {\n urls?: string[];\n url?: string;\n type?: string;\n filename?: string;\n message?: string;\n title?: string;\n subject?: string;\n email?: string;\n recipient?: string;\n social: Exclude<Social, Social.FacebookStories | Social.InstagramStories>;\n forceDialog?: boolean;\n}\n\ninterface BaseSocialStoriesShareSingleOptions extends Omit<BaseShareSingleOptions, 'social'> {\n backgroundImage?: string;\n stickerImage?: string;\n backgroundBottomColor?: string;\n backgroundTopColor?: string;\n attributionURL?: string;\n backgroundVideo?: string;\n}\n\nexport interface InstagramStoriesShareSingleOptions extends BaseSocialStoriesShareSingleOptions {\n social: Social.InstagramStories;\n}\n\nexport interface FacebookStoriesShareSingleOptions extends BaseSocialStoriesShareSingleOptions {\n social: Social.FacebookStories;\n appId: string;\n}\n\nexport type ShareSingleOptions =\n | BaseShareSingleOptions\n | InstagramStoriesShareSingleOptions\n | FacebookStoriesShareSingleOptions;\n\nexport interface ShareOptions {\n message?: string;\n title?: string;\n url?: string;\n urls?: string[];\n type?: string;\n subject?: string;\n email?: string;\n recipient?: string;\n excludedActivityTypes?: ActivityType[] | string[];\n failOnCancel?: boolean;\n showAppsToView?: boolean;\n filename?: string;\n filenames?: string[];\n saveToFiles?: boolean;\n activityItemSources?: ActivityItemSource[];\n isNewTask?: boolean;\n}\n\nexport type ActivityType =\n | 'default'\n | 'addToReadingList'\n | 'airDrop'\n | 'assignToContact'\n | 'copyToPasteBoard'\n | 'mail'\n | 'message'\n | 'openInIBooks' // iOS 9 or later\n | 'postToFacebook'\n | 'postToFlickr'\n | 'postToTencentWeibo'\n | 'postToTwitter'\n | 'postToVimeo'\n | 'postToWeibo'\n | 'print'\n | 'saveToCameraRoll'\n | 'markupAsPDF'; // iOS 11 or late\n\nexport interface ShareSingleResult {\n message: string;\n success: boolean;\n}\n\nexport interface ShareOpenResult extends ShareSingleResult {\n dismissedAction?: boolean;\n}\nexport interface IsPackageInstalledResult {\n message: string;\n isInstalled: boolean;\n}\n"]}
|
package/lib/module/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["types.ts"],"names":["Social","ShareAsset"],"mappings":"AAAA,WAAYA,MAAZ;;WAAYA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;GAAAA,M,KAAAA,M;;AAoBZ,WAAYC,UAAZ;;WAAYA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;GAAAA,U,KAAAA,U","sourcesContent":["export enum Social {\n Facebook = 'facebook',\n FacebookStories = 'facebookstories',\n Pagesmanager = 'pagesmanager',\n Twitter = 'twitter',\n Whatsapp = 'whatsapp',\n Whatsappbusiness = 'whatsappbusiness',\n Instagram = 'instagram',\n InstagramStories = 'instagramstories',\n Googleplus = 'googleplus',\n Email = 'email',\n Pinterest = 'pinterest',\n Linkedin = 'linkedin',\n Sms = 'sms',\n Telegram = 'telegram',\n Snapchat = 'snapchat',\n Messenger = 'messenger',\n Viber = 'viber',\n}\n\nexport enum ShareAsset {\n BackgroundImage = 'shareBackgroundImage',\n BackgroundVideo = 'shareBackgroundVideo',\n StickerImage = 'shareStickerImage',\n BackgroundAndStickerImage = 'shareBackgroundAndStickerImage',\n}\n\nexport interface LinkMetadata {\n originalUrl?: string;\n url?: string;\n title?: string;\n icon?: string;\n image?: string;\n remoteVideoUrl?: string;\n video?: string;\n}\n\nexport interface ActivityItem {\n type: 'text' | 'url';\n content: string;\n}\n\nexport interface ActivityItemSource {\n placeholderItem: ActivityItem;\n item: { [key in ActivityType]?: ActivityItem | null | undefined };\n subject?: { [key in ActivityType]?: string };\n dataTypeIdentifier?: { [key in ActivityType]?: string };\n thumbnailImage?: { [key in ActivityType]?: string };\n linkMetadata?: LinkMetadata;\n}\n\ninterface BaseShareSingleOptions {\n urls?: string[];\n url?: string;\n type?: string;\n filename?: string;\n message?: string;\n title?: string;\n subject?: string;\n email?: string;\n recipient?: string;\n social: Exclude<Social, Social.FacebookStories | Social.InstagramStories>;\n forceDialog?: boolean;\n}\n\ninterface BaseSocialStoriesShareSingleOptions extends Omit<BaseShareSingleOptions, 'social'> {\n backgroundImage?: string;\n stickerImage?: string;\n backgroundBottomColor?: string;\n backgroundTopColor?: string;\n attributionURL?: string;\n backgroundVideo?: string;\n}\n\nexport interface InstagramStoriesShareSingleOptions extends BaseSocialStoriesShareSingleOptions {\n social: Social.InstagramStories;\n}\n\nexport interface FacebookStoriesShareSingleOptions extends BaseSocialStoriesShareSingleOptions {\n social: Social.FacebookStories;\n appId: string;\n}\n\nexport type ShareSingleOptions =\n | BaseShareSingleOptions\n | InstagramStoriesShareSingleOptions\n | FacebookStoriesShareSingleOptions;\n\nexport interface ShareOptions {\n message?: string;\n title?: string;\n url?: string;\n urls?: string[];\n type?: string;\n subject?: string;\n email?: string;\n recipient?: string;\n excludedActivityTypes?: ActivityType[];\n failOnCancel?: boolean;\n showAppsToView?: boolean;\n filename?: string;\n filenames?: string[];\n saveToFiles?: boolean;\n activityItemSources?: ActivityItemSource[];\n isNewTask?: boolean;\n}\n\nexport type ActivityType =\n | 'default'\n | 'addToReadingList'\n | 'airDrop'\n | 'assignToContact'\n | 'copyToPasteBoard'\n | 'mail'\n | 'message'\n | 'openInIBooks' // iOS 9 or later\n | 'postToFacebook'\n | 'postToFlickr'\n | 'postToTencentWeibo'\n | 'postToTwitter'\n | 'postToVimeo'\n | 'postToWeibo'\n | 'print'\n | 'saveToCameraRoll'\n | 'markupAsPDF'; // iOS 11 or late\n\nexport interface ShareSingleResult {\n message: string;\n success: boolean;\n}\n\nexport interface ShareOpenResult extends ShareSingleResult {\n dismissedAction?: boolean;\n}\nexport interface IsPackageInstalledResult {\n message: string;\n isInstalled: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["types.ts"],"names":["Social","ShareAsset"],"mappings":"AAAA,WAAYA,MAAZ;;WAAYA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;GAAAA,M,KAAAA,M;;AAoBZ,WAAYC,UAAZ;;WAAYA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;GAAAA,U,KAAAA,U","sourcesContent":["export enum Social {\n Facebook = 'facebook',\n FacebookStories = 'facebookstories',\n Pagesmanager = 'pagesmanager',\n Twitter = 'twitter',\n Whatsapp = 'whatsapp',\n Whatsappbusiness = 'whatsappbusiness',\n Instagram = 'instagram',\n InstagramStories = 'instagramstories',\n Googleplus = 'googleplus',\n Email = 'email',\n Pinterest = 'pinterest',\n Linkedin = 'linkedin',\n Sms = 'sms',\n Telegram = 'telegram',\n Snapchat = 'snapchat',\n Messenger = 'messenger',\n Viber = 'viber',\n}\n\nexport enum ShareAsset {\n BackgroundImage = 'shareBackgroundImage',\n BackgroundVideo = 'shareBackgroundVideo',\n StickerImage = 'shareStickerImage',\n BackgroundAndStickerImage = 'shareBackgroundAndStickerImage',\n}\n\nexport interface LinkMetadata {\n originalUrl?: string;\n url?: string;\n title?: string;\n icon?: string;\n image?: string;\n remoteVideoUrl?: string;\n video?: string;\n}\n\nexport interface ActivityItem {\n type: 'text' | 'url';\n content: string;\n}\n\nexport interface ActivityItemSource {\n placeholderItem: ActivityItem;\n item: { [key in ActivityType]?: ActivityItem | null | undefined };\n subject?: { [key in ActivityType]?: string };\n dataTypeIdentifier?: { [key in ActivityType]?: string };\n thumbnailImage?: { [key in ActivityType]?: string };\n linkMetadata?: LinkMetadata;\n}\n\ninterface BaseShareSingleOptions {\n urls?: string[];\n url?: string;\n type?: string;\n filename?: string;\n message?: string;\n title?: string;\n subject?: string;\n email?: string;\n recipient?: string;\n social: Exclude<Social, Social.FacebookStories | Social.InstagramStories>;\n forceDialog?: boolean;\n}\n\ninterface BaseSocialStoriesShareSingleOptions extends Omit<BaseShareSingleOptions, 'social'> {\n backgroundImage?: string;\n stickerImage?: string;\n backgroundBottomColor?: string;\n backgroundTopColor?: string;\n attributionURL?: string;\n backgroundVideo?: string;\n}\n\nexport interface InstagramStoriesShareSingleOptions extends BaseSocialStoriesShareSingleOptions {\n social: Social.InstagramStories;\n}\n\nexport interface FacebookStoriesShareSingleOptions extends BaseSocialStoriesShareSingleOptions {\n social: Social.FacebookStories;\n appId: string;\n}\n\nexport type ShareSingleOptions =\n | BaseShareSingleOptions\n | InstagramStoriesShareSingleOptions\n | FacebookStoriesShareSingleOptions;\n\nexport interface ShareOptions {\n message?: string;\n title?: string;\n url?: string;\n urls?: string[];\n type?: string;\n subject?: string;\n email?: string;\n recipient?: string;\n excludedActivityTypes?: ActivityType[] | string[];\n failOnCancel?: boolean;\n showAppsToView?: boolean;\n filename?: string;\n filenames?: string[];\n saveToFiles?: boolean;\n activityItemSources?: ActivityItemSource[];\n isNewTask?: boolean;\n}\n\nexport type ActivityType =\n | 'default'\n | 'addToReadingList'\n | 'airDrop'\n | 'assignToContact'\n | 'copyToPasteBoard'\n | 'mail'\n | 'message'\n | 'openInIBooks' // iOS 9 or later\n | 'postToFacebook'\n | 'postToFlickr'\n | 'postToTencentWeibo'\n | 'postToTwitter'\n | 'postToVimeo'\n | 'postToWeibo'\n | 'print'\n | 'saveToCameraRoll'\n | 'markupAsPDF'; // iOS 11 or late\n\nexport interface ShareSingleResult {\n message: string;\n success: boolean;\n}\n\nexport interface ShareOpenResult extends ShareSingleResult {\n dismissedAction?: boolean;\n}\nexport interface IsPackageInstalledResult {\n message: string;\n isInstalled: boolean;\n}\n"]}
|
|
@@ -90,7 +90,7 @@ export interface ShareOptions {
|
|
|
90
90
|
subject?: string;
|
|
91
91
|
email?: string;
|
|
92
92
|
recipient?: string;
|
|
93
|
-
excludedActivityTypes?: ActivityType[];
|
|
93
|
+
excludedActivityTypes?: ActivityType[] | string[];
|
|
94
94
|
failOnCancel?: boolean;
|
|
95
95
|
showAppsToView?: boolean;
|
|
96
96
|
filename?: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-share",
|
|
3
3
|
"description": "Social share, sending simple data to other apps.",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.7.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/react-native-community/react-native-share.git"
|
|
@@ -41,12 +41,14 @@
|
|
|
41
41
|
"eslint-config-satya164": "3.1.10",
|
|
42
42
|
"husky": "4.3.0",
|
|
43
43
|
"lint-staged": "10.3.0",
|
|
44
|
+
"metro-config": "^0.66.2",
|
|
44
45
|
"metro-react-native-babel-preset": "^0.66.2",
|
|
45
46
|
"pre-commit": "1.2.2",
|
|
46
47
|
"prettier": "^2.2.1",
|
|
47
48
|
"react": "17.0.2",
|
|
48
49
|
"react-native": "0.66.4",
|
|
49
50
|
"react-native-builder-bob": "^0.18.1",
|
|
51
|
+
"react-native-windows": "0.66.4",
|
|
50
52
|
"semantic-release": "^19.0.3",
|
|
51
53
|
"typescript": "4.2.4"
|
|
52
54
|
},
|
|
@@ -80,7 +82,8 @@
|
|
|
80
82
|
"typescript": "tsc --noEmit",
|
|
81
83
|
"validate": "yarn lint && yarn typescript",
|
|
82
84
|
"ci:publish": "npx semantic-release",
|
|
83
|
-
"prepare": "bob build"
|
|
85
|
+
"prepare": "bob build",
|
|
86
|
+
"windows": "react-native run-windows"
|
|
84
87
|
},
|
|
85
88
|
"husky": {
|
|
86
89
|
"hooks": {
|
package/src/types.ts
CHANGED
|
@@ -95,7 +95,7 @@ export interface ShareOptions {
|
|
|
95
95
|
subject?: string;
|
|
96
96
|
email?: string;
|
|
97
97
|
recipient?: string;
|
|
98
|
-
excludedActivityTypes?: ActivityType[];
|
|
98
|
+
excludedActivityTypes?: ActivityType[] | string[];
|
|
99
99
|
failOnCancel?: boolean;
|
|
100
100
|
showAppsToView?: boolean;
|
|
101
101
|
filename?: string;
|
package/windows/.gitignore
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
*AppPackages*
|
|
2
2
|
*BundleArtifacts*
|
|
3
|
-
*ReactAssets*
|
|
4
3
|
|
|
5
4
|
#OS junk files
|
|
6
5
|
[Tt]humbs.db
|
|
@@ -36,6 +35,17 @@ ipch/
|
|
|
36
35
|
[Rr]elease*/
|
|
37
36
|
Ankh.NoLoad
|
|
38
37
|
|
|
38
|
+
# Visual C++ cache files
|
|
39
|
+
ipch/
|
|
40
|
+
*.aps
|
|
41
|
+
*.ncb
|
|
42
|
+
*.opendb
|
|
43
|
+
*.opensdf
|
|
44
|
+
*.sdf
|
|
45
|
+
*.cachefile
|
|
46
|
+
*.VC.db
|
|
47
|
+
*.VC.VC.opendb
|
|
48
|
+
|
|
39
49
|
#MonoDevelop
|
|
40
50
|
*.pidb
|
|
41
51
|
*.userprefs
|
|
@@ -75,4 +85,8 @@ packages/
|
|
|
75
85
|
#Other files
|
|
76
86
|
*.DotSettings
|
|
77
87
|
.vs/
|
|
78
|
-
*project.lock.json
|
|
88
|
+
*project.lock.json
|
|
89
|
+
|
|
90
|
+
#Files generated by the VS build
|
|
91
|
+
**/Generated Files/**
|
|
92
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
|
+
|
|
4
|
+
<!--
|
|
5
|
+
Application projects contain a file with this name to specify some important settings
|
|
6
|
+
that will apply globally for the app and *all* native modules the app consumes. These
|
|
7
|
+
values are set by the app developer.
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
</Project>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<configuration>
|
|
3
|
+
<config>
|
|
4
|
+
<add key="repositoryPath" value="packages" />
|
|
5
|
+
</config>
|
|
6
|
+
<packageSources>
|
|
7
|
+
<clear />
|
|
8
|
+
<add key="react-native" value="https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/nuget/v3/index.json" />
|
|
9
|
+
<add key="Nuget.org" value="https://api.nuget.org/v3/index.json" />
|
|
10
|
+
</packageSources>
|
|
11
|
+
<disabledPackageSources>
|
|
12
|
+
<clear />
|
|
13
|
+
</disabledPackageSources>
|
|
14
|
+
</configuration>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
|
+
<ImportGroup Label="PropertySheets" />
|
|
4
|
+
<PropertyGroup Label="UserMacros" />
|
|
5
|
+
<!--
|
|
6
|
+
To customize common C++/WinRT project properties:
|
|
7
|
+
* right-click the project node
|
|
8
|
+
* expand the Common Properties item
|
|
9
|
+
* select the C++/WinRT property page
|
|
10
|
+
|
|
11
|
+
For more advanced scenarios, and complete documentation, please see:
|
|
12
|
+
https://github.com/Microsoft/xlang/tree/master/src/package/cppwinrt/nuget
|
|
13
|
+
-->
|
|
14
|
+
<PropertyGroup />
|
|
15
|
+
<ItemDefinitionGroup />
|
|
16
|
+
</Project>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "JSValue.h"
|
|
4
|
+
#include "NativeModules.h"
|
|
5
|
+
#include <winrt/Windows.ApplicationModel.DataTransfer.h>
|
|
6
|
+
|
|
7
|
+
using namespace winrt::Microsoft::ReactNative;
|
|
8
|
+
using namespace winrt::Windows::ApplicationModel::DataTransfer;
|
|
9
|
+
|
|
10
|
+
namespace winrt::ReactNativeShare
|
|
11
|
+
{
|
|
12
|
+
|
|
13
|
+
REACT_STRUCT(RequestData)
|
|
14
|
+
struct RequestData
|
|
15
|
+
{
|
|
16
|
+
std::wstring title;
|
|
17
|
+
std::wstring message;
|
|
18
|
+
std::wstring url;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
REACT_MODULE(ReactNativeShare, L"RNShare")
|
|
22
|
+
struct ReactNativeShare
|
|
23
|
+
{
|
|
24
|
+
REACT_INIT(Initialize)
|
|
25
|
+
void Initialize(ReactContext const &reactContext) noexcept
|
|
26
|
+
{
|
|
27
|
+
context = reactContext;
|
|
28
|
+
|
|
29
|
+
context.UIDispatcher().Post([&]() {
|
|
30
|
+
DataTransferManager dataTransferManager = DataTransferManager::GetForCurrentView();
|
|
31
|
+
auto dataRequestedToken = dataTransferManager.DataRequested(TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(this, &ReactNativeShare::handleDataRequest));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
REACT_METHOD(open)
|
|
36
|
+
void open(JSValueObject options, std::function<void(JSValue)> errorCallback, std::function<void(JSValue, JSValue)> successCallback) noexcept
|
|
37
|
+
{
|
|
38
|
+
if (options["title"] == nullptr) {
|
|
39
|
+
errorCallback("no_title_provided");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if ((options["message"] == nullptr) && (options["url"] == nullptr))
|
|
44
|
+
{
|
|
45
|
+
errorCallback("no_message_or_url_provided");
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
requestData.title = to_hstring(options["title"].AsString());
|
|
50
|
+
|
|
51
|
+
if (options["message"] != nullptr)
|
|
52
|
+
{
|
|
53
|
+
requestData.message = to_hstring(options["message"].AsString());
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (options["url"] != nullptr){
|
|
57
|
+
requestData.url = to_hstring(options["url"].AsString());
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
context.UIDispatcher().Post([&, errorCallback, successCallback]() {
|
|
61
|
+
try
|
|
62
|
+
{
|
|
63
|
+
DataTransferManager::ShowShareUI();
|
|
64
|
+
successCallback(true, "OK");
|
|
65
|
+
}
|
|
66
|
+
catch (hresult_error const& e)
|
|
67
|
+
{
|
|
68
|
+
errorCallback("not_available");
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
REACT_METHOD(addListener);
|
|
74
|
+
void addListener(std::string) noexcept
|
|
75
|
+
{
|
|
76
|
+
// Keep: Required for RN built in Event Emitter Calls.
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
REACT_METHOD(removeListeners);
|
|
80
|
+
void removeListeners(int64_t) noexcept
|
|
81
|
+
{
|
|
82
|
+
// Keep: Required for RN built in Event Emitter Calls.
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
void handleDataRequest(DataTransferManager sender, DataRequestedEventArgs e)
|
|
86
|
+
{
|
|
87
|
+
e.Request().Data().Properties().Title(requestData.title);
|
|
88
|
+
|
|
89
|
+
if (!requestData.message.empty())
|
|
90
|
+
{
|
|
91
|
+
e.Request().Data().SetText(requestData.message);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (!requestData.url.empty())
|
|
95
|
+
{
|
|
96
|
+
Windows::Foundation::Uri uri{ requestData.url };
|
|
97
|
+
e.Request().Data().SetUri(uri);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
requestData = {};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
private:
|
|
104
|
+
ReactContext context;
|
|
105
|
+
RequestData requestData = {};
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
} // namespace winrt::ReactNativeShare
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
|
+
<Import Project="$(SolutionDir)\ExperimentalFeatures.props" Condition="Exists('$(SolutionDir)\ExperimentalFeatures.props')" />
|
|
4
|
+
<Import Project="$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210312.4\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210312.4\build\native\Microsoft.Windows.CppWinRT.props')" />
|
|
5
|
+
<PropertyGroup Label="Globals">
|
|
6
|
+
<CppWinRTOptimized>true</CppWinRTOptimized>
|
|
7
|
+
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
|
|
8
|
+
<MinimalCoreWin>true</MinimalCoreWin>
|
|
9
|
+
<ProjectGuid>{bd58576e-3205-4762-8b1b-ea33774079b7}</ProjectGuid>
|
|
10
|
+
<ProjectName>ReactNativeShare</ProjectName>
|
|
11
|
+
<RootNamespace>ReactNativeShare</RootNamespace>
|
|
12
|
+
<DefaultLanguage>en-US</DefaultLanguage>
|
|
13
|
+
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
|
|
14
|
+
<AppContainerApplication>true</AppContainerApplication>
|
|
15
|
+
<ApplicationType>Windows Store</ApplicationType>
|
|
16
|
+
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
|
|
17
|
+
</PropertyGroup>
|
|
18
|
+
<PropertyGroup Label="ReactNativeWindowsProps">
|
|
19
|
+
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(SolutionDir), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
|
|
20
|
+
</PropertyGroup>
|
|
21
|
+
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.WindowsSdk.Default.props" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.WindowsSdk.Default.props')" />
|
|
22
|
+
<PropertyGroup Label="Fallback Windows SDK Versions">
|
|
23
|
+
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.19041.0</WindowsTargetPlatformVersion>
|
|
24
|
+
<WindowsTargetPlatformMinVersion Condition=" '$(WindowsTargetPlatformMinVersion)' == '' ">10.0.15063.0</WindowsTargetPlatformMinVersion>
|
|
25
|
+
</PropertyGroup>
|
|
26
|
+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
27
|
+
<ItemGroup Label="ProjectConfigurations">
|
|
28
|
+
<ProjectConfiguration Include="Debug|ARM64">
|
|
29
|
+
<Configuration>Debug</Configuration>
|
|
30
|
+
<Platform>ARM64</Platform>
|
|
31
|
+
</ProjectConfiguration>
|
|
32
|
+
<ProjectConfiguration Include="Debug|Win32">
|
|
33
|
+
<Configuration>Debug</Configuration>
|
|
34
|
+
<Platform>Win32</Platform>
|
|
35
|
+
</ProjectConfiguration>
|
|
36
|
+
<ProjectConfiguration Include="Debug|x64">
|
|
37
|
+
<Configuration>Debug</Configuration>
|
|
38
|
+
<Platform>x64</Platform>
|
|
39
|
+
</ProjectConfiguration>
|
|
40
|
+
<ProjectConfiguration Include="Release|ARM64">
|
|
41
|
+
<Configuration>Release</Configuration>
|
|
42
|
+
<Platform>ARM64</Platform>
|
|
43
|
+
</ProjectConfiguration>
|
|
44
|
+
<ProjectConfiguration Include="Release|Win32">
|
|
45
|
+
<Configuration>Release</Configuration>
|
|
46
|
+
<Platform>Win32</Platform>
|
|
47
|
+
</ProjectConfiguration>
|
|
48
|
+
<ProjectConfiguration Include="Release|x64">
|
|
49
|
+
<Configuration>Release</Configuration>
|
|
50
|
+
<Platform>x64</Platform>
|
|
51
|
+
</ProjectConfiguration>
|
|
52
|
+
</ItemGroup>
|
|
53
|
+
<PropertyGroup Label="Configuration">
|
|
54
|
+
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
55
|
+
<CharacterSet>Unicode</CharacterSet>
|
|
56
|
+
<GenerateManifest>false</GenerateManifest>
|
|
57
|
+
</PropertyGroup>
|
|
58
|
+
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
|
|
59
|
+
<UseDebugLibraries>true</UseDebugLibraries>
|
|
60
|
+
<LinkIncremental>true</LinkIncremental>
|
|
61
|
+
</PropertyGroup>
|
|
62
|
+
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
|
|
63
|
+
<UseDebugLibraries>false</UseDebugLibraries>
|
|
64
|
+
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
65
|
+
<LinkIncremental>false</LinkIncremental>
|
|
66
|
+
</PropertyGroup>
|
|
67
|
+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
68
|
+
<ImportGroup Label="ExtensionSettings"></ImportGroup>
|
|
69
|
+
<ImportGroup Label="PropertySheets">
|
|
70
|
+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
71
|
+
</ImportGroup>
|
|
72
|
+
<ImportGroup Label="PropertySheets">
|
|
73
|
+
<Import Project="PropertySheet.props" />
|
|
74
|
+
</ImportGroup>
|
|
75
|
+
<ImportGroup Label="ReactNativeWindowsPropertySheets">
|
|
76
|
+
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\external\Microsoft.ReactNative.Uwp.CppLib.props" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props')" />
|
|
77
|
+
<Import Project="$(SolutionDir)\packages\$(WinUIPackageProps)" Condition="'$(WinUIPackageProps)'!='' And Exists('$(SolutionDir)\packages\$(WinUIPackageProps)')" />
|
|
78
|
+
</ImportGroup>
|
|
79
|
+
|
|
80
|
+
<PropertyGroup Label="UserMacros" />
|
|
81
|
+
<ItemDefinitionGroup>
|
|
82
|
+
<ClCompile>
|
|
83
|
+
<PrecompiledHeader>Use</PrecompiledHeader>
|
|
84
|
+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
85
|
+
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
|
86
|
+
<WarningLevel>Level4</WarningLevel>
|
|
87
|
+
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
|
|
88
|
+
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
|
89
|
+
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
90
|
+
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
91
|
+
</ClCompile>
|
|
92
|
+
<Midl>
|
|
93
|
+
<!-- This allows applications targetting older Windows SDKs (e.g. RNW 0.65 apps) to consume the library generated WinMD -->
|
|
94
|
+
<AdditionalOptions>%(AdditionalOptions) /noattributename</AdditionalOptions>
|
|
95
|
+
</Midl>
|
|
96
|
+
<Link>
|
|
97
|
+
<SubSystem>Console</SubSystem>
|
|
98
|
+
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
|
|
99
|
+
<ModuleDefinitionFile>ReactNativeShare.def</ModuleDefinitionFile>
|
|
100
|
+
</Link>
|
|
101
|
+
</ItemDefinitionGroup>
|
|
102
|
+
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
|
103
|
+
<ClCompile>
|
|
104
|
+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
105
|
+
</ClCompile>
|
|
106
|
+
</ItemDefinitionGroup>
|
|
107
|
+
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
|
|
108
|
+
<ClCompile>
|
|
109
|
+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
110
|
+
</ClCompile>
|
|
111
|
+
</ItemDefinitionGroup>
|
|
112
|
+
<ItemGroup>
|
|
113
|
+
<ClInclude Include="ReactPackageProvider.h">
|
|
114
|
+
<DependentUpon>ReactPackageProvider.idl</DependentUpon>
|
|
115
|
+
</ClInclude>
|
|
116
|
+
<ClInclude Include="ReactNativeModule.h" />
|
|
117
|
+
<ClInclude Include="pch.h" />
|
|
118
|
+
</ItemGroup>
|
|
119
|
+
<ItemGroup>
|
|
120
|
+
<ClCompile Include="pch.cpp">
|
|
121
|
+
<PrecompiledHeader>Create</PrecompiledHeader>
|
|
122
|
+
</ClCompile>
|
|
123
|
+
<ClCompile Include="ReactPackageProvider.cpp">
|
|
124
|
+
<DependentUpon>ReactPackageProvider.idl</DependentUpon>
|
|
125
|
+
</ClCompile>
|
|
126
|
+
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
|
|
127
|
+
</ItemGroup>
|
|
128
|
+
<ItemGroup>
|
|
129
|
+
<Midl Include="ReactPackageProvider.idl" />
|
|
130
|
+
</ItemGroup>
|
|
131
|
+
<ItemGroup>
|
|
132
|
+
<None Include="packages.config" />
|
|
133
|
+
<None Include="PropertySheet.props" />
|
|
134
|
+
</ItemGroup>
|
|
135
|
+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
136
|
+
<ImportGroup Label="ReactNativeWindowsTargets">
|
|
137
|
+
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets')" />
|
|
138
|
+
</ImportGroup>
|
|
139
|
+
<Target Name="EnsureReactNativeWindowsTargets" BeforeTargets="PrepareForBuild">
|
|
140
|
+
<PropertyGroup>
|
|
141
|
+
<ErrorText>This project references targets in your node_modules\react-native-windows folder that are missing. The missing file is {0}.</ErrorText>
|
|
142
|
+
</PropertyGroup>
|
|
143
|
+
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props'))" />
|
|
144
|
+
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets'))" />
|
|
145
|
+
</Target>
|
|
146
|
+
<ImportGroup Label="ExtensionTargets">
|
|
147
|
+
<Import Project="$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210312.4\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210312.4\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
|
148
|
+
<Import Project="$(SolutionDir)\packages\ReactNative.Hermes.Windows.0.9.0-ms.4\build\native\ReactNative.Hermes.Windows.targets" Condition="Exists('$(SolutionDir)\packages\ReactNative.Hermes.Windows.0.9.0-ms.4\build\native\ReactNative.Hermes.Windows.targets')" />
|
|
149
|
+
<Import Project="$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets" Condition="Exists('$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets')" />
|
|
150
|
+
</ImportGroup>
|
|
151
|
+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
152
|
+
<PropertyGroup>
|
|
153
|
+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
154
|
+
</PropertyGroup>
|
|
155
|
+
<Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210312.4\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210312.4\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
|
156
|
+
<Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210312.4\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210312.4\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
|
157
|
+
<Error Condition="!Exists('$(SolutionDir)\packages\ReactNative.Hermes.Windows.0.9.0-ms.4\build\native\ReactNative.Hermes.Windows.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\ReactNative.Hermes.Windows.0.9.0-ms.4\build\native\ReactNative.Hermes.Windows.targets'))" />
|
|
158
|
+
<Error Condition="!Exists('$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets'))" />
|
|
159
|
+
</Target>
|
|
160
|
+
</Project>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
|
+
<ItemGroup>
|
|
4
|
+
<Midl Include="ReactPackageProvider.idl" />
|
|
5
|
+
</ItemGroup>
|
|
6
|
+
<ItemGroup>
|
|
7
|
+
<ClCompile Include="pch.cpp" />
|
|
8
|
+
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
|
|
9
|
+
<ClCompile Include="ReactPackageProvider.cpp" />
|
|
10
|
+
</ItemGroup>
|
|
11
|
+
<ItemGroup>
|
|
12
|
+
<ClInclude Include="pch.h" />
|
|
13
|
+
<ClInclude Include="ReactPackageProvider.h" />
|
|
14
|
+
<ClInclude Include="ReactNativeModule.h" />
|
|
15
|
+
</ItemGroup>
|
|
16
|
+
<ItemGroup>
|
|
17
|
+
<None Include="PropertySheet.props" />
|
|
18
|
+
<None Include="packages.config" />
|
|
19
|
+
</ItemGroup>
|
|
20
|
+
</Project>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#include "pch.h"
|
|
2
|
+
#include "ReactPackageProvider.h"
|
|
3
|
+
#if __has_include("ReactPackageProvider.g.cpp")
|
|
4
|
+
#include "ReactPackageProvider.g.cpp"
|
|
5
|
+
#endif
|
|
6
|
+
|
|
7
|
+
#include "ReactNativeModule.h"
|
|
8
|
+
|
|
9
|
+
using namespace winrt::Microsoft::ReactNative;
|
|
10
|
+
|
|
11
|
+
namespace winrt::ReactNativeShare::implementation
|
|
12
|
+
{
|
|
13
|
+
|
|
14
|
+
void ReactPackageProvider::CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept
|
|
15
|
+
{
|
|
16
|
+
AddAttributedModules(packageBuilder);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
} // namespace winrt::ReactNativeShare::implementation
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#include "ReactPackageProvider.g.h"
|
|
3
|
+
|
|
4
|
+
using namespace winrt::Microsoft::ReactNative;
|
|
5
|
+
|
|
6
|
+
namespace winrt::ReactNativeShare::implementation
|
|
7
|
+
{
|
|
8
|
+
struct ReactPackageProvider : ReactPackageProviderT<ReactPackageProvider>
|
|
9
|
+
{
|
|
10
|
+
ReactPackageProvider() = default;
|
|
11
|
+
|
|
12
|
+
void CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept;
|
|
13
|
+
};
|
|
14
|
+
} // namespace winrt::ReactNativeShare::implementation
|
|
15
|
+
|
|
16
|
+
namespace winrt::ReactNativeShare::factory_implementation
|
|
17
|
+
{
|
|
18
|
+
|
|
19
|
+
struct ReactPackageProvider : ReactPackageProviderT<ReactPackageProvider, implementation::ReactPackageProvider> {};
|
|
20
|
+
|
|
21
|
+
} // namespace winrt::ReactNativeShare::factory_implementation
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<packages>
|
|
3
|
+
<package id="Microsoft.Windows.CppWinRT" version="2.0.210312.4" targetFramework="native" />
|
|
4
|
+
<package id="ReactNative.Hermes.Windows" version="0.9.0-ms.4" targetFramework="native" />
|
|
5
|
+
<package id="Microsoft.UI.Xaml" version="2.6.0" targetFramework="native" />
|
|
6
|
+
</packages>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#include "pch.h"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#define NOMINMAX
|
|
4
|
+
|
|
5
|
+
#include <hstring.h>
|
|
6
|
+
#include <restrictederrorinfo.h>
|
|
7
|
+
#include <unknwn.h>
|
|
8
|
+
#include <windows.h>
|
|
9
|
+
#include <CppWinRTIncludes.h>
|
|
10
|
+
|
|
11
|
+
#include <winrt/Microsoft.ReactNative.h>
|
|
12
|
+
|
|
13
|
+
#include <winrt/Microsoft.UI.Xaml.Automation.Peers.h>
|
|
14
|
+
#include <winrt/Microsoft.UI.Xaml.Controls.Primitives.h>
|
|
15
|
+
#include <winrt/Microsoft.UI.Xaml.Controls.h>
|
|
16
|
+
#include <winrt/Microsoft.UI.Xaml.Media.h>
|
|
17
|
+
#include <winrt/Microsoft.UI.Xaml.XamlTypeInfo.h>
|
|
18
|
+
using namespace winrt::Windows::Foundation;
|