@difizen/libro-lab 0.2.20 → 0.2.21

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.
Files changed (34) hide show
  1. package/es/common/icon.d.ts.map +1 -1
  2. package/es/common/icon.js +12 -62
  3. package/es/index.less +29 -23
  4. package/es/kernel-and-terminal-panel/collapse/index.less +3 -3
  5. package/es/kernel-and-terminal-panel/kernel-and-terminal-panel-view.d.ts.map +1 -1
  6. package/es/kernel-and-terminal-panel/kernel-and-terminal-panel-view.js +89 -82
  7. package/es/kernel-and-terminal-panel/kernel-color-registry.d.ts +6 -0
  8. package/es/kernel-and-terminal-panel/kernel-color-registry.d.ts.map +1 -0
  9. package/es/kernel-and-terminal-panel/kernel-color-registry.js +96 -0
  10. package/es/kernel-and-terminal-panel/module.d.ts.map +1 -1
  11. package/es/kernel-and-terminal-panel/module.js +2 -1
  12. package/es/lab-color-registry.d.ts +6 -0
  13. package/es/lab-color-registry.d.ts.map +1 -0
  14. package/es/lab-color-registry.js +124 -0
  15. package/es/layout/footer/index.less +1 -1
  16. package/es/layout/index.less +9 -3
  17. package/es/module.d.ts.map +1 -1
  18. package/es/module.js +2 -1
  19. package/es/toc/libro-toc-panel-view.d.ts.map +1 -1
  20. package/es/toc/libro-toc-panel-view.js +16 -10
  21. package/es/welcome/index.less +10 -10
  22. package/package.json +10 -10
  23. package/src/common/icon.tsx +36 -52
  24. package/src/index.less +29 -23
  25. package/src/kernel-and-terminal-panel/collapse/index.less +3 -3
  26. package/src/kernel-and-terminal-panel/kernel-and-terminal-panel-view.tsx +50 -38
  27. package/src/kernel-and-terminal-panel/kernel-color-registry.ts +84 -0
  28. package/src/kernel-and-terminal-panel/module.ts +2 -0
  29. package/src/lab-color-registry.ts +119 -0
  30. package/src/layout/footer/index.less +1 -1
  31. package/src/layout/index.less +9 -3
  32. package/src/module.tsx +2 -0
  33. package/src/toc/libro-toc-panel-view.tsx +23 -12
  34. package/src/welcome/index.less +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/common/icon.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,MAAM;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AACD,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,2CAiCjC;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,2CA6BpC;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,2CA8BrC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,2CA+EzC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,2CAoC3C;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,2CAwCxC;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,2CAiCrC;AAED,wBAAgB,iBAAiB,4CA6ChC;AAED,wBAAgB,UAAU,4CAmDzB;AAED,wBAAgB,eAAe,4CAmD9B;AAED,wBAAgB,aAAa,4CAsD5B;AAED,wBAAgB,eAAe,4CA0C9B;AAED,wBAAgB,UAAU,4CA0CzB"}
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/common/icon.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,MAAM;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AACD,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,2CAiCjC;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,2CAmCpC;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,2CA8BrC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,2CA+EzC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,2CA0C3C;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,2CA8CxC;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,2CAuCrC;AAED,wBAAgB,iBAAiB,4CA4ChC;AAED,wBAAgB,UAAU,4CAmDzB;AAED,wBAAgB,eAAe,4CAmD9B;AAED,wBAAgB,aAAa,4CAsD5B;AAED,wBAAgB,eAAe,4CAE9B;AAED,wBAAgB,UAAU,4CA0CzB"}
package/es/common/icon.js CHANGED
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ import { CodeFilled } from '@ant-design/icons';
2
3
  import "./index.less";
3
4
  import { jsx as _jsx } from "react/jsx-runtime";
