craft-native 0.0.216 → 0.0.217

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
@@ -3424,7 +3424,7 @@ function pinCraftNativeDependency(packagePath, craftVersion) {
3424
3424
  `);
3425
3425
  }
3426
3426
  // package.json
3427
- var version = "0.0.216";
3427
+ var version = "0.0.217";
3428
3428
 
3429
3429
  // bin/cli.ts
3430
3430
  var spawnedFrom = process6.env[CRAFT_CLI_SPAWN_MARKER];
package/dist/index.cjs CHANGED
@@ -309,7 +309,7 @@ function craftBinaryNotFoundMessage(triedPath) {
309
309
  `);
310
310
  }
311
311
  // package.json
312
- var version = "0.0.216";
312
+ var version = "0.0.217";
313
313
 
314
314
  // src/sdk-version.ts
315
315
  var SDK_VERSION = version;
package/dist/index.js CHANGED
@@ -57,7 +57,7 @@ function craftBinaryNotFoundMessage(triedPath) {
57
57
  `);
58
58
  }
59
59
  // package.json
60
- var version = "0.0.216";
60
+ var version = "0.0.217";
61
61
 
62
62
  // src/sdk-version.ts
63
63
  var SDK_VERSION = version;
@@ -797,9 +797,11 @@ final class CraftChrome: ObservableObject {
797
797
 
798
798
  /// Move the tab indicator with an in-flight native-stack swipe. The
799
799
  /// controller commits or restores this preview when the finger lifts.
800
- func beginTabSwipe(to id: String) {
801
- guard id != selected, tabs.contains(where: { $0.id == id }) else { return }
802
- tabSwipePrevious = selected
800
+ func beginTabSwipe(to id: String, from previous: String) {
801
+ guard id != previous, tabs.contains(where: { $0.id == id }) else { return }
802
+ // A page's pending selection report may disagree with the native
803
+ // stack. Cancellation belongs to the stack the finger left.
804
+ tabSwipePrevious = previous
803
805
  withAnimation(nil) { selected = id }
804
806
  }
805
807
 
@@ -1203,7 +1203,7 @@ final class CraftHybridController: UIViewController, UINavigationControllerDeleg
1203
1203
  tabSwipeFrom = -direction * width
1204
1204
  target.view.frame = view.bounds.offsetBy(dx: tabSwipeFrom, dy: 0)
1205
1205
  view.bringSubviewToFront(target.view)
1206
- CraftChrome.shared.beginTabSwipe(to: id)
1206
+ CraftChrome.shared.beginTabSwipe(to: id, from: currentTab)
1207
1207
  return true
1208
1208
  }
1209
1209
 
@@ -1668,12 +1668,16 @@ final class CraftHybridController: UIViewController, UINavigationControllerDeleg
1668
1668
  /// tab's root: over a native screen, or on an entry the shell pushed
1669
1669
  /// there, the page cannot know which tab it is in (a workout page
1670
1670
  /// loaded on its own lights Calendar, though Today opened it). The bar
1671
- /// then keeps the tab that is on screen.
1671
+ /// then keeps the tab that is on screen, or the finger's active preview.
1672
1672
  func pageSelectedTab(_ id: String) {
1673
- guard id != currentTab, pendingTab?.id != id else { return }
1674
- guard let top = visibleStack?.topViewController as? CraftHybridWebSlot, top.isTabRoot else {
1675
- let shown = currentTab
1676
- DispatchQueue.main.async {
1673
+ guard id != (activeTabSwipeTarget ?? currentTab), pendingTab?.id != id else { return }
1674
+ guard activeTabSwipeTarget == nil,
1675
+ let top = visibleStack?.topViewController as? CraftHybridWebSlot, top.isTabRoot else {
1676
+ DispatchQueue.main.async { [weak self] in
1677
+ guard let self, self.hybrid.controller === self else { return }
1678
+ // Resolve ownership when the correction runs: a newer tap
1679
+ // or swipe may have arrived while a native root was mounting.
1680
+ let shown = self.activeTabSwipeTarget ?? self.currentTab
1677
1681
  guard CraftChrome.shared.selected != shown else { return }
1678
1682
  CraftChrome.shared.selected = shown
1679
1683
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "craft-native",
3
- "version": "0.0.216",
3
+ "version": "0.0.217",
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>",