@atlaskit/avatar 21.9.1 → 21.9.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 +11 -2
- package/codemods/18.0.0-lite-mode.ts +221 -270
- package/codemods/19.0.0-render-props.ts +100 -132
- package/codemods/__tests__/18.0.0-lite-mode.ts +140 -140
- package/codemods/__tests__/19.0.0-render-props.ts +28 -28
- package/dist/cjs/Avatar.js +7 -7
- package/dist/cjs/AvatarImage.js +3 -1
- package/dist/cjs/AvatarItem.js +1 -1
- package/dist/cjs/IconWrapper.js +1 -0
- package/dist/cjs/Presence.js +2 -0
- package/dist/cjs/Skeleton.js +5 -1
- package/dist/cjs/Status.js +2 -0
- package/dist/es2019/Avatar.js +48 -45
- package/dist/es2019/AvatarImage.js +3 -1
- package/dist/es2019/AvatarItem.js +20 -20
- package/dist/es2019/IconWrapper.js +1 -0
- package/dist/es2019/Presence.js +2 -0
- package/dist/es2019/Skeleton.js +7 -1
- package/dist/es2019/Status.js +2 -0
- package/dist/esm/Avatar.js +7 -7
- package/dist/esm/AvatarImage.js +3 -1
- package/dist/esm/AvatarItem.js +1 -1
- package/dist/esm/IconWrapper.js +1 -0
- package/dist/esm/Presence.js +2 -0
- package/dist/esm/Skeleton.js +5 -1
- package/dist/esm/Status.js +2 -0
- package/dist/types/Avatar.d.ts +5 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types-ts4.5/Avatar.d.ts +5 -1
- package/dist/types-ts4.5/index.d.ts +2 -2
- package/package.json +3 -3
- package/report.api.md +83 -94
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/avatar
|
|
2
2
|
|
|
3
|
+
## 21.9.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#110310](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110310)
|
|
8
|
+
[`ea4751db471b1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ea4751db471b1) -
|
|
9
|
+
Allow maker-provided prop to override the context value for the AvatarContext's `size` property.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 21.9.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -20,7 +29,7 @@
|
|
|
20
29
|
|
|
21
30
|
- [#98168](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98168)
|
|
22
31
|
[`bc3ef8133b6c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bc3ef8133b6c) -
|
|
23
|
-
Add support for React 18.
|
|
32
|
+
Add support for React 18 in non-strict mode.
|
|
24
33
|
|
|
25
34
|
## 21.7.0
|
|
26
35
|
|
|
@@ -28,7 +37,7 @@
|
|
|
28
37
|
|
|
29
38
|
- [#96490](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/96490)
|
|
30
39
|
[`e7e14229e1ca`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e7e14229e1ca) -
|
|
31
|
-
Add support for React 18.
|
|
40
|
+
Add support for React 18 in non-strict mode.
|
|
32
41
|
|
|
33
42
|
## 21.6.1
|
|
34
43
|
|
|
@@ -1,301 +1,252 @@
|
|
|
1
1
|
// eslint-disable-next-line @repo/internal/fs/filename-pattern-match
|
|
2
2
|
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
API,
|
|
4
|
+
ASTPath,
|
|
5
|
+
default as core,
|
|
6
|
+
FileInfo,
|
|
7
|
+
ImportDeclaration,
|
|
8
|
+
ImportSpecifier,
|
|
9
|
+
MemberExpression,
|
|
10
|
+
Options,
|
|
11
11
|
} from 'jscodeshift';
|
|
12
12
|
|
|
13
13
|
function getImportDeclaration(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
j: core.JSCodeshift,
|
|
15
|
+
source: ReturnType<typeof j>,
|
|
16
|
+
specifier: string,
|
|
17
17
|
) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
(path: ASTPath<ImportDeclaration>) =>
|
|
22
|
-
path.node.source.value === specifier,
|
|
23
|
-
);
|
|
18
|
+
return source
|
|
19
|
+
.find(j.ImportDeclaration)
|
|
20
|
+
.filter((path: ASTPath<ImportDeclaration>) => path.node.source.value === specifier);
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
function getDefaultSpecifier(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
)
|
|
37
|
-
.find(j.ImportDefaultSpecifier);
|
|
38
|
-
|
|
39
|
-
if (!specifiers.length) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
return specifiers.nodes()[0]!.local!.name;
|
|
23
|
+
function getDefaultSpecifier(j: core.JSCodeshift, source: ReturnType<typeof j>, specifier: string) {
|
|
24
|
+
const specifiers = source
|
|
25
|
+
.find(j.ImportDeclaration)
|
|
26
|
+
.filter((path: ASTPath<ImportDeclaration>) => path.node.source.value === specifier)
|
|
27
|
+
.find(j.ImportDefaultSpecifier);
|
|
28
|
+
|
|
29
|
+
if (!specifiers.length) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return specifiers.nodes()[0]!.local!.name;
|
|
43
33
|
}
|
|
44
34
|
|
|
45
35
|
function getImportSpecifier(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
j: core.JSCodeshift,
|
|
37
|
+
source: ReturnType<typeof j>,
|
|
38
|
+
specifier: string,
|
|
39
|
+
imported: string,
|
|
50
40
|
) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (!specifiers.length) {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return specifiers.nodes()[0]!.local!.name;
|
|
41
|
+
const specifiers = source
|
|
42
|
+
.find(j.ImportDeclaration)
|
|
43
|
+
.filter((path: ASTPath<ImportDeclaration>) => path.node.source.value === specifier)
|
|
44
|
+
.find(j.ImportSpecifier)
|
|
45
|
+
.filter((path: ASTPath<ImportSpecifier>) => path.value.imported.name === imported);
|
|
46
|
+
|
|
47
|
+
if (!specifiers.length) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return specifiers.nodes()[0]!.local!.name;
|
|
67
52
|
}
|
|
68
53
|
|
|
69
|
-
function getJSXAttributesByName(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
.find(j.JSXIdentifier)
|
|
80
|
-
.filter((identifier) => identifier.value.name === attributeName);
|
|
81
|
-
return Boolean(matches.length);
|
|
82
|
-
});
|
|
54
|
+
function getJSXAttributesByName(j: core.JSCodeshift, element: ASTPath<any>, attributeName: string) {
|
|
55
|
+
return j(element)
|
|
56
|
+
.find(j.JSXOpeningElement)
|
|
57
|
+
.find(j.JSXAttribute)
|
|
58
|
+
.filter((attribute) => {
|
|
59
|
+
const matches = j(attribute)
|
|
60
|
+
.find(j.JSXIdentifier)
|
|
61
|
+
.filter((identifier) => identifier.value.name === attributeName);
|
|
62
|
+
return Boolean(matches.length);
|
|
63
|
+
});
|
|
83
64
|
}
|
|
84
65
|
|
|
85
66
|
function updateAvatarProps(j: core.JSCodeshift, source: ReturnType<typeof j>) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
element.value,
|
|
166
|
-
),
|
|
167
|
-
]);
|
|
168
|
-
} else {
|
|
169
|
-
j(element).replaceWith([wrappedAvatar]);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
enableTooltipValue && enableTooltipValue.remove();
|
|
174
|
-
});
|
|
67
|
+
const defaultSpecifier = getDefaultSpecifier(j, source, '@atlaskit/avatar');
|
|
68
|
+
|
|
69
|
+
if (!defaultSpecifier) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
source.findJSXElements(defaultSpecifier).forEach((element) => {
|
|
74
|
+
getJSXAttributesByName(j, element, 'isHover').remove();
|
|
75
|
+
getJSXAttributesByName(j, element, 'isActive').remove();
|
|
76
|
+
getJSXAttributesByName(j, element, 'isFocus').remove();
|
|
77
|
+
getJSXAttributesByName(j, element, 'isSelected').remove();
|
|
78
|
+
getJSXAttributesByName(j, element, 'theme').remove();
|
|
79
|
+
|
|
80
|
+
const nameAttributes = getJSXAttributesByName(j, element, 'name');
|
|
81
|
+
const name = nameAttributes.length && nameAttributes.get();
|
|
82
|
+
const enableTooltipAttributes = getJSXAttributesByName(j, element, 'enableTooltip');
|
|
83
|
+
const enableTooltipValue = enableTooltipAttributes.length && enableTooltipAttributes;
|
|
84
|
+
|
|
85
|
+
const hasDefaultTrue = !!enableTooltipAttributes.filter((attr) => attr.node.value == null)
|
|
86
|
+
.length;
|
|
87
|
+
|
|
88
|
+
const hasTruthy = !!enableTooltipAttributes
|
|
89
|
+
.find(j.JSXExpressionContainer)
|
|
90
|
+
.find(j.BooleanLiteral)
|
|
91
|
+
.filter((literal) => literal.node.value).length;
|
|
92
|
+
|
|
93
|
+
const hasFalsy = !!enableTooltipAttributes
|
|
94
|
+
.find(j.JSXExpressionContainer)
|
|
95
|
+
.find(j.BooleanLiteral)
|
|
96
|
+
.filter((literal) => literal.node.value === false).length;
|
|
97
|
+
|
|
98
|
+
const hasExpression = !!enableTooltipAttributes
|
|
99
|
+
.find(j.JSXExpressionContainer)
|
|
100
|
+
.filter((container) => {
|
|
101
|
+
return j(container).find(j.BooleanLiteral).length === 0;
|
|
102
|
+
}).length;
|
|
103
|
+
|
|
104
|
+
const shouldWrapAvatar = !hasFalsy || hasDefaultTrue || hasTruthy || hasExpression;
|
|
105
|
+
|
|
106
|
+
if (shouldWrapAvatar && name) {
|
|
107
|
+
getImportDeclaration(j, source, '@atlaskit/avatar').forEach((importDeclaration) => {
|
|
108
|
+
j(importDeclaration).replaceWith([
|
|
109
|
+
j.importDeclaration(
|
|
110
|
+
[j.importDefaultSpecifier(j.identifier('Tooltip'))],
|
|
111
|
+
j.literal('@atlaskit/tooltip'),
|
|
112
|
+
),
|
|
113
|
+
importDeclaration.value,
|
|
114
|
+
]);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
const wrappedAvatar = j.jsxElement(
|
|
118
|
+
j.jsxOpeningElement(j.jsxIdentifier('Tooltip'), [
|
|
119
|
+
j.jsxAttribute(j.jsxIdentifier('content'), name.value.value),
|
|
120
|
+
]),
|
|
121
|
+
j.jsxClosingElement(j.jsxIdentifier('Tooltip')),
|
|
122
|
+
[
|
|
123
|
+
j.jsxElement(
|
|
124
|
+
element.value.openingElement,
|
|
125
|
+
element.value.closingElement,
|
|
126
|
+
element.value.children,
|
|
127
|
+
),
|
|
128
|
+
],
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
if (hasExpression && enableTooltipValue) {
|
|
132
|
+
j(element).replaceWith([
|
|
133
|
+
j.conditionalExpression(
|
|
134
|
+
enableTooltipValue.find(j.JSXExpressionContainer).get().value.expression,
|
|
135
|
+
wrappedAvatar,
|
|
136
|
+
element.value,
|
|
137
|
+
),
|
|
138
|
+
]);
|
|
139
|
+
} else {
|
|
140
|
+
j(element).replaceWith([wrappedAvatar]);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
enableTooltipValue && enableTooltipValue.remove();
|
|
145
|
+
});
|
|
175
146
|
}
|
|
176
147
|
|
|
177
|
-
function updateAvatarItemProps(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
.forEach((container) => {
|
|
241
|
-
j(container).replaceWith(
|
|
242
|
-
j.jsxExpressionContainer(
|
|
243
|
-
// Type 'JSXEmptyExpression' is not assignable to type 'ExpressionKind'.
|
|
244
|
-
// @ts-ignore TS2345
|
|
245
|
-
j.unaryExpression('!', container.node.expression),
|
|
246
|
-
),
|
|
247
|
-
);
|
|
248
|
-
});
|
|
249
|
-
},
|
|
250
|
-
);
|
|
251
|
-
});
|
|
148
|
+
function updateAvatarItemProps(j: core.JSCodeshift, source: ReturnType<typeof j>) {
|
|
149
|
+
const importSpecifier = getImportSpecifier(j, source, '@atlaskit/avatar', 'AvatarItem');
|
|
150
|
+
|
|
151
|
+
if (!importSpecifier) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
source.findJSXElements(importSpecifier).forEach((element) => {
|
|
156
|
+
getJSXAttributesByName(j, element, 'isHover').remove();
|
|
157
|
+
getJSXAttributesByName(j, element, 'isActive').remove();
|
|
158
|
+
getJSXAttributesByName(j, element, 'isFocus').remove();
|
|
159
|
+
getJSXAttributesByName(j, element, 'isSelected').remove();
|
|
160
|
+
getJSXAttributesByName(j, element, 'theme').remove();
|
|
161
|
+
getJSXAttributesByName(j, element, 'enableTextTruncate').forEach((attribute) => {
|
|
162
|
+
// Change the prop name to isTruncationDisabled
|
|
163
|
+
j(attribute).find(j.JSXIdentifier).replaceWith(j.jsxIdentifier('isTruncationDisabled'));
|
|
164
|
+
|
|
165
|
+
// Remove if enableTextTruncate was true or given no value (ie true)
|
|
166
|
+
j(attribute)
|
|
167
|
+
.filter((attr) => attr.node.value == null)
|
|
168
|
+
.remove();
|
|
169
|
+
|
|
170
|
+
j(attribute)
|
|
171
|
+
.filter((attr) => {
|
|
172
|
+
return !!j(attr)
|
|
173
|
+
.find(j.JSXExpressionContainer)
|
|
174
|
+
.find(j.BooleanLiteral)
|
|
175
|
+
.filter((literal) => literal.node.value).length;
|
|
176
|
+
})
|
|
177
|
+
.remove();
|
|
178
|
+
|
|
179
|
+
// if `enableTextTruncate` value is negative we can change it to 'true'
|
|
180
|
+
j(attribute)
|
|
181
|
+
.filter(
|
|
182
|
+
(attr) =>
|
|
183
|
+
!!j(attr)
|
|
184
|
+
.find(j.JSXExpressionContainer)
|
|
185
|
+
.filter(
|
|
186
|
+
(expression) =>
|
|
187
|
+
j(expression)
|
|
188
|
+
.find(j.BooleanLiteral)
|
|
189
|
+
.filter((literal) => !literal.node.value).length > 0,
|
|
190
|
+
).length,
|
|
191
|
+
)
|
|
192
|
+
.replaceWith(j.jsxAttribute(j.jsxIdentifier('isTruncationDisabled')));
|
|
193
|
+
|
|
194
|
+
// if `enableTextTruncate` was an expression, negate it
|
|
195
|
+
j(attribute)
|
|
196
|
+
.find(j.JSXExpressionContainer)
|
|
197
|
+
.filter((container) => {
|
|
198
|
+
return j(container).find(j.BooleanLiteral).length === 0;
|
|
199
|
+
})
|
|
200
|
+
.forEach((container) => {
|
|
201
|
+
j(container).replaceWith(
|
|
202
|
+
j.jsxExpressionContainer(
|
|
203
|
+
// Type 'JSXEmptyExpression' is not assignable to type 'ExpressionKind'.
|
|
204
|
+
// @ts-ignore TS2345
|
|
205
|
+
j.unaryExpression('!', container.node.expression),
|
|
206
|
+
),
|
|
207
|
+
);
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
});
|
|
252
211
|
}
|
|
253
212
|
|
|
254
|
-
function updateBorderWidthUsage(
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
);
|
|
271
|
-
}
|
|
272
|
-
});
|
|
213
|
+
function updateBorderWidthUsage(j: core.JSCodeshift, source: ReturnType<typeof j>) {
|
|
214
|
+
source
|
|
215
|
+
.find(j.MemberExpression)
|
|
216
|
+
.filter(
|
|
217
|
+
(memberExpression: ASTPath<MemberExpression>) =>
|
|
218
|
+
// @ts-ignore
|
|
219
|
+
memberExpression.value.object.name === 'BORDER_WIDTH',
|
|
220
|
+
)
|
|
221
|
+
.forEach((memberExpression: ASTPath<MemberExpression>) => {
|
|
222
|
+
if (memberExpression.value.property) {
|
|
223
|
+
j(memberExpression).replaceWith(
|
|
224
|
+
// @ts-ignore
|
|
225
|
+
j.identifier(memberExpression.value.object.name),
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
});
|
|
273
229
|
}
|
|
274
230
|
|
|
275
231
|
function hasImportDeclaration(
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
232
|
+
j: core.JSCodeshift,
|
|
233
|
+
source: ReturnType<typeof j>,
|
|
234
|
+
importPath: string,
|
|
279
235
|
) {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
.filter((path) => path.node.source.value === importPath).length;
|
|
236
|
+
return !!source.find(j.ImportDeclaration).filter((path) => path.node.source.value === importPath)
|
|
237
|
+
.length;
|
|
283
238
|
}
|
|
284
239
|
|
|
285
|
-
export default function transformer(
|
|
286
|
-
|
|
287
|
-
{ jscodeshift: j }: API,
|
|
288
|
-
options: Options,
|
|
289
|
-
) {
|
|
290
|
-
const source = j(fileInfo.source);
|
|
240
|
+
export default function transformer(fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) {
|
|
241
|
+
const source = j(fileInfo.source);
|
|
291
242
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
243
|
+
if (hasImportDeclaration(j, source, '@atlaskit/avatar')) {
|
|
244
|
+
updateBorderWidthUsage(j, source);
|
|
245
|
+
updateAvatarProps(j, source);
|
|
246
|
+
updateAvatarItemProps(j, source);
|
|
296
247
|
|
|
297
|
-
|
|
298
|
-
|
|
248
|
+
return source.toSource(options.printOptions || { quote: 'single' });
|
|
249
|
+
}
|
|
299
250
|
|
|
300
|
-
|
|
251
|
+
return fileInfo.source;
|
|
301
252
|
}
|