expo-widgets 57.0.22 → 57.0.24
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
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 57.0.24 — 2026-10-12
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 57.0.23 — 2026-10-06
|
|
18
|
+
|
|
19
|
+
### 🐛 Bug fixes
|
|
20
|
+
|
|
21
|
+
- [iOS] Stop linking WidgetKit into apps that use `@expo/ui` without widgets. The `widgetURL`, `activityBackgroundTint`, `widgetAccentedRenderingMode`, and `containerBackground` (`widget` placement) modifiers and the `AccessoryWidgetBackground` view now take effect only inside `expo-widgets` widgets and Live Activities. ([#50786](https://github.com/expo/expo/pull/50786) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
22
|
+
|
|
13
23
|
## 57.0.22 — 2026-09-29
|
|
14
24
|
|
|
15
25
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -13,7 +13,7 @@ apply plugin: 'expo-module-gradle-plugin'
|
|
|
13
13
|
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
|
|
14
14
|
|
|
15
15
|
group = 'expo.modules.widgets'
|
|
16
|
-
version = '57.0.
|
|
16
|
+
version = '57.0.24'
|
|
17
17
|
|
|
18
18
|
expoModule {
|
|
19
19
|
canBePublished false
|
|
@@ -23,7 +23,7 @@ android {
|
|
|
23
23
|
namespace "expo.modules.widgets"
|
|
24
24
|
defaultConfig {
|
|
25
25
|
versionCode 1
|
|
26
|
-
versionName '57.0.
|
|
26
|
+
versionName '57.0.24'
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
buildFeatures {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
import ExpoModulesCore
|
|
3
|
+
import ExpoUI
|
|
4
|
+
#if !os(tvOS)
|
|
5
|
+
import WidgetKit
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
public final class AccessoryWidgetBackgroundProps: UIBaseViewProps {}
|
|
9
|
+
|
|
10
|
+
public struct AccessoryWidgetBackgroundView: ExpoSwiftUI.View {
|
|
11
|
+
@ObservedObject public var props: AccessoryWidgetBackgroundProps
|
|
12
|
+
|
|
13
|
+
public init(props: AccessoryWidgetBackgroundProps) {
|
|
14
|
+
self.props = props
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public var body: some View {
|
|
18
|
+
#if !os(tvOS)
|
|
19
|
+
if #available(iOS 16.0, *) {
|
|
20
|
+
AccessoryWidgetBackground()
|
|
21
|
+
} else {
|
|
22
|
+
Color.clear
|
|
23
|
+
}
|
|
24
|
+
#else
|
|
25
|
+
EmptyView()
|
|
26
|
+
#endif
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// Copyright 2015-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
import ExpoUI
|
|
5
|
+
import SwiftUI
|
|
6
|
+
#if !os(tvOS)
|
|
7
|
+
import WidgetKit
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
internal enum WidgetAccentedRenderingModeOptions: String, Enumerable {
|
|
11
|
+
case accented
|
|
12
|
+
case desaturated
|
|
13
|
+
case accentedDesaturated
|
|
14
|
+
case fullColor
|
|
15
|
+
|
|
16
|
+
#if !os(tvOS)
|
|
17
|
+
@available(iOS 18.0, *)
|
|
18
|
+
var toWidgetAccentedRenderingMode: WidgetAccentedRenderingMode {
|
|
19
|
+
switch self {
|
|
20
|
+
case .accented: return .accented
|
|
21
|
+
case .accentedDesaturated: return .accentedDesaturated
|
|
22
|
+
case .desaturated: return .desaturated
|
|
23
|
+
case .fullColor: return .fullColor
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
#endif
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* This is a unique modifier that exists only on Image, but returns some View, and for this reason it cannot be a ViewModifier.
|
|
31
|
+
*/
|
|
32
|
+
internal struct WidgetAccentedRenderingModeModifier: Record {
|
|
33
|
+
@Field var renderingMode: WidgetAccentedRenderingModeOptions?
|
|
34
|
+
|
|
35
|
+
@ViewBuilder
|
|
36
|
+
func apply(to image: Image) -> some View {
|
|
37
|
+
#if !os(tvOS)
|
|
38
|
+
if #available(iOS 18.0, *), renderingMode != nil {
|
|
39
|
+
image.widgetAccentedRenderingMode(renderingMode?.toWidgetAccentedRenderingMode)
|
|
40
|
+
} else {
|
|
41
|
+
image
|
|
42
|
+
}
|
|
43
|
+
#else
|
|
44
|
+
image
|
|
45
|
+
#endif
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
internal struct WidgetURLModifier: ViewModifier, Record {
|
|
50
|
+
@Field var url: URL?
|
|
51
|
+
|
|
52
|
+
func body(content: Content) -> some View {
|
|
53
|
+
#if !os(tvOS)
|
|
54
|
+
content.widgetURL(url)
|
|
55
|
+
#else
|
|
56
|
+
content
|
|
57
|
+
#endif
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
internal struct ActivityBackgroundTintModifier: ViewModifier, Record {
|
|
62
|
+
@Field var color: Color?
|
|
63
|
+
|
|
64
|
+
func body(content: Content) -> some View {
|
|
65
|
+
#if !os(tvOS) && !os(macOS) && !targetEnvironment(macCatalyst)
|
|
66
|
+
content.activityBackgroundTint(color)
|
|
67
|
+
#else
|
|
68
|
+
content
|
|
69
|
+
#endif
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Registers the modifiers that need WidgetKit. They live here rather than in ExpoUI,
|
|
75
|
+
* so apps that use ExpoUI without widgets do not link WidgetKit.
|
|
76
|
+
* See: https://github.com/expo/expo/issues/50777
|
|
77
|
+
*/
|
|
78
|
+
internal func registerWidgetModifiers() {
|
|
79
|
+
ViewModifierRegistry.register("widgetURL") { params, appContext, _ in
|
|
80
|
+
return try WidgetURLModifier(from: params, appContext: appContext)
|
|
81
|
+
}
|
|
82
|
+
ViewModifierRegistry.register("activityBackgroundTint") { params, appContext, _ in
|
|
83
|
+
return try ActivityBackgroundTintModifier(from: params, appContext: appContext)
|
|
84
|
+
}
|
|
85
|
+
ViewModifierRegistry.widgetKit = WidgetKitModifiersImpl()
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
private struct WidgetKitModifiersImpl: WidgetKitModifiers {
|
|
89
|
+
func containerBackground(_ view: AnyView, style: AnyShapeStyle) -> AnyView {
|
|
90
|
+
guard #available(iOS 17.0, *) else {
|
|
91
|
+
return view
|
|
92
|
+
}
|
|
93
|
+
return AnyView(view.containerBackground(style, for: .widget))
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
func widgetAccentedRenderingMode(_ image: Image, params: [String: Any], appContext: AppContext) -> AnyView? {
|
|
97
|
+
guard #available(iOS 18.0, *), let modifier = try? WidgetAccentedRenderingModeModifier(from: params, appContext: appContext) else {
|
|
98
|
+
return nil
|
|
99
|
+
}
|
|
100
|
+
return AnyView(modifier.apply(to: image))
|
|
101
|
+
}
|
|
102
|
+
}
|
package/ios/WidgetsContext.swift
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-widgets",
|
|
3
|
-
"version": "57.0.
|
|
3
|
+
"version": "57.0.24",
|
|
4
4
|
"description": "Widgets.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"homepage": "https://docs.expo.dev/versions/latest/sdk/widgets/",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@expo/plist": "^0.8.1",
|
|
25
|
-
"@expo/ui": "~57.0.
|
|
25
|
+
"@expo/ui": "~57.0.23"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@expo/spawn-async": "^1.8.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@types/react": "~19.2.0",
|
|
31
31
|
"react-native": "0.86.3",
|
|
32
32
|
"resolve-workspace-root": "^2.0.0",
|
|
33
|
-
"expo": "57.0.
|
|
33
|
+
"expo": "57.0.28",
|
|
34
34
|
"expo-module-scripts": "56.0.3"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"./scripts/xcode-build-bundle.sh"
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "58da4edafcb043872c3ed9bf8f5957e6544d0a9c",
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "expo-module build",
|
|
50
50
|
"build:plugin": "expo-module build plugin",
|