expo-widgets 58.0.16 → 58.0.18

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 (59) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/AndroidManifest.xml +6 -1
  4. package/android/src/main/java/expo/modules/widgets/ExpoWidgetEmittableTree.kt +7 -7
  5. package/android/src/main/java/expo/modules/widgets/ExpoWidgetsPeekWidget.kt +1 -1
  6. package/android/src/main/java/expo/modules/widgets/WidgetInteractionAction.kt +34 -4
  7. package/android/src/main/java/expo/modules/widgets/WidgetsEvents.kt +8 -4
  8. package/android/src/main/java/expo/modules/widgets/WidgetsModule.kt +45 -0
  9. package/android/src/main/java/expo/modules/widgets/notifications/CustomNotification.kt +28 -0
  10. package/android/src/main/java/expo/modules/widgets/notifications/CustomNotificationBuilder.kt +116 -0
  11. package/android/src/main/java/expo/modules/widgets/notifications/CustomNotificationExceptions.kt +50 -0
  12. package/android/src/main/java/expo/modules/widgets/notifications/CustomNotificationFactory.kt +36 -0
  13. package/android/src/main/java/expo/modules/widgets/notifications/CustomNotificationOptions.kt +86 -0
  14. package/android/src/main/java/expo/modules/widgets/notifications/CustomNotificationRenderer.kt +44 -0
  15. package/android/src/main/java/expo/modules/widgets/notifications/CustomNotificationState.kt +65 -0
  16. package/android/src/main/java/expo/modules/widgets/notifications/CustomNotifications.kt +107 -0
  17. package/android/src/main/java/expo/modules/widgets/notifications/ExpoWidgetsNotificationReceiver.kt +67 -0
  18. package/android/src/main/res/values/expo_widgets_notifications.xml +4 -0
  19. package/build/CustomNotifications.d.ts +128 -0
  20. package/build/CustomNotifications.js +162 -0
  21. package/build/CustomNotifications.js.map +1 -0
  22. package/build/CustomNotifications.types.d.ts +124 -0
  23. package/build/CustomNotifications.types.js +3 -0
  24. package/build/CustomNotifications.types.js.map +1 -0
  25. package/build/ExpoWidgets.d.ts +3 -0
  26. package/build/ExpoWidgets.js +26 -0
  27. package/build/ExpoWidgets.js.map +1 -1
  28. package/build/ExpoWidgets.native.d.ts +5 -0
  29. package/build/ExpoWidgets.native.js.map +1 -1
  30. package/build/Widgets.d.ts +14 -0
  31. package/build/Widgets.js +14 -0
  32. package/build/Widgets.js.map +1 -1
  33. package/build/Widgets.types.d.ts +24 -0
  34. package/build/index.d.ts +2 -0
  35. package/build/index.js +1 -0
  36. package/build/index.js.map +1 -1
  37. package/bundle/decorator.ts +13 -0
  38. package/bundle/index.ts +19 -2
  39. package/bundle/layout-registry-stub.ts +19 -0
  40. package/ios/ExpoWidgets.podspec +5 -7
  41. package/package.json +5 -5
  42. package/plugin/build/android/withAndroidNotificationPermission.d.ts +6 -0
  43. package/plugin/build/android/withAndroidNotificationPermission.js +31 -0
  44. package/plugin/build/android/withAndroidNotificationPermission.js.map +1 -0
  45. package/plugin/build/android/withAndroidWidgets.d.ts +4 -2
  46. package/plugin/build/android/withAndroidWidgets.js +6 -1
  47. package/plugin/build/android/withAndroidWidgets.js.map +1 -1
  48. package/plugin/build/withWidgets.js +1 -0
  49. package/plugin/build/withWidgets.js.map +1 -1
  50. package/plugin/src/android/withAndroidNotificationPermission.ts +22 -0
  51. package/plugin/src/android/withAndroidWidgets.ts +11 -1
  52. package/plugin/src/withWidgets.ts +2 -2
  53. package/src/CustomNotifications.ts +213 -0
  54. package/src/CustomNotifications.types.ts +138 -0
  55. package/src/ExpoWidgets.native.ts +8 -0
  56. package/src/ExpoWidgets.ts +41 -0
  57. package/src/Widgets.ts +14 -0
  58. package/src/Widgets.types.ts +24 -0
  59. package/src/index.ts +8 -0
@@ -8,6 +8,7 @@ import type { after } from './Widgets';
8
8
  * - `fullColor` — Home screen widgets (default).
9
9
  * - `accented` — Tinted widgets (iOS 18+) and watchOS.
