@atlaskit/inline-edit 13.4.1 → 13.5.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 +10 -10
- package/__perf__/inline-edit.tsx +31 -36
- package/__perf__/inline-text-field.tsx +9 -9
- package/codemods/12.0.0-lite-mode.ts +4 -4
- package/codemods/__tests__/12.0.0-lite-mode.tsx +21 -21
- package/codemods/__tests__/add-comments-when-validate-found.ts +14 -14
- package/codemods/__tests__/lift-InlineEditStateless-to-default.ts +35 -35
- package/codemods/__tests__/lift-InlineEditableTextField-to-its-entry-point.tsx +21 -21
- package/codemods/__tests__/spread-errorMessage-out-of-fieldProps.tsx +28 -28
- package/codemods/migrates/add-comments-when-validate-found.ts +13 -23
- package/codemods/migrates/lift-InlineEditStateless-to-default.ts +43 -57
- package/codemods/migrates/lift-InlineEditableTextField-to-its-entry-point.ts +29 -42
- package/codemods/migrates/spread-errorMessage-out-of-fieldProps.ts +45 -63
- package/codemods/migrates/utils.ts +62 -70
- package/dist/cjs/inline-edit.js +4 -2
- package/dist/cjs/inline-editable-textfield.js +8 -1
- package/dist/cjs/internal/buttons.js +10 -3
- package/dist/cjs/internal/read-view.js +6 -0
- package/dist/es2019/inline-edit.js +6 -1
- package/dist/es2019/inline-editable-textfield.js +9 -1
- package/dist/es2019/internal/buttons.js +9 -3
- package/dist/es2019/internal/read-view.js +6 -0
- package/dist/esm/inline-edit.js +6 -1
- package/dist/esm/inline-editable-textfield.js +9 -1
- package/dist/esm/internal/buttons.js +9 -3
- package/dist/esm/internal/read-view.js +6 -0
- package/dist/types/internal/buttons.d.ts +3 -0
- package/dist/types/internal/read-view.d.ts +3 -0
- package/dist/types/types.d.ts +2 -2
- package/dist/types-ts4.5/internal/buttons.d.ts +3 -0
- package/dist/types-ts4.5/internal/read-view.d.ts +3 -0
- package/dist/types-ts4.5/types.d.ts +2 -2
- package/extract-react-types/inline-editable-textfield-props.tsx +2 -4
- package/package.json +109 -109
- package/report.api.md +32 -37
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/inline-edit
|
|
2
2
|
|
|
3
|
+
## 13.5.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
|
## 13.4.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -12,7 +25,7 @@
|
|
|
12
25
|
|
|
13
26
|
- [#104208](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/104208)
|
|
14
27
|
[`0d4480895db7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0d4480895db7) -
|
|
15
|
-
Add support for React 18.
|
|
28
|
+
Add support for React 18 in non-strict mode.
|
|
16
29
|
|
|
17
30
|
## 13.3.0
|
|
18
31
|
|
package/README.md
CHANGED
|
@@ -8,4 +8,5 @@ yarn add @atlaskit/inline-edit
|
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
|
-
Detailed docs and example usage can be found
|
|
11
|
+
Detailed docs and example usage can be found
|
|
12
|
+
[here](https://atlaskit.atlassian.com/packages/core/inline-edit).
|
package/__perf__/default.tsx
CHANGED
|
@@ -5,14 +5,14 @@ import Textfield from '@atlaskit/textfield';
|
|
|
5
5
|
import InlineEdit from '../src';
|
|
6
6
|
|
|
7
7
|
export default () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
const [editValue, setEditValue] = useState('Field value');
|
|
9
|
+
return (
|
|
10
|
+
<InlineEdit
|
|
11
|
+
defaultValue={editValue}
|
|
12
|
+
label="Inline edit"
|
|
13
|
+
editView={(fieldProps) => <Textfield {...fieldProps} autoFocus />}
|
|
14
|
+
readView={() => <div>{editValue || 'Click to enter value'}</div>}
|
|
15
|
+
onConfirm={(value) => setEditValue(value)}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
18
|
};
|
package/__perf__/inline-edit.tsx
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { 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 { type FieldProps } from '@atlaskit/form';
|
|
10
7
|
import Textfield from '@atlaskit/textfield';
|
|
@@ -12,44 +9,42 @@ import Textfield from '@atlaskit/textfield';
|
|
|
12
9
|
import InlineEdit from '../src';
|
|
13
10
|
|
|
14
11
|
const InlineEditExample = () => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
12
|
+
const [editValue, setEditValue] = useState('Field value');
|
|
13
|
+
const renderEditView = (fieldProps: FieldProps<any>) => <Textfield {...fieldProps} autoFocus />;
|
|
14
|
+
const renderReadView = () => (
|
|
15
|
+
<div data-testid="read-view">{editValue || 'Click to enter value'}</div>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<InlineEdit
|
|
20
|
+
defaultValue={editValue}
|
|
21
|
+
label="Inline edit"
|
|
22
|
+
editView={renderEditView}
|
|
23
|
+
readView={renderReadView}
|
|
24
|
+
onConfirm={setEditValue}
|
|
25
|
+
validate={() => {}}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
33
28
|
};
|
|
34
29
|
|
|
35
30
|
const interactionTasks: PublicInteractionTask[] = [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
{
|
|
32
|
+
name: 'Change inline edit status',
|
|
33
|
+
description: 'Activate on input',
|
|
34
|
+
run: async ({ container }: InteractionTaskArgs): Promise<void> => {
|
|
35
|
+
const readView = container.querySelector('[data-testid="read-view"]');
|
|
36
|
+
fireEvent.click(readView!);
|
|
37
|
+
},
|
|
38
|
+
},
|
|
44
39
|
];
|
|
45
40
|
|
|
46
41
|
InlineEditExample.story = {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
name: 'InlineEdit Component',
|
|
43
|
+
parameters: {
|
|
44
|
+
performance: {
|
|
45
|
+
interactions: interactionTasks,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
53
48
|
};
|
|
54
49
|
|
|
55
50
|
export default InlineEditExample;
|
|
@@ -3,14 +3,14 @@ import React, { useState } from 'react';
|
|
|
3
3
|
import { InlineEditableTextfield } from '../src';
|
|
4
4
|
|
|
5
5
|
export default () => {
|
|
6
|
-
|
|
6
|
+
const [editValue, setEditValue] = useState('Field value');
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
return (
|
|
9
|
+
<InlineEditableTextfield
|
|
10
|
+
defaultValue={editValue}
|
|
11
|
+
label="Inline editable textfield"
|
|
12
|
+
onConfirm={(value) => setEditValue(value)}
|
|
13
|
+
placeholder="Click to enter text"
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
16
|
};
|
|
@@ -6,10 +6,10 @@ import elevateComponentToDefault from './migrates/lift-InlineEditStateless-to-de
|
|
|
6
6
|
import spreadErrorMessage from './migrates/spread-errorMessage-out-of-fieldProps';
|
|
7
7
|
|
|
8
8
|
const transformer = createTransformer([
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
addCommentsWhenValidateFound,
|
|
10
|
+
liftInlineEditableTextField,
|
|
11
|
+
elevateComponentToDefault,
|
|
12
|
+
spreadErrorMessage,
|
|
13
13
|
]);
|
|
14
14
|
|
|
15
15
|
export default transformer;
|
|
@@ -3,10 +3,10 @@ import transformer from '../12.0.0-lite-mode';
|
|
|
3
3
|
const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
|
|
4
4
|
|
|
5
5
|
describe('apply all transforms', () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
defineInlineTest(
|
|
7
|
+
{ default: transformer, parser: 'tsx' },
|
|
8
|
+
{},
|
|
9
|
+
`
|
|
10
10
|
import React from "react";
|
|
11
11
|
import InlineEdit, {InlineEditableTextfield} from "@atlaskit/inline-edit";
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ describe('apply all transforms', () => {
|
|
|
20
20
|
</Container>
|
|
21
21
|
);
|
|
22
22
|
`,
|
|
23
|
-
|
|
23
|
+
`
|
|
24
24
|
/* TODO: (from codemod) We could not automatically convert this code to the new API.
|
|
25
25
|
|
|
26
26
|
This file uses \`inline-edit\`’s \`validate\` prop which previously would use \`react-loadable\` and the \`inline-dialog\` packages. Version 12.0.0 of \`inline-edit\` now no longer includes these dependencies out of the box and instead allows you to compose your own experience.
|
|
@@ -63,13 +63,13 @@ describe('apply all transforms', () => {
|
|
|
63
63
|
</Container>
|
|
64
64
|
);
|
|
65
65
|
`,
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
'should switch InlineEditableTextfield to a new entrypoint with default import',
|
|
67
|
+
);
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
defineInlineTest(
|
|
70
|
+
{ default: transformer, parser: 'tsx' },
|
|
71
|
+
{},
|
|
72
|
+
`
|
|
73
73
|
import React, { PureComponent } from "react";
|
|
74
74
|
import InlineEdit from "@atlaskit/inline-edit";
|
|
75
75
|
import TextField from "@atlaskit/textfield";
|
|
@@ -163,7 +163,7 @@ describe('apply all transforms', () => {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
`,
|
|
166
|
-
|
|
166
|
+
`
|
|
167
167
|
/* TODO: (from codemod) We could not automatically convert this code to the new API.
|
|
168
168
|
|
|
169
169
|
This file uses \`inline-edit\`’s \`validate\` prop which previously would use \`react-loadable\` and the \`inline-dialog\` packages. Version 12.0.0 of \`inline-edit\` now no longer includes these dependencies out of the box and instead allows you to compose your own experience.
|
|
@@ -280,13 +280,13 @@ describe('apply all transforms', () => {
|
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
`,
|
|
283
|
-
|
|
284
|
-
|
|
283
|
+
'ColumnEditableTitle - add comment when editView is not inline and validate is passed',
|
|
284
|
+
);
|
|
285
285
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
286
|
+
defineInlineTest(
|
|
287
|
+
{ default: transformer, parser: 'tsx' },
|
|
288
|
+
{},
|
|
289
|
+
`
|
|
290
290
|
import React from "react";
|
|
291
291
|
import InlineEdit from "@atlaskit/inline-edit";
|
|
292
292
|
|
|
@@ -343,7 +343,7 @@ describe('apply all transforms', () => {
|
|
|
343
343
|
</InlineEditOffsetContainer>
|
|
344
344
|
);
|
|
345
345
|
`,
|
|
346
|
-
|
|
346
|
+
`
|
|
347
347
|
import React from "react";
|
|
348
348
|
import InlineEdit from "@atlaskit/inline-edit";
|
|
349
349
|
|
|
@@ -400,6 +400,6 @@ describe('apply all transforms', () => {
|
|
|
400
400
|
</InlineEditOffsetContainer>
|
|
401
401
|
);
|
|
402
402
|
`,
|
|
403
|
-
|
|
404
|
-
|
|
403
|
+
'should do nothing for editView is something other than arrow function',
|
|
404
|
+
);
|
|
405
405
|
});
|
|
@@ -7,10 +7,10 @@ const transformer = createTransformer([addCommentsWhenValidateFound]);
|
|
|
7
7
|
const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
|
|
8
8
|
|
|
9
9
|
describe('wrapEditViewWithInlineDialog prop', () => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
defineInlineTest(
|
|
11
|
+
{ default: transformer, parser: 'tsx' },
|
|
12
|
+
{},
|
|
13
|
+
`
|
|
14
14
|
import React from "react";
|
|
15
15
|
import InlineEdit from "@atlaskit/inline-edit";
|
|
16
16
|
|
|
@@ -28,7 +28,7 @@ describe('wrapEditViewWithInlineDialog prop', () => {
|
|
|
28
28
|
/>
|
|
29
29
|
);
|
|
30
30
|
`,
|
|
31
|
-
|
|
31
|
+
`
|
|
32
32
|
import React from "react";
|
|
33
33
|
import InlineEdit from "@atlaskit/inline-edit";
|
|
34
34
|
|
|
@@ -46,13 +46,13 @@ describe('wrapEditViewWithInlineDialog prop', () => {
|
|
|
46
46
|
/>
|
|
47
47
|
);
|
|
48
48
|
`,
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
'should not do anything particular',
|
|
50
|
+
);
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
defineInlineTest(
|
|
53
|
+
{ default: transformer, parser: 'tsx' },
|
|
54
|
+
{},
|
|
55
|
+
`
|
|
56
56
|
import React from "react";
|
|
57
57
|
import InlineEdit from "@atlaskit/inline-edit";
|
|
58
58
|
|
|
@@ -71,7 +71,7 @@ describe('wrapEditViewWithInlineDialog prop', () => {
|
|
|
71
71
|
/>
|
|
72
72
|
);
|
|
73
73
|
`,
|
|
74
|
-
|
|
74
|
+
`
|
|
75
75
|
/* TODO: (from codemod) We could not automatically convert this code to the new API.
|
|
76
76
|
|
|
77
77
|
This file uses \`inline-edit\`’s \`validate\` prop which previously would use \`react-loadable\` and the \`inline-dialog\` packages. Version 12.0.0 of \`inline-edit\` now no longer includes these dependencies out of the box and instead allows you to compose your own experience.
|
|
@@ -113,6 +113,6 @@ describe('wrapEditViewWithInlineDialog prop', () => {
|
|
|
113
113
|
/>
|
|
114
114
|
);
|
|
115
115
|
`,
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
'add comment when validate function is defined',
|
|
117
|
+
);
|
|
118
118
|
});
|
|
@@ -7,10 +7,10 @@ const transformer = createTransformer([liftInlineEditStatelessToDefault]);
|
|
|
7
7
|
const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
|
|
8
8
|
|
|
9
9
|
describe('lift InlineEditStateless to default', () => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
defineInlineTest(
|
|
11
|
+
{ default: transformer, parser: 'tsx' },
|
|
12
|
+
{},
|
|
13
|
+
`
|
|
14
14
|
import React from "react";
|
|
15
15
|
import { InlineEditableTextfield } from "@atlaskit/inline-edit";
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ describe('lift InlineEditStateless to default', () => {
|
|
|
18
18
|
<InlineEditableTextfield />
|
|
19
19
|
);
|
|
20
20
|
`,
|
|
21
|
-
|
|
21
|
+
`
|
|
22
22
|
import React from "react";
|
|
23
23
|
import { InlineEditableTextfield } from "@atlaskit/inline-edit";
|
|
24
24
|
|
|
@@ -26,13 +26,13 @@ describe('lift InlineEditStateless to default', () => {
|
|
|
26
26
|
<InlineEditableTextfield />
|
|
27
27
|
);
|
|
28
28
|
`,
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
'should not do anything other than stateless',
|
|
30
|
+
);
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
defineInlineTest(
|
|
33
|
+
{ default: transformer, parser: 'tsx' },
|
|
34
|
+
{},
|
|
35
|
+
`
|
|
36
36
|
import React from "react";
|
|
37
37
|
import { InlineEditStateless } from "@atlaskit/inline-edit";
|
|
38
38
|
|
|
@@ -40,7 +40,7 @@ describe('lift InlineEditStateless to default', () => {
|
|
|
40
40
|
<InlineEditStateless />
|
|
41
41
|
);
|
|
42
42
|
`,
|
|
43
|
-
|
|
43
|
+
`
|
|
44
44
|
import React from "react";
|
|
45
45
|
import InlineEditStateless from "@atlaskit/inline-edit";
|
|
46
46
|
|
|
@@ -48,13 +48,13 @@ describe('lift InlineEditStateless to default', () => {
|
|
|
48
48
|
<InlineEditStateless />
|
|
49
49
|
);
|
|
50
50
|
`,
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
'should lift the stateless to default',
|
|
52
|
+
);
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
defineInlineTest(
|
|
55
|
+
{ default: transformer, parser: 'tsx' },
|
|
56
|
+
{},
|
|
57
|
+
`
|
|
58
58
|
import React from "react";
|
|
59
59
|
import { InlineEditStateless as InlineEdit } from "@atlaskit/inline-edit";
|
|
60
60
|
|
|
@@ -62,7 +62,7 @@ describe('lift InlineEditStateless to default', () => {
|
|
|
62
62
|
<InlineEdit />
|
|
63
63
|
);
|
|
64
64
|
`,
|
|
65
|
-
|
|
65
|
+
`
|
|
66
66
|
import React from "react";
|
|
67
67
|
import InlineEdit from "@atlaskit/inline-edit";
|
|
68
68
|
|
|
@@ -70,13 +70,13 @@ describe('lift InlineEditStateless to default', () => {
|
|
|
70
70
|
<InlineEdit />
|
|
71
71
|
);
|
|
72
72
|
`,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
'should lift the stateless to default with alias',
|
|
74
|
+
);
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
defineInlineTest(
|
|
77
|
+
{ default: transformer, parser: 'tsx' },
|
|
78
|
+
{},
|
|
79
|
+
`
|
|
80
80
|
import React from "react";
|
|
81
81
|
import { InlineEditableTextfield as InlineEdit } from "@atlaskit/inline-edit";
|
|
82
82
|
|
|
@@ -84,7 +84,7 @@ describe('lift InlineEditStateless to default', () => {
|
|
|
84
84
|
<InlineEdit />
|
|
85
85
|
);
|
|
86
86
|
`,
|
|
87
|
-
|
|
87
|
+
`
|
|
88
88
|
import React from "react";
|
|
89
89
|
import { InlineEditableTextfield as InlineEdit } from "@atlaskit/inline-edit";
|
|
90
90
|
|
|
@@ -92,13 +92,13 @@ describe('lift InlineEditStateless to default', () => {
|
|
|
92
92
|
<InlineEdit />
|
|
93
93
|
);
|
|
94
94
|
`,
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
'should not lift the InlineEditableTextfield to default with alias',
|
|
96
|
+
);
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
defineInlineTest(
|
|
99
|
+
{ default: transformer, parser: 'tsx' },
|
|
100
|
+
{},
|
|
101
|
+
`
|
|
102
102
|
import React from "react";
|
|
103
103
|
import InlineEdit, { InlineEditStateless } from "@atlaskit/inline-edit";
|
|
104
104
|
|
|
@@ -109,7 +109,7 @@ describe('lift InlineEditStateless to default', () => {
|
|
|
109
109
|
</Container>
|
|
110
110
|
);
|
|
111
111
|
`,
|
|
112
|
-
|
|
112
|
+
`
|
|
113
113
|
/* TODO: (from codemod) We could not automatically convert this code to the new API.
|
|
114
114
|
|
|
115
115
|
This file uses \`InlineEdit\` and \`InlineEditStateless\` at the same time. We've merged these two types since version 12.0.0, and please use the merged version instead.
|
|
@@ -124,6 +124,6 @@ describe('lift InlineEditStateless to default', () => {
|
|
|
124
124
|
</Container>
|
|
125
125
|
);
|
|
126
126
|
`,
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
'should add comments when cannot convert',
|
|
128
|
+
);
|
|
129
129
|
});
|
|
@@ -7,10 +7,10 @@ const transformer = createTransformer([liftInlineEditableTextField]);
|
|
|
7
7
|
const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
|
|
8
8
|
|
|
9
9
|
describe('lift InlineEditableTextField to its own entry point', () => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
defineInlineTest(
|
|
11
|
+
{ default: transformer, parser: 'tsx' },
|
|
12
|
+
{},
|
|
13
|
+
`
|
|
14
14
|
import React from "react";
|
|
15
15
|
import {InlineEditableTextfield} from "@atlaskit/inline-edit";
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ describe('lift InlineEditableTextField to its own entry point', () => {
|
|
|
18
18
|
<InlineEditableTextfield />
|
|
19
19
|
);
|
|
20
20
|
`,
|
|
21
|
-
|
|
21
|
+
`
|
|
22
22
|
import React from "react";
|
|
23
23
|
import InlineEditableTextfield from "@atlaskit/inline-edit/inline-editable-textfield";
|
|
24
24
|
|
|
@@ -26,13 +26,13 @@ describe('lift InlineEditableTextField to its own entry point', () => {
|
|
|
26
26
|
<InlineEditableTextfield />
|
|
27
27
|
);
|
|
28
28
|
`,
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
'should switch InlineEditableTextfield to a new entrypoint',
|
|
30
|
+
);
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
defineInlineTest(
|
|
33
|
+
{ default: transformer, parser: 'tsx' },
|
|
34
|
+
{},
|
|
35
|
+
`
|
|
36
36
|
import React from "react";
|
|
37
37
|
import { InlineEditStateless } from "@atlaskit/inline-edit";
|
|
38
38
|
|
|
@@ -40,7 +40,7 @@ describe('lift InlineEditableTextField to its own entry point', () => {
|
|
|
40
40
|
<InlineEditableTextfield />
|
|
41
41
|
);
|
|
42
42
|
`,
|
|
43
|
-
|
|
43
|
+
`
|
|
44
44
|
import React from "react";
|
|
45
45
|
import { InlineEditStateless } from "@atlaskit/inline-edit";
|
|
46
46
|
|
|
@@ -48,13 +48,13 @@ describe('lift InlineEditableTextField to its own entry point', () => {
|
|
|
48
48
|
<InlineEditableTextfield />
|
|
49
49
|
);
|
|
50
50
|
`,
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
'should not do it to other things',
|
|
52
|
+
);
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
defineInlineTest(
|
|
55
|
+
{ default: transformer, parser: 'tsx' },
|
|
56
|
+
{},
|
|
57
|
+
`
|
|
58
58
|
import React from "react";
|
|
59
59
|
import InlineEdit, {InlineEditableTextfield} from "@atlaskit/inline-edit";
|
|
60
60
|
|
|
@@ -65,7 +65,7 @@ describe('lift InlineEditableTextField to its own entry point', () => {
|
|
|
65
65
|
</Container>
|
|
66
66
|
);
|
|
67
67
|
`,
|
|
68
|
-
|
|
68
|
+
`
|
|
69
69
|
import React from "react";
|
|
70
70
|
import InlineEditableTextfield from "@atlaskit/inline-edit/inline-editable-textfield";
|
|
71
71
|
import InlineEdit from "@atlaskit/inline-edit";
|
|
@@ -77,6 +77,6 @@ describe('lift InlineEditableTextField to its own entry point', () => {
|
|
|
77
77
|
</Container>
|
|
78
78
|
);
|
|
79
79
|
`,
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
'should switch InlineEditableTextfield to a new entrypoint with default import',
|
|
81
|
+
);
|
|
82
82
|
});
|