@pingux/astro 2.125.0 → 2.126.0-alpha.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.
- package/lib/cjs/components/CodeEditor/CodeEditor.d.ts +1 -1
- package/lib/cjs/components/CodeEditor/CodeEditor.js +57 -8
- package/lib/cjs/components/CodeEditor/CodeEditor.stories.d.ts +2 -1
- package/lib/cjs/components/CodeEditor/CodeEditor.stories.js +14 -5
- package/lib/cjs/components/CodeEditor/CodeEditor.styles.d.ts +15 -0
- package/lib/cjs/components/CodeEditor/CodeEditor.styles.js +19 -3
- package/lib/cjs/components/CodeEditor/CodeEditor.test.js +29 -5
- package/lib/cjs/components/MultivaluesField/CondensedMultivaluesField.js +14 -3
- package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +35 -0
- package/lib/cjs/types/codeEditor.d.ts +4 -1
- package/lib/cjs/utils/devUtils/constants/languageMapping.d.ts +31 -0
- package/lib/cjs/utils/devUtils/constants/languageMapping.js +38 -0
- package/lib/components/CodeEditor/CodeEditor.js +59 -10
- package/lib/components/CodeEditor/CodeEditor.stories.js +11 -3
- package/lib/components/CodeEditor/CodeEditor.styles.js +19 -3
- package/lib/components/CodeEditor/CodeEditor.test.js +29 -5
- package/lib/components/MultivaluesField/CondensedMultivaluesField.js +14 -3
- package/lib/components/MultivaluesField/MultivaluesField.test.js +35 -0
- package/lib/utils/devUtils/constants/languageMapping.js +30 -0
- package/package.json +1 -1
@@ -1,4 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { CodeEditorProps } from '../../types';
|
3
|
-
declare const CodeEditor: React.ForwardRefExoticComponent<CodeEditorProps & React.RefAttributes<
|
3
|
+
declare const CodeEditor: React.ForwardRefExoticComponent<CodeEditorProps & React.RefAttributes<HTMLDivElement>>;
|
4
4
|
export default CodeEditor;
|
@@ -10,34 +10,77 @@ _Object$defineProperty(exports, "__esModule", {
|
|
10
10
|
});
|
11
11
|
exports["default"] = void 0;
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
13
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
13
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
14
15
|
var _react = _interopRequireWildcard(require("react"));
|
15
16
|
var _react2 = _interopRequireDefault(require("@monaco-editor/react"));
|
17
|
+
var _hooks = require("../../hooks");
|
16
18
|
var _index = require("../../index");
|
19
|
+
var _languageMapping = _interopRequireDefault(require("../../utils/devUtils/constants/languageMapping"));
|
17
20
|
var _react3 = require("@emotion/react");
|
18
|
-
var _excluded = ["
|
21
|
+
var _excluded = ["defaultValue", "language", "onChange", "onValidate", "height", "className", "isReadOnly", "iconButtonProps"];
|
19
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
20
23
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
21
24
|
var CodeEditor = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
22
|
-
var
|
25
|
+
var defaultValue = props.defaultValue,
|
23
26
|
language = props.language,
|
24
27
|
onChange = props.onChange,
|
25
28
|
onValidate = props.onValidate,
|
26
29
|
height = props.height,
|
30
|
+
className = props.className,
|
31
|
+
isReadOnly = props.isReadOnly,
|
32
|
+
iconButtonProps = props.iconButtonProps,
|
27
33
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
34
|
+
var _useStatusClasses = (0, _hooks.useStatusClasses)(className, {
|
35
|
+
isReadOnly: isReadOnly
|
36
|
+
}),
|
37
|
+
classNames = _useStatusClasses.classNames;
|
28
38
|
var editorRef = (0, _react.useRef)(null);
|
39
|
+
var _useState = (0, _react.useState)(''),
|
40
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
41
|
+
code = _useState2[0],
|
42
|
+
setCode = _useState2[1];
|
43
|
+
var handleChange = function handleChange(value) {
|
44
|
+
if (value) {
|
45
|
+
setCode(value);
|
46
|
+
if (onChange) {
|
47
|
+
onChange(value);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
};
|
51
|
+
var languageName = function languageName(languageExtension) {
|
52
|
+
return _languageMapping["default"][languageExtension] || languageExtension;
|
53
|
+
};
|
29
54
|
return (0, _react3.jsx)(_index.Box, (0, _extends2["default"])({}, others, {
|
30
55
|
ref: ref
|
31
56
|
}), (0, _react3.jsx)(_index.Box, {
|
32
|
-
|
33
|
-
|
34
|
-
|
57
|
+
ref: ref,
|
58
|
+
className: classNames,
|
59
|
+
variant: "codeEditor.wrapper"
|
60
|
+
}, (0, _react3.jsx)(_index.Box, {
|
61
|
+
isRow: true,
|
62
|
+
justifyContent: "space-between",
|
63
|
+
alignItems: "center",
|
64
|
+
variant: "codeEditor.header"
|
65
|
+
}, (0, _react3.jsx)(_index.Text, {
|
66
|
+
mb: "0",
|
67
|
+
mr: "sm",
|
68
|
+
py: "sm"
|
69
|
+
}, typeof language === 'string' ? languageName(language) : ''), (0, _react3.jsx)(_index.CopyText, {
|
70
|
+
ref: ref,
|
71
|
+
mode: "rightText",
|
72
|
+
textToCopy: code || defaultValue,
|
73
|
+
iconButtonProps: iconButtonProps
|
74
|
+
})), (0, _react3.jsx)(_index.Box, {
|
75
|
+
height: height,
|
76
|
+
className: classNames,
|
77
|
+
ref: editorRef
|
35
78
|
}, (0, _react3.jsx)(_react2["default"], {
|
36
79
|
height: "100%",
|
37
80
|
language: language,
|
38
|
-
|
81
|
+
defaultValue: defaultValue,
|
39
82
|
theme: "vs-light",
|
40
|
-
onChange:
|
83
|
+
onChange: handleChange,
|
41
84
|
onValidate: onValidate,
|
42
85
|
options: {
|
43
86
|
fontSize: 14,
|
@@ -47,9 +90,15 @@ var CodeEditor = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
47
90
|
},
|
48
91
|
stickyScroll: {
|
49
92
|
enabled: false
|
93
|
+
},
|
94
|
+
readOnly: isReadOnly,
|
95
|
+
scrollBeyondLastLine: false,
|
96
|
+
padding: {
|
97
|
+
top: 13,
|
98
|
+
bottom: 13
|
50
99
|
}
|
51
100
|
}
|
52
|
-
})));
|
101
|
+
}))));
|
53
102
|
});
|
54
103
|
var _default = CodeEditor;
|
55
104
|
exports["default"] = _default;
|
@@ -3,7 +3,7 @@ import { StoryFn } from '@storybook/react';
|
|
3
3
|
import { CodeEditorProps } from '../../types';
|
4
4
|
declare const _default: {
|
5
5
|
title: string;
|
6
|
-
component: React.ForwardRefExoticComponent<CodeEditorProps & React.RefAttributes<
|
6
|
+
component: React.ForwardRefExoticComponent<CodeEditorProps & React.RefAttributes<HTMLDivElement>>;
|
7
7
|
parameters: {
|
8
8
|
docs: {
|
9
9
|
page: () => React.JSX.Element;
|
@@ -25,3 +25,4 @@ export default _default;
|
|
25
25
|
export declare const TypescriptEditor: StoryFn<CodeEditorProps>;
|
26
26
|
export declare const JavascriptEditor: StoryFn<CodeEditorProps>;
|
27
27
|
export declare const JsonEditor: StoryFn<CodeEditorProps>;
|
28
|
+
export declare const ReadOnly: StoryFn<CodeEditorProps>;
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
5
5
|
_Object$defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
|
-
exports["default"] = exports.TypescriptEditor = exports.JsonEditor = exports.JavascriptEditor = void 0;
|
8
|
+
exports["default"] = exports.TypescriptEditor = exports.ReadOnly = exports.JsonEditor = exports.JavascriptEditor = void 0;
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
10
10
|
var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
|
11
11
|
var _index = require("../../index");
|
@@ -42,7 +42,7 @@ var tsCode = "const stringValue: string = 15;\n\nfunction addOne(integer: number
|
|
42
42
|
var jsCode = "\nfunction factorial(n) {\n if (n === 0 || n === 1) {\n return 1;\n } else {\n return n * factorial(n - 1);\n }\n}\n\nconsole.log(factorial(5));\n\n(a) => {};\n";
|
43
43
|
var TypescriptEditor = function TypescriptEditor() {
|
44
44
|
return (0, _react2.jsx)(_index.CodeEditor, {
|
45
|
-
|
45
|
+
defaultValue: tsCode,
|
46
46
|
language: "typescript",
|
47
47
|
height: "200px"
|
48
48
|
});
|
@@ -50,7 +50,7 @@ var TypescriptEditor = function TypescriptEditor() {
|
|
50
50
|
exports.TypescriptEditor = TypescriptEditor;
|
51
51
|
var JavascriptEditor = function JavascriptEditor() {
|
52
52
|
return (0, _react2.jsx)(_index.CodeEditor, {
|
53
|
-
|
53
|
+
defaultValue: jsCode,
|
54
54
|
language: "javascript",
|
55
55
|
height: "200px"
|
56
56
|
});
|
@@ -58,9 +58,18 @@ var JavascriptEditor = function JavascriptEditor() {
|
|
58
58
|
exports.JavascriptEditor = JavascriptEditor;
|
59
59
|
var JsonEditor = function JsonEditor() {
|
60
60
|
return (0, _react2.jsx)(_index.CodeEditor, {
|
61
|
-
|
61
|
+
defaultValue: jsonCode,
|
62
62
|
language: "json",
|
63
63
|
height: "200px"
|
64
64
|
});
|
65
65
|
};
|
66
|
-
exports.JsonEditor = JsonEditor;
|
66
|
+
exports.JsonEditor = JsonEditor;
|
67
|
+
var ReadOnly = function ReadOnly() {
|
68
|
+
return (0, _react2.jsx)(_index.CodeEditor, {
|
69
|
+
defaultValue: jsonCode,
|
70
|
+
language: "json",
|
71
|
+
height: "200px",
|
72
|
+
isReadOnly: true
|
73
|
+
});
|
74
|
+
};
|
75
|
+
exports.ReadOnly = ReadOnly;
|
@@ -5,6 +5,21 @@ declare const _default: {
|
|
5
5
|
borderStyle: string;
|
6
6
|
borderWidth: string;
|
7
7
|
width: string;
|
8
|
+
'&.is-read-only': {
|
9
|
+
borderWidth: string;
|
10
|
+
'&:after': {
|
11
|
+
display: string;
|
12
|
+
};
|
13
|
+
};
|
14
|
+
};
|
15
|
+
header: {
|
16
|
+
color: string;
|
17
|
+
px: string;
|
18
|
+
width: string;
|
19
|
+
borderBottom: string;
|
20
|
+
borderColor: string;
|
21
|
+
lineHeight: string;
|
22
|
+
fontWeight: string;
|
8
23
|
};
|
9
24
|
};
|
10
25
|
export default _default;
|
@@ -19,12 +19,28 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
19
19
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
20
20
|
var wrapper = _objectSpread(_objectSpread({}, _Input.input.fieldControlWrapper), {}, {
|
21
21
|
borderColor: 'neutral.80',
|
22
|
-
borderRadius: '
|
22
|
+
borderRadius: '4px 0 0 4px',
|
23
23
|
borderStyle: 'solid',
|
24
24
|
borderWidth: '1px 1px 1px 0px',
|
25
|
-
width: '100%'
|
25
|
+
width: '100%',
|
26
|
+
'&.is-read-only': {
|
27
|
+
borderWidth: '1px',
|
28
|
+
'&:after': {
|
29
|
+
display: 'none'
|
30
|
+
}
|
31
|
+
}
|
26
32
|
});
|
33
|
+
var header = {
|
34
|
+
color: 'gray-300',
|
35
|
+
px: 'md',
|
36
|
+
width: '100%',
|
37
|
+
borderBottom: '1px solid',
|
38
|
+
borderColor: 'neutral.80',
|
39
|
+
lineHeight: 'body',
|
40
|
+
fontWeight: '600'
|
41
|
+
};
|
27
42
|
var _default = {
|
28
|
-
wrapper: wrapper
|
43
|
+
wrapper: wrapper,
|
44
|
+
header: header
|
29
45
|
};
|
30
46
|
exports["default"] = _default;
|
@@ -24,7 +24,7 @@ var jsCode = "\n function helloWorld() {\n console.log(\"Hello, World!\");\n
|
|
24
24
|
},
|
25
25
|
renderComponent: function renderComponent(props) {
|
26
26
|
return (0, _react2.jsx)(_index.CodeEditor, (0, _extends2["default"])({}, defaultProps, props, {
|
27
|
-
|
27
|
+
defaultValue: jsCode,
|
28
28
|
language: "javascript"
|
29
29
|
}));
|
30
30
|
}
|
@@ -35,14 +35,14 @@ jest.mock('@monaco-editor/react', function () {
|
|
35
35
|
"default": function _default(_ref) {
|
36
36
|
var _context;
|
37
37
|
var language = _ref.language,
|
38
|
-
|
38
|
+
defaultValue = _ref.defaultValue,
|
39
39
|
_onChange = _ref.onChange;
|
40
40
|
return (0, _react2.jsx)("textarea", {
|
41
41
|
"data-testid": "mock-monaco-editor",
|
42
42
|
onChange: function onChange(e) {
|
43
43
|
return _onChange(e.target.value);
|
44
44
|
},
|
45
|
-
value: (0, _concat["default"])(_context = "Editor Language: ".concat(language, ", Code:")).call(_context,
|
45
|
+
value: (0, _concat["default"])(_context = "Editor Language: ".concat(language, ", Code:")).call(_context, defaultValue),
|
46
46
|
"aria-label": "Code editor"
|
47
47
|
});
|
48
48
|
}
|
@@ -53,7 +53,7 @@ describe('CodeEditor', function () {
|
|
53
53
|
var value = 'console.log("Hello, World!");';
|
54
54
|
(0, _testWrapper.render)((0, _react2.jsx)(_index.CodeEditor, {
|
55
55
|
language: "javascript",
|
56
|
-
|
56
|
+
defaultValue: value
|
57
57
|
}));
|
58
58
|
expect(_testWrapper.screen.getByTestId('mock-monaco-editor')).toBeInTheDocument();
|
59
59
|
expect(_testWrapper.screen.getByText('Editor Language: javascript, Code:console.log("Hello, World!");')).toBeInTheDocument();
|
@@ -63,7 +63,7 @@ describe('CodeEditor', function () {
|
|
63
63
|
var mockOnChange = jest.fn();
|
64
64
|
(0, _testWrapper.render)((0, _react2.jsx)(_index.CodeEditor, {
|
65
65
|
language: "javascript",
|
66
|
-
|
66
|
+
defaultValue: value,
|
67
67
|
onChange: mockOnChange
|
68
68
|
}));
|
69
69
|
var editor = _testWrapper.screen.getByTestId('mock-monaco-editor');
|
@@ -79,4 +79,28 @@ describe('CodeEditor', function () {
|
|
79
79
|
});
|
80
80
|
expect(mockOnChange).toHaveBeenCalled();
|
81
81
|
});
|
82
|
+
it('displays the correct language name in the header for mapped languages', function () {
|
83
|
+
(0, _testWrapper.render)((0, _react2.jsx)(_index.CodeEditor, {
|
84
|
+
language: "typescript",
|
85
|
+
defaultValue: jsCode
|
86
|
+
}));
|
87
|
+
expect(_testWrapper.screen.getByText('TypeScript')).toBeInTheDocument();
|
88
|
+
(0, _testWrapper.render)((0, _react2.jsx)(_index.CodeEditor, {
|
89
|
+
language: "scss",
|
90
|
+
defaultValue: jsCode
|
91
|
+
}));
|
92
|
+
expect(_testWrapper.screen.getByText('SCSS')).toBeInTheDocument();
|
93
|
+
(0, _testWrapper.render)((0, _react2.jsx)(_index.CodeEditor, {
|
94
|
+
language: "python",
|
95
|
+
defaultValue: jsCode
|
96
|
+
}));
|
97
|
+
expect(_testWrapper.screen.getByText('Python')).toBeInTheDocument();
|
98
|
+
});
|
99
|
+
it('displays the language extension as-is if not mapped', function () {
|
100
|
+
(0, _testWrapper.render)((0, _react2.jsx)(_index.CodeEditor, {
|
101
|
+
language: "unknownlang",
|
102
|
+
defaultValue: jsCode
|
103
|
+
}));
|
104
|
+
expect(_testWrapper.screen.getByText('unknownlang')).toBeInTheDocument();
|
105
|
+
});
|
82
106
|
});
|
@@ -51,7 +51,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
51
51
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty2(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
52
52
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(source), !0)).call(_context3, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
53
53
|
var CondensedMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
54
|
-
var _selectionManager$sta, _selectionManager$sta2, _selectionManager$sta3, _listBoxRef$
|
54
|
+
var _selectionManager$sta, _selectionManager$sta2, _selectionManager$sta3, _listBoxRef$current2;
|
55
55
|
var defaultSelectedKeys = props.defaultSelectedKeys,
|
56
56
|
direction = props.direction,
|
57
57
|
_props$disabledKeys = props.disabledKeys,
|
@@ -247,6 +247,14 @@ var CondensedMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
247
247
|
}
|
248
248
|
if (onKeyDown) onKeyDown(e.nativeEvent);
|
249
249
|
};
|
250
|
+
var handleBlur = function handleBlur(e) {
|
251
|
+
var _inputWrapperRef$curr, _listBoxRef$current;
|
252
|
+
var relatedTarget = e.relatedTarget || document.activeElement;
|
253
|
+
if ((_inputWrapperRef$curr = inputWrapperRef.current) !== null && _inputWrapperRef$curr !== void 0 && _inputWrapperRef$curr.contains(relatedTarget) || (_listBoxRef$current = listBoxRef.current) !== null && _listBoxRef$current !== void 0 && _listBoxRef$current.contains(relatedTarget) || buttonRef.current === relatedTarget) {
|
254
|
+
return;
|
255
|
+
}
|
256
|
+
setIsOpen(false);
|
257
|
+
};
|
250
258
|
var _useState9 = (0, _react.useState)('Select All'),
|
251
259
|
_useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
|
252
260
|
selectionState = _useState10[0],
|
@@ -301,7 +309,10 @@ var CondensedMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
301
309
|
loadingState: loadingState,
|
302
310
|
isLoading: loadingState === _loadingStates["default"].LOADING_MORE,
|
303
311
|
"aria-label": "List of options",
|
304
|
-
isCondensed: mode === 'condensed'
|
312
|
+
isCondensed: mode === 'condensed',
|
313
|
+
onBlur: function onBlur(e) {
|
314
|
+
return handleBlur(e);
|
315
|
+
}
|
305
316
|
}, overlayProps))), (0, _react2.jsx)(_reactAria.DismissButton, {
|
306
317
|
onDismiss: close
|
307
318
|
}));
|
@@ -320,7 +331,7 @@ var CondensedMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
320
331
|
var inputProps = _objectSpread(_objectSpread({}, customInputProps), {}, {
|
321
332
|
controlProps: {
|
322
333
|
'aria-activedescendant': activeDescendant,
|
323
|
-
'aria-controls': (_listBoxRef$
|
334
|
+
'aria-controls': (_listBoxRef$current2 = listBoxRef.current) === null || _listBoxRef$current2 === void 0 ? void 0 : _listBoxRef$current2.id,
|
324
335
|
'aria-expanded': isOpen,
|
325
336
|
role: 'combobox',
|
326
337
|
ref: inputRef,
|
@@ -1060,6 +1060,41 @@ test('opening and closing listbox fires "onOpenChange" in condensed mode', funct
|
|
1060
1060
|
expect(_testWrapper.screen.queryByRole('listbox')).not.toBeInTheDocument();
|
1061
1061
|
expect(onOpenChange).toHaveBeenCalledWith(false);
|
1062
1062
|
});
|
1063
|
+
test('in condensed mode, clicking outside of listbox closes listbox', function () {
|
1064
|
+
var onOpenChange = jest.fn();
|
1065
|
+
getComponent({
|
1066
|
+
mode: 'condensed',
|
1067
|
+
onOpenChange: onOpenChange
|
1068
|
+
});
|
1069
|
+
var input = _testWrapper.screen.getByRole('combobox');
|
1070
|
+
_userEvent["default"].tab();
|
1071
|
+
expect(input).toHaveFocus();
|
1072
|
+
expect(_testWrapper.screen.queryByRole('listbox')).toBeInTheDocument();
|
1073
|
+
expect(onOpenChange).toHaveBeenCalledWith(true);
|
1074
|
+
_userEvent["default"].click(document.body);
|
1075
|
+
expect(_testWrapper.screen.queryByRole('listbox')).not.toBeInTheDocument();
|
1076
|
+
expect(onOpenChange).toHaveBeenCalledWith(false);
|
1077
|
+
});
|
1078
|
+
test('in condensed mode, tabbing outside of listbox closes listbox', function () {
|
1079
|
+
var onOpenChange = jest.fn();
|
1080
|
+
getComponent({
|
1081
|
+
mode: 'condensed',
|
1082
|
+
onOpenChange: onOpenChange
|
1083
|
+
});
|
1084
|
+
var input = _testWrapper.screen.getByRole('combobox');
|
1085
|
+
_userEvent["default"].tab();
|
1086
|
+
expect(input).toHaveFocus();
|
1087
|
+
expect(_testWrapper.screen.queryByRole('listbox')).toBeInTheDocument();
|
1088
|
+
expect(onOpenChange).toHaveBeenCalledWith(true);
|
1089
|
+
// one tab to move focus to select all button
|
1090
|
+
_userEvent["default"].tab();
|
1091
|
+
// one tab to move focus to list
|
1092
|
+
_userEvent["default"].tab();
|
1093
|
+
// one tab to move focus beyond lsit
|
1094
|
+
_userEvent["default"].tab();
|
1095
|
+
expect(_testWrapper.screen.queryByRole('listbox')).not.toBeInTheDocument();
|
1096
|
+
expect(onOpenChange).toHaveBeenCalledWith(false);
|
1097
|
+
});
|
1063
1098
|
test('selected keys in condensed mode ', function () {
|
1064
1099
|
getComponent({
|
1065
1100
|
mode: 'condensed',
|
@@ -1,12 +1,15 @@
|
|
1
1
|
import { type editor } from 'monaco-editor';
|
2
2
|
import * as monaco from 'monaco-editor';
|
3
|
+
import { IconButtonProps } from './iconButton';
|
3
4
|
import { DOMAttributes, StyleProps } from './shared';
|
4
5
|
import { FocusableElement } from '.';
|
5
6
|
export interface CodeEditorProps extends Omit<DOMAttributes<FocusableElement>, 'onChange'>, StyleProps {
|
6
|
-
|
7
|
+
defaultValue?: string;
|
7
8
|
language?: string;
|
8
9
|
onChange?: (value: string | undefined) => void;
|
9
10
|
onValidate?: (markers: editor.IMarker[]) => void;
|
11
|
+
isReadOnly?: boolean;
|
12
|
+
iconButtonProps?: Omit<IconButtonProps, 'onPress'>;
|
10
13
|
}
|
11
14
|
export interface CustomEditorOptions extends monaco.editor.IStandaloneEditorConstructionOptions {
|
12
15
|
stickyScroll?: {
|
@@ -0,0 +1,31 @@
|
|
1
|
+
declare const _default: {
|
2
|
+
typescript: string;
|
3
|
+
javascript: string;
|
4
|
+
css: string;
|
5
|
+
less: string;
|
6
|
+
scss: string;
|
7
|
+
json: string;
|
8
|
+
html: string;
|
9
|
+
xml: string;
|
10
|
+
php: string;
|
11
|
+
csharp: string;
|
12
|
+
cpp: string;
|
13
|
+
razor: string;
|
14
|
+
markdown: string;
|
15
|
+
diff: string;
|
16
|
+
java: string;
|
17
|
+
vb: string;
|
18
|
+
coffeescript: string;
|
19
|
+
handlebars: string;
|
20
|
+
bat: string;
|
21
|
+
pug: string;
|
22
|
+
fsharp: string;
|
23
|
+
lua: string;
|
24
|
+
powershell: string;
|
25
|
+
python: string;
|
26
|
+
ruby: string;
|
27
|
+
sass: string;
|
28
|
+
r: string;
|
29
|
+
'objective-c': string;
|
30
|
+
};
|
31
|
+
export default _default;
|
@@ -0,0 +1,38 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
_Object$defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports["default"] = void 0;
|
8
|
+
var _default = {
|
9
|
+
'typescript': 'TypeScript',
|
10
|
+
'javascript': 'JavaScript',
|
11
|
+
'css': 'CSS',
|
12
|
+
'less': 'LESS',
|
13
|
+
'scss': 'SCSS',
|
14
|
+
'json': 'JSON',
|
15
|
+
'html': 'HTML',
|
16
|
+
'xml': 'XML',
|
17
|
+
'php': 'PHP',
|
18
|
+
'csharp': 'C#',
|
19
|
+
'cpp': 'C++',
|
20
|
+
'razor': 'Razor',
|
21
|
+
'markdown': 'Markdown',
|
22
|
+
'diff': 'Diff',
|
23
|
+
'java': 'Java',
|
24
|
+
'vb': 'VB',
|
25
|
+
'coffeescript': 'CoffeeScript',
|
26
|
+
'handlebars': 'Handlebars',
|
27
|
+
'bat': 'Batch',
|
28
|
+
'pug': 'Pug',
|
29
|
+
'fsharp': 'F#',
|
30
|
+
'lua': 'Lua',
|
31
|
+
'powershell': 'PowerShell',
|
32
|
+
'python': 'Python',
|
33
|
+
'ruby': 'Ruby',
|
34
|
+
'sass': 'SASS',
|
35
|
+
'r': 'R',
|
36
|
+
'objective-c': 'Objective-C'
|
37
|
+
};
|
38
|
+
exports["default"] = _default;
|
@@ -1,30 +1,73 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
2
3
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
|
-
var _excluded = ["
|
4
|
-
import React, { forwardRef, useRef } from 'react';
|
4
|
+
var _excluded = ["defaultValue", "language", "onChange", "onValidate", "height", "className", "isReadOnly", "iconButtonProps"];
|
5
|
+
import React, { forwardRef, useRef, useState } from 'react';
|
5
6
|
import Editor from '@monaco-editor/react';
|
6
|
-
import {
|
7
|
+
import { useStatusClasses } from '../../hooks';
|
8
|
+
import { Box, CopyText, Text } from '../../index';
|
9
|
+
import languageMapping from '../../utils/devUtils/constants/languageMapping';
|
7
10
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
8
11
|
var CodeEditor = /*#__PURE__*/forwardRef(function (props, ref) {
|
9
|
-
var
|
12
|
+
var defaultValue = props.defaultValue,
|
10
13
|
language = props.language,
|
11
14
|
onChange = props.onChange,
|
12
15
|
onValidate = props.onValidate,
|
13
16
|
height = props.height,
|
17
|
+
className = props.className,
|
18
|
+
isReadOnly = props.isReadOnly,
|
19
|
+
iconButtonProps = props.iconButtonProps,
|
14
20
|
others = _objectWithoutProperties(props, _excluded);
|
21
|
+
var _useStatusClasses = useStatusClasses(className, {
|
22
|
+
isReadOnly: isReadOnly
|
23
|
+
}),
|
24
|
+
classNames = _useStatusClasses.classNames;
|
15
25
|
var editorRef = useRef(null);
|
26
|
+
var _useState = useState(''),
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
28
|
+
code = _useState2[0],
|
29
|
+
setCode = _useState2[1];
|
30
|
+
var handleChange = function handleChange(value) {
|
31
|
+
if (value) {
|
32
|
+
setCode(value);
|
33
|
+
if (onChange) {
|
34
|
+
onChange(value);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
};
|
38
|
+
var languageName = function languageName(languageExtension) {
|
39
|
+
return languageMapping[languageExtension] || languageExtension;
|
40
|
+
};
|
16
41
|
return ___EmotionJSX(Box, _extends({}, others, {
|
17
42
|
ref: ref
|
18
43
|
}), ___EmotionJSX(Box, {
|
19
|
-
|
20
|
-
|
21
|
-
|
44
|
+
ref: ref,
|
45
|
+
className: classNames,
|
46
|
+
variant: "codeEditor.wrapper"
|
47
|
+
}, ___EmotionJSX(Box, {
|
48
|
+
isRow: true,
|
49
|
+
justifyContent: "space-between",
|
50
|
+
alignItems: "center",
|
51
|
+
variant: "codeEditor.header"
|
52
|
+
}, ___EmotionJSX(Text, {
|
53
|
+
mb: "0",
|
54
|
+
mr: "sm",
|
55
|
+
py: "sm"
|
56
|
+
}, typeof language === 'string' ? languageName(language) : ''), ___EmotionJSX(CopyText, {
|
57
|
+
ref: ref,
|
58
|
+
mode: "rightText",
|
59
|
+
textToCopy: code || defaultValue,
|
60
|
+
iconButtonProps: iconButtonProps
|
61
|
+
})), ___EmotionJSX(Box, {
|
62
|
+
height: height,
|
63
|
+
className: classNames,
|
64
|
+
ref: editorRef
|
22
65
|
}, ___EmotionJSX(Editor, {
|
23
66
|
height: "100%",
|
24
67
|
language: language,
|
25
|
-
|
68
|
+
defaultValue: defaultValue,
|
26
69
|
theme: "vs-light",
|
27
|
-
onChange:
|
70
|
+
onChange: handleChange,
|
28
71
|
onValidate: onValidate,
|
29
72
|
options: {
|
30
73
|
fontSize: 14,
|
@@ -34,8 +77,14 @@ var CodeEditor = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
34
77
|
},
|
35
78
|
stickyScroll: {
|
36
79
|
enabled: false
|
80
|
+
},
|
81
|
+
readOnly: isReadOnly,
|
82
|
+
scrollBeyondLastLine: false,
|
83
|
+
padding: {
|
84
|
+
top: 13,
|
85
|
+
bottom: 13
|
37
86
|
}
|
38
87
|
}
|
39
|
-
})));
|
88
|
+
}))));
|
40
89
|
});
|
41
90
|
export default CodeEditor;
|
@@ -33,22 +33,30 @@ var tsCode = "const stringValue: string = 15;\n\nfunction addOne(integer: number
|
|
33
33
|
var jsCode = "\nfunction factorial(n) {\n if (n === 0 || n === 1) {\n return 1;\n } else {\n return n * factorial(n - 1);\n }\n}\n\nconsole.log(factorial(5));\n\n(a) => {};\n";
|
34
34
|
export var TypescriptEditor = function TypescriptEditor() {
|
35
35
|
return ___EmotionJSX(CodeEditor, {
|
36
|
-
|
36
|
+
defaultValue: tsCode,
|
37
37
|
language: "typescript",
|
38
38
|
height: "200px"
|
39
39
|
});
|
40
40
|
};
|
41
41
|
export var JavascriptEditor = function JavascriptEditor() {
|
42
42
|
return ___EmotionJSX(CodeEditor, {
|
43
|
-
|
43
|
+
defaultValue: jsCode,
|
44
44
|
language: "javascript",
|
45
45
|
height: "200px"
|
46
46
|
});
|
47
47
|
};
|
48
48
|
export var JsonEditor = function JsonEditor() {
|
49
49
|
return ___EmotionJSX(CodeEditor, {
|
50
|
-
|
50
|
+
defaultValue: jsonCode,
|
51
51
|
language: "json",
|
52
52
|
height: "200px"
|
53
53
|
});
|
54
|
+
};
|
55
|
+
export var ReadOnly = function ReadOnly() {
|
56
|
+
return ___EmotionJSX(CodeEditor, {
|
57
|
+
defaultValue: jsonCode,
|
58
|
+
language: "json",
|
59
|
+
height: "200px",
|
60
|
+
isReadOnly: true
|
61
|
+
});
|
54
62
|
};
|
@@ -12,11 +12,27 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
12
12
|
import { input } from '../Input/Input.styles';
|
13
13
|
var wrapper = _objectSpread(_objectSpread({}, input.fieldControlWrapper), {}, {
|
14
14
|
borderColor: 'neutral.80',
|
15
|
-
borderRadius: '
|
15
|
+
borderRadius: '4px 0 0 4px',
|
16
16
|
borderStyle: 'solid',
|
17
17
|
borderWidth: '1px 1px 1px 0px',
|
18
|
-
width: '100%'
|
18
|
+
width: '100%',
|
19
|
+
'&.is-read-only': {
|
20
|
+
borderWidth: '1px',
|
21
|
+
'&:after': {
|
22
|
+
display: 'none'
|
23
|
+
}
|
24
|
+
}
|
19
25
|
});
|
26
|
+
var header = {
|
27
|
+
color: 'gray-300',
|
28
|
+
px: 'md',
|
29
|
+
width: '100%',
|
30
|
+
borderBottom: '1px solid',
|
31
|
+
borderColor: 'neutral.80',
|
32
|
+
lineHeight: 'body',
|
33
|
+
fontWeight: '600'
|
34
|
+
};
|
20
35
|
export default {
|
21
|
-
wrapper: wrapper
|
36
|
+
wrapper: wrapper,
|
37
|
+
header: header
|
22
38
|
};
|
@@ -21,7 +21,7 @@ universalComponentTests({
|
|
21
21
|
},
|
22
22
|
renderComponent: function renderComponent(props) {
|
23
23
|
return ___EmotionJSX(CodeEditor, _extends({}, defaultProps, props, {
|
24
|
-
|
24
|
+
defaultValue: jsCode,
|
25
25
|
language: "javascript"
|
26
26
|
}));
|
27
27
|
}
|
@@ -32,14 +32,14 @@ jest.mock('@monaco-editor/react', function () {
|
|
32
32
|
"default": function _default(_ref) {
|
33
33
|
var _context;
|
34
34
|
var language = _ref.language,
|
35
|
-
|
35
|
+
defaultValue = _ref.defaultValue,
|
36
36
|
_onChange = _ref.onChange;
|
37
37
|
return ___EmotionJSX("textarea", {
|
38
38
|
"data-testid": "mock-monaco-editor",
|
39
39
|
onChange: function onChange(e) {
|
40
40
|
return _onChange(e.target.value);
|
41
41
|
},
|
42
|
-
value: _concatInstanceProperty(_context = "Editor Language: ".concat(language, ", Code:")).call(_context,
|
42
|
+
value: _concatInstanceProperty(_context = "Editor Language: ".concat(language, ", Code:")).call(_context, defaultValue),
|
43
43
|
"aria-label": "Code editor"
|
44
44
|
});
|
45
45
|
}
|
@@ -50,7 +50,7 @@ describe('CodeEditor', function () {
|
|
50
50
|
var value = 'console.log("Hello, World!");';
|
51
51
|
render(___EmotionJSX(CodeEditor, {
|
52
52
|
language: "javascript",
|
53
|
-
|
53
|
+
defaultValue: value
|
54
54
|
}));
|
55
55
|
expect(screen.getByTestId('mock-monaco-editor')).toBeInTheDocument();
|
56
56
|
expect(screen.getByText('Editor Language: javascript, Code:console.log("Hello, World!");')).toBeInTheDocument();
|
@@ -60,7 +60,7 @@ describe('CodeEditor', function () {
|
|
60
60
|
var mockOnChange = jest.fn();
|
61
61
|
render(___EmotionJSX(CodeEditor, {
|
62
62
|
language: "javascript",
|
63
|
-
|
63
|
+
defaultValue: value,
|
64
64
|
onChange: mockOnChange
|
65
65
|
}));
|
66
66
|
var editor = screen.getByTestId('mock-monaco-editor');
|
@@ -76,4 +76,28 @@ describe('CodeEditor', function () {
|
|
76
76
|
});
|
77
77
|
expect(mockOnChange).toHaveBeenCalled();
|
78
78
|
});
|
79
|
+
it('displays the correct language name in the header for mapped languages', function () {
|
80
|
+
render(___EmotionJSX(CodeEditor, {
|
81
|
+
language: "typescript",
|
82
|
+
defaultValue: jsCode
|
83
|
+
}));
|
84
|
+
expect(screen.getByText('TypeScript')).toBeInTheDocument();
|
85
|
+
render(___EmotionJSX(CodeEditor, {
|
86
|
+
language: "scss",
|
87
|
+
defaultValue: jsCode
|
88
|
+
}));
|
89
|
+
expect(screen.getByText('SCSS')).toBeInTheDocument();
|
90
|
+
render(___EmotionJSX(CodeEditor, {
|
91
|
+
language: "python",
|
92
|
+
defaultValue: jsCode
|
93
|
+
}));
|
94
|
+
expect(screen.getByText('Python')).toBeInTheDocument();
|
95
|
+
});
|
96
|
+
it('displays the language extension as-is if not mapped', function () {
|
97
|
+
render(___EmotionJSX(CodeEditor, {
|
98
|
+
language: "unknownlang",
|
99
|
+
defaultValue: jsCode
|
100
|
+
}));
|
101
|
+
expect(screen.getByText('unknownlang')).toBeInTheDocument();
|
102
|
+
});
|
79
103
|
});
|
@@ -39,7 +39,7 @@ import { statusDefaultProp, statusPropTypes } from '../../utils/docUtils/statusP
|
|
39
39
|
import ListBox from '../ListBox';
|
40
40
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
41
41
|
var CondensedMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
42
|
-
var _selectionManager$sta, _selectionManager$sta2, _selectionManager$sta3, _listBoxRef$
|
42
|
+
var _selectionManager$sta, _selectionManager$sta2, _selectionManager$sta3, _listBoxRef$current2;
|
43
43
|
var defaultSelectedKeys = props.defaultSelectedKeys,
|
44
44
|
direction = props.direction,
|
45
45
|
_props$disabledKeys = props.disabledKeys,
|
@@ -235,6 +235,14 @@ var CondensedMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
235
235
|
}
|
236
236
|
if (onKeyDown) onKeyDown(e.nativeEvent);
|
237
237
|
};
|
238
|
+
var handleBlur = function handleBlur(e) {
|
239
|
+
var _inputWrapperRef$curr, _listBoxRef$current;
|
240
|
+
var relatedTarget = e.relatedTarget || document.activeElement;
|
241
|
+
if ((_inputWrapperRef$curr = inputWrapperRef.current) !== null && _inputWrapperRef$curr !== void 0 && _inputWrapperRef$curr.contains(relatedTarget) || (_listBoxRef$current = listBoxRef.current) !== null && _listBoxRef$current !== void 0 && _listBoxRef$current.contains(relatedTarget) || buttonRef.current === relatedTarget) {
|
242
|
+
return;
|
243
|
+
}
|
244
|
+
setIsOpen(false);
|
245
|
+
};
|
238
246
|
var _useState9 = useState('Select All'),
|
239
247
|
_useState10 = _slicedToArray(_useState9, 2),
|
240
248
|
selectionState = _useState10[0],
|
@@ -289,7 +297,10 @@ var CondensedMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
289
297
|
loadingState: loadingState,
|
290
298
|
isLoading: loadingState === loadingStates.LOADING_MORE,
|
291
299
|
"aria-label": "List of options",
|
292
|
-
isCondensed: mode === 'condensed'
|
300
|
+
isCondensed: mode === 'condensed',
|
301
|
+
onBlur: function onBlur(e) {
|
302
|
+
return handleBlur(e);
|
303
|
+
}
|
293
304
|
}, overlayProps))), ___EmotionJSX(DismissButton, {
|
294
305
|
onDismiss: close
|
295
306
|
}));
|
@@ -308,7 +319,7 @@ var CondensedMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
308
319
|
var inputProps = _objectSpread(_objectSpread({}, customInputProps), {}, {
|
309
320
|
controlProps: {
|
310
321
|
'aria-activedescendant': activeDescendant,
|
311
|
-
'aria-controls': (_listBoxRef$
|
322
|
+
'aria-controls': (_listBoxRef$current2 = listBoxRef.current) === null || _listBoxRef$current2 === void 0 ? void 0 : _listBoxRef$current2.id,
|
312
323
|
'aria-expanded': isOpen,
|
313
324
|
role: 'combobox',
|
314
325
|
ref: inputRef,
|
@@ -1053,6 +1053,41 @@ test('opening and closing listbox fires "onOpenChange" in condensed mode', funct
|
|
1053
1053
|
expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
|
1054
1054
|
expect(onOpenChange).toHaveBeenCalledWith(false);
|
1055
1055
|
});
|
1056
|
+
test('in condensed mode, clicking outside of listbox closes listbox', function () {
|
1057
|
+
var onOpenChange = jest.fn();
|
1058
|
+
getComponent({
|
1059
|
+
mode: 'condensed',
|
1060
|
+
onOpenChange: onOpenChange
|
1061
|
+
});
|
1062
|
+
var input = screen.getByRole('combobox');
|
1063
|
+
userEvent.tab();
|
1064
|
+
expect(input).toHaveFocus();
|
1065
|
+
expect(screen.queryByRole('listbox')).toBeInTheDocument();
|
1066
|
+
expect(onOpenChange).toHaveBeenCalledWith(true);
|
1067
|
+
userEvent.click(document.body);
|
1068
|
+
expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
|
1069
|
+
expect(onOpenChange).toHaveBeenCalledWith(false);
|
1070
|
+
});
|
1071
|
+
test('in condensed mode, tabbing outside of listbox closes listbox', function () {
|
1072
|
+
var onOpenChange = jest.fn();
|
1073
|
+
getComponent({
|
1074
|
+
mode: 'condensed',
|
1075
|
+
onOpenChange: onOpenChange
|
1076
|
+
});
|
1077
|
+
var input = screen.getByRole('combobox');
|
1078
|
+
userEvent.tab();
|
1079
|
+
expect(input).toHaveFocus();
|
1080
|
+
expect(screen.queryByRole('listbox')).toBeInTheDocument();
|
1081
|
+
expect(onOpenChange).toHaveBeenCalledWith(true);
|
1082
|
+
// one tab to move focus to select all button
|
1083
|
+
userEvent.tab();
|
1084
|
+
// one tab to move focus to list
|
1085
|
+
userEvent.tab();
|
1086
|
+
// one tab to move focus beyond lsit
|
1087
|
+
userEvent.tab();
|
1088
|
+
expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
|
1089
|
+
expect(onOpenChange).toHaveBeenCalledWith(false);
|
1090
|
+
});
|
1056
1091
|
test('selected keys in condensed mode ', function () {
|
1057
1092
|
getComponent({
|
1058
1093
|
mode: 'condensed',
|
@@ -0,0 +1,30 @@
|
|
1
|
+
export default {
|
2
|
+
'typescript': 'TypeScript',
|
3
|
+
'javascript': 'JavaScript',
|
4
|
+
'css': 'CSS',
|
5
|
+
'less': 'LESS',
|
6
|
+
'scss': 'SCSS',
|
7
|
+
'json': 'JSON',
|
8
|
+
'html': 'HTML',
|
9
|
+
'xml': 'XML',
|
10
|
+
'php': 'PHP',
|
11
|
+
'csharp': 'C#',
|
12
|
+
'cpp': 'C++',
|
13
|
+
'razor': 'Razor',
|
14
|
+
'markdown': 'Markdown',
|
15
|
+
'diff': 'Diff',
|
16
|
+
'java': 'Java',
|
17
|
+
'vb': 'VB',
|
18
|
+
'coffeescript': 'CoffeeScript',
|
19
|
+
'handlebars': 'Handlebars',
|
20
|
+
'bat': 'Batch',
|
21
|
+
'pug': 'Pug',
|
22
|
+
'fsharp': 'F#',
|
23
|
+
'lua': 'Lua',
|
24
|
+
'powershell': 'PowerShell',
|
25
|
+
'python': 'Python',
|
26
|
+
'ruby': 'Ruby',
|
27
|
+
'sass': 'SASS',
|
28
|
+
'r': 'R',
|
29
|
+
'objective-c': 'Objective-C'
|
30
|
+
};
|