@atlaskit/code 15.6.2 → 15.6.4
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 +17 -0
- package/dist/cjs/code.js +18 -17
- package/dist/cjs/internal/theme/get-theme.js +2 -4
- package/dist/cjs/internal/theme/styles.js +1 -2
- package/dist/es2019/code.js +18 -17
- package/dist/es2019/internal/theme/get-theme.js +2 -4
- package/dist/es2019/internal/theme/styles.js +1 -2
- package/dist/esm/code.js +18 -17
- package/dist/esm/internal/theme/get-theme.js +2 -4
- package/dist/esm/internal/theme/styles.js +1 -2
- package/dist/types/internal/theme/styles.d.ts +1 -1
- package/dist/types-ts4.5/internal/theme/styles.d.ts +1 -1
- package/package.json +5 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/code
|
|
2
2
|
|
|
3
|
+
## 15.6.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#153064](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/153064)
|
|
8
|
+
[`fba89f308ab2b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fba89f308ab2b) -
|
|
9
|
+
[ux] Removed feature flag resulting typography style changes but no visual changes.
|
|
10
|
+
|
|
11
|
+
## 15.6.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#152305](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/152305)
|
|
16
|
+
[`0f13c972be628`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0f13c972be628) -
|
|
17
|
+
[ux] Fix background color override using CSS variable for inlinde code behind a feature flag. If
|
|
18
|
+
successful, these changes will be made available in a later release.
|
|
19
|
+
|
|
3
20
|
## 15.6.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/cjs/code.js
CHANGED
|
@@ -16,9 +16,9 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
16
16
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
17
|
var _react = _interopRequireWildcard(require("react"));
|
|
18
18
|
var _react2 = require("@emotion/react");
|
|
19
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
19
|
var _bidiWarning = _interopRequireDefault(require("./bidi-warning"));
|
|
21
20
|
var _bidiWarningDecorator = _interopRequireDefault(require("./bidi-warning/bidi-warning-decorator"));
|
|
21
|
+
var _constants = require("./internal/theme/constants");
|
|
22
22
|
var _styles = require("./internal/theme/styles");
|
|
23
23
|
var _excluded = ["testId"],
|
|
24
24
|
_excluded2 = ["children", "codeBidiWarnings", "codeBidiWarningLabel", "codeBidiWarningTooltipEnabled"];
|
|
@@ -29,6 +29,22 @@ var _excluded = ["testId"],
|
|
|
29
29
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
30
30
|
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); }
|
|
31
31
|
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; }
|
|
32
|
+
var styles = (0, _react2.css)({
|
|
33
|
+
display: 'inline',
|
|
34
|
+
padding: '2px 0.5ch',
|
|
35
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
36
|
+
backgroundColor: "var(".concat(_constants.VAR_CODE_BG_COLOR, ", ", "var(--ds-background-neutral, #091E420F)", ")"),
|
|
37
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
38
|
+
borderStyle: 'none',
|
|
39
|
+
boxDecorationBreak: 'clone',
|
|
40
|
+
color: "var(--ds-text, #172B4D)",
|
|
41
|
+
font: "var(--ds-font-code, normal 400 0.875em/1 ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
42
|
+
lineHeight: 'inherit',
|
|
43
|
+
overflow: 'auto',
|
|
44
|
+
overflowWrap: 'break-word',
|
|
45
|
+
whiteSpace: 'pre-wrap'
|
|
46
|
+
});
|
|
47
|
+
|
|
32
48
|
/**
|
|
33
49
|
* __Code__
|
|
34
50
|
*
|
|
@@ -42,22 +58,7 @@ var Code = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
42
58
|
var testId = _ref.testId,
|
|
43
59
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
44
60
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
45
|
-
|
|
46
|
-
display: 'inline',
|
|
47
|
-
padding: '2px 0.5ch',
|
|
48
|
-
backgroundColor: "var(--ds-background-neutral, #091E420F)",
|
|
49
|
-
borderRadius: "var(--ds-border-radius, 3px)",
|
|
50
|
-
borderStyle: 'none',
|
|
51
|
-
boxDecorationBreak: 'clone',
|
|
52
|
-
color: "var(--ds-text, #172B4D)",
|
|
53
|
-
font: "var(--ds-font-code, normal 400 0.875em/1 ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
54
|
-
lineHeight: 'inherit',
|
|
55
|
-
overflow: 'auto',
|
|
56
|
-
overflowWrap: 'break-word',
|
|
57
|
-
whiteSpace: 'pre-wrap'
|
|
58
|
-
}) :
|
|
59
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
60
|
-
(0, _react2.css)((0, _styles.getCodeStyles)());
|
|
61
|
+
|
|
61
62
|
var children = props.children,
|
|
62
63
|
_props$codeBidiWarnin = props.codeBidiWarnings,
|
|
63
64
|
codeBidiWarnings = _props$codeBidiWarnin === void 0 ? true : _props$codeBidiWarnin,
|
|
@@ -8,9 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.getColorPalette = exports.getBaseTheme = exports.default = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
13
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
14
12
|
var _tokens = require("@atlaskit/tokens");
|
|
15
13
|
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); }
|
|
16
14
|
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; }
|
|
@@ -22,8 +20,8 @@ var T800 = '#067384';
|
|
|
22
20
|
var Y1100 = '#7A5D1A';
|
|
23
21
|
var getBaseTheme = exports.getBaseTheme = function getBaseTheme() {
|
|
24
22
|
return {
|
|
25
|
-
fontFamily:
|
|
26
|
-
fontFamilyItalic: "SFMono-MediumItalic, ".concat((0,
|
|
23
|
+
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
24
|
+
fontFamilyItalic: "SFMono-MediumItalic, ".concat((0, _tokens.getTokenValue)('font.family.code')),
|
|
27
25
|
backgroundColor: "var(--ds-background-neutral, ".concat(colors.N20, ")"),
|
|
28
26
|
textColor: "var(--ds-text, ".concat(colors.N800, ")"),
|
|
29
27
|
lineNumberColor: "var(--ds-text-subtlest, ".concat(colors.N400, ")"),
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.getLineNumWidth = exports.getCodeStyles = exports.getCodeBlockTheme = exports.getCodeBlockStyles = exports.getBaseCodeStyles = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
9
|
var _constants = require("./constants");
|
|
11
10
|
var _getTheme = require("./get-theme");
|
|
12
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -200,7 +199,7 @@ var getBaseCodeStyles = exports.getBaseCodeStyles = function getBaseCodeStyles(t
|
|
|
200
199
|
return {
|
|
201
200
|
fontSize: _constants.CODE_FONT_SIZE,
|
|
202
201
|
fontFamily: theme.fontFamily,
|
|
203
|
-
fontWeight:
|
|
202
|
+
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
204
203
|
backgroundColor: "var(".concat(_constants.VAR_CODE_BG_COLOR, ",").concat(theme.backgroundColor, ")"),
|
|
205
204
|
color: theme.textColor,
|
|
206
205
|
borderStyle: 'none',
|
package/dist/es2019/code.js
CHANGED
|
@@ -7,10 +7,26 @@ import React, { forwardRef, memo } from 'react';
|
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
import CodeBidiWarning from './bidi-warning';
|
|
12
11
|
import codeBidiWarningDecorator from './bidi-warning/bidi-warning-decorator';
|
|
12
|
+
import { VAR_CODE_BG_COLOR } from './internal/theme/constants';
|
|
13
13
|
import { getCodeStyles } from './internal/theme/styles';
|
|
14
|
+
const styles = css({
|
|
15
|
+
display: 'inline',
|
|
16
|
+
padding: '2px 0.5ch',
|
|
17
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
18
|
+
backgroundColor: `var(${VAR_CODE_BG_COLOR}, ${"var(--ds-background-neutral, #091E420F)"})`,
|
|
19
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
20
|
+
borderStyle: 'none',
|
|
21
|
+
boxDecorationBreak: 'clone',
|
|
22
|
+
color: "var(--ds-text, #172B4D)",
|
|
23
|
+
font: "var(--ds-font-code, normal 400 0.875em/1 ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
24
|
+
lineHeight: 'inherit',
|
|
25
|
+
overflow: 'auto',
|
|
26
|
+
overflowWrap: 'break-word',
|
|
27
|
+
whiteSpace: 'pre-wrap'
|
|
28
|
+
});
|
|
29
|
+
|
|
14
30
|
/**
|
|
15
31
|
* __Code__
|
|
16
32
|
*
|
|
@@ -25,22 +41,7 @@ const Code = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Code({
|
|
|
25
41
|
...props
|
|
26
42
|
}, ref) {
|
|
27
43
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
28
|
-
|
|
29
|
-
display: 'inline',
|
|
30
|
-
padding: '2px 0.5ch',
|
|
31
|
-
backgroundColor: "var(--ds-background-neutral, #091E420F)",
|
|
32
|
-
borderRadius: "var(--ds-border-radius, 3px)",
|
|
33
|
-
borderStyle: 'none',
|
|
34
|
-
boxDecorationBreak: 'clone',
|
|
35
|
-
color: "var(--ds-text, #172B4D)",
|
|
36
|
-
font: "var(--ds-font-code, normal 400 0.875em/1 ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
37
|
-
lineHeight: 'inherit',
|
|
38
|
-
overflow: 'auto',
|
|
39
|
-
overflowWrap: 'break-word',
|
|
40
|
-
whiteSpace: 'pre-wrap'
|
|
41
|
-
}) :
|
|
42
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
43
|
-
css(getCodeStyles());
|
|
44
|
+
|
|
44
45
|
const {
|
|
45
46
|
children,
|
|
46
47
|
codeBidiWarnings = true,
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import memoizeOne from 'memoize-one';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import * as colors from '@atlaskit/theme/colors';
|
|
4
|
-
import { codeFontFamily } from '@atlaskit/theme/constants';
|
|
5
3
|
import { getTokenValue } from '@atlaskit/tokens';
|
|
6
4
|
// Hardcoded values have been used due to the current color palette not having any
|
|
7
5
|
// accessible color options for Teal and Yellow and +20A
|
|
8
6
|
const T800 = '#067384';
|
|
9
7
|
const Y1100 = '#7A5D1A';
|
|
10
8
|
export const getBaseTheme = () => ({
|
|
11
|
-
fontFamily:
|
|
12
|
-
fontFamilyItalic: `SFMono-MediumItalic, ${
|
|
9
|
+
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
10
|
+
fontFamilyItalic: `SFMono-MediumItalic, ${getTokenValue('font.family.code')}`,
|
|
13
11
|
backgroundColor: `var(--ds-background-neutral, ${colors.N20})`,
|
|
14
12
|
textColor: `var(--ds-text, ${colors.N800})`,
|
|
15
13
|
lineNumberColor: `var(--ds-text-subtlest, ${colors.N400})`,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
2
|
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { CODE_FONT_SIZE, CODE_LINE_HEIGHT, HIGHLIGHT_BORDER_WIDTH, LINE_NUMBER_GUTTER, SPACING, VAR_CODE_BG_COLOR, VAR_CODE_LINE_NUMBER_BG_COLOR } from './constants';
|
|
5
4
|
import { getBaseTheme, getColorPalette } from './get-theme';
|
|
6
5
|
export const getLineNumWidth = numLines => {
|
|
@@ -187,7 +186,7 @@ const syntaxKeywordColors = theme => ({
|
|
|
187
186
|
export const getBaseCodeStyles = theme => ({
|
|
188
187
|
fontSize: CODE_FONT_SIZE,
|
|
189
188
|
fontFamily: theme.fontFamily,
|
|
190
|
-
fontWeight:
|
|
189
|
+
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
191
190
|
backgroundColor: `var(${VAR_CODE_BG_COLOR},${theme.backgroundColor})`,
|
|
192
191
|
color: theme.textColor,
|
|
193
192
|
borderStyle: 'none',
|
package/dist/esm/code.js
CHANGED
|
@@ -10,10 +10,26 @@ import React, { forwardRef, memo } from 'react';
|
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
12
|
import { css, jsx } from '@emotion/react';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
13
|
import CodeBidiWarning from './bidi-warning';
|
|
15
14
|
import codeBidiWarningDecorator from './bidi-warning/bidi-warning-decorator';
|
|
15
|
+
import { VAR_CODE_BG_COLOR } from './internal/theme/constants';
|
|
16
16
|
import { getCodeStyles } from './internal/theme/styles';
|
|
17
|
+
var styles = css({
|
|
18
|
+
display: 'inline',
|
|
19
|
+
padding: '2px 0.5ch',
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
21
|
+
backgroundColor: "var(".concat(VAR_CODE_BG_COLOR, ", ", "var(--ds-background-neutral, #091E420F)", ")"),
|
|
22
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
23
|
+
borderStyle: 'none',
|
|
24
|
+
boxDecorationBreak: 'clone',
|
|
25
|
+
color: "var(--ds-text, #172B4D)",
|
|
26
|
+
font: "var(--ds-font-code, normal 400 0.875em/1 ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
27
|
+
lineHeight: 'inherit',
|
|
28
|
+
overflow: 'auto',
|
|
29
|
+
overflowWrap: 'break-word',
|
|
30
|
+
whiteSpace: 'pre-wrap'
|
|
31
|
+
});
|
|
32
|
+
|
|
17
33
|
/**
|
|
18
34
|
* __Code__
|
|
19
35
|
*
|
|
@@ -27,22 +43,7 @@ var Code = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Code(_ref, ref) {
|
|
|
27
43
|
var testId = _ref.testId,
|
|
28
44
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
29
45
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
30
|
-
|
|
31
|
-
display: 'inline',
|
|
32
|
-
padding: '2px 0.5ch',
|
|
33
|
-
backgroundColor: "var(--ds-background-neutral, #091E420F)",
|
|
34
|
-
borderRadius: "var(--ds-border-radius, 3px)",
|
|
35
|
-
borderStyle: 'none',
|
|
36
|
-
boxDecorationBreak: 'clone',
|
|
37
|
-
color: "var(--ds-text, #172B4D)",
|
|
38
|
-
font: "var(--ds-font-code, normal 400 0.875em/1 ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
39
|
-
lineHeight: 'inherit',
|
|
40
|
-
overflow: 'auto',
|
|
41
|
-
overflowWrap: 'break-word',
|
|
42
|
-
whiteSpace: 'pre-wrap'
|
|
43
|
-
}) :
|
|
44
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
45
|
-
css(getCodeStyles());
|
|
46
|
+
|
|
46
47
|
var children = props.children,
|
|
47
48
|
_props$codeBidiWarnin = props.codeBidiWarnings,
|
|
48
49
|
codeBidiWarnings = _props$codeBidiWarnin === void 0 ? true : _props$codeBidiWarnin,
|
|
@@ -2,9 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import memoizeOne from 'memoize-one';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import * as colors from '@atlaskit/theme/colors';
|
|
7
|
-
import { codeFontFamily } from '@atlaskit/theme/constants';
|
|
8
6
|
import { getTokenValue } from '@atlaskit/tokens';
|
|
9
7
|
// Hardcoded values have been used due to the current color palette not having any
|
|
10
8
|
// accessible color options for Teal and Yellow and +20A
|
|
@@ -12,8 +10,8 @@ var T800 = '#067384';
|
|
|
12
10
|
var Y1100 = '#7A5D1A';
|
|
13
11
|
export var getBaseTheme = function getBaseTheme() {
|
|
14
12
|
return {
|
|
15
|
-
fontFamily:
|
|
16
|
-
fontFamilyItalic: "SFMono-MediumItalic, ".concat(
|
|
13
|
+
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
14
|
+
fontFamilyItalic: "SFMono-MediumItalic, ".concat(getTokenValue('font.family.code')),
|
|
17
15
|
backgroundColor: "var(--ds-background-neutral, ".concat(colors.N20, ")"),
|
|
18
16
|
textColor: "var(--ds-text, ".concat(colors.N800, ")"),
|
|
19
17
|
lineNumberColor: "var(--ds-text-subtlest, ".concat(colors.N400, ")"),
|
|
@@ -3,7 +3,6 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
5
|
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { CODE_FONT_SIZE, CODE_LINE_HEIGHT, HIGHLIGHT_BORDER_WIDTH, LINE_NUMBER_GUTTER, SPACING, VAR_CODE_BG_COLOR, VAR_CODE_LINE_NUMBER_BG_COLOR } from './constants';
|
|
8
7
|
import { getBaseTheme, getColorPalette } from './get-theme';
|
|
9
8
|
export var getLineNumWidth = function getLineNumWidth(numLines) {
|
|
@@ -195,7 +194,7 @@ export var getBaseCodeStyles = function getBaseCodeStyles(theme) {
|
|
|
195
194
|
return {
|
|
196
195
|
fontSize: CODE_FONT_SIZE,
|
|
197
196
|
fontFamily: theme.fontFamily,
|
|
198
|
-
fontWeight:
|
|
197
|
+
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
199
198
|
backgroundColor: "var(".concat(VAR_CODE_BG_COLOR, ",").concat(theme.backgroundColor, ")"),
|
|
200
199
|
color: theme.textColor,
|
|
201
200
|
borderStyle: 'none',
|
|
@@ -7,7 +7,7 @@ export declare const getLineNumWidth: (numLines: number) => string;
|
|
|
7
7
|
export declare const getBaseCodeStyles: (theme: CodeTheme) => {
|
|
8
8
|
fontSize: number;
|
|
9
9
|
fontFamily: string | undefined;
|
|
10
|
-
fontWeight:
|
|
10
|
+
fontWeight: "var(--ds-font-weight-regular)";
|
|
11
11
|
backgroundColor: string;
|
|
12
12
|
color: string | undefined;
|
|
13
13
|
borderStyle: string;
|
|
@@ -7,7 +7,7 @@ export declare const getLineNumWidth: (numLines: number) => string;
|
|
|
7
7
|
export declare const getBaseCodeStyles: (theme: CodeTheme) => {
|
|
8
8
|
fontSize: number;
|
|
9
9
|
fontFamily: string | undefined;
|
|
10
|
-
fontWeight:
|
|
10
|
+
fontWeight: "var(--ds-font-weight-regular)";
|
|
11
11
|
backgroundColor: string;
|
|
12
12
|
color: string | undefined;
|
|
13
13
|
borderStyle: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/code",
|
|
3
|
-
"version": "15.6.
|
|
3
|
+
"version": "15.6.4",
|
|
4
4
|
"description": "Code highlights short strings of code snippets inline with body text.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,10 +27,9 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
30
|
-
"@atlaskit/
|
|
31
|
-
"@atlaskit/theme": "^13.0.0",
|
|
30
|
+
"@atlaskit/theme": "^13.1.0",
|
|
32
31
|
"@atlaskit/tokens": "^2.0.0",
|
|
33
|
-
"@atlaskit/tooltip": "^18.
|
|
32
|
+
"@atlaskit/tooltip": "^18.8.0",
|
|
34
33
|
"@atlaskit/visually-hidden": "^1.5.0",
|
|
35
34
|
"@babel/runtime": "^7.0.0",
|
|
36
35
|
"@emotion/react": "^11.7.1",
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
"@af/accessibility-testing": "*",
|
|
45
44
|
"@af/integration-testing": "*",
|
|
46
45
|
"@af/visual-regression": "*",
|
|
47
|
-
"@atlaskit/ds-lib": "^
|
|
46
|
+
"@atlaskit/ds-lib": "^3.1.0",
|
|
48
47
|
"@atlaskit/ssr": "*",
|
|
49
48
|
"@atlaskit/toggle": "^13.4.0",
|
|
50
49
|
"@atlaskit/visual-regression": "*",
|
|
@@ -105,10 +104,5 @@
|
|
|
105
104
|
"./inline": "./src/entry-points/inline.tsx",
|
|
106
105
|
"./constants": "./src/entry-points/constants.tsx"
|
|
107
106
|
},
|
|
108
|
-
"homepage": "https://atlassian.design/components/code/"
|
|
109
|
-
"platform-feature-flags": {
|
|
110
|
-
"platform_design_system_team_code_new_typography": {
|
|
111
|
-
"type": "boolean"
|
|
112
|
-
}
|
|
113
|
-
}
|
|
107
|
+
"homepage": "https://atlassian.design/components/code/"
|
|
114
108
|
}
|