@atlaskit/code 16.2.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/cjs/bidi-warning/ui/styled.compiled.css +19 -0
  3. package/dist/cjs/bidi-warning/ui/styled.js +16 -49
  4. package/dist/cjs/code-block.compiled.css +105 -0
  5. package/dist/cjs/code-block.js +26 -22
  6. package/dist/cjs/code.compiled.css +16 -0
  7. package/dist/cjs/code.js +16 -35
  8. package/dist/cjs/constants.js +4 -0
  9. package/dist/cjs/internal/theme/constants.js +1 -12
  10. package/dist/cjs/internal/theme/styles.js +12 -305
  11. package/dist/cjs/syntax-highlighter/types.js +0 -1
  12. package/dist/es2019/bidi-warning/ui/styled.compiled.css +19 -0
  13. package/dist/es2019/bidi-warning/ui/styled.js +12 -47
  14. package/dist/es2019/code-block.compiled.css +105 -0
  15. package/dist/es2019/code-block.js +23 -16
  16. package/dist/es2019/code.compiled.css +16 -0
  17. package/dist/es2019/code.js +16 -36
  18. package/dist/es2019/constants.js +4 -0
  19. package/dist/es2019/internal/theme/constants.js +0 -10
  20. package/dist/es2019/internal/theme/styles.js +9 -295
  21. package/dist/es2019/syntax-highlighter/types.js +0 -3
  22. package/dist/esm/bidi-warning/ui/styled.compiled.css +19 -0
  23. package/dist/esm/bidi-warning/ui/styled.js +12 -47
  24. package/dist/esm/code-block.compiled.css +105 -0
  25. package/dist/esm/code-block.js +23 -22
  26. package/dist/esm/code.compiled.css +16 -0
  27. package/dist/esm/code.js +16 -36
  28. package/dist/esm/constants.js +4 -0
  29. package/dist/esm/internal/theme/constants.js +0 -10
  30. package/dist/esm/internal/theme/styles.js +11 -305
  31. package/dist/esm/syntax-highlighter/types.js +0 -3
  32. package/dist/types/bidi-warning/ui/styled.d.ts +1 -2
  33. package/dist/types/constants.d.ts +4 -0
  34. package/dist/types/internal/theme/constants.d.ts +0 -7
  35. package/dist/types/internal/theme/styles.d.ts +16 -9
  36. package/dist/types/syntax-highlighter/types.d.ts +3 -3
  37. package/dist/types-ts4.5/bidi-warning/ui/styled.d.ts +1 -2
  38. package/dist/types-ts4.5/constants.d.ts +8 -0
  39. package/dist/types-ts4.5/internal/theme/constants.d.ts +0 -7
  40. package/dist/types-ts4.5/internal/theme/styles.d.ts +16 -9
  41. package/dist/types-ts4.5/syntax-highlighter/types.d.ts +3 -3
  42. package/package.json +6 -6
  43. package/report.api.md +1 -2
  44. package/dist/cjs/internal/theme/get-theme.js +0 -83
  45. package/dist/es2019/internal/theme/get-theme.js +0 -69
  46. package/dist/esm/internal/theme/get-theme.js +0 -73
  47. package/dist/types/internal/theme/get-theme.d.ts +0 -5
  48. package/dist/types-ts4.5/internal/theme/get-theme.d.ts +0 -5
@@ -1,32 +1,14 @@
1
+ /* code.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
- /**
3
- * @jsxRuntime classic
4
- * @jsx jsx
5
- */
3
+ import "./code.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
6
5
  import React, { forwardRef, memo } from 'react';
7
-
8
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
- import { css, jsx } from '@emotion/react';
10
6
  import CodeBidiWarning from './bidi-warning';
11
7
  import codeBidiWarningDecorator from './bidi-warning/bidi-warning-decorator';
