expo-widgets 58.0.16 → 58.0.17
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 +9 -0
- package/android/build.gradle +2 -2
- package/android/src/main/AndroidManifest.xml +6 -1
- package/android/src/main/java/expo/modules/widgets/ExpoWidgetEmittableTree.kt +7 -7
- package/android/src/main/java/expo/modules/widgets/ExpoWidgetsPeekWidget.kt +1 -1
- package/android/src/main/java/expo/modules/widgets/WidgetInteractionAction.kt +34 -4
- package/android/src/main/java/expo/modules/widgets/WidgetsEvents.kt +8 -4
- package/android/src/main/java/expo/modules/widgets/WidgetsModule.kt +45 -0
- package/android/src/main/java/expo/modules/widgets/notifications/CustomNotification.kt +28 -0
- package/android/src/main/java/expo/modules/widgets/notifications/CustomNotificationBuilder.kt +116 -0
- package/android/src/main/java/expo/modules/widgets/notifications/CustomNotificationExceptions.kt +50 -0
- package/android/src/main/java/expo/modules/widgets/notifications/CustomNotificationFactory.kt +36 -0
- package/android/src/main/java/expo/modules/widgets/notifications/CustomNotificationOptions.kt +86 -0
- package/android/src/main/java/expo/modules/widgets/notifications/CustomNotificationRenderer.kt +44 -0
- package/android/src/main/java/expo/modules/widgets/notifications/CustomNotificationState.kt +65 -0
- package/android/src/main/java/expo/modules/widgets/notifications/CustomNotifications.kt +107 -0
- package/android/src/main/java/expo/modules/widgets/notifications/ExpoWidgetsNotificationReceiver.kt +67 -0
- package/android/src/main/res/values/expo_widgets_notifications.xml +4 -0
- package/build/CustomNotifications.d.ts +128 -0
- package/build/CustomNotifications.js +162 -0
- package/build/CustomNotifications.js.map +1 -0
- package/build/CustomNotifications.types.d.ts +124 -0
- package/build/CustomNotifications.types.js +3 -0
- package/build/CustomNotifications.types.js.map +1 -0
- package/build/ExpoWidgets.d.ts +3 -0
- package/build/ExpoWidgets.js +26 -0
- package/build/ExpoWidgets.js.map +1 -1
- package/build/ExpoWidgets.native.d.ts +5 -0
- package/build/ExpoWidgets.native.js.map +1 -1
- package/build/Widgets.d.ts +14 -0
- package/build/Widgets.js +14 -0
- package/build/Widgets.js.map +1 -1
- package/build/Widgets.types.d.ts +24 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/bundle/decorator.ts +13 -0
- package/bundle/index.ts +19 -2
- package/bundle/layout-registry-stub.ts +19 -0
- package/ios/ExpoWidgets.podspec +5 -7
- package/package.json +4 -4
- package/plugin/build/android/withAndroidNotificationPermission.d.ts +6 -0
- package/plugin/build/android/withAndroidNotificationPermission.js +31 -0
- package/plugin/build/android/withAndroidNotificationPermission.js.map +1 -0
- package/plugin/build/android/withAndroidWidgets.d.ts +4 -2
- package/plugin/build/android/withAndroidWidgets.js +6 -1
- package/plugin/build/android/withAndroidWidgets.js.map +1 -1
- package/plugin/build/withWidgets.js +1 -0
- package/plugin/build/withWidgets.js.map +1 -1
- package/plugin/src/android/withAndroidNotificationPermission.ts +22 -0
- package/plugin/src/android/withAndroidWidgets.ts +11 -1
- package/plugin/src/withWidgets.ts +2 -2
- package/src/CustomNotifications.ts +213 -0
- package/src/CustomNotifications.types.ts +138 -0
- package/src/ExpoWidgets.native.ts +8 -0
- package/src/ExpoWidgets.ts +41 -0
- package/src/Widgets.ts +14 -0
- package/src/Widgets.types.ts +24 -0
- package/src/index.ts +8 -0
package/src/Widgets.types.ts
CHANGED
|
@@ -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,
|