craft-native 0.0.179 → 0.0.180
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/CraftNativeScreen.swift +22 -3
- package/package.json +1 -1
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.
|
|
3306
|
+
var version = "0.0.180";
|
|
3307
3307
|
|
|
3308
3308
|
// bin/cli.ts
|
|
3309
3309
|
var spawnedFrom = process6.env[CRAFT_CLI_SPAWN_MARKER];
|
package/dist/index.cjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -1306,11 +1306,20 @@ private class CraftNativeFlowView: UIStackView {
|
|
|
1306
1306
|
|
|
1307
1307
|
override func insertArrangedSubview(_ view: UIView, at stackIndex: Int) {
|
|
1308
1308
|
flowChildren.removeAll { $0 === view }
|
|
1309
|
-
|
|
1309
|
+
let index = min(max(0, stackIndex), flowChildren.count)
|
|
1310
|
+
flowChildren.insert(view, at: index)
|
|
1310
1311
|
if view.superview !== self {
|
|
1311
1312
|
view.removeFromSuperview()
|
|
1312
1313
|
addSubview(view)
|
|
1313
1314
|
}
|
|
1315
|
+
// Stacking follows the tree, as on the web: a later sibling draws and
|
|
1316
|
+
// takes touches above an earlier one. Appending a child inserted
|
|
1317
|
+
// before its siblings put it on top of all of them, so a ScrollView
|
|
1318
|
+
// re-created under a floating button (absolute, after it) took the
|
|
1319
|
+
// button's taps for whatever lay beneath while the button still drew.
|
|
1320
|
+
if let next = flowChildren[(index + 1)...].first(where: { $0.superview === self }) {
|
|
1321
|
+
insertSubview(view, belowSubview: next)
|
|
1322
|
+
}
|
|
1314
1323
|
view.translatesAutoresizingMaskIntoConstraints = true
|
|
1315
1324
|
invalidateMeasurements()
|
|
1316
1325
|
}
|
|
@@ -3963,6 +3972,16 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
|
|
|
3963
3972
|
// it follows light, dark and Increase Contrast by itself.
|
|
3964
3973
|
let surface = Self.floatingSurface(diameter: 44)
|
|
3965
3974
|
button.addSubview(surface)
|
|
3975
|
+
// Pinned to the button rather than resized with it: the button starts
|
|
3976
|
+
// at zero size, so a 44-point surface that grew with its superview
|
|
3977
|
+
// came out 88 points, a rounded card twice the button's size that
|
|
3978
|
+
// spilled off the bar's edge and covered its neighbour.
|
|
3979
|
+
NSLayoutConstraint.activate([
|
|
3980
|
+
surface.leadingAnchor.constraint(equalTo: button.leadingAnchor),
|
|
3981
|
+
surface.trailingAnchor.constraint(equalTo: button.trailingAnchor),
|
|
3982
|
+
surface.topAnchor.constraint(equalTo: button.topAnchor),
|
|
3983
|
+
surface.bottomAnchor.constraint(equalTo: button.bottomAnchor),
|
|
3984
|
+
])
|
|
3966
3985
|
// Glass lifts itself off the content; the material needs the tab
|
|
3967
3986
|
// bar's shadow to.
|
|
3968
3987
|
if surface.effect is UIBlurEffect {
|
|
@@ -4043,8 +4062,8 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
|
|
|
4043
4062
|
effect = UIBlurEffect(style: .systemUltraThinMaterial)
|
|
4044
4063
|
#endif
|
|
4045
4064
|
let surface = UIVisualEffectView(effect: effect)
|
|
4046
|
-
|
|
4047
|
-
surface.
|
|
4065
|
+
// The caller pins it to its button; it is exactly `diameter` across.
|
|
4066
|
+
surface.translatesAutoresizingMaskIntoConstraints = false
|
|
4048
4067
|
surface.isUserInteractionEnabled = false
|
|
4049
4068
|
surface.layer.cornerRadius = diameter / 2
|
|
4050
4069
|
surface.layer.cornerCurve = .circular
|