slint-ui 1.10.0-nightly.2025011321 → 1.10.0-nightly.2025011419

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
@@ -11,7 +11,7 @@ homepage = "https://slint.dev"
11
11
  keywords = ["gui", "toolkit", "graphics", "design", "ui"]
12
12
  license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
13
13
  repository = "https://github.com/slint-ui/slint"
14
- rust-version = "1.77"
14
+ rust-version = "1.82"
15
15
  version = "1.10.0"
16
16
  categories = ["gui", "development-tools"]
17
17
  build = "build.rs"
@@ -41,13 +41,13 @@ 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 = "d17d5dd6e43e7c16a27835ed8976d2df72ddb981", version = "=1.10.0", default-features = false }
45
- i-slint-core = { features = ["default", "gettext-rs"] , git = "https://github.com/slint-ui/slint", rev = "d17d5dd6e43e7c16a27835ed8976d2df72ddb981", version = "=1.10.0", default-features = false }
46
- i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "d17d5dd6e43e7c16a27835ed8976d2df72ddb981", 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 = "d17d5dd6e43e7c16a27835ed8976d2df72ddb981", version = "=1.10.0"}
44
+ i-slint-compiler = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "8e6d2c80e5b52b8c5ae03ad35cb9d25d96814bc8", version = "=1.10.0", default-features = false }
45
+ i-slint-core = { features = ["default", "gettext-rs"] , git = "https://github.com/slint-ui/slint", rev = "8e6d2c80e5b52b8c5ae03ad35cb9d25d96814bc8", version = "=1.10.0", default-features = false }
46
+ i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "8e6d2c80e5b52b8c5ae03ad35cb9d25d96814bc8", 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 = "8e6d2c80e5b52b8c5ae03ad35cb9d25d96814bc8", version = "=1.10.0"}
48
48
  spin_on = { version = "0.1" }
49
49
  css-color-parser2 = { version = "1.0.1" }
50
- itertools = { version = "0.13" }
50
+ itertools = { version = "0.14" }
51
51
  send_wrapper = { version = "0.6.0" }
52
52
  smol_str = { version = "0.3.1" }
53
53
 
package/README.md CHANGED
@@ -33,7 +33,7 @@ You need to install the following components:
33
33
 