4
5
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -55,7 +56,7 @@ export function TocIcon(props) {
55
56
  id: "\u4EE3\u7801\u7247\u6BB5",
56
57
  stroke: "none",
57
58
  strokeWidth: "1",
58
- fill: "none",
59
+ fill: "currentColor",
59
60
  fillRule: "evenodd",
60
61
  children: /*#__PURE__*/_jsx("g", {
61
62
  id: "1.4\u7F16\u8F91\u72B6\u6001\u5907\u4EFD",
@@ -97,7 +98,7 @@ export function Loadding(props) {
97
98
  children: /*#__PURE__*/_jsx("g", {
98
99
  id: "1.1\u5BB9\u5668\u52A0\u8F7D\u4E2D-\u5173\u95ED\u63D0\u793A",
99
100
  transform: "translate(-1362.000000, -879.000000)",
100
- fill: "#1890FF",
101
+ fill: "currentColor",
101
102
  children: /*#__PURE__*/_jsx("g", {
102
103
  id: "\u7F16\u7EC4-20",
103
104
  transform: "translate(0.000000, 872.000000)",
@@ -209,12 +210,12 @@ export function PreferenceIcon(props) {
209
210
  id: "\u6574\u4F53\u6846\u67B6\u90E8\u5206",
210
211
  stroke: "none",
211
212
  strokeWidth: "1",
212
- fill: "none",
213
+ fill: "currentColor",
213
214
  fillRule: "evenodd",
214
215
  children: /*#__PURE__*/_jsx("g", {
215
216
  id: "1.2\u5BB9\u5668\u52A0\u8F7D\u5B8C\u6210",
216
217
  transform: "translate(-330.000000, -970.000000)",
217
- fill: "#333333",
218
+ fill: "currentColor",
218
219
  fillRule: "nonzero",
219
220
  children: /*#__PURE__*/_jsx("g", {
220
221
  id: "\u7F16\u7EC4-19",
@@ -257,12 +258,12 @@ export function KeybindIcon(props) {
257
258
  id: "\u6574\u4F53\u6846\u67B6\u90E8\u5206",
258
259
  stroke: "none",
259
260
  strokeWidth: "1",
260
- fill: "none",
261
+ fill: "currentColor",
261
262
  fillRule: "evenodd",
262
263
  children: /*#__PURE__*/_jsx("g", {
263
264
  id: "1.2\u5BB9\u5668\u52A0\u8F7D\u5B8C\u6210",
264
265
  transform: "translate(-446.000000, -970.000000)",
265
- fill: "#333333",
266
+ fill: "currentColor",
266
267
  fillRule: "nonzero",
267
268
  children: /*#__PURE__*/_jsx("g", {
268
269
  id: "\u7F16\u7EC4-19",
@@ -309,12 +310,12 @@ export function SuccIcon(props) {
309
310
  id: "\u6574\u4F53\u6846\u67B6\u90E8\u5206",
310
311
  stroke: "none",
311
312
  strokeWidth: "1",
312
- fill: "none",
313
+ fill: "currentColor",
313
314
  fillRule: "evenodd",
314
315
  children: /*#__PURE__*/_jsx("g", {
315
316
  id: "1.2\u5BB9\u5668\u52A0\u8F7D\u5B8C\u6210",
316
317
  transform: "translate(-1392.000000, -1073.000000)",
317
- fill: "#52C41A",
318
+ fill: "currentColor",
318
319
  children: /*#__PURE__*/_jsx("g", {
319
320
  id: "\u7F16\u7EC4-26",
320
321
  transform: "translate(24.000000, 1070.000000)",
@@ -381,13 +382,12 @@ export function KernelAndTerminal() {
381
382
  id: "\u4EE3\u7801\u7247\u6BB5",
382
383
  stroke: "none",
383
384
  strokeWidth: "1",
384
- fill: "none",
385
+ fill: "currentColor",
385
386
  fillRule: "evenodd",
386
- fillOpacity: "0.35",
387
387
  children: /*#__PURE__*/_jsx("g", {
388
388
  id: "1.1\u641C\u7D22",
389
389
  transform: "translate(-12.000000, -142.000000)",
390
- fill: "#000000",
390
+ fill: "currentColor",
391
391
  fillRule: "nonzero",
392
392
  children: /*#__PURE__*/_jsx("g", {
393
393
  id: "\u7F16\u7EC4-2",
@@ -587,57 +587,7 @@ export function runningKernel() {
587
587
  });
588
588
  }
589
589
  export function runningTerminal() {
590
- return /*#__PURE__*/_jsxs("svg", {
591
- width: "12px",
592
- height: "12px",
593
- viewBox: "0 0 12 12",
594
- version: "1.1",
595
- xmlns: "http://www.w3.org/2000/svg",
596
- xmlnsXlink: "http://www.w3.org/1999/xlink",
597
- children: [/*#__PURE__*/_jsx("title", {
598
- children: "bxs-terminal"
599
- }), /*#__PURE__*/_jsx("g", {
600
- id: "kernel\u7BA1\u7406\u9762\u677F",
601
- stroke: "none",
602
- strokeWidth: "1",
603
- fill: "none",
604
- fillRule: "evenodd",
605
- opacity: "0.45",
606
- children: /*#__PURE__*/_jsx("g", {
607
- id: "2.0\u5C55\u5F00",
608
- transform: "translate(-52.000000, -332.000000)",
609
- fill: "#000000",
610
- fillRule: "nonzero",
611
- children: /*#__PURE__*/_jsx("g", {
612
- id: "\u7F16\u7EC4-2",
613
- transform: "translate(0.000000, 56.000000)",
614
- children: /*#__PURE__*/_jsx("g", {
615
- id: "\u7F16\u7EC4-11",
616
- transform: "translate(40.000000, 0.000000)",
617
- children: /*#__PURE__*/_jsx("g", {
618
- id: "\u7F16\u7EC4-16\u5907\u4EFD-4",
619
- transform: "translate(12.000000, 272.000000)",
620
- children: /*#__PURE__*/_jsxs("g", {
621
- id: "bxs-terminal",
622
- transform: "translate(0.000000, 4.000000)",
623
- children: [/*#__PURE__*/_jsx("rect", {
624
- id: "\u77E9\u5F62",
625
- opacity: "0",
626
- x: "0",
627
- y: "0",
628
- width: "12",
629
- height: "12"
630
- }), /*#__PURE__*/_jsx("path", {
631
- d: "M9.99999609,2.00000391 L1.99999609,2.00000391 C1.73478642,2.00000391 1.48043049,2.10535585 1.29289231,2.29289184 C1.10535413,2.48042782 0.999996094,2.73478252 0.999996094,3.00000391 L0.999996094,9.00000391 C0.999996094,9.26521748 1.10535413,9.51957218 1.29289231,9.70710816 C1.48043049,9.89464415 1.73478642,10.0000039 1.99999609,10.0000039 L9.99999609,10.0000039 C10.2652136,10.0000039 10.5195695,9.89464415 10.7071077,9.70710816 C10.8946459,9.51957218 10.9999961,9.26521748 10.9999961,9.00000391 L10.9999961,3.00000391 C10.9999961,2.73478252 10.8946459,2.48042782 10.7071077,2.29289184 C10.5195695,2.10535585 10.2652136,2.00000391 9.99999609,2.00000391 Z M3.207,7.85349609 L2.49998438,7.14650391 L3.64648828,6 L2.49998438,4.85349609 L3.20698828,4.14650391 L5.06049609,6 L3.207,7.85349609 Z M9.5,7.99999609 L6,7.99999609 L6,6.99999609 L9.5,6.99999609 L9.5,7.99999609 L9.5,7.99999609 Z",
632
- id: "\u5F62\u72B6"
633
- })]
634
- })
635
- })
636
- })
637
- })
638
- })
639
- })]
640
- });
590
+ return /*#__PURE__*/_jsx(CodeFilled, {});
641
591
  }
642
592
  export function existedLSP() {
643
593
  return /*#__PURE__*/_jsxs("svg", {
package/es/index.less CHANGED
@@ -1,12 +1,22 @@
1
+ /* stylelint-disable selector-no-vendor-prefix */
2
+ a:-webkit-any-link {
3
+ color: unset;
4
+ }
5
+
6
+ .libro-lab-layout {
7
+ .ant-empty {
8
+ .ant-empty-description {
9
+ color: var(--mana-ant-color-text-description);
10
+ }
11
+ }
12
+ }
13
+
1
14
  #libro-lab-content-layout-left {
2
15
  .mana-side-tab-view {
3
16
  .mana-tabs-left {
4
17
  .mana-tabs-nav {
5
- background-color: #f0f2f51f;
18
+ background-color: var(--mana-ant-color-bg-elevated);
6
19
  min-width: 40px;
7
- box-shadow:
8
- 1px 0 0 0 #000a1a02,
9
- 2px 0 0 0 #ffffff0c;
10
20
 
11
21
  .mana-tabs-ink-bar {
12
22
  display: none;
@@ -37,28 +47,29 @@
37
47
  }
38
48
 
39
49
  .mana-tabs-tab-btn:hover {
40
- background-color: #000a1a1f;
41
-
42
50
  .mana-tab-icon {
43
- color: #00000059;
51
+ color: var(--mana-ant-color-icon);
44
52
  }
45
53
  }
46
54
 
47
55
  .mana-tabs-tab-active {
48
56
  .mana-tabs-tab-btn {
49
- background-color: #000a1a1f;
50
-
51
57
  .mana-tab-icon {
52
- color: #000a1a7f;
58
+ color: var(--mana-ant-color-icon-hover);
53
59
  }
54
60
  }
55
61
  }
56
62
  }
57
63
 
58
64
  .mana-tabs-content-holder {
59
- background-image: linear-gradient(269deg, #c8c8cd1f 0%, #ffffff1f 100%);
65
+ background-image: linear-gradient(
66
+ 269deg,
67
+ var(--mana-libro-lab-content-tab-nav) 0%,
68
+ var(--mana-libro-background)
69
+ );
60
70
  border-left: none;
61
- background-color: unset;
71
+ box-shadow: var(--mana-ant-box-shadow-tabs-overflow-left);
72
+ padding-left: 2px;
62
73
 
63
74
  .mana-tab-side-pane-content {
64
75
  height: calc(100% - 32px);
@@ -69,22 +80,17 @@
69
80
  }
70
81
 
71
82
  #libro-lab-content-layout-main {
72
- background-color: #f8f8fb;
83
+ background-color: var(--mana-libro-lab-content-tab-nav);
73
84
 
74
85
  .mana-tabs-nav {
75
- background-color: #f8f8fb;
86
+ background-color: var(--mana-libro-lab-content-tab-nav);
87
+ }
88
+
89
+ .mana-tabs-tab-active {
90
+ background-color: var(--mana-libro-lab-content-tab-active-background);
76
91
  }
77
92
  }
78
93
 
79
94
  #libro-lab-content-layout-main-container {
80
95
  overflow: auto;
81
96
  }
82
-
83
- .default-folder-icon,
84
- .default-file-icon {
85
- color: #00000072;
86
- }
87
-
88
- .mana-tree-node-segment-grow {
89
- color: #000000a5;
90
- }
@@ -5,7 +5,7 @@
5
5
 
6
6
  .libro-panel-collapse-header {
7
7
  user-select: none; // 双击不选中文本
8
- color: rgba(0, 10, 26, 68%);
8
+ color: var(--mana-libro-lab-kernel-panel-collapse-header-label);
9
9
  font-size: 12px;
10
10
 
11
11
  .libro-panel-collapse-header-left {
@@ -25,7 +25,7 @@
25
25
  .libro-panel-collapse-header-closeAll {
26
26
  // display: inline-block;
27
27
  cursor: pointer;
28
- color: rgba(0, 10, 26, 47%);
28
+ color: var(--mana-ant-color-text-secondary);
29
29
  float: right;
30
30
  }
31
31
  }
@@ -40,7 +40,7 @@
40
40
  .libro-panel-collapse-kernel-item {
41
41
  cursor: pointer;
42
42
  user-select: none; // 双击不选中文本
43
- color: rgba(0, 10, 26, 65%);
43
+ color: var(--mana-libro-lab-kernel-panel-collapse-item-text);
44
44
  font-size: 12px;
45
45
  margin: 8px 0;
46
46
  padding: 0 10px;
@@ -1 +1 @@
1
- {"version":3,"file":"kernel-and-terminal-panel-view.d.ts","sourceRoot":"","sources":["../../src/kernel-and-terminal-panel/kernel-and-terminal-panel-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAoB,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EACL,QAAQ,EACR,eAAe,EAMf,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAI3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAQ5D,OAAO,cAAc,CAAC;AAsJtB,eAAO,MAAM,4BAA4B,mCAAmC,CAAC;AAE7E,qBAEa,0BAA2B,SAAQ,QAAQ;IAC7C,IAAI,yBAAe;IACP,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;IACjC,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAE9D,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,eAAe,EAAE,eAAe,CAAC;IACjC,0BAA0B,EAAE,0BAA0B,CAAC;IACvD,eAAe,EAAE,eAAe,CAAC;gBAGH,kBAAkB,EAAE,kBAAkB,EACrC,mBAAmB,EAAE,mBAAmB,EAC5C,eAAe,EAAE,eAAe,EAEzD,0BAA0B,EAAE,0BAA0B,EAC7B,eAAe,EAAE,eAAe;IAa3D,mBAAmB,IAAI,eAAe;IAMtC,OAAO;CAKR"}
1
+ {"version":3,"file":"kernel-and-terminal-panel-view.d.ts","sourceRoot":"","sources":["../../src/kernel-and-terminal-panel/kernel-and-terminal-panel-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAoB,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EACL,QAAQ,EACR,eAAe,EAOf,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAK3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAQ5D,OAAO,cAAc,CAAC;AAgKtB,eAAO,MAAM,4BAA4B,mCAAmC,CAAC;AAE7E,qBAEa,0BAA2B,SAAQ,QAAQ;IAC7C,IAAI,yBAAe;IACP,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;IACjC,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAE9D,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,eAAe,EAAE,eAAe,CAAC;IACjC,0BAA0B,EAAE,0BAA0B,CAAC;IACvD,eAAe,EAAE,eAAe,CAAC;gBAGH,kBAAkB,EAAE,kBAAkB,EACrC,mBAAmB,EAAE,mBAAmB,EAC5C,eAAe,EAAE,eAAe,EAEzD,0BAA0B,EAAE,0BAA0B,EAC7B,eAAe,EAAE,eAAe;IAa3D,mBAAmB,IAAI,eAAe;IAMtC,OAAO;CAKR"}
@@ -32,7 +32,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
32
32
  import { LibroKernelManager, LibroSessionManager } from '@difizen/libro-kernel';
33
33
  import { LibroLanguageClientManager } from '@difizen/libro-language-client';
34
34
  import { TerminalCommands, TerminalManager } from '@difizen/libro-terminal';
35
- import { BaseView, CommandRegistry, inject, singleton, useInject, view, ViewInstance, ViewManager } from '@difizen/mana-app';
35
+ import { BaseView, CommandRegistry, inject, singleton, ThemeService, useInject, view, ViewInstance, ViewManager } from '@difizen/mana-app';
36
+ import { ConfigProvider, theme } from 'antd';
36
37
  import { useEffect, useState } from 'react';
37
38
  import { KernelAndTerminal } from "../common/index.js";
38
39
  import { LibroLabLayoutSlots } from "../index.js";
@@ -44,6 +45,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
44
45
  var PanelRender = function PanelRender() {
45
46
  var instance = useInject(ViewInstance);
46
47
  var openedTabView = instance.getAllOpenedTabView();
48
+ var themeService = useInject(ThemeService);
47
49
  var libroKernelManager = instance.libroKernelManager,
48
50
  libroSessionManager = instance.libroSessionManager,
49
51
  terminalManager = instance.terminalManager,
@@ -204,88 +206,93 @@ var PanelRender = function PanelRender() {
204
206
 
205
207
  // eslint-disable-next-line react-hooks/exhaustive-deps
206
208
  }, [terminalManager.runningModels]);
207
- return /*#__PURE__*/_jsxs("div", {
208
- className: "kernel-and-terminal-panel",
209
- children: [/*#__PURE__*/_jsx(LibroCollapse, {
210
- type: LibroPanelCollapseItemType.PAGE,
211
- items: openedTabView.children.map(function (item) {
212
- return {
213
- id: item.id + '',
214
- name: item.title.label
215
- };
216
- }),
217
- tabView: openedTabView,
218
- shutdownAll: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
219
- var _i, _arr, item;
220
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
221
- while (1) switch (_context4.prev = _context4.next) {
222
- case 0:
223
- // dispose会影响原始数组,这里使用解构赋值copy一份数组。
224
- for (_i = 0, _arr = _toConsumableArray(openedTabView.children); _i < _arr.length; _i++) {
225
- item = _arr[_i];
226
- if (item.title.closable) {
227
- item.dispose();
209
+ return /*#__PURE__*/_jsx(ConfigProvider, {
210
+ theme: {
211
+ algorithm: themeService.getCurrentTheme().type === 'dark' ? theme.darkAlgorithm : theme.defaultAlgorithm
212
+ },
213
+ children: /*#__PURE__*/_jsxs("div", {
214
+ className: "kernel-and-terminal-panel",
215
+ children: [/*#__PURE__*/_jsx(LibroCollapse, {
216
+ type: LibroPanelCollapseItemType.PAGE,
217
+ items: openedTabView.children.map(function (item) {
218
+ return {
219
+ id: item.id + '',
220
+ name: item.title.label
221
+ };
222
+ }),
223
+ tabView: openedTabView,
224
+ shutdownAll: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
225
+ var _i, _arr, item;
226
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
227
+ while (1) switch (_context4.prev = _context4.next) {
228
+ case 0:
229
+ // dispose会影响原始数组,这里使用解构赋值copy一份数组。
230
+ for (_i = 0, _arr = _toConsumableArray(openedTabView.children); _i < _arr.length; _i++) {
231
+ item = _arr[_i];
232
+ if (item.title.closable) {
233
+ item.dispose();
234
+ }
228
235
  }
229
- }
230
- case 1:
231
- case "end":
232
- return _context4.stop();
233
- }
234
- }, _callee4);
235
- }))
236
- }), /*#__PURE__*/_jsx(LibroCollapse, {
237
- type: LibroPanelCollapseItemType.KERNEL,
238
- items: kernelItems,
239
- shutdownAll: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
240
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
241
- while (1) switch (_context5.prev = _context5.next) {
242
- case 0:
243
- _context5.next = 2;
244
- return libroKernelManager.shutdownAll();
245
- case 2:
246
- _context5.next = 4;
247
- return libroSessionManager.refreshRunning();
248
- case 4:
249
- case "end":
250
- return _context5.stop();
251
- }
252
- }, _callee5);
253
- }))
254
- }), /*#__PURE__*/_jsx(LibroCollapse, {
255
- type: LibroPanelCollapseItemType.TERMINAL,
256
- items: terminalItems,
257
- shutdownAll: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
258
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
259
- while (1) switch (_context6.prev = _context6.next) {
260
- case 0:
261
- _context6.next = 2;
262
- return terminalManager.shutdownAll();
263
- case 2:
264
- return _context6.abrupt("return", _context6.sent);
265
- case 3:
266
- case "end":
267
- return _context6.stop();
268
- }
269
- }, _callee6);
270
- }))
271
- }), /*#__PURE__*/_jsx(LibroCollapse, {
272
- type: LibroPanelCollapseItemType.LSP,
273
- items: lspItems,
274
- shutdownAll: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
275
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
276
- while (1) switch (_context7.prev = _context7.next) {
277
- case 0:
278
- _context7.next = 2;
279
- return libroLanguageClientManager.closeAllLanguageClient();
280
- case 2:
281
- return _context7.abrupt("return", _context7.sent);
282
- case 3:
283
- case "end":
284
- return _context7.stop();
285
- }
286
- }, _callee7);
287
- }))
288
- })]
236
+ case 1:
237
+ case "end":
238
+ return _context4.stop();
239
+ }
240
+ }, _callee4);
241
+ }))
242
+ }), /*#__PURE__*/_jsx(LibroCollapse, {
243
+ type: LibroPanelCollapseItemType.KERNEL,
244
+ items: kernelItems,
245
+ shutdownAll: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
246
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
247
+ while (1) switch (_context5.prev = _context5.next) {
248
+ case 0:
249
+ _context5.next = 2;
250
+ return libroKernelManager.shutdownAll();
251
+ case 2:
252
+ _context5.next = 4;
253
+ return libroSessionManager.refreshRunning();
254
+ case 4:
255
+ case "end":
256
+ return _context5.stop();
257
+ }
258
+ }, _callee5);
259
+ }))
260
+ }), /*#__PURE__*/_jsx(LibroCollapse, {
261
+ type: LibroPanelCollapseItemType.TERMINAL,
262
+ items: terminalItems,
263
+ shutdownAll: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
264
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
265
+ while (1) switch (_context6.prev = _context6.next) {
266
+ case 0:
267
+ _context6.next = 2;
268
+ return terminalManager.shutdownAll();
269
+ case 2:
270
+ return _context6.abrupt("return", _context6.sent);
271
+ case 3:
272
+ case "end":
273
+ return _context6.stop();
274
+ }
275
+ }, _callee6);
276
+ }))
277
+ }), /*#__PURE__*/_jsx(LibroCollapse, {
278
+ type: LibroPanelCollapseItemType.LSP,
279
+ items: lspItems,
280
+ shutdownAll: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
281
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
282
+ while (1) switch (_context7.prev = _context7.next) {
283
+ case 0:
284
+ _context7.next = 2;
285
+ return libroLanguageClientManager.closeAllLanguageClient();
286
+ case 2:
287
+ return _context7.abrupt("return", _context7.sent);
288
+ case 3:
289
+ case "end":
290
+ return _context7.stop();
291
+ }
292
+ }, _callee7);
293
+ }))
294
+ })]
295
+ })
289
296
  });
