@c9up/orbit 0.1.0 → 0.1.1
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/Cargo.lock +9 -16
- package/Cargo.toml +4 -0
- package/README.md +7 -1
- package/android/src/main/java/com/c9up/orbit/OrbitInput.kt +18 -2
- package/crates/orbit-host/Cargo.toml +1 -1
- package/crates/orbit-host/src/lib.rs +549 -115
- package/crates/orbit-host/src/vector.rs +312 -56
- package/dist/color.d.ts.map +1 -1
- package/dist/color.js +3 -3
- package/dist/color.js.map +1 -1
- package/dist/commit.d.ts +32 -0
- package/dist/commit.d.ts.map +1 -1
- package/dist/commit.js +142 -12
- package/dist/commit.js.map +1 -1
- package/dist/errors.d.ts +60 -26
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +85 -11
- package/dist/errors.js.map +1 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +4 -2
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/motion.d.ts.map +1 -1
- package/dist/motion.js +7 -6
- package/dist/motion.js.map +1 -1
- package/dist/pages.d.ts.map +1 -1
- package/dist/pages.js +3 -3
- package/dist/pages.js.map +1 -1
- package/dist/react-native/index.d.ts +9 -1
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +33 -5
- package/dist/react-native/index.js.map +1 -1
- package/dist/report.d.ts +13 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +22 -0
- package/dist/report.js.map +1 -0
- package/dist/server.d.ts +27 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +15 -7
- package/dist/server.js.map +1 -1
- package/dist/stack.d.ts.map +1 -1
- package/dist/stack.js +3 -3
- package/dist/stack.js.map +1 -1
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +2 -2
- package/dist/styles.js.map +1 -1
- package/dist/template.d.ts.map +1 -1
- package/dist/template.js +56 -12
- package/dist/template.js.map +1 -1
- package/dist/textDecoder.d.ts +29 -0
- package/dist/textDecoder.d.ts.map +1 -0
- package/dist/textDecoder.js +149 -0
- package/dist/textDecoder.js.map +1 -0
- package/dist/url.d.ts.map +1 -1
- package/dist/url.js +4 -3
- package/dist/url.js.map +1 -1
- package/package.json +13 -7
- package/scripts/build-android.sh +0 -0
- package/src/color.ts +5 -10
- package/src/commit.ts +184 -17
- package/src/errors.ts +174 -44
- package/src/host.ts +4 -5
- package/src/index.ts +5 -1
- package/src/motion.ts +8 -6
- package/src/pages.ts +3 -6
- package/src/react-native/index.ts +46 -7
- package/src/react-native/react-native.d.ts +8 -0
- package/src/report.ts +25 -0
- package/src/server.ts +50 -14
- package/src/stack.ts +3 -9
- package/src/styles.ts +2 -5
- package/src/template.ts +65 -41
- package/src/textDecoder.ts +162 -0
- package/src/url.ts +10 -3
package/Cargo.lock
CHANGED
|
@@ -2,18 +2,6 @@
|
|
|
2
2
|
# It is not intended for manual editing.
|
|
3
3
|
version = 4
|
|
4
4
|
|
|
5
|
-
[[package]]
|
|
6
|
-
name = "arrayvec"
|
|
7
|
-
version = "0.7.8"
|
|
8
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
-
checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56"
|
|
10
|
-
|
|
11
|
-
[[package]]
|
|
12
|
-
name = "grid"
|
|
13
|
-
version = "1.0.1"
|
|
14
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
-
checksum = "b40ca9252762c466af32d0b1002e91e4e1bc5398f77455e55474deb466355ff5"
|
|
16
|
-
|
|
17
5
|
[[package]]
|
|
18
6
|
name = "itoa"
|
|
19
7
|
version = "1.0.19"
|
|
@@ -104,6 +92,12 @@ dependencies = [
|
|
|
104
92
|
"version_check",
|
|
105
93
|
]
|
|
106
94
|
|
|
95
|
+
[[package]]
|
|
96
|
+
name = "smallvec"
|
|
97
|
+
version = "1.16.5"
|
|
98
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
99
|
+
checksum = "149309498a5f7334b12ddae0cad8aba81ce785fe91755068867e017cf98fee46"
|
|
100
|
+
|
|
107
101
|
[[package]]
|
|
108
102
|
name = "syn"
|
|
109
103
|
version = "3.0.10"
|
|
@@ -117,14 +111,13 @@ dependencies = [
|
|
|
117
111
|
|
|
118
112
|
[[package]]
|
|
119
113
|
name = "taffy"
|
|
120
|
-
version = "0.
|
|
114
|
+
version = "0.15.1"
|
|
121
115
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
122
|
-
checksum = "
|
|
116
|
+
checksum = "31f7bd2d97198df05186f93a3a3c306845f40e8b3c22bf9279cdd7e5cf5fea7d"
|
|
123
117
|
dependencies = [
|
|
124
|
-
"arrayvec",
|
|
125
|
-
"grid",
|
|
126
118
|
"serde",
|
|
127
119
|
"slotmap",
|
|
120
|
+
"smallvec",
|
|
128
121
|
]
|
|
129
122
|
|
|
130
123
|
[[package]]
|
package/Cargo.toml
CHANGED
|
@@ -10,6 +10,10 @@ repository = "https://github.com/C9up/orbit"
|
|
|
10
10
|
# The host is linked into the app's native library (a static library behind a
|
|
11
11
|
# C ABI, called from the JSI module). No `panic = "abort"`: every exported
|
|
12
12
|
# function wraps its body in `catch_unwind`, and abort would kill the app.
|
|
13
|
+
# `catch_unwind` stops panics only: a stack overflow is not one and ends the
|
|
14
|
+
# app whatever this says. The layout recurses once per level of the tree, so
|
|
15
|
+
# the host refuses a tree deeper than `MAX_DEPTH` (crates/orbit-host/src/lib.rs)
|
|
16
|
+
# before it lays it out.
|
|
13
17
|
[profile.release]
|
|
14
18
|
opt-level = 3
|
|
15
19
|
lto = "fat"
|
package/README.md
CHANGED
|
@@ -76,7 +76,10 @@ default, as in CSS), `rounded-*` clips it and a border is drawn over it.
|
|
|
76
76
|
with the node, so a decrypted media stays out of storage. orbit reads the
|
|
77
77
|
array when it commits: keep it unchanged until the image shows.
|
|
78
78
|
|
|
79
|
-
Any other scheme (`data:`, `javascript:`…)
|
|
79
|
+
Any other scheme (`data:`, `javascript:`…), or none (`//host/a.png`), throws
|
|
80
|
+
`E_ORBIT_IMAGE_SOURCE`. That is for an address written in the template; one
|
|
81
|
+
that comes from data (`src=${user.avatar}`) shows nothing for that image and
|
|
82
|
+
goes to `mount`'s `onError`, so one bad row does not take its list down.
|
|
80
83
|
Images are decoded at the size their box is laid out to, never above the
|
|
81
84
|
source's own size nor 4096 px a side, and kept decoded in a memory cache
|
|
82
85
|
bounded to an eighth of the app's heap; a download or a file over 64 MB is
|
|
@@ -218,6 +221,9 @@ session cookie, the `XSRF-TOKEN` echoed on mutations), `json` (comet's
|
|
|
218
221
|
transport), `stream` (server-sent events over React Native's streaming XHR,
|
|
219
222
|
for `configureRelay({ stream, fetch })`) and `authorize(token)` (a Bearer
|
|
220
223
|
token on every request and stream). Pass it as `serverPages({ server })`.
|
|
224
|
+
With a `tokenStore` (`{ get, set }`, e.g. over `@c9up/orbit-secure-store`),
|
|
225
|
+
`authorize` keeps the token and `restore()` authorizes again at the next
|
|
226
|
+
launch.
|
|
221
227
|
|
|
222
228
|
## Long lists
|
|
223
229
|
|
|
@@ -118,13 +118,29 @@ class OrbitInput(context: Context) : EditText(context), Framed {
|
|
|
118
118
|
appliedVersion = version
|
|
119
119
|
if (next != text?.toString()) {
|
|
120
120
|
muted = true
|
|
121
|
-
|
|
122
|
-
setSelection(next.length)
|
|
121
|
+
setValue(next)
|
|
123
122
|
muted = false
|
|
124
123
|
}
|
|
125
124
|
}
|
|
126
125
|
}
|
|
127
126
|
|
|
127
|
+
/**
|
|
128
|
+
* The value the app sets, kept whole as HTML keeps a value set by script:
|
|
129
|
+
* `maxlength` limits what the user types, so the length filter is left out
|
|
130
|
+
* while the value goes in. The caret goes to the end of the text the field
|
|
131
|
+
* holds — never past it, which Android refuses with an exception.
|
|
132
|
+
*/
|
|
133
|
+
private fun setValue(value: String) {
|
|
134
|
+
val kept = filters
|
|
135
|
+
filters = arrayOf()
|
|
136
|
+
try {
|
|
137
|
+
setText(value)
|
|
138
|
+
} finally {
|
|
139
|
+
filters = kept
|
|
140
|
+
}
|
|
141
|
+
setSelection(text?.length ?: 0)
|
|
142
|
+
}
|
|
143
|
+
|
|
128
144
|
override fun setFrame(x: Float, y: Float, w: Float, h: Float) {
|
|
129
145
|
frame[0] = x; frame[1] = y; frame[2] = w; frame[3] = h
|
|
130
146
|
measure(
|