@craft-native/ios 0.0.374 → 0.0.377

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@craft-native/ios",
3
- "version": "0.0.374",
3
+ "version": "0.0.377",
4
4
  "homepage": "https://github.com/craft-native/craft/tree/main/packages/ios#readme",
5
5
  "repository": {
6
6
  "type": "git",
@@ -135,8 +135,8 @@ final class CraftHeartRate: NSObject, CBCentralManagerDelegate, CBPeripheralDele
135
135
  static let connectTimeout: TimeInterval = 15
136
136
  /// A reading older than this is no longer "now".
137
137
  static let staleAfter: TimeInterval = 10
138
- /// Fourteen hours of one reading a second: more is not one workout.
139
- static let maxRecordedSamples = 50_000
138
+ /// Seven days at one reading a second, including multi-day ultra events.
139
+ static let maxRecordedSamples = 604_800
140
140
 
141
141
  private let clock: () -> Date
142
142
  private let recordingDirectory: URL?
@@ -63,7 +63,16 @@ struct CraftLiveActivityWidget: Widget {
63
63
  } compactTrailing: {
64
64
  timer(context).monospacedDigit().frame(width: 64, alignment: .trailing)
65
65
  } minimal: {
66
- activityIcon(context)
66
+ // When another activity (for example Music) shares the island,
67
+ // the minimal presentation must still carry useful live state.
68
+ if context.state.remainingSeconds != nil || context.state.timerEndsAt != nil {
69
+ timer(context).font(.caption2.monospacedDigit().weight(.semibold))
70
+ .frame(width: 48).minimumScaleFactor(0.65)
71
+ } else if let bpm = context.state.heartRate, bpm > 0 {
72
+ Text("\(Int(bpm))").font(.caption.monospacedDigit()).foregroundStyle(.pink)
73
+ } else {
74
+ timer(context).font(.caption2.monospacedDigit()).frame(width: 48)
75
+ }
67
76
  }
68
77
  .widgetURL(context.attributes.deepLink.flatMap(URL.init(string:)))
69
78
  .keylineTint(tint(context))
@@ -104,6 +113,9 @@ struct CraftLiveActivityWidget: Widget {
104
113
  .lineLimit(1)
105
114
  .minimumScaleFactor(0.8)
106
115
  }
116
+ // Dynamic Island is black even when the host app uses light mode.
117
+ // Explicit ink also applies to the ticking Text inside the overlay.
118
+ .foregroundStyle(.white)
107
119
  }
108
120
 
109
121
  @ViewBuilder