@difizen/libro-lab 0.1.13 → 0.1.15
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/es/common/icon.d.ts +6 -0
- package/es/common/icon.d.ts.map +1 -1
- package/es/common/icon.js +326 -0
- package/es/kernel-and-terminal-panel/collapse/collapse-content.d.ts +11 -0
- package/es/kernel-and-terminal-panel/collapse/collapse-content.d.ts.map +1 -0
- package/es/kernel-and-terminal-panel/collapse/collapse-content.js +53 -0
- package/es/kernel-and-terminal-panel/collapse/index.d.ts +31 -0
- package/es/kernel-and-terminal-panel/collapse/index.d.ts.map +1 -0
- package/es/kernel-and-terminal-panel/collapse/index.js +103 -0
- package/es/kernel-and-terminal-panel/collapse/index.less +89 -0
- package/es/kernel-and-terminal-panel/collapse/kernel-collapse-content-item.d.ts +8 -0
- package/es/kernel-and-terminal-panel/collapse/kernel-collapse-content-item.d.ts.map +1 -0
- package/es/kernel-and-terminal-panel/collapse/kernel-collapse-content-item.js +79 -0
- package/es/kernel-and-terminal-panel/collapse/kernel-collapse-content.d.ts +9 -0
- package/es/kernel-and-terminal-panel/collapse/kernel-collapse-content.d.ts.map +1 -0
- package/es/kernel-and-terminal-panel/collapse/kernel-collapse-content.js +13 -0
- package/es/kernel-and-terminal-panel/collapse/page-collapse-content.d.ts +3 -0
- package/es/kernel-and-terminal-panel/collapse/page-collapse-content.d.ts.map +1 -0
- package/es/kernel-and-terminal-panel/collapse/page-collapse-content.js +38 -0
- package/es/kernel-and-terminal-panel/index.d.ts +2 -0
- package/es/kernel-and-terminal-panel/index.d.ts.map +1 -0
- package/es/kernel-and-terminal-panel/index.js +1 -0
- package/es/kernel-and-terminal-panel/index.less +5 -0
- package/es/kernel-and-terminal-panel/kernel-and-terminal-panel-view.d.ts +24 -0
- package/es/kernel-and-terminal-panel/kernel-and-terminal-panel-view.d.ts.map +1 -0
- package/es/kernel-and-terminal-panel/kernel-and-terminal-panel-view.js +320 -0
- package/es/kernel-and-terminal-panel/module.d.ts +3 -0
- package/es/kernel-and-terminal-panel/module.d.ts.map +1 -0
- package/es/kernel-and-terminal-panel/module.js +13 -0
- package/es/kernel-and-terminal-panel/panel-command.d.ts +18 -0
- package/es/kernel-and-terminal-panel/panel-command.d.ts.map +1 -0
- package/es/kernel-and-terminal-panel/panel-command.js +80 -0
- package/es/layout/layout-service.d.ts +2 -0
- package/es/layout/layout-service.d.ts.map +1 -1
- package/es/layout/layout-service.js +18 -0
- package/es/layout/main.d.ts.map +1 -1
- package/es/layout/main.js +20 -7
- package/es/module.d.ts.map +1 -1
- package/es/module.js +4 -2
- package/package.json +9 -8
- package/src/common/icon.tsx +298 -0
- package/src/kernel-and-terminal-panel/collapse/collapse-content.tsx +72 -0
- package/src/kernel-and-terminal-panel/collapse/index.less +89 -0
- package/src/kernel-and-terminal-panel/collapse/index.tsx +128 -0
- package/src/kernel-and-terminal-panel/collapse/kernel-collapse-content-item.tsx +87 -0
- package/src/kernel-and-terminal-panel/collapse/kernel-collapse-content.tsx +23 -0
- package/src/kernel-and-terminal-panel/collapse/page-collapse-content.tsx +49 -0
- package/src/kernel-and-terminal-panel/index.less +5 -0
- package/src/kernel-and-terminal-panel/index.ts +1 -0
- package/src/kernel-and-terminal-panel/kernel-and-terminal-panel-view.tsx +218 -0
- package/src/kernel-and-terminal-panel/module.ts +20 -0
- package/src/kernel-and-terminal-panel/panel-command.tsx +57 -0
- package/src/layout/layout-service.ts +17 -0
- package/src/layout/main.tsx +13 -1
- package/src/module.tsx +3 -0
package/es/common/icon.d.ts
CHANGED
|
@@ -11,4 +11,10 @@ export declare function TerminalIcon(props: IProps): import("react/jsx-runtime")
|
|
|
11
11
|
export declare function PreferenceIcon(props: IProps): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export declare function KeybindIcon(props: IProps): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export declare function SuccIcon(props: IProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function KernelAndTerminal(): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function openedPage(): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function fileUnderKernel(): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function runningKernel(): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function runningTerminal(): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function existedLSP(): import("react/jsx-runtime").JSX.Element;
|
|
14
20
|
//# sourceMappingURL=icon.d.ts.map
|
package/es/common/icon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/common/icon.tsx"],"names":[],"mappings":"
|
|
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"}
|
package/es/common/icon.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1
2
|
import "./index.less";
|
|
2
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
4
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -365,4 +366,329 @@ export function SuccIcon(props) {
|
|
|
365
366
|
})
|
|
366
367
|
})]
|
|
367
368
|
});
|
|
369
|
+
}
|
|
370
|
+
export function KernelAndTerminal() {
|
|
371
|
+
return /*#__PURE__*/_jsxs("svg", {
|
|
372
|
+
width: "17px",
|
|
373
|
+
height: "16px",
|
|
374
|
+
viewBox: "0 0 17 16",
|
|
375
|
+
version: "1.1",
|
|
376
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
377
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
378
|
+
children: [/*#__PURE__*/_jsx("title", {
|
|
379
|
+
children: "app store-fill"
|
|
380
|
+
}), /*#__PURE__*/_jsx("g", {
|
|
381
|
+
id: "\u4EE3\u7801\u7247\u6BB5",
|
|
382
|
+
stroke: "none",
|
|
383
|
+
strokeWidth: "1",
|
|
384
|
+
fill: "none",
|
|
385
|
+
fillRule: "evenodd",
|
|
386
|
+
fillOpacity: "0.35",
|
|
387
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
388
|
+
id: "1.1\u641C\u7D22",
|
|
389
|
+
transform: "translate(-12.000000, -142.000000)",
|
|
390
|
+
fill: "#000000",
|
|
391
|
+
fillRule: "nonzero",
|
|
392
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
393
|
+
id: "\u7F16\u7EC4-2",
|
|
394
|
+
transform: "translate(0.000000, 56.000000)",
|
|
395
|
+
children: /*#__PURE__*/_jsxs("g", {
|
|
396
|
+
id: "app-store-fill",
|
|
397
|
+
transform: "translate(12.092308, 86.000427)",
|
|
398
|
+
children: [/*#__PURE__*/_jsx("rect", {
|
|
399
|
+
id: "\u77E9\u5F62",
|
|
400
|
+
opacity: "0",
|
|
401
|
+
x: "0",
|
|
402
|
+
y: "0",
|
|
403
|
+
width: "16.0001102",
|
|
404
|
+
height: "16.0001102"
|
|
405
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
406
|
+
d: "M13.500093,2.2500155 L8.75006028,2.2500155 C8.61255933,2.2500155 8.50005856,2.36251628 8.50005856,2.50001722 L8.50005856,7.25004994 C8.50005856,7.38755089 8.61255933,7.50005167 8.75006028,7.50005167 L13.500093,7.50005167 C13.6375939,7.50005167 13.7500947,7.38755089 13.7500947,7.25004994 L13.7500947,2.50001722 C13.7500947,2.36251628 13.6375939,2.2500155 13.500093,2.2500155 Z M13.500093,8.50005856 L8.75006028,8.50005856 C8.61255933,8.50005856 8.50005856,8.61255933 8.50005856,8.75006028 L8.50005856,13.500093 C8.50005856,13.6375939 8.61255933,13.7500947 8.75006028,13.7500947 L13.500093,13.7500947 C13.6375939,13.7500947 13.7500947,13.6375939 13.7500947,13.500093 L13.7500947,8.75006028 C13.7500947,8.61255933 13.6375939,8.50005856 13.500093,8.50005856 Z M7.25004994,2.2500155 L2.50001722,2.2500155 C2.36251628,2.2500155 2.2500155,2.36251628 2.2500155,2.50001722 L2.2500155,7.25004994 C2.2500155,7.38755089 2.36251628,7.50005167 2.50001722,7.50005167 L7.25004994,7.50005167 C7.38755089,7.50005167 7.50005167,7.38755089 7.50005167,7.25004994 L7.50005167,2.50001722 C7.50005167,2.36251628 7.38755089,2.2500155 7.25004994,2.2500155 Z M7.25004994,8.50005856 L2.50001722,8.50005856 C2.36251628,8.50005856 2.2500155,8.61255933 2.2500155,8.75006028 L2.2500155,13.500093 C2.2500155,13.6375939 2.36251628,13.7500947 2.50001722,13.7500947 L7.25004994,13.7500947 C7.38755089,13.7500947 7.50005167,13.6375939 7.50005167,13.500093 L7.50005167,8.75006028 C7.50005167,8.61255933 7.38755089,8.50005856 7.25004994,8.50005856 Z",
|
|
407
|
+
id: "\u5F62\u72B6"
|
|
408
|
+
})]
|
|
409
|
+
})
|
|
410
|
+
})
|
|
411
|
+
})
|
|
412
|
+
})]
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
export function openedPage() {
|
|
416
|
+
return /*#__PURE__*/_jsxs("svg", {
|
|
417
|
+
width: "12px",
|
|
418
|
+
height: "12px",
|
|
419
|
+
viewBox: "0 0 12 12",
|
|
420
|
+
version: "1.1",
|
|
421
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
422
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
423
|
+
children: [/*#__PURE__*/_jsx("title", {
|
|
424
|
+
children: "\u5E7F\u544A\u4E3B\u6D41\u6C34@2x"
|
|
425
|
+
}), /*#__PURE__*/_jsx("g", {
|
|
426
|
+
id: "kernel\u7BA1\u7406\u9762\u677F",
|
|
427
|
+
stroke: "none",
|
|
428
|
+
strokeWidth: "1",
|
|
429
|
+
fill: "none",
|
|
430
|
+
fillRule: "evenodd",
|
|
431
|
+
opacity: "0.45",
|
|
432
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
433
|
+
id: "2.0\u5C55\u5F00",
|
|
434
|
+
transform: "translate(-52.000000, -124.000000)",
|
|
435
|
+
fill: "#000000",
|
|
436
|
+
fillRule: "nonzero",
|
|
437
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
438
|
+
id: "\u7F16\u7EC4-2",
|
|
439
|
+
transform: "translate(0.000000, 56.000000)",
|
|
440
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
441
|
+
id: "\u7F16\u7EC4-11",
|
|
442
|
+
transform: "translate(40.000000, 0.000000)",
|
|
443
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
444
|
+
id: "\u7F16\u7EC4-28",
|
|
445
|
+
transform: "translate(4.000000, 39.000000)",
|
|
446
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
447
|
+
id: "\u7F16\u7EC4-16",
|
|
448
|
+
transform: "translate(8.000000, 25.000000)",
|
|
449
|
+
children: /*#__PURE__*/_jsxs("g", {
|
|
450
|
+
id: "\u5E7F\u544A\u4E3B\u6D41\u6C34@2x",
|
|
451
|
+
transform: "translate(0.000000, 4.000000)",
|
|
452
|
+
children: [/*#__PURE__*/_jsx("rect", {
|
|
453
|
+
id: "\u77E9\u5F62",
|
|
454
|
+
opacity: "0",
|
|
455
|
+
x: "0",
|
|
456
|
+
y: "0",
|
|
457
|
+
width: "12",
|
|
458
|
+
height: "12"
|
|
459
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
460
|
+
d: "M9.21733594,1.33333564 L2.784,1.33333564 C2.35266797,1.33333564 2.00000391,1.68399609 2.00000391,2.11266797 L2.00000391,10.1126719 C2.00000391,10.3573359 2.29133203,10.4866641 2.47332422,10.3226719 L3.03133594,9.82599609 C3.14104553,9.72791931 3.30734886,9.72936573 3.41533594,9.82933594 L4.23400781,10.589332 C4.33144663,10.6806592 4.47935125,10.6917615 4.58933203,10.6160039 L5.83933594,9.76265625 C5.93632187,9.69679836 6.06367813,9.69679836 6.16066406,9.76265625 L7.41399609,10.6173164 C7.52372385,10.6919995 7.67032569,10.6818078 7.76866406,10.5926602 L8.59733203,9.83199609 C8.70467578,9.73198828 8.87067187,9.73198828 8.97999609,9.82932422 L9.52467187,10.3193203 C9.60800658,10.3944788 9.72772048,10.4136655 9.83036936,10.3683149 C9.93301824,10.3229642 9.9994456,10.2215396 10.0000039,10.1093203 L10.0000039,2.11266797 C9.99852973,1.68156402 9.64844222,1.3329652 9.21733594,1.33333564 L9.21733594,1.33333564 Z M2.79998437,3.258 C2.79998437,3.03932813 2.97999609,2.85932813 3.20132812,2.85932813 L5.61199219,2.85932813 C5.832,2.85932813 6.01333594,3.03800391 6.01333594,3.258 C6.01333594,3.47667188 5.83333594,3.65732813 5.61200391,3.65732813 L3.20132812,3.65732813 C2.98060489,3.65697268 2.80145112,3.47871865 2.79998437,3.258 L2.79998437,3.258 Z M6.80199609,4.85132813 C6.80199609,5.07 6.62199609,5.25 6.40066406,5.25 L3.20132812,5.25 C2.98071328,5.25 2.8014584,5.07193813 2.79999609,4.85132813 C2.79999609,4.63265625 2.97999609,4.45265401 3.20132812,4.45265401 L6.40066406,4.45265401 C6.50675183,4.45230135 6.60863526,4.49410529 6.68390008,4.56887123 C6.7591649,4.64363717 6.80164547,4.74524035 6.80199609,4.85132813 L6.80199609,4.85132813 Z",
|
|
461
|
+
id: "\u5F62\u72B6"
|
|
462
|
+
})]
|
|
463
|
+
})
|
|
464
|
+
})
|
|
465
|
+
})
|
|
466
|
+
})
|
|
467
|
+
})
|
|
468
|
+
})
|
|
469
|
+
})]
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
export function fileUnderKernel() {
|
|
473
|
+
return /*#__PURE__*/_jsxs("svg", {
|
|
474
|
+
width: "12px",
|
|
475
|
+
height: "12px",
|
|
476
|
+
viewBox: "0 0 12 12",
|
|
477
|
+
version: "1.1",
|
|
478
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
479
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
480
|
+
children: [/*#__PURE__*/_jsx("title", {
|
|
481
|
+
children: "CPU#1"
|
|
482
|
+
}), /*#__PURE__*/_jsx("g", {
|
|
483
|
+
id: "kernel\u7BA1\u7406\u9762\u677F",
|
|
484
|
+
stroke: "none",
|
|
485
|
+
strokeWidth: "1",
|
|
486
|
+
fill: "none",
|
|
487
|
+
fillRule: "evenodd",
|
|
488
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
489
|
+
id: "2.0\u5C55\u5F00",
|
|
490
|
+
transform: "translate(-52.000000, -243.000000)",
|
|
491
|
+
fill: "#000000",
|
|
492
|
+
fillRule: "nonzero",
|
|
493
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
494
|
+
id: "\u7F16\u7EC4-2",
|
|
495
|
+
transform: "translate(0.000000, 56.000000)",
|
|
496
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
497
|
+
id: "\u7F16\u7EC4-11",
|
|
498
|
+
transform: "translate(40.000000, 0.000000)",
|
|
499
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
500
|
+
id: "\u7F16\u7EC4-16\u5907\u4EFD-3",
|
|
501
|
+
transform: "translate(12.000000, 183.000000)",
|
|
502
|
+
children: /*#__PURE__*/_jsxs("g", {
|
|
503
|
+
id: "CPU#1",
|
|
504
|
+
transform: "translate(0.000000, 4.000000)",
|
|
505
|
+
children: [/*#__PURE__*/_jsx("rect", {
|
|
506
|
+
id: "\u77E9\u5F62",
|
|
507
|
+
opacity: "0",
|
|
508
|
+
x: "0",
|
|
509
|
+
y: "0",
|
|
510
|
+
width: "12",
|
|
511
|
+
height: "12"
|
|
512
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
513
|
+
d: "M3.00000391,2.00000391 L9.00000391,2.00000391 C9.66666406,2.00000391 10.0000039,2.33333594 10.0000039,3.00000391 L10.0000039,9.00000391 C10.0000039,9.66666406 9.66666406,10.0000039 9.00000391,10.0000039 L3.00000391,10.0000039 C2.33333594,10.0000039 2.00000391,9.66666406 2.00000391,9.00000391 L2.00000391,3.00000391 C2.00000391,2.33333594 2.33333594,2.00000391 3.00000391,2.00000391 Z",
|
|
514
|
+
id: "\u8DEF\u5F84",
|
|
515
|
+
opacity: "0.3"
|
|
516
|
+
}), /*#__PURE__*/_jsx("polygon", {
|
|
517
|
+
id: "\u8DEF\u5F84",
|
|
518
|
+
opacity: "0.3",
|
|
519
|
+
points: "4.5 4.5 7.5 4.5 7.5 7.5 4.5 7.5"
|
|
520
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
521
|
+
d: "M9.99999609,3.50000391 L10.4999961,3.50000391 C10.7751965,3.5013362 10.9975833,3.72480226 10.9975833,4.00000391 C10.9975833,4.27520165 10.7751965,4.4986677 10.4999961,4.50000391 L9.99999609,4.50000391 L9.99999609,3.50000391 L9.99999609,3.50000391 Z M9.99999609,5.49999609 L10.4999961,5.49999609 C10.7761445,5.49999609 10.9999961,5.72385548 10.9999961,5.99999609 C10.9999961,6.27614452 10.7761445,6.49999609 10.4999961,6.49999609 L9.99999609,6.49999609 L9.99999609,5.49999609 L9.99999609,5.49999609 Z M9.99999609,7.5 L10.4999961,7.5 C10.7751965,7.5013323 10.9975833,7.72479835 10.9975833,8 C10.9975833,8.27519774 10.7751965,8.4986638 10.4999961,8.5 L9.99999609,8.5 L9.99999609,7.5 L9.99999609,7.5 Z M1.5,3.49999802 L2.00000391,3.49999802 L2.00000391,4.49999802 L1.5,4.49999802 C1.32079125,4.50086759 1.15482306,4.4057587 1.0649673,4.25070236 C0.975111536,4.09564601 0.975111536,3.9043579 1.0649673,3.74930155 C1.15482306,3.5942452 1.32079125,3.49913631 1.5,3.49999802 L1.5,3.49999802 Z M1.49999609,5.49999609 L1.99999609,5.49999609 L1.99999609,6.49999609 L1.49999609,6.49999609 C1.22385547,6.49999609 0.999996094,6.27614453 0.999996094,5.99999609 C0.999996094,5.72385547 1.22385547,5.49999609 1.49999609,5.49999609 L1.49999609,5.49999609 Z M1.5,7.5 L2.00000391,7.5 L2.00000391,8.5 L1.5,8.5 C1.22480353,8.4986638 1.00241671,8.27519774 1.00241671,8 C1.00241671,7.72479835 1.22480353,7.5013323 1.5,7.5 L1.5,7.5 Z",
|
|
522
|
+
id: "\u5F62\u72B6"
|
|
523
|
+
})]
|
|
524
|
+
})
|
|
525
|
+
})
|
|
526
|
+
})
|
|
527
|
+
})
|
|
528
|
+
})
|
|
529
|
+
})]
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
export function runningKernel() {
|
|
533
|
+
return /*#__PURE__*/_jsxs("svg", {
|
|
534
|
+
width: "12px",
|
|
535
|
+
height: "12px",
|
|
536
|
+
viewBox: "0 0 12 12",
|
|
537
|
+
version: "1.1",
|
|
538
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
539
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
540
|
+
children: [/*#__PURE__*/_jsx("title", {
|
|
541
|
+
children: "py"
|
|
542
|
+
}), /*#__PURE__*/_jsx("g", {
|
|
543
|
+
id: "kernel\u7BA1\u7406\u9762\u677F",
|
|
544
|
+
stroke: "none",
|
|
545
|
+
strokeWidth: "1",
|
|
546
|
+
fill: "none",
|
|
547
|
+
fillRule: "evenodd",
|
|
548
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
549
|
+
id: "2.0\u5C55\u5F00",
|
|
550
|
+
transform: "translate(-80.000000, -317.000000)",
|
|
551
|
+
fillRule: "nonzero",
|
|
552
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
553
|
+
id: "\u7F16\u7EC4-2",
|
|
554
|
+
transform: "translate(0.000000, 56.000000)",
|
|
555
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
556
|
+
id: "\u7F16\u7EC4-11",
|
|
557
|
+
transform: "translate(40.000000, 0.000000)",
|
|
558
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
559
|
+
id: "\u7F16\u7EC4-10\u5907\u4EFD",
|
|
560
|
+
transform: "translate(26.000000, 258.000000)",
|
|
561
|
+
children: /*#__PURE__*/_jsxs("g", {
|
|
562
|
+
id: "py",
|
|
563
|
+
transform: "translate(14.000000, 3.000000)",
|
|
564
|
+
children: [/*#__PURE__*/_jsx("rect", {
|
|
565
|
+
id: "\u77E9\u5F62",
|
|
566
|
+
fill: "#000000",
|
|
567
|
+
opacity: "0",
|
|
568
|
+
x: "0",
|
|
569
|
+
y: "0",
|
|
570
|
+
width: "12",
|
|
571
|
+
height: "12"
|
|
572
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
573
|
+
d: "M5.75814393,11.7154535 C4.37245332,11.6681765 3.50787713,11.2545027 3.28285045,10.5217092 L3.25916343,10.4389745 L3.25916343,9.0206645 C3.25916343,7.38960802 3.25916343,7.36596952 3.34206799,7.10594602 C3.49603362,6.64499528 3.87502592,6.33769478 4.44351438,6.20768303 L4.57379298,6.18404453 L6.18451028,6.18404453 C7.3333307,6.18404453 7.81891459,6.18404453 7.86628863,6.16040603 C8.19790689,6.08949053 8.39924655,6.03039428 8.60058622,5.87674403 C8.84929992,5.69945528 9.03879607,5.39215479 9.10985713,5.06121579 C9.18091818,4.81301154 9.18091818,4.83665004 9.18091818,3.98566405 L9.18091818,3.19377431 L10.3297386,3.19377431 L10.4363302,3.21741281 C11.0285057,3.39470156 11.478559,3.9502063 11.6562117,4.80119229 C11.7272727,5.13213129 11.7272727,5.15576979 11.7272727,5.99493653 C11.7272727,6.81046477 11.7272727,6.81046477 11.6562117,7.09412677 C11.5851506,7.35415027 11.5259331,7.57871602 11.407498,7.80328176 C11.1824713,8.24059401 10.850853,8.54789451 10.4363302,8.68972551 C10.1876165,8.77246026 10.3889562,8.76064101 8.06762829,8.77246026 L5.97132711,8.77246026 L5.97132711,9.17431475 L8.75455184,9.17431475 L8.75455184,10.604444 C8.73086482,10.6871787 8.7071778,10.8053712 8.64796025,10.9117445 C8.5768992,11.0181177 8.39924655,11.1954065 8.29265497,11.2899605 C7.91366266,11.5381647 7.34517421,11.691815 6.5871896,11.7272727 L5.75814393,11.7272727 L5.75814393,11.7154535 Z M7.67679247,10.8290097 C7.93734968,10.7817327 8.13868935,10.5217092 8.09131531,10.2616857 C8.04394127,10.03712 7.88997565,9.88346974 7.67679247,9.848012 C7.34517421,9.800735 7.06092998,10.0962162 7.10830402,10.415336 C7.15567806,10.6635402 7.35701772,10.8171905 7.59388791,10.8290097 L7.67679247,10.8290097 Z M1.70766368,8.807918 C1.39973243,8.73700251 1.09180119,8.55971376 0.866774506,8.27605176 C0.452251674,7.76782401 0.250912012,6.90501877 0.274599031,5.82946703 C0.29828605,5.16758904 0.381190616,4.65936129 0.606217297,4.24568755 C0.866774506,3.6901828 1.26945383,3.38288231 1.80241176,3.27650906 C1.90900334,3.25287056 1.93269036,3.25287056 3.969774,3.25287056 L6.04238816,3.25287056 C6.06607518,3.25287056 6.06607518,3.22923206 6.06607518,3.05194331 L6.06607518,2.85101606 L3.28285045,2.85101606 L3.28285045,2.11822257 C3.28285045,1.32633283 3.28285045,1.34997133 3.3539115,1.19632108 C3.6026252,0.688093331 4.27770525,0.380792834 5.39099514,0.298058085 C5.47389971,0.298058085 5.67523937,0.274419585 5.87657903,0.274419585 C7.10830402,0.250781086 7.99656723,0.475346833 8.48215112,0.912659079 C8.52952516,0.959936079 8.58874271,1.04267083 8.63611675,1.06630933 C8.7071778,1.14904408 8.79008237,1.32633283 8.83745641,1.46816382 L8.86114343,1.55089857 L8.86114343,3.05194331 C8.86114343,4.43479555 8.86114343,4.55298804 8.83745641,4.63572279 C8.81376939,4.76573454 8.75455184,4.94302329 8.7071778,5.03757729 C8.52952516,5.36851629 8.22159391,5.60490129 7.80707108,5.72309378 C7.54651387,5.79400928 7.65310546,5.79400928 5.88842254,5.80582853 C4.12373962,5.80582853 4.23033121,5.80582853 3.99346102,5.87674403 C3.50787713,6.00675578 3.15257184,6.38497178 3.02229324,6.91683802 C2.95123218,7.16504227 2.95123218,7.14140377 2.95123218,7.99238976 L2.95123218,8.807918 L2.41827425,8.807918 C1.90900334,8.8315565 1.75503772,8.8315565 1.70766368,8.807918 Z M4.64485404,2.10640332 C4.8461937,2.02366857 4.97647231,1.77546432 4.92909827,1.57453707 C4.88172423,1.37360983 4.75144563,1.21995958 4.57379298,1.17268258 C4.28954875,1.08994783 3.98161751,1.25541733 3.93424347,1.57453707 C3.88686943,1.82274132 4.01714804,2.05912632 4.26586174,2.13004182 C4.31323577,2.15368032 4.3487663,2.15368032 4.44351438,2.15368032 C4.56194947,2.15368032 4.58563649,2.15368032 4.64485404,2.10640332 L4.64485404,2.10640332 Z",
|
|
574
|
+
id: "\u5F62\u72B6",
|
|
575
|
+
fill: "#FED142"
|
|
576
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
577
|
+
d: "M1.656,8.856 C1.344,8.784 1.032,8.604 0.804,8.316 C0.384,7.8 0.18,6.924 0.204,5.832 C0.228,5.16 0.312,4.644 0.54,4.224 C0.804,3.66 1.212,3.348 1.752,3.24 C1.86,3.216 1.884,3.216 3.948,3.216 L6.048,3.216 C6.072,3.216 6.072,3.192 6.072,3.012 L6.072,2.808 L3.252,2.808 L3.252,2.064 C3.252,1.26 3.252,1.284 3.324,1.128 C3.576,0.612 4.26,0.3 5.388,0.216 C5.472,0.216 5.676,0.192 5.88,0.192 C7.128,0.168 8.028,0.396 8.52,0.84 C8.568,0.888 8.628,0.972 8.676,0.996 C8.748,1.08 8.832,1.26 8.88,1.404 L8.904,1.488 L8.904,3.012 C8.904,4.416 8.904,4.536 8.88,4.62 C8.856,4.752 8.796,4.932 8.748,5.028 C8.568,5.364 8.256,5.604 7.836,5.724 C7.572,5.796 7.68,5.796 5.892,5.808 C4.104,5.808 4.212,5.808 3.972,5.88 C3.48,6.012 3.12,6.396 2.988,6.936 C2.916,7.188 2.916,7.164 2.916,8.028 L2.916,8.856 L2.376,8.856 C1.86,8.88 1.704,8.88 1.656,8.856 Z M4.632,2.052 C4.836,1.968 4.968,1.716 4.92,1.512 C4.872,1.308 4.74,1.152 4.56,1.104 C4.272,1.02 3.96,1.188 3.912,1.512 C3.864,1.764 3.996,2.004 4.248,2.076 C4.296,2.1 4.332,2.1 4.428,2.1 C4.548,2.1 4.572,2.1 4.632,2.052 L4.632,2.052 Z",
|
|
578
|
+
id: "\u5F62\u72B6",
|
|
579
|
+
fill: "#3571A3"
|
|
580
|
+
})]
|
|
581
|
+
})
|
|
582
|
+
})
|
|
583
|
+
})
|
|
584
|
+
})
|
|
585
|
+
})
|
|
586
|
+
})]
|
|
587
|
+
});
|
|
588
|
+
}
|
|
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
|
+
});
|
|
641
|
+
}
|
|
642
|
+
export function existedLSP() {
|
|
643
|
+
return /*#__PURE__*/_jsxs("svg", {
|
|
644
|
+
width: "12px",
|
|
645
|
+
height: "12px",
|
|
646
|
+
viewBox: "0 0 12 12",
|
|
647
|
+
version: "1.1",
|
|
648
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
649
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
650
|
+
children: [/*#__PURE__*/_jsx("title", {
|
|
651
|
+
children: "robot-fill"
|
|
652
|
+
}), /*#__PURE__*/_jsx("g", {
|
|
653
|
+
id: "kernel\u7BA1\u7406\u9762\u677F",
|
|
654
|
+
stroke: "none",
|
|
655
|
+
strokeWidth: "1",
|
|
656
|
+
fill: "none",
|
|
657
|
+
fillRule: "evenodd",
|
|
658
|
+
fillOpacity: "0.45",
|
|
659
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
660
|
+
id: "2.0\u5C55\u5F00",
|
|
661
|
+
transform: "translate(-52.000000, -421.000000)",
|
|
662
|
+
fill: "#000000",
|
|
663
|
+
fillRule: "nonzero",
|
|
664
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
665
|
+
id: "\u7F16\u7EC4-2",
|
|
666
|
+
transform: "translate(0.000000, 56.000000)",
|
|
667
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
668
|
+
id: "\u7F16\u7EC4-11",
|
|
669
|
+
transform: "translate(40.000000, 0.000000)",
|
|
670
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
671
|
+
id: "\u7F16\u7EC4-16\u5907\u4EFD-5",
|
|
672
|
+
transform: "translate(12.000000, 361.000000)",
|
|
673
|
+
children: /*#__PURE__*/_jsxs("g", {
|
|
674
|
+
id: "robot-fill",
|
|
675
|
+
transform: "translate(0.000000, 4.000000)",
|
|
676
|
+
children: [/*#__PURE__*/_jsx("rect", {
|
|
677
|
+
id: "\u77E9\u5F62",
|
|
678
|
+
opacity: "0",
|
|
679
|
+
x: "0",
|
|
680
|
+
y: "0",
|
|
681
|
+
width: "12",
|
|
682
|
+
height: "12"
|
|
683
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
684
|
+
d: "M9.984375,0.75 L2.015625,0.75 C1.80820313,0.75 1.640625,0.917578125 1.640625,1.125 L1.640625,8.859375 C1.640625,9.06679687 1.80820313,9.234375 2.015625,9.234375 L9.984375,9.234375 C10.1917969,9.234375 10.359375,9.06679687 10.359375,8.859375 L10.359375,1.125 C10.359375,0.917578125 10.1917969,0.75 9.984375,0.75 Z M3.515625,3.84375 C3.515625,3.45585937 3.83085937,3.140625 4.21875,3.140625 C4.60664063,3.140625 4.921875,3.45585937 4.921875,3.84375 C4.921875,4.23164063 4.60664063,4.546875 4.21875,4.546875 C3.83085937,4.546875 3.515625,4.23164063 3.515625,3.84375 Z M7.875,6.75 C7.875,6.8015625 7.8328125,6.84375 7.78125,6.84375 L4.21875,6.84375 C4.1671875,6.84375 4.125,6.8015625 4.125,6.75 L4.125,6.046875 C4.125,5.9953125 4.1671875,5.953125 4.21875,5.953125 L7.78125,5.953125 C7.8328125,5.953125 7.875,5.9953125 7.875,6.046875 L7.875,6.75 Z M7.78125,4.546875 C7.39335937,4.546875 7.078125,4.23164063 7.078125,3.84375 C7.078125,3.45585937 7.39335937,3.140625 7.78125,3.140625 C8.16914063,3.140625 8.484375,3.45585937 8.484375,3.84375 C8.484375,4.23164063 8.16914063,4.546875 7.78125,4.546875 Z M9.36328125,10.125 L2.63671875,10.125 C2.475,10.125 2.34375,10.2925781 2.34375,10.5 L2.34375,11.15625 C2.34375,11.2078125 2.3765625,11.25 2.41640625,11.25 L9.58242188,11.25 C9.62226563,11.25 9.65508591,11.2078125 9.65508591,11.15625 L9.65508591,10.5 C9.65625,10.2925781 9.525,10.125 9.36328125,10.125 L9.36328125,10.125 Z",
|
|
685
|
+
id: "\u5F62\u72B6"
|
|
686
|
+
})]
|
|
687
|
+
})
|
|
688
|
+
})
|
|
689
|
+
})
|
|
690
|
+
})
|
|
691
|
+
})
|
|
692
|
+
})]
|
|
693
|
+
});
|
|
368
694
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LibroPanelCollapseItemType } from './index.js';
|
|
3
|
+
import type { LibroPanelCollapseItem } from './index.js';
|
|
4
|
+
export declare const getIcon: (type: LibroPanelCollapseItemType) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
interface Props {
|
|
6
|
+
type: LibroPanelCollapseItemType;
|
|
7
|
+
items: LibroPanelCollapseItem[];
|
|
8
|
+
}
|
|
9
|
+
export declare const LibroCollapseContent: React.FC<Props>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=collapse-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapse-content.d.ts","sourceRoot":"","sources":["../../../src/kernel-and-terminal-panel/collapse/collapse-content.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,eAAO,MAAM,OAAO,SAAU,0BAA0B,4CAWvD,CAAC;AAEF,UAAU,KAAK;IACb,IAAI,EAAE,0BAA0B,CAAC;IACjC,KAAK,EAAE,sBAAsB,EAAE,CAAC;CACjC;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAsChD,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { CloseOutlined } from '@ant-design/icons';
|
|
2
|
+
import { TerminalCommands } from '@difizen/libro-terminal';
|
|
3
|
+
import { CommandRegistry, useInject } from '@difizen/mana-app';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { existedLSP, openedPage, runningKernel, runningTerminal } from "../../common/icon.js";
|
|
6
|
+
import { LibroPanelCollapseItemType } from "./index.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
|
+
export var getIcon = function getIcon(type) {
|
|
11
|
+
switch (type) {
|
|
12
|
+
case LibroPanelCollapseItemType.PAGE:
|
|
13
|
+
return openedPage();
|
|
14
|
+
case LibroPanelCollapseItemType.KERNEL:
|
|
15
|
+
return runningKernel();
|
|
16
|
+
case LibroPanelCollapseItemType.TERMINAL:
|
|
17
|
+
return runningTerminal();
|
|
18
|
+
case LibroPanelCollapseItemType.LSP:
|
|
19
|
+
return existedLSP();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export var LibroCollapseContent = function LibroCollapseContent(props) {
|
|
23
|
+
var commandRegistry = useInject(CommandRegistry);
|
|
24
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
25
|
+
children: props.items.map(function (item) {
|
|
26
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
27
|
+
className: "libro-panel-collapse-item",
|
|
28
|
+
onClick: function onClick() {
|
|
29
|
+
if (props.type === LibroPanelCollapseItemType.TERMINAL) {
|
|
30
|
+
commandRegistry.executeCommand(TerminalCommands['OpenTerminal'].id, item.name);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
34
|
+
className: "libro-panel-collapse-item-icon",
|
|
35
|
+
children: getIcon(props.type)
|
|
36
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
37
|
+
className: "libro-panel-collapse-item-label",
|
|
38
|
+
children: item.name
|
|
39
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
40
|
+
className: "libro-panel-collapse-item-close",
|
|
41
|
+
onClick: function onClick(e) {
|
|
42
|
+
e.stopPropagation();
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
if (item.shutdown) {
|
|
45
|
+
item.shutdown();
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
children: /*#__PURE__*/_jsx(CloseOutlined, {})
|
|
49
|
+
})]
|
|
50
|
+
}, item.id);
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SaveableTabView } from '../../index.js';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export declare enum LibroPanelCollapseItemType {
|
|
5
|
+
PAGE = "Page",
|
|
6
|
+
KERNEL = "Kernel",
|
|
7
|
+
TERMINAL = "Terminal",
|
|
8
|
+
LSP = "LSP"
|
|
9
|
+
}
|
|
10
|
+
export interface LibroPanelCollapseItem {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
shutdown?: () => Promise<void>;
|
|
14
|
+
restart?: () => Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export interface LibroPanelCollapseKernelItem extends LibroPanelCollapseItem {
|
|
17
|
+
notebooks: {
|
|
18
|
+
sessionId: string;
|
|
19
|
+
name: string;
|
|
20
|
+
path: string;
|
|
21
|
+
}[];
|
|
22
|
+
}
|
|
23
|
+
interface Props {
|
|
24
|
+
type: LibroPanelCollapseItemType;
|
|
25
|
+
items: LibroPanelCollapseItem[] | undefined;
|
|
26
|
+
tabView?: SaveableTabView;
|
|
27
|
+
shutdownAll?: () => Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
export declare const LibroCollapse: React.FC<Props>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/kernel-and-terminal-panel/collapse/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAItD,OAAO,cAAc,CAAC;AAItB,oBAAY,0BAA0B;IACpC,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,GAAG,QAAQ;CACZ;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,4BAA6B,SAAQ,sBAAsB;IAC1E,SAAS,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAChE;AAED,UAAU,KAAK;IACb,IAAI,EAAE,0BAA0B,CAAC;IACjC,KAAK,EAAE,sBAAsB,EAAE,GAAG,SAAS,CAAC;IAC5C,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAmDD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAwCzC,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons';
|
|
8
|
+
import { ViewContext } from '@difizen/mana-app';
|
|
9
|
+
import { Empty, Popconfirm } from 'antd';
|
|
10
|
+
import React, { useState } from 'react';
|
|
11
|
+
import { LibroCollapseContent } from "./collapse-content.js";
|
|
12
|
+
import "./index.less";
|
|
13
|
+
import { LibroKernelCollapseContent } from "./kernel-collapse-content.js";
|
|
14
|
+
import { OpenedTabs } from "./page-collapse-content.js";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
export var LibroPanelCollapseItemType = /*#__PURE__*/function (LibroPanelCollapseItemType) {
|
|
18
|
+
LibroPanelCollapseItemType["PAGE"] = "Page";
|
|
19
|
+
LibroPanelCollapseItemType["KERNEL"] = "Kernel";
|
|
20
|
+
LibroPanelCollapseItemType["TERMINAL"] = "Terminal";
|
|
21
|
+
LibroPanelCollapseItemType["LSP"] = "LSP";
|
|
22
|
+
return LibroPanelCollapseItemType;
|
|
23
|
+
}({});
|
|
24
|
+
var getCollapseContentView = function getCollapseContentView(type, items, tabView) {
|
|
25
|
+
if (!items) {
|
|
26
|
+
return /*#__PURE__*/_jsx(Empty, {
|
|
27
|
+
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
28
|
+
description: "\u6682\u65E0\u5185\u5BB9",
|
|
29
|
+
className: "kernel-and-terminal-panel-empty"
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
switch (type) {
|
|
33
|
+
case LibroPanelCollapseItemType.PAGE:
|
|
34
|
+
return /*#__PURE__*/_jsx(ViewContext, {
|
|
35
|
+
view: tabView,
|
|
36
|
+
children: /*#__PURE__*/_jsx(OpenedTabs, {})
|
|
37
|
+
});
|
|
38
|
+
case LibroPanelCollapseItemType.KERNEL:
|
|
39
|
+
return /*#__PURE__*/_jsx(LibroKernelCollapseContent, {
|
|
40
|
+
type: type,
|
|
41
|
+
items: items
|
|
42
|
+
});
|
|
43
|
+
case LibroPanelCollapseItemType.TERMINAL:
|
|
44
|
+
case LibroPanelCollapseItemType.LSP:
|
|
45
|
+
return /*#__PURE__*/_jsx(LibroCollapseContent, {
|
|
46
|
+
type: type,
|
|
47
|
+
items: items
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var getCollapseHeaderLabel = function getCollapseHeaderLabel(type) {
|
|
52
|
+
switch (type) {
|
|
53
|
+
case LibroPanelCollapseItemType.PAGE:
|
|
54
|
+
return '已开启的标签页';
|
|
55
|
+
case LibroPanelCollapseItemType.KERNEL:
|
|
56
|
+
return '运行的内核';
|
|
57
|
+
case LibroPanelCollapseItemType.TERMINAL:
|
|
58
|
+
return '运行的终端';
|
|
59
|
+
case LibroPanelCollapseItemType.LSP:
|
|
60
|
+
return '语言服务';
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
export var LibroCollapse = function LibroCollapse(props) {
|
|
64
|
+
var _useState = useState(true),
|
|
65
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
66
|
+
open = _useState2[0],
|
|
67
|
+
setOpen = _useState2[1];
|
|
68
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
69
|
+
className: "libro-panel-collapse-container",
|
|
70
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
71
|
+
className: "libro-panel-collapse-header",
|
|
72
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
73
|
+
className: "libro-panel-collapse-header-left",
|
|
74
|
+
onClick: function onClick() {
|
|
75
|
+
setOpen(!open);
|
|
76
|
+
},
|
|
77
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
78
|
+
className: "libro-panel-collapse-header-icon",
|
|
79
|
+
children: open ? /*#__PURE__*/_jsx(CaretDownOutlined, {}) : /*#__PURE__*/_jsx(CaretRightOutlined, {})
|
|
80
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
81
|
+
className: "libro-panel-collapse-header-label",
|
|
82
|
+
children: getCollapseHeaderLabel(props.type)
|
|
83
|
+
})]
|
|
84
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
85
|
+
className: "libro-panel-collapse-header-closeAll",
|
|
86
|
+
children: /*#__PURE__*/_jsx(Popconfirm, {
|
|
87
|
+
title: "\u4F60\u786E\u5B9A\u8981\u5173\u95ED\u5168\u90E8\u5417\uFF1F",
|
|
88
|
+
okText: "\u786E\u5B9A",
|
|
89
|
+
cancelText: "\u53D6\u6D88",
|
|
90
|
+
onConfirm: function onConfirm() {
|
|
91
|
+
if (props.shutdownAll) {
|
|
92
|
+
props.shutdownAll();
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
children: "\u5173\u95ED\u5168\u90E8"
|
|
96
|
+
})
|
|
97
|
+
})]
|
|
98
|
+
}), open && /*#__PURE__*/_jsx("div", {
|
|
99
|
+
className: "libro-panel-collapse-content",
|
|
100
|
+
children: getCollapseContentView(props.type, props.items, props.tabView)
|
|
101
|
+
})]
|
|
102
|
+
}, props.type);
|
|
103
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
.libro-panel-collapse-container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
margin-bottom: 16px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.libro-panel-collapse-header {
|
|
7
|
+
user-select: none; // 双击不选中文本
|
|
8
|
+
color: rgba(0, 10, 26, 68%);
|
|
9
|
+
font-size: 12px;
|
|
10
|
+
|
|
11
|
+
.libro-panel-collapse-header-left {
|
|
12
|
+
display: inline-block;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
|
|
15
|
+
.libro-panel-collapse-header-icon {
|
|
16
|
+
display: inline-block;
|
|
17
|
+
margin-right: 5px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.libro-panel-collapse-header-label {
|
|
21
|
+
display: inline-block;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.libro-panel-collapse-header-closeAll {
|
|
26
|
+
// display: inline-block;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
color: rgba(0, 10, 26, 47%);
|
|
29
|
+
float: right;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.libro-panel-collapse-kernel-item-container {
|
|
34
|
+
margin-left: 15px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.libro-panel-collapse-content,
|
|
38
|
+
.libro-panel-collapse-kernel-item-container {
|
|
39
|
+
.libro-panel-collapse-item,
|
|
40
|
+
.libro-panel-collapse-kernel-item {
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
user-select: none; // 双击不选中文本
|
|
43
|
+
color: rgba(0, 10, 26, 65%);
|
|
44
|
+
font-size: 12px;
|
|
45
|
+
margin: 8px 0;
|
|
46
|
+
padding: 0 10px;
|
|
47
|
+
display: flex;
|
|
48
|
+
|
|
49
|
+
.libro-panel-collapse-item-toggle {
|
|
50
|
+
display: inline-block;
|
|
51
|
+
margin: auto 5px auto 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.libro-panel-collapse-item-icon,
|
|
55
|
+
.libro-panel-collapse-kernel-item-icon {
|
|
56
|
+
display: inline-block;
|
|
57
|
+
margin: auto 5px auto 0;
|
|
58
|
+
|
|
59
|
+
& > :first-child {
|
|
60
|
+
vertical-align: middle;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.libro-panel-collapse-item-label,
|
|
65
|
+
.libro-panel-collapse-kernel-item-name {
|
|
66
|
+
display: inline-block;
|
|
67
|
+
min-width: 50px;
|
|
68
|
+
white-space: nowrap; /* 避免文本换行 */
|
|
69
|
+
overflow: hidden; /* 隐藏超出div的内容 */
|
|
70
|
+
text-overflow: ellipsis; /* 在文本超出宽度时显示省略号 */
|
|
71
|
+
margin: auto 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.libro-panel-collapse-item-close {
|
|
75
|
+
// display: inline-block;
|
|
76
|
+
margin: auto 0 auto auto;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.libro-panel-collapse-item-close:hover {
|
|
80
|
+
background: rgba(0, 10, 26, 15%);
|
|
81
|
+
border-radius: 4px;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.libro-panel-collapse-item:hover {
|
|
86
|
+
background: rgba(0, 10, 26, 5%);
|
|
87
|
+
border-radius: 4px;
|
|
88
|
+
}
|
|
89
|
+
}
|