@atlaskit/heading 4.3.0 → 5.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.
- package/CHANGELOG.md +26 -0
- package/package.json +7 -8
- package/codemods/1.6.0-level-to-size.tsx +0 -66
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @atlaskit/heading
|
|
2
2
|
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#117363](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117363)
|
|
8
|
+
[`10a0f7f6c2027`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/10a0f7f6c2027) -
|
|
9
|
+
This package's `peerDependencies` have been adjusted for `react` and/or `react-dom` to reflect the
|
|
10
|
+
status of only supporting React 18 going forward. No explicit breaking change to React support has
|
|
11
|
+
been made in this release, but this is to signify going forward, breaking changes for React 16 or
|
|
12
|
+
React 17 may come via non-major semver releases.
|
|
13
|
+
|
|
14
|
+
Please refer this community post for more details:
|
|
15
|
+
https://community.developer.atlassian.com/t/rfc-78-dropping-support-for-react-16-and-rendering-in-a-react-18-concurrent-root-in-jira-and-confluence/87026
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
21
|
+
## 4.3.1
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#114791](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114791)
|
|
26
|
+
[`084765a9c326c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/084765a9c326c) -
|
|
27
|
+
Remove old codemods and update dependencies.
|
|
28
|
+
|
|
3
29
|
## 4.3.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/heading",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "A heading is a typography component used to display text in different sizes and formats.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,27 +31,26 @@
|
|
|
31
31
|
"codegen": "ts-node ./scripts/codegen.tsx"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/css": "^0.
|
|
35
|
-
"@atlaskit/primitives": "^
|
|
36
|
-
"@atlaskit/tokens": "^
|
|
34
|
+
"@atlaskit/css": "^0.10.0",
|
|
35
|
+
"@atlaskit/primitives": "^14.0.0",
|
|
36
|
+
"@atlaskit/tokens": "^4.0.0",
|
|
37
37
|
"@babel/runtime": "^7.0.0",
|
|
38
38
|
"@compiled/react": "^0.18.2",
|
|
39
39
|
"@emotion/react": "^11.7.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"react": "^
|
|
42
|
+
"react": "^18.2.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@af/accessibility-testing": "*",
|
|
46
46
|
"@af/formatting": "*",
|
|
47
47
|
"@af/integration-testing": "*",
|
|
48
48
|
"@af/visual-regression": "*",
|
|
49
|
-
"@atlaskit/button": "^
|
|
50
|
-
"@atlaskit/ds-lib": "^
|
|
49
|
+
"@atlaskit/button": "^21.0.0",
|
|
50
|
+
"@atlaskit/ds-lib": "^4.0.0",
|
|
51
51
|
"@atlaskit/ssr": "*",
|
|
52
52
|
"@atlassian/codegen": "^0.1.0",
|
|
53
53
|
"@testing-library/react": "^13.4.0",
|
|
54
|
-
"jscodeshift": "^0.13.0",
|
|
55
54
|
"react-dom": "^18.2.0",
|
|
56
55
|
"ts-node": "^10.9.1",
|
|
57
56
|
"typescript": "~5.4.2"
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
API,
|
|
3
|
-
ASTPath,
|
|
4
|
-
default as core,
|
|
5
|
-
FileInfo,
|
|
6
|
-
ImportDeclaration,
|
|
7
|
-
Options,
|
|
8
|
-
} from 'jscodeshift';
|
|
9
|
-
|
|
10
|
-
export default function transformer(fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) {
|
|
11
|
-
const base = j(fileInfo.source);
|
|
12
|
-
const headingSpecifier = getDefaultSpecifier(j, base, '@atlaskit/heading');
|
|
13
|
-
if (!headingSpecifier) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
replaceLevelWithSize(j, base, headingSpecifier);
|
|
18
|
-
|
|
19
|
-
return base.toSource();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const levelToSizeMap = {
|
|
23
|
-
h900: 'xxlarge',
|
|
24
|
-
h800: 'xlarge',
|
|
25
|
-
h700: 'large',
|
|
26
|
-
h600: 'medium',
|
|
27
|
-
h500: 'small',
|
|
28
|
-
h400: 'xsmall',
|
|
29
|
-
h300: 'xxsmall',
|
|
30
|
-
// We may want to auto-transform h100s and h200s in the future
|
|
31
|
-
// h200: 'xxsmall',
|
|
32
|
-
// h100: 'xxsmall',
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
function replaceLevelWithSize(
|
|
36
|
-
j: core.JSCodeshift,
|
|
37
|
-
source: ReturnType<typeof j>,
|
|
38
|
-
specifier: string,
|
|
39
|
-
) {
|
|
40
|
-
source.findJSXElements(specifier).forEach((element) => {
|
|
41
|
-
j(element)
|
|
42
|
-
.find(j.JSXAttribute, { name: { type: 'JSXIdentifier', name: 'level' } })
|
|
43
|
-
.forEach((attr) => {
|
|
44
|
-
const attrValue = j(attr).nodes()[0].value;
|
|
45
|
-
if (attrValue.type === 'StringLiteral') {
|
|
46
|
-
const replacementValue = levelToSizeMap[attrValue.value as keyof typeof levelToSizeMap];
|
|
47
|
-
if (replacementValue) {
|
|
48
|
-
j(attr).replaceWith(
|
|
49
|
-
j.jsxAttribute(j.jsxIdentifier('size'), j.stringLiteral(replacementValue)),
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function getDefaultSpecifier(j: core.JSCodeshift, source: any, specifier: string) {
|
|
58
|
-
const specifiers = source
|
|
59
|
-
.find(j.ImportDeclaration)
|
|
60
|
-
.filter((path: ASTPath<ImportDeclaration>) => path.node.source.value === specifier)
|
|
61
|
-
.find(j.ImportDefaultSpecifier);
|
|
62
|
-
if (!specifiers.length) {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
return specifiers.nodes()[0]!.local!.name;
|
|
66
|
-
}
|