@atlaskit/code 17.0.0 → 17.1.1
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/CHANGELOG.md +20 -0
- package/dist/cjs/code-block.js +1 -0
- package/dist/cjs/code.js +0 -9
- package/dist/cjs/constants.js +4 -0
- package/dist/cjs/entry-points/inline.js +2 -10
- package/dist/cjs/index.js +2 -11
- package/dist/cjs/internal/theme/styles.js +1 -24
- package/dist/es2019/code-block.js +1 -0
- package/dist/es2019/code.js +0 -4
- package/dist/es2019/constants.js +4 -0
- package/dist/es2019/entry-points/inline.js +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/internal/theme/styles.js +0 -23
- package/dist/esm/code-block.js +1 -0
- package/dist/esm/code.js +0 -4
- package/dist/esm/constants.js +4 -0
- package/dist/esm/entry-points/inline.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/internal/theme/styles.js +0 -23
- package/dist/types/code.d.ts +0 -2
- package/dist/types/constants.d.ts +4 -0
- package/dist/types/entry-points/inline.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/internal/theme/styles.d.ts +0 -18
- package/dist/types-ts4.5/code.d.ts +0 -2
- package/dist/types-ts4.5/constants.d.ts +8 -0
- package/dist/types-ts4.5/entry-points/inline.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/internal/theme/styles.d.ts +0 -18
- package/package.json +7 -7
- package/report.api.md +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/code
|
|
2
2
|
|
|
3
|
+
## 17.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#152049](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/152049)
|
|
8
|
+
[`a2bdf059329e8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a2bdf059329e8) -
|
|
9
|
+
Add support for Gherkin language to code
|
|
10
|
+
|
|
11
|
+
## 17.1.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#146790](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/146790)
|
|
16
|
+
[`14ab02f5ac440`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/14ab02f5ac440) -
|
|
17
|
+
Removing deprecated `getCodeStyles` function export
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 17.0.0
|
|
4
24
|
|
|
5
25
|
### Major Changes
|
package/dist/cjs/code-block.js
CHANGED
|
@@ -98,6 +98,7 @@ var CodeBlock = /*#__PURE__*/(0, _react.memo)(function CodeBlock(_ref) {
|
|
|
98
98
|
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
99
99
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
100
100
|
text: text,
|
|
101
|
+
tabIndex: "0",
|
|
101
102
|
className: (0, _runtime.ax)([getCodeBlockStyles.root, shouldWrapLongLines ? getCodeBlockStyles.shouldWrapLongLines : getCodeBlockStyles.dontWrapLongLines, showLineNumbers ? getCodeBlockStyles.showLineNumbers : getCodeBlockStyles.dontShowLineNumbers])
|
|
102
103
|
});
|
|
103
104
|
});
|
package/dist/cjs/code.js
CHANGED
|
@@ -7,12 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
9
|
exports.default = void 0;
|
|
10
|
-
Object.defineProperty(exports, "getCodeStyles", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _styles.getCodeStyles;
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
10
|
require("./code.compiled.css");
|
|
17
11
|
var _runtime = require("@compiled/react/runtime");
|
|
18
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
@@ -20,7 +14,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
20
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
15
|
var _bidiWarning = _interopRequireDefault(require("./bidi-warning"));
|
|
22
16
|
var _bidiWarningDecorator = _interopRequireDefault(require("./bidi-warning/bidi-warning-decorator"));
|
|
23
|
-
var _styles = require("./internal/theme/styles");
|
|
24
17
|
var _excluded = ["testId"],
|
|
25
18
|
_excluded2 = ["children", "codeBidiWarnings", "codeBidiWarningLabel", "codeBidiWarningTooltipEnabled"];
|
|
26
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -41,8 +34,6 @@ var styles = {
|
|
|
41
34
|
var Code = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function Code(_ref, ref) {
|
|
42
35
|
var testId = _ref.testId,
|
|
43
36
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
44
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
45
|
-
|
|
46
37
|
var children = props.children,
|
|
47
38
|
_props$codeBidiWarnin = props.codeBidiWarnings,
|
|
48
39
|
codeBidiWarnings = _props$codeBidiWarnin === void 0 ? true : _props$codeBidiWarnin,
|
package/dist/cjs/constants.js
CHANGED
|
@@ -338,6 +338,10 @@ var SUPPORTED_LANGUAGES = exports.SUPPORTED_LANGUAGES = [{
|
|
|
338
338
|
name: 'Handlebars',
|
|
339
339
|
alias: ['handlebars', 'mustache'],
|
|
340
340
|
value: 'handlebars'
|
|
341
|
+
}, {
|
|
342
|
+
name: 'Gherkin',
|
|
343
|
+
alias: ['gherkin', 'cucumber'],
|
|
344
|
+
value: 'gherkin'
|
|
341
345
|
}, {
|
|
342
346
|
name: 'ABAP',
|
|
343
347
|
alias: ['abap'],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -10,12 +10,4 @@ Object.defineProperty(exports, "default", {
|
|
|
10
10
|
return _code.default;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function get() {
|
|
16
|
-
return _code.getCodeStyles;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
var _code = _interopRequireWildcard(require("../code"));
|
|
20
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
21
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
var _code = _interopRequireDefault(require("../code"));
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -23,14 +22,6 @@ Object.defineProperty(exports, "SUPPORTED_LANGUAGES", {
|
|
|
23
22
|
return _constants.SUPPORTED_LANGUAGES;
|
|
24
23
|
}
|
|
25
24
|
});
|
|
26
|
-
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function get() {
|
|
29
|
-
return _code.getCodeStyles;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
var _code = _interopRequireWildcard(require("./code"));
|
|
25
|
+
var _code = _interopRequireDefault(require("./code"));
|
|
33
26
|
var _codeBlock = _interopRequireDefault(require("./code-block"));
|
|
34
|
-
var _constants = require("./constants");
|
|
35
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
36
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
27
|
+
var _constants = require("./constants");
|
|
@@ -3,30 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getLineNumWidth =
|
|
6
|
+
exports.getLineNumWidth = void 0;
|
|
7
7
|
var getLineNumWidth = exports.getLineNumWidth = function getLineNumWidth(numLines) {
|
|
8
8
|
return !numLines ? '1ch' : "".concat(numLines.toFixed(0).length, "ch");
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated
|
|
14
|
-
*/
|
|
15
|
-
var getCodeStyles = exports.getCodeStyles = function getCodeStyles() {
|
|
16
|
-
return {
|
|
17
|
-
display: 'inline',
|
|
18
|
-
padding: '2px 0.5ch',
|
|
19
|
-
backgroundColor: "var(--ds--code--bg-color,".concat("var(--ds-background-neutral, #091E420F)", ")"),
|
|
20
|
-
borderRadius: "var(--ds-border-radius, 3px)",
|
|
21
|
-
borderStyle: 'none',
|
|
22
|
-
boxDecorationBreak: 'clone',
|
|
23
|
-
color: "var(--ds-text, #172B4D)",
|
|
24
|
-
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
25
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
26
|
-
fontSize: '0.875em',
|
|
27
|
-
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
28
|
-
overflow: 'auto',
|
|
29
|
-
overflowWrap: 'break-word',
|
|
30
|
-
whiteSpace: 'pre-wrap'
|
|
31
|
-
};
|
|
32
9
|
};
|
|
@@ -77,6 +77,7 @@ const CodeBlock = /*#__PURE__*/memo(function CodeBlock({
|
|
|
77
77
|
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
78
78
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
79
79
|
text: text,
|
|
80
|
+
tabIndex: "0",
|
|
80
81
|
className: ax([getCodeBlockStyles.root, shouldWrapLongLines ? getCodeBlockStyles.shouldWrapLongLines : getCodeBlockStyles.dontWrapLongLines, showLineNumbers ? getCodeBlockStyles.showLineNumbers : getCodeBlockStyles.dontShowLineNumbers])
|
|
81
82
|
});
|
|
82
83
|
});
|
package/dist/es2019/code.js
CHANGED
|
@@ -5,7 +5,6 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
5
5
|
import React, { forwardRef, memo } from 'react';
|
|
6
6
|
import CodeBidiWarning from './bidi-warning';
|
|
7
7
|
import codeBidiWarningDecorator from './bidi-warning/bidi-warning-decorator';
|
|
8
|
-
import { getCodeStyles } from './internal/theme/styles';
|
|
9
8
|
const styles = {
|
|
10
9
|
base: "_ca0qyh40 _u5f3m5ip _n3tdyh40 _19bvm5ip _2rko1sit _11c81u0j _1reo1wug _18m91wug _1dqoglyw _1e0c1nu9 _bfhktkvp _16d9qvcn _syaz1fxt _vwz41kw7 _1i4q1hna _o5721jtm"
|
|
11
10
|
};
|
|
@@ -23,8 +22,6 @@ const Code = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Code({
|
|
|
23
22
|
testId,
|
|
24
23
|
...props
|
|
25
24
|
}, ref) {
|
|
26
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
27
|
-
|
|
28
25
|
const {
|
|
29
26
|
children,
|
|
30
27
|
codeBidiWarnings = true,
|
|
@@ -79,5 +76,4 @@ function isReactElement(child) {
|
|
|
79
76
|
return !!child.type;
|
|
80
77
|
}
|
|
81
78
|
Code.displayName = 'Code';
|
|
82
|
-
export { getCodeStyles };
|
|
83
79
|
export default Code;
|
package/dist/es2019/constants.js
CHANGED
|
@@ -325,6 +325,10 @@ export const SUPPORTED_LANGUAGES = [{
|
|
|
325
325
|
name: 'Handlebars',
|
|
326
326
|
alias: ['handlebars', 'mustache'],
|
|
327
327
|
value: 'handlebars'
|
|
328
|
+
}, {
|
|
329
|
+
name: 'Gherkin',
|
|
330
|
+
alias: ['gherkin', 'cucumber'],
|
|
331
|
+
value: 'gherkin'
|
|
328
332
|
}, {
|
|
329
333
|
name: 'ABAP',
|
|
330
334
|
alias: ['abap'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default
|
|
1
|
+
export { default } from '../code';
|
package/dist/es2019/index.js
CHANGED
|
@@ -1,26 +1,3 @@
|
|
|
1
1
|
export const getLineNumWidth = numLines => {
|
|
2
2
|
return !numLines ? '1ch' : `${numLines.toFixed(0).length}ch`;
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated
|
|
8
|
-
*/
|
|
9
|
-
export const getCodeStyles = () => {
|
|
10
|
-
return {
|
|
11
|
-
display: 'inline',
|
|
12
|
-
padding: '2px 0.5ch',
|
|
13
|
-
backgroundColor: `var(--ds--code--bg-color,${"var(--ds-background-neutral, #091E420F)"})`,
|
|
14
|
-
borderRadius: "var(--ds-border-radius, 3px)",
|
|
15
|
-
borderStyle: 'none',
|
|
16
|
-
boxDecorationBreak: 'clone',
|
|
17
|
-
color: "var(--ds-text, #172B4D)",
|
|
18
|
-
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
19
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
20
|
-
fontSize: '0.875em',
|
|
21
|
-
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
22
|
-
overflow: 'auto',
|
|
23
|
-
overflowWrap: 'break-word',
|
|
24
|
-
whiteSpace: 'pre-wrap'
|
|
25
|
-
};
|
|
26
3
|
};
|
package/dist/esm/code-block.js
CHANGED
|
@@ -88,6 +88,7 @@ var CodeBlock = /*#__PURE__*/memo(function CodeBlock(_ref) {
|
|
|
88
88
|
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
89
89
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
90
90
|
text: text,
|
|
91
|
+
tabIndex: "0",
|
|
91
92
|
className: ax([getCodeBlockStyles.root, shouldWrapLongLines ? getCodeBlockStyles.shouldWrapLongLines : getCodeBlockStyles.dontWrapLongLines, showLineNumbers ? getCodeBlockStyles.showLineNumbers : getCodeBlockStyles.dontShowLineNumbers])
|
|
92
93
|
});
|
|
93
94
|
});
|
package/dist/esm/code.js
CHANGED
|
@@ -8,7 +8,6 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
8
8
|
import React, { forwardRef, memo } from 'react';
|
|
9
9
|
import CodeBidiWarning from './bidi-warning';
|
|
10
10
|
import codeBidiWarningDecorator from './bidi-warning/bidi-warning-decorator';
|
|
11
|
-
import { getCodeStyles } from './internal/theme/styles';
|
|
12
11
|
var styles = {
|
|
13
12
|
base: "_ca0qyh40 _u5f3m5ip _n3tdyh40 _19bvm5ip _2rko1sit _11c81u0j _1reo1wug _18m91wug _1dqoglyw _1e0c1nu9 _bfhktkvp _16d9qvcn _syaz1fxt _vwz41kw7 _1i4q1hna _o5721jtm"
|
|
14
13
|
};
|
|
@@ -25,8 +24,6 @@ var styles = {
|
|
|
25
24
|
var Code = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Code(_ref, ref) {
|
|
26
25
|
var testId = _ref.testId,
|
|
27
26
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
29
|
-
|
|
30
27
|
var children = props.children,
|
|
31
28
|
_props$codeBidiWarnin = props.codeBidiWarnings,
|
|
32
29
|
codeBidiWarnings = _props$codeBidiWarnin === void 0 ? true : _props$codeBidiWarnin,
|
|
@@ -81,5 +78,4 @@ function isReactElement(child) {
|
|
|
81
78
|
return !!child.type;
|
|
82
79
|
}
|
|
83
80
|
Code.displayName = 'Code';
|
|
84
|
-
export { getCodeStyles };
|
|
85
81
|
export default Code;
|
package/dist/esm/constants.js
CHANGED
|
@@ -325,6 +325,10 @@ export var SUPPORTED_LANGUAGES = [{
|
|
|
325
325
|
name: 'Handlebars',
|
|
326
326
|
alias: ['handlebars', 'mustache'],
|
|
327
327
|
value: 'handlebars'
|
|
328
|
+
}, {
|
|
329
|
+
name: 'Gherkin',
|
|
330
|
+
alias: ['gherkin', 'cucumber'],
|
|
331
|
+
value: 'gherkin'
|
|
328
332
|
}, {
|
|
329
333
|
name: 'ABAP',
|
|
330
334
|
alias: ['abap'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default
|
|
1
|
+
export { default } from '../code';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,26 +1,3 @@
|
|
|
1
1
|
export var getLineNumWidth = function getLineNumWidth(numLines) {
|
|
2
2
|
return !numLines ? '1ch' : "".concat(numLines.toFixed(0).length, "ch");
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated
|
|
8
|
-
*/
|
|
9
|
-
export var getCodeStyles = function getCodeStyles() {
|
|
10
|
-
return {
|
|
11
|
-
display: 'inline',
|
|
12
|
-
padding: '2px 0.5ch',
|
|
13
|
-
backgroundColor: "var(--ds--code--bg-color,".concat("var(--ds-background-neutral, #091E420F)", ")"),
|
|
14
|
-
borderRadius: "var(--ds-border-radius, 3px)",
|
|
15
|
-
borderStyle: 'none',
|
|
16
|
-
boxDecorationBreak: 'clone',
|
|
17
|
-
color: "var(--ds-text, #172B4D)",
|
|
18
|
-
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
19
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
20
|
-
fontSize: '0.875em',
|
|
21
|
-
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
22
|
-
overflow: 'auto',
|
|
23
|
-
overflowWrap: 'break-word',
|
|
24
|
-
whiteSpace: 'pre-wrap'
|
|
25
|
-
};
|
|
26
3
|
};
|
package/dist/types/code.d.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { getCodeStyles } from './internal/theme/styles';
|
|
7
6
|
import type { CodeProps } from './types';
|
|
8
7
|
/**
|
|
9
8
|
* __Code__
|
|
@@ -15,5 +14,4 @@ import type { CodeProps } from './types';
|
|
|
15
14
|
* - [Usage](https://atlassian.design/components/code/usage)
|
|
16
15
|
*/
|
|
17
16
|
declare const Code: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<CodeProps, "ref"> & React.RefAttributes<HTMLElement>>>;
|
|
18
|
-
export { getCodeStyles };
|
|
19
17
|
export default Code;
|
|
@@ -322,6 +322,10 @@ export declare const SUPPORTED_LANGUAGES: readonly [{
|
|
|
322
322
|
readonly name: "Handlebars";
|
|
323
323
|
readonly alias: readonly ["handlebars", "mustache"];
|
|
324
324
|
readonly value: "handlebars";
|
|
325
|
+
}, {
|
|
326
|
+
readonly name: "Gherkin";
|
|
327
|
+
readonly alias: readonly ["gherkin", "cucumber"];
|
|
328
|
+
readonly value: "gherkin";
|
|
325
329
|
}, {
|
|
326
330
|
readonly name: "ABAP";
|
|
327
331
|
readonly alias: readonly ["abap"];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default
|
|
1
|
+
export { default } from '../code';
|
|
2
2
|
export type { CodeBlockProps } from '../types';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as Code
|
|
1
|
+
export { default as Code } from './code';
|
|
2
2
|
export { default as CodeBlock } from './code-block';
|
|
3
3
|
export type { CodeBlockProps, CodeProps, SupportedLanguages, LanguageAlias, Language, } from './types';
|
|
4
4
|
export { SUPPORTED_LANGUAGES } from './constants';
|
|
@@ -1,19 +1 @@
|
|
|
1
1
|
export declare const getLineNumWidth: (numLines: number) => string;
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated
|
|
4
|
-
*/
|
|
5
|
-
export declare const getCodeStyles: () => {
|
|
6
|
-
display: string;
|
|
7
|
-
padding: string;
|
|
8
|
-
backgroundColor: string;
|
|
9
|
-
borderRadius: "var(--ds-border-radius)";
|
|
10
|
-
borderStyle: string;
|
|
11
|
-
boxDecorationBreak: string;
|
|
12
|
-
color: "var(--ds-text)";
|
|
13
|
-
fontFamily: "var(--ds-font-family-code)";
|
|
14
|
-
fontSize: string;
|
|
15
|
-
fontWeight: "var(--ds-font-weight-regular)";
|
|
16
|
-
overflow: string;
|
|
17
|
-
overflowWrap: string;
|
|
18
|
-
whiteSpace: string;
|
|
19
|
-
};
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { getCodeStyles } from './internal/theme/styles';
|
|
7
6
|
import type { CodeProps } from './types';
|
|
8
7
|
/**
|
|
9
8
|
* __Code__
|
|
@@ -15,5 +14,4 @@ import type { CodeProps } from './types';
|
|
|
15
14
|
* - [Usage](https://atlassian.design/components/code/usage)
|
|
16
15
|
*/
|
|
17
16
|
declare const Code: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<CodeProps, "ref"> & React.RefAttributes<HTMLElement>>>;
|
|
18
|
-
export { getCodeStyles };
|
|
19
17
|
export default Code;
|
|
@@ -649,6 +649,14 @@ export declare const SUPPORTED_LANGUAGES: readonly [
|
|
|
649
649
|
];
|
|
650
650
|
readonly value: "handlebars";
|
|
651
651
|
},
|
|
652
|
+
{
|
|
653
|
+
readonly name: "Gherkin";
|
|
654
|
+
readonly alias: readonly [
|
|
655
|
+
"gherkin",
|
|
656
|
+
"cucumber"
|
|
657
|
+
];
|
|
658
|
+
readonly value: "gherkin";
|
|
659
|
+
},
|
|
652
660
|
{
|
|
653
661
|
readonly name: "ABAP";
|
|
654
662
|
readonly alias: readonly [
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default
|
|
1
|
+
export { default } from '../code';
|
|
2
2
|
export type { CodeBlockProps } from '../types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as Code
|
|
1
|
+
export { default as Code } from './code';
|
|
2
2
|
export { default as CodeBlock } from './code-block';
|
|
3
3
|
export type { CodeBlockProps, CodeProps, SupportedLanguages, LanguageAlias, Language, } from './types';
|
|
4
4
|
export { SUPPORTED_LANGUAGES } from './constants';
|
|
@@ -1,19 +1 @@
|
|
|
1
1
|
export declare const getLineNumWidth: (numLines: number) => string;
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated
|
|
4
|
-
*/
|
|
5
|
-
export declare const getCodeStyles: () => {
|
|
6
|
-
display: string;
|
|
7
|
-
padding: string;
|
|
8
|
-
backgroundColor: string;
|
|
9
|
-
borderRadius: "var(--ds-border-radius)";
|
|
10
|
-
borderStyle: string;
|
|
11
|
-
boxDecorationBreak: string;
|
|
12
|
-
color: "var(--ds-text)";
|
|
13
|
-
fontFamily: "var(--ds-font-family-code)";
|
|
14
|
-
fontSize: string;
|
|
15
|
-
fontWeight: "var(--ds-font-weight-regular)";
|
|
16
|
-
overflow: string;
|
|
17
|
-
overflowWrap: string;
|
|
18
|
-
whiteSpace: string;
|
|
19
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/code",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.1.1",
|
|
4
4
|
"description": "Code highlights short strings of code snippets inline with body text.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
32
32
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
33
|
-
"@atlaskit/tokens": "^4.
|
|
33
|
+
"@atlaskit/tokens": "^4.8.0",
|
|
34
34
|
"@atlaskit/tooltip": "^20.0.0",
|
|
35
35
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
36
36
|
"@babel/runtime": "^7.0.0",
|
|
@@ -42,17 +42,17 @@
|
|
|
42
42
|
"react": "^18.2.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@af/accessibility-testing": "
|
|
46
|
-
"@af/integration-testing": "
|
|
47
|
-
"@af/visual-regression": "
|
|
45
|
+
"@af/accessibility-testing": "workspace:^",
|
|
46
|
+
"@af/integration-testing": "workspace:^",
|
|
47
|
+
"@af/visual-regression": "workspace:^",
|
|
48
48
|
"@atlaskit/button": "^23.0.0",
|
|
49
49
|
"@atlaskit/docs": "^10.0.0",
|
|
50
50
|
"@atlaskit/ds-lib": "^4.0.0",
|
|
51
51
|
"@atlaskit/form": "^12.0.0",
|
|
52
52
|
"@atlaskit/link": "^3.1.0",
|
|
53
|
-
"@atlaskit/primitives": "^14.
|
|
53
|
+
"@atlaskit/primitives": "^14.7.0",
|
|
54
54
|
"@atlaskit/section-message": "^8.2.0",
|
|
55
|
-
"@atlaskit/ssr": "
|
|
55
|
+
"@atlaskit/ssr": "workspace:^",
|
|
56
56
|
"@atlaskit/theme": "^18.0.0",
|
|
57
57
|
"@atlaskit/toggle": "^15.0.0",
|
|
58
58
|
"@atlassian/ssr-tests": "^0.2.0",
|
package/report.api.md
CHANGED
|
@@ -424,9 +424,6 @@ export interface CodeProps extends HTMLProps<HTMLElement> {
|
|
|
424
424
|
testId?: string;
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
-
// @public @deprecated (undocumented)
|
|
428
|
-
export const getCodeStyles: () => CSSObject;
|
|
429
|
-
|
|
430
427
|
// @public (undocumented)
|
|
431
428
|
export type Language = (typeof SUPPORTED_LANGUAGES)[number];
|
|
432
429
|
|