@atlaskit/code 16.3.0 → 17.0.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 +24 -0
- package/dist/cjs/bidi-warning/ui/styled.compiled.css +19 -0
- package/dist/cjs/bidi-warning/ui/styled.js +16 -49
- package/dist/cjs/code-block.compiled.css +105 -0
- package/dist/cjs/code-block.js +26 -22
- package/dist/cjs/code.compiled.css +16 -0
- package/dist/cjs/code.js +16 -35
- package/dist/cjs/internal/theme/constants.js +1 -12
- package/dist/cjs/internal/theme/styles.js +12 -305
- package/dist/cjs/syntax-highlighter/types.js +0 -1
- package/dist/es2019/bidi-warning/ui/styled.compiled.css +19 -0
- package/dist/es2019/bidi-warning/ui/styled.js +12 -47
- package/dist/es2019/code-block.compiled.css +105 -0
- package/dist/es2019/code-block.js +23 -16
- package/dist/es2019/code.compiled.css +16 -0
- package/dist/es2019/code.js +16 -36
- package/dist/es2019/internal/theme/constants.js +0 -10
- package/dist/es2019/internal/theme/styles.js +9 -295
- package/dist/es2019/syntax-highlighter/types.js +0 -3
- package/dist/esm/bidi-warning/ui/styled.compiled.css +19 -0
- package/dist/esm/bidi-warning/ui/styled.js +12 -47
- package/dist/esm/code-block.compiled.css +105 -0
- package/dist/esm/code-block.js +23 -22
- package/dist/esm/code.compiled.css +16 -0
- package/dist/esm/code.js +16 -36
- package/dist/esm/internal/theme/constants.js +0 -10
- package/dist/esm/internal/theme/styles.js +11 -305
- package/dist/esm/syntax-highlighter/types.js +0 -3
- package/dist/types/bidi-warning/ui/styled.d.ts +1 -2
- package/dist/types/internal/theme/constants.d.ts +0 -7
- package/dist/types/internal/theme/styles.d.ts +16 -9
- package/dist/types/syntax-highlighter/types.d.ts +3 -3
- package/dist/types-ts4.5/bidi-warning/ui/styled.d.ts +1 -2
- package/dist/types-ts4.5/internal/theme/constants.d.ts +0 -7
- package/dist/types-ts4.5/internal/theme/styles.d.ts +16 -9
- package/dist/types-ts4.5/syntax-highlighter/types.d.ts +3 -3
- package/package.json +4 -4
- package/report.api.md +1 -2
- package/dist/cjs/internal/theme/get-theme.js +0 -83
- package/dist/es2019/internal/theme/get-theme.js +0 -69
- package/dist/esm/internal/theme/get-theme.js +0 -73
- package/dist/types/internal/theme/get-theme.d.ts +0 -5
- package/dist/types-ts4.5/internal/theme/get-theme.d.ts +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/code
|
|
2
2
|
|
|
3
|
+
## 17.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#125263](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/125263)
|
|
8
|
+
[`1437a53a170e0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1437a53a170e0) -
|
|
9
|
+
Migrated from `@emotion/react` to `@compiled/react` in order to improve performance, align with
|
|
10
|
+
the rest of the Atlaskit techstack, and support React 18 Streaming SSR.
|
|
11
|
+
|
|
12
|
+
Deprecating the `getCodeStyles` function export from the @atlaskit/code package as it is no longer
|
|
13
|
+
used.
|
|
14
|
+
|
|
15
|
+
Please note, in order to use this version of `@atlaskit/code`, you will need to ensure that your
|
|
16
|
+
bundler is configured to handle `.css` imports correctly. Most bundlers come with built-in support
|
|
17
|
+
for `.css` imports, so you may not need to do anything. If you are using a different bundler,
|
|
18
|
+
please refer to the documentation for that bundler to understand how to handle `.css` imports.
|
|
19
|
+
|
|
20
|
+
For more information on the migration, please refer to
|
|
21
|
+
[RFC-73 Migrating our components to Compiled CSS-in-JS](https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/85953).
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 16.3.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
._szpl2smr:before{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}._123w1b66:before{padding-inline-end:var(--ds-space-050,4px)}
|
|
3
|
+
._15nnze3t:before{padding-block-start:var(--ds-space-0,0)}
|
|
4
|
+
._19o61h6o:before{align-items:center}
|
|
5
|
+
._1a354jg8:before{font-style:normal}
|
|
6
|
+
._1cfcvrvc:before{flex-direction:row}
|
|
7
|
+
._1j6r1odn:before{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
|
|
8
|
+
._1kt9y7el:before{content:"<"attr(data-bidi-character-code)">"}
|
|
9
|
+
._1rbawx40:hover:before{color:var(--ds-text-warning,#a54800)}
|
|
10
|
+
._1rus1tzq:before{background-color:var(--ds-background-warning,#fff7d6)}
|
|
11
|
+
._1uakf6fq:before{line-height:18px}
|
|
12
|
+
._1xqc1rd4:hover:before{background-color:var(--ds-background-warning-hovered,#f8e6a0)}
|
|
13
|
+
._1xyt1b66:before{padding-inline-start:var(--ds-space-050,4px)}
|
|
14
|
+
._24gj1h6o:before{justify-content:center}
|
|
15
|
+
._cfu1116y:before{display:inline-flex}
|
|
16
|
+
._dsq41wug:before{pointer-events:auto}
|
|
17
|
+
._is06wx40:before{color:var(--ds-text-warning,#a54800)}
|
|
18
|
+
._kqswh2mm{position:relative}
|
|
19
|
+
._rxygze3t:before{padding-block-end:var(--ds-space-0,0)}
|
|
@@ -1,62 +1,28 @@
|
|
|
1
|
+
/* styled.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
Object.defineProperty(exports, "__esModule", {
|
|
5
7
|
value: true
|
|
6
8
|
});
|
|
7
9
|
exports.Decorator = Decorator;
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
var
|
|
10
|
+
require("./styled.compiled.css");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var React = _react;
|
|
13
|
+
var _runtime = require("@compiled/react/runtime");
|
|
11
14
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
|
-
|
|
19
|
-
var decoration = (0, _react2.css)({
|
|
20
|
-
// Required as otherwise the following bidi characters cause the span
|
|
21
|
-
// to not receive hover events.
|
|
22
|
-
//
|
|
23
|
-
// U+2066 LEFT-TO-RIGHT ISOLATE (when using pseudo element before)
|
|
24
|
-
// U+202E RIGHT-TO-LEFT OVERRIDE' (when using pseudo element after)
|
|
25
|
-
position: 'relative',
|
|
26
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
27
|
-
':before': {
|
|
28
|
-
display: 'inline-flex',
|
|
29
|
-
padding: "var(--ds-space-0, 0px)".concat(" ", "var(--ds-space-050, 4px)"),
|
|
30
|
-
alignItems: 'center',
|
|
31
|
-
justifyContent: 'center',
|
|
32
|
-
flexDirection: 'row',
|
|
33
|
-
background: "var(--ds-background-warning, ".concat(_colors.Y75, ")"),
|
|
34
|
-
color: "var(--ds-text-warning, #7F5F01)",
|
|
35
|
-
content: '"<"attr(data-bidi-character-code)">"',
|
|
36
|
-
font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
37
|
-
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
38
|
-
fontStyle: 'normal',
|
|
39
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
40
|
-
lineHeight: '18px',
|
|
41
|
-
/**
|
|
42
|
-
* Ensures the decoration receives pointer events when it occurs with
|
|
43
|
-
* an ancestor that disables them.
|
|
44
|
-
*/
|
|
45
|
-
pointerEvents: 'auto'
|
|
46
|
-
},
|
|
47
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
48
|
-
':hover:before': {
|
|
49
|
-
background: "var(--ds-background-warning-hovered, ".concat(_colors.Y75, ")"),
|
|
50
|
-
color: "var(--ds-text-warning, #533F04)"
|
|
51
|
-
}
|
|
52
|
-
});
|
|
15
|
+
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
|
+
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; }
|
|
17
|
+
var decoration = {
|
|
18
|
+
root: "_kqswh2mm _szpl2smr _dsq41wug _1xyt1b66 _123w1b66 _15nnze3t _rxygze3t _1a354jg8 _1j6r1odn _1uakf6fq _1kt9y7el _is06wx40 _1rus1tzq _1cfcvrvc _24gj1h6o _19o61h6o _cfu1116y _1rbawx40 _1xqc1rd4"
|
|
19
|
+
};
|
|
53
20
|
function Decorator(_ref) {
|
|
54
21
|
var bidiCharacter = _ref.bidiCharacter,
|
|
55
22
|
children = _ref.children,
|
|
56
23
|
testId = _ref.testId;
|
|
57
24
|
var bidiCharacterCode = getBidiCharacterCode(bidiCharacter);
|
|
58
|
-
return
|
|
59
|
-
css: decoration,
|
|
25
|
+
return /*#__PURE__*/React.createElement(_react.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
60
26
|
"data-testid": testId,
|
|
61
27
|
"data-bidi-character-code": bidiCharacterCode
|
|
62
28
|
// This is set to true so that the content is not read out by
|
|
@@ -64,10 +30,11 @@ function Decorator(_ref) {
|
|
|
64
30
|
// visual decoration purposes.
|
|
65
31
|
// We use a visually hidden `mark` element below for screen readers
|
|
66
32
|
,
|
|
67
|
-
"aria-hidden": "true"
|
|
68
|
-
|
|
33
|
+
"aria-hidden": "true",
|
|
34
|
+
className: (0, _runtime.ax)([decoration.root])
|
|
35
|
+
}, children), /*#__PURE__*/React.createElement(_visuallyHidden.default, {
|
|
69
36
|
testId: testId && "".concat(testId, "--visually-hidden")
|
|
70
|
-
},
|
|
37
|
+
}, /*#__PURE__*/React.createElement("mark", null, bidiCharacterCode)));
|
|
71
38
|
}
|
|
72
39
|
function getBidiCharacterCode(bidiCharacter) {
|
|
73
40
|
var _bidiCharacter$codePo;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
|
|
2
|
+
._1ozdn7od code, ._7xinn7od code[class*=language-], ._t7aun7od pre[class*=language-]{all:unset}
|
|
3
|
+
._i7ngn7od .token:not([class=token],[data-ds--code--row--highlight],[data-ds--code--row]){all:unset}
|
|
4
|
+
._2rkoglpi{border-radius:var(--ds-border-radius,4px)}
|
|
5
|
+
._1dqoglyw{border-style:none}
|
|
6
|
+
._1agb1dyw [data-ds--code--row--highlight]+[data-ds--code--row]:not([data-ds--code--row--highlight]), ._lkm81dyw [data-ds--code--row]:not([data-ds--code--row--highlight])+[data-ds--code--row--highlight]{border-top:1px dashed transparent}
|
|
7
|
+
._j1w0ww7y [data-ds--code--row--highlight] .linenumber{border-left:4px solid var(--ds-border-focused,#388bff)}
|
|
8
|
+
._tv41hkgb [data-ds--code--row--highlight] .linenumber:before{border-top:1px solid var(--ds-border-focused,#388bff)}
|
|
9
|
+
._wozj1dyw [data-ds--code--row--highlight]:last-child{border-bottom:1px dashed transparent}._113p131l .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.cdata{color:var(--ds-text-subtlest,#626f86)}
|
|
10
|
+
._12l6ysn8 [data-ds--code--row--highlight]:after, ._uga3ysn8 [data-ds--code--row--highlight]:before{clip-path:inset(100%)}
|
|
11
|
+
._12nh9lu1 .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.deleted{color:var(--ds-text-accent-red,#ae2e24)}
|
|
12
|
+
._12tu1a66 .linenumber, ._zu0j1a66 .ds-sh-line-number{padding-right:var(--ds-space-100,8px)!important}
|
|
13
|
+
._131n1giz .linenumber, ._gy101giz .ds-sh-line-number{font-style:normal!important}
|
|
14
|
+
._137bh55r .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.inserted{color:var(--ds-text-accent-green,#216e4e)}
|
|
15
|
+
._13cdh2mm [data-ds--code--row--highlight] .linenumber{position:relative}
|
|
16
|
+
._13dgkb7n code:last-of-type{flex-shrink:1}
|
|
17
|
+
._13zt131l .token.token.token.token.token.token.token.substr{color:var(--ds-text-subtlest,#626f86)}
|
|
18
|
+
._14y71a66 code:last-of-type{padding-right:var(--ds-space-100,8px)!important}
|
|
19
|
+
._1552u2gc .linenumber, ._12afu2gc .ds-sh-line-number{margin-right:var(--ds-space-100,8px)}
|
|
20
|
+
._15ba126e [data-ds--code--row--highlight] .linenumber{padding-left:var(--ds-space-050,4px)!important}
|
|
21
|
+
._17071olh code:first-of-type{background-image:linear-gradient(to right,var(--ds--code--line-number-bg-color,var(--ds-background-neutral,#091e420f)),var(--ds--code--line-number-bg-color,var(--ds-background-neutral,#091e420f)) var(--ads-code-line-number-width),transparent var(--ads-code-line-number-width),transparent)}
|
|
22
|
+
._17wyu2gc code, ._pn28u2gc code[class*=language-], ._gz9fu2gc pre[class*=language-]{padding-bottom:var(--ds-space-100,8px)}
|
|
23
|
+
._19o610m5 .token.token.token.token.token.token.token.token.token.token.url{color:var(--ds-text-accent-purple,#5e4db2)}
|
|
24
|
+
._1b9tpnps .token.token.token.token.token.token.token.token.builtin, ._1tq6pnps .token.token.token.token.token.token.token.token.bullet, ._1rd2pnps .token.token.token.token.token.token.token.token.code, ._1pbkpnps .token.token.token.token.token.token.token.token.entity, ._k3lipnps .token.token.token.token.token.token.token.token.namespace{color:var(--ds-text-accent-blue,#05c)}
|
|
25
|
+
._1d4j1y44 [data-ds--code--row--highlight] .linenumber:before{width:4px}
|
|
26
|
+
._1e0c1txw{display:flex}
|
|
27
|
+
._1eimjvyg{direction:ltr}
|
|
28
|
+
._1exb1q9c [data-ds--code--row--highlight]:after, ._1hgu1q9c [data-ds--code--row--highlight]:before{white-space:nowrap}
|
|
29
|
+
._1f0gpnps .token.token.token.selector{color:var(--ds-text-accent-blue,#05c)}
|
|
30
|
+
._1f8gstnw [data-ds--code--row--highlight] .linenumber:before{position:absolute}
|
|
31
|
+
._1g0517qg .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.constant{color:var(--ds-text-accent-teal,#206a83)}
|
|
32
|
+
._1gec1a66 [data-ds--code--row]{padding-right:var(--ds-space-100,8px)!important}
|
|
33
|
+
._1gx21e5h .linenumber{float:left}
|
|
34
|
+
._1hmimyb0 [data-ds--code--row--highlight] .linenumber:before{left:-4px}
|
|
35
|
+
._1hmyegat code, ._vblregat code[class*=language-], ._vbulegat pre[class*=language-]{tab-size:4}
|
|
36
|
+
._1huoidpf code, ._1a9lidpf code[class*=language-], ._20bqidpf pre[class*=language-]{padding-right:0}
|
|
37
|
+
._1huou2gc code, ._1a9lu2gc code[class*=language-], ._20bqu2gc pre[class*=language-]{padding-right:var(--ds-space-100,8px)}
|
|
38
|
+
._1i3h1txw [data-ds--code--row]{display:flex}
|
|
39
|
+
._1i3h1ule [data-ds--code--row]{display:block}
|
|
40
|
+
._1k47pnps .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.number{color:var(--ds-text-accent-blue,#05c)}
|
|
41
|
+
._1k7d1fxt .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.char{color:var(--ds-text,#172b4d)}
|
|
42
|
+
._1ls01ule .linenumber, ._rude1ule .ds-sh-line-number{display:block}
|
|
43
|
+
._1ls0df4r .linenumber{display:inline-block!important}
|
|
44
|
+
._1m3815vq [data-ds--code--row--highlight]:after, ._qk1e15vq [data-ds--code--row--highlight]:before{overflow-y:hidden}
|
|
45
|
+
._1mgnt94y [data-ds--code--row--highlight]:after, ._nhket94y [data-ds--code--row--highlight]:before{width:1px}
|
|
46
|
+
._1n6tpnps .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.prolog{color:var(--ds-text-accent-blue,#05c)}
|
|
47
|
+
._1na21hna code:last-of-type{word-break:break-word}
|
|
48
|
+
._1oggidpf code, ._bympidpf code[class*=language-], ._9nnjidpf pre[class*=language-]{padding-left:0}
|
|
49
|
+
._1oggu2gc code, ._bympu2gc code[class*=language-], ._9nnju2gc pre[class*=language-]{padding-left:var(--ds-space-100,8px)}
|
|
50
|
+
._1pzyb3bt [data-ds--code--row--highlight] .linenumber:before{content:""}
|
|
51
|
+
._1q16glyw .linenumber, ._1io6glyw .ds-sh-line-number{-webkit-user-select:none;-ms-user-select:none;user-select:none}
|
|
52
|
+
._1ra01n1a [data-ds--code--row--highlight] .linenumber:before{top:-1px}
|
|
53
|
+
._1reo1wug{overflow-x:auto}
|
|
54
|
+
._1t361fxt .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.operator{color:var(--ds-text,#172b4d)}
|
|
55
|
+
._1v0lh55r .token.token.token.token.token.token.token.token.token.token.token.token.string{color:var(--ds-text-accent-green,#216e4e)}
|
|
56
|
+
._1v15u2gc code, ._ilvcu2gc code[class*=language-], ._m29uu2gc pre[class*=language-]{padding-top:var(--ds-space-100,8px)}
|
|
57
|
+
._1weckb7n code:last-of-type{flex-grow:1}
|
|
58
|
+
._1wfuwrk5 .linenumber, ._16kzwrk5 .ds-sh-line-number{min-width:var(--ads-code-line-number-width)!important}
|
|
59
|
+
._1wyb1crf{font-size:9pt}
|
|
60
|
+
._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)}
|
|
61
|
+
._1xx2grf3 code:first-of-type{padding-right:0!important}
|
|
62
|
+
._1yvq10m5 .token.token.token.token.token.token.token.token.token.token.token.token.token.class-name, ._1vww10m5 .token.token.token.token.token.token.token.token.token.token.token.token.token.section, ._1rju10m5 .token.token.token.token.token.token.token.token.token.token.token.token.token.title{color:var(--ds-text-accent-purple,#5e4db2)}
|
|
63
|
+
._28ddu2gc .linenumber, ._1i8zu2gc .ds-sh-line-number{padding-left:var(--ds-space-100,8px)}
|
|
64
|
+
._2g12fb2s .token.token.token.token.token.token.doctype{color:var(--ds-text-accent-yellow,#7f5f01)}
|
|
65
|
+
._326z1fxt .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.punctuation{color:var(--ds-text,#172b4d)}
|
|
66
|
+
._7gp8h55r .token.token.token.token.token.token.token.token.token.token.token.token.token.token.meta-keyword{color:var(--ds-text-accent-green,#216e4e)}
|
|
67
|
+
._97lipnps .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.boolean{color:var(--ds-text-accent-blue,#05c)}
|
|
68
|
+
._9d3e17qg .token.token.attr-name{color:var(--ds-text-accent-teal,#206a83)}
|
|
69
|
+
._9k2r1m30 .token.italic{font-style:italic}
|
|
70
|
+
._9kk3moej .token.important{font-weight:var(--ds-font-weight-bold,700)}
|
|
71
|
+
._9wu1fb2s .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.token.important{color:var(--ds-text-accent-yellow,#7f5f01)}
|
|
72
|
+
._b5iy131l .token.token.token.token.block-comment, ._gti3131l .token.token.token.token.comment{color:var(--ds-text-subtlest,#626f86)}
|
|
73
|
+
._bfhktkvp{background-color:var(--ds--code--bg-color,var(--ds-background-neutral,#091e420f))}
|
|
74
|
+
._cjus1w1g .token.bold:not(.important){font-weight:bolder}
|
|
75
|
+
._ect41odn{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
|
|
76
|
+
._eiht5x2v .token.block-comment:not(.italic), ._t9zb5x2v .token.comment:not(.italic){font-family:SFMono-MediumItalic,var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
|
|
77
|
+
._euyxusvi .linenumber, ._cahfusvi .ds-sh-line-number{box-sizing:border-box}
|
|
78
|
+
._g0lx1fxt .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.function{color:var(--ds-text,#172b4d)}
|
|
79
|
+
._h909m7j4 [data-ds--code--row--highlight]{background-color:var(--ds-background-neutral,#091e420f)}
|
|
80
|
+
._i2ig10m5 .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.property{color:var(--ds-text-accent-purple,#5e4db2)}
|
|
81
|
+
._ipl81e17 [data-ds--code--row--highlight]:before{content:" [var(--ads-highlighted-start-text)] "}
|
|
82
|
+
._j0l11wug code:last-of-type{flex-basis:auto}
|
|
83
|
+
._jeky1l04 [data-ds--code--row]{margin-right:-var(--ds-space-100,8px)}
|
|
84
|
+
._juomusic .linenumber, ._lcwuusic .ds-sh-line-number{text-align:right}
|
|
85
|
+
._k48pi7a9{font-weight:var(--ds-font-weight-regular,400)}
|
|
86
|
+
._k86b10m5 .token.token.token.token.token.function-name{color:var(--ds-text-accent-purple,#5e4db2)}
|
|
87
|
+
._kxov17qg .token.token.token.token.token.token.token.token.token.regex, ._1np517qg .token.token.token.token.token.token.token.token.token.symbol, ._m2f517qg .token.token.token.token.token.token.token.token.token.variable{color:var(--ds-text-accent-teal,#206a83)}
|
|
88
|
+
._mbgcpf9b .linenumber, ._bu7zpf9b .ds-sh-line-number{color:var(--ds-text-subtlest,#626f86)!important}
|
|
89
|
+
._mqok1w1g .token.key:not(.important,.bold), ._3hsg1w1g .token.keyword:not(.important,.bold){font-weight:bolder}
|
|
90
|
+
._mx8b7mnp [data-ds--code--row--highlight]:after, ._1kr87mnp [data-ds--code--row--highlight]:before{clip:rect(1px,1px,1px,1px)}
|
|
91
|
+
._nalpstnw [data-ds--code--row--highlight]:after, ._151dstnw [data-ds--code--row--highlight]:before{position:absolute}
|
|
92
|
+
._nhmw1m30 .token.block-comment:not(.italic), ._yl021m30 .token.comment:not(.italic){font-style:italic}
|
|
93
|
+
._o572qvpr{white-space:pre}
|
|
94
|
+
._qdiapnps .token.key, ._72uvpnps .token.keyword{color:var(--ds-text-accent-blue,#05c)}
|
|
95
|
+
._scgayz1z [data-ds--code--row--highlight]:after{content:" [var(--ads-highlighted-end-text)] "}
|
|
96
|
+
._syaz1fxt{color:var(--ds-text,#172b4d)}
|
|
97
|
+
._tgu817qg .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.attr-value{color:var(--ds-text-accent-teal,#206a83)}
|
|
98
|
+
._vm2c1rh5 .linenumber:after, ._12ok1rh5 .ds-sh-line-number:after{content:attr(data-ds--line-number)}
|
|
99
|
+
._vwz4gktf{line-height:20px}
|
|
100
|
+
._wmyy17qg .token.token.token.token.token.token.token.token.token.token.token.quote, ._748n17qg .token.token.token.token.token.token.token.token.token.token.token.selector-attr, ._1mfn17qg .token.token.token.token.token.token.token.token.token.token.token.selector-pseudo, ._1d7e17qg .token.token.token.token.token.token.token.token.token.token.token.tag, ._p2vr17qg .token.token.token.token.token.token.token.token.token.token.token.type{color:var(--ds-text-accent-teal,#206a83)}
|
|
101
|
+
._x7c815vq [data-ds--code--row--highlight]:after, ._lh0y15vq [data-ds--code--row--highlight]:before{overflow-x:hidden}
|
|
102
|
+
._xo19t94y [data-ds--code--row--highlight]:after, ._1bemt94y [data-ds--code--row--highlight]:before{height:1px}
|
|
103
|
+
._ys4e131l .token.token.token.token.token.token.token.token.token.token.token.token.token.token.token.meta{color:var(--ds-text-subtlest,#626f86)}
|
|
104
|
+
._zhnuidpf .linenumber, ._1amdidpf .ds-sh-line-number{flex-shrink:0}
|
|
105
|
+
._zvy9f705 code>span:only-child:empty:before, ._qcxof705 code>span:only-child>span:only-child:empty:before{content:" "}
|
package/dist/cjs/code-block.js
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
|
+
/* code-block.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-selectors */
|
|
3
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors */
|
|
1
4
|
"use strict";
|
|
2
5
|
|
|
3
6
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
7
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
8
|
Object.defineProperty(exports, "__esModule", {
|
|
5
9
|
value: true
|
|
6
10
|
});
|
|
7
11
|
exports.default = void 0;
|
|
8
|
-
|
|
9
|
-
var
|
|
12
|
+
require("./code-block.compiled.css");
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var React = _react;
|
|
15
|
+
var _runtime = require("@compiled/react/runtime");
|
|
10
16
|
var _useHighlight = require("./internal/hooks/use-highlight");
|
|
11
17
|
var _styles = require("./internal/theme/styles");
|
|
12
18
|
var _getNormalizedLanguage = require("./internal/utils/get-normalized-language");
|
|
13
19
|
var _syntaxHighlighter = _interopRequireDefault(require("./syntax-highlighter"));
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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; }
|
|
22
|
+
var getCodeBlockStyles = {
|
|
23
|
+
root: "_2rkoglpi _1dqoglyw _1wyb1crf _k48pi7a9 _1e0c1txw _vwz4gktf _1reo1wug _o572qvpr _1eimjvyg _bfhktkvp _syaz1fxt _ect41odn _1ozdn7od _7xinn7od _t7aun7od _1v15u2gc _ilvcu2gc _m29uu2gc _17wyu2gc _pn28u2gc _gz9fu2gc _1hmyegat _vblregat _vbulegat _wozj1dyw _1agb1dyw _lkm81dyw _tv41hkgb _1hmimyb0 _1ra01n1a _1d4j1y44 _1f8gstnw _1pzyb3bt _j1w0ww7y _13cdh2mm _15ba126e _zvy9f705 _qcxof705 _14y71a66 _j0l11wug _1weckb7n _1na21hna _1xx2grf3 _x7c815vq _lh0y15vq _1m3815vq _qk1e15vq _12l6ysn8 _uga3ysn8 _mx8b7mnp _1kr87mnp _xo19t94y _1bemt94y _nalpstnw _151dstnw _1exb1q9c _1hgu1q9c _1mgnt94y _nhket94y _h909m7j4 _scgayz1z _ipl81e17 _jeky1l04 _1gec1a66 _1gx21e5h _1ls0df4r _vm2c1rh5 _12ok1rh5 _1ls01ule _rude1ule _1q16glyw _1io6glyw _juomusic _lcwuusic _1552u2gc _12afu2gc _28ddu2gc _1i8zu2gc _12tu1a66 _zu0j1a66 _euyxusvi _cahfusvi _zhnuidpf _1amdidpf _mbgcpf9b _bu7zpf9b _131n1giz _gy101giz _1wfuwrk5 _16kzwrk5 _9kk3moej _cjus1w1g _9k2r1m30 _nhmw1m30 _yl021m30 _eiht5x2v _t9zb5x2v _mqok1w1g _3hsg1w1g _i7ngn7od _9wu1fb2s _1xcoh55r _1t361fxt _137bh55r _1k7d1fxt _97lipnps _12nh9lu1 _1g0517qg _i2ig10m5 _326z1fxt _113p131l _1n6tpnps _tgu817qg _1k47pnps _g0lx1fxt _ys4e131l _7gp8h55r _1yvq10m5 _1vww10m5 _1rju10m5 _1v0lh55r _wmyy17qg _748n17qg _1mfn17qg _1d7e17qg _p2vr17qg _19o610m5 _kxov17qg _1np517qg _m2f517qg _1b9tpnps _1tq6pnps _1rd2pnps _1pbkpnps _k3lipnps _13zt131l _2g12fb2s _k86b10m5 _b5iy131l _gti3131l _1f0gpnps _9d3e17qg _qdiapnps _72uvpnps",
|
|
24
|
+
showLineNumbers: "_17071olh _1i3h1txw _1huoidpf _1a9lidpf _20bqidpf _1oggidpf _bympidpf _9nnjidpf",
|
|
25
|
+
dontShowLineNumbers: "_1i3h1ule _1huou2gc _1a9lu2gc _20bqu2gc _1oggu2gc _bympu2gc _9nnju2gc",
|
|
26
|
+
shouldWrapLongLines: "_13dgkb7n",
|
|
27
|
+
dontWrapLongLines: "_13dgkb7n"
|
|
28
|
+
};
|
|
20
29
|
|
|
21
30
|
/**
|
|
22
31
|
* __Code block__
|
|
@@ -50,17 +59,7 @@ var CodeBlock = /*#__PURE__*/(0, _react.memo)(function CodeBlock(_ref) {
|
|
|
50
59
|
_ref$shouldWrapLongLi = _ref.shouldWrapLongLines,
|
|
51
60
|
shouldWrapLongLines = _ref$shouldWrapLongLi === void 0 ? false : _ref$shouldWrapLongLi;
|
|
52
61
|
var numLines = (text || '').split('\n').length + (firstLineNumber > 0 ? firstLineNumber : 1) - 1;
|
|
53
|
-
var
|
|
54
|
-
return (0, _styles.getCodeBlockTheme)(numLines);
|
|
55
|
-
}, [numLines]);
|
|
56
|
-
var getStyles = (0, _react.useMemo)(function () {
|
|
57
|
-
return (0, _styles.getCodeBlockStyles)(theme);
|
|
58
|
-
}, [theme]);
|
|
59
|
-
var styles = (0, _react.useMemo)(function () {
|
|
60
|
-
return (0, _react2.css)(
|
|
61
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
62
|
-
getStyles(highlightedStartText, highlightedEndText, showLineNumbers, shouldWrapLongLines));
|
|
63
|
-
}, [highlightedStartText, highlightedEndText, showLineNumbers, shouldWrapLongLines, getStyles]);
|
|
62
|
+
var lineNumberWidth = numLines ? (0, _styles.getLineNumWidth)(numLines) : 0;
|
|
64
63
|
var _useHighlightLines = (0, _useHighlight.useHighlightLines)({
|
|
65
64
|
highlight: highlight,
|
|
66
65
|
testId: testId
|
|
@@ -76,12 +75,16 @@ var CodeBlock = /*#__PURE__*/(0, _react.memo)(function CodeBlock(_ref) {
|
|
|
76
75
|
|
|
77
76
|
// https://product-fabric.atlassian.net/browse/DST-2472
|
|
78
77
|
var languageToUse = text ? language : 'text';
|
|
79
|
-
return
|
|
78
|
+
return /*#__PURE__*/React.createElement(_syntaxHighlighter.default, {
|
|
80
79
|
"data-code-lang": language,
|
|
81
80
|
"data-ds--code--code-block": "",
|
|
82
81
|
testId: testId,
|
|
83
82
|
language: languageToUse,
|
|
84
|
-
|
|
83
|
+
style: {
|
|
84
|
+
'--ads-code-line-number-width': "calc(".concat(lineNumberWidth, " + 16px)"),
|
|
85
|
+
'--ads-highlighted-start-text': highlightedStartText,
|
|
86
|
+
'--ads-highlighted-end-text': highlightedEndText
|
|
87
|
+
},
|
|
85
88
|
showLineNumbers: showLineNumbers,
|
|
86
89
|
firstLineNumber: firstLineNumber,
|
|
87
90
|
lineProps: getLineProps
|
|
@@ -94,7 +97,8 @@ var CodeBlock = /*#__PURE__*/(0, _react.memo)(function CodeBlock(_ref) {
|
|
|
94
97
|
codeBidiWarnings: codeBidiWarnings,
|
|
95
98
|
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
96
99
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
97
|
-
text: text
|
|
100
|
+
text: text,
|
|
101
|
+
className: (0, _runtime.ax)([getCodeBlockStyles.root, shouldWrapLongLines ? getCodeBlockStyles.shouldWrapLongLines : getCodeBlockStyles.dontWrapLongLines, showLineNumbers ? getCodeBlockStyles.showLineNumbers : getCodeBlockStyles.dontShowLineNumbers])
|
|
98
102
|
});
|
|
99
103
|
});
|
|
100
104
|
CodeBlock.displayName = 'CodeBlock';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
._11c81u0j{font:var(--ds-font-code,normal 400 .875em/1 ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
|
|
2
|
+
._2rko1sit{border-radius:var(--ds-border-radius,3px)}
|
|
3
|
+
._1dqoglyw{border-style:none}
|
|
4
|
+
._16d9qvcn{-webkit-box-decoration-break:clone;box-decoration-break:clone}
|
|
5
|
+
._18m91wug{overflow-y:auto}
|
|
6
|
+
._19bvm5ip{padding-left:.5ch}
|
|
7
|
+
._1e0c1nu9{display:inline}
|
|
8
|
+
._1i4q1hna{overflow-wrap:break-word}
|
|
9
|
+
._1reo1wug{overflow-x:auto}
|
|
10
|
+
._bfhktkvp{background-color:var(--ds--code--bg-color,var(--ds-background-neutral,#091e420f))}
|
|
11
|
+
._ca0qyh40{padding-top:2px}
|
|
12
|
+
._n3tdyh40{padding-bottom:2px}
|
|
13
|
+
._o5721jtm{white-space:pre-wrap}
|
|
14
|
+
._syaz1fxt{color:var(--ds-text,#172b4d)}
|
|
15
|
+
._u5f3m5ip{padding-right:.5ch}
|
|
16
|
+
._vwz41kw7{line-height:inherit}
|
package/dist/cjs/code.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* code.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -12,39 +13,21 @@ Object.defineProperty(exports, "getCodeStyles", {
|
|
|
12
13
|
return _styles.getCodeStyles;
|
|
13
14
|
}
|
|
14
15
|
});
|
|
16
|
+
require("./code.compiled.css");
|
|
17
|
+
var _runtime = require("@compiled/react/runtime");
|
|
15
18
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
16
19
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
20
|
var _react = _interopRequireWildcard(require("react"));
|
|
18
|
-
var _react2 = require("@emotion/react");
|
|
19
21
|
var _bidiWarning = _interopRequireDefault(require("./bidi-warning"));
|
|
20
22
|
var _bidiWarningDecorator = _interopRequireDefault(require("./bidi-warning/bidi-warning-decorator"));
|
|
21
|
-
var _constants = require("./internal/theme/constants");
|
|
22
23
|
var _styles = require("./internal/theme/styles");
|
|
23
24
|
var _excluded = ["testId"],
|
|
24
25
|
_excluded2 = ["children", "codeBidiWarnings", "codeBidiWarningLabel", "codeBidiWarningTooltipEnabled"];
|
|
25
|
-
/**
|
|
26
|
-
* @jsxRuntime classic
|
|
27
|
-
* @jsx jsx
|
|
28
|
-
*/
|
|
29
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
30
26
|
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
27
|
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 =
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
43
|
-
lineHeight: 'inherit',
|
|
44
|
-
overflow: 'auto',
|
|
45
|
-
overflowWrap: 'break-word',
|
|
46
|
-
whiteSpace: 'pre-wrap'
|
|
47
|
-
});
|
|
28
|
+
var styles = {
|
|
29
|
+
base: "_ca0qyh40 _u5f3m5ip _n3tdyh40 _19bvm5ip _2rko1sit _11c81u0j _1reo1wug _18m91wug _1dqoglyw _1e0c1nu9 _bfhktkvp _16d9qvcn _syaz1fxt _vwz41kw7 _1i4q1hna _o5721jtm"
|
|
30
|
+
};
|
|
48
31
|
|
|
49
32
|
/**
|
|
50
33
|
* __Code__
|
|
@@ -67,18 +50,16 @@ var Code = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
67
50
|
_props$codeBidiWarnin2 = props.codeBidiWarningTooltipEnabled,
|
|
68
51
|
codeBidiWarningTooltipEnabled = _props$codeBidiWarnin2 === void 0 ? true : _props$codeBidiWarnin2,
|
|
69
52
|
otherProps = (0, _objectWithoutProperties2.default)(props, _excluded2);
|
|
70
|
-
var decoratedChildren = codeBidiWarnings ?
|
|
53
|
+
var decoratedChildren = codeBidiWarnings ? /*#__PURE__*/_react.default.createElement(RenderCodeChildrenWithBidiWarnings, {
|
|
71
54
|
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
72
55
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
|
|
73
56
|
}, children) : children;
|
|
74
|
-
return (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}, otherProps), decoratedChildren)
|
|
81
|
-
);
|
|
57
|
+
return /*#__PURE__*/_react.default.createElement("code", (0, _extends2.default)({
|
|
58
|
+
ref: ref,
|
|
59
|
+
"data-testid": testId
|
|
60
|
+
}, otherProps, {
|
|
61
|
+
className: (0, _runtime.ax)([styles.base])
|
|
62
|
+
}), decoratedChildren);
|
|
82
63
|
}));
|
|
83
64
|
function RenderCodeChildrenWithBidiWarnings(_ref2) {
|
|
84
65
|
var children = _ref2.children,
|
|
@@ -89,7 +70,7 @@ function RenderCodeChildrenWithBidiWarnings(_ref2) {
|
|
|
89
70
|
var decorated = (0, _bidiWarningDecorator.default)(childNode, function (_ref3) {
|
|
90
71
|
var bidiCharacter = _ref3.bidiCharacter,
|
|
91
72
|
index = _ref3.index;
|
|
92
|
-
return
|
|
73
|
+
return /*#__PURE__*/_react.default.createElement(_bidiWarning.default, {
|
|
93
74
|
bidiCharacter: bidiCharacter,
|
|
94
75
|
key: index,
|
|
95
76
|
label: codeBidiWarningLabel,
|
|
@@ -101,7 +82,7 @@ function RenderCodeChildrenWithBidiWarnings(_ref2) {
|
|
|
101
82
|
if (isReactElement(childNode) && childNode.props.children) {
|
|
102
83
|
// eslint-disable-next-line @repo/internal/react/no-clone-element
|
|
103
84
|
var newChildNode = /*#__PURE__*/_react.default.cloneElement(childNode, {
|
|
104
|
-
children:
|
|
85
|
+
children: /*#__PURE__*/_react.default.createElement(RenderCodeChildrenWithBidiWarnings, {
|
|
105
86
|
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
106
87
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
|
|
107
88
|
}, childNode.props.children)
|
|
@@ -110,7 +91,7 @@ function RenderCodeChildrenWithBidiWarnings(_ref2) {
|
|
|
110
91
|
}
|
|
111
92
|
return childNode;
|
|
112
93
|
});
|
|
113
|
-
return
|
|
94
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, replacedChildren);
|
|
114
95
|
}
|
|
115
96
|
function isReactElement(child) {
|
|
116
97
|
return !!child.type;
|
|
@@ -3,17 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
8
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
9
|
-
|
|
10
|
-
var CODE_FONT_SIZE = exports.CODE_FONT_SIZE = 12;
|
|
11
|
-
var CODE_LINE_HEIGHT = exports.CODE_LINE_HEIGHT = '20px';
|
|
12
|
-
var HIGHLIGHT_BORDER_WIDTH = exports.HIGHLIGHT_BORDER_WIDTH = '4px';
|
|
13
|
-
var SPACING = exports.SPACING = (0, _constants.gridSize)();
|
|
14
|
-
var LINE_NUMBER_GUTTER = exports.LINE_NUMBER_GUTTER = SPACING * 2;
|
|
15
|
-
var VAR_CODE_LINE_NUMBER_BG_COLOR = exports.VAR_CODE_LINE_NUMBER_BG_COLOR = '--ds--code--line-number-bg-color';
|
|
16
|
-
var VAR_CODE_BG_COLOR = exports.VAR_CODE_BG_COLOR = '--ds--code--bg-color';
|
|
17
|
-
|
|
6
|
+
exports.CODE_BLOCK_SELECTOR = void 0;
|
|
18
7
|
// selector for codeblock
|
|
19
8
|
var CODE_BLOCK_SELECTOR = exports.CODE_BLOCK_SELECTOR = "data-ds--code--code-block";
|