bare-native 0.1.1 → 0.1.2

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/README.md CHANGED
@@ -12,8 +12,6 @@ npm i bare-native
12
12
  const { Window } = require('bare-native')
13
13
 
14
14
  const window = new Window(400, 250)
15
-
16
- window.show()
17
15
  ```
18
16
 
19
17
  <https://github.com/holepunchto/bare-build> is used to package your application code alongside a Bare runtime suitable for the target platform. Either install the tool globally or as a development dependency of your project:
@@ -12,10 +12,6 @@ module.exports = class NativeWindow extends EventEmitter {
12
12
  return this._native
13
13
  }
14
14
 
15
- show() {
16
- return this
17
- }
18
-
19
15
  content(view) {
20
16
  this._native.contentView(view._native)
21
17
  return this
@@ -17,18 +17,13 @@ module.exports = class NativeWindow extends EventEmitter {
17
17
  styleMask: DEFAULT_STYLE_MASK
18
18
  })
19
19
 
20
- this._native.center()
20
+ this._native.makeKeyWindow().orderFront().center()
21
21
  }
22
22
 
23
23
  get native() {
24
24
  return this._native
25
25
  }
26
26
 
27
- show() {
28
- this._native.makeKeyWindow().orderFront()
29
- return this
30
- }
31
-
32
27
  content(view) {
33
28
  this._native.contentView = view._native
34
29
  return this
@@ -0,0 +1,31 @@
1
+ const EventEmitter = require('bare-events')
2
+ const UIKit = require('bare-ui-kit')
3
+
4
+ module.exports = class NativeWindow extends EventEmitter {
5
+ constructor() {
6
+ super()
7
+
8
+ this._native = new UIKit.Window()
9
+
10
+ this._native.hidden = false
11
+ this._native.makeKeyWindow()
12
+ }
13
+
14
+ get native() {
15
+ return this._native
16
+ }
17
+
18
+ content(view) {
19
+ const viewController = new UIKit.ViewController()
20
+ viewController.view = view._native
21
+
22
+ this._native.rootViewController = viewController
23
+ return this
24
+ }
25
+
26
+ [Symbol.for('bare.inspect')]() {
27
+ return {
28
+ __proto__: { constructor: NativeWindow }
29
+ }
30
+ }
31
+ }
@@ -7,6 +7,7 @@ module.exports = class NativeWindow extends EventEmitter {
7
7
 
8
8
  this._native = new GTK.Window()
9
9
 
10
+ this._native.visible = true
10
11
  this._native.defaultSize = [width, height]
11
12
  }
12
13
 
@@ -14,11 +15,6 @@ module.exports = class NativeWindow extends EventEmitter {
14
15
  return this._native
15
16
  }
16
17
 
17
- show() {
18
- this._native.visible = true
19
- return this
20
- }
21
-
22
18
  content(view) {
23
19
  this._native.child = view._native
24
20
  return this
@@ -7,18 +7,13 @@ module.exports = class NativeWindow extends EventEmitter {
7
7
 
8
8
  this._native = new WinUI.Window()
9
9
 
10
- this._native.resize(width, height)
10
+ this._native.resize(width, height).activate()
11
11
  }
12
12
 
13
13
  get native() {
14
14
  return this._native
15
15
  }
16
16
 
17
- show() {
18
- this._native.activate()
19
- return this
20
- }
21
-
22
17
  content(view) {
23
18
  this._native.content = view._native
24
19
  return this
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-native",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Native application development framework for Bare",
5
5
  "exports": {
6
6
  "./package": "./package.json",
@@ -10,6 +10,7 @@
10
10
  "imports": {
11
11
  "#window": {
12
12
  "darwin": "./lib/window/darwin.js",
13
+ "ios": "./lib/window/ios.js",
13
14
  "linux": "./lib/window/linux.js",
14
15
  "android": "./lib/window/android.js",
15
16
  "win32": "./lib/window/win32.js"
@@ -45,7 +46,7 @@
45
46
  "bare-events": "^2.8.2",
46
47
  "bare-gtk": "^0.1.0",
47
48
  "bare-ndk": "^0.1.2",
48
- "bare-ui-kit": "^0.1.0",
49
+ "bare-ui-kit": "^0.1.1",
49
50
  "bare-web-kit": "^0.1.0",
50
51
  "bare-web-kit-gtk": "^0.1.0",
51
52
  "bare-win-ui": "^0.1.0"