@craft-native/ios 0.0.139 → 0.0.140

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.139",
3
+ "version": "0.0.140",
4
4
  "homepage": "https://github.com/craft-native/craft/tree/main/packages/ios#readme",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1310,8 +1310,11 @@ private final class CraftNativeGradientLayer: CAGradientLayer {
1310
1310
  layer.follow(view)
1311
1311
  guard existing == nil else { return }
1312
1312
  view.layer.insertSublayer(layer, at: 0)
1313
+ // The layer's bounds, not the view's: UIKit does not promise KVO for
1314
+ // UIView.bounds, and a screen laid out by frame never reported it, so
1315
+ // every gradient stayed zero-sized. CALayer's own bounds always do.
1313
1316
  layer.observations = [
1314
- view.observe(\.bounds) { [weak layer] view, _ in layer?.follow(view) },
1317
+ view.layer.observe(\.bounds) { [weak layer, weak view] _, _ in if let view { layer?.follow(view) } },
1315
1318
  view.layer.observe(\.cornerRadius) { [weak layer, weak view] _, _ in if let view { layer?.follow(view) } },
1316
1319
  ]
1317
1320
  }
@@ -2744,7 +2747,6 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
2744
2747
  return textView
2745
2748
  }
2746
2749
  let field = UITextField()
2747
- field.borderStyle = .roundedRect
2748
2750
  field.addTarget(self, action: #selector(textChanged(_:)), for: .editingChanged)
2749
2751
  field.addTarget(self, action: #selector(textFocused(_:)), for: .editingDidBegin)
2750
2752
  field.addTarget(self, action: #selector(textBlurred(_:)), for: .editingDidEnd)
@@ -3282,6 +3284,12 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
3282
3284
  updateDimension(width, constraint: &node.widthConstraint, anchor: view.widthAnchor)
3283
3285
  updateDimension(height, constraint: &node.heightConstraint, anchor: view.heightAnchor)
3284
3286
  view.backgroundColor = color(style["backgroundColor"]) ?? .clear
3287
+ // A field the style dresses itself (`border-0`, a border or a
3288
+ // background, as a search field inside its own pill is) draws no
3289
+ // system box of its own; a bare one keeps the rounded rectangle.
3290
+ if let field = view as? UITextField {
3291
+ field.borderStyle = style["borderWidth"] != nil || style["backgroundColor"] != nil ? .none : .roundedRect
3292
+ }
3285
3293
  CraftNativeGradientLayer.apply(
3286
3294
  to: view,
3287
3295
  direction: style["gradientDirection"] as? String,