slint-ui 1.8.0-nightly.2024091017 → 1.8.0-nightly.2024091220

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
@@ -40,10 +40,10 @@ accessibility = ["slint-interpreter/accessibility"]
40
40
  [dependencies]
41
41
  napi = { version = "2.14.0", default-features = false, features = ["napi8"] }
42
42
  napi-derive = "2.14.0"
43
- i-slint-compiler = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "d7007f5356ba8caedf82be5d0ea42f8df8729bb0", version = "=1.8.0", default-features = false }
44
- i-slint-core = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "d7007f5356ba8caedf82be5d0ea42f8df8729bb0", version = "=1.8.0", default-features = false }
45
- i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "d7007f5356ba8caedf82be5d0ea42f8df8729bb0", version = "=1.8.0", default-features = false }
46
- slint-interpreter = { default-features = false , features = ["display-diagnostics", "internal", "compat-1-2"] , git = "https://github.com/slint-ui/slint", rev = "d7007f5356ba8caedf82be5d0ea42f8df8729bb0", version = "=1.8.0"}
43
+ i-slint-compiler = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "eed03345b5d02dd4dc5aee01d83198fcda3e5e79", version = "=1.8.0", default-features = false }
44
+ i-slint-core = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "eed03345b5d02dd4dc5aee01d83198fcda3e5e79", version = "=1.8.0", default-features = false }
45
+ i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "eed03345b5d02dd4dc5aee01d83198fcda3e5e79", version = "=1.8.0", default-features = false }
46
+ slint-interpreter = { default-features = false , features = ["display-diagnostics", "internal", "compat-1-2"] , git = "https://github.com/slint-ui/slint", rev = "eed03345b5d02dd4dc5aee01d83198fcda3e5e79", version = "=1.8.0"}
47
47
  spin_on = { version = "0.1" }
48
48
  css-color-parser2 = { version = "1.0.1" }
49
49
  itertools = { version = "0.13" }
package/biome.json CHANGED
@@ -1,10 +1,36 @@
1
1
  {
2
2
  "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
3
- "extends": ["../../editors/vscode/biome.json"],
3
+ "extends": ["../../biome.json"],
4
4
  "formatter": {
5
5
  "ignore": ["*/rust-module.d.ts"]
6
6
  },
7
7
  "linter": {
8
- "ignore": ["rust-module.d.ts"]
8
+ "ignore": ["rust-module.d.ts"],
9
+ "rules": {
10
+ "complexity": {
11
+ "useArrowFunction": "off",
12
+ "noForEach": "off",
13
+ "noUselessConstructor": "off",
14
+ "noBannedTypes": "warn"
15
+ },
16
+ "style": {
17
+ "noNonNullAssertion": "off",
18
+ "noUnusedTemplateLiteral": "off",
19
+ "useConst": "off",
20
+ "useTemplate": "off",
21
+ "noArguments": "off",
22
+ "noVar": "off",
23
+ "noInferrableTypes": "off",
24
+ "useImportType": "off",
25
+ "useNodejsImportProtocol": "off",
26
+ "noParameterAssign": "off"
27
+ },
28
+ "suspicious": {
29
+ "noExplicitAny": "off",
30
+ "noAssignInExpressions": "off",
31
+ "noImplicitAnyLet": "off",
32
+ "noRedundantUseStrict": "off"
33
+ }
34
+ }
9
35
  }
10
36
  }
package/index.js CHANGED
@@ -13,7 +13,7 @@ class ModelIterator {
13
13
  }
