expo-app-blocker 0.1.34 → 0.1.35
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.
|
@@ -34,7 +34,7 @@ public class ExpoAppBlockerPickerModule: Module {
|
|
|
34
34
|
// MARK: - ViewModel
|
|
35
35
|
|
|
36
36
|
class FamilyActivityPickerViewModel: ObservableObject {
|
|
37
|
-
@Published var selection = FamilyActivitySelection()
|
|
37
|
+
@Published var selection = FamilyActivitySelection(includeEntireCategory: true)
|
|
38
38
|
@Published var colorScheme: ColorScheme? = nil
|
|
39
39
|
var didSetInitial = false
|
|
40
40
|
}
|
|
@@ -70,7 +70,7 @@ class FamilyActivityPickerNativeView: ExpoView {
|
|
|
70
70
|
func setInitialSelection(_ selection: FamilyActivitySelection) {
|
|
71
71
|
guard !viewModel.didSetInitial else { return }
|
|
72
72
|
viewModel.didSetInitial = true
|
|
73
|
-
viewModel.selection = selection
|
|
73
|
+
viewModel.selection = normalizeSelection(selection)
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/// Increments-only: first snapshot records baseline without clearing; higher values clear UI.
|
|
@@ -89,11 +89,21 @@ class FamilyActivityPickerNativeView: ExpoView {
|
|
|
89
89
|
var transaction = Transaction()
|
|
90
90
|
transaction.disablesAnimations = true
|
|
91
91
|
withTransaction(transaction) {
|
|
92
|
-
viewModel.selection = FamilyActivitySelection()
|
|
92
|
+
viewModel.selection = FamilyActivitySelection(includeEntireCategory: true)
|
|
93
93
|
}
|
|
94
94
|
viewModel.didSetInitial = false
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
private func normalizeSelection(_ selection: FamilyActivitySelection) -> FamilyActivitySelection {
|
|
98
|
+
// Apple forum reports indicate includeEntireCategory may not survive some encode/decode paths.
|
|
99
|
+
// Rehydrate into a fresh includeEntireCategory=true value so category picks expand to app tokens.
|
|
100
|
+
var normalized = FamilyActivitySelection(includeEntireCategory: true)
|
|
101
|
+
normalized.applicationTokens = selection.applicationTokens
|
|
102
|
+
normalized.categoryTokens = selection.categoryTokens
|
|
103
|
+
normalized.webDomainTokens = selection.webDomainTokens
|
|
104
|
+
return normalized
|
|
105
|
+
}
|
|
106
|
+
|
|
97
107
|
func setTheme(_ theme: String) {
|
|
98
108
|
switch theme.lowercased() {
|
|
99
109
|
case "light":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-app-blocker",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.35",
|
|
4
4
|
"description": "Expo module for cross-platform app blocking. Android: UsageStatsManager + Overlay. iOS: Screen Time API (FamilyControls + ManagedSettings + DeviceActivity).",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|