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 +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/ios/templates/CraftApp.swift +5 -3
- package/dist/ios/templates/CraftHybrid.swift +10 -6
- package/package.json +1 -1
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.
|
|
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
package/dist/index.js
CHANGED
|
@@ -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 !=
|
|
802
|
-
|
|
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
|
|
1675
|
-
|
|
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
|
}
|