@atlaskit/code 14.4.1 → 14.4.3
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/codemods/13.0.0-remove-unnecessary-code-props.tsx +9 -11
- package/codemods/utils/helpers.tsx +17 -22
- package/dist/cjs/internal/theme/styles.js +4 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/internal/theme/styles.js +3 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/internal/theme/styles.js +4 -2
- package/dist/esm/version.json +1 -1
- package/package.json +3 -11
- package/report.api.md +415 -475
- package/dist/types-ts4.0/bidi-warning/bidi-warning-decorator.d.ts +0 -5
- package/dist/types-ts4.0/bidi-warning/index.d.ts +0 -1
- package/dist/types-ts4.0/bidi-warning/ui/index.d.ts +0 -3
- package/dist/types-ts4.0/bidi-warning/ui/styled.d.ts +0 -8
- package/dist/types-ts4.0/bidi-warning/ui/types.d.ts +0 -33
- package/dist/types-ts4.0/code-block.d.ts +0 -13
- package/dist/types-ts4.0/code.d.ts +0 -16
- package/dist/types-ts4.0/constants.d.ts +0 -625
- package/dist/types-ts4.0/entry-points/block.d.ts +0 -2
- package/dist/types-ts4.0/entry-points/constants.d.ts +0 -1
- package/dist/types-ts4.0/entry-points/inline.d.ts +0 -2
- package/dist/types-ts4.0/entry-points/types.d.ts +0 -1
- package/dist/types-ts4.0/extract-react-types/code-block.d.ts +0 -37
- package/dist/types-ts4.0/extract-react-types/code.d.ts +0 -2
- package/dist/types-ts4.0/index.d.ts +0 -4
- package/dist/types-ts4.0/internal/hooks/use-highlight.d.ts +0 -6
- package/dist/types-ts4.0/internal/theme/constants.d.ts +0 -8
- package/dist/types-ts4.0/internal/theme/get-theme.d.ts +0 -7
- package/dist/types-ts4.0/internal/theme/styles.d.ts +0 -27
- package/dist/types-ts4.0/internal/theme/types.d.ts +0 -57
- package/dist/types-ts4.0/internal/types.d.ts +0 -57
- package/dist/types-ts4.0/internal/utils/get-normalized-language.d.ts +0 -2
- package/dist/types-ts4.0/react-syntax-highlighter-bidi-warning-renderer.d.ts +0 -9
- package/dist/types-ts4.0/types.d.ts +0 -32
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/code
|
|
2
2
|
|
|
3
|
+
## 14.4.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f1765efdca6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f1765efdca6) - [ux] Fix bug that caused misalignment of Code Block content which contain a mixture of spaces and tabs
|
|
8
|
+
|
|
9
|
+
## 14.4.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 14.4.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -35,21 +35,19 @@ function removeProps(
|
|
|
35
35
|
jsxAttributeCollection.remove();
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
const jsxSpreadIdentifierPropertyCollection =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
const jsxSpreadIdentifierPropertyCollection =
|
|
39
|
+
getJSXSpreadIdentifierAttributesByName(
|
|
40
|
+
j,
|
|
41
|
+
collection,
|
|
42
|
+
jsxElementPath,
|
|
43
|
+
propName,
|
|
44
|
+
);
|
|
44
45
|
if (jsxSpreadIdentifierPropertyCollection) {
|
|
45
46
|
jsxSpreadIdentifierPropertyCollection.remove();
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
const jsxSpreadExpressionPropertyCollection =
|
|
49
|
-
j,
|
|
50
|
-
jsxElementPath,
|
|
51
|
-
propName,
|
|
52
|
-
);
|
|
49
|
+
const jsxSpreadExpressionPropertyCollection =
|
|
50
|
+
getJSXSpreadObjectExpressionAttributesByName(j, jsxElementPath, propName);
|
|
53
51
|
if (jsxSpreadExpressionPropertyCollection) {
|
|
54
52
|
jsxSpreadExpressionPropertyCollection.remove();
|
|
55
53
|
}
|
|
@@ -49,10 +49,8 @@ export function getDynamicImportCollection(
|
|
|
49
49
|
importPath: string,
|
|
50
50
|
) {
|
|
51
51
|
return collection.find(j.CallExpression).filter((callExpressionPath) => {
|
|
52
|
-
const {
|
|
53
|
-
|
|
54
|
-
arguments: callExpressionArguments,
|
|
55
|
-
} = callExpressionPath.node;
|
|
52
|
+
const { callee, arguments: callExpressionArguments } =
|
|
53
|
+
callExpressionPath.node;
|
|
56
54
|
|
|
57
55
|
return !!(
|
|
58
56
|
isCallExpressionCalleeImportType(callee) &&
|
|
@@ -246,24 +244,21 @@ export function getJSXSpreadObjectExpressionAttributesByName(
|
|
|
246
244
|
);
|
|
247
245
|
}
|
|
248
246
|
|
|
249
|
-
export const createRemoveFuncFor =
|
|
250
|
-
component: string,
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
comment?: string,
|
|
254
|
-
) => (j: core.JSCodeshift, source: Collection<Node>) => {
|
|
255
|
-
const specifier = getNamedSpecifier(j, source, component, importName);
|
|
247
|
+
export const createRemoveFuncFor =
|
|
248
|
+
(component: string, importName: string, prop: string, comment?: string) =>
|
|
249
|
+
(j: core.JSCodeshift, source: Collection<Node>) => {
|
|
250
|
+
const specifier = getNamedSpecifier(j, source, component, importName);
|
|
256
251
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
252
|
+
if (!specifier) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
260
255
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
256
|
+
source.findJSXElements(specifier).forEach((element) => {
|
|
257
|
+
getJSXAttributesByName(j, element, prop).forEach((attribute: any) => {
|
|
258
|
+
j(attribute).remove();
|
|
259
|
+
if (comment) {
|
|
260
|
+
addCommentToStartOfFile({ j, base: source, message: comment });
|
|
261
|
+
}
|
|
262
|
+
});
|
|
267
263
|
});
|
|
268
|
-
}
|
|
269
|
-
};
|
|
264
|
+
};
|
|
@@ -235,12 +235,14 @@ var getCodeBlockStyles = function getCodeBlockStyles(theme) {
|
|
|
235
235
|
display: 'flex',
|
|
236
236
|
lineHeight: _constants2.CODE_LINE_HEIGHT,
|
|
237
237
|
overflowX: 'auto',
|
|
238
|
-
whiteSpace: 'pre'
|
|
238
|
+
whiteSpace: 'pre',
|
|
239
|
+
direction: 'ltr'
|
|
239
240
|
}, getBaseCodeStyles(theme)), syntaxKeywordColors(theme)), {}, {
|
|
240
241
|
// this is to account for SSR spacing issue once loaded in browser
|
|
241
242
|
'& .linenumber, .react-syntax-highlighter-line-number': lineNumberStyle(theme),
|
|
242
243
|
'& .linenumber': {
|
|
243
|
-
display: 'inline-block !important'
|
|
244
|
+
display: 'inline-block !important',
|
|
245
|
+
float: 'left'
|
|
244
246
|
},
|
|
245
247
|
// these styles are for line highlighting
|
|
246
248
|
'& [data-ds--code--row]': {
|
package/dist/cjs/version.json
CHANGED
|
@@ -205,12 +205,14 @@ export const getCodeBlockStyles = theme => (highlightedStartText, highlightedEnd
|
|
|
205
205
|
lineHeight: CODE_LINE_HEIGHT,
|
|
206
206
|
overflowX: 'auto',
|
|
207
207
|
whiteSpace: 'pre',
|
|
208
|
+
direction: 'ltr',
|
|
208
209
|
...getBaseCodeStyles(theme),
|
|
209
210
|
...syntaxKeywordColors(theme),
|
|
210
211
|
// this is to account for SSR spacing issue once loaded in browser
|
|
211
212
|
'& .linenumber, .react-syntax-highlighter-line-number': lineNumberStyle(theme),
|
|
212
213
|
'& .linenumber': {
|
|
213
|
-
display: 'inline-block !important'
|
|
214
|
+
display: 'inline-block !important',
|
|
215
|
+
float: 'left'
|
|
214
216
|
},
|
|
215
217
|
// these styles are for line highlighting
|
|
216
218
|
'& [data-ds--code--row]': {
|
package/dist/es2019/version.json
CHANGED
|
@@ -218,12 +218,14 @@ export var getCodeBlockStyles = function getCodeBlockStyles(theme) {
|
|
|
218
218
|
display: 'flex',
|
|
219
219
|
lineHeight: CODE_LINE_HEIGHT,
|
|
220
220
|
overflowX: 'auto',
|
|
221
|
-
whiteSpace: 'pre'
|
|
221
|
+
whiteSpace: 'pre',
|
|
222
|
+
direction: 'ltr'
|
|
222
223
|
}, getBaseCodeStyles(theme)), syntaxKeywordColors(theme)), {}, {
|
|
223
224
|
// this is to account for SSR spacing issue once loaded in browser
|
|
224
225
|
'& .linenumber, .react-syntax-highlighter-line-number': lineNumberStyle(theme),
|
|
225
226
|
'& .linenumber': {
|
|
226
|
-
display: 'inline-block !important'
|
|
227
|
+
display: 'inline-block !important',
|
|
228
|
+
float: 'left'
|
|
227
229
|
},
|
|
228
230
|
// these styles are for line highlighting
|
|
229
231
|
'& [data-ds--code--row]': {
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/code",
|
|
3
|
-
"version": "14.4.
|
|
3
|
+
"version": "14.4.3",
|
|
4
4
|
"description": "Code highlights short strings of code snippets inline with body text.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,14 +12,6 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
-
"typesVersions": {
|
|
16
|
-
">=4.0 <4.5": {
|
|
17
|
-
"*": [
|
|
18
|
-
"dist/types-ts4.0/*",
|
|
19
|
-
"dist/types-ts4.0/index.d.ts"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
15
|
"sideEffects": false,
|
|
24
16
|
"atlaskit:src": "src/index.tsx",
|
|
25
17
|
"atlassian": {
|
|
@@ -37,7 +29,7 @@
|
|
|
37
29
|
"dependencies": {
|
|
38
30
|
"@atlaskit/codemod-utils": "^4.1.0",
|
|
39
31
|
"@atlaskit/theme": "^12.2.0",
|
|
40
|
-
"@atlaskit/tokens": "^0.
|
|
32
|
+
"@atlaskit/tokens": "^0.11.0",
|
|
41
33
|
"@atlaskit/tooltip": "^17.6.0",
|
|
42
34
|
"@babel/runtime": "^7.0.0",
|
|
43
35
|
"@emotion/react": "^11.7.1",
|
|
@@ -48,7 +40,7 @@
|
|
|
48
40
|
"react": "^16.8.0"
|
|
49
41
|
},
|
|
50
42
|
"devDependencies": {
|
|
51
|
-
"@atlaskit/button": "^16.
|
|
43
|
+
"@atlaskit/button": "^16.5.0",
|
|
52
44
|
"@atlaskit/docs": "^9.0.0",
|
|
53
45
|
"@atlaskit/ds-lib": "^2.1.0",
|
|
54
46
|
"@atlaskit/section-message": "^6.3.0",
|