craft-native 0.0.167 → 0.0.168

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
@@ -3303,7 +3303,7 @@ function pinCraftNativeDependency(packagePath, craftVersion) {
3303
3303
  `);
3304
3304
  }
3305
3305
  // package.json
3306
- var version = "0.0.167";
3306
+ var version = "0.0.168";
3307
3307
 
3308
3308
  // bin/cli.ts
3309
3309
  var spawnedFrom = process6.env[CRAFT_CLI_SPAWN_MARKER];
package/dist/index.cjs CHANGED
@@ -310,7 +310,7 @@ function craftBinaryNotFoundMessage(triedPath) {
310
310
  `);
311
311
  }
312
312
  // package.json
313
- var version = "0.0.167";
313
+ var version = "0.0.168";
314
314
 
315
315
  // src/sdk-version.ts
316
316
  var SDK_VERSION = version;
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ function craftBinaryNotFoundMessage(triedPath) {
58
58
  `);
59
59
  }
60
60
  // package.json
61
- var version = "0.0.167";
61
+ var version = "0.0.168";
62
62
 
63
63
  // src/sdk-version.ts
64
64
  var SDK_VERSION = version;
@@ -3353,12 +3353,26 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
3353
3353
  }
3354
3354
  return nil
3355
3355
  }
3356
+ /// The scroll view the screen starts with, when nothing sits above it:
3357
+ /// the root's first child, its first, and so on, none padded on top.
3358
+ func leading(_ node: RenderedNode) -> UIScrollView? {
3359
+ if let scroll = node.view as? CraftNativeScrollView { return scroll.isVertical && scroll.isScrollEnabled ? scroll : nil }
3360
+ if let list = node.view as? CraftNativeFlatList {
3361
+ return list.isScrollEnabled && (list.collectionViewLayout as? UICollectionViewFlowLayout)?.scrollDirection != .horizontal ? list : nil
3362
+ }
3363
+ guard paddingInsets(node.style).top == 0,
3364
+ let first = node.children.first(where: { $0.type != "Modal" && !$0.view.isHidden }) else { return nil }
3365
+ return leading(first)
3366
+ }
3356
3367
  let scroll = find(renderedRoot)
3357
3368
  // Under a large title the screen runs edge to edge, as UIKit's own
3358
3369
  // screens do: the scroll view starts under the bar and insets its
3359
3370
  // content by it, so the title collapses and pull to refresh draws
3360
- // in the bar's space. Other screens stay inside the safe area.
3361
- let edgeToEdge = scroll != nil && prefersLargeTitle == true
3371
+ // in the bar's space. So does a screen that starts with its scroll
3372
+ // view: its content scrolls up under the bar behind iOS's scroll edge
3373
+ // effect, rather than over the bar's back button. Other screens stay
3374
+ // inside the safe area.
3375
+ let edgeToEdge = scroll != nil && (prefersLargeTitle == true || scroll === leading(renderedRoot))
3362
3376
  if rootTopToView?.isActive != edgeToEdge {
3363
3377
  rootTopToSafeArea?.isActive = !edgeToEdge
3364
3378
  rootTopToView?.isActive = edgeToEdge
@@ -4931,13 +4945,12 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
4931
4945
  height: number(shadowOffset?["height"]) ?? (elevation * 0.25)
4932
4946
  )
4933
4947
  // A label paints its background inside its own bounds, so a rounded
4934
- // chip of text clips to its corners. A scroll view clips its content
4935
- // unless told `overflow: visible`, as UIKit's and React Native's do:
4936
- // unclipped, a screen's content scrolled up over its bar's back
4937
- // button and down into the home indicator.
4938
- let overflow = style["overflow"] as? String
4939
- view.clipsToBounds = overflow == "hidden"
4940
- || (view is UIScrollView && overflow != "visible")
4948
+ // chip of text clips to its corners.
4949
+ // A scroll view does not clip either: its content runs on under the
4950
+ // floating tab bar and the home indicator, as iOS 26's own screens'
4951
+ // does. At the top, a screen that starts with one runs edge to edge
4952
+ // (trackContentScrollView), so nothing scrolls over the bar.
4953
+ view.clipsToBounds = style["overflow"] as? String == "hidden"
4941
4954
  || (view is UILabel && (view.craftRequestedCornerRadius ?? 0) > 0)
4942
4955
  view.layer.masksToBounds = view.clipsToBounds
4943
4956
  view.craftLayoutStyle = CraftNativeLayoutStyle(style)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "craft-native",
3
- "version": "0.0.167",
3
+ "version": "0.0.168",
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>",