craft-native 0.0.449 → 0.0.451

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/dist/cli.js CHANGED
@@ -3228,7 +3228,7 @@ function pinCraftNativeDependency(packagePath, craftVersion) {
3228
3228
  `);
3229
3229
  }
3230
3230
  // package.json
3231
- var version = "0.0.449";
3231
+ var version = "0.0.451";
3232
3232
 
3233
3233
  // bin/cli.ts
3234
3234
  var spawnedFrom = process6.env[CRAFT_CLI_SPAWN_MARKER];
package/dist/index.cjs CHANGED
@@ -376,7 +376,7 @@ function craftBinaryNotFoundMessage(triedPath) {
376
376
  `);
377
377
  }
378
378
  // package.json
379
- var version = "0.0.449";
379
+ var version = "0.0.451";
380
380
 
381
381
  // src/sdk-version.ts
382
382
  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.449";
120
+ var version = "0.0.451";
121
121
 
122
122
  // src/sdk-version.ts
123
123
  var SDK_VERSION = version;
@@ -245,6 +245,9 @@ final class DriverTests: XCTestCase {
245
245
  /// nor any descendant has keyboard focus". A later tap lands once the app
246
246
  /// is idle again.
247
247
  func focus(_ target: XCUIElement, seconds: Double = 15) -> Bool {
248
+ // Retapping an already focused field can collapse its selection. A
249
+ // caller that just selected text must type into that same selection.
250
+ if hasKeyboardFocus(target) { return true }
248
251
  let end = Date().addingTimeInterval(seconds)
249
252
  repeat {
250
253
  target.tap()
@@ -295,7 +298,14 @@ final class DriverTests: XCTestCase {
295
298
  /// The switch answers `/exec` with 200 whatever the hook did, its first
296
299
  /// word the hook's exit code: only `exit 0` is a hook that worked.
297
300
  func hookSucceeded(_ answer: String) -> Bool {
298
- answer.trimmingCharacters(in: .whitespacesAndNewlines).hasPrefix("exit 0")
301
+ // get() already requires HTTP success. Custom control servers may
302
+ // return a message or no body. Preserve the legacy shell protocol's
303
+ // explicit failures, without accepting "exit 01" as a zero status.
304
+ let body = answer.trimmingCharacters(in: .whitespacesAndNewlines)
305
+ if body == "no such hook" { return false }
306
+ let fields = body.split(whereSeparator: { $0.isWhitespace })
307
+ guard fields.first == "exit" else { return true }
308
+ return fields.count >= 2 && fields[1] == "0"
299
309
  }
300
310
 
301
311
  func switchFlipped(from before: String?, to after: String?) -> Bool {
@@ -482,6 +492,12 @@ final class DriverTests: XCTestCase {
482
492
  check(false, "longpressid \(arg) is hittable")
483
493
  return
484
494
  }
495
+ if [.textField, .secureTextField, .textView].contains(target.elementType) {
496
+ guard focus(target) else {
497
+ check(false, "longpressid \(arg) takes keyboard focus")
498
+ return
499
+ }
500
+ }
485
501
  target.press(forDuration: 1.2)
486
502
  note("longpressid \(arg): ok")
487
503
  case "holdtab":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "craft-native",
3
- "version": "0.0.449",
3
+ "version": "0.0.451",
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>",