14
14
  next() {
15
15
  if (this.row < this.model.rowCount()) {
16
- let row = this.row;
16
+ const row = this.row;
17
17
  this.row++;
18
18
  return {
19
19
  done: false,
@@ -189,7 +189,7 @@ class ArrayModel extends Model {
189
189
  * @param values list of values that will be pushed to the array.
190
190
  */
191
191
  push(...values) {
192
- let size = this.#array.length;
192
+ const size = this.#array.length;
193
193
  Array.prototype.push.apply(this.#array, values);
194
194
  this.notifyRowAdded(size, arguments.length);
195
195
  }
@@ -199,7 +199,7 @@ class ArrayModel extends Model {
199
199
  * @returns The removed element or undefined if the array is empty.
200
200
  */
201
201
  pop() {
202
- let last = this.#array.pop();
202
+ const last = this.#array.pop();
203
203
  if (last !== undefined) {
204
204
  this.notifyRowRemoved(this.#array.length, 1);
205
205
  }
@@ -213,7 +213,7 @@ class ArrayModel extends Model {
213
213
  * @param size number of rows to remove.
214
214
  */
215
215
  remove(index, size) {
216
- let r = this.#array.splice(index, size);
216
+ const r = this.#array.splice(index, size);
217
217
  this.notifyRowRemoved(index, size);
218
218
  }
219
219
  /**
@@ -377,7 +377,7 @@ var private_api;
377
377
  * @returns undefined if row is out of range otherwise the data.
378
378
  */
379
379
  rowData(row) {
380
- let data = this.sourceModel.rowData(row);
380
+ const data = this.sourceModel.rowData(row);
381
381
  if (data === undefined) {
382
382
  return undefined;
383
383
  }
@@ -447,7 +447,7 @@ class CompileError extends Error {
447
447
  exports.CompileError = CompileError;
448
448
  function loadSlint(loadData) {
449
449
  const { filePath, options } = loadData.fileData;
450
- let compiler = new napi.ComponentCompiler();
450
+ const compiler = new napi.ComponentCompiler();
451
451
  if (typeof options !== "undefined") {
452
452
  if (typeof options.style !== "undefined") {
453
453
  compiler.style = options.style;
@@ -459,32 +459,32 @@ function loadSlint(loadData) {
459
459
  compiler.libraryPaths = options.libraryPaths;
460
460
  }
461
461
  }
462
- let definitions = loadData.from === "file"
462
+ const definitions = loadData.from === "file"
463
463
  ? compiler.buildFromPath(filePath)
464
464
  : compiler.buildFromSource(loadData.fileData.source, filePath);
465
- let diagnostics = compiler.diagnostics;
465
+ const diagnostics = compiler.diagnostics;
466
466
  if (diagnostics.length > 0) {
467
- let warnings = diagnostics.filter((d) => d.level === napi.DiagnosticLevel.Warning);
467
+ const warnings = diagnostics.filter((d) => d.level === napi.DiagnosticLevel.Warning);
468
468
  if (typeof options !== "undefined" && options.quiet !== true) {
469
469
  warnings.forEach((w) => console.warn("Warning: " + w));
470
470
  }
471
- let errors = diagnostics.filter((d) => d.level === napi.DiagnosticLevel.Error);
471
+ const errors = diagnostics.filter((d) => d.level === napi.DiagnosticLevel.Error);
472
472
  if (errors.length > 0) {
473
473
  throw new CompileError("Could not compile " + filePath, errors);
474
474
  }
475
475
  }
476
- let slint_module = Object.create({});
476
+ const slint_module = Object.create({});
477
477
  Object.keys(definitions).forEach((key) => {
478
- let definition = definitions[key];
478
+ const definition = definitions[key];
479
479
  Object.defineProperty(slint_module, definition.name.replace(/-/g, "_"), {
480
480
  value: function (properties) {
481
- let instance = definition.create();
481
+ const instance = definition.create();
482
482
  if (instance == null) {
483
483
  throw Error("Could not create a component handle for" +
484
484
  filePath);
485
485
  }
486
486
  for (var key in properties) {
487
- let value = properties[key];
487
+ const value = properties[key];
488
488
  if (value instanceof Function) {
489
489
  instance.setCallback(key, value);
490
490
  }
@@ -492,9 +492,9 @@ function loadSlint(loadData) {
492
492
  instance.setProperty(key, properties[key]);
493
493
  }
494
494
  }
495
- let componentHandle = new Component(instance);
495
+ const componentHandle = new Component(instance);
496
496
  instance.definition().properties.forEach((prop) => {
497
- let propName = prop.name.replace(/-/g, "_");
497
+ const propName = prop.name.replace(/-/g, "_");
498
498
  if (componentHandle[propName] !== undefined) {
499
499
  console.warn("Duplicated property name " + propName);
500
500
  }
@@ -511,7 +511,7 @@ function loadSlint(loadData) {
511
511
  }
512
512
  });
513
513
  instance.definition().callbacks.forEach((cb) => {
514
- let callbackName = cb.replace(/-/g, "_");
514
+ const callbackName = cb.replace(/-/g, "_");
515
515
  if (componentHandle[callbackName] !== undefined) {
516
516
  console.warn("Duplicated callback name " + callbackName);
517
517
  }
@@ -530,7 +530,7 @@ function loadSlint(loadData) {
530
530
  }
531
531
  });
532
532
  instance.definition().functions.forEach((cb) => {
533
- let functionName = cb.replace(/-/g, "_");
533
+ const functionName = cb.replace(/-/g, "_");
534
534
  if (componentHandle[functionName] !== undefined) {
535
535
  console.warn("Duplicated function name " + functionName);
536
536
  }
@@ -551,12 +551,12 @@ function loadSlint(loadData) {
551
551
  console.warn("Duplicated property name " + globalName);
552
552
  }
553
553
  else {
554
- let globalObject = Object.create({});
554
+ const globalObject = Object.create({});
555
555
  instance
556
556
  .definition()
557
557
  .globalProperties(globalName)
558
558
  .forEach((prop) => {
559
- let propName = prop.name.replace(/-/g, "_");
559
+ const propName = prop.name.replace(/-/g, "_");
560
560
  if (globalObject[propName] !== undefined) {
561
561
  console.warn("Duplicated property name " +
562
562
  propName +
@@ -579,7 +579,7 @@ function loadSlint(loadData) {
579
579
  .definition()
580
580
  .globalCallbacks(globalName)
581
581
  .forEach((cb) => {
582
- let callbackName = cb.replace(/-/g, "_");
582
+ const callbackName = cb.replace(/-/g, "_");
583
583
  if (globalObject[callbackName] !== undefined) {
584
584
  console.warn("Duplicated property name " +
585
585
  cb +
@@ -604,7 +604,7 @@ function loadSlint(loadData) {
604
604
  .definition()
605
605
  .globalFunctions(globalName)
606
606
  .forEach((cb) => {
607
- let functionName = cb.replace(/-/g, "_");
607
+ const functionName = cb.replace(/-/g, "_");
608
608
  if (globalObject[functionName] !== undefined) {
609
609
  console.warn("Duplicated function name " +
610
610
  cb +
@@ -733,7 +733,7 @@ class EventLoop {
733
733
  // Give the nodejs event loop 16 ms to tick. This polling is sub-optimal, but it's the best we
734
734
  // can do right now.
735
735
  const nodejsPollInterval = 16;
736
- let id = setInterval(() => {
736
+ const id = setInterval(() => {
737
737
  if (napi.processEvents() === napi.ProcessEventsResult.Exited ||
738
738
  this.#quit_loop) {
739
739
  clearInterval(id);
package/index.ts CHANGED
@@ -126,7 +126,7 @@ class ModelIterator<T> implements Iterator<T> {
126
126
 
127
127
  public next(): IteratorResult<T> {
128
128
  if (this.row < this.model.rowCount()) {
129
- let row = this.row;
129
+ const row = this.row;
130
130
  this.row++;
131
131
  return {
132
132
  done: false,
@@ -341,7 +341,7 @@ export class ArrayModel<T> extends Model<T> {
341
341
  * @param values list of values that will be pushed to the array.
342
342
  */
343
343
  push(...values: T[]) {
344
- let size = this.#array.length;
344
+ const size = this.#array.length;
345
345
  Array.prototype.push.apply(this.#array, values);
346
346
  this.notifyRowAdded(size, arguments.length);
347
347
  }
@@ -352,7 +352,7 @@ export class ArrayModel<T> extends Model<T> {
352
352
  * @returns The removed element or undefined if the array is empty.
353
353
  */
354
354
  pop(): T | undefined {
355
- let last = this.#array.pop();
355
+ const last = this.#array.pop();
356
356
  if (last !== undefined) {
357
357
  this.notifyRowRemoved(this.#array.length, 1);
358
358
  }
@@ -367,7 +367,7 @@ export class ArrayModel<T> extends Model<T> {
367
367
  * @param size number of rows to remove.
368
368
  */
369
369
  remove(index: number, size: number) {
370
- let r = this.#array.splice(index, size);
370
+ const r = this.#array.splice(index, size);
371
371
  this.notifyRowRemoved(index, size);
372
372
  }
373
373
 
@@ -535,7 +535,7 @@ export namespace private_api {
535
535
  * @returns undefined if row is out of range otherwise the data.
536
536
  */
537
537
  rowData(row: number): U | undefined {
538
- let data = this.sourceModel.rowData(row);
538
+ const data = this.sourceModel.rowData(row);
539
539
  if (data === undefined) {
540
540
  return undefined;
541
541
  }
@@ -692,7 +692,7 @@ type LoadData =
692
692
  function loadSlint(loadData: LoadData): Object {
693
693
  const { filePath, options } = loadData.fileData;
694
694
 
695
- let compiler = new napi.ComponentCompiler();
695
+ const compiler = new napi.ComponentCompiler();
696
696
 
697
697
  if (typeof options !== "undefined") {
698
698
  if (typeof options.style !== "undefined") {
@@ -706,14 +706,14 @@ function loadSlint(loadData: LoadData): Object {
706
706
  }
707
707
  }
708
708
 
709
- let definitions =
709
+ const definitions =
710
710
  loadData.from === "file"
711
711
  ? compiler.buildFromPath(filePath)
712
712
  : compiler.buildFromSource(loadData.fileData.source, filePath);
713
- let diagnostics = compiler.diagnostics;
713
+ const diagnostics = compiler.diagnostics;
714
714
 
715
715
  if (diagnostics.length > 0) {
716
- let warnings = diagnostics.filter(
716
+ const warnings = diagnostics.filter(
717
717
  (d) => d.level === napi.DiagnosticLevel.Warning,
718
718
  );
719
719
 
@@ -721,7 +721,7 @@ function loadSlint(loadData: LoadData): Object {
721
721
  warnings.forEach((w) => console.warn("Warning: " + w));
722
722
  }
723
723
 
724
- let errors = diagnostics.filter(
724
+ const errors = diagnostics.filter(
725
725
  (d) => d.level === napi.DiagnosticLevel.Error,
726
726
  );
727
727
 
@@ -730,17 +730,17 @@ function loadSlint(loadData: LoadData): Object {
730
730
  }
731
731
  }
732
732
 
733
- let slint_module = Object.create({});
733
+ const slint_module = Object.create({});
734
734
 
735
735
  Object.keys(definitions).forEach((key) => {
736
- let definition = definitions[key];
736
+ const definition = definitions[key];
737
737
 
738
738
  Object.defineProperty(
739
739
  slint_module,
740
740
  definition.name.replace(/-/g, "_"),
741
741
  {
742
742
  value: function (properties: any) {
743
- let instance = definition.create();
743
+ const instance = definition.create();
744
744
 
745
745
  if (instance == null) {
746
746
  throw Error(
@@ -750,7 +750,7 @@ function loadSlint(loadData: LoadData): Object {
750
750
  }
751
751
 
752
752
  for (var key in properties) {
753
- let value = properties[key];
753
+ const value = properties[key];
754
754
 
755
755
  if (value instanceof Function) {
756
756
  instance.setCallback(key, value);
@@ -759,9 +759,9 @@ function loadSlint(loadData: LoadData): Object {
759
759
  }
760
760
  }
761
761
 
762
- let componentHandle = new Component(instance!);
762
+ const componentHandle = new Component(instance!);
763
763
  instance!.definition().properties.forEach((prop) => {
764
- let propName = prop.name.replace(/-/g, "_");
764
+ const propName = prop.name.replace(/-/g, "_");
765
765
 
766
766
  if (componentHandle[propName] !== undefined) {
767
767
  console.warn(
@@ -781,7 +781,7 @@ function loadSlint(loadData: LoadData): Object {
781
781
  });
782
782
 
783
783
  instance!.definition().callbacks.forEach((cb) => {
784
- let callbackName = cb.replace(/-/g, "_");
784
+ const callbackName = cb.replace(/-/g, "_");
785
785
 
786
786
  if (componentHandle[callbackName] !== undefined) {
787
787
  console.warn(
@@ -810,7 +810,7 @@ function loadSlint(loadData: LoadData): Object {
810
810
  });
811
811
 
812
812
  instance!.definition().functions.forEach((cb) => {
813
- let functionName = cb.replace(/-/g, "_");
813
+ const functionName = cb.replace(/-/g, "_");
814
814
 
815
815
  if (componentHandle[functionName] !== undefined) {
816
816
  console.warn(
@@ -842,13 +842,16 @@ function loadSlint(loadData: LoadData): Object {
842
842
  "Duplicated property name " + globalName,
843
843
  );
844
844
  } else {
845
- let globalObject = Object.create({});
845
+ const globalObject = Object.create({});
846
846
 
847
847
  instance!
848
848
  .definition()
849
849
  .globalProperties(globalName)
850
850
  .forEach((prop) => {
851
- let propName = prop.name.replace(/-/g, "_");
851
+ const propName = prop.name.replace(
852
+ /-/g,
853
+ "_",
854
+ );
852
855
 
853
856
  if (globalObject[propName] !== undefined) {
854
857
  console.warn(
@@ -885,7 +888,7 @@ function loadSlint(loadData: LoadData): Object {
885
888
  .definition()
886
889
  .globalCallbacks(globalName)
887
890
  .forEach((cb) => {
888
- let callbackName = cb.replace(/-/g, "_");
891
+ const callbackName = cb.replace(/-/g, "_");
889
892
 
890
893
  if (
891
894
  globalObject[callbackName] !== undefined
@@ -929,7 +932,7 @@ function loadSlint(loadData: LoadData): Object {
929
932
  .definition()
930
933
  .globalFunctions(globalName)
931
934
  .forEach((cb) => {
932
- let functionName = cb.replace(/-/g, "_");
935
+ const functionName = cb.replace(/-/g, "_");
933
936
 
934
937
  if (
935
938
  globalObject[functionName] !== undefined
@@ -1089,7 +1092,7 @@ class EventLoop {
1089
1092
  // Give the nodejs event loop 16 ms to tick. This polling is sub-optimal, but it's the best we
1090
1093
  // can do right now.
1091
1094
  const nodejsPollInterval = 16;
1092
- let id = setInterval(() => {
1095
+ const id = setInterval(() => {
1093
1096
  if (
1094
1097
  napi.processEvents() === napi.ProcessEventsResult.Exited ||
1095
1098
  this.#quit_loop
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slint-ui",
3
- "version": "1.8.0-nightly.2024091017",
3
+ "version": "1.8.0-nightly.2024091220",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "homepage": "https://github.com/slint-ui/slint",
@@ -45,7 +45,7 @@
45
45
  "format": "biome format",
46
46
  "format:fix": "biome format --write",
47
47
  "lint": "biome lint",
48
- "lint:fix": "biome check --apply",
48
+ "lint:fix": "biome lint --fix",
49
49
  "test": "ava"
50
50
  },
51
51
  "ava": {
@@ -65,10 +65,10 @@
65
65
  "@napi-rs/cli": "^2.16.5"
66
66
  },
67
67
  "optionalDependencies": {
68
- "@slint-ui/slint-ui-binary-linux-x64-gnu": "1.8.0-nightly.2024091017",
69
- "@slint-ui/slint-ui-binary-darwin-x64": "1.8.0-nightly.2024091017",
70
- "@slint-ui/slint-ui-binary-darwin-arm64": "1.8.0-nightly.2024091017",
71
- "@slint-ui/slint-ui-binary-win32-x64-msvc": "1.8.0-nightly.2024091017",
72
- "@slint-ui/slint-ui-binary-win32-ia32-msvc": "1.8.0-nightly.2024091017"
68
+ "@slint-ui/slint-ui-binary-linux-x64-gnu": "1.8.0-nightly.2024091220",
69
+ "@slint-ui/slint-ui-binary-darwin-x64": "1.8.0-nightly.2024091220",
70
+ "@slint-ui/slint-ui-binary-darwin-arm64": "1.8.0-nightly.2024091220",
71
+ "@slint-ui/slint-ui-binary-win32-x64-msvc": "1.8.0-nightly.2024091220",
72
+ "@slint-ui/slint-ui-binary-win32-ia32-msvc": "1.8.0-nightly.2024091220"
73
73
  }
74
74
  }