12
- import { VAR_CODE_BG_COLOR } from './internal/theme/constants';
13
8
  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
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
25
- lineHeight: 'inherit',
26
- overflow: 'auto',
27
- overflowWrap: 'break-word',
28
- whiteSpace: 'pre-wrap'
29
- });
9
+ const styles = {
10
+ base: "_ca0qyh40 _u5f3m5ip _n3tdyh40 _19bvm5ip _2rko1sit _11c81u0j _1reo1wug _18m91wug _1dqoglyw _1e0c1nu9 _bfhktkvp _16d9qvcn _syaz1fxt _vwz41kw7 _1i4q1hna _o5721jtm"
11
+ };
30
12
 
31
13
  /**
32
14
  * __Code__
@@ -50,18 +32,16 @@ const Code = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Code({
50
32
  codeBidiWarningTooltipEnabled = true,
51
33
  ...otherProps
52
34
  } = props;
53
- const decoratedChildren = codeBidiWarnings ? jsx(RenderCodeChildrenWithBidiWarnings, {
35
+ const decoratedChildren = codeBidiWarnings ? /*#__PURE__*/React.createElement(RenderCodeChildrenWithBidiWarnings, {
54
36
  codeBidiWarningLabel: codeBidiWarningLabel,
55
37
  codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
56
38
  }, children) : children;
57
- return (
58
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
59
- jsx("code", _extends({
60
- ref: ref,
61
- "data-testid": testId,
62
- css: styles
63
- }, otherProps), decoratedChildren)
64
- );
39
+ return /*#__PURE__*/React.createElement("code", _extends({
40
+ ref: ref,
41
+ "data-testid": testId
42
+ }, otherProps, {
43
+ className: ax([styles.base])
44
+ }), decoratedChildren);
65
45
  }));
