craft-native 0.0.167 → 0.0.169
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/android/src/index.d.ts +62 -0
- package/dist/android/src/index.js +138 -18
- package/dist/android/templates/CraftNativeBackground.kt.template +296 -0
- package/dist/android/templates/CraftNativeCapabilities.kt.template +59 -37
- package/dist/android/templates/CraftNativeHealth.kt.template +1046 -0
- package/dist/android/templates/CraftNativeHealthStub.kt.template +32 -0
- package/dist/android/templates/CraftNativeMessagingService.kt.template +75 -0
- package/dist/android/templates/CraftNativeMutation.kt.template +14 -2
- package/dist/android/templates/CraftNativeServices.kt.template +561 -0
- package/dist/android/templates/CraftNativeShell.kt.template +1013 -0
- package/dist/android/templates/LocationRecordingService.kt.template +7 -0
- package/dist/android/templates/MainActivityNative.kt.template +738 -132
- package/dist/android/templates/build.gradle.kts.app.template +16 -0
- 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 -9
- package/package.json +1 -1
|
@@ -18,8 +18,24 @@ android {
|
|
|
18
18
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
// Release signing from the environment (the upload key Google Play
|
|
22
|
+
// expects; Play App Signing re-signs for devices). Without
|
|
23
|
+
// CRAFT_ANDROID_KEYSTORE a release build is unsigned.
|
|
24
|
+
val releaseKeystore = System.getenv("CRAFT_ANDROID_KEYSTORE")?.takeIf { it.isNotBlank() }
|
|
25
|
+
signingConfigs {
|
|
26
|
+
if (releaseKeystore != null) {
|
|
27
|
+
create("release") {
|
|
28
|
+
storeFile = file(releaseKeystore)
|
|
29
|
+
storePassword = System.getenv("CRAFT_ANDROID_KEYSTORE_PASSWORD")
|
|
30
|
+
keyAlias = System.getenv("CRAFT_ANDROID_KEY_ALIAS")
|
|
31
|
+
keyPassword = System.getenv("CRAFT_ANDROID_KEY_PASSWORD") ?: System.getenv("CRAFT_ANDROID_KEYSTORE_PASSWORD")
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
21
36
|
buildTypes {
|
|
22
37
|
release {
|
|
38
|
+
if (releaseKeystore != null) signingConfig = signingConfigs.getByName("release")
|
|
23
39
|
isMinifyEnabled = true
|
|
24
40
|
isShrinkResources = true
|
|
25
41
|
proguardFiles(
|
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.169";
|
|
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
|
@@ -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.
|
|
3361
|
-
|
|
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.
|
|
4935
|
-
//
|
|
4936
|
-
//
|
|
4937
|
-
//
|
|
4938
|
-
|
|
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)
|