craft-native 0.0.232 → 0.0.234

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.
@@ -4563,12 +4563,34 @@ class MainActivity : AppCompatActivity() {
4563
4563
  }
4564
4564
 
4565
4565
  /** Applies a screen-specific background, falling back to the dynamic app colour. */
4566
+ @Suppress("DEPRECATION")
4566
4567
  private fun applyScreenBackground(screen: Screen) {
4567
4568
  val configured = screen.options.opt("backgroundColor")
4568
4569
  ?.takeUnless { it == JSONObject.NULL }
4569
4570
  ?.let { craftNativeOptionalString(it) }
4570
4571
  ?.let { runCatching { craftNativeColor(it) }.getOrNull() }
4571
- screen.view.setBackgroundColor(configured ?: ContextCompat.getColor(this, R.color.background))
4572
+ val background = configured ?: ContextCompat.getColor(this, R.color.background)
4573
+ screen.view.setBackgroundColor(background)
4574
+ // The root also paints the window-inset padding above/below the
4575
+ // screen. Retained screens still receive options and theme updates;
4576
+ // only the visible one may change the colour behind system bars.
4577
+ if (visibleScreen === screen) {
4578
+ root.setBackgroundColor(background)
4579
+ WindowCompat.getInsetsController(window, window.decorView)
4580
+ .isAppearanceLightNavigationBars = Color.luminance(background) >= 0.5f
4581
+ // Android 15+ draws the root behind transparent system bars.
4582
+ // Older releases still paint separate window bar surfaces.
4583
+ if (Build.VERSION.SDK_INT < 35) {
4584
+ window.statusBarColor = background
4585
+ window.navigationBarColor = background
4586
+ } else {
4587
+ // Android 15 still overlays a three-button scrim by
4588
+ // default. The root already paints this inset and the
4589
+ // glyph appearance above follows its actual luminance.
4590
+ window.navigationBarColor = Color.TRANSPARENT
4591
+ window.isNavigationBarContrastEnforced = false
4592
+ }
4593
+ }
4572
4594
  }
4573
4595
 
4574
4596
  /** Refresh controls use a contrasting system tint when no color is authored. */
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.232";
3427
+ var version = "0.0.234";
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.232";
312
+ var version = "0.0.234";
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.232";
60
+ var version = "0.0.234";
61
61
 
62
62
  // src/sdk-version.ts
63
63
  var SDK_VERSION = version;
@@ -503,7 +503,10 @@ export declare function installRuntime(output: string, runtimeDir: string): Prom
503
503
  * valid Swift type.
504
504
  */
505
505
  export declare function productName(name: string): string;
506
- /** Restore package-owned Swift into an existing project, without changing its Xcode metadata or bundled screens. */
506
+ /** Restore package-owned Swift, retaining Xcode metadata and bundled screens.
507
+ * Xcode Cloud assigns the distributed build number independently of the source
508
+ * config; keep the packaged runtime identity in step with Apple's build.
509
+ */
507
510
  export declare function restoreShell(output: string): void;
508
511
  export { assertNoApplicationSwiftSources, findApplicationSwiftSources } from './source-audit.js';
509
512
  export declare function init(options: InitOptions): Promise<void>;
@@ -1057,8 +1057,17 @@ function productName(name) {
1057
1057
  return /^\d/.test(joined) ? `App${joined}` : joined;
1058
1058
  }
1059
1059
  function restoreShell(output) {
1060
- const config = JSON.parse(readFileSync2(join3(output, "craft.config.json"), "utf8"));
1060
+ const file = join3(output, "craft.config.json");
1061
+ const config = JSON.parse(readFileSync2(file, "utf8"));
1062
+ const cloudBuild = process.env.CI_BUILD_NUMBER;
1063
+ if (cloudBuild !== undefined) {
1064
+ if (!/^[1-9]\d*$/.test(cloudBuild) || cloudBuild.trim() !== cloudBuild)
1065
+ throw new Error("CI_BUILD_NUMBER must be a positive integer");
1066
+ config.buildNumber = cloudBuild;
1067
+ }
1061
1068
  writeShell(output, config);
1069
+ if (cloudBuild !== undefined)
1070
+ writeFileSync2(file, JSON.stringify(config, null, 2));
1062
1071
  }
1063
1072
  function writeShell(output, config) {
1064
1073
  if (!config.appName || !/^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/.test(config.bundleId))
@@ -7454,7 +7454,6 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
7454
7454
  var traits: UIAccessibilityTraits = []
7455
7455
  switch type {
7456
7456
  case "Slider", "Picker", "DatePicker": traits.insert(.adjustable)
7457
- case "Switch": traits.insert(.button)
7458
7457
  default: break
7459
7458
  }
7460
7459
  switch role ?? type.lowercased() {
@@ -7496,7 +7495,10 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
7496
7495
  // that is what UI tests and VoiceOver read focus from. Setting them
7497
7496
  // froze them, so it read as static text that never had focus ("neither
7498
7497
  // element nor any descendant has keyboard focus"); it keeps its own.
7499
- if view is UITextView { return }
7498
+ // UISwitch also owns its native identity and enabled/on state.
7499
+ // Assigning .button changes its legacy AX type into a button while
7500
+ // modern XCTest still identifies its UIKit class as a switch.
7501
+ if view is UITextView || view is UISwitch { return }
7500
7502
  view.accessibilityTraits = traits
7501
7503
  }
7502
7504
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "craft-native",
3
- "version": "0.0.232",
3
+ "version": "0.0.234",
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>",