@thelacanians/vue-native-cli 0.4.9 → 0.4.11

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 CHANGED
@@ -10,7 +10,7 @@ import { join, dirname } from "path";
10
10
  import { fileURLToPath } from "url";
11
11
  import { existsSync } from "fs";
12
12
  import pc from "picocolors";
13
- var VERSION = "0.4.9";
13
+ var VERSION = "0.4.11";
14
14
  var createCommand = new Command("create").description("Create a new Vue Native project").argument("<name>", "project name").option("-t, --template <template>", "project template (blank, tabs, drawer)", "blank").action(async (name, options) => {
15
15
  const template = options.template;
16
16
  if (!["blank", "tabs", "drawer"].includes(template)) {
@@ -95,7 +95,7 @@ afterEvaluate {
95
95
  create<MavenPublication>("release") {
96
96
  groupId = "com.vuenative"
97
97
  artifactId = "core"
98
- version = "0.4.9"
98
+ version = "0.4.11"
99
99
  from(components["release"])
100
100
  }
101
101
  }
@@ -352,7 +352,7 @@ public final class NativeBridge {
352
352
  if let factory = ComponentRegistry.factory(for: parentView) {
353
353
  factory.insertChild(childView, into: container, before: nil)
354
354
  } else {
355
- container.addSubview(childView)
355
+ container.flex.addItem(childView)
356
356
  }
357
357
  }
358
358
 
@@ -385,9 +385,10 @@ public final class NativeBridge {
385
385
  if let factory = ComponentRegistry.factory(for: parentView) {
386
386
  factory.insertChild(childView, into: container, before: beforeView)
387
387
  } else if let index = container.subviews.firstIndex(of: beforeView) {
388
+ container.flex.addItem(childView)
388
389
  container.insertSubview(childView, at: index)
389
390
  } else {
390
- container.addSubview(childView)
391
+ container.flex.addItem(childView)
391
392
  }
392
393
  }
393
394
 
@@ -45,9 +45,11 @@ final class SafeAreaView: UIView {
45
45
  }
46
46
  }
47
47
 
48
+ /// Walk up to the topmost Yoga-managed view (__ROOT__), stopping before
49
+ /// we reach vc.view or UIWindow which are NOT part of the Yoga tree.
48
50
  private func findFlexRoot() -> UIView? {
49
51
  var v: UIView? = self
50
- while let parent = v?.superview {
52
+ while let parent = v?.superview, parent.isFlexEnabled {
51
53
  v = parent
52
54
  }
53
55
  return v
@@ -1,5 +1,6 @@
1
1
  #if canImport(UIKit)
2
2
  import UIKit
3
+ import FlexLayout
3
4
 
4
5
  /// Protocol that all native component factories must implement.
5
6
  /// Each factory knows how to create a UIView, update its properties,
@@ -40,9 +41,11 @@ extension NativeComponentFactory {
40
41
 
41
42
  func insertChild(_ child: UIView, into parent: UIView, before anchor: UIView?) {
42
43
  if let anchor = anchor, let idx = parent.subviews.firstIndex(of: anchor) {
44
+ parent.flex.addItem(child)
45
+ // Move to correct position after adding
43
46
  parent.insertSubview(child, at: idx)
44
47
  } else {
45
- parent.addSubview(child)
48
+ parent.flex.addItem(child)
46
49
  }
47
50
  }
48
51
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thelacanians/vue-native-cli",
3
- "version": "0.4.9",
3
+ "version": "0.4.11",
4
4
  "description": "CLI for creating and running Vue Native apps",
5
5
  "license": "MIT",
6
6
  "author": "Vue Native Contributors",