66
46
  function RenderCodeChildrenWithBidiWarnings({
67
47
  children,
@@ -73,7 +53,7 @@ function RenderCodeChildrenWithBidiWarnings({
73
53
  const decorated = codeBidiWarningDecorator(childNode, ({
74
54
  bidiCharacter,
75
55
  index
76
- }) => jsx(CodeBidiWarning, {
56
+ }) => /*#__PURE__*/React.createElement(CodeBidiWarning, {
77
57
  bidiCharacter: bidiCharacter,
78
58
  key: index,
79
59
  label: codeBidiWarningLabel,
@@ -84,7 +64,7 @@ function RenderCodeChildrenWithBidiWarnings({
84
64
  if (isReactElement(childNode) && childNode.props.children) {
85
65
  // eslint-disable-next-line @repo/internal/react/no-clone-element
86
66
  const newChildNode = /*#__PURE__*/React.cloneElement(childNode, {
87
- children: jsx(RenderCodeChildrenWithBidiWarnings, {
67
+ children: /*#__PURE__*/React.createElement(RenderCodeChildrenWithBidiWarnings, {
88
68
  codeBidiWarningLabel: codeBidiWarningLabel,
89
69
  codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
90
70
  }, childNode.props.children)
@@ -93,7 +73,7 @@ function RenderCodeChildrenWithBidiWarnings({
93
73
  }
94
74
  return childNode;
95
75
  });
96
- return jsx(React.Fragment, null, replacedChildren);
76
+ return /*#__PURE__*/React.createElement(React.Fragment, null, replacedChildren);
97
77
  }
98
78
  function isReactElement(child) {
99
79
  return !!child.type;
@@ -321,6 +321,10 @@ export const SUPPORTED_LANGUAGES = [{
321
321
  name: 'Protocol Buffers',
322
322
  alias: ['protobuf', 'proto'],
323
323
  value: 'protobuf'
324
+ }, {
325
+ name: 'Handlebars',
326
+ alias: ['handlebars', 'mustache'],
327
+ value: 'handlebars'
324
328
  }, {
325
329
  name: 'ABAP',
326
330
  alias: ['abap'],
@@ -1,12 +1,2 @@
1
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
2
- import { gridSize } from '@atlaskit/theme/constants';
3
- export const CODE_FONT_SIZE = 12;
4
- export const CODE_LINE_HEIGHT = '20px';
5
- export const HIGHLIGHT_BORDER_WIDTH = '4px';
6
- export const SPACING = gridSize();
7
- export const LINE_NUMBER_GUTTER = SPACING * 2;
8
- export const VAR_CODE_LINE_NUMBER_BG_COLOR = '--ds--code--line-number-bg-color';
9
- export const VAR_CODE_BG_COLOR = '--ds--code--bg-color';
10
-
11
1
  // selector for codeblock
12
2
  export const CODE_BLOCK_SELECTOR = `data-ds--code--code-block`;
@@ -1,312 +1,26 @@
1
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
-
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';
4
- import { getBaseTheme, getColorPalette } from './get-theme';
5
1
  export const getLineNumWidth = numLines => {
6
- if (!numLines) {
7
- return '1ch';
8
- }
9
- return `${numLines.toFixed(0).length}ch`;
2
+ return !numLines ? '1ch' : `${numLines.toFixed(0).length}ch`;
10
3
  };
11
- const lineNumberStyle = theme => ({
12
- // width of the line number gutter
13
- minWidth: `calc(${theme.lineNumberWidth} + ${LINE_NUMBER_GUTTER}px) !important`,
14
- // this needs to be important or it gets overwritten by inline styles
15
- fontStyle: 'normal !important',
16
- // this needs to be important or it gets overwritten by inline styles
17
- color: `${theme.lineNumberColor} !important`,
18
- flexShrink: 0,
19
- // needed to replicate existing design spec
20
- boxSizing: 'border-box',
21
- paddingRight: `${SPACING}px !important`,
22
- paddingLeft: SPACING,
23
- marginRight: SPACING,
24
- textAlign: 'right',
25
- userSelect: 'none',
26
- // this is to fix SSR spacing issue
27
- display: 'block',
28
- // This is how we are preventing line numbers being copied to clipboard.
29
- // (`user-select: none;` was not sufficent).
30
- // https://product-fabric.atlassian.net/browse/DSP-2729
31
- '&::after': {
32
- content: `attr(data-ds--line-number)`
33
- }
34
- });
35
-
36
- // order of these keys does matter as it will affect the css precedence
37
- const syntaxKeywordColors = theme => ({
38
- '.token': {
39
- // this specifically stops prism css cascading.
40
- '&:not([class=token],[data-ds--code--row--highlight],[data-ds--code--row])': {
41
- all: 'unset'
42
- },
43
- // additional specificity required to match the all: unset
44
- '&.key,&.keyword': {
45
- color: theme.keywordColor,
46
- fontWeight: 'bolder'
47
- },
48
- '&.attr-name': {
49
- color: theme.attributeColor
50
- },
51
- '&.selector': {
52
- color: theme.selectorTagColor
53
- },
54
- '&.comment,&.block-comment': {
55
- color: theme.commentColor,
56
- fontFamily: theme.fontFamilyItalic,
57
- fontStyle: 'italic'
58
- },
59
- '&.function-name': {
60
- color: theme.sectionColor
61
- },
62
- '&.doctype': {
63
- color: theme.docTagColor
64
- },
65
- '&.substr': {
66
- color: theme.substringColor
67
- },
68
- '&.namespace': {
69
- color: theme.nameColor
70
- },
71
- '&.builtin': {
72
- color: theme.builtInColor
73
- },
74
- '&.entity': {
75
- color: theme.literalColor
76
- },
77
- '&.bullet': {
78
- color: theme.bulletColor
79
- },
80
- '&.code': {
81
- color: theme.codeColor
82
- },
83
- '&.regex': {
84
- color: theme.regexpColor
85
- },
86
- '&.symbol': {
87
- color: theme.symbolColor
88
- },
89
- '&.variable': {
90
- color: theme.variableColor
91
- },
92
- '&.url': {
93
- color: theme.linkColor
94
- },
95
- '&.selector-attr': {
96
- color: theme.selectorAttributeColor
97
- },
98
- '&.selector-pseudo': {
99
- color: theme.selectorPseudoColor
100
- },
101
- '&.type': {
102
- color: theme.typeColor
103
- },
104
- '&.quote': {
105
- color: theme.quoteColor
106
- },
107
- '&.tag': {
108
- color: theme.templateTagColor
109
- },
110
- '&.string': {
111
- color: theme.stringColor
112
- },
113
- '&.class-name': {
114
- color: theme.sectionColor
115
- },
116
- '&.title': {
117
- color: theme.titleColor
118
- },
119
- '&.section': {
120
- color: theme.sectionColor
121
- },
122
- '&.meta-keyword': {
123
- color: theme.metaKeywordColor
124
- },
125
- '&.meta': {
126
- color: theme.metaColor
127
- },
128
- '&.italic': {
129
- fontStyle: 'italic'
130
- },
131
- '&.bold': {
132
- fontWeight: 'bolder'
133
- },
134
- '&.function': {
135
- color: theme.functionColor
136
- },
137
- '&.number': {
138
- color: theme.numberColor
139
- },
140
- '&.attr-value': {
141
- color: theme.attributeColor
142
- },
143
- '&.prolog': {
144
- color: theme.prologColor
145
- },
146
- '&.cdata': {
147
- color: theme.cdataColor
148
- },
149
- '&.punctuation': {
150
- color: theme.punctuationColor
151
- },
152
- '&.property': {
153
- color: theme.propertyColor
154
- },
155
- '&.constant': {
156
- color: theme.constantColor
157
- },
158
- '&.deleted': {
159
- color: theme.deletedColor
160
- },
161
- '&.boolean': {
162
- color: theme.booleanColor
163
- },
164
- '&.char': {
165
- color: theme.charColor
166
- },
167
- '&.inserted': {
168
- color: theme.insertedColor
169
- },
170
- '&.operator': {
171
- color: theme.operatorColor
172
- },
173
- '&.atrule': {
174
- color: theme.atruleColor
175
- },
176
- '&.important': {
177
- color: theme.importantColor,
178
- fontWeight: "var(--ds-font-weight-bold, 700)"
179
- }
180
- }
181
- });
182
-
183
- /**
184
- * Styles applied at the root element level, common across code/codeblock
185
- */
186
- const getBaseCodeStyles = theme => ({
187
- fontSize: CODE_FONT_SIZE,
188
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
189
- fontFamily: theme.fontFamily,
190
- fontWeight: "var(--ds-font-weight-regular, 400)",
191
- backgroundColor: `var(${VAR_CODE_BG_COLOR},${theme.backgroundColor})`,
192
- color: theme.textColor,
193
- borderStyle: 'none',
194
- borderRadius: "var(--ds-border-radius, 3px)"
195
- });
196
4
 
5
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
197
6
  /**
198
- * Takes an implemented CodeBlock theme, and returns styles required for
199
- * react-syntax-highlighter.
200
- *
201
- * @param theme
7
+ * @deprecated
202
8
  */
203
- export const getCodeBlockStyles = theme => (highlightedStartText, highlightedEndText, showLineNumbers, shouldWrapLongLines) => ({
204
- // this is required to account for prismjs styles leaking into the codeblock
205
- 'code[class*="language-"], pre[class*="language-"], code': {
206
- all: 'unset',
207
- padding: showLineNumbers ? `${SPACING}px 0` : SPACING,
208
- tabSize: 4
209
- },
210
- display: 'flex',
211
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
212
- lineHeight: CODE_LINE_HEIGHT,
213
- overflowX: 'auto',
214
- whiteSpace: 'pre',
215
- direction: 'ltr',
216
- ...getBaseCodeStyles(theme),
217
- ...syntaxKeywordColors(theme),
218
- // this is to account for SSR spacing issue once loaded in browser
219
- '& .linenumber, .ds-sh-line-number': lineNumberStyle(theme),
220
- '& .linenumber': {
221
- display: 'inline-block !important',
222
- float: 'left'
223
- },
224
- // these styles are for line highlighting
225
- '& [data-ds--code--row]': {
226
- display: showLineNumbers ? 'flex' : 'block',
227
- paddingRight: `${SPACING}px !important`,
228
- marginRight: `-${SPACING}px`
229
- },
230
- '& [data-ds--code--row--highlight]': {
231
- background: `${theme.highlightedLineBgColor}`,
232
- // eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
233
- '&::before, &::after': {
234
- clipPath: 'inset(100%)',
235
- clip: 'rect(1px, 1px, 1px, 1px)',
236
- height: '1px',
237
- overflow: 'hidden',
238
- position: 'absolute',
239
- whiteSpace: 'nowrap',
240
- width: '1px'
241
- },
242
- // The formatting here is an accessibility convention
243
- '&::before': {
244
- content: `" [${highlightedStartText}] "`
245
- },
246
- '&::after': {
247
- content: `" [${highlightedEndText}] "`
248
- }
249
- },
250
- '& [data-ds--code--row--highlight] .linenumber': {
251
- borderLeft: `${HIGHLIGHT_BORDER_WIDTH} solid ${theme.highlightedLineBorderColor}`,
252
- paddingLeft: `${SPACING / 2}px !important`,
253
- position: 'relative'
254
- },
255
- // fill in space caused by parent border top
256
- '& [data-ds--code--row--highlight] .linenumber::before': {
257
- content: '""',
258
- position: 'absolute',
259
- width: HIGHLIGHT_BORDER_WIDTH,
260
- top: '-1px',
261
- left: `-${HIGHLIGHT_BORDER_WIDTH}`,
262
- borderTop: `1px solid ${theme.highlightedLineBorderColor}`
263
- },
264
- '[data-ds--code--row--highlight] + [data-ds--code--row]:not([data-ds--code--row--highlight]), [data-ds--code--row]:not([data-ds--code--row--highlight]) + [data-ds--code--row--highlight]': {
265
- borderTop: '1px dashed transparent'
266
- },
267
- '[data-ds--code--row--highlight]:last-child': {
268
- borderBottom: '1px dashed transparent'
269
- },
270
- '& code:first-of-type': {
271
- paddingRight: `0px !important`,
272
- backgroundImage: showLineNumbers ? `linear-gradient(to right, var(${VAR_CODE_LINE_NUMBER_BG_COLOR},${theme.lineNumberBgColor}), var(${VAR_CODE_LINE_NUMBER_BG_COLOR},${theme.lineNumberBgColor})
273
- calc(${theme.lineNumberWidth} + ${LINE_NUMBER_GUTTER}px), transparent calc(${theme.lineNumberWidth} + ${LINE_NUMBER_GUTTER}px), transparent)` : undefined
274
- },
275
- // we need to use last-of-type because when Code is SSR'd
276
- // 2 <code> elements are created and we don't want this style
277
- // applied to the first one
278
- '& code:last-of-type': {
279
- paddingRight: `${SPACING}px !important`,
280
- flexBasis: 'auto',
281
- flexGrow: 1,
282
- // Needed for the highlight line to extend full-width
283
- flexShrink: shouldWrapLongLines ? 1 : 0,
284
- wordBreak: 'break-word'
285
- },
286
- // Prevents empty code blocks from vertically collapsing
287
- 'code > span:only-child:empty:before, code > span:only-child > span:only-child:empty:before': {
288
- content: '" "'
289
- }
290
- });
291
9
  export const getCodeStyles = () => {
292
- const theme = getBaseTheme();
293
- const baseStyles = getBaseCodeStyles(theme);
294
10
  return {
295
- ...baseStyles,
296
11
  display: 'inline',
297
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',
298
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)",
299
19
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
300
20
  fontSize: '0.875em',
21
+ fontWeight: "var(--ds-font-weight-regular, 400)",
301
22
  overflow: 'auto',
302
23
  overflowWrap: 'break-word',
303
24
  whiteSpace: 'pre-wrap'
304
25
  };
305
- };
306
- export const getCodeBlockTheme = maxLines => {
307
- return {
308
- ...getBaseTheme(),
309
- ...getColorPalette(),
310
- lineNumberWidth: maxLines ? getLineNumWidth(maxLines) : undefined
311
- };
312
26
  };
@@ -1,7 +1,4 @@
1
1
  import React from 'react';
2
-
3
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
-
5
2
  // This wrapper supports the async loading of refractor and language grammars. The internal Highlight is a memo() functional component as expected
6
3
  // eslint-disable-next-line @repo/internal/react/no-class-components
7
4
  export class SyntaxHighlighter extends React.PureComponent {}
@@ -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,54 +1,18 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
1
+ /* styled.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./styled.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
5
  import { Fragment } from 'react';
6
-
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { css, jsx } from '@emotion/react';
9
- import { Y75 } from '@atlaskit/theme/colors';
10
6
  import VisuallyHidden from '@atlaskit/visually-hidden';
11
- var decoration = css({
12
- // Required as otherwise the following bidi characters cause the span
13
- // to not receive hover events.
14
- //
15
- // U+2066 LEFT-TO-RIGHT ISOLATE (when using pseudo element before)
16
- // U+202E RIGHT-TO-LEFT OVERRIDE' (when using pseudo element after)
17
- position: 'relative',
18
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
19
- ':before': {
20
- display: 'inline-flex',
21
- padding: "var(--ds-space-0, 0px)".concat(" ", "var(--ds-space-050, 4px)"),
22
- alignItems: 'center',
23
- justifyContent: 'center',
24
- flexDirection: 'row',
25
- background: "var(--ds-background-warning, ".concat(Y75, ")"),
26
- color: "var(--ds-text-warning, #7F5F01)",
27
- content: '"<"attr(data-bidi-character-code)">"',
28
- font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
29
- fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
30
- fontStyle: 'normal',
31
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
32
- lineHeight: '18px',
33
- /**
34
- * Ensures the decoration receives pointer events when it occurs with
35
- * an ancestor that disables them.
36
- */
37
- pointerEvents: 'auto'
38
- },
39
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
40
- ':hover:before': {
41
- background: "var(--ds-background-warning-hovered, ".concat(Y75, ")"),
42
- color: "var(--ds-text-warning, #533F04)"
43
- }
44
- });
7
+ var decoration = {
8
+ root: "_kqswh2mm _szpl2smr _dsq41wug _1xyt1b66 _123w1b66 _15nnze3t _rxygze3t _1a354jg8 _1j6r1odn _1uakf6fq _1kt9y7el _is06wx40 _1rus1tzq _1cfcvrvc _24gj1h6o _19o61h6o _cfu1116y _1rbawx40 _1xqc1rd4"
9
+ };
45
10
  export function Decorator(_ref) {
46
11
  var bidiCharacter = _ref.bidiCharacter,
47
12
  children = _ref.children,
48
13
  testId = _ref.testId;
49
14
  var bidiCharacterCode = getBidiCharacterCode(bidiCharacter);
50
- return jsx(Fragment, null, jsx("span", {
51
- css: decoration,
15
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
52
16
  "data-testid": testId,
53
17
  "data-bidi-character-code": bidiCharacterCode
54
18
  // This is set to true so that the content is not read out by
@@ -56,10 +20,11 @@ export function Decorator(_ref) {
56
20
  // visual decoration purposes.
57
21
  // We use a visually hidden `mark` element below for screen readers
58
22
  ,
59
- "aria-hidden": "true"
60
- }, children), jsx(VisuallyHidden, {
23
+ "aria-hidden": "true",
24
+ className: ax([decoration.root])
25
+ }, children), /*#__PURE__*/React.createElement(VisuallyHidden, {
61
26
  testId: testId && "".concat(testId, "--visually-hidden")
62
- }, jsx("mark", null, bidiCharacterCode)));
27
+ }, /*#__PURE__*/React.createElement("mark", null, bidiCharacterCode)));
63
28
  }
64
29
  function getBidiCharacterCode(bidiCharacter) {
65
30
  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:" "}