expo-widgets 56.0.13 → 56.0.15

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 (76) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/android/build.gradle +38 -0
  3. package/android/src/main/AndroidManifest.xml +2 -0
  4. package/android/src/main/java/expo/modules/widgets/ExpoWidgetsAppWidgetProvider.kt +10 -0
  5. package/android/src/main/java/expo/modules/widgets/ExpoWidgetsGlanceWidget.kt +17 -0
  6. package/android/src/main/java/expo/modules/widgets/WidgetsModule.kt +10 -0
  7. package/expo-module.config.json +4 -1
  8. package/package.json +5 -5
  9. package/plugin/build/android/resourceNames.d.ts +5 -0
  10. package/plugin/build/android/resourceNames.js +29 -0
  11. package/plugin/build/android/withAndroidWidgetFiles.d.ts +4 -0
  12. package/plugin/build/android/withAndroidWidgetFiles.js +142 -0
  13. package/plugin/build/android/withAndroidWidgetManifest.d.ts +4 -0
  14. package/plugin/build/android/withAndroidWidgetManifest.js +58 -0
  15. package/plugin/build/android/withAndroidWidgets.d.ts +6 -0
  16. package/plugin/build/android/withAndroidWidgets.js +19 -0
  17. package/plugin/build/ios/withIosWidgets.d.ts +11 -0
  18. package/plugin/build/ios/withIosWidgets.js +81 -0
  19. package/plugin/build/{withWidgetSourceFiles.d.ts → ios/withWidgetSourceFiles.d.ts} +1 -1
  20. package/plugin/build/{withWidgetSourceFiles.js → ios/withWidgetSourceFiles.js} +18 -13
  21. package/plugin/build/types/WidgetConfig.type.d.ts +17 -1
  22. package/plugin/build/types/WidgetFamily.type.d.ts +10 -9
  23. package/plugin/build/types/WidgetFamily.type.js +9 -10
  24. package/plugin/build/withWidgets.js +6 -63
  25. package/plugin/src/android/resourceNames.ts +29 -0
  26. package/plugin/src/android/withAndroidWidgetFiles.ts +143 -0
  27. package/plugin/src/android/withAndroidWidgetManifest.ts +94 -0
  28. package/plugin/src/android/withAndroidWidgets.ts +21 -0
  29. package/plugin/src/ios/withIosWidgets.ts +99 -0
  30. package/plugin/src/{withWidgetSourceFiles.ts → ios/withWidgetSourceFiles.ts} +20 -14
  31. package/plugin/src/types/WidgetConfig.type.ts +20 -1
  32. package/plugin/src/types/WidgetFamily.type.ts +11 -9
  33. package/plugin/src/withWidgets.ts +7 -71
  34. package/plugin/tsconfig.tsbuildinfo +1 -0
  35. /package/plugin/build/{withAppGroupEntitlements.d.ts → ios/withAppGroupEntitlements.d.ts} +0 -0
  36. /package/plugin/build/{withAppGroupEntitlements.js → ios/withAppGroupEntitlements.js} +0 -0
  37. /package/plugin/build/{withAppInfoPlist.d.ts → ios/withAppInfoPlist.d.ts} +0 -0
  38. /package/plugin/build/{withAppInfoPlist.js → ios/withAppInfoPlist.js} +0 -0
  39. /package/plugin/build/{withEasConfig.d.ts → ios/withEasConfig.d.ts} +0 -0
  40. /package/plugin/build/{withEasConfig.js → ios/withEasConfig.js} +0 -0
  41. /package/plugin/build/{withIosWarning.d.ts → ios/withIosWarning.d.ts} +0 -0
  42. /package/plugin/build/{withIosWarning.js → ios/withIosWarning.js} +0 -0
  43. /package/plugin/build/{withPodsLinking.d.ts → ios/withPodsLinking.d.ts} +0 -0
  44. /package/plugin/build/{withPodsLinking.js → ios/withPodsLinking.js} +0 -0
  45. /package/plugin/build/{withPushNotifications.d.ts → ios/withPushNotifications.d.ts} +0 -0
  46. /package/plugin/build/{withPushNotifications.js → ios/withPushNotifications.js} +0 -0
  47. /package/plugin/build/{xcode → ios/xcode}/addBuildPhases.d.ts +0 -0
  48. /package/plugin/build/{xcode → ios/xcode}/addBuildPhases.js +0 -0
  49. /package/plugin/build/{xcode → ios/xcode}/addPbxGroup.d.ts +0 -0
  50. /package/plugin/build/{xcode → ios/xcode}/addPbxGroup.js +0 -0
  51. /package/plugin/build/{xcode → ios/xcode}/addProductFile.d.ts +0 -0
  52. /package/plugin/build/{xcode → ios/xcode}/addProductFile.js +0 -0
  53. /package/plugin/build/{xcode → ios/xcode}/addTargetDependency.d.ts +0 -0
  54. /package/plugin/build/{xcode → ios/xcode}/addTargetDependency.js +0 -0
  55. /package/plugin/build/{xcode → ios/xcode}/addToPbxNativeTargetSection.d.ts +0 -0
  56. /package/plugin/build/{xcode → ios/xcode}/addToPbxNativeTargetSection.js +0 -0
  57. /package/plugin/build/{xcode → ios/xcode}/addToPbxProjectSection.d.ts +0 -0
  58. /package/plugin/build/{xcode → ios/xcode}/addToPbxProjectSection.js +0 -0
  59. /package/plugin/build/{xcode → ios/xcode}/addXCConfigurationList.d.ts +0 -0
  60. /package/plugin/build/{xcode → ios/xcode}/addXCConfigurationList.js +0 -0
  61. /package/plugin/build/{xcode → ios/xcode}/withTargetXcodeProject.d.ts +0 -0
  62. /package/plugin/build/{xcode → ios/xcode}/withTargetXcodeProject.js +0 -0
  63. /package/plugin/src/{withAppGroupEntitlements.ts → ios/withAppGroupEntitlements.ts} +0 -0
  64. /package/plugin/src/{withAppInfoPlist.ts → ios/withAppInfoPlist.ts} +0 -0
  65. /package/plugin/src/{withEasConfig.ts → ios/withEasConfig.ts} +0 -0
  66. /package/plugin/src/{withIosWarning.ts → ios/withIosWarning.ts} +0 -0
  67. /package/plugin/src/{withPodsLinking.ts → ios/withPodsLinking.ts} +0 -0
  68. /package/plugin/src/{withPushNotifications.ts → ios/withPushNotifications.ts} +0 -0
  69. /package/plugin/src/{xcode → ios/xcode}/addBuildPhases.ts +0 -0
  70. /package/plugin/src/{xcode → ios/xcode}/addPbxGroup.ts +0 -0
  71. /package/plugin/src/{xcode → ios/xcode}/addProductFile.ts +0 -0
  72. /package/plugin/src/{xcode → ios/xcode}/addTargetDependency.ts +0 -0
  73. /package/plugin/src/{xcode → ios/xcode}/addToPbxNativeTargetSection.ts +0 -0
  74. /package/plugin/src/{xcode → ios/xcode}/addToPbxProjectSection.ts +0 -0
  75. /package/plugin/src/{xcode → ios/xcode}/addXCConfigurationList.ts +0 -0
  76. /package/plugin/src/{xcode → ios/xcode}/withTargetXcodeProject.ts +0 -0
