expo-targets 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/build/plugin/src/config.d.ts +23 -1
  2. package/build/plugin/src/config.d.ts.map +1 -1
  3. package/build/plugin/src/config.js +3 -1
  4. package/build/plugin/src/config.js.map +1 -1
  5. package/build/plugin/src/ios/config-plugins/withIOSTarget.d.ts.map +1 -1
  6. package/build/plugin/src/ios/config-plugins/withIOSTarget.js +17 -5
  7. package/build/plugin/src/ios/config-plugins/withIOSTarget.js.map +1 -1
  8. package/build/plugin/src/ios/config-plugins/withPodfile.d.ts.map +1 -1
  9. package/build/plugin/src/ios/config-plugins/withPodfile.js +3 -5
  10. package/build/plugin/src/ios/config-plugins/withPodfile.js.map +1 -1
  11. package/build/plugin/src/ios/config-plugins/withXcodeChanges.d.ts.map +1 -1
  12. package/build/plugin/src/ios/config-plugins/withXcodeChanges.js +63 -2
  13. package/build/plugin/src/ios/config-plugins/withXcodeChanges.js.map +1 -1
  14. package/build/plugin/src/ios/target.d.ts.map +1 -1
  15. package/build/plugin/src/ios/target.js +71 -11
  16. package/build/plugin/src/ios/target.js.map +1 -1
  17. package/build/plugin/src/ios/utils/index.d.ts +1 -0
  18. package/build/plugin/src/ios/utils/index.d.ts.map +1 -1
  19. package/build/plugin/src/ios/utils/index.js +2 -1
  20. package/build/plugin/src/ios/utils/index.js.map +1 -1
  21. package/build/plugin/src/ios/utils/plist.d.ts.map +1 -1
  22. package/build/plugin/src/ios/utils/plist.js +1 -0
  23. package/build/plugin/src/ios/utils/plist.js.map +1 -1
  24. package/build/plugin/src/ios/utils/podfile.d.ts.map +1 -1
  25. package/build/plugin/src/ios/utils/podfile.js +55 -22
  26. package/build/plugin/src/ios/utils/podfile.js.map +1 -1
  27. package/build/plugin/src/ios/utils/safari.d.ts +69 -0
  28. package/build/plugin/src/ios/utils/safari.d.ts.map +1 -0
  29. package/build/plugin/src/ios/utils/safari.js +359 -0
  30. package/build/plugin/src/ios/utils/safari.js.map +1 -0
  31. package/build/plugin/src/withTargetsDir.d.ts.map +1 -1
  32. package/build/plugin/src/withTargetsDir.js +34 -0
  33. package/build/plugin/src/withTargetsDir.js.map +1 -1
  34. package/build/src/Target.d.ts +8 -1
  35. package/build/src/Target.d.ts.map +1 -1
  36. package/build/src/Target.js +136 -26
  37. package/build/src/Target.js.map +1 -1
  38. package/build/src/index.d.ts +3 -1
  39. package/build/src/index.d.ts.map +1 -1
  40. package/build/src/index.js +14 -1
  41. package/build/src/index.js.map +1 -1
  42. package/build/src/modules/safari/index.d.ts +109 -0
  43. package/build/src/modules/safari/index.d.ts.map +1 -0
  44. package/build/src/modules/safari/index.js +288 -0
  45. package/build/src/modules/safari/index.js.map +1 -0
  46. package/metro/{src/index.ts → build/index.d.ts} +1 -0
  47. package/metro/build/index.d.ts.map +1 -0
  48. package/metro/build/index.js +6 -0
  49. package/metro/build/index.js.map +1 -0
  50. package/metro/build/withTargetsMetro.d.ts +5 -0
  51. package/metro/build/withTargetsMetro.d.ts.map +1 -0
  52. package/metro/build/withTargetsMetro.js +78 -0
  53. package/metro/build/withTargetsMetro.js.map +1 -0
  54. package/package.json +11 -1
  55. package/plugin/build/android/withAndroidAppBuildGradle.d.ts +7 -0
  56. package/plugin/build/android/withAndroidAppBuildGradle.d.ts.map +1 -0
  57. package/plugin/build/android/withAndroidAppBuildGradle.js +31 -0
  58. package/plugin/build/android/withAndroidAppBuildGradle.js.map +1 -0
  59. package/plugin/build/android/withAndroidTarget.d.ts +10 -0
  60. package/plugin/build/android/withAndroidTarget.d.ts.map +1 -0
  61. package/plugin/build/android/withAndroidTarget.js +22 -0
  62. package/plugin/build/android/withAndroidTarget.js.map +1 -0
  63. package/plugin/build/android/withAndroidWidget.d.ts +13 -0
  64. package/plugin/build/android/withAndroidWidget.d.ts.map +1 -0
  65. package/plugin/build/android/withAndroidWidget.js +564 -0
  66. package/plugin/build/android/withAndroidWidget.js.map +1 -0
  67. package/plugin/build/config.d.ts +163 -0
  68. package/plugin/build/config.d.ts.map +1 -0
  69. package/plugin/build/config.js +56 -0
  70. package/plugin/build/config.js.map +1 -0
  71. package/plugin/build/index.d.ts +9 -0
  72. package/plugin/build/index.d.ts.map +1 -0
  73. package/plugin/build/index.js +11 -0
  74. package/plugin/build/index.js.map +1 -0
  75. package/plugin/build/ios/config-plugins/withEntitlements.d.ts +11 -0
  76. package/plugin/build/ios/config-plugins/withEntitlements.d.ts.map +1 -0
  77. package/plugin/build/ios/config-plugins/withEntitlements.js +49 -0
  78. package/plugin/build/ios/config-plugins/withEntitlements.js.map +1 -0
  79. package/plugin/build/ios/config-plugins/withIOSTarget.d.ts +17 -0
  80. package/plugin/build/ios/config-plugins/withIOSTarget.d.ts.map +1 -0
  81. package/plugin/build/ios/config-plugins/withIOSTarget.js +164 -0
  82. package/plugin/build/ios/config-plugins/withIOSTarget.js.map +1 -0
  83. package/plugin/build/ios/config-plugins/withIosColorset.d.ts +8 -0
  84. package/plugin/build/ios/config-plugins/withIosColorset.d.ts.map +1 -0
  85. package/plugin/build/ios/config-plugins/withIosColorset.js +25 -0
  86. package/plugin/build/ios/config-plugins/withIosColorset.js.map +1 -0
  87. package/plugin/build/ios/config-plugins/withIosStickerPack.d.ts +8 -0
  88. package/plugin/build/ios/config-plugins/withIosStickerPack.d.ts.map +1 -0
  89. package/plugin/build/ios/config-plugins/withIosStickerPack.js +52 -0
  90. package/plugin/build/ios/config-plugins/withIosStickerPack.js.map +1 -0
  91. package/plugin/build/ios/config-plugins/withPodfile.d.ts +12 -0
  92. package/plugin/build/ios/config-plugins/withPodfile.d.ts.map +1 -0
  93. package/plugin/build/ios/config-plugins/withPodfile.js +160 -0
  94. package/plugin/build/ios/config-plugins/withPodfile.js.map +1 -0
  95. package/plugin/build/ios/config-plugins/withXcodeChanges.d.ts +15 -0
  96. package/plugin/build/ios/config-plugins/withXcodeChanges.d.ts.map +1 -0
  97. package/plugin/build/ios/config-plugins/withXcodeChanges.js +707 -0
  98. package/plugin/build/ios/config-plugins/withXcodeChanges.js.map +1 -0
  99. package/plugin/build/ios/target.d.ts +41 -0
  100. package/plugin/build/ios/target.d.ts.map +1 -0
  101. package/plugin/build/ios/target.js +634 -0
  102. package/plugin/build/ios/target.js.map +1 -0
  103. package/plugin/build/ios/utils/asset.d.ts +60 -0
  104. package/plugin/build/ios/utils/asset.d.ts.map +1 -0
  105. package/plugin/build/ios/utils/asset.js +375 -0
  106. package/plugin/build/ios/utils/asset.js.map +1 -0
  107. package/plugin/build/ios/utils/file.d.ts +33 -0
  108. package/plugin/build/ios/utils/file.d.ts.map +1 -0
  109. package/plugin/build/ios/utils/file.js +88 -0
  110. package/plugin/build/ios/utils/file.js.map +1 -0
  111. package/plugin/{src/ios/utils/index.ts → build/ios/utils/index.d.ts} +2 -1
  112. package/plugin/build/ios/utils/index.d.ts.map +1 -0
  113. package/plugin/build/ios/utils/index.js +39 -0
  114. package/plugin/build/ios/utils/index.js.map +1 -0
  115. package/plugin/build/ios/utils/paths.d.ts +128 -0
  116. package/plugin/build/ios/utils/paths.d.ts.map +1 -0
  117. package/plugin/build/ios/utils/paths.js +141 -0
  118. package/plugin/build/ios/utils/paths.js.map +1 -0
  119. package/plugin/build/ios/utils/plist.d.ts +29 -0
  120. package/plugin/build/ios/utils/plist.d.ts.map +1 -0
  121. package/plugin/build/ios/utils/plist.js +115 -0
  122. package/plugin/build/ios/utils/plist.js.map +1 -0
  123. package/plugin/build/ios/utils/podfile.d.ts +82 -0
  124. package/plugin/build/ios/utils/podfile.d.ts.map +1 -0
  125. package/plugin/build/ios/utils/podfile.js +441 -0
  126. package/plugin/build/ios/utils/podfile.js.map +1 -0
  127. package/plugin/build/ios/utils/reactNativeSwift.d.ts +11 -0
  128. package/plugin/build/ios/utils/reactNativeSwift.d.ts.map +1 -0
  129. package/plugin/build/ios/utils/reactNativeSwift.js +263 -0
  130. package/plugin/build/ios/utils/reactNativeSwift.js.map +1 -0
  131. package/plugin/build/ios/utils/safari.d.ts +69 -0
  132. package/plugin/build/ios/utils/safari.d.ts.map +1 -0
  133. package/plugin/build/ios/utils/safari.js +359 -0
  134. package/plugin/build/ios/utils/safari.js.map +1 -0
  135. package/plugin/build/ios/utils/xcode.d.ts +185 -0
  136. package/plugin/build/ios/utils/xcode.d.ts.map +1 -0
  137. package/plugin/build/ios/utils/xcode.js +706 -0
  138. package/plugin/build/ios/utils/xcode.js.map +1 -0
  139. package/plugin/build/logger.d.ts +10 -0
  140. package/plugin/build/logger.d.ts.map +1 -0
  141. package/plugin/build/logger.js +62 -0
  142. package/plugin/build/logger.js.map +1 -0
  143. package/plugin/build/parseTargetConfig.d.ts +3 -0
  144. package/plugin/build/parseTargetConfig.d.ts.map +1 -0
  145. package/plugin/build/parseTargetConfig.js +113 -0
  146. package/plugin/build/parseTargetConfig.js.map +1 -0
  147. package/plugin/build/withTargetsDir.d.ts +6 -0
  148. package/plugin/build/withTargetsDir.d.ts.map +1 -0
  149. package/plugin/build/withTargetsDir.js +124 -0
  150. package/plugin/build/withTargetsDir.js.map +1 -0
  151. package/.eslintrc.js +0 -2
  152. package/metro/src/withTargetsMetro.ts +0 -72
  153. package/metro/tsconfig.build.json +0 -9
  154. package/plugin/src/android/withAndroidAppBuildGradle.ts +0 -34
  155. package/plugin/src/android/withAndroidTarget.ts +0 -26
  156. package/plugin/src/android/withAndroidWidget.ts +0 -778
  157. package/plugin/src/config.ts +0 -255
  158. package/plugin/src/index.ts +0 -19
  159. package/plugin/src/ios/config-plugins/withEntitlements.ts +0 -69
  160. package/plugin/src/ios/config-plugins/withIOSTarget.ts +0 -179
  161. package/plugin/src/ios/config-plugins/withIosColorset.ts +0 -29
  162. package/plugin/src/ios/config-plugins/withIosStickerPack.ts +0 -65
  163. package/plugin/src/ios/config-plugins/withPodfile.ts +0 -238
  164. package/plugin/src/ios/config-plugins/withXcodeChanges.ts +0 -891
  165. package/plugin/src/ios/target.ts +0 -668
  166. package/plugin/src/ios/utils/asset.ts +0 -490
  167. package/plugin/src/ios/utils/file.ts +0 -80
  168. package/plugin/src/ios/utils/paths.ts +0 -253
  169. package/plugin/src/ios/utils/plist.ts +0 -101
  170. package/plugin/src/ios/utils/podfile.ts +0 -534
  171. package/plugin/src/ios/utils/reactNativeSwift.ts +0 -283
  172. package/plugin/src/ios/utils/xcode.ts +0 -989
  173. package/plugin/src/logger.ts +0 -63
  174. package/plugin/src/parseTargetConfig.ts +0 -115
  175. package/plugin/src/types/normalize-colors.d.ts +0 -3
  176. package/plugin/src/withTargetsDir.ts +0 -120
  177. package/plugin/tsconfig.build.json +0 -9
  178. package/plugin/tsconfig.json +0 -9
  179. package/src/Target.ts +0 -239
  180. package/src/index.ts +0 -52
  181. package/src/modules/extension/index.ts +0 -54
  182. package/src/modules/messages/index.ts +0 -124
  183. package/src/modules/storage/index.ts +0 -126
  184. package/tsconfig.json +0 -8
  185. /package/plugin/{src → build}/ios/templates/MessagesViewController.swift +0 -0
  186. /package/plugin/{src → build}/ios/templates/ReactNativeViewController.swift +0 -0
  187. /package/plugin/{src → build}/ios/templates/action-extension-data.swift +0 -0
  188. /package/plugin/{src → build}/ios/templates/clip-extension-data.swift +0 -0
  189. /package/plugin/{src → build}/ios/templates/messages-extension-data.swift +0 -0
  190. /package/plugin/{src → build}/ios/templates/share-extension-data.swift +0 -0
