@craft-native/ios 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/README.md CHANGED
@@ -1420,4 +1420,6 @@ when available. `monospace`/`ui-monospace`, `serif`/`ui-serif` and
1420
1420
  weight, italic style and system text scaling. A missing custom face falls through
1421
1421
  to the next family rather than silently replacing a requested mono font with sans.
1422
1422
 
1423
- The simulator driver requires a successful HTTP response from each control-server `exec` hook. A failed or unavailable hook fails XCTest and stops the journey before its next command.
1423
+ The simulator driver requires a successful HTTP response from each control-server `exec` hook. A failed or unavailable hook fails XCTest and stops the journey before its next command. A successful hook may return a message or HTTP 204 with no body. Legacy shell responses (`exit <code> ...`) must report exactly `0`; nonzero or malformed exit statuses and the legacy `no such hook` response fail the journey.
1424
+
1425
+ `longpressid` establishes keyboard focus before holding a native text field or text view, so the gesture opens its edit menu. Typing into an already focused control preserves its current selection. Other elements keep their ordinary long-press behavior. The real native text-editing regression runs with `CRAFT_DRIVER_SIMULATOR=<owned-uuid> CRAFT_DRIVER_TEXT_RESULT=<retained-path>.xcresult bun packages/ios/scripts/test-driver-text.ts`; it uses the existing selection and typing commands to edit and clear Unicode values.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@craft-native/ios",
3
- "version": "0.0.449",
3
+ "version": "0.0.451",
4
4
  "homepage": "https://github.com/craft-native/craft/tree/main/packages/ios#readme",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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":