34
34
  * **[Node.js](https://nodejs.org/download/release/)** (v16. or newer)
35
35
  * **[pnpm](https://www.pnpm.io/)**
36
- * **[Rust compiler](https://www.rust-lang.org/tools/install)** (1.77 or newer)
36
+ * **[Rust compiler](https://www.rust-lang.org/tools/install)** (1.82 or newer)
37
37
 
38
38
  You will also need a few more dependencies, see <https://github.com/slint-ui/slint/blob/master/docs/building.md#prerequisites>
39
39
 
package/biome.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "extends": ["../../biome.json"],
3
3
  "formatter": {
4
- "ignore": ["rust-module.d.ts", "rust-module.cjs", "dist/", "docs/"]
4
+ "ignore": ["rust-module.d.cts", "rust-module.cjs", "dist/", "docs/"]
5
5
  },
6
6
  "linter": {
7
- "ignore": ["rust-module.d.ts", "rust-module.cjs", "dist/", "docs/"],
7
+ "ignore": ["dist/", "docs/"],
8
8
  "rules": {
9
9
  "complexity": {
10
10
  "useArrowFunction": "off",
package/cover.md CHANGED
@@ -34,7 +34,7 @@ To use Slint with Deno, ensure the following programs are installed:
34
34
  Slint-node comes with pre-built binaries for macOS, Linux, and Windows. If you'd like to use Slint-node on a system
35
35
  without pre-built binaries, you need to additional software:
36
36
 
37
- * **[Rust compiler](https://www.rust-lang.org/tools/install)** (1.77 or newer) * Depending on your operating system, you may need additional components. For a list of required system libraries,
37
+ * **[Rust compiler](https://www.rust-lang.org/tools/install)** (1.82 or newer) * Depending on your operating system, you may need additional components. For a list of required system libraries,
38
38
  see <https://github.com/slint-ui/slint/blob/master/docs/building.md#prerequisites>.
39
39
 
40
40
  ## Getting Started (Node.js)
package/dist/index.js CHANGED
@@ -2,13 +2,14 @@
2
2
  // Copyright © SixtyFPS GmbH <info@slint.dev>
3
3
  // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.setXdgAppId = exports.initTranslations = exports.private_api = exports.quitEventLoop = exports.runEventLoop = exports.loadSource = exports.loadFile = exports.CompileError = exports.ArrayModel = exports.Model = exports.Brush = exports.RgbaColor = exports.DiagnosticLevel = exports.Diagnostic = void 0;
5
+ exports.private_api = exports.CompileError = exports.ArrayModel = exports.Model = void 0;
6
+ exports.loadFile = loadFile;
7
+ exports.loadSource = loadSource;
8
+ exports.runEventLoop = runEventLoop;
9
+ exports.quitEventLoop = quitEventLoop;
10
+ exports.initTranslations = initTranslations;
11
+ exports.setXdgAppId = setXdgAppId;
6
12
  const napi = require("../rust-module.cjs");
7
- var rust_module_cjs_1 = require("../rust-module.cjs");
8
- Object.defineProperty(exports, "Diagnostic", { enumerable: true, get: function () { return rust_module_cjs_1.Diagnostic; } });
9
- Object.defineProperty(exports, "DiagnosticLevel", { enumerable: true, get: function () { return rust_module_cjs_1.DiagnosticLevel; } });
10
- Object.defineProperty(exports, "RgbaColor", { enumerable: true, get: function () { return rust_module_cjs_1.RgbaColor; } });
11
- Object.defineProperty(exports, "Brush", { enumerable: true, get: function () { return rust_module_cjs_1.Brush; } });
12
13
  const models_1 = require("./models");
13
14
  Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return models_1.Model; } });
14
15
  var models_2 = require("./models");
@@ -97,11 +98,11 @@ function loadSlint(loadData) {
97
98
  : compiler.buildFromSource(loadData.fileData.source, filePath);
98
99
  const diagnostics = compiler.diagnostics;
99
100
  if (diagnostics.length > 0) {
100
- const warnings = diagnostics.filter((d) => d.level === napi.DiagnosticLevel.Warning);
101
+ const warnings = diagnostics.filter((d) => d.level === 1 /* napi.DiagnosticLevel.Warning */);
101
102
  if (typeof options !== "undefined" && options.quiet !== true) {
102
103
  warnings.forEach((w) => console.warn("Warning: " + w));
103
104
  }
104
- const errors = diagnostics.filter((d) => d.level === napi.DiagnosticLevel.Error);
105
+ const errors = diagnostics.filter((d) => d.level === 0 /* napi.DiagnosticLevel.Error */);
105
106
  if (errors.length > 0) {
106
107
  throw new CompileError("Could not compile " + filePath, errors);
107
108
  }
@@ -338,7 +339,6 @@ function loadFile(filePath, options) {
338
339
  from: "file",
339
340
  });
340
341
  }
341
- exports.loadFile = loadFile;
342
342
  /**
343
343
  * Loads the given Slint source code and returns an object that contains a functions to construct the exported
344
344
  * components of the Slint source code.
@@ -373,7 +373,6 @@ function loadSource(source, filePath, options) {
373
373
  from: "source",
374
374
  });
375
375
  }
376
- exports.loadSource = loadSource;
377
376
  class EventLoop {
378
377
  #quit_loop = false;
379
378
  #terminationPromise = null;
@@ -397,7 +396,7 @@ class EventLoop {
397
396
  // can do right now.
398
397
  const nodejsPollInterval = 16;
399
398
  const id = setInterval(() => {
400
- if (napi.processEvents() === napi.ProcessEventsResult.Exited ||
399
+ if (napi.processEvents() === 1 /* napi.ProcessEventsResult.Exited */ ||
401
400
  this.#quit_loop) {
402
401
  clearInterval(id);
403
402
  this.#terminateResolveFn(undefined);
@@ -442,7 +441,6 @@ function runEventLoop(args) {
442
441
  }
443
442
  return globalEventLoop.start(args.runningCallback, args.quitOnLastWindowClosed);
444
443
  }
445
- exports.runEventLoop = runEventLoop;
446
444
  /**
447
445
  * Stops a spinning event loop. This function returns immediately, and the promise returned
448
446
  from run_event_loop() will resolve in a later tick of the nodejs event loop.
@@ -450,7 +448,6 @@ exports.runEventLoop = runEventLoop;
450
448
  function quitEventLoop() {
451
449
  globalEventLoop.quit();
452
450
  }
453
- exports.quitEventLoop = quitEventLoop;
454
451
  var private_api;
455
452
  (function (private_api) {
456
453
  /**
@@ -628,7 +625,6 @@ function initTranslations(domain, path) {
628
625
  const pathname = path instanceof URL ? path.pathname : path;
629
626
  napi.initTranslations(domain, pathname);
630
627
  }
631
- exports.initTranslations = initTranslations;
632
628
  /**
633
629
  * Sets the application id for use on Wayland or X11 with [xdg](https://specifications.freedesktop.org/desktop-entry-spec/latest/)
634
630
  * compliant window managers. This must be set before the window is shown.
@@ -636,7 +632,6 @@ exports.initTranslations = initTranslations;
636
632
  function setXdgAppId(app_id) {
637
633
  napi.setXdgAppId(app_id);
638
634
  }
639
- exports.setXdgAppId = setXdgAppId;
640
635
  /**
641
636
  * @hidden
642
637
  */
@@ -646,7 +641,6 @@ exports.setXdgAppId = setXdgAppId;
646
641
  private_api.ComponentCompiler = napi.ComponentCompiler;
647
642
  private_api.ComponentDefinition = napi.ComponentDefinition;
648
643
  private_api.ComponentInstance = napi.ComponentInstance;
649
- private_api.ValueType = napi.ValueType;
650
644
  private_api.Window = napi.Window;
651
645
  private_api.SlintBrush = napi.SlintBrush;
652
646
  private_api.SlintRgbaColor = napi.SlintRgbaColor;
package/dist/models.js CHANGED
@@ -94,7 +94,7 @@ class Model {
94
94
  * @hidden
95
95
  */
96
96
  constructor(modelNotify) {
97
- this.modelNotify = modelNotify ?? napi.jsModelNotifyNew(this);
97
+ this.modelNotify = modelNotify ?? napi.jsModelNotifyNew();
98
98
  }
99
99
  /**
100
100
  * Implementations of this function must store the provided data parameter
@@ -0,0 +1 @@
1
+ {"root":["../typescript/index.ts","../typescript/models.ts"],"version":"5.7.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slint-ui",
3
- "version": "1.10.0-nightly.2025011321",
3
+ "version": "1.10.0-nightly.2025011419",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "homepage": "https://github.com/slint-ui/slint",
@@ -27,9 +27,8 @@
27
27
  "ava": "6.2.0",
28
28
  "capture-console": "1.0.2",
29
29
  "jimp": "1.6.0",
30
- "ts-node": "10.9.2",
31
30
  "typedoc": "0.27",
32
- "typescript": "5.2.2"
31
+ "typescript": "5.7.3"
33
32
  },
34
33
  "engines": {
35
34
  "node": ">= 10"
@@ -37,40 +36,41 @@
37
36
  "scripts": {
38
37
  "artifacts": "napi artifacts",
39
38
  "compile": "tsc --build",
40
- "build": "napi build --platform --release --js rust-module.cjs --dts rust-module.d.ts -c binaries.json",
41
- "build:debug": "napi build --platform --js rust-module.cjs --dts rust-module.d.ts -c binaries.json && pnpm compile",
42
- "build:testing": "napi build --platform --js rust-module.cjs --dts rust-module.d.ts -c binaries.json --features testing && pnpm compile",
39
+ "build": "napi build --platform --release --js rust-module.cjs --dts rust-module.d.cts -c binaries.json",
40
+ "build:debug": "napi build --platform --js rust-module.cjs --dts rust-module.d.cts -c binaries.json && pnpm compile",
41
+ "build:testing": "napi build --platform --js rust-module.cjs --dts rust-module.d.cts -c binaries.json --features testing && pnpm compile",
43
42
  "install": "node build-on-demand.mjs",
44
43
  "docs": "pnpm build && typedoc --hideGenerator --readme cover.md typescript/index.ts && cargo about generate thirdparty.hbs -o docs/thirdparty.html",
44
+ "docs:debug": "pnpm build:debug && typedoc --hideGenerator --readme cover.md typescript/index.ts",
45
45
  "check": "biome check",
46
46
  "format": "biome format",
47
47
  "format:fix": "biome format --write",
48
48
  "lint": "biome lint",
49
49
  "lint:fix": "biome lint --fix",
50
- "test": "ava"
50
+ "test": "tsc --build __test__/tsconfig.json && ava"
51
51
  },
52
52
  "ava": {
53
- "extensions": {
54
- "mts": "module"
53
+ "typescript": {
54
+ "rewritePaths": {
55
+ "__test__/": "build/"
56
+ },
57
+ "compile": false,
58
+ "extensions": [
59
+ "mts"
60
+ ]
55
61
  },
56
- "nodeArguments": [
57
- "--loader=ts-node/esm"
58
- ],
59
62
  "timeout": "2m",
60
- "environmentVariables": {
61
- "TS_NODE_PROJECT": "./__test__/tsconfig.json"
62
- },
63
63
  "workerThreads": false
64
64
  },
65
65
  "dependencies": {
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.2025011321",
70
- "@slint-ui/slint-ui-binary-linux-arm64-gnu": "1.10.0-nightly.2025011321",
71
- "@slint-ui/slint-ui-binary-darwin-x64": "1.10.0-nightly.2025011321",
72
- "@slint-ui/slint-ui-binary-darwin-arm64": "1.10.0-nightly.2025011321",
73
- "@slint-ui/slint-ui-binary-win32-x64-msvc": "1.10.0-nightly.2025011321",
74
- "@slint-ui/slint-ui-binary-win32-ia32-msvc": "1.10.0-nightly.2025011321"
69
+ "@slint-ui/slint-ui-binary-linux-x64-gnu": "1.10.0-nightly.2025011419",
70
+ "@slint-ui/slint-ui-binary-linux-arm64-gnu": "1.10.0-nightly.2025011419",
71
+ "@slint-ui/slint-ui-binary-darwin-x64": "1.10.0-nightly.2025011419",
72
+ "@slint-ui/slint-ui-binary-darwin-arm64": "1.10.0-nightly.2025011419",
73
+ "@slint-ui/slint-ui-binary-win32-x64-msvc": "1.10.0-nightly.2025011419",
74
+ "@slint-ui/slint-ui-binary-win32-ia32-msvc": "1.10.0-nightly.2025011419"
75
75
  }
76
76
  }
@@ -281,7 +281,7 @@ impl JsComponentInstance {
281
281
  &self,
282
282
  env: Env,
283
283
  callback_name: String,
284
- arguments: Vec<JsUnknown>,
284
+ callback_arguments: Vec<JsUnknown>,
285
285
  ) -> Result<JsUnknown> {
286
286
  let ty = self
287
287
  .inner
@@ -297,7 +297,7 @@ impl JsComponentInstance {
297
297
 
298
298
  let args = match ty {
299
299
  Type::Callback(function) | Type::Function(function) => {
300
- Self::invoke_args(env, &callback_name, arguments, &function.args)?
300
+ Self::invoke_args(env, &callback_name, callback_arguments, &function.args)?
301
301
  }
302
302
  _ => {
303
303
  return Err(napi::Error::from_reason(
@@ -319,7 +319,7 @@ impl JsComponentInstance {
319
319
  env: Env,
320
320
  global_name: String,
321
321
  callback_name: String,
322
- arguments: Vec<JsUnknown>,
322
+ callback_arguments: Vec<JsUnknown>,
323
323
  ) -> Result<JsUnknown> {
324
324
  let ty = self
325
325
  .inner
@@ -340,7 +340,7 @@ impl JsComponentInstance {
340
340
 
341
341
  let args = match ty {
342
342
  Type::Callback(function) | Type::Function(function) => {
343
- Self::invoke_args(env, &callback_name, arguments, &function.args)?
343
+ Self::invoke_args(env, &callback_name, callback_arguments, &function.args)?
344
344
  }
345
345
  _ => {
346
346
  return Err(napi::Error::from_reason(
@@ -135,8 +135,8 @@ export declare class ComponentInstance {
135
135
  setGlobalProperty(globalName: string, propName: string, jsValue: unknown): void
136
136
  setCallback(callbackName: string, callback: (...args: any[]) => any): void
137
137
  setGlobalCallback(globalName: string, callbackName: string, callback: (...args: any[]) => any): void
138
- invoke(callbackName: string, arguments: Array<unknown>): unknown
139
- invokeGlobal(globalName: string, callbackName: string, arguments: Array<unknown>): unknown
138
+ invoke(callbackName: string, callbackArguments: Array<unknown>): unknown
139
+ invokeGlobal(globalName: string, callbackName: string, callbackArguments: Array<unknown>): unknown
140
140
  sendMouseClick(x: number, y: number): void
141
141
  sendKeyboardStringSequence(sequence: string): void
142
142
  window(): JsWindow
@@ -327,7 +327,7 @@ function loadSlint(loadData: LoadData): Object {
327
327
  for (const key in compiler.structs) {
328
328
  Object.defineProperty(slint_module, translateName(key), {
329
329
  value: function (properties: any) {
330
- const defaultObject = structs[key];
330
+ const defaultObject = structs[key] as any;
331
331
  const newObject = Object.create({});
332
332
 
333
333
  for (const propertyKey in defaultObject) {
@@ -97,7 +97,7 @@ export abstract class Model<T> implements Iterable<T> {
97
97
  * @hidden
98
98
  */
99
99
  constructor(modelNotify?: napi.ExternalObject<napi.SharedModelNotify>) {
100
- this.modelNotify = modelNotify ?? napi.jsModelNotifyNew(this);
100
+ this.modelNotify = modelNotify ?? napi.jsModelNotifyNew();
101
101
  }
102
102
 
103
103
  // /**