@@ -1,124 +0,0 @@
1
- import { requireNativeModule } from 'expo-modules-core';
2
- import { Platform } from 'react-native';
3
-
4
- const ExpoTargetsMessagesModule = requireNativeModule('ExpoTargetsMessages');
5
-
6
- export type PresentationStyle = 'compact' | 'expanded';
7
-
8
- export interface MessageLayout {
9
- caption: string;
10
- subcaption?: string;
11
- trailingCaption?: string;
12
- trailingSubcaption?: string;
13
- imageUrl?: string;
14
- mediaFileUrl?: string;
15
- url?: string;
16
- }
17
-
18
- export interface ConversationInfo {
19
- conversationId: string;
20
- remoteParticipantIds: string[];
21
- participantCount: number;
22
- hasSelectedMessage: boolean;
23
- }
24
-
25
- export interface SelectedMessage {
26
- url?: string;
27
- caption?: string;
28
- subcaption?: string;
29
- trailingCaption?: string;
30
- trailingSubcaption?: string;
31
- }
32
-
33
- export class Messages {
34
- getPresentationStyle(): PresentationStyle | null {
35
- if (Platform.OS !== 'ios') return null;
36
- return ExpoTargetsMessagesModule.getPresentationStyle();
37
- }
38
-
39
- requestPresentationStyle(style: PresentationStyle): void {
40
- if (Platform.OS !== 'ios') return;
41
- ExpoTargetsMessagesModule.requestPresentationStyle(style);
42
- }
43
-
44
- sendMessage(layout: MessageLayout): void {
45
- if (Platform.OS !== 'ios') return;
46
- ExpoTargetsMessagesModule.sendMessage(layout);
47
- }
48
-
49
- sendUpdate(layout: MessageLayout, sessionId: string): void {
50
- if (Platform.OS !== 'ios') return;
51
- ExpoTargetsMessagesModule.sendUpdate(layout, sessionId);
52
- }
53
-
54
- createSession(): string | null {
55
- if (Platform.OS !== 'ios') return null;
56
- return ExpoTargetsMessagesModule.createSession();
57
- }
58
-
59
- getConversationInfo(): ConversationInfo | null {
60
- if (Platform.OS !== 'ios') return null;
61
- return ExpoTargetsMessagesModule.getConversationInfo();
62
- }
63
-
64
- addEventListener(
65
- eventName: 'onPresentationStyleChange',
66
- listener: (style: PresentationStyle) => void
67
- ) {
68
- if (Platform.OS !== 'ios') {
69
- return { remove: () => {} };
70
- }
71
- return ExpoTargetsMessagesModule.addListener(
72
- eventName,
73
- (event: { presentationStyle: PresentationStyle }) => {
74
- listener(event.presentationStyle);
75
- }
76
- );
77
- }
78
- }
79
-
80
- // Standalone functions for backwards compatibility
81
- export const getPresentationStyle = (): PresentationStyle | null => {
82
- if (Platform.OS !== 'ios') return null;
83
- return ExpoTargetsMessagesModule.getPresentationStyle();
84
- };
85
-
86
- export const requestPresentationStyle = (style: PresentationStyle): void => {
87
- if (Platform.OS !== 'ios') return;
88
- ExpoTargetsMessagesModule.requestPresentationStyle(style);
89
- };
90
-
91
- export const sendMessage = (layout: MessageLayout): void => {
92
- if (Platform.OS !== 'ios') return;
93
- ExpoTargetsMessagesModule.sendMessage(layout);
94
- };
95
-
96
- export const sendUpdate = (layout: MessageLayout, sessionId: string): void => {
97
- if (Platform.OS !== 'ios') return;
98
- ExpoTargetsMessagesModule.sendUpdate(layout, sessionId);
99
- };
100
-
101
- export const createSession = (): string | null => {
102
- if (Platform.OS !== 'ios') return null;
103
- return ExpoTargetsMessagesModule.createSession();
104
- };
105
-
106
- export const getConversationInfo = (): ConversationInfo | null => {
107
- if (Platform.OS !== 'ios') return null;
108
- return ExpoTargetsMessagesModule.getConversationInfo();
109
- };
110
-
111
- export const addEventListener = (
112
- eventName: 'onPresentationStyleChange',
113
- listener: (style: PresentationStyle) => void
114
- ) => {
115
- if (Platform.OS !== 'ios') {
116
- return { remove: () => {} };
117
- }
118
- return ExpoTargetsMessagesModule.addListener(
119
- eventName,
120
- (event: { presentationStyle: PresentationStyle }) => {
121
- listener(event.presentationStyle);
122
- }
123
- );
124
- };
@@ -1,126 +0,0 @@
1
- import { requireNativeModule } from 'expo-modules-core';
2
-
3
- const ExpoTargetsStorageModule = requireNativeModule('ExpoTargetsStorage');
4
-
5
- export class AppGroupStorage {
6
- constructor(private readonly appGroup: string) {}
7
-
8
- set(key: string, value: any) {
9
- if (value === null || value === undefined) {
10
- ExpoTargetsStorageModule.remove(key, this.appGroup);
11
- } else if (typeof value === 'number') {
12
- ExpoTargetsStorageModule.setInt(key, Math.floor(value), this.appGroup);
13
- } else if (typeof value === 'string') {
14
- ExpoTargetsStorageModule.setString(key, value, this.appGroup);
15
- } else if (typeof value === 'boolean') {
16
- ExpoTargetsStorageModule.setInt(key, value ? 1 : 0, this.appGroup);
17
- } else if (Array.isArray(value)) {
18
- ExpoTargetsStorageModule.setString(
19
- key,
20
- JSON.stringify(value),
21
- this.appGroup
22
- );
23
- } else {
24
- ExpoTargetsStorageModule.setString(
25
- key,
26
- JSON.stringify(value),
27
- this.appGroup
28
- );
29
- }
30
- }
31
-
32
- get<T = any>(key: string): T | null {
33
- try {
34
- const value = ExpoTargetsStorageModule.get(key, this.appGroup);
35
- if (value === null || value === undefined) {
36
- return null;
37
- }
38
-
39
- if (typeof value === 'string') {
40
- try {
41
- return JSON.parse(value) as T;
42
- } catch {
43
- return value as T;
44
- }
45
- }
46
-
47
- return value as T;
48
- } catch (error) {
49
- console.warn(`Failed to get value for key "${key}":`, error);
50
- return null;
51
- }
52
- }
53
-
54
- remove(key: string) {
55
- ExpoTargetsStorageModule.remove(key, this.appGroup);
56
- }
57
-
58
- clear() {
59
- ExpoTargetsStorageModule.clearAll(this.appGroup);
60
- }
61
-
62
- setData(data: Record<string, any>) {
63
- Object.entries(data).forEach(([key, value]) => {
64
- this.set(key, value);
65
- });
66
- }
67
-
68
- getData<T extends Record<string, any>>(): T {
69
- try {
70
- const rawData = ExpoTargetsStorageModule.getAllData(this.appGroup);
71
- if (!rawData || typeof rawData !== 'object') {
72
- return {} as T;
73
- }
74
-
75
- const parsedData: Record<string, any> = {};
76
-
77
- Object.entries(rawData).forEach(([key, value]) => {
78
- if (typeof value === 'string') {
79
- try {
80
- parsedData[key] = JSON.parse(value);
81
- } catch {
82
- parsedData[key] = value;
83
- }
84
- } else {
85
- parsedData[key] = value;
86
- }
87
- });
88
-
89
- return parsedData as T;
90
- } catch (error) {
91
- console.warn('Failed to get all data:', error);
92
- return {} as T;
93
- }
94
- }
95
-
96
- getKeys(): string[] {
97
- try {
98
- return ExpoTargetsStorageModule.getAllKeys(this.appGroup);
99
- } catch (error) {
100
- console.warn('Failed to get all keys:', error);
101
- return [];
102
- }
103
- }
104
-
105
- refresh(targetName?: string) {
106
- ExpoTargetsStorageModule.refreshTarget(targetName);
107
- }
108
- }
109
-
110
- export function refreshAllTargets() {
111
- ExpoTargetsStorageModule.refreshTarget(undefined);
112
- }
113
-
114
- export function clearSharedData(appGroup: string) {
115
- const storage = new AppGroupStorage(appGroup);
116
- storage.clear();
117
- }
118
-
119
- export function getTargetsConfigFromBundle(): any[] | null {
120
- try {
121
- return ExpoTargetsStorageModule.getTargetsConfig();
122
- } catch (error) {
123
- console.warn('Failed to read targets config from bundle:', error);
124
- return null;
125
- }
126
- }
package/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "./build"
5
- },
6
- "include": ["src/**/*", "plugin/src/**/*", "metro/src/**/*"],
7
- "exclude": ["node_modules", "build", "plugin/build", "metro/build"]
8
- }