slint-ui 1.10.0-nightly.2025020617 → 1.10.0-nightly.2025020719
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
|
@@ -41,10 +41,10 @@ accessibility = ["slint-interpreter/accessibility"]
|
|
|
41
41
|
[dependencies]
|
|
42
42
|
napi = { version = "2.14.0", default-features = false, features = ["napi8"] }
|
|
43
43
|
napi-derive = "2.14.0"
|
|
44
|
-
i-slint-compiler = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "
|
|
45
|
-
i-slint-core = { features = ["default", "gettext-rs"] , git = "https://github.com/slint-ui/slint", rev = "
|
|
46
|
-
i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "
|
|
47
|
-
slint-interpreter = { default-features = false , features = ["display-diagnostics", "internal", "compat-1-2"] , git = "https://github.com/slint-ui/slint", rev = "
|
|
44
|
+
i-slint-compiler = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "ca2803fe73cd4685f93e1f3bb99e2e6ae58a2c9f", version = "=1.10.0", default-features = false }
|
|
45
|
+
i-slint-core = { features = ["default", "gettext-rs"] , git = "https://github.com/slint-ui/slint", rev = "ca2803fe73cd4685f93e1f3bb99e2e6ae58a2c9f", version = "=1.10.0", default-features = false }
|
|
46
|
+
i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "ca2803fe73cd4685f93e1f3bb99e2e6ae58a2c9f", version = "=1.10.0", default-features = false }
|
|
47
|
+
slint-interpreter = { default-features = false , features = ["display-diagnostics", "internal", "compat-1-2"] , git = "https://github.com/slint-ui/slint", rev = "ca2803fe73cd4685f93e1f3bb99e2e6ae58a2c9f", version = "=1.10.0"}
|
|
48
48
|
spin_on = { version = "0.1" }
|
|
49
49
|
css-color-parser2 = { version = "1.0.1" }
|
|
50
50
|
itertools = { version = "0.14" }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slint-ui",
|
|
3
|
-
"version": "1.10.0-nightly.
|
|
3
|
+
"version": "1.10.0-nightly.2025020719",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"homepage": "https://github.com/slint-ui/slint",
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
"@napi-rs/cli": "2.18.4"
|
|
67
67
|
},
|
|
68
68
|
"optionalDependencies": {
|
|
69
|
-
"@slint-ui/slint-ui-binary-linux-x64-gnu": "1.10.0-nightly.
|
|
70
|
-
"@slint-ui/slint-ui-binary-linux-arm64-gnu": "1.10.0-nightly.
|
|
71
|
-
"@slint-ui/slint-ui-binary-darwin-x64": "1.10.0-nightly.
|
|
72
|
-
"@slint-ui/slint-ui-binary-darwin-arm64": "1.10.0-nightly.
|
|
73
|
-
"@slint-ui/slint-ui-binary-win32-x64-msvc": "1.10.0-nightly.
|
|
74
|
-
"@slint-ui/slint-ui-binary-win32-ia32-msvc": "1.10.0-nightly.
|
|
69
|
+
"@slint-ui/slint-ui-binary-linux-x64-gnu": "1.10.0-nightly.2025020719",
|
|
70
|
+
"@slint-ui/slint-ui-binary-linux-arm64-gnu": "1.10.0-nightly.2025020719",
|
|
71
|
+
"@slint-ui/slint-ui-binary-darwin-x64": "1.10.0-nightly.2025020719",
|
|
72
|
+
"@slint-ui/slint-ui-binary-darwin-arm64": "1.10.0-nightly.2025020719",
|
|
73
|
+
"@slint-ui/slint-ui-binary-win32-x64-msvc": "1.10.0-nightly.2025020719",
|
|
74
|
+
"@slint-ui/slint-ui-binary-win32-ia32-msvc": "1.10.0-nightly.2025020719"
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -128,9 +128,9 @@ impl JsComponentCompiler {
|
|
|
128
128
|
))),
|
|
129
129
|
);
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
Some((name.to_string(), struct_instance.ok()?))
|
|
132
132
|
}
|
|
133
|
-
_ =>
|
|
133
|
+
_ => None,
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -156,9 +156,9 @@ impl JsComponentCompiler {
|
|
|
156
156
|
)
|
|
157
157
|
.ok()?;
|
|
158
158
|
}
|
|
159
|
-
|
|
159
|
+
Some((en.name.to_string(), o.into_unknown()))
|
|
160
160
|
}
|
|
161
|
-
_ =>
|
|
161
|
+
_ => None,
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
|
|
@@ -141,7 +141,7 @@ impl JsComponentInstance {
|
|
|
141
141
|
|
|
142
142
|
move |args| {
|
|
143
143
|
let Ok(callback) = function_ref.get::<JsFunction>() else {
|
|
144
|
-
eprintln!("Node.js: cannot get reference of callback {} because it has the wrong type"
|
|
144
|
+
eprintln!("Node.js: cannot get reference of callback {callback_name} because it has the wrong type");
|
|
145
145
|
return Value::Void;
|
|
146
146
|
};
|
|
147
147
|
|
|
@@ -175,7 +175,7 @@ impl JsComponentInstance {
|
|
|
175
175
|
return Ok(());
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
Err(napi::Error::from_reason(format!("{} is not a callback"
|
|
178
|
+
Err(napi::Error::from_reason(format!("{callback_name} is not a callback").as_str()))
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
#[napi]
|
|
@@ -211,8 +211,7 @@ impl JsComponentInstance {
|
|
|
211
211
|
move |args| {
|
|
212
212
|
let Ok(callback) = function_ref.get::<JsFunction>() else {
|
|
213
213
|
eprintln!(
|
|
214
|
-
"Node.js: cannot get reference of callback {} of global {} because it has the wrong type"
|
|
215
|
-
callback_name, global_name
|
|
214
|
+
"Node.js: cannot get reference of callback {callback_name} of global {global_name} because it has the wrong type"
|
|
216
215
|
);
|
|
217
216
|
return Value::Void;
|
|
218
217
|
};
|
|
@@ -247,7 +246,7 @@ impl JsComponentInstance {
|
|
|
247
246
|
return Ok(());
|
|
248
247
|
}
|
|
249
248
|
|
|
250
|
-
Err(napi::Error::from_reason(format!("{} is not a callback"
|
|
249
|
+
Err(napi::Error::from_reason(format!("{callback_name} is not a callback").as_str()))
|
|
251
250
|
}
|
|
252
251
|
|
|
253
252
|
fn invoke_args(
|
|
@@ -260,7 +259,7 @@ impl JsComponentInstance {
|
|
|
260
259
|
let args = arguments
|
|
261
260
|
.into_iter()
|
|
262
261
|
.zip(args.into_iter())
|
|
263
|
-
.map(|(a, ty)| super::value::to_value(&env, a,
|
|
262
|
+
.map(|(a, ty)| super::value::to_value(&env, a, ty))
|
|
264
263
|
.collect::<Result<Vec<_>, _>>()?;
|
|
265
264
|
if args.len() != count {
|
|
266
265
|
return Err(napi::Error::from_reason(
|
|
@@ -291,7 +290,7 @@ impl JsComponentInstance {
|
|
|
291
290
|
.ok_or(())
|
|
292
291
|
.map_err(|_| {
|
|
293
292
|
napi::Error::from_reason(
|
|
294
|
-
format!("Callback {} not found in the component"
|
|
293
|
+
format!("Callback {callback_name} not found in the component").as_str(),
|
|
295
294
|
)
|
|
296
295
|
})?;
|
|
297
296
|
|
|
@@ -301,7 +300,7 @@ impl JsComponentInstance {
|
|
|
301
300
|
}
|
|
302
301
|
_ => {
|
|
303
302
|
return Err(napi::Error::from_reason(
|
|
304
|
-
format!("{} is not a callback or a function"
|
|
303
|
+
format!("{callback_name} is not a callback or a function").as_str(),
|
|
305
304
|
));
|
|
306
305
|
}
|
|
307
306
|
};
|
|
@@ -331,8 +330,7 @@ impl JsComponentInstance {
|
|
|
331
330
|
.map_err(|_| {
|
|
332
331
|
napi::Error::from_reason(
|
|
333
332
|
format!(
|
|
334
|
-
"Callback {} of global {global_name} not found in the component"
|
|
335
|
-
callback_name
|
|
333
|
+
"Callback {callback_name} of global {global_name} not found in the component"
|
|
336
334
|
)
|
|
337
335
|
.as_str(),
|
|
338
336
|
)
|
|
@@ -345,8 +343,7 @@ impl JsComponentInstance {
|
|
|
345
343
|
_ => {
|
|
346
344
|
return Err(napi::Error::from_reason(
|
|
347
345
|
format!(
|
|
348
|
-
"{} is not a callback or a function on global {}"
|
|
349
|
-
callback_name, global_name
|
|
346
|
+
"{callback_name} is not a callback or a function on global {global_name}"
|
|
350
347
|
)
|
|
351
348
|
.as_str(),
|
|
352
349
|
));
|
|
@@ -198,8 +198,7 @@ pub fn to_value(env: &Env, unknown: JsUnknown, typ: &Type) -> Result<Value> {
|
|
|
198
198
|
let expected_size: usize = (width as usize) * (height as usize) * BPP;
|
|
199
199
|
if actual_size != expected_size {
|
|
200
200
|
return Err(napi::Error::from_reason(format!(
|
|
201
|
-
"data property does not have the correct size; expected {} (width) * {} (height) * {} = {}; got {}"
|
|
202
|
-
width, height, BPP, actual_size, expected_size
|
|
201
|
+
"data property does not have the correct size; expected {width} (width) * {height} (height) * {BPP} = {actual_size}; got {expected_size}"
|
|
203
202
|
)));
|
|
204
203
|
}
|
|
205
204
|
|
|
@@ -244,8 +243,7 @@ pub fn to_value(env: &Env, unknown: JsUnknown, typ: &Type) -> Result<Value> {
|
|
|
244
243
|
vec.push(to_value(
|
|
245
244
|
env,
|
|
246
245
|
array.get(i)?.ok_or(napi::Error::from_reason(format!(
|
|
247
|
-
"Cannot access array element at index {}"
|
|
248
|
-
i
|
|
246
|
+
"Cannot access array element at index {i}"
|
|
249
247
|
)))?,
|
|
250
248
|
a,
|
|
251
249
|
)?);
|
|
@@ -255,7 +253,7 @@ pub fn to_value(env: &Env, unknown: JsUnknown, typ: &Type) -> Result<Value> {
|
|
|
255
253
|
)))))
|
|
256
254
|
} else {
|
|
257
255
|
let rust_model =
|
|
258
|
-
unknown.coerce_to_object().and_then(|obj| js_into_rust_model(env, &obj,
|
|
256
|
+
unknown.coerce_to_object().and_then(|obj| js_into_rust_model(env, &obj, a))?;
|
|
259
257
|
Ok(Value::Model(rust_model))
|
|
260
258
|
}
|
|
261
259
|
}
|
|
@@ -308,10 +306,10 @@ fn brush_from_color(rgb_color: Object) -> Result<Value> {
|
|
|
308
306
|
return Err(Error::from_reason("A channel of Color cannot be negative"));
|
|
309
307
|
}
|
|
310
308
|
|
|
311
|
-
|
|
309
|
+
Ok(Value::Brush(Brush::SolidColor(Color::from_argb_u8(
|
|
312
310
|
alpha as u8,
|
|
313
311
|
red as u8,
|
|
314
312
|
green as u8,
|
|
315
313
|
blue as u8,
|
|
316
|
-
))))
|
|
314
|
+
))))
|
|
317
315
|
}
|
package/rust/types/brush.rs
CHANGED
|
@@ -286,21 +286,16 @@ impl SlintBrush {
|
|
|
286
286
|
#[napi]
|
|
287
287
|
pub fn to_string(&self) -> String {
|
|
288
288
|
match &self.inner {
|
|
289
|
-
Brush::SolidColor(_) =>
|
|
290
|
-
return self.slint_color().to_string();
|
|
291
|
-
}
|
|
289
|
+
Brush::SolidColor(_) => self.slint_color().to_string(),
|
|
292
290
|
Brush::LinearGradient(gradient) => {
|
|
293
|
-
|
|
291
|
+
format!(
|
|
294
292
|
"linear-gradient({}deg, {})",
|
|
295
293
|
gradient.angle(),
|
|
296
294
|
gradient_stops_to_string(gradient.stops())
|
|
297
|
-
)
|
|
295
|
+
)
|
|
298
296
|
}
|
|
299
297
|
Brush::RadialGradient(gradient) => {
|
|
300
|
-
|
|
301
|
-
"radial-gradient(circle, {})",
|
|
302
|
-
gradient_stops_to_string(gradient.stops())
|
|
303
|
-
);
|
|
298
|
+
format!("radial-gradient(circle, {})", gradient_stops_to_string(gradient.stops()))
|
|
304
299
|
}
|
|
305
300
|
_ => String::default(),
|
|
306
301
|
}
|
package/rust/types/model.rs
CHANGED
|
@@ -184,8 +184,7 @@ impl Model for JsModel {
|
|
|
184
184
|
&[self.env.create_double(row as f64).unwrap().into_unknown(), js_data],
|
|
185
185
|
) {
|
|
186
186
|
eprintln!(
|
|
187
|
-
"Node.js: JavaScript Model<T>'s setRowData function threw an exception: {}"
|
|
188
|
-
exception
|
|
187
|
+
"Node.js: JavaScript Model<T>'s setRowData function threw an exception: {exception}"
|
|
189
188
|
);
|
|
190
189
|
}
|
|
191
190
|
}
|
|
@@ -278,6 +277,6 @@ impl ModelIterator {
|
|
|
278
277
|
self.model.row_data(row).and_then(|value| to_js_unknown(&self.env, &value).ok()),
|
|
279
278
|
)?
|
|
280
279
|
}
|
|
281
|
-
|
|
280
|
+
Ok(result.into_unknown())
|
|
282
281
|
}
|
|
283
282
|
}
|