290
297
  };
291
298
  export var KernelAndTerminalPanelViewId = 'libro-kernel-and-terminal-view';
@@ -0,0 +1,6 @@
1
+ import type { ColorRegistry } from '@difizen/mana-app';
2
+ import { ColorContribution } from '@difizen/mana-app';
3
+ export declare class KernelPanelColorContribution implements ColorContribution {
4
+ registerColors(colors: ColorRegistry): void;
5
+ }
6
+ //# sourceMappingURL=kernel-color-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kernel-color-registry.d.ts","sourceRoot":"","sources":["../../src/kernel-and-terminal-panel/kernel-color-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAS,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,qBACa,4BAA6B,YAAW,iBAAiB;IACpE,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;CA6E5C"}
@@ -0,0 +1,96 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _dec, _class;
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
5
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ import { Color, ColorContribution } from '@difizen/mana-app';
9
+ import { singleton } from '@difizen/mana-app';
10
+ export var KernelPanelColorContribution = (_dec = singleton({
11
+ contrib: ColorContribution
12
+ }), _dec(_class = /*#__PURE__*/function () {
13
+ function KernelPanelColorContribution() {
14
+ _classCallCheck(this, KernelPanelColorContribution);
15
+ }
16
+ _createClass(KernelPanelColorContribution, [{
17
+ key: "registerColors",
18
+ value: function registerColors(colors) {
19
+ // common
20
+ colors.register(
21
+ // #region antd variable
22
+ {
23
+ id: 'libro.lab.kernel.panel.collapse.header.label',
24
+ defaults: {
25
+ dark: '#F8F8FB',
26
+ light: Color.rgba(0, 10, 26, 0.68)
27
+ },
28
+ description: ''
29
+ }, {
30
+ id: 'libro.lab.kernel.panel.collapse.item.text',
31
+ defaults: {
32
+ dark: '#E3E4E6',
33
+ light: Color.rgba(0, 10, 26, 0.65)
34
+ },
35
+ description: ''
36
+ }, {
37
+ id: 'libro.lab.server.info.title.text',
38
+ defaults: {
39
+ dark: '#BDC0C4',
40
+ light: Color.rgba(0, 10, 26, 0.89)
41
+ },
42
+ description: ''
43
+ }, {
44
+ id: 'libro.lab.server.info.text',
45
+ defaults: {
46
+ dark: '#e3e4e6',
47
+ light: Color.rgba(0, 10, 26, 0.78)
48
+ },
49
+ description: 'welcome'
50
+ }, {
51
+ id: 'libro.lab.welcome.h3.text',
52
+ defaults: {
53
+ dark: '#EDEEEF',
54
+ light: Color.rgba(0, 10, 26, 0.89)
55
+ },
56
+ description: 'welcome'
57
+ }, {
58
+ id: 'libro.lab.welcome.entry.point.text',
59
+ defaults: {
60
+ dark: '#D6D8DA',
61
+ light: Color.rgba(0, 10, 26, 0.68)
62
+ },
63
+ description: 'welcome'
64
+ }, {
65
+ id: 'libro.lab.welcome.entry.point.text',
66
+ defaults: {
67
+ dark: '#D6D8DA',
68
+ light: Color.rgba(0, 10, 26, 0.68)
69
+ },
70
+ description: 'welcome'
71
+ }, {
72
+ id: 'libro.lab.welcome.entry.point.background',
73
+ defaults: {
74
+ dark: Color.rgba(255, 255, 255, 0.08),
75
+ light: '#000a1a05'
76
+ },
77
+ description: 'welcome'
78
+ }, {
79
+ id: 'libro.lab.welcome.service.info.background',
80
+ defaults: {
81
+ dark: Color.rgba(255, 255, 255, 0.08),
82
+ light: Color.rgba(0, 10, 26, 0.02)
83
+ },
84
+ description: 'welcome'
85
+ }, {
86
+ id: 'libro.lab.welcome.entry.point.hover.background',
87
+ defaults: {
88
+ dark: Color.rgba(255, 255, 255, 0.16),
89
+ light: Color.rgba(0, 10, 26, 0.04)
90
+ },
91
+ description: 'welcome'
92
+ });
93
+ }
94
+ }]);
95
+ return KernelPanelColorContribution;
96
+ }()) || _class);
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/kernel-and-terminal-panel/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAOrE,eAAO,MAAM,iCAAiC,YAY7C,CAAC"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/kernel-and-terminal-panel/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAQrE,eAAO,MAAM,iCAAiC,YAa7C,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { createViewPreference, ManaModule } from '@difizen/mana-app';
2
2
  import { LibroLabLayoutSlots } from "../layout/protocol.js";