10
10
  * - `vibrant` — Lock screen widgets.
11
+ * @platform ios
11
12
  */
12
13
  export type WidgetRenderingMode = 'fullColor' | 'accented' | 'vibrant';
13
14
 
@@ -102,9 +103,13 @@ export type WidgetEnvironment<T extends object | undefined = undefined> = {
102
103
  configuration: T;
103
104
  };
104
105
 
106
+ /**
107
+ * @platform ios
108
+ */
105
109
  export type LiveActivityEnvironment = {
106
110
  /**
107
111
  * The color scheme of the activity's environment.
112
+ * @platform ios
108
113
  */
109
114
  colorScheme: 'light' | 'dark';
110
115
  /**
@@ -143,6 +148,9 @@ export type LiveActivityEnvironment = {
143
148
  levelOfDetail?: LevelOfDetail;
144
149
  };
145
150
 
151
+ /**
152
+ * @platform ios
153
+ */
146
154
  export type WidgetTimelineEntry<T extends object = object> = {
147
155
  /**
148
156
  * Date when widget should update.
@@ -177,6 +185,7 @@ export type ExpoTimelineEntry = {
177
185
 
178
186
  /**
179
187
  * Defines the layout sections for an iOS Live Activity.
188
+ * @platform ios
180
189
  */
181
190
  export type LiveActivityLayout = {
182
191
  /**
@@ -219,6 +228,7 @@ export type LiveActivityLayout = {
219
228
 
220
229
  /**
221
230
  * A function that returns the layout for a Live Activity.
231
+ * @platform ios
222
232
  */
223
233
  export type LiveActivityComponent<T extends object = object> = (
224
234
  props: T,
@@ -237,6 +247,11 @@ export type UserInteractionEvent = {
237
247
  * Button/toggle that was pressed.
238
248
  */
239
249
  target: string;
250
+ /**
251
+ * The key of the custom notification that contains the button. Absent for widget interactions.
252
+ * @platform android
253
+ */
254
+ notificationId?: string;
240
255
  /**
241
256
  * Timestamp of the event.
242
257
  */
@@ -249,6 +264,7 @@ export type UserInteractionEvent = {
249
264
 
250
265
  /**
251
266
  * Event emitted when a push token is received for a live activity.
267
+ * @platform ios
252
268
  */
253
269
  export type PushTokenEvent = {
254
270
  /**
@@ -263,6 +279,7 @@ export type PushTokenEvent = {
263
279
 
264
280
  /**
265
281
  * Event emitted when a push-to-start token is received.
282
+ * @platform ios
266
283
  */
267
284
  export type PushToStartTokenEvent = {
268
285
  /**
@@ -276,22 +293,29 @@ export type PushToStartTokenEvent = {
276
293
  * - `'default'` - The system’s default dismissal policy for the Live Activity.
277
294
  * - `'immediate'` - The system immediately removes the Live Activity that ended.
278
295
  * - `after(date)` - The system removes the Live Activity that ended at the specified time within a four-hour window.
296
+ * @platform ios
279
297
  */
280
298
  export type LiveActivityDismissalPolicy = 'default' | 'immediate' | ReturnType<typeof after>;
281
299
 
300
+ /** @hidden */
282
301
  export type ExpoWidgetsEvents = {
283
302
  /**
284
303
  * Function that is invoked when user interacts with a widget.
285
304
  * @param event Interaction event details.
305
+ * @platform ios
286
306
  */
287
307
  onExpoWidgetsUserInteraction: (event: UserInteractionEvent) => void;
288
308
  /**
289
309
  * Function that is invoked when a push-to-start token is received.
290
310
  * @param event Token event details.
311
+ * @platform ios
291
312
  */
292
313
  onExpoWidgetsPushToStartTokenReceived: (event: PushToStartTokenEvent) => void;
293
314
  };
294
315
 
316
+ /**
317
+ * @platform ios
318
+ */
295
319
  export type LiveActivityEvents = {
296
320
  /**
297
321
  * Function that is invoked when a push token is received for a live activity.
package/src/index.ts CHANGED
@@ -1,3 +1,11 @@
1
+ export * from './CustomNotifications';
2
+ export type {
3
+ CustomNotificationComponent,
4
+ CustomNotificationEnvironment,
5
+ CustomNotificationLayout,
6
+ CustomNotificationOptions,
7
+ CustomNotificationUpdateOptions,
8
+ } from './CustomNotifications.types';
1
9
  export * from './Widgets';
2
10
  export type {
3
11
  ExpoWidgetsEvents,