craft-native 0.0.161 → 0.0.162
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/templates/MainActivityNative.kt.template +9 -0
- package/dist/cli.js +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/ios/src/index.d.ts +9 -0
- package/dist/ios/src/index.js +2 -0
- package/dist/ios/templates/CraftNativeScreen.swift +4 -0
- package/package.json +1 -1
|
@@ -653,6 +653,7 @@ private class CraftNativeFlexLayout(context: Context) : LinearLayout(context) {
|
|
|
653
653
|
"space-between" -> 3
|
|
654
654
|
"space-around" -> 4
|
|
655
655
|
"stretch" -> 5
|
|
656
|
+
"space-evenly" -> 6
|
|
656
657
|
else -> 0
|
|
657
658
|
}
|
|
658
659
|
|
|
@@ -803,6 +804,10 @@ private class CraftNativeFlexLayout(context: Context) : LinearLayout(context) {
|
|
|
803
804
|
rowLeading = freeRows / (rowCount * 2)
|
|
804
805
|
rowBetween += freeRows / rowCount
|
|
805
806
|
}
|
|
807
|
+
6 -> {
|
|
808
|
+
rowLeading = freeRows / (rowCount + 1)
|
|
809
|
+
rowBetween += freeRows / (rowCount + 1)
|
|
810
|
+
}
|
|
806
811
|
5 -> rowExtra = freeRows / rowCount
|
|
807
812
|
}
|
|
808
813
|
var rowTop = paddingTop + rowLeading
|
|
@@ -871,6 +876,10 @@ private class CraftNativeFlexLayout(context: Context) : LinearLayout(context) {
|
|
|
871
876
|
crossBetween = crossFree / lines.size + crossGap
|
|
872
877
|
crossLeading = crossFree / (lines.size * 2)
|
|
873
878
|
}
|
|
879
|
+
"space-evenly" -> {
|
|
880
|
+
crossBetween = crossFree / (lines.size + 1) + crossGap
|
|
881
|
+
crossLeading = crossFree / (lines.size + 1)
|
|
882
|
+
}
|
|
874
883
|
"stretch" -> {
|
|
875
884
|
val extra = crossFree / lines.size
|
|
876
885
|
lines.forEach { it.cross += extra }
|
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.162";
|
|
3307
3307
|
|
|
3308
3308
|
// bin/cli.ts
|
|
3309
3309
|
var spawnedFrom = process6.env[CRAFT_CLI_SPAWN_MARKER];
|
|
@@ -45,7 +45,7 @@ export interface FlexStyle {
|
|
|
45
45
|
/** Align self (override parent alignItems) */
|
|
46
46
|
alignSelf?: 'auto' | 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
|
|
47
47
|
/** Align content (multi-line) */
|
|
48
|
-
alignContent?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'space-between' | 'space-around';
|
|
48
|
+
alignContent?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'space-between' | 'space-around' | 'space-evenly';
|
|
49
49
|
/** Gap between items */
|
|
50
50
|
gap?: number;
|
|
51
51
|
/** Row gap */
|
package/dist/index.cjs
CHANGED
package/dist/index.js
CHANGED
package/dist/ios/src/index.d.ts
CHANGED
|
@@ -79,6 +79,15 @@ export interface CraftConfig {
|
|
|
79
79
|
* time the page scans or connects.
|
|
80
80
|
*/
|
|
81
81
|
enableHeartRate?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Keep playing sound with the screen locked or the app in the background:
|
|
84
|
+
* a sleep soundscape, a meditation timer's ambience. Adds the `audio`
|
|
85
|
+
* background mode. iOS keeps the app running only while it plays, and App
|
|
86
|
+
* Review expects audible content, so turn it on only for an app that plays
|
|
87
|
+
* some (Web Audio on native screens and in the web view, which use the
|
|
88
|
+
* playback session).
|
|
89
|
+
*/
|
|
90
|
+
enableBackgroundAudio?: boolean;
|
|
82
91
|
/**
|
|
83
92
|
* Purpose strings in the app's own words, by Info.plist key
|
|
84
93
|
* (`{ NSAppleMusicUsageDescription: 'Shows the song playing during a workout.' }`).
|
package/dist/ios/src/index.js
CHANGED
|
@@ -490,6 +490,8 @@ function renderBackgroundModes(config) {
|
|
|
490
490
|
modes.add("remote-notification");
|
|
491
491
|
if (config.enableHeartRate)
|
|
492
492
|
modes.add("bluetooth-central");
|
|
493
|
+
if (config.enableBackgroundAudio)
|
|
494
|
+
modes.add("audio");
|
|
493
495
|
if (!modes.size)
|
|
494
496
|
return "";
|
|
495
497
|
return ` <key>UIBackgroundModes</key>
|
|
@@ -263,6 +263,7 @@ private func craftNativeAlignContentCode(_ value: String) -> UInt32 {
|
|
|
263
263
|
case "space-between": return 3
|
|
264
264
|
case "space-around": return 4
|
|
265
265
|
case "stretch": return 5
|
|
266
|
+
case "space-evenly": return 6
|
|
266
267
|
default: return 0
|
|
267
268
|
}
|
|
268
269
|
}
|
|
@@ -1203,6 +1204,9 @@ private class CraftNativeFlowView: UIStackView {
|
|
|
1203
1204
|
case "space-around":
|
|
1204
1205
|
crossBetween = free / CGFloat(lineCrosses.count) + crossGap
|
|
1205
1206
|
crossLeading = free / CGFloat(lineCrosses.count * 2)
|
|
1207
|
+
case "space-evenly":
|
|
1208
|
+
crossBetween = free / CGFloat(lineCrosses.count + 1) + crossGap
|
|
1209
|
+
crossLeading = free / CGFloat(lineCrosses.count + 1)
|
|
1206
1210
|
case "stretch":
|
|
1207
1211
|
let extra = free / CGFloat(lineCrosses.count)
|
|
1208
1212
|
lineCrosses = lineCrosses.map { $0 + extra }
|