@difizen/libro-jupyter 0.2.24 → 0.2.26

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.
@@ -1 +1 @@
1
- {"version":3,"file":"kernel-selector-dropdown.d.ts","sourceRoot":"","sources":["../../src/toolbar/kernel-selector-dropdown.tsx"],"names":[],"mappings":";AASA,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AA8FD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EA0HlC,CAAC"}
1
+ {"version":3,"file":"kernel-selector-dropdown.d.ts","sourceRoot":"","sources":["../../src/toolbar/kernel-selector-dropdown.tsx"],"names":[],"mappings":";AAUA,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAsGD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EA0HlC,CAAC"}
@@ -87,9 +87,17 @@ function getKernelListItems(preferredSessionKernelList, otherKernelList, allowPr
87
87
  key: 'ShutDownKernel',
88
88
  label: 'Shut Down the Kernel'
89
89
  }];
90
- if (!allowPreferredSession) {
91
- array = array.filter(function (item) {
92
- return item.key !== 'UseKernelFromPreferredSession';
90
+ if (allowPreferredSession) {
91
+ array.splice(2, 0, {
92
+ key: 'UseKernelFromPreferredSession',
93
+ type: 'group',
94
+ label: 'Use Kernel from Preferred Session',
95
+ children: preferredSessionKernelList.map(function (item) {
96
+ return {
97
+ key: item.fileName,
98
+ label: item.fileName
99
+ };
100
+ })
93
101
  });
94
102
  }
95
103
  return array;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-jupyter",
3
- "version": "0.2.24",
3
+ "version": "0.2.26",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro"
@@ -31,22 +31,22 @@
31
31
  "src"
32
32
  ],
33
33
  "dependencies": {
34
- "@difizen/libro-cofine-editor": "^0.2.24",
35
- "@difizen/libro-code-editor": "^0.2.24",
36
- "@difizen/libro-code-cell": "^0.2.24",
37
- "@difizen/libro-codemirror": "^0.2.24",
38
- "@difizen/libro-rendermime": "^0.2.24",
39
- "@difizen/libro-common": "^0.2.24",
40
- "@difizen/libro-core": "^0.2.24",
41
- "@difizen/libro-kernel": "^0.2.24",
42
- "@difizen/libro-l10n": "^0.2.24",
43
- "@difizen/libro-output": "^0.2.24",
44
- "@difizen/libro-search": "^0.2.24",
45
- "@difizen/libro-search-code-cell": "^0.2.24",
46
- "@difizen/libro-lsp": "^0.2.24",
47
- "@difizen/libro-markdown-cell": "^0.2.24",
48
- "@difizen/libro-raw-cell": "^0.2.24",
49
- "@difizen/libro-language-client": "^0.2.24",
34
+ "@difizen/libro-cofine-editor": "^0.2.26",
35
+ "@difizen/libro-code-editor": "^0.2.26",
36
+ "@difizen/libro-code-cell": "^0.2.26",
37
+ "@difizen/libro-codemirror": "^0.2.26",
38
+ "@difizen/libro-rendermime": "^0.2.26",
39
+ "@difizen/libro-common": "^0.2.26",
40
+ "@difizen/libro-core": "^0.2.26",
41
+ "@difizen/libro-kernel": "^0.2.26",
42
+ "@difizen/libro-l10n": "^0.2.26",
43
+ "@difizen/libro-output": "^0.2.26",
44
+ "@difizen/libro-search": "^0.2.26",
45
+ "@difizen/libro-search-code-cell": "^0.2.26",
46
+ "@difizen/libro-lsp": "^0.2.26",
47
+ "@difizen/libro-markdown-cell": "^0.2.26",
48
+ "@difizen/libro-raw-cell": "^0.2.26",
49
+ "@difizen/libro-language-client": "^0.2.26",
50
50
  "@difizen/mana-app": "latest",
51
51
  "@difizen/mana-l10n": "latest",
52
52
  "@ant-design/colors": "^7.0.0",
@@ -3,6 +3,7 @@ import type { LibroView } from '@difizen/libro-core';
3
3
  import { LibroKernelConnectionManager, KernelSpecManager } from '@difizen/libro-kernel';
4
4
  import { ConfigurationService, useInject, ViewInstance } from '@difizen/mana-app';
5
5
  import { Dropdown, Space } from 'antd';
6
+ import type { MenuProps } from 'antd';
6
7
  import { useCallback, useEffect, useState } from 'react';
7
8
 
8
9
  import { LibroJupyterConfiguration } from '../config/index.js';
@@ -57,7 +58,7 @@ function getKernelListItems(
57
58
  otherKernelList: OtherKernelListElem[],
58
59
  allowPreferredSession: boolean,
59
60
  ) {
60
- let array = [
61
+ const array: MenuProps['items'] = [
61
62
  {
62
63
  key: 'StartPreferredKernel',
63
64
  type: 'group',
@@ -104,9 +105,17 @@ function getKernelListItems(
104
105
  label: 'Shut Down the Kernel',
105
106
  },
106
107
  ];
107
- if (!allowPreferredSession) {
108
- array = array.filter((item) => {
109
- return item.key !== 'UseKernelFromPreferredSession';
108
+ if (allowPreferredSession) {
109
+ array.splice(2, 0, {
110
+ key: 'UseKernelFromPreferredSession',
111
+ type: 'group',
112
+ label: 'Use Kernel from Preferred Session',
113
+ children: preferredSessionKernelList.map((item) => {
114
+ return {
115
+ key: item.fileName,
116
+ label: item.fileName,
117
+ };
118
+ }),
110
119
  });
111
120
  }
112
121
  return array;