@atlaskit/code 14.4.1 → 14.4.2
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 +6 -0
- package/codemods/13.0.0-remove-unnecessary-code-props.tsx +9 -11
- package/codemods/utils/helpers.tsx +17 -22
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/package.json +3 -11
- package/report.api.md +407 -474
- 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
|
@@ -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
|
+
};
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
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.2",
|
|
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.4.0",
|
|
52
44
|
"@atlaskit/docs": "^9.0.0",
|
|
53
45
|
"@atlaskit/ds-lib": "^2.1.0",
|
|
54
46
|
"@atlaskit/section-message": "^6.3.0",
|