3
3
  import { KernelAndTerminalPanelView } from "./kernel-and-terminal-panel-view.js";
4
+ import { KernelPanelColorContribution } from "./kernel-color-registry.js";
4
5
  import { PanelCommandContribution } from "./panel-command.js";
5
- export var LibroKernelAndTerminalPanelModule = ManaModule.create().register(PanelCommandContribution, KernelAndTerminalPanelView, createViewPreference({
6
+ export var LibroKernelAndTerminalPanelModule = ManaModule.create().register(PanelCommandContribution, KernelAndTerminalPanelView, KernelPanelColorContribution, createViewPreference({
6
7
  view: KernelAndTerminalPanelView,
7
8
  slot: LibroLabLayoutSlots.navigator,
8
9
  autoCreate: true,
@@ -0,0 +1,6 @@
1
+ import type { ColorRegistry } from '@difizen/mana-app';
2
+ import { ColorContribution } from '@difizen/mana-app';
3
+ export declare class LabColorContribution implements ColorContribution {
4
+ registerColors(colors: ColorRegistry): void;
5
+ }
6
+ //# sourceMappingURL=lab-color-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lab-color-registry.d.ts","sourceRoot":"","sources":["../src/lab-color-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAS,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,qBACa,oBAAqB,YAAW,iBAAiB;IAC5D,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;CAgH5C"}