@jupyterlab/apputils 4.3.0-alpha.2 → 4.3.0-beta.0

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.
@@ -29,6 +29,10 @@ export declare class SemanticCommand {
29
29
  * Default rank for semantic command
30
30
  */
31
31
  static readonly DEFAULT_RANK = 500;
32
+ /**
33
+ * The command IDs used by this semantic command.
34
+ */
35
+ get ids(): string[];
32
36
  /**
33
37
  * Add a command to the semantic group
34
38
  *
@@ -43,6 +47,12 @@ export declare class SemanticCommand {
43
47
  * @returns Command id
44
48
  */
45
49
  getActiveCommandId(widget: Widget): string | null;
50
+ /**
51
+ * Remove a command ID.
52
+ *
53
+ * @param id Command ID to remove
54
+ */
55
+ remove(id: string): void;
46
56
  protected _commands: Required<ISemanticCommand>[];
47
57
  }
48
58
  export {};
@@ -9,6 +9,12 @@ export class SemanticCommand {
9
9
  constructor() {
10
10
  this._commands = new Array();
11
11
  }
12
+ /**
13
+ * The command IDs used by this semantic command.
14
+ */
15
+ get ids() {
16
+ return this._commands.map(c => c.id);
17
+ }
12
18
  /**
13
19
  * Add a command to the semantic group
14
20
  *
@@ -42,6 +48,17 @@ export class SemanticCommand {
42
48
  const command = (_a = commands[0]) !== null && _a !== void 0 ? _a : { id: null };
43
49
  return command.id;
44
50
  }
51
+ /**
52
+ * Remove a command ID.
53
+ *
54
+ * @param id Command ID to remove
55
+ */
56
+ remove(id) {
57
+ const index = this._commands.findIndex(c => c.id === id);
58
+ if (index >= 0) {
59
+ this._commands.splice(index, 1);
60
+ }
61
+ }
45
62
  }
46
63
  /**
47
64
  * Default rank for semantic command
@@ -1 +1 @@
1
- {"version":3,"file":"semanticCommand.js","sourceRoot":"","sources":["../src/semanticCommand.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH;;GAEG;AACH,MAAM,OAAO,eAAe;IAA5B;QA0CY,cAAS,GAAG,IAAI,KAAK,EAA8B,CAAC;IAChE,CAAC;IArCC;;;;OAI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H,MAAM,CAAC,EAAU;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACzD,IAAI,KAAK,IAAI,CAAC,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SACjC;IACH,CAAC;;AA1DD;;GAEG;AACa,4BAAY,GAAG,GAAG,AAAN,CAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlab/apputils",
3
- "version": "4.3.0-alpha.2",
3
+ "version": "4.3.0-beta.0",
4
4
  "description": "JupyterLab - Application Utilities",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -45,15 +45,15 @@
45
45
  "watch": "tsc -b --watch"
46
46
  },
47
47
  "dependencies": {
48
- "@jupyterlab/coreutils": "^6.2.0-alpha.2",
49
- "@jupyterlab/observables": "^5.2.0-alpha.2",
50
- "@jupyterlab/rendermime-interfaces": "^3.10.0-alpha.2",
51
- "@jupyterlab/services": "^7.2.0-alpha.2",
52
- "@jupyterlab/settingregistry": "^4.2.0-alpha.2",
53
- "@jupyterlab/statedb": "^4.2.0-alpha.2",
54
- "@jupyterlab/statusbar": "^4.2.0-alpha.2",
55
- "@jupyterlab/translation": "^4.2.0-alpha.2",
56
- "@jupyterlab/ui-components": "^4.2.0-alpha.2",
48
+ "@jupyterlab/coreutils": "^6.2.0-beta.0",
49
+ "@jupyterlab/observables": "^5.2.0-beta.0",
50
+ "@jupyterlab/rendermime-interfaces": "^3.10.0-beta.0",
51
+ "@jupyterlab/services": "^7.2.0-beta.0",
52
+ "@jupyterlab/settingregistry": "^4.2.0-beta.0",
53
+ "@jupyterlab/statedb": "^4.2.0-beta.0",
54
+ "@jupyterlab/statusbar": "^4.2.0-beta.0",
55
+ "@jupyterlab/translation": "^4.2.0-beta.0",
56
+ "@jupyterlab/ui-components": "^4.2.0-beta.0",
57
57
  "@lumino/algorithm": "^2.0.1",
58
58
  "@lumino/commands": "^2.2.0",
59
59
  "@lumino/coreutils": "^2.1.2",
@@ -68,7 +68,7 @@
68
68
  "sanitize-html": "~2.12.1"
69
69
  },
70
70
  "devDependencies": {
71
- "@jupyterlab/testing": "^4.2.0-alpha.2",
71
+ "@jupyterlab/testing": "^4.2.0-beta.0",
72
72
  "@types/jest": "^29.2.0",
73
73
  "@types/sanitize-html": "^2.11.0",
74
74
  "jest": "^29.2.0",
@@ -37,6 +37,13 @@ export class SemanticCommand {
37
37
  */
38
38
  static readonly DEFAULT_RANK = 500;
39
39
 
40
+ /**
41
+ * The command IDs used by this semantic command.
42
+ */
43
+ get ids(): string[] {
44
+ return this._commands.map(c => c.id);
45
+ }
46
+
40
47
  /**
41
48
  * Add a command to the semantic group
42
49
  *
@@ -73,5 +80,17 @@ export class SemanticCommand {
73
80
  return command.id;
74
81
  }
75
82
 
83
+ /**
84
+ * Remove a command ID.
85
+ *
86
+ * @param id Command ID to remove
87
+ */
88
+ remove(id: string): void {
89
+ const index = this._commands.findIndex(c => c.id === id);
90
+ if (index >= 0) {
91
+ this._commands.splice(index, 1);
92
+ }
93
+ }
94
+
76
95
  protected _commands = new Array<Required<ISemanticCommand>>();
77
96
  }