craft-native 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.
@@ -208,8 +208,8 @@ internal class CraftHeartRateRecording(
208
208
  private val archiveWriter: (ByteArray, File) -> Unit = ::craftHeartRateWriteAtomically,
209
209
  ) {
210
210
  companion object {
211
- /** Fourteen hours of one reading a second: more is not one workout. */
212
- const val MAX_SAMPLES = 50_000
211
+ /** Seven days at one reading a second, including multi-day ultra events. */
212
+ const val MAX_SAMPLES = 604_800
213
213
  val METHODS = setOf("startRecording", "pauseRecording", "resumeRecording", "stopRecording", "getRecordingState", "readRecording", "acknowledgeRecording")
214
214
  private const val KIND = "heart-rate"
215
215
  }
package/dist/cli.js CHANGED
@@ -3047,7 +3047,7 @@ function pinCraftNativeDependency(packagePath, craftVersion) {
3047
3047
  `);
3048
3048
  }
3049
3049
  // package.json
3050
- var version = "0.0.374";
3050
+ var version = "0.0.377";
3051
3051
 
3052
3052
  // bin/cli.ts
3053
3053
  var spawnedFrom = process6.env[CRAFT_CLI_SPAWN_MARKER];
package/dist/index.cjs CHANGED
@@ -375,7 +375,7 @@ function craftBinaryNotFoundMessage(triedPath) {
375
375
  `);
376
376
  }
377
377
  // package.json
378
- var version = "0.0.374";
378
+ var version = "0.0.377";
379
379
 
380
380
  // src/sdk-version.ts
381
381
  var SDK_VERSION = version;
package/dist/index.js CHANGED
@@ -117,7 +117,7 @@ function craftBinaryNotFoundMessage(triedPath) {
117
117
  `);
118
118
  }
119
119
  // package.json
120
- var version = "0.0.374";
120
+ var version = "0.0.377";
121
121
 
122
122
  // src/sdk-version.ts
123
123
  var SDK_VERSION = version;
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "craft-native",
3
- "version": "0.0.374",
3
+ "version": "0.0.377",
4
4
  "type": "module",
5
5
  "description": "Build desktop apps with web languages - TypeScript SDK for Craft",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",