@@ -1,14 +1,8 @@
1
- import { ConfigPlugin, createRunOncePlugin, StaticPlugin, withPlugins } from 'expo/config-plugins';
1
+ import { ConfigPlugin, createRunOncePlugin, withPlugins } from 'expo/config-plugins';
2
2
 
3
+ import withAndroidWidgets from './android/withAndroidWidgets';
4
+ import withIosWidgets from './ios/withIosWidgets';
3
5
  import { WidgetConfig } from './types/WidgetConfig.type';
4
- import withAppGroupEntitlements from './withAppGroupEntitlements';
5
- import withAppInfoPlist from './withAppInfoPlist';
6
- import withEasConfig from './withEasConfig';
7
- import withIosWarning from './withIosWarning';
8
- import withPodsLinking from './withPodsLinking';
9
- import withPushNotifications from './withPushNotifications';
10
- import withWidgetSourceFiles from './withWidgetSourceFiles';
11
- import withTargetXcodeProject from './xcode/withTargetXcodeProject';
12
6
 
13
7
  const pkg = require('../../package.json');
14
8
 
@@ -25,70 +19,12 @@ export type ExpoWidgetsConfigPluginProps = {
25
19
  };
26
20
 
27
21
  const withWidgets: ConfigPlugin<ExpoWidgetsConfigPluginProps | undefined> = (config, props) => {
28
- let plugins: (StaticPlugin | ConfigPlugin | string)[] = [];
29
- const deploymentTarget = '16.4';
30
- const targetName = 'ExpoWidgetsTarget';
31
-
32
- let bundleIdentifier = props?.bundleIdentifier;
33
- if (!bundleIdentifier) {
34
- bundleIdentifier = `${config.ios?.bundleIdentifier}.${targetName}`;
35
- plugins.push([
36
- withIosWarning,
37
- {
38
- property: 'bundleIdentifier',
39
- warning: `Expo Widgets: No bundle identifier provided, using fallback: ${bundleIdentifier}.`,
40
- },
41
- ]);
42
- }
43
-
44
- let groupIdentifier = props?.groupIdentifier;
45
- if (!groupIdentifier) {
46
- if (!config.ios?.bundleIdentifier) {
47
- throw new Error(
48
- 'iOS bundle identifier is required. Please set `ios.bundleIdentifier` in `app.json` or `app.config.js`'
49
- );
50
- }
51
- groupIdentifier = `group.${config.ios.bundleIdentifier}`;
52
- plugins.push([
53
- withIosWarning,
54
- {
55
- property: 'groupIdentifier',
56
- warning: `Expo Widgets: No group identifier provided, using fallback: ${groupIdentifier}.`,
57
- },
58
- ]);
59
- }
60
-
61
22
  const widgets = props?.widgets ?? [];
62
- const enablePushNotifications = props?.enablePushNotifications ?? false;
63
- const frequentUpdates = props?.frequentUpdates ?? false;
64
-
65
- let sharedFiles: string[] = [];
66
- const setFiles = (files: string[]) => {
67
- sharedFiles = [...sharedFiles, ...files];
68
- };
69
- const getFileUris = () => sharedFiles;
70
-
71
- plugins = [
72
- ...plugins,
73
- [withEasConfig, { targetName, bundleIdentifier, groupIdentifier }],
74
- [withPodsLinking, { targetName }],
75
- [withWidgetSourceFiles, { targetName, widgets, groupIdentifier, onFilesGenerated: setFiles }],
76
- [withAppInfoPlist, { frequentUpdates, groupIdentifier }],
77
- [withPushNotifications, { enablePushNotifications }],
78
- [withAppGroupEntitlements, { groupIdentifier }],
79
- [
80
- withTargetXcodeProject,
81
- {
82
- targetName,
83
- bundleIdentifier,
84
- deploymentTarget,
85
- appleTeamId: config.ios?.appleTeamId,
86
- getFileUris,
87
- },
88
- ],
89
- ];
90
23
 
91
- return withPlugins(config, plugins);
24
+ return withPlugins(config, [
25
+ [withAndroidWidgets, { widgets }],
26
+ [withIosWidgets, { ...(props ?? {}), widgets }],
27
+ ]);
92
28
  };
93
29
 
94
30
  export default createRunOncePlugin(withWidgets, pkg.name, pkg.version);
@@ -0,0 +1 @@
1
+ {"root":["./src/index.ts","./src/withappgroupentitlements.ts","./src/withappinfoplist.ts","./src/witheasconfig.ts","./src/withioswarning.ts","./src/withpodslinking.ts","./src/withpushnotifications.ts","./src/withwidgetsourcefiles.ts","./src/types/widgetconfig.type.ts","./src/types/widgetfamily.type.ts","./src/xcode/addbuildphases.ts","./src/xcode/addpbxgroup.ts","./src/xcode/addproductfile.ts","./src/xcode/addtargetdependency.ts","./src/xcode/addtopbxnativetargetsection.ts","./src/xcode/addtopbxprojectsection.ts","./src/xcode/addxcconfigurationlist.ts","./src/xcode/withtargetxcodeproject.ts"],"version":"5.9.2"}
File without changes