bare-ui-kit 0.2.0 → 0.3.0
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/CMakeLists.txt +7 -1
- package/README.md +42 -1
- package/binding.m +558 -2
- package/index.d.ts +41 -0
- package/index.js +16 -0
- package/lib/activity-indicator-view.d.ts +29 -0
- package/lib/activity-indicator-view.h +181 -0
- package/lib/activity-indicator-view.js +56 -0
- package/lib/alert-action.d.ts +33 -0
- package/lib/alert-action.js +48 -0
- package/lib/alert-controller.d.ts +20 -0
- package/lib/alert-controller.h +199 -0
- package/lib/alert-controller.js +33 -0
- package/lib/attributed-string.d.ts +45 -0
- package/lib/attributed-string.h +176 -0
- package/lib/attributed-string.js +51 -0
- package/lib/attributes.js +34 -0
- package/lib/bezier-path.d.ts +26 -0
- package/lib/bezier-path.h +145 -0
- package/lib/bezier-path.js +51 -0
- package/lib/bridging.h +600 -2
- package/lib/color.d.ts +86 -0
- package/lib/color.h +286 -0
- package/lib/color.js +170 -0
- package/lib/events.js +35 -0
- package/lib/font-descriptor.d.ts +30 -0
- package/lib/font-descriptor.h +96 -0
- package/lib/font-descriptor.js +47 -0
- package/lib/font-metrics.d.ts +38 -0
- package/lib/font-metrics.h +109 -0
- package/lib/font-metrics.js +58 -0
- package/lib/font.d.ts +59 -0
- package/lib/font.h +424 -0
- package/lib/font.js +100 -0
- package/lib/handle.d.ts +5 -0
- package/lib/handle.js +6 -0
- package/lib/image-view.d.ts +15 -0
- package/lib/image-view.h +75 -0
- package/lib/image-view.js +27 -0
- package/lib/image.d.ts +37 -0
- package/lib/image.h +205 -0
- package/lib/image.js +60 -0
- package/lib/label.d.ts +51 -0
- package/lib/label.h +331 -0
- package/lib/label.js +94 -0
- package/lib/paragraph-style.d.ts +20 -0
- package/lib/paragraph-style.h +94 -0
- package/lib/paragraph-style.js +42 -0
- package/lib/pasteboard.d.ts +31 -0
- package/lib/pasteboard.h +123 -0
- package/lib/pasteboard.js +63 -0
- package/lib/retain.js +12 -0
- package/lib/runtime.m +92 -15
- package/lib/scene.d.ts +30 -0
- package/lib/scene.h +87 -0
- package/lib/scene.js +48 -0
- package/lib/scratch.js +4 -0
- package/lib/screen.d.ts +26 -0
- package/lib/screen.h +194 -0
- package/lib/screen.js +52 -0
- package/lib/scroll-view.d.ts +39 -0
- package/lib/scroll-view.h +246 -0
- package/lib/scroll-view.js +64 -0
- package/lib/switch.d.ts +22 -0
- package/lib/switch.h +166 -0
- package/lib/switch.js +42 -0
- package/lib/text-field.d.ts +103 -0
- package/lib/text-field.h +562 -0
- package/lib/text-field.js +183 -0
- package/lib/text-view.d.ts +59 -0
- package/lib/text-view.h +497 -0
- package/lib/text-view.js +138 -0
- package/lib/view-controller.d.ts +37 -0
- package/lib/view-controller.h +108 -20
- package/lib/view-controller.js +50 -5
- package/lib/view.d.ts +158 -0
- package/lib/view.h +1385 -20
- package/lib/view.js +276 -7
- package/lib/window.d.ts +44 -0
- package/lib/window.h +167 -27
- package/lib/window.js +62 -9
- package/lib/wrap.js +7 -0
- package/package.json +12 -3
- package/prebuilds/ios-arm64/bare +0 -0
- package/prebuilds/ios-arm64/bare-ui-kit.bare +0 -0
- package/prebuilds/ios-arm64-simulator/bare +0 -0
- package/prebuilds/ios-arm64-simulator/bare-ui-kit.bare +0 -0
- package/prebuilds/ios-x64-simulator/bare +0 -0
- package/prebuilds/ios-x64-simulator/bare-ui-kit.bare +0 -0
package/lib/window.js
CHANGED
|
@@ -1,28 +1,77 @@
|
|
|
1
1
|
const binding = require('../binding')
|
|
2
|
+
const { adopt } = require('./handle')
|
|
3
|
+
const retain = require('./retain')
|
|
2
4
|
const UIKitView = require('./view')
|
|
5
|
+
const UIKitScene = require('./scene')
|
|
3
6
|
const UIKitViewController = require('./view-controller')
|
|
4
7
|
|
|
8
|
+
// Windows made key are kept here, because UIKit would otherwise be their only
|
|
9
|
+
// owner.
|
|
10
|
+
const key = new Set()
|
|
11
|
+
|
|
5
12
|
module.exports = exports = class UIKitWindow extends UIKitView {
|
|
6
|
-
constructor() {
|
|
7
|
-
super()
|
|
13
|
+
constructor(opts = {}) {
|
|
14
|
+
super(opts)
|
|
8
15
|
|
|
9
|
-
this.
|
|
16
|
+
this._rootViewController = null
|
|
17
|
+
this._windowScene = null
|
|
10
18
|
}
|
|
11
19
|
|
|
12
|
-
|
|
13
|
-
|
|
20
|
+
_onkeyboardwillchangeframe(x, y, width, height) {
|
|
21
|
+
this.emit('keyboardWillChangeFrame', { x, y, width, height })
|
|
22
|
+
}
|
|
14
23
|
|
|
15
|
-
|
|
24
|
+
_init(opts) {
|
|
25
|
+
const { scene = null, x, y, width, height } = opts
|
|
16
26
|
|
|
17
|
-
|
|
27
|
+
const framed = x !== undefined || y !== undefined || width !== undefined || height !== undefined
|
|
28
|
+
|
|
29
|
+
return binding.windowInit(
|
|
30
|
+
scene === null ? null : adopt(scene),
|
|
31
|
+
framed ? (x ?? 0) : null,
|
|
32
|
+
framed ? (y ?? 0) : null,
|
|
33
|
+
framed ? (width ?? 0) : null,
|
|
34
|
+
framed ? (height ?? 0) : null,
|
|
35
|
+
this
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get rootViewController() {
|
|
40
|
+
return retain(
|
|
41
|
+
this,
|
|
42
|
+
'_rootViewController',
|
|
43
|
+
UIKitViewController,
|
|
44
|
+
binding.windowRootViewController(this._tag)
|
|
45
|
+
)
|
|
18
46
|
}
|
|
19
47
|
|
|
20
48
|
set rootViewController(viewController) {
|
|
21
|
-
binding.windowRootViewController(this.
|
|
49
|
+
binding.windowRootViewController(this._tag, adopt(viewController))
|
|
50
|
+
this._rootViewController = viewController
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get windowScene() {
|
|
54
|
+
return retain(this, '_windowScene', UIKitScene, binding.windowWindowScene(this._tag))
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
set windowScene(windowScene) {
|
|
58
|
+
binding.windowWindowScene(this._tag, adopt(windowScene))
|
|
59
|
+
this._windowScene = windowScene
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
get keyWindow() {
|
|
63
|
+
return binding.windowKeyWindow(this._tag)
|
|
22
64
|
}
|
|
23
65
|
|
|
24
66
|
makeKeyWindow() {
|
|
25
|
-
binding.windowMakeKeyWindow(this.
|
|
67
|
+
binding.windowMakeKeyWindow(this._tag)
|
|
68
|
+
key.add(this)
|
|
69
|
+
return this
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
makeKeyAndVisible() {
|
|
73
|
+
binding.windowMakeKeyAndVisible(this._tag)
|
|
74
|
+
key.add(this)
|
|
26
75
|
return this
|
|
27
76
|
}
|
|
28
77
|
|
|
@@ -32,3 +81,7 @@ module.exports = exports = class UIKitWindow extends UIKitView {
|
|
|
32
81
|
}
|
|
33
82
|
}
|
|
34
83
|
}
|
|
84
|
+
|
|
85
|
+
exports._events = {
|
|
86
|
+
keyboardWillChangeFrame: binding.WINDOW_EVENT_KEYBOARD_WILL_CHANGE_FRAME
|
|
87
|
+
}
|
package/lib/wrap.js
ADDED
package/package.json
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bare-ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "UIKit bindings and runtime for Bare",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./package": "./package.json",
|
|
7
|
-
".":
|
|
8
|
-
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./index.d.ts",
|
|
9
|
+
"default": "./index.js"
|
|
10
|
+
},
|
|
11
|
+
"./runtime": "./runtime.js",
|
|
12
|
+
"./*": {
|
|
13
|
+
"types": "./lib/*.d.ts",
|
|
14
|
+
"default": "./lib/*.js"
|
|
15
|
+
}
|
|
9
16
|
},
|
|
10
17
|
"files": [
|
|
11
18
|
"index.js",
|
|
19
|
+
"index.d.ts",
|
|
12
20
|
"binding.m",
|
|
13
21
|
"binding.js",
|
|
14
22
|
"runtime.js",
|
|
@@ -34,6 +42,7 @@
|
|
|
34
42
|
"homepage": "https://github.com/holepunchto/bare-ui-kit#readme",
|
|
35
43
|
"dependencies": {
|
|
36
44
|
"bare-events": "^2.8.2",
|
|
45
|
+
"bare-foundation-registry": "^0.1.0",
|
|
37
46
|
"require-asset": "^1.1.0"
|
|
38
47
|
},
|
|
39
48
|
"peerDependencies": {
|
package/prebuilds/ios-arm64/bare
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|