@atlaskit/code 17.3.2 → 17.4.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/CHANGELOG.md +14 -0
- package/dist/cjs/code-block.compiled.css +1 -3
- package/dist/cjs/code-block.js +3 -7
- package/dist/es2019/code-block.compiled.css +1 -3
- package/dist/es2019/code-block.js +3 -7
- package/dist/esm/code-block.compiled.css +1 -3
- package/dist/esm/code-block.js +3 -7
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/code
|
|
2
2
|
|
|
3
|
+
## 17.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`b867e641d818d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b867e641d818d) -
|
|
8
|
+
Updated border radius values behind a feature gate `platform-dst-shape-theme-default`.
|
|
9
|
+
|
|
10
|
+
## 17.3.3
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`b783aa9a00348`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b783aa9a00348) -
|
|
15
|
+
Use ADS code token for font styling.
|
|
16
|
+
|
|
3
17
|
## 17.3.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
._t7aun7od pre[class*=language-]{all:unset}
|
|
6
6
|
._11c81u0j{font:var(--ds-font-code,normal 400 .875em/1 ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
|
|
7
7
|
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
8
|
+
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
8
9
|
._1dqoglyw{border-style:none}
|
|
9
10
|
._196q1xv3 [data-ds--code--row--highlight]:last-child{border-block-end:var(--ds-border-width,1px) dashed transparent}
|
|
10
11
|
._1srnt0uh [data-ds--code--row--highlight] .linenumber:before{border-block-start:var(--ds-border-width,1px) solid var(--ds-border-focused,#4688ec)}
|
|
@@ -76,7 +77,6 @@
|
|
|
76
77
|
._1w2xu2gc pre[class*=language-]{padding-block-end:var(--ds-space-100,8px)}
|
|
77
78
|
._1weckb7n code:last-of-type{flex-grow:1}
|
|
78
79
|
._1wfuwrk5 .linenumber{min-width:var(--ads-code-line-number-width)!important}
|
|
79
|
-
._1wyb1crf{font-size:9pt}
|
|
80
80
|
._1xcoh55r .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.atrule{color:var(--ds-text-accent-green,#216e4e)}
|
|
81
81
|
._1yuau2gc .ds-sh-line-number{padding-inline-start:var(--ds-space-100,8px)}
|
|
82
82
|
._1yvqqmo9 .token.token.token.token.token.token.token.token.token.token.token.token.token.class-name{color:var(--ds-text-accent-purple,#803fa5)}
|
|
@@ -99,7 +99,6 @@
|
|
|
99
99
|
._cahfusvi .ds-sh-line-number{box-sizing:border-box}
|
|
100
100
|
._ccm6u2gc .ds-sh-line-number{margin-inline-end:var(--ds-space-100,8px)}
|
|
101
101
|
._cjus1w1g .token.bold:not(.important){font-weight:bolder}
|
|
102
|
-
._ect41odn{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
|
|
103
102
|
._eiht5x2v .token.block-comment:not(.italic){font-family:SFMono-MediumItalic,var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
|
|
104
103
|
._euyxusvi .linenumber{box-sizing:border-box}
|
|
105
104
|
._g0lxi7uo .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.function{color:var(--ds-text,#292a2e)}
|
|
@@ -115,7 +114,6 @@
|
|
|
115
114
|
._j0l11wug code:last-of-type{flex-basis:auto}
|
|
116
115
|
._juomusic .linenumber{text-align:right}
|
|
117
116
|
._k3li16jw .token.token.token.token.token.token.token.token.namespace{color:var(--ds-text-accent-blue,#1558bc)}
|
|
118
|
-
._k48pi7a9{font-weight:var(--ds-font-weight-regular,400)}
|
|
119
117
|
._k86bqmo9 .token.token.token.token.token.function-name{color:var(--ds-text-accent-purple,#803fa5)}
|
|
120
118
|
._kxov17qg .token.token.token.token.token.token.token.token.token.regex{color:var(--ds-text-accent-teal,#206a83)}
|
|
121
119
|
._lcwuusic .ds-sh-line-number{text-align:right}
|
package/dist/cjs/code-block.js
CHANGED
|
@@ -23,9 +23,8 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
23
23
|
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-selectors */
|
|
24
24
|
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors */
|
|
25
25
|
var getCodeBlockStyles = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
root: "_2rko12b0 _1dqoglyw _1e0c1txw _vwz4gktf _1reo1wug _o572qvpr _1eimjvyg _bfhk187e _syazi7uo _1ozdn7od _7xinn7od _t7aun7od _r28du2gc _tajqu2gc _1ohiu2gc _m802u2gc _i6ntu2gc _1w2xu2gc _1hmyegat _vblregat _vbulegat _196q1xv3 _1vbw1xv3 _1v9c1xv3 _1srnt0uh _18r6myb0 _vyvc1n1a _1d4j1y44 _1f8gstnw _1pzyb3bt _ra6gsb9t _13cdh2mm _1pp0126e _zvy9f705 _qcxof705 _qzn01a66 _j0l11wug _1weckb7n _1na21hna _vsnzgrf3 _x7c815vq _lh0y15vq _1m3815vq _qk1e15vq _12l6ysn8 _uga3ysn8 _mx8b7mnp _1kr87mnp _xo19t94y _1bemt94y _nalpstnw _151dstnw _1exb1q9c _1hgu1q9c _1mgnt94y _nhket94y _h909i8nm _scgayz1z _ipl81e17 _40uk1l04 _i81p1a66 _1gx21e5h _1ls0df4r _vm2c1rh5 _12ok1rh5 _1ls01ule _rude1ule _1q16glyw _1io6glyw _juomusic _lcwuusic _pyovu2gc _ccm6u2gc _1ascu2gc _1yuau2gc _xr0w1a66 _4io21a66 _euyxusvi _cahfusvi _zhnuidpf _1amdidpf _mbgc124n _bu7z124n _131n1giz _gy101giz _1wfuwrk5 _16kzwrk5 _9kk3moej _cjus1w1g _9k2r1m30 _nhmw1m30 _yl021m30 _eiht5x2v _t9zb5x2v _mqok1w1g _3hsg1w1g _i7ngn7od _9wu1fb2s _1xcoh55r _1t36i7uo _137bh55r _1k7di7uo _97li16jw _12nh9lu1 _1g0517qg _i2igqmo9 _326zi7uo _113p1rpy _1n6t16jw _tgu817qg _1k4716jw _g0lxi7uo _ys4e1rpy _7gp8h55r _1yvqqmo9 _1vwwqmo9 _1rjuqmo9 _1v0lh55r _wmyy17qg _748n17qg _1mfn17qg _1d7e17qg _p2vr17qg _19o6qmo9 _kxov17qg _1np517qg _m2f517qg _1b9t16jw _1tq616jw _1rd216jw _1pbk16jw _k3li16jw _13zt1rpy _2g12fb2s _k86bqmo9 _b5iy1rpy _gti31rpy _1f0g16jw _9d3e17qg _qdia16jw _72uv16jw",
|
|
26
|
+
rootT26Shape: "_2rko1mok",
|
|
27
|
+
root: "_11c81u0j _2rko12b0 _1dqoglyw _1e0c1txw _vwz4gktf _1reo1wug _o572qvpr _1eimjvyg _bfhk187e _syazi7uo _1ozdn7od _7xinn7od _t7aun7od _r28du2gc _tajqu2gc _1ohiu2gc _m802u2gc _i6ntu2gc _1w2xu2gc _1hmyegat _vblregat _vbulegat _196q1xv3 _1vbw1xv3 _1v9c1xv3 _1srnt0uh _18r6myb0 _vyvc1n1a _1d4j1y44 _1f8gstnw _1pzyb3bt _ra6gsb9t _13cdh2mm _1pp0126e _zvy9f705 _qcxof705 _qzn01a66 _j0l11wug _1weckb7n _1na21hna _vsnzgrf3 _x7c815vq _lh0y15vq _1m3815vq _qk1e15vq _12l6ysn8 _uga3ysn8 _mx8b7mnp _1kr87mnp _xo19t94y _1bemt94y _nalpstnw _151dstnw _1exb1q9c _1hgu1q9c _1mgnt94y _nhket94y _h909i8nm _scgayz1z _ipl81e17 _40uk1l04 _i81p1a66 _1gx21e5h _1ls0df4r _vm2c1rh5 _12ok1rh5 _1ls01ule _rude1ule _1q16glyw _1io6glyw _juomusic _lcwuusic _pyovu2gc _ccm6u2gc _1ascu2gc _1yuau2gc _xr0w1a66 _4io21a66 _euyxusvi _cahfusvi _zhnuidpf _1amdidpf _mbgc124n _bu7z124n _131n1giz _gy101giz _1wfuwrk5 _16kzwrk5 _9kk3moej _cjus1w1g _9k2r1m30 _nhmw1m30 _yl021m30 _eiht5x2v _t9zb5x2v _mqok1w1g _3hsg1w1g _i7ngn7od _9wu1fb2s _1xcoh55r _1t36i7uo _137bh55r _1k7di7uo _97li16jw _12nh9lu1 _1g0517qg _i2igqmo9 _326zi7uo _113p1rpy _1n6t16jw _tgu817qg _1k4716jw _g0lxi7uo _ys4e1rpy _7gp8h55r _1yvqqmo9 _1vwwqmo9 _1rjuqmo9 _1v0lh55r _wmyy17qg _748n17qg _1mfn17qg _1d7e17qg _p2vr17qg _19o6qmo9 _kxov17qg _1np517qg _m2f517qg _1b9t16jw _1tq616jw _1rd216jw _1pbk16jw _k3li16jw _13zt1rpy _2g12fb2s _k86bqmo9 _b5iy1rpy _gti31rpy _1f0g16jw _9d3e17qg _qdia16jw _72uv16jw",
|
|
29
28
|
showLineNumbers: "_1707efft _1i3h1txw _16noidpf _h4fuidpf _pp6yidpf _1g4tidpf _11wmidpf _1bx8idpf",
|
|
30
29
|
dontShowLineNumbers: "_1i3h1ule _16nou2gc _h4fuu2gc _pp6yu2gc _1g4tu2gc _11wmu2gc _1bx8u2gc",
|
|
31
30
|
shouldWrapLongLines: "_13dgkb7n",
|
|
@@ -112,9 +111,6 @@ var CodeBlock = /*#__PURE__*/(0, _react.memo)(function CodeBlock(_ref) {
|
|
|
112
111
|
|
|
113
112
|
// https://product-fabric.atlassian.net/browse/DST-2472
|
|
114
113
|
var languageToUse = text ? language : 'text';
|
|
115
|
-
|
|
116
|
-
// https://product-fabric.atlassian.net/browse/DSP-22927
|
|
117
|
-
var useCodeFont = (0, _platformFeatureFlags.fg)('platform_dst_code-token');
|
|
118
114
|
return /*#__PURE__*/React.createElement(_syntaxHighlighter.default, {
|
|
119
115
|
"data-code-lang": language,
|
|
120
116
|
"data-ds--code--code-block": "",
|
|
@@ -142,7 +138,7 @@ var CodeBlock = /*#__PURE__*/(0, _react.memo)(function CodeBlock(_ref) {
|
|
|
142
138
|
"aria-label": showContentFocus ? label : undefined,
|
|
143
139
|
role: showContentFocus ? 'region' : undefined,
|
|
144
140
|
scrollRef: scrollableRef,
|
|
145
|
-
className: (0, _runtime.ax)([
|
|
141
|
+
className: (0, _runtime.ax)([getCodeBlockStyles.root, (0, _platformFeatureFlags.fg)('platform-dst-shape-theme-default') && getCodeBlockStyles.rootT26Shape, shouldWrapLongLines ? getCodeBlockStyles.shouldWrapLongLines : getCodeBlockStyles.dontWrapLongLines, shouldShowLineNumbersValue ? getCodeBlockStyles.showLineNumbers : getCodeBlockStyles.dontShowLineNumbers])
|
|
146
142
|
});
|
|
147
143
|
});
|
|
148
144
|
var _default = exports.default = CodeBlock;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
._t7aun7od pre[class*=language-]{all:unset}
|
|
6
6
|
._11c81u0j{font:var(--ds-font-code,normal 400 .875em/1 ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
|
|
7
7
|
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
8
|
+
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
8
9
|
._1dqoglyw{border-style:none}
|
|
9
10
|
._196q1xv3 [data-ds--code--row--highlight]:last-child{border-block-end:var(--ds-border-width,1px) dashed transparent}
|
|
10
11
|
._1srnt0uh [data-ds--code--row--highlight] .linenumber:before{border-block-start:var(--ds-border-width,1px) solid var(--ds-border-focused,#4688ec)}
|
|
@@ -76,7 +77,6 @@
|
|
|
76
77
|
._1w2xu2gc pre[class*=language-]{padding-block-end:var(--ds-space-100,8px)}
|
|
77
78
|
._1weckb7n code:last-of-type{flex-grow:1}
|
|
78
79
|
._1wfuwrk5 .linenumber{min-width:var(--ads-code-line-number-width)!important}
|
|
79
|
-
._1wyb1crf{font-size:9pt}
|
|
80
80
|
._1xcoh55r .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.atrule{color:var(--ds-text-accent-green,#216e4e)}
|
|
81
81
|
._1yuau2gc .ds-sh-line-number{padding-inline-start:var(--ds-space-100,8px)}
|
|
82
82
|
._1yvqqmo9 .token.token.token.token.token.token.token.token.token.token.token.token.token.class-name{color:var(--ds-text-accent-purple,#803fa5)}
|
|
@@ -99,7 +99,6 @@
|
|
|
99
99
|
._cahfusvi .ds-sh-line-number{box-sizing:border-box}
|
|
100
100
|
._ccm6u2gc .ds-sh-line-number{margin-inline-end:var(--ds-space-100,8px)}
|
|
101
101
|
._cjus1w1g .token.bold:not(.important){font-weight:bolder}
|
|
102
|
-
._ect41odn{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
|
|
103
102
|
._eiht5x2v .token.block-comment:not(.italic){font-family:SFMono-MediumItalic,var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
|
|
104
103
|
._euyxusvi .linenumber{box-sizing:border-box}
|
|
105
104
|
._g0lxi7uo .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.function{color:var(--ds-text,#292a2e)}
|
|
@@ -115,7 +114,6 @@
|
|
|
115
114
|
._j0l11wug code:last-of-type{flex-basis:auto}
|
|
116
115
|
._juomusic .linenumber{text-align:right}
|
|
117
116
|
._k3li16jw .token.token.token.token.token.token.token.token.namespace{color:var(--ds-text-accent-blue,#1558bc)}
|
|
118
|
-
._k48pi7a9{font-weight:var(--ds-font-weight-regular,400)}
|
|
119
117
|
._k86bqmo9 .token.token.token.token.token.function-name{color:var(--ds-text-accent-purple,#803fa5)}
|
|
120
118
|
._kxov17qg .token.token.token.token.token.token.token.token.token.regex{color:var(--ds-text-accent-teal,#206a83)}
|
|
121
119
|
._lcwuusic .ds-sh-line-number{text-align:right}
|
|
@@ -13,9 +13,8 @@ import { getLineNumWidth } from './internal/theme/styles';
|
|
|
13
13
|
import { normalizeLanguage } from './internal/utils/get-normalized-language';
|
|
14
14
|
import SyntaxHighlighter from './syntax-highlighter';
|
|
15
15
|
const getCodeBlockStyles = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
root: "_2rko12b0 _1dqoglyw _1e0c1txw _vwz4gktf _1reo1wug _o572qvpr _1eimjvyg _bfhk187e _syazi7uo _1ozdn7od _7xinn7od _t7aun7od _r28du2gc _tajqu2gc _1ohiu2gc _m802u2gc _i6ntu2gc _1w2xu2gc _1hmyegat _vblregat _vbulegat _196q1xv3 _1vbw1xv3 _1v9c1xv3 _1srnt0uh _18r6myb0 _vyvc1n1a _1d4j1y44 _1f8gstnw _1pzyb3bt _ra6gsb9t _13cdh2mm _1pp0126e _zvy9f705 _qcxof705 _qzn01a66 _j0l11wug _1weckb7n _1na21hna _vsnzgrf3 _x7c815vq _lh0y15vq _1m3815vq _qk1e15vq _12l6ysn8 _uga3ysn8 _mx8b7mnp _1kr87mnp _xo19t94y _1bemt94y _nalpstnw _151dstnw _1exb1q9c _1hgu1q9c _1mgnt94y _nhket94y _h909i8nm _scgayz1z _ipl81e17 _40uk1l04 _i81p1a66 _1gx21e5h _1ls0df4r _vm2c1rh5 _12ok1rh5 _1ls01ule _rude1ule _1q16glyw _1io6glyw _juomusic _lcwuusic _pyovu2gc _ccm6u2gc _1ascu2gc _1yuau2gc _xr0w1a66 _4io21a66 _euyxusvi _cahfusvi _zhnuidpf _1amdidpf _mbgc124n _bu7z124n _131n1giz _gy101giz _1wfuwrk5 _16kzwrk5 _9kk3moej _cjus1w1g _9k2r1m30 _nhmw1m30 _yl021m30 _eiht5x2v _t9zb5x2v _mqok1w1g _3hsg1w1g _i7ngn7od _9wu1fb2s _1xcoh55r _1t36i7uo _137bh55r _1k7di7uo _97li16jw _12nh9lu1 _1g0517qg _i2igqmo9 _326zi7uo _113p1rpy _1n6t16jw _tgu817qg _1k4716jw _g0lxi7uo _ys4e1rpy _7gp8h55r _1yvqqmo9 _1vwwqmo9 _1rjuqmo9 _1v0lh55r _wmyy17qg _748n17qg _1mfn17qg _1d7e17qg _p2vr17qg _19o6qmo9 _kxov17qg _1np517qg _m2f517qg _1b9t16jw _1tq616jw _1rd216jw _1pbk16jw _k3li16jw _13zt1rpy _2g12fb2s _k86bqmo9 _b5iy1rpy _gti31rpy _1f0g16jw _9d3e17qg _qdia16jw _72uv16jw",
|
|
16
|
+
rootT26Shape: "_2rko1mok",
|
|
17
|
+
root: "_11c81u0j _2rko12b0 _1dqoglyw _1e0c1txw _vwz4gktf _1reo1wug _o572qvpr _1eimjvyg _bfhk187e _syazi7uo _1ozdn7od _7xinn7od _t7aun7od _r28du2gc _tajqu2gc _1ohiu2gc _m802u2gc _i6ntu2gc _1w2xu2gc _1hmyegat _vblregat _vbulegat _196q1xv3 _1vbw1xv3 _1v9c1xv3 _1srnt0uh _18r6myb0 _vyvc1n1a _1d4j1y44 _1f8gstnw _1pzyb3bt _ra6gsb9t _13cdh2mm _1pp0126e _zvy9f705 _qcxof705 _qzn01a66 _j0l11wug _1weckb7n _1na21hna _vsnzgrf3 _x7c815vq _lh0y15vq _1m3815vq _qk1e15vq _12l6ysn8 _uga3ysn8 _mx8b7mnp _1kr87mnp _xo19t94y _1bemt94y _nalpstnw _151dstnw _1exb1q9c _1hgu1q9c _1mgnt94y _nhket94y _h909i8nm _scgayz1z _ipl81e17 _40uk1l04 _i81p1a66 _1gx21e5h _1ls0df4r _vm2c1rh5 _12ok1rh5 _1ls01ule _rude1ule _1q16glyw _1io6glyw _juomusic _lcwuusic _pyovu2gc _ccm6u2gc _1ascu2gc _1yuau2gc _xr0w1a66 _4io21a66 _euyxusvi _cahfusvi _zhnuidpf _1amdidpf _mbgc124n _bu7z124n _131n1giz _gy101giz _1wfuwrk5 _16kzwrk5 _9kk3moej _cjus1w1g _9k2r1m30 _nhmw1m30 _yl021m30 _eiht5x2v _t9zb5x2v _mqok1w1g _3hsg1w1g _i7ngn7od _9wu1fb2s _1xcoh55r _1t36i7uo _137bh55r _1k7di7uo _97li16jw _12nh9lu1 _1g0517qg _i2igqmo9 _326zi7uo _113p1rpy _1n6t16jw _tgu817qg _1k4716jw _g0lxi7uo _ys4e1rpy _7gp8h55r _1yvqqmo9 _1vwwqmo9 _1rjuqmo9 _1v0lh55r _wmyy17qg _748n17qg _1mfn17qg _1d7e17qg _p2vr17qg _19o6qmo9 _kxov17qg _1np517qg _m2f517qg _1b9t16jw _1tq616jw _1rd216jw _1pbk16jw _k3li16jw _13zt1rpy _2g12fb2s _k86bqmo9 _b5iy1rpy _gti31rpy _1f0g16jw _9d3e17qg _qdia16jw _72uv16jw",
|
|
19
18
|
showLineNumbers: "_1707efft _1i3h1txw _16noidpf _h4fuidpf _pp6yidpf _1g4tidpf _11wmidpf _1bx8idpf",
|
|
20
19
|
dontShowLineNumbers: "_1i3h1ule _16nou2gc _h4fuu2gc _pp6yu2gc _1g4tu2gc _11wmu2gc _1bx8u2gc",
|
|
21
20
|
shouldWrapLongLines: "_13dgkb7n",
|
|
@@ -87,9 +86,6 @@ const CodeBlock = /*#__PURE__*/memo(function CodeBlock({
|
|
|
87
86
|
|
|
88
87
|
// https://product-fabric.atlassian.net/browse/DST-2472
|
|
89
88
|
const languageToUse = text ? language : 'text';
|
|
90
|
-
|
|
91
|
-
// https://product-fabric.atlassian.net/browse/DSP-22927
|
|
92
|
-
const useCodeFont = fg('platform_dst_code-token');
|
|
93
89
|
return /*#__PURE__*/React.createElement(SyntaxHighlighter, {
|
|
94
90
|
"data-code-lang": language,
|
|
95
91
|
"data-ds--code--code-block": "",
|
|
@@ -117,7 +113,7 @@ const CodeBlock = /*#__PURE__*/memo(function CodeBlock({
|
|
|
117
113
|
"aria-label": showContentFocus ? label : undefined,
|
|
118
114
|
role: showContentFocus ? 'region' : undefined,
|
|
119
115
|
scrollRef: scrollableRef,
|
|
120
|
-
className: ax([
|
|
116
|
+
className: ax([getCodeBlockStyles.root, fg('platform-dst-shape-theme-default') && getCodeBlockStyles.rootT26Shape, shouldWrapLongLines ? getCodeBlockStyles.shouldWrapLongLines : getCodeBlockStyles.dontWrapLongLines, shouldShowLineNumbersValue ? getCodeBlockStyles.showLineNumbers : getCodeBlockStyles.dontShowLineNumbers])
|
|
121
117
|
});
|
|
122
118
|
});
|
|
123
119
|
export default CodeBlock;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
._t7aun7od pre[class*=language-]{all:unset}
|
|
6
6
|
._11c81u0j{font:var(--ds-font-code,normal 400 .875em/1 ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
|
|
7
7
|
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
8
|
+
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
8
9
|
._1dqoglyw{border-style:none}
|
|
9
10
|
._196q1xv3 [data-ds--code--row--highlight]:last-child{border-block-end:var(--ds-border-width,1px) dashed transparent}
|
|
10
11
|
._1srnt0uh [data-ds--code--row--highlight] .linenumber:before{border-block-start:var(--ds-border-width,1px) solid var(--ds-border-focused,#4688ec)}
|
|
@@ -76,7 +77,6 @@
|
|
|
76
77
|
._1w2xu2gc pre[class*=language-]{padding-block-end:var(--ds-space-100,8px)}
|
|
77
78
|
._1weckb7n code:last-of-type{flex-grow:1}
|
|
78
79
|
._1wfuwrk5 .linenumber{min-width:var(--ads-code-line-number-width)!important}
|
|
79
|
-
._1wyb1crf{font-size:9pt}
|
|
80
80
|
._1xcoh55r .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.atrule{color:var(--ds-text-accent-green,#216e4e)}
|
|
81
81
|
._1yuau2gc .ds-sh-line-number{padding-inline-start:var(--ds-space-100,8px)}
|
|
82
82
|
._1yvqqmo9 .token.token.token.token.token.token.token.token.token.token.token.token.token.class-name{color:var(--ds-text-accent-purple,#803fa5)}
|
|
@@ -99,7 +99,6 @@
|
|
|
99
99
|
._cahfusvi .ds-sh-line-number{box-sizing:border-box}
|
|
100
100
|
._ccm6u2gc .ds-sh-line-number{margin-inline-end:var(--ds-space-100,8px)}
|
|
101
101
|
._cjus1w1g .token.bold:not(.important){font-weight:bolder}
|
|
102
|
-
._ect41odn{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
|
|
103
102
|
._eiht5x2v .token.block-comment:not(.italic){font-family:SFMono-MediumItalic,var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
|
|
104
103
|
._euyxusvi .linenumber{box-sizing:border-box}
|
|
105
104
|
._g0lxi7uo .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.function{color:var(--ds-text,#292a2e)}
|
|
@@ -115,7 +114,6 @@
|
|
|
115
114
|
._j0l11wug code:last-of-type{flex-basis:auto}
|
|
116
115
|
._juomusic .linenumber{text-align:right}
|
|
117
116
|
._k3li16jw .token.token.token.token.token.token.token.token.namespace{color:var(--ds-text-accent-blue,#1558bc)}
|
|
118
|
-
._k48pi7a9{font-weight:var(--ds-font-weight-regular,400)}
|
|
119
117
|
._k86bqmo9 .token.token.token.token.token.function-name{color:var(--ds-text-accent-purple,#803fa5)}
|
|
120
118
|
._kxov17qg .token.token.token.token.token.token.token.token.token.regex{color:var(--ds-text-accent-teal,#206a83)}
|
|
121
119
|
._lcwuusic .ds-sh-line-number{text-align:right}
|
package/dist/esm/code-block.js
CHANGED
|
@@ -15,9 +15,8 @@ import { getLineNumWidth } from './internal/theme/styles';
|
|
|
15
15
|
import { normalizeLanguage } from './internal/utils/get-normalized-language';
|
|
16
16
|
import SyntaxHighlighter from './syntax-highlighter';
|
|
17
17
|
var getCodeBlockStyles = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
root: "_2rko12b0 _1dqoglyw _1e0c1txw _vwz4gktf _1reo1wug _o572qvpr _1eimjvyg _bfhk187e _syazi7uo _1ozdn7od _7xinn7od _t7aun7od _r28du2gc _tajqu2gc _1ohiu2gc _m802u2gc _i6ntu2gc _1w2xu2gc _1hmyegat _vblregat _vbulegat _196q1xv3 _1vbw1xv3 _1v9c1xv3 _1srnt0uh _18r6myb0 _vyvc1n1a _1d4j1y44 _1f8gstnw _1pzyb3bt _ra6gsb9t _13cdh2mm _1pp0126e _zvy9f705 _qcxof705 _qzn01a66 _j0l11wug _1weckb7n _1na21hna _vsnzgrf3 _x7c815vq _lh0y15vq _1m3815vq _qk1e15vq _12l6ysn8 _uga3ysn8 _mx8b7mnp _1kr87mnp _xo19t94y _1bemt94y _nalpstnw _151dstnw _1exb1q9c _1hgu1q9c _1mgnt94y _nhket94y _h909i8nm _scgayz1z _ipl81e17 _40uk1l04 _i81p1a66 _1gx21e5h _1ls0df4r _vm2c1rh5 _12ok1rh5 _1ls01ule _rude1ule _1q16glyw _1io6glyw _juomusic _lcwuusic _pyovu2gc _ccm6u2gc _1ascu2gc _1yuau2gc _xr0w1a66 _4io21a66 _euyxusvi _cahfusvi _zhnuidpf _1amdidpf _mbgc124n _bu7z124n _131n1giz _gy101giz _1wfuwrk5 _16kzwrk5 _9kk3moej _cjus1w1g _9k2r1m30 _nhmw1m30 _yl021m30 _eiht5x2v _t9zb5x2v _mqok1w1g _3hsg1w1g _i7ngn7od _9wu1fb2s _1xcoh55r _1t36i7uo _137bh55r _1k7di7uo _97li16jw _12nh9lu1 _1g0517qg _i2igqmo9 _326zi7uo _113p1rpy _1n6t16jw _tgu817qg _1k4716jw _g0lxi7uo _ys4e1rpy _7gp8h55r _1yvqqmo9 _1vwwqmo9 _1rjuqmo9 _1v0lh55r _wmyy17qg _748n17qg _1mfn17qg _1d7e17qg _p2vr17qg _19o6qmo9 _kxov17qg _1np517qg _m2f517qg _1b9t16jw _1tq616jw _1rd216jw _1pbk16jw _k3li16jw _13zt1rpy _2g12fb2s _k86bqmo9 _b5iy1rpy _gti31rpy _1f0g16jw _9d3e17qg _qdia16jw _72uv16jw",
|
|
18
|
+
rootT26Shape: "_2rko1mok",
|
|
19
|
+
root: "_11c81u0j _2rko12b0 _1dqoglyw _1e0c1txw _vwz4gktf _1reo1wug _o572qvpr _1eimjvyg _bfhk187e _syazi7uo _1ozdn7od _7xinn7od _t7aun7od _r28du2gc _tajqu2gc _1ohiu2gc _m802u2gc _i6ntu2gc _1w2xu2gc _1hmyegat _vblregat _vbulegat _196q1xv3 _1vbw1xv3 _1v9c1xv3 _1srnt0uh _18r6myb0 _vyvc1n1a _1d4j1y44 _1f8gstnw _1pzyb3bt _ra6gsb9t _13cdh2mm _1pp0126e _zvy9f705 _qcxof705 _qzn01a66 _j0l11wug _1weckb7n _1na21hna _vsnzgrf3 _x7c815vq _lh0y15vq _1m3815vq _qk1e15vq _12l6ysn8 _uga3ysn8 _mx8b7mnp _1kr87mnp _xo19t94y _1bemt94y _nalpstnw _151dstnw _1exb1q9c _1hgu1q9c _1mgnt94y _nhket94y _h909i8nm _scgayz1z _ipl81e17 _40uk1l04 _i81p1a66 _1gx21e5h _1ls0df4r _vm2c1rh5 _12ok1rh5 _1ls01ule _rude1ule _1q16glyw _1io6glyw _juomusic _lcwuusic _pyovu2gc _ccm6u2gc _1ascu2gc _1yuau2gc _xr0w1a66 _4io21a66 _euyxusvi _cahfusvi _zhnuidpf _1amdidpf _mbgc124n _bu7z124n _131n1giz _gy101giz _1wfuwrk5 _16kzwrk5 _9kk3moej _cjus1w1g _9k2r1m30 _nhmw1m30 _yl021m30 _eiht5x2v _t9zb5x2v _mqok1w1g _3hsg1w1g _i7ngn7od _9wu1fb2s _1xcoh55r _1t36i7uo _137bh55r _1k7di7uo _97li16jw _12nh9lu1 _1g0517qg _i2igqmo9 _326zi7uo _113p1rpy _1n6t16jw _tgu817qg _1k4716jw _g0lxi7uo _ys4e1rpy _7gp8h55r _1yvqqmo9 _1vwwqmo9 _1rjuqmo9 _1v0lh55r _wmyy17qg _748n17qg _1mfn17qg _1d7e17qg _p2vr17qg _19o6qmo9 _kxov17qg _1np517qg _m2f517qg _1b9t16jw _1tq616jw _1rd216jw _1pbk16jw _k3li16jw _13zt1rpy _2g12fb2s _k86bqmo9 _b5iy1rpy _gti31rpy _1f0g16jw _9d3e17qg _qdia16jw _72uv16jw",
|
|
21
20
|
showLineNumbers: "_1707efft _1i3h1txw _16noidpf _h4fuidpf _pp6yidpf _1g4tidpf _11wmidpf _1bx8idpf",
|
|
22
21
|
dontShowLineNumbers: "_1i3h1ule _16nou2gc _h4fuu2gc _pp6yu2gc _1g4tu2gc _11wmu2gc _1bx8u2gc",
|
|
23
22
|
shouldWrapLongLines: "_13dgkb7n",
|
|
@@ -104,9 +103,6 @@ var CodeBlock = /*#__PURE__*/memo(function CodeBlock(_ref) {
|
|
|
104
103
|
|
|
105
104
|
// https://product-fabric.atlassian.net/browse/DST-2472
|
|
106
105
|
var languageToUse = text ? language : 'text';
|
|
107
|
-
|
|
108
|
-
// https://product-fabric.atlassian.net/browse/DSP-22927
|
|
109
|
-
var useCodeFont = fg('platform_dst_code-token');
|
|
110
106
|
return /*#__PURE__*/React.createElement(SyntaxHighlighter, {
|
|
111
107
|
"data-code-lang": language,
|
|
112
108
|
"data-ds--code--code-block": "",
|
|
@@ -134,7 +130,7 @@ var CodeBlock = /*#__PURE__*/memo(function CodeBlock(_ref) {
|
|
|
134
130
|
"aria-label": showContentFocus ? label : undefined,
|
|
135
131
|
role: showContentFocus ? 'region' : undefined,
|
|
136
132
|
scrollRef: scrollableRef,
|
|
137
|
-
className: ax([
|
|
133
|
+
className: ax([getCodeBlockStyles.root, fg('platform-dst-shape-theme-default') && getCodeBlockStyles.rootT26Shape, shouldWrapLongLines ? getCodeBlockStyles.shouldWrapLongLines : getCodeBlockStyles.dontWrapLongLines, shouldShowLineNumbersValue ? getCodeBlockStyles.showLineNumbers : getCodeBlockStyles.dontShowLineNumbers])
|
|
138
134
|
});
|
|
139
135
|
});
|
|
140
136
|
export default CodeBlock;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/code",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.4.0",
|
|
4
4
|
"description": "Code highlights short strings of code snippets inline with body text.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"@af/accessibility-testing": "workspace:^",
|
|
46
46
|
"@af/integration-testing": "workspace:^",
|
|
47
47
|
"@af/visual-regression": "workspace:^",
|
|
48
|
-
"@atlaskit/button": "^23.
|
|
48
|
+
"@atlaskit/button": "^23.7.0",
|
|
49
49
|
"@atlaskit/docs": "^11.2.0",
|
|
50
50
|
"@atlaskit/ds-lib": "^5.3.0",
|
|
51
51
|
"@atlaskit/form": "^14.3.0",
|
|
52
52
|
"@atlaskit/link": "^3.2.0",
|
|
53
53
|
"@atlaskit/primitives": "^16.4.0",
|
|
54
|
-
"@atlaskit/section-message": "^8.
|
|
54
|
+
"@atlaskit/section-message": "^8.10.0",
|
|
55
55
|
"@atlaskit/theme": "^21.0.0",
|
|
56
|
-
"@atlaskit/toggle": "^15.
|
|
56
|
+
"@atlaskit/toggle": "^15.2.0",
|
|
57
57
|
"@atlassian/ssr-tests": "workspace:^",
|
|
58
58
|
"@testing-library/react": "^13.4.0",
|
|
59
59
|
"@types/jscodeshift": "^0.11.0",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
},
|
|
106
106
|
"homepage": "https://atlassian.design/components/code/",
|
|
107
107
|
"platform-feature-flags": {
|
|
108
|
-
"
|
|
108
|
+
"platform-dst-shape-theme-default": {
|
|
109
109
|
"type": "boolean"
|
|
110
110
|
}
|
|
111
111
|
}
|