@atlaskit/modal-dialog 12.13.5 → 12.14.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 +14 -1
- package/README.md +2 -1
- package/__perf__/default.tsx +29 -35
- package/__perf__/interactions.tsx +88 -109
- package/__perf__/scroll.tsx +52 -69
- package/codemods/12.0.0-lite-mode.tsx +19 -22
- package/codemods/__tests__/12.0.0-lite-mode.test.tsx +41 -41
- package/codemods/__tests__/handle-prop-spread.tsx +53 -53
- package/codemods/__tests__/inline-width-names-declaration.test.tsx +28 -28
- package/codemods/__tests__/map-actions-prop.tsx +46 -46
- package/codemods/__tests__/map-body-from-props.test.tsx +95 -95
- package/codemods/__tests__/map-container-from-props.test.tsx +46 -46
- package/codemods/__tests__/map-footer-from-props.test.tsx +74 -74
- package/codemods/__tests__/map-header-from-props.test.tsx +74 -74
- package/codemods/__tests__/map-heading-prop.tsx +95 -95
- package/codemods/__tests__/remove-appearance-prop.test.tsx +18 -18
- package/codemods/__tests__/remove-component-override-props.test.tsx +25 -25
- package/codemods/__tests__/remove-is-chromeless.tsx +39 -39
- package/codemods/__tests__/rename-appearance-type.test.tsx +21 -21
- package/codemods/__tests__/rename-inner-component-prop-types.test.tsx +21 -21
- package/codemods/__tests__/rename-scroll-behavior-to-should-scroll-in-viewport.test.tsx +40 -42
- package/codemods/internal/utils.tsx +151 -189
- package/codemods/migrations/handle-prop-spread.tsx +23 -31
- package/codemods/migrations/inline-width-names-declaration.tsx +61 -73
- package/codemods/migrations/map-actions-prop.tsx +338 -381
- package/codemods/migrations/map-body-from-props.tsx +111 -136
- package/codemods/migrations/map-container-from-props.tsx +44 -65
- package/codemods/migrations/map-footer-from-props.tsx +66 -85
- package/codemods/migrations/map-header-from-props.tsx +60 -79
- package/codemods/migrations/map-heading-prop.tsx +142 -169
- package/codemods/migrations/remove-appearance-prop.tsx +17 -23
- package/codemods/migrations/remove-component-override-props.tsx +31 -43
- package/codemods/migrations/remove-is-chromeless.tsx +20 -26
- package/codemods/migrations/rename-appearance-type.tsx +3 -3
- package/codemods/migrations/rename-inner-component-prop-types.tsx +15 -18
- package/codemods/migrations/rename-scroll-behavior-to-should-scroll-in-viewport.tsx +48 -65
- package/dist/cjs/internal/components/modal-dialog.js +10 -1
- package/dist/cjs/internal/components/positioner.js +11 -0
- package/dist/cjs/internal/components/scroll-container.js +7 -0
- package/dist/cjs/modal-body.js +7 -2
- package/dist/cjs/modal-footer.js +7 -0
- package/dist/cjs/modal-header.js +7 -0
- package/dist/cjs/modal-title.js +5 -0
- package/dist/cjs/modal-wrapper.js +6 -1
- package/dist/es2019/internal/components/modal-dialog.js +12 -2
- package/dist/es2019/internal/components/positioner.js +11 -0
- package/dist/es2019/internal/components/scroll-container.js +7 -0
- package/dist/es2019/modal-body.js +7 -2
- package/dist/es2019/modal-footer.js +6 -0
- package/dist/es2019/modal-header.js +7 -0
- package/dist/es2019/modal-title.js +4 -0
- package/dist/es2019/modal-wrapper.js +6 -1
- package/dist/esm/internal/components/modal-dialog.js +11 -1
- package/dist/esm/internal/components/positioner.js +11 -0
- package/dist/esm/internal/components/scroll-container.js +7 -0
- package/dist/esm/modal-body.js +7 -2
- package/dist/esm/modal-footer.js +6 -0
- package/dist/esm/modal-header.js +7 -0
- package/dist/esm/modal-title.js +4 -0
- package/dist/esm/modal-wrapper.js +6 -1
- package/dist/types/internal/components/positioner.d.ts +3 -0
- package/dist/types/internal/components/scroll-container.d.ts +3 -0
- package/dist/types/internal/hooks/use-modal-stack.d.ts +1 -1
- package/dist/types/modal-body.d.ts +3 -0
- package/dist/types/modal-footer.d.ts +3 -0
- package/dist/types/modal-header.d.ts +3 -0
- package/dist/types/modal-title.d.ts +3 -0
- package/dist/types/modal-wrapper.d.ts +3 -0
- package/dist/types-ts4.5/internal/components/positioner.d.ts +3 -0
- package/dist/types-ts4.5/internal/components/scroll-container.d.ts +3 -0
- package/dist/types-ts4.5/internal/hooks/use-modal-stack.d.ts +1 -1
- package/dist/types-ts4.5/modal-body.d.ts +3 -0
- package/dist/types-ts4.5/modal-footer.d.ts +3 -0
- package/dist/types-ts4.5/modal-header.d.ts +3 -0
- package/dist/types-ts4.5/modal-title.d.ts +3 -0
- package/dist/types-ts4.5/modal-wrapper.d.ts +3 -0
- package/extract-react-types/modal-attributes.tsx +1 -1
- package/package.json +149 -149
- package/report.api.md +38 -45
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/modal-dialog
|
|
2
2
|
|
|
3
|
+
## 12.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#110670](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110670)
|
|
8
|
+
[`c733254a2dd6e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c733254a2dd6e) -
|
|
9
|
+
Explicitly set jsxRuntime to classic via pragma comments in order to avoid issues where jsxRuntime
|
|
10
|
+
is implicitly set to automatic.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 12.13.5
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -42,7 +55,7 @@
|
|
|
42
55
|
|
|
43
56
|
- [#93686](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/93686)
|
|
44
57
|
[`acf6d58fc241`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/acf6d58fc241) -
|
|
45
|
-
Add support for React 18.
|
|
58
|
+
Add support for React 18 in non-strict mode.
|
|
46
59
|
|
|
47
60
|
### Patch Changes
|
|
48
61
|
|
package/README.md
CHANGED
package/__perf__/default.tsx
CHANGED
|
@@ -2,43 +2,37 @@ import React, { useState } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import Button from '@atlaskit/button/new';
|
|
4
4
|
|
|
5
|
-
import Modal, {
|
|
6
|
-
ModalBody,
|
|
7
|
-
ModalFooter,
|
|
8
|
-
ModalHeader,
|
|
9
|
-
ModalTitle,
|
|
10
|
-
ModalTransition,
|
|
11
|
-
} from '../src';
|
|
5
|
+
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '../src';
|
|
12
6
|
|
|
13
7
|
export default function Example() {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
9
|
+
const close = () => setIsOpen(false);
|
|
10
|
+
const open = () => setIsOpen(true);
|
|
17
11
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<button onClick={open} type="button">
|
|
15
|
+
open modal
|
|
16
|
+
</button>
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
18
|
+
<ModalTransition>
|
|
19
|
+
{isOpen && (
|
|
20
|
+
<Modal onClose={close}>
|
|
21
|
+
<ModalHeader>
|
|
22
|
+
<ModalTitle>Modal title</ModalTitle>
|
|
23
|
+
</ModalHeader>
|
|
24
|
+
<ModalBody>A simple Modal</ModalBody>
|
|
25
|
+
<ModalFooter>
|
|
26
|
+
<Button testId="primary" appearance="primary" onClick={close}>
|
|
27
|
+
Close
|
|
28
|
+
</Button>
|
|
29
|
+
<Button testId="secondary" appearance="subtle">
|
|
30
|
+
Secondary Action
|
|
31
|
+
</Button>
|
|
32
|
+
</ModalFooter>
|
|
33
|
+
</Modal>
|
|
34
|
+
)}
|
|
35
|
+
</ModalTransition>
|
|
36
|
+
</>
|
|
37
|
+
);
|
|
44
38
|
}
|
|
@@ -1,136 +1,115 @@
|
|
|
1
1
|
import React, { useCallback, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { findByText, fireEvent } from '@testing-library/dom';
|
|
4
|
-
import {
|
|
5
|
-
type InteractionTaskArgs,
|
|
6
|
-
type PublicInteractionTask,
|
|
7
|
-
} from 'storybook-addon-performance';
|
|
4
|
+
import { type InteractionTaskArgs, type PublicInteractionTask } from 'storybook-addon-performance';
|
|
8
5
|
|
|
9
6
|
import Button from '@atlaskit/button/new';
|
|
10
7
|
|
|
11
|
-
import Modal, {
|
|
12
|
-
ModalBody,
|
|
13
|
-
ModalFooter,
|
|
14
|
-
ModalHeader,
|
|
15
|
-
ModalTitle,
|
|
16
|
-
ModalTransition,
|
|
17
|
-
} from '../src';
|
|
8
|
+
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '../src';
|
|
18
9
|
|
|
19
10
|
const modalText = (index: number) => `Hello, world (${index})`;
|
|
20
11
|
const closeText = (index: number) => `Close (${index})`;
|
|
21
12
|
const openText = (index: number) => `Open (${index})`;
|
|
22
13
|
|
|
23
14
|
const InteractionPerformance = ({ index = 0 }: { index?: number }) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
16
|
+
const open = useCallback(() => setIsOpen(true), []);
|
|
17
|
+
const close = useCallback(() => setIsOpen(false), []);
|
|
27
18
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
return (
|
|
20
|
+
<>
|
|
21
|
+
<button data-testid="open-button" onClick={open} type="button">
|
|
22
|
+
{openText(index)}
|
|
23
|
+
</button>
|
|
33
24
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
25
|
+
<ModalTransition>
|
|
26
|
+
{isOpen && (
|
|
27
|
+
<Modal onClose={close}>
|
|
28
|
+
<ModalHeader>
|
|
29
|
+
<ModalTitle>Modal dialog</ModalTitle>
|
|
30
|
+
</ModalHeader>
|
|
31
|
+
<ModalBody>
|
|
32
|
+
{modalText(index)}
|
|
33
|
+
<InteractionPerformance index={index + 1} />
|
|
34
|
+
</ModalBody>
|
|
35
|
+
<ModalFooter>
|
|
36
|
+
<Button testId="primary" appearance="primary" onClick={close}>
|
|
37
|
+
{closeText(index)}
|
|
38
|
+
</Button>
|
|
39
|
+
</ModalFooter>
|
|
40
|
+
</Modal>
|
|
41
|
+
)}
|
|
42
|
+
</ModalTransition>
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
54
45
|
};
|
|
55
46
|
|
|
56
47
|
const interactionTasks: PublicInteractionTask[] = [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
controls,
|
|
63
|
-
}: InteractionTaskArgs): Promise<void> => {
|
|
64
|
-
const openButton = await findByText(container, openText(0));
|
|
48
|
+
{
|
|
49
|
+
name: 'Open first',
|
|
50
|
+
description: 'Opens the modal dialog',
|
|
51
|
+
run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
|
|
52
|
+
const openButton = await findByText(container, openText(0));
|
|
65
53
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}: InteractionTaskArgs): Promise<void> => {
|
|
79
|
-
const openButton = await findByText(container, openText(0));
|
|
80
|
-
fireEvent.click(openButton);
|
|
54
|
+
await controls.time(async () => {
|
|
55
|
+
fireEvent.click(openButton);
|
|
56
|
+
await findByText(document.body, modalText(0));
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'Close first',
|
|
62
|
+
description: 'Closes the modal dialog',
|
|
63
|
+
run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
|
|
64
|
+
const openButton = await findByText(container, openText(0));
|
|
65
|
+
fireEvent.click(openButton);
|
|
81
66
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
fireEvent.click(openButton);
|
|
97
|
-
await findByText(document.body, modalText(0));
|
|
98
|
-
const secondOpenButton = await findByText(document.body, openText(1));
|
|
67
|
+
await controls.time(async () => {
|
|
68
|
+
const closeButton = await findByText(document.body, closeText(0));
|
|
69
|
+
fireEvent.click(closeButton);
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'Open second',
|
|
75
|
+
description: 'Opens the a second modal',
|
|
76
|
+
run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
|
|
77
|
+
const openButton = await findByText(container, openText(0));
|
|
78
|
+
fireEvent.click(openButton);
|
|
79
|
+
await findByText(document.body, modalText(0));
|
|
80
|
+
const secondOpenButton = await findByText(document.body, openText(1));
|
|
99
81
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const secondOpenButton = await findByText(document.body, openText(1));
|
|
117
|
-
fireEvent.click(secondOpenButton);
|
|
118
|
-
await findByText(document.body, modalText(1));
|
|
82
|
+
await controls.time(async () => {
|
|
83
|
+
fireEvent.click(secondOpenButton);
|
|
84
|
+
await findByText(document.body, modalText(1));
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'Close second',
|
|
90
|
+
description: 'Closes the a second modal',
|
|
91
|
+
run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
|
|
92
|
+
const openButton = await findByText(container, openText(0));
|
|
93
|
+
fireEvent.click(openButton);
|
|
94
|
+
await findByText(document.body, modalText(0));
|
|
95
|
+
const secondOpenButton = await findByText(document.body, openText(1));
|
|
96
|
+
fireEvent.click(secondOpenButton);
|
|
97
|
+
await findByText(document.body, modalText(1));
|
|
119
98
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
99
|
+
await controls.time(async () => {
|
|
100
|
+
const closeButton = await findByText(document.body, closeText(1));
|
|
101
|
+
fireEvent.click(closeButton);
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
},
|
|
126
105
|
];
|
|
127
106
|
|
|
128
107
|
InteractionPerformance.story = {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
108
|
+
parameters: {
|
|
109
|
+
performance: {
|
|
110
|
+
interactions: interactionTasks,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
134
113
|
};
|
|
135
114
|
|
|
136
115
|
export default InteractionPerformance;
|
package/__perf__/scroll.tsx
CHANGED
|
@@ -2,97 +2,80 @@ import React, { useCallback, useRef, useState } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { findByTestId, findByText, fireEvent } from '@testing-library/dom';
|
|
4
4
|
import Lorem from 'react-lorem-component';
|
|
5
|
-
import {
|
|
6
|
-
type InteractionTaskArgs,
|
|
7
|
-
type PublicInteractionTask,
|
|
8
|
-
} from 'storybook-addon-performance';
|
|
5
|
+
import { type InteractionTaskArgs, type PublicInteractionTask } from 'storybook-addon-performance';
|
|
9
6
|
|
|
10
7
|
import Button from '@atlaskit/button/new';
|
|
11
8
|
|
|
12
|
-
import Modal, {
|
|
13
|
-
ModalBody,
|
|
14
|
-
ModalFooter,
|
|
15
|
-
ModalHeader,
|
|
16
|
-
ModalTitle,
|
|
17
|
-
ModalTransition,
|
|
18
|
-
} from '../src';
|
|
9
|
+
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '../src';
|
|
19
10
|
|
|
20
11
|
const openText = 'Open modal';
|
|
21
12
|
const closeText = 'Close';
|
|
22
13
|
const scrollToBottomText = 'Scroll to bottom';
|
|
23
14
|
|
|
24
15
|
const ScrollPerformance = () => {
|
|
25
|
-
|
|
16
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
26
17
|
|
|
27
|
-
|
|
18
|
+
const bottomRef = useRef<HTMLDivElement>(null);
|
|
28
19
|
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
const open = useCallback(() => setIsOpen(true), []);
|
|
21
|
+
const close = useCallback(() => setIsOpen(false), []);
|
|
31
22
|
|
|
32
|
-
|
|
33
|
-
bottomRef.current && bottomRef.current.scrollIntoView(true);
|
|
23
|
+
const scrollToBottom = () => bottomRef.current && bottomRef.current.scrollIntoView(true);
|
|
34
24
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
return (
|
|
26
|
+
<>
|
|
27
|
+
<button data-testid="open" onClick={open} type="button">
|
|
28
|
+
{openText}
|
|
29
|
+
</button>
|
|
40
30
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
)}
|
|
65
|
-
</ModalTransition>
|
|
66
|
-
</>
|
|
67
|
-
);
|
|
31
|
+
<ModalTransition>
|
|
32
|
+
{isOpen && (
|
|
33
|
+
<Modal onClose={close} testId="modal">
|
|
34
|
+
<ModalHeader>
|
|
35
|
+
<ModalTitle>Modal dialog</ModalTitle>
|
|
36
|
+
</ModalHeader>
|
|
37
|
+
<ModalBody>
|
|
38
|
+
<Lorem count={10} />
|
|
39
|
+
<div ref={bottomRef} />
|
|
40
|
+
</ModalBody>
|
|
41
|
+
<ModalFooter>
|
|
42
|
+
<Button testId="close" appearance="primary" onClick={close}>
|
|
43
|
+
{closeText}
|
|
44
|
+
</Button>
|
|
45
|
+
<Button testId="scroll-to-bottom" appearance="subtle" onClick={scrollToBottom}>
|
|
46
|
+
{scrollToBottomText}
|
|
47
|
+
</Button>
|
|
48
|
+
</ModalFooter>
|
|
49
|
+
</Modal>
|
|
50
|
+
)}
|
|
51
|
+
</ModalTransition>
|
|
52
|
+
</>
|
|
53
|
+
);
|
|
68
54
|
};
|
|
69
55
|
|
|
70
56
|
const interactionTasks: PublicInteractionTask[] = [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}: InteractionTaskArgs): Promise<void> => {
|
|
78
|
-
const openButton = await findByText(container, openText);
|
|
79
|
-
fireEvent.click(openButton);
|
|
57
|
+
{
|
|
58
|
+
name: 'Scroll to bottom',
|
|
59
|
+
description: 'Opens the modal dialog',
|
|
60
|
+
run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
|
|
61
|
+
const openButton = await findByText(container, openText);
|
|
62
|
+
fireEvent.click(openButton);
|
|
80
63
|
|
|
81
|
-
|
|
64
|
+
const content = await findByTestId(document.body, 'modal--scrollable');
|
|
82
65
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
66
|
+
await controls.time(async () => {
|
|
67
|
+
content.scrollTo(0, content.scrollHeight);
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
},
|
|
88
71
|
];
|
|
89
72
|
|
|
90
73
|
ScrollPerformance.story = {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
74
|
+
parameters: {
|
|
75
|
+
performance: {
|
|
76
|
+
interactions: interactionTasks,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
96
79
|
};
|
|
97
80
|
|
|
98
81
|
export default ScrollPerformance;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { type JSCodeshift } from 'jscodeshift';
|
|
2
2
|
import { type Collection } from 'jscodeshift/src/Collection';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
createTransformer,
|
|
6
|
-
hasImportDeclaration,
|
|
7
|
-
} from '@atlaskit/codemod-utils';
|
|
4
|
+
import { createTransformer, hasImportDeclaration } from '@atlaskit/codemod-utils';
|
|
8
5
|
|
|
9
6
|
import { handlePropSpread } from './migrations/handle-prop-spread';
|
|
10
7
|
import { inlineWidthNamesDeclaration } from './migrations/inline-width-names-declaration';
|
|
@@ -28,24 +25,24 @@ import { renameScrollBehaviorToShouldScrollInViewport } from './migrations/renam
|
|
|
28
25
|
* after the other migrations.
|
|
29
26
|
*/
|
|
30
27
|
const transformer = createTransformer(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
28
|
+
[
|
|
29
|
+
mapBodyFromProps,
|
|
30
|
+
mapHeaderFromProps,
|
|
31
|
+
mapFooterFromProps,
|
|
32
|
+
renameScrollBehaviorToShouldScrollInViewport,
|
|
33
|
+
renameAppearanceType,
|
|
34
|
+
renameInnerComponentPropTypes,
|
|
35
|
+
inlineWidthNamesDeclaration,
|
|
36
|
+
mapHeadingPropToModalTitle,
|
|
37
|
+
mapActionsProp,
|
|
38
|
+
mapContainerFromProps,
|
|
39
|
+
removeComponentOverrideProps,
|
|
40
|
+
removeAppearanceProp,
|
|
41
|
+
removeIsChromeless,
|
|
42
|
+
handlePropSpread,
|
|
43
|
+
],
|
|
44
|
+
(j: JSCodeshift, source: Collection<Node>) =>
|
|
45
|
+
hasImportDeclaration(j, source, '@atlaskit/modal-dialog'),
|
|
49
46
|
);
|
|
50
47
|
|
|
51
48
|
export default transformer;
|