@opensumi/ide-main-layout 2.21.1 → 2.21.2-next-1667875132.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.
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare namespace CSSIcon {
|
|
3
|
-
const iconNameSegment = "[A-Za-z0-9]+";
|
|
4
|
-
const iconNameExpression = "[A-Za-z0-9\\-]+";
|
|
5
|
-
const iconModifierExpression = "~[A-Za-z]+";
|
|
6
|
-
}
|
|
7
|
-
export declare function renderLabelWithIcons(text: string): Array<React.ReactElement | string>;
|
|
8
2
|
interface WelcomeViewProps {
|
|
9
3
|
viewId: string;
|
|
10
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"welcome.view.d.ts","sourceRoot":"","sources":["../../src/browser/welcome.view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"welcome.view.d.ts","sourceRoot":"","sources":["../../src/browser/welcome.view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AA6F1B,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB;AASD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAevB,CAAC"}
|
|
@@ -1,40 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WelcomeView =
|
|
3
|
+
exports.WelcomeView = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
6
6
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
7
7
|
const button_1 = require("@opensumi/ide-components/lib/button");
|
|
8
8
|
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
9
9
|
const ide_core_browser_2 = require("@opensumi/ide-core-browser");
|
|
10
|
+
const iconLabels_1 = require("@opensumi/ide-core-browser/lib/utils/iconLabels");
|
|
10
11
|
const ide_core_common_1 = require("@opensumi/ide-core-common");
|
|
11
12
|
const styles_module_less_1 = tslib_1.__importDefault(require("./accordion/styles.module.less"));
|
|
12
13
|
const views_registry_1 = require("./views-registry");
|
|
13
|
-
var CSSIcon;
|
|
14
|
-
(function (CSSIcon) {
|
|
15
|
-
CSSIcon.iconNameSegment = '[A-Za-z0-9]+';
|
|
16
|
-
CSSIcon.iconNameExpression = '[A-Za-z0-9\\-]+';
|
|
17
|
-
CSSIcon.iconModifierExpression = '~[A-Za-z]+';
|
|
18
|
-
})(CSSIcon = exports.CSSIcon || (exports.CSSIcon = {}));
|
|
19
|
-
const labelWithIconsRegex = new RegExp(`(\\\\)?\\$\\((${CSSIcon.iconNameExpression}(?:${CSSIcon.iconModifierExpression})?)\\)`, 'g');
|
|
20
|
-
function renderLabelWithIcons(text) {
|
|
21
|
-
const elements = new Array();
|
|
22
|
-
let match;
|
|
23
|
-
let textStart = 0;
|
|
24
|
-
let textStop = 0;
|
|
25
|
-
while ((match = labelWithIconsRegex.exec(text)) !== null) {
|
|
26
|
-
textStop = match.index || 0;
|
|
27
|
-
elements.push(text.substring(textStart, textStop));
|
|
28
|
-
textStart = (match.index || 0) + match[0].length;
|
|
29
|
-
const [, escaped, codicon] = match;
|
|
30
|
-
elements.push(escaped ? `$(${codicon})` : react_1.default.createElement("span", { className: (0, ide_core_browser_1.getExternalIcon)(codicon) }));
|
|
31
|
-
}
|
|
32
|
-
if (textStart < text.length) {
|
|
33
|
-
elements.push(text.substring(textStart));
|
|
34
|
-
}
|
|
35
|
-
return elements;
|
|
36
|
-
}
|
|
37
|
-
exports.renderLabelWithIcons = renderLabelWithIcons;
|
|
38
14
|
const WelcomeContent = (props) => {
|
|
39
15
|
const { contents } = props;
|
|
40
16
|
const [disables, setDisables] = react_1.default.useState(contents.map((item) => (item.precondition ? false : null)));
|
|
@@ -73,7 +49,7 @@ const WelcomeContent = (props) => {
|
|
|
73
49
|
if (linkedText.nodes.length === 1 && typeof linkedText.nodes[0] !== 'string') {
|
|
74
50
|
const node = linkedText.nodes[0];
|
|
75
51
|
lineElements.push(react_1.default.createElement("div", { key: lineElements.length, title: node.title, className: 'button-container' },
|
|
76
|
-
react_1.default.createElement(button_1.Button, { disabled: disables[index] === false, onClick: () => openerService.open(node.href) }, renderLabelWithIcons(node.label))));
|
|
52
|
+
react_1.default.createElement(button_1.Button, { disabled: disables[index] === false, onClick: () => openerService.open(node.href) }, (0, iconLabels_1.renderLabelWithIcons)(node.label))));
|
|
77
53
|
}
|
|
78
54
|
else {
|
|
79
55
|
const textNodes = linkedText.nodes.map((node, idx) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"welcome.view.js","sourceRoot":"","sources":["../../src/browser/welcome.view.tsx"],"names":[],"mappings":";;;;AAAA,oEAA8B;AAC9B,0DAA0B;AAE1B,gEAA6D;AAC7D,
|
|
1
|
+
{"version":3,"file":"welcome.view.js","sourceRoot":"","sources":["../../src/browser/welcome.view.tsx"],"names":[],"mappings":";;;;AAAA,oEAA8B;AAC9B,0DAA0B;AAE1B,gEAA6D;AAC7D,iEAA2E;AAC3E,iEAAgE;AAChE,gFAAuF;AACvF,+DAA4D;AAI5D,gGAAoD;AACpD,qDAAmD;AAEnD,MAAM,cAAc,GAAG,CAAC,KAA6C,EAAE,EAAE;IACvE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,eAAK,CAAC,QAAQ,CAC5C,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAC3D,CAAC;IACF,MAAM,iBAAiB,GAAuB,IAAA,gCAAa,EAAC,qC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,CAAC,CACvB,uCAAK,SAAS,EAAE,4BAAM,CAAC,OAAO;QAC5B,8BAAC,cAAc,IAAC,QAAQ,EAAE,QAAQ,GAAI,CAClC,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,EAAE,wBAAwB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/ide-main-layout",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.2-next-1667875132.0",
|
|
4
4
|
"description": "@opensumi/ide-main-layout",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib"
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
"url": "git@github.com:opensumi/core.git"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@opensumi/ide-components": "2.21.
|
|
21
|
-
"@opensumi/ide-core-common": "2.21.
|
|
20
|
+
"@opensumi/ide-components": "2.21.2-next-1667875132.0",
|
|
21
|
+
"@opensumi/ide-core-common": "2.21.2-next-1667875132.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@opensumi/ide-core-browser": "2.21.
|
|
24
|
+
"@opensumi/ide-core-browser": "2.21.2-next-1667875132.0",
|
|
25
25
|
"@opensumi/ide-dev-tool": "^1.3.1",
|
|
26
|
-
"@opensumi/ide-theme": "2.21.
|
|
26
|
+
"@opensumi/ide-theme": "2.21.2-next-1667875132.0"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "d6e4584249a53f89dd18cc4fe524295f09fe89e9"
|
|
29
29
|
}
|