@atlaskit/tabs 17.2.1 → 17.2.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 +14 -36
- package/dist/cjs/components/tabs.js +1 -1
- package/dist/es2019/components/tabs.js +1 -1
- package/dist/esm/components/tabs.js +1 -1
- package/dist/types/components/tab-panel.d.ts +2 -2
- package/dist/types-ts4.5/components/tab-panel.d.ts +2 -2
- package/package.json +2 -3
- package/codemods/13.0.0-lite-mode.tsx +0 -31
- package/codemods/__tests__/13.0.0-lite-mode.tsx +0 -569
- package/codemods/__tests__/add-id-prop.tsx +0 -77
- package/codemods/__tests__/map-tabs-prop.tsx +0 -299
- package/codemods/__tests__/on-select-to-on-change.tsx +0 -541
- package/codemods/__tests__/remove-components-prop.tsx +0 -151
- package/codemods/__tests__/remove-is-selected-test-prop.tsx +0 -147
- package/codemods/__tests__/remove-tab-item-tab-content.tsx +0 -86
- package/codemods/__tests__/remove-types.tsx +0 -162
- package/codemods/__tests__/rename-is-content-persisted-to-should-unmount-tab-panel-on-change.tsx +0 -311
- package/codemods/migrations/add-id-prop.tsx +0 -51
- package/codemods/migrations/map-tabs-prop.tsx +0 -171
- package/codemods/migrations/on-select-to-on-change.tsx +0 -91
- package/codemods/migrations/remove-components-prop.tsx +0 -20
- package/codemods/migrations/remove-is-selected-test-prop.tsx +0 -17
- package/codemods/migrations/remove-tab-item-tab-content.tsx +0 -26
- package/codemods/migrations/remove-types.tsx +0 -45
- package/codemods/migrations/rename-is-content-persisted-to-should-unmount-tab-panel-on-change.tsx +0 -62
- package/codemods/utils.tsx +0 -39
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/tabs
|
|
2
2
|
|
|
3
|
+
## 17.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 17.2.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#110415](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110415)
|
|
14
|
+
[`f082418019174`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f082418019174) -
|
|
15
|
+
Remove old codemods from package.
|
|
16
|
+
|
|
3
17
|
## 17.2.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -810,42 +824,6 @@
|
|
|
810
824
|
`TabContentComponentProvided`, `TabItemType`, `TabContentType`, `SelectedProp`,
|
|
811
825
|
`IsSelectedTestFunction`, `OnSelectCallback`, `TabsState`, `TabsNavigationProps` and `Mode`.
|
|
812
826
|
|
|
813
|
-
### Automatic upgrading
|
|
814
|
-
|
|
815
|
-
There is a codemod that assists you in upgrading most of the changes from above. Depending on your
|
|
816
|
-
usage, you will most likely have to do a manual step as this is a fairly big change in API. The
|
|
817
|
-
codemod will do its best job at making sure everything functions but you may want to clean up your
|
|
818
|
-
usage of `@atlaskit/tabs`. It does these following changes:
|
|
819
|
-
|
|
820
|
-
- Adds a randomly generated ID
|
|
821
|
-
- Changes `onSelect` to `onChange` and defines a new inline function that will functionally work
|
|
822
|
-
the same as it used to. It is however a messy solution and you may want to change the function
|
|
823
|
-
to only use the selected index.
|
|
824
|
-
- Remove the `TabItem` and `TabContent` imports.
|
|
825
|
-
- Map the array you supplied as a `tabs` prop to create `Tab`'s and `TabPanel`'s.
|
|
826
|
-
- Remove the `component` and `isSelectedTest` prop.
|
|
827
|
-
- Removes types that no longer exist.
|
|
828
|
-
- Migrates your usage of `isContentPersisted` to one of `shouldUnmountTabPanelOnChange`.
|
|
829
|
-
|
|
830
|
-
To run the codemod: **You first need to have the latest version installed**
|
|
831
|
-
|
|
832
|
-
```bash
|
|
833
|
-
yarn upgrade @atlaskit/tabs@^13.0.0
|
|
834
|
-
```
|
|
835
|
-
|
|
836
|
-
Once upgraded, use `@atlaskit/codemod-cli`:
|
|
837
|
-
|
|
838
|
-
```bash
|
|
839
|
-
npx @atlaskit/codemod-cli --parser babel --extensions ts,tsx,js [relativePath]
|
|
840
|
-
```
|
|
841
|
-
|
|
842
|
-
The CLI will show a list of components and versions so select `@atlaskit/tabs@^13.0.0` and you
|
|
843
|
-
will automatically be upgraded.
|
|
844
|
-
|
|
845
|
-
Run `npx @atlaskit/codemod-cli -h` for more details on usage. For Atlassians, refer to the
|
|
846
|
-
[documentation](https://hello.atlassian.net/wiki/spaces/AF/pages/2627171992/Codemods) for more
|
|
847
|
-
details on the codemod CLI.
|
|
848
|
-
|
|
849
827
|
### Patch Changes
|
|
850
828
|
|
|
851
829
|
- [`4a969d5c40f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4a969d5c40f) - Fix a
|
|
@@ -25,7 +25,7 @@ var tabsStyles = null;
|
|
|
25
25
|
var analyticsAttributes = {
|
|
26
26
|
componentName: 'tabs',
|
|
27
27
|
packageName: "@atlaskit/tabs",
|
|
28
|
-
packageVersion: "17.2.
|
|
28
|
+
packageVersion: "17.2.3"
|
|
29
29
|
};
|
|
30
30
|
var getTabPanelWithContext = function getTabPanelWithContext(_ref) {
|
|
31
31
|
var tabPanel = _ref.tabPanel,
|
|
@@ -15,7 +15,7 @@ var tabsStyles = null;
|
|
|
15
15
|
var analyticsAttributes = {
|
|
16
16
|
componentName: 'tabs',
|
|
17
17
|
packageName: "@atlaskit/tabs",
|
|
18
|
-
packageVersion: "17.2.
|
|
18
|
+
packageVersion: "17.2.3"
|
|
19
19
|
};
|
|
20
20
|
var getTabPanelWithContext = function getTabPanelWithContext(_ref) {
|
|
21
21
|
var tabPanel = _ref.tabPanel,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { type TabPanelProps } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* __TabPanel__
|
|
@@ -9,5 +9,5 @@ import { type TabPanelProps } from '../types';
|
|
|
9
9
|
* - [Code](https://atlassian.design/components/tabs/code)
|
|
10
10
|
* - [Usage](https://atlassian.design/components/tabs/usage)
|
|
11
11
|
*/
|
|
12
|
-
declare const TabPanel: ({ children, testId }: TabPanelProps) => JSX.Element;
|
|
12
|
+
declare const TabPanel: ({ children, testId }: TabPanelProps) => React.JSX.Element;
|
|
13
13
|
export default TabPanel;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { type TabPanelProps } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* __TabPanel__
|
|
@@ -9,5 +9,5 @@ import { type TabPanelProps } from '../types';
|
|
|
9
9
|
* - [Code](https://atlassian.design/components/tabs/code)
|
|
10
10
|
* - [Usage](https://atlassian.design/components/tabs/usage)
|
|
11
11
|
*/
|
|
12
|
-
declare const TabPanel: ({ children, testId }: TabPanelProps) => JSX.Element;
|
|
12
|
+
declare const TabPanel: ({ children, testId }: TabPanelProps) => React.JSX.Element;
|
|
13
13
|
export default TabPanel;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/tabs",
|
|
3
|
-
"version": "17.2.
|
|
3
|
+
"version": "17.2.3",
|
|
4
4
|
"description": "Tabs are used to organize content by grouping similar information on the same page.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@atlaskit/focus-ring": "^2.1.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^1.0.0",
|
|
41
41
|
"@atlaskit/primitives": "^13.4.0",
|
|
42
|
-
"@atlaskit/theme": "^
|
|
42
|
+
"@atlaskit/theme": "^15.0.0",
|
|
43
43
|
"@atlaskit/tokens": "^3.3.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@compiled/react": "^0.18.1"
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
"@atlaskit/tooltip": "^19.1.0",
|
|
57
57
|
"@atlaskit/visual-regression": "*",
|
|
58
58
|
"@testing-library/react": "^13.4.0",
|
|
59
|
-
"jscodeshift": "^0.13.0",
|
|
60
59
|
"react-dom": "^18.2.0",
|
|
61
60
|
"react-lorem-component": "^0.13.0",
|
|
62
61
|
"storybook-addon-performance": "^0.17.3",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type JSCodeshift } from 'jscodeshift';
|
|
2
|
-
import { type Collection } from 'jscodeshift/src/Collection';
|
|
3
|
-
|
|
4
|
-
import { createTransformer, hasImportDeclaration } from '@atlaskit/codemod-utils';
|
|
5
|
-
|
|
6
|
-
import { addIdProp } from './migrations/add-id-prop';
|
|
7
|
-
import { mapTabsProp, removeTabsProp } from './migrations/map-tabs-prop';
|
|
8
|
-
import { migrateOnSelectType } from './migrations/on-select-to-on-change';
|
|
9
|
-
import { removeComponentsProp } from './migrations/remove-components-prop';
|
|
10
|
-
import { removeIsSelectedTestProp } from './migrations/remove-is-selected-test-prop';
|
|
11
|
-
import { removeTabItemTabContent } from './migrations/remove-tab-item-tab-content';
|
|
12
|
-
import { removeTypes } from './migrations/remove-types';
|
|
13
|
-
import { renameIsContentPersistedToShouldUnmountTabPanelOnChange } from './migrations/rename-is-content-persisted-to-should-unmount-tab-panel-on-change';
|
|
14
|
-
|
|
15
|
-
const transformer = createTransformer(
|
|
16
|
-
[
|
|
17
|
-
// Note these first 2 must be done first while there is one JSX element for tabs
|
|
18
|
-
addIdProp,
|
|
19
|
-
renameIsContentPersistedToShouldUnmountTabPanelOnChange,
|
|
20
|
-
migrateOnSelectType,
|
|
21
|
-
removeTabItemTabContent,
|
|
22
|
-
mapTabsProp,
|
|
23
|
-
removeTabsProp,
|
|
24
|
-
removeComponentsProp,
|
|
25
|
-
removeIsSelectedTestProp,
|
|
26
|
-
removeTypes,
|
|
27
|
-
],
|
|
28
|
-
(j: JSCodeshift, source: Collection<Node>) => hasImportDeclaration(j, source, '@atlaskit/tabs'),
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
export default transformer;
|