@atlaskit/code 14.6.9 → 15.1.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 +12 -0
- package/dist/cjs/code-block.js +2 -4
- package/dist/cjs/code.js +1 -5
- package/dist/cjs/constants.js +18 -0
- package/dist/cjs/internal/theme/get-theme.js +53 -212
- package/dist/cjs/internal/theme/styles.js +22 -25
- package/dist/es2019/code-block.js +1 -3
- package/dist/es2019/code.js +2 -4
- package/dist/es2019/constants.js +18 -0
- package/dist/es2019/internal/theme/get-theme.js +54 -213
- package/dist/es2019/internal/theme/styles.js +6 -9
- package/dist/esm/code-block.js +2 -4
- package/dist/esm/code.js +2 -6
- package/dist/esm/constants.js +18 -0
- package/dist/esm/internal/theme/get-theme.js +53 -212
- package/dist/esm/internal/theme/styles.js +5 -8
- package/dist/types/constants.d.ts +16 -0
- package/dist/types/internal/theme/get-theme.d.ts +3 -4
- package/dist/types/internal/theme/styles.d.ts +3 -6
- package/dist/types-ts4.5/constants.d.ts +31 -0
- package/dist/types-ts4.5/internal/theme/get-theme.d.ts +3 -4
- package/dist/types-ts4.5/internal/theme/styles.d.ts +3 -6
- package/package.json +2 -2
- package/report.api.md +21 -8
- package/tmp/api-report-tmp.d.ts +17 -4
|
@@ -1,228 +1,69 @@
|
|
|
1
1
|
import memoizeOne from 'memoize-one';
|
|
2
2
|
import * as colors from '@atlaskit/theme/colors';
|
|
3
|
-
import { themed } from '@atlaskit/theme/components';
|
|
4
3
|
import { codeFontFamily } from '@atlaskit/theme/constants';
|
|
5
4
|
// Hardcoded values have been used due to the current color palette not having any
|
|
6
5
|
// accessible color options for Teal and Yellow and +20A
|
|
7
6
|
const T800 = '#067384';
|
|
8
7
|
const Y1100 = '#7A5D1A';
|
|
9
|
-
const
|
|
10
|
-
export const getBaseTheme = theme => ({
|
|
8
|
+
export const getBaseTheme = () => ({
|
|
11
9
|
fontFamily: codeFontFamily(),
|
|
12
10
|
fontFamilyItalic: `SFMono-MediumItalic, ${codeFontFamily()}`,
|
|
13
|
-
backgroundColor:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})
|
|
17
|
-
theme
|
|
18
|
-
}),
|
|
19
|
-
textColor: themed({
|
|
20
|
-
light: `var(--ds-text, ${colors.N800})`,
|
|
21
|
-
dark: `var(--ds-text, ${colors.DN800})`
|
|
22
|
-
})({
|
|
23
|
-
theme
|
|
24
|
-
}),
|
|
25
|
-
lineNumberColor: themed({
|
|
26
|
-
light: `var(--ds-text-subtlest, ${colors.N400})`,
|
|
27
|
-
dark: `var(--ds-text-subtlest, ${colors.DN400})`
|
|
28
|
-
})({
|
|
29
|
-
theme
|
|
30
|
-
}),
|
|
31
|
-
lineNumberBgColor: themed({
|
|
32
|
-
light: `var(--ds-background-neutral, ${colors.N30})`,
|
|
33
|
-
dark: `var(--ds-background-neutral, ${colors.DN20})`
|
|
34
|
-
})({
|
|
35
|
-
theme
|
|
36
|
-
})
|
|
11
|
+
backgroundColor: `var(--ds-background-neutral, ${colors.N20})`,
|
|
12
|
+
textColor: `var(--ds-text, ${colors.N800})`,
|
|
13
|
+
lineNumberColor: `var(--ds-text-subtlest, ${colors.N400})`,
|
|
14
|
+
lineNumberBgColor: `var(--ds-background-neutral, ${colors.N30})`
|
|
37
15
|
});
|
|
38
|
-
export const defaultBaseTheme = getBaseTheme(
|
|
39
|
-
|
|
40
|
-
});
|
|
41
|
-
export const getColorPalette = memoizeOne(theme => {
|
|
42
|
-
const akTheme = {
|
|
43
|
-
theme
|
|
44
|
-
};
|
|
16
|
+
export const defaultBaseTheme = getBaseTheme();
|
|
17
|
+
export const getColorPalette = memoizeOne(() => {
|
|
45
18
|
return {
|
|
46
|
-
highlightedLineBgColor:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
})
|
|
90
|
-
codeColor: themed({
|
|
91
|
-
light: `var(--ds-text-accent-blue, ${colors.B400})`,
|
|
92
|
-
dark: `var(--ds-text-accent-blue, ${colors.B75})`
|
|
93
|
-
})(akTheme),
|
|
94
|
-
regexpColor: themed({
|
|
95
|
-
light: `var(--ds-text-accent-teal, ${T800})`,
|
|
96
|
-
dark: `var(--ds-text-accent-teal, ${colors.T200})`
|
|
97
|
-
})(akTheme),
|
|
98
|
-
symbolColor: themed({
|
|
99
|
-
light: `var(--ds-text-accent-teal, ${T800})`,
|
|
100
|
-
dark: `var(--ds-text-accent-teal, ${colors.T200})`
|
|
101
|
-
})(akTheme),
|
|
102
|
-
variableColor: themed({
|
|
103
|
-
light: `var(--ds-text-accent-teal, ${T800})`,
|
|
104
|
-
dark: `var(--ds-text-accent-teal, ${colors.T200})`
|
|
105
|
-
})(akTheme),
|
|
106
|
-
templateVariableColor: themed({
|
|
107
|
-
light: `var(--ds-text-accent-teal, ${T800})`,
|
|
108
|
-
dark: `var(--ds-text-accent-teal, ${colors.T200})`
|
|
109
|
-
})(akTheme),
|
|
110
|
-
linkColor: themed({
|
|
111
|
-
light: `var(--ds-text-accent-purple, ${colors.P300})`,
|
|
112
|
-
dark: `var(--ds-text-accent-purple, ${colors.P75})`
|
|
113
|
-
})(akTheme),
|
|
114
|
-
selectorAttributeColor: themed({
|
|
115
|
-
light: `var(--ds-text-accent-teal, ${T800})`,
|
|
116
|
-
dark: `var(--ds-text-accent-teal, ${colors.T200})`
|
|
117
|
-
})(akTheme),
|
|
118
|
-
selectorPseudoColor: themed({
|
|
119
|
-
light: `var(--ds-text-accent-teal, ${T800})`,
|
|
120
|
-
dark: `var(--ds-text-accent-teal, ${colors.T200})`
|
|
121
|
-
})(akTheme),
|
|
122
|
-
typeColor: themed({
|
|
123
|
-
light: `var(--ds-text-accent-teal, ${T800})`,
|
|
124
|
-
dark: `var(--ds-text-accent-teal, ${colors.T100})`
|
|
125
|
-
})(akTheme),
|
|
126
|
-
stringColor: themed({
|
|
127
|
-
light: `var(--ds-text-accent-green, ${colors.G500})`,
|
|
128
|
-
dark: `var(--ds-text-accent-green, ${colors.G200})`
|
|
129
|
-
})(akTheme),
|
|
130
|
-
selectorIdColor: themed({
|
|
131
|
-
light: `var(--ds-text-accent-teal, ${T800})`,
|
|
132
|
-
dark: `var(--ds-text-accent-teal, ${colors.T100})`
|
|
133
|
-
})(akTheme),
|
|
134
|
-
selectorClassColor: themed({
|
|
135
|
-
light: `var(--ds-text-accent-teal, ${T800})`,
|
|
136
|
-
dark: `var(--ds-text-accent-teal, ${colors.T100})`
|
|
137
|
-
})(akTheme),
|
|
138
|
-
quoteColor: themed({
|
|
139
|
-
light: `var(--ds-text-accent-teal, ${T800})`,
|
|
140
|
-
dark: `var(--ds-text-accent-teal, ${colors.T100})`
|
|
141
|
-
})(akTheme),
|
|
142
|
-
templateTagColor: themed({
|
|
143
|
-
light: `var(--ds-text-accent-teal, ${T800})`,
|
|
144
|
-
dark: `var(--ds-text-accent-teal, ${colors.T100})`
|
|
145
|
-
})(akTheme),
|
|
146
|
-
titleColor: themed({
|
|
147
|
-
light: `var(--ds-text-accent-purple, ${colors.P300})`,
|
|
148
|
-
dark: `var(--ds-text-accent-purple, ${colors.P75})`
|
|
149
|
-
})(akTheme),
|
|
150
|
-
sectionColor: themed({
|
|
151
|
-
light: `var(--ds-text-accent-purple, ${colors.P300})`,
|
|
152
|
-
dark: `var(--ds-text-accent-purple, ${colors.P75})`
|
|
153
|
-
})(akTheme),
|
|
154
|
-
commentColor: themed({
|
|
155
|
-
light: `var(--ds-text-subtlest, ${colors.N400})`,
|
|
156
|
-
dark: `var(--ds-text-subtlest, ${colors.DN400})`
|
|
157
|
-
})(akTheme),
|
|
158
|
-
metaKeywordColor: themed({
|
|
159
|
-
light: `var(--ds-text-accent-green, ${colors.G500})`,
|
|
160
|
-
dark: `var(--ds-text-accent-green, ${colors.G200})`
|
|
161
|
-
})(akTheme),
|
|
162
|
-
metaColor: themed({
|
|
163
|
-
light: `var(--ds-text-subtlest, ${colors.N400})`,
|
|
164
|
-
dark: `var(--ds-text-subtlest, ${colors.DN400})`
|
|
165
|
-
})(akTheme),
|
|
166
|
-
functionColor: themed({
|
|
167
|
-
light: `var(--ds-text, ${colors.N800})`,
|
|
168
|
-
dark: `var(--ds-text, ${colors.DN800})`
|
|
169
|
-
})(akTheme),
|
|
170
|
-
numberColor: themed({
|
|
171
|
-
light: `var(--ds-text-accent-blue, ${colors.B400})`,
|
|
172
|
-
dark: `var(--ds-text-accent-blue, ${colors.B75})`
|
|
173
|
-
})(akTheme),
|
|
174
|
-
prologColor: themed({
|
|
175
|
-
light: `var(--ds-text-accent-blue, ${colors.B400})`,
|
|
176
|
-
dark: `var(--ds-text-accent-blue, ${colors.B75})`
|
|
177
|
-
})(akTheme),
|
|
178
|
-
cdataColor: themed({
|
|
179
|
-
light: `var(--ds-text-subtlest, ${colors.N400})`,
|
|
180
|
-
dark: `var(--ds-text-subtlest, ${colors.B75})`
|
|
181
|
-
})(akTheme),
|
|
182
|
-
punctuationColor: themed({
|
|
183
|
-
light: `var(--ds-text, ${colors.N800})`,
|
|
184
|
-
dark: `var(--ds-text, ${colors.DN800})`
|
|
185
|
-
})(akTheme),
|
|
186
|
-
propertyColor: themed({
|
|
187
|
-
light: `var(--ds-text-accent-purple, ${colors.P300})`,
|
|
188
|
-
dark: `var(--ds-text-accent-purple, ${colors.P75})`
|
|
189
|
-
})(akTheme),
|
|
190
|
-
constantColor: themed({
|
|
191
|
-
light: `var(--ds-text-accent-teal, ${T800})`,
|
|
192
|
-
dark: `var(--ds-text-accent-teal, ${colors.T100})`
|
|
193
|
-
})(akTheme),
|
|
194
|
-
booleanColor: themed({
|
|
195
|
-
light: `var(--ds-text-accent-blue, ${colors.B400})`,
|
|
196
|
-
dark: `var(--ds-text-accent-blue, ${colors.B75})`
|
|
197
|
-
})(akTheme),
|
|
198
|
-
charColor: themed({
|
|
199
|
-
light: `var(--ds-text, ${colors.N800})`,
|
|
200
|
-
dark: `var(--ds-text, ${colors.DN800})`
|
|
201
|
-
})(akTheme),
|
|
202
|
-
insertedColor: themed({
|
|
203
|
-
light: `var(--ds-text-accent-green, ${colors.G500})`,
|
|
204
|
-
dark: `var(--ds-text-accent-green, ${colors.B75})`
|
|
205
|
-
})(akTheme),
|
|
206
|
-
deletedColor: themed({
|
|
207
|
-
light: `var(--ds-text-accent-red, ${colors.R500})`,
|
|
208
|
-
dark: `var(--ds-text-accent-red, ${colors.B75})`
|
|
209
|
-
})(akTheme),
|
|
210
|
-
operatorColor: themed({
|
|
211
|
-
light: `var(--ds-text, ${colors.N800})`,
|
|
212
|
-
dark: `var(--ds-text, ${colors.B75})`
|
|
213
|
-
})(akTheme),
|
|
214
|
-
atruleColor: themed({
|
|
215
|
-
light: `var(--ds-text-accent-green, ${colors.G500})`,
|
|
216
|
-
dark: `var(--ds-text-accent-green, ${colors.G200})`
|
|
217
|
-
})(akTheme),
|
|
218
|
-
importantColor: themed({
|
|
219
|
-
light: `var(--ds-text-accent-yellow, ${Y1100})`,
|
|
220
|
-
dark: `var(--ds-text-accent-yellow, ${colors.Y300})`
|
|
221
|
-
})(akTheme)
|
|
19
|
+
highlightedLineBgColor: `var(--ds-background-neutral, ${colors.N30})`,
|
|
20
|
+
highlightedLineBorderColor: `var(--ds-border-focused, ${colors.B200})`,
|
|
21
|
+
substringColor: `var(--ds-text-subtlest, ${colors.N400})`,
|
|
22
|
+
keywordColor: `var(--ds-text-accent-blue, ${colors.B400})`,
|
|
23
|
+
attributeColor: `var(--ds-text-accent-teal, ${T800})`,
|
|
24
|
+
selectorTagColor: `var(--ds-text-accent-blue, ${colors.B400})`,
|
|
25
|
+
docTagColor: `var(--ds-text-accent-yellow, ${Y1100})`,
|
|
26
|
+
nameColor: `var(--ds-text-accent-blue, ${colors.B400})`,
|
|
27
|
+
builtInColor: `var(--ds-text-accent-blue, ${colors.B400})`,
|
|
28
|
+
literalColor: `var(--ds-text-accent-blue, ${colors.B400})`,
|
|
29
|
+
bulletColor: `var(--ds-text-accent-blue, ${colors.B400})`,
|
|
30
|
+
codeColor: `var(--ds-text-accent-blue, ${colors.B400})`,
|
|
31
|
+
regexpColor: `var(--ds-text-accent-teal, ${T800})`,
|
|
32
|
+
symbolColor: `var(--ds-text-accent-teal, ${T800})`,
|
|
33
|
+
variableColor: `var(--ds-text-accent-teal, ${T800})`,
|
|
34
|
+
templateVariableColor: `var(--ds-text-accent-teal, ${T800})`,
|
|
35
|
+
linkColor: `var(--ds-text-accent-purple, ${colors.P300})`,
|
|
36
|
+
selectorAttributeColor: `var(--ds-text-accent-teal, ${T800})`,
|
|
37
|
+
selectorPseudoColor: `var(--ds-text-accent-teal, ${T800})`,
|
|
38
|
+
typeColor: `var(--ds-text-accent-teal, ${T800})`,
|
|
39
|
+
stringColor: `var(--ds-text-accent-green, ${colors.G500})`,
|
|
40
|
+
selectorIdColor: `var(--ds-text-accent-teal, ${T800})`,
|
|
41
|
+
selectorClassColor: `var(--ds-text-accent-teal, ${T800})`,
|
|
42
|
+
quoteColor: `var(--ds-text-accent-teal, ${T800})`,
|
|
43
|
+
templateTagColor: `var(--ds-text-accent-teal, ${T800})`,
|
|
44
|
+
titleColor: `var(--ds-text-accent-purple, ${colors.P300})`,
|
|
45
|
+
sectionColor: `var(--ds-text-accent-purple, ${colors.P300})`,
|
|
46
|
+
commentColor: `var(--ds-text-subtlest, ${colors.N400})`,
|
|
47
|
+
metaKeywordColor: `var(--ds-text-accent-green, ${colors.G500})`,
|
|
48
|
+
metaColor: `var(--ds-text-subtlest, ${colors.N400})`,
|
|
49
|
+
functionColor: `var(--ds-text, ${colors.N800})`,
|
|
50
|
+
numberColor: `var(--ds-text-accent-blue, ${colors.B400})`,
|
|
51
|
+
prologColor: `var(--ds-text-accent-blue, ${colors.B400})`,
|
|
52
|
+
cdataColor: `var(--ds-text-subtlest, ${colors.N400})`,
|
|
53
|
+
punctuationColor: `var(--ds-text, ${colors.N800})`,
|
|
54
|
+
propertyColor: `var(--ds-text-accent-purple, ${colors.P300})`,
|
|
55
|
+
constantColor: `var(--ds-text-accent-teal, ${T800})`,
|
|
56
|
+
booleanColor: `var(--ds-text-accent-blue, ${colors.B400})`,
|
|
57
|
+
charColor: `var(--ds-text, ${colors.N800})`,
|
|
58
|
+
insertedColor: `var(--ds-text-accent-green, ${colors.G500})`,
|
|
59
|
+
deletedColor: `var(--ds-text-accent-red, ${colors.R500})`,
|
|
60
|
+
operatorColor: `var(--ds-text, ${colors.N800})`,
|
|
61
|
+
atruleColor: `var(--ds-text-accent-green, ${colors.G500})`,
|
|
62
|
+
importantColor: `var(--ds-text-accent-yellow, ${Y1100})`
|
|
222
63
|
};
|
|
223
64
|
});
|
|
224
|
-
const getTheme =
|
|
225
|
-
...getBaseTheme(
|
|
226
|
-
...getColorPalette(
|
|
65
|
+
const getTheme = () => ({
|
|
66
|
+
...getBaseTheme(),
|
|
67
|
+
...getColorPalette()
|
|
227
68
|
});
|
|
228
69
|
export default getTheme;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
2
1
|
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';
|
|
3
2
|
import { getBaseTheme, getColorPalette } from './get-theme';
|
|
4
3
|
export const getLineNumWidth = numLines => {
|
|
@@ -189,7 +188,7 @@ export const getBaseCodeStyles = theme => ({
|
|
|
189
188
|
backgroundColor: `var(${VAR_CODE_BG_COLOR},${theme.backgroundColor})`,
|
|
190
189
|
color: theme.textColor,
|
|
191
190
|
borderStyle: 'none',
|
|
192
|
-
borderRadius:
|
|
191
|
+
borderRadius: "var(--ds-border-radius, 3px)"
|
|
193
192
|
});
|
|
194
193
|
|
|
195
194
|
/**
|
|
@@ -284,10 +283,8 @@ export const getCodeBlockStyles = theme => (highlightedStartText, highlightedEnd
|
|
|
284
283
|
content: '" "'
|
|
285
284
|
}
|
|
286
285
|
});
|
|
287
|
-
export const getCodeStyles =
|
|
288
|
-
|
|
289
|
-
const akTheme = 'theme' in globalTheme ? globalTheme.theme : globalTheme;
|
|
290
|
-
const theme = getBaseTheme(akTheme);
|
|
286
|
+
export const getCodeStyles = () => {
|
|
287
|
+
const theme = getBaseTheme();
|
|
291
288
|
const baseStyles = getBaseCodeStyles(theme);
|
|
292
289
|
return {
|
|
293
290
|
...baseStyles,
|
|
@@ -300,10 +297,10 @@ export const getCodeStyles = globalTheme => {
|
|
|
300
297
|
whiteSpace: 'pre-wrap'
|
|
301
298
|
};
|
|
302
299
|
};
|
|
303
|
-
export const getCodeBlockTheme =
|
|
300
|
+
export const getCodeBlockTheme = maxLines => {
|
|
304
301
|
return {
|
|
305
|
-
...getBaseTheme(
|
|
306
|
-
...getColorPalette(
|
|
302
|
+
...getBaseTheme(),
|
|
303
|
+
...getColorPalette(),
|
|
307
304
|
lineNumberWidth: maxLines ? getLineNumWidth(maxLines) : undefined
|
|
308
305
|
};
|
|
309
306
|
};
|
package/dist/esm/code-block.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { memo, useCallback, useMemo } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
5
4
|
import { useHighlightLines } from './internal/hooks/use-highlight';
|
|
6
5
|
import { getCodeBlockStyles, getCodeBlockTheme } from './internal/theme/styles';
|
|
7
6
|
import { normalizeLanguage } from './internal/utils/get-normalized-language';
|
|
@@ -37,10 +36,9 @@ var CodeBlock = /*#__PURE__*/memo(function CodeBlock(_ref) {
|
|
|
37
36
|
_ref$shouldWrapLongLi = _ref.shouldWrapLongLines,
|
|
38
37
|
shouldWrapLongLines = _ref$shouldWrapLongLi === void 0 ? false : _ref$shouldWrapLongLi;
|
|
39
38
|
var numLines = (text || '').split('\n').length;
|
|
40
|
-
var globalTheme = useGlobalTheme();
|
|
41
39
|
var theme = useMemo(function () {
|
|
42
|
-
return getCodeBlockTheme(
|
|
43
|
-
}, [
|
|
40
|
+
return getCodeBlockTheme(numLines);
|
|
41
|
+
}, [numLines]);
|
|
44
42
|
var getStyles = useMemo(function () {
|
|
45
43
|
return getCodeBlockStyles(theme);
|
|
46
44
|
}, [theme]);
|
package/dist/esm/code.js
CHANGED
|
@@ -3,9 +3,8 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
var _excluded = ["testId"],
|
|
4
4
|
_excluded2 = ["children", "codeBidiWarnings", "codeBidiWarningLabel", "codeBidiWarningTooltipEnabled"];
|
|
5
5
|
/** @jsx jsx */
|
|
6
|
-
import React, { forwardRef, memo
|
|
6
|
+
import React, { forwardRef, memo } from 'react';
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
9
8
|
import CodeBidiWarning from './bidi-warning';
|
|
10
9
|
import codeBidiWarningDecorator from './bidi-warning/bidi-warning-decorator';
|
|
11
10
|
import { getCodeStyles } from './internal/theme/styles';
|
|
@@ -21,10 +20,7 @@ import { getCodeStyles } from './internal/theme/styles';
|
|
|
21
20
|
var Code = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Code(_ref, ref) {
|
|
22
21
|
var testId = _ref.testId,
|
|
23
22
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
-
var
|
|
25
|
-
var styles = useMemo(function () {
|
|
26
|
-
return css(getCodeStyles(theme));
|
|
27
|
-
}, [theme]);
|
|
23
|
+
var styles = css(getCodeStyles());
|
|
28
24
|
var children = props.children,
|
|
29
25
|
_props$codeBidiWarnin = props.codeBidiWarnings,
|
|
30
26
|
codeBidiWarnings = _props$codeBidiWarnin === void 0 ? true : _props$codeBidiWarnin,
|
package/dist/esm/constants.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// The full list of languages that can potentially be supported is found in
|
|
2
|
+
// https://prismjs.com/#supported-languages
|
|
1
3
|
export var SUPPORTED_LANGUAGES = [{
|
|
2
4
|
name: 'PHP',
|
|
3
5
|
alias: ['php', 'php3', 'php4', 'php5'],
|
|
@@ -306,5 +308,21 @@ export var SUPPORTED_LANGUAGES = [{
|
|
|
306
308
|
name: 'SplunkSPL',
|
|
307
309
|
alias: ['splunk-spl'],
|
|
308
310
|
value: 'splunk-spl'
|
|
311
|
+
}, {
|
|
312
|
+
name: 'Dockerfile',
|
|
313
|
+
alias: ['docker', 'dockerfile'],
|
|
314
|
+
value: 'dockerfile'
|
|
315
|
+
}, {
|
|
316
|
+
name: 'HCL',
|
|
317
|
+
alias: ['hcl', 'terraform'],
|
|
318
|
+
value: 'hcl'
|
|
319
|
+
}, {
|
|
320
|
+
name: 'NGINX',
|
|
321
|
+
alias: ['nginx'],
|
|
322
|
+
value: 'nginx'
|
|
323
|
+
}, {
|
|
324
|
+
name: 'Protocol Buffers',
|
|
325
|
+
alias: ['protobuf', 'proto'],
|
|
326
|
+
value: 'protobuf'
|
|
309
327
|
}];
|
|
310
328
|
export { CODE_BLOCK_SELECTOR } from './internal/theme/constants';
|