slint-ui 1.12.0-nightly.2025050714 → 1.12.0-nightly.2025050920
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.toml
CHANGED
|
@@ -42,10 +42,10 @@ accessibility = ["slint-interpreter/accessibility"]
|
|
|
42
42
|
[dependencies]
|
|
43
43
|
napi = { version = "2.14.0", default-features = false, features = ["napi8"] }
|
|
44
44
|
napi-derive = "2.14.0"
|
|
45
|
-
i-slint-compiler = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "
|
|
46
|
-
i-slint-core = { features = ["default", "gettext-rs"] , git = "https://github.com/slint-ui/slint", rev = "
|
|
47
|
-
i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "
|
|
48
|
-
slint-interpreter = { default-features = false , features = ["display-diagnostics", "internal", "compat-1-2"] , git = "https://github.com/slint-ui/slint", rev = "
|
|
45
|
+
i-slint-compiler = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "92f3a9a5acef81555419e64a755767c9b78f0547", version = "=1.12.0", default-features = false }
|
|
46
|
+
i-slint-core = { features = ["default", "gettext-rs"] , git = "https://github.com/slint-ui/slint", rev = "92f3a9a5acef81555419e64a755767c9b78f0547", version = "=1.12.0", default-features = false }
|
|
47
|
+
i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "92f3a9a5acef81555419e64a755767c9b78f0547", version = "=1.12.0", default-features = false }
|
|
48
|
+
slint-interpreter = { default-features = false , features = ["display-diagnostics", "internal", "compat-1-2"] , git = "https://github.com/slint-ui/slint", rev = "92f3a9a5acef81555419e64a755767c9b78f0547", version = "=1.12.0"}
|
|
49
49
|
spin_on = { version = "0.1" }
|
|
50
50
|
css-color-parser2 = { version = "1.0.1" }
|
|
51
51
|
itertools = { version = "0.14" }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slint-ui",
|
|
3
|
-
"version": "1.12.0-nightly.
|
|
3
|
+
"version": "1.12.0-nightly.2025050920",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"homepage": "https://github.com/slint-ui/slint",
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
"@napi-rs/cli": "2.18.4"
|
|
67
67
|
},
|
|
68
68
|
"optionalDependencies": {
|
|
69
|
-
"@slint-ui/slint-ui-binary-linux-x64-gnu": "1.12.0-nightly.
|
|
70
|
-
"@slint-ui/slint-ui-binary-linux-arm64-gnu": "1.12.0-nightly.
|
|
71
|
-
"@slint-ui/slint-ui-binary-darwin-x64": "1.12.0-nightly.
|
|
72
|
-
"@slint-ui/slint-ui-binary-darwin-arm64": "1.12.0-nightly.
|
|
73
|
-
"@slint-ui/slint-ui-binary-win32-x64-msvc": "1.12.0-nightly.
|
|
69
|
+
"@slint-ui/slint-ui-binary-linux-x64-gnu": "1.12.0-nightly.2025050920",
|
|
70
|
+
"@slint-ui/slint-ui-binary-linux-arm64-gnu": "1.12.0-nightly.2025050920",
|
|
71
|
+
"@slint-ui/slint-ui-binary-darwin-x64": "1.12.0-nightly.2025050920",
|
|
72
|
+
"@slint-ui/slint-ui-binary-darwin-arm64": "1.12.0-nightly.2025050920",
|
|
73
|
+
"@slint-ui/slint-ui-binary-win32-x64-msvc": "1.12.0-nightly.2025050920"
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -60,7 +60,7 @@ impl JsComponentCompiler {
|
|
|
60
60
|
|
|
61
61
|
#[napi(setter)]
|
|
62
62
|
pub fn set_include_paths(&mut self, include_paths: Vec<String>) {
|
|
63
|
-
self.internal.set_include_paths(include_paths.iter().map(
|
|
63
|
+
self.internal.set_include_paths(include_paths.iter().map(PathBuf::from).collect());
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
#[napi(getter)]
|
|
@@ -137,7 +137,6 @@ impl JsComponentCompiler {
|
|
|
137
137
|
self.structs_and_enums
|
|
138
138
|
.iter()
|
|
139
139
|
.filter_map(|ty| convert_type(&env, ty))
|
|
140
|
-
.into_iter()
|
|
141
140
|
.collect::<HashMap<String, JsUnknown>>()
|
|
142
141
|
}
|
|
143
142
|
|
|
@@ -165,7 +164,6 @@ impl JsComponentCompiler {
|
|
|
165
164
|
self.structs_and_enums
|
|
166
165
|
.iter()
|
|
167
166
|
.filter_map(|ty| convert_type(&env, ty))
|
|
168
|
-
.into_iter()
|
|
169
167
|
.collect::<HashMap<String, JsUnknown>>()
|
|
170
168
|
}
|
|
171
169
|
|
|
@@ -253,12 +253,12 @@ impl JsComponentInstance {
|
|
|
253
253
|
env: Env,
|
|
254
254
|
callback_name: &String,
|
|
255
255
|
arguments: Vec<JsUnknown>,
|
|
256
|
-
args: &
|
|
256
|
+
args: &[Type],
|
|
257
257
|
) -> Result<Vec<Value>> {
|
|
258
258
|
let count = args.len();
|
|
259
259
|
let args = arguments
|
|
260
260
|
.into_iter()
|
|
261
|
-
.zip(args
|
|
261
|
+
.zip(args)
|
|
262
262
|
.map(|(a, ty)| super::value::to_value(&env, a, ty))
|
|
263
263
|
.collect::<Result<Vec<_>, _>>()?;
|
|
264
264
|
if args.len() != count {
|
|
@@ -381,7 +381,7 @@ pub struct RefCountedReference {
|
|
|
381
381
|
|
|
382
382
|
impl RefCountedReference {
|
|
383
383
|
pub fn new<T: NapiRaw>(env: &Env, value: T) -> Result<Self> {
|
|
384
|
-
Ok(Self { env: env
|
|
384
|
+
Ok(Self { env: *env, reference: env.create_reference(value)? })
|
|
385
385
|
}
|
|
386
386
|
|
|
387
387
|
pub fn get<T: NapiValue>(&self) -> Result<T> {
|
|
@@ -109,7 +109,7 @@ pub fn to_value(env: &Env, unknown: JsUnknown, typ: &Type) -> Result<Value> {
|
|
|
109
109
|
Type::Color => {
|
|
110
110
|
match unknown.get_type() {
|
|
111
111
|
Ok(ValueType::String) => {
|
|
112
|
-
return
|
|
112
|
+
return unknown.coerce_to_string().and_then(string_to_brush)
|
|
113
113
|
}
|
|
114
114
|
Ok(ValueType::Object) => {
|
|
115
115
|
if let Ok(rgb_color) = unknown.coerce_to_object() {
|
|
@@ -125,7 +125,7 @@ pub fn to_value(env: &Env, unknown: JsUnknown, typ: &Type) -> Result<Value> {
|
|
|
125
125
|
Type::Brush => {
|
|
126
126
|
match unknown.get_type() {
|
|
127
127
|
Ok(ValueType::String) => {
|
|
128
|
-
return
|
|
128
|
+
return unknown.coerce_to_string().and_then(string_to_brush);
|
|
129
129
|
}
|
|
130
130
|
Ok(ValueType::Object) => {
|
|
131
131
|
if let Ok(obj) = unknown.coerce_to_object() {
|
|
@@ -277,7 +277,7 @@ pub fn to_value(env: &Env, unknown: JsUnknown, typ: &Type) -> Result<Value> {
|
|
|
277
277
|
| Type::InferredCallback
|
|
278
278
|
| Type::Function { .. }
|
|
279
279
|
| Type::Callback { .. }
|
|
280
|
-
| Type::ComponentFactory
|
|
280
|
+
| Type::ComponentFactory
|
|
281
281
|
| Type::Easing
|
|
282
282
|
| Type::PathData
|
|
283
283
|
| Type::LayoutCache
|
|
@@ -292,7 +292,7 @@ fn string_to_brush(js_string: JsString) -> Result<Value> {
|
|
|
292
292
|
.parse::<css_color_parser2::Color>()
|
|
293
293
|
.map_err(|_| napi::Error::from_reason(format!("Could not convert {string} to Brush.")))?;
|
|
294
294
|
|
|
295
|
-
Ok(Value::Brush(Brush::from(Color::from_argb_u8((c.a * 255.) as u8, c.r, c.g, c.b))
|
|
295
|
+
Ok(Value::Brush(Brush::from(Color::from_argb_u8((c.a * 255.) as u8, c.r, c.g, c.b))))
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
fn brush_from_color(rgb_color: Object) -> Result<Value> {
|
package/rust/lib.rs
CHANGED
|
@@ -36,11 +36,9 @@ pub fn process_events() -> napi::Result<ProcessEventsResult> {
|
|
|
36
36
|
b.process_events(std::time::Duration::ZERO, i_slint_core::InternalToken)
|
|
37
37
|
})
|
|
38
38
|
.map_err(|e| napi::Error::from_reason(e.to_string()))
|
|
39
|
-
.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
core::ops::ControlFlow::Break(()) => ProcessEventsResult::Exited,
|
|
43
|
-
})
|
|
39
|
+
.map(|result| match result {
|
|
40
|
+
core::ops::ControlFlow::Continue(()) => ProcessEventsResult::Continue,
|
|
41
|
+
core::ops::ControlFlow::Break(()) => ProcessEventsResult::Exited,
|
|
44
42
|
})
|
|
45
43
|
}
|
|
46
44
|
|
|
@@ -125,7 +123,7 @@ pub fn print_to_console(env: Env, function: &str, arguments: core::fmt::Argument
|
|
|
125
123
|
return;
|
|
126
124
|
};
|
|
127
125
|
|
|
128
|
-
if let Err(err) = log_fn.call(None, &
|
|
126
|
+
if let Err(err) = log_fn.call(None, &[js_message.into_unknown()]) {
|
|
129
127
|
eprintln!("Unable to invoke console.{function}: {err}");
|
|
130
128
|
}
|
|
131
129
|
}
|
package/rust/types/model.rs
CHANGED
|
@@ -41,7 +41,7 @@ pub(crate) fn js_into_rust_model(
|
|
|
41
41
|
})?;
|
|
42
42
|
Ok(Rc::new(JsModel {
|
|
43
43
|
shared_model_notify,
|
|
44
|
-
env: env
|
|
44
|
+
env: *env,
|
|
45
45
|
js_impl: RefCountedReference::new(env, maybe_js_impl)?,
|
|
46
46
|
row_data_type: row_data_type.clone(),
|
|
47
47
|
})
|
|
@@ -230,7 +230,7 @@ impl ReadOnlyRustModel {
|
|
|
230
230
|
|
|
231
231
|
pub fn into_js(self, env: &Env) -> Result<JsUnknown> {
|
|
232
232
|
let model = self.0.clone();
|
|
233
|
-
let iterator_env = env
|
|
233
|
+
let iterator_env = *env;
|
|
234
234
|
|
|
235
235
|
let mut obj = self.into_instance(*env)?.as_object(*env);
|
|
236
236
|
|