@atlaskit/editor-core 193.24.6 → 193.24.15
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/.eslintrc.js +37 -37
- package/CHANGELOG.md +8 -0
- package/architecture/0001-record-architecture-decisions.md +6 -3
- package/architecture/0002-deep-equality-check-for-getsharedstate.md +9 -8
- package/architecture/0003-explicit-plugin-dependencies.md +47 -18
- package/codemods/140.0.0-rc-kraken-fix-type-errors.ts +1 -3
- package/codemods/145.0.0-deprecate-props.ts +1 -3
- package/codemods/172.0.0-transform-smartlinks-prop.ts +1 -3
- package/codemods/175.0.0-rename-unsafe-allowUndoRedoButton-prop.ts +1 -1
- package/codemods/180.1.0-update-to-editor-migration-component.ts +1 -3
- package/codemods/__tests__/next-remove-allow-more-text-colors-prop.ts +29 -31
- package/codemods/__tests__/remove-config-panel-width-prop.ts +29 -31
- package/codemods/__tests__/rename-editor-to-editor-migration-component.ts +43 -45
- package/codemods/__tests__/rename-smartlinks-prop.ts +57 -59
- package/codemods/__tests__/rename-unsafe-allowUndoRedoButtons-prop.ts +43 -43
- package/codemods/__tests__/rename-unsafe-cards-prop.ts +43 -45
- package/codemods/migrates/next-remove-allow-more-text-colors-prop.ts +41 -45
- package/codemods/migrates/remove-config-panel-width-prop.ts +20 -29
- package/codemods/migrates/rename-editor-to-editor-migration-component.ts +20 -24
- package/codemods/migrates/rename-smartlinks-prop.ts +30 -38
- package/codemods/migrates/rename-unsafe-allowUndoRedoButtons-prop.ts +4 -5
- package/codemods/migrates/rename-unsafe-cards-prop.ts +1 -4
- package/codemods/utils.ts +62 -72
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +3 -3
- package/dist/cjs/ui/AppearanceComponents/Mobile.js +5 -5
- package/dist/cjs/ui/ContentStyles/ai-panels.js +1 -1
- package/dist/cjs/ui/ContentStyles/code-block.js +2 -2
- package/dist/cjs/ui/ContentStyles/date.js +1 -1
- package/dist/cjs/ui/ContentStyles/expand.js +1 -1
- package/dist/cjs/ui/ContentStyles/extension.js +2 -2
- package/dist/cjs/ui/ContentStyles/index.js +6 -6
- package/dist/cjs/ui/ContentStyles/layout.js +1 -1
- package/dist/cjs/ui/ContentStyles/media.js +1 -1
- package/dist/cjs/ui/ContentStyles/panel.js +1 -1
- package/dist/cjs/ui/ContentStyles/status.js +1 -1
- package/dist/cjs/ui/ContentStyles/tasks-and-decisions.js +1 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +40 -40
- package/dist/es2019/ui/AppearanceComponents/Mobile.js +5 -5
- package/dist/es2019/ui/ContentStyles/ai-panels.js +80 -80
- package/dist/es2019/ui/ContentStyles/code-block.js +58 -58
- package/dist/es2019/ui/ContentStyles/date.js +19 -19
- package/dist/es2019/ui/ContentStyles/expand.js +98 -98
- package/dist/es2019/ui/ContentStyles/extension.js +154 -159
- package/dist/es2019/ui/ContentStyles/index.js +139 -144
- package/dist/es2019/ui/ContentStyles/layout.js +125 -125
- package/dist/es2019/ui/ContentStyles/media.js +179 -178
- package/dist/es2019/ui/ContentStyles/panel.js +29 -30
- package/dist/es2019/ui/ContentStyles/status.js +30 -32
- package/dist/es2019/ui/ContentStyles/tasks-and-decisions.js +18 -19
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +3 -3
- package/dist/esm/ui/AppearanceComponents/Mobile.js +5 -5
- package/dist/esm/ui/ContentStyles/ai-panels.js +1 -1
- package/dist/esm/ui/ContentStyles/code-block.js +2 -2
- package/dist/esm/ui/ContentStyles/date.js +1 -1
- package/dist/esm/ui/ContentStyles/expand.js +1 -1
- package/dist/esm/ui/ContentStyles/extension.js +2 -2
- package/dist/esm/ui/ContentStyles/index.js +6 -6
- package/dist/esm/ui/ContentStyles/layout.js +1 -1
- package/dist/esm/ui/ContentStyles/media.js +1 -1
- package/dist/esm/ui/ContentStyles/panel.js +1 -1
- package/dist/esm/ui/ContentStyles/status.js +1 -1
- package/dist/esm/ui/ContentStyles/tasks-and-decisions.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/composable-editor/editor.d.ts +1 -1
- package/dist/types/composable-editor/hooks/useProviders.d.ts +1 -1
- package/dist/types/create-editor/create-preset.d.ts +135 -9
- package/dist/types/create-editor/sort-by-order.d.ts +1 -1
- package/dist/types/event-dispatcher/index.d.ts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/presets/default.d.ts +120 -8
- package/dist/types/presets/universal.d.ts +135 -9
- package/dist/types/presets/useUniversalPreset.d.ts +135 -9
- package/dist/types/test-utils.d.ts +1 -1
- package/dist/types/types/browser.d.ts +1 -1
- package/dist/types/types/editor-plugin.d.ts +1 -1
- package/dist/types/types/empty-state-handler.d.ts +1 -1
- package/dist/types/types/feature-flags.d.ts +1 -1
- package/dist/types/types/index.d.ts +3 -3
- package/dist/types/types/pm-config.d.ts +1 -1
- package/dist/types/types/ui-components.d.ts +1 -1
- package/dist/types/ui/Addon/ClickAreaBlock/index.d.ts +1 -1
- package/dist/types/ui/Toolbar/types.d.ts +1 -1
- package/dist/types/utils/action.d.ts +1 -4
- package/dist/types/utils/performance/plugin-performance-report.d.ts +1 -1
- package/dist/types/utils/slice.d.ts +1 -1
- package/dist/types-ts4.5/composable-editor/editor.d.ts +1 -1
- package/dist/types-ts4.5/composable-editor/hooks/useProviders.d.ts +1 -1
- package/dist/types-ts4.5/create-editor/create-preset.d.ts +153 -9
- package/dist/types-ts4.5/create-editor/sort-by-order.d.ts +1 -1
- package/dist/types-ts4.5/event-dispatcher/index.d.ts +2 -2
- package/dist/types-ts4.5/index.d.ts +2 -2
- package/dist/types-ts4.5/presets/default.d.ts +136 -8
- package/dist/types-ts4.5/presets/universal.d.ts +153 -9
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +153 -9
- package/dist/types-ts4.5/test-utils.d.ts +1 -1
- package/dist/types-ts4.5/types/browser.d.ts +1 -1
- package/dist/types-ts4.5/types/editor-plugin.d.ts +1 -1
- package/dist/types-ts4.5/types/empty-state-handler.d.ts +1 -1
- package/dist/types-ts4.5/types/feature-flags.d.ts +1 -1
- package/dist/types-ts4.5/types/index.d.ts +3 -3
- package/dist/types-ts4.5/types/pm-config.d.ts +1 -1
- package/dist/types-ts4.5/types/ui-components.d.ts +1 -1
- package/dist/types-ts4.5/ui/Addon/ClickAreaBlock/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/Toolbar/types.d.ts +1 -1
- package/dist/types-ts4.5/utils/performance/plugin-performance-report.d.ts +1 -1
- package/dist/types-ts4.5/utils/slice.d.ts +1 -1
- package/docs/0-intro.tsx +13 -19
- package/docs/1-legacy-editor.tsx +13 -19
- package/docs/4-annotations.tsx +222 -223
- package/package.json +25 -12
- package/report.api.md +448 -473
|
@@ -6,15 +6,13 @@ import { createTransformer } from '../utils';
|
|
|
6
6
|
// This stays as require() since changing to import will trigger a linter error
|
|
7
7
|
const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
|
|
8
8
|
|
|
9
|
-
const transformer = createTransformer('@atlaskit/editor-core', [
|
|
10
|
-
renameEditorToMigrationComponent,
|
|
11
|
-
]);
|
|
9
|
+
const transformer = createTransformer('@atlaskit/editor-core', [renameEditorToMigrationComponent]);
|
|
12
10
|
|
|
13
11
|
describe('Update Editor to EditorMigrationComponent', () => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
defineInlineTest(
|
|
13
|
+
{ default: transformer, parser: 'tsx' },
|
|
14
|
+
{},
|
|
15
|
+
`
|
|
18
16
|
import React from 'react';
|
|
19
17
|
import { Editor } from '@atlaskit/editor-core';
|
|
20
18
|
|
|
@@ -22,7 +20,7 @@ describe('Update Editor to EditorMigrationComponent', () => {
|
|
|
22
20
|
<Editor />
|
|
23
21
|
);
|
|
24
22
|
`, // -----
|
|
25
|
-
|
|
23
|
+
`
|
|
26
24
|
import React from 'react';
|
|
27
25
|
import { EditorMigrationComponent as Editor } from '@atlaskit/editor-core';
|
|
28
26
|
|
|
@@ -30,13 +28,13 @@ describe('Update Editor to EditorMigrationComponent', () => {
|
|
|
30
28
|
<Editor />
|
|
31
29
|
);
|
|
32
30
|
`, // -----
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
'update editor component',
|
|
32
|
+
);
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
defineInlineTest(
|
|
35
|
+
{ default: transformer, parser: 'tsx' },
|
|
36
|
+
{},
|
|
37
|
+
`
|
|
40
38
|
import React from 'react';
|
|
41
39
|
import { Editor as AkEditor } from '@atlaskit/editor-core';
|
|
42
40
|
|
|
@@ -44,7 +42,7 @@ describe('Update Editor to EditorMigrationComponent', () => {
|
|
|
44
42
|
<AkEditor />
|
|
45
43
|
);
|
|
46
44
|
`, // -----
|
|
47
|
-
|
|
45
|
+
`
|
|
48
46
|
import React from 'react';
|
|
49
47
|
import { EditorMigrationComponent as AkEditor } from '@atlaskit/editor-core';
|
|
50
48
|
|
|
@@ -52,13 +50,13 @@ describe('Update Editor to EditorMigrationComponent', () => {
|
|
|
52
50
|
<AkEditor />
|
|
53
51
|
);
|
|
54
52
|
`, // -----
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
'update editor component to keep same local name',
|
|
54
|
+
);
|
|
57
55
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
defineInlineTest(
|
|
57
|
+
{ default: transformer, parser: 'tsx' },
|
|
58
|
+
{},
|
|
59
|
+
`
|
|
62
60
|
import React from 'react';
|
|
63
61
|
import { Editor as AkEditor, ContextPanel } from '@atlaskit/editor-core';
|
|
64
62
|
|
|
@@ -66,7 +64,7 @@ describe('Update Editor to EditorMigrationComponent', () => {
|
|
|
66
64
|
<AkEditor />
|
|
67
65
|
);
|
|
68
66
|
`, // -----
|
|
69
|
-
|
|
67
|
+
`
|
|
70
68
|
import React from 'react';
|
|
71
69
|
import { EditorMigrationComponent as AkEditor, ContextPanel } from '@atlaskit/editor-core';
|
|
72
70
|
|
|
@@ -74,13 +72,13 @@ describe('Update Editor to EditorMigrationComponent', () => {
|
|
|
74
72
|
<AkEditor />
|
|
75
73
|
);
|
|
76
74
|
`, // -----
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
'update editor component to not modify other components',
|
|
76
|
+
);
|
|
79
77
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
defineInlineTest(
|
|
79
|
+
{ default: transformer, parser: 'tsx' },
|
|
80
|
+
{},
|
|
81
|
+
`
|
|
84
82
|
import React from 'react';
|
|
85
83
|
import { ContextPanel } from '@atlaskit/editor-core';
|
|
86
84
|
|
|
@@ -88,7 +86,7 @@ describe('Update Editor to EditorMigrationComponent', () => {
|
|
|
88
86
|
<div />
|
|
89
87
|
);
|
|
90
88
|
`, // -----
|
|
91
|
-
|
|
89
|
+
`
|
|
92
90
|
import React from 'react';
|
|
93
91
|
import { ContextPanel } from '@atlaskit/editor-core';
|
|
94
92
|
|
|
@@ -96,13 +94,13 @@ describe('Update Editor to EditorMigrationComponent', () => {
|
|
|
96
94
|
<div />
|
|
97
95
|
);
|
|
98
96
|
`, // -----
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
'nothing should change if there is no editor',
|
|
98
|
+
);
|
|
101
99
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
defineInlineTest(
|
|
101
|
+
{ default: transformer, parser: 'tsx' },
|
|
102
|
+
{},
|
|
103
|
+
`
|
|
106
104
|
import React from 'react';
|
|
107
105
|
import SomethingElse, { Editor } from 'cool-package'
|
|
108
106
|
import { Editor as AkEditor } from '@atlaskit/editor-core';
|
|
@@ -113,7 +111,7 @@ describe('Update Editor to EditorMigrationComponent', () => {
|
|
|
113
111
|
</AkEditor>
|
|
114
112
|
);
|
|
115
113
|
`, // -----
|
|
116
|
-
|
|
114
|
+
`
|
|
117
115
|
import React from 'react';
|
|
118
116
|
import SomethingElse, { Editor } from 'cool-package'
|
|
119
117
|
import { EditorMigrationComponent as AkEditor } from '@atlaskit/editor-core';
|
|
@@ -124,13 +122,13 @@ describe('Update Editor to EditorMigrationComponent', () => {
|
|
|
124
122
|
</AkEditor>
|
|
125
123
|
);
|
|
126
124
|
`, // -----
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
'should not change named exports from other packages that are called Editor',
|
|
126
|
+
);
|
|
129
127
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
defineInlineTest(
|
|
129
|
+
{ default: transformer, parser: 'tsx' },
|
|
130
|
+
{},
|
|
131
|
+
`
|
|
134
132
|
import React from 'react';
|
|
135
133
|
import Editor from 'cool-package'
|
|
136
134
|
import { Editor as AkEditor } from '@atlaskit/editor-core';
|
|
@@ -141,7 +139,7 @@ describe('Update Editor to EditorMigrationComponent', () => {
|
|
|
141
139
|
</AkEditor>
|
|
142
140
|
);
|
|
143
141
|
`, // -----
|
|
144
|
-
|
|
142
|
+
`
|
|
145
143
|
import React from 'react';
|
|
146
144
|
import Editor from 'cool-package'
|
|
147
145
|
import { EditorMigrationComponent as AkEditor } from '@atlaskit/editor-core';
|
|
@@ -152,6 +150,6 @@ describe('Update Editor to EditorMigrationComponent', () => {
|
|
|
152
150
|
</AkEditor>
|
|
153
151
|
);
|
|
154
152
|
`, // -----
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
'should not change exports from other packages that has a default export of Editor',
|
|
154
|
+
);
|
|
157
155
|
});
|
|
@@ -6,15 +6,13 @@ import { createTransformer } from '../utils';
|
|
|
6
6
|
// This stays as require() since changing to import will trigger a linter error
|
|
7
7
|
const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
|
|
8
8
|
|
|
9
|
-
const transformer = createTransformer('@atlaskit/editor-core', [
|
|
10
|
-
renameSmartLinksProp,
|
|
11
|
-
]);
|
|
9
|
+
const transformer = createTransformer('@atlaskit/editor-core', [renameSmartLinksProp]);
|
|
12
10
|
|
|
13
11
|
describe('Rename smartLinks to inside linking prop', () => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
defineInlineTest(
|
|
13
|
+
{ default: transformer, parser: 'tsx' },
|
|
14
|
+
{},
|
|
15
|
+
`
|
|
18
16
|
import React from 'react';
|
|
19
17
|
import { Editor } from '@atlaskit/editor-core';
|
|
20
18
|
|
|
@@ -22,7 +20,7 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
22
20
|
<Editor />
|
|
23
21
|
);
|
|
24
22
|
`, // -----
|
|
25
|
-
|
|
23
|
+
`
|
|
26
24
|
import React from 'react';
|
|
27
25
|
import { Editor } from '@atlaskit/editor-core';
|
|
28
26
|
|
|
@@ -30,13 +28,13 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
30
28
|
<Editor />
|
|
31
29
|
);
|
|
32
30
|
`, // -----
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
'rename nothing if smartLinks prop not set',
|
|
32
|
+
);
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
defineInlineTest(
|
|
35
|
+
{ default: transformer, parser: 'tsx' },
|
|
36
|
+
{},
|
|
37
|
+
`
|
|
40
38
|
import React from 'react';
|
|
41
39
|
import { Editor } from '@atlaskit/editor-core';
|
|
42
40
|
|
|
@@ -44,7 +42,7 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
44
42
|
<Editor linking />
|
|
45
43
|
);
|
|
46
44
|
`, // -----
|
|
47
|
-
|
|
45
|
+
`
|
|
48
46
|
import React from 'react';
|
|
49
47
|
import { Editor } from '@atlaskit/editor-core';
|
|
50
48
|
|
|
@@ -52,13 +50,13 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
52
50
|
<Editor linking />
|
|
53
51
|
);
|
|
54
52
|
`, // -----
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
'rename nothing if boolean prop',
|
|
54
|
+
);
|
|
57
55
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
defineInlineTest(
|
|
57
|
+
{ default: transformer, parser: 'tsx' },
|
|
58
|
+
{},
|
|
59
|
+
`
|
|
62
60
|
import React from 'react';
|
|
63
61
|
import { Editor } from '@atlaskit/editor-core';
|
|
64
62
|
|
|
@@ -66,7 +64,7 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
66
64
|
<Editor linking={{ smartLinks: { provider: Promise.resolve({}) } }} />
|
|
67
65
|
);
|
|
68
66
|
`, // -----
|
|
69
|
-
|
|
67
|
+
`
|
|
70
68
|
import React from 'react';
|
|
71
69
|
import { Editor } from '@atlaskit/editor-core';
|
|
72
70
|
|
|
@@ -74,13 +72,13 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
74
72
|
<Editor linking={{ smartLinks: { provider: Promise.resolve({}) } }} />
|
|
75
73
|
);
|
|
76
74
|
`, // -----
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
'rename nothing if smartLinks not found',
|
|
76
|
+
);
|
|
79
77
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
defineInlineTest(
|
|
79
|
+
{ default: transformer, parser: 'tsx' },
|
|
80
|
+
{},
|
|
81
|
+
`
|
|
84
82
|
import React from 'react';
|
|
85
83
|
import { Editor } from '@atlaskit/editor-core';
|
|
86
84
|
|
|
@@ -88,7 +86,7 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
88
86
|
<Editor smartLinks={{ provider: Promise.resolve({}), allowEmbeds: true }} linking={{ linkPicker: {} }} />
|
|
89
87
|
);
|
|
90
88
|
`, // -----
|
|
91
|
-
|
|
89
|
+
`
|
|
92
90
|
import React from 'react';
|
|
93
91
|
import { Editor } from '@atlaskit/editor-core';
|
|
94
92
|
|
|
@@ -96,13 +94,13 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
96
94
|
<Editor smartLinks={{ provider: Promise.resolve({}), allowEmbeds: true }} linking={{ linkPicker: {} }} />
|
|
97
95
|
);
|
|
98
96
|
`, // -----
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
'rename nothing if linking prop already exists',
|
|
98
|
+
);
|
|
101
99
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
defineInlineTest(
|
|
101
|
+
{ default: transformer, parser: 'tsx' },
|
|
102
|
+
{},
|
|
103
|
+
`
|
|
106
104
|
import React from 'react';
|
|
107
105
|
import { Editor } from '@atlaskit/editor-core';
|
|
108
106
|
|
|
@@ -110,7 +108,7 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
110
108
|
<Editor smartLinks={{ provider: Promise.resolve({}), allowEmbeds: true }} linking={{ smartLinks: { provider: Promise.resolve({}) } }} />
|
|
111
109
|
);
|
|
112
110
|
`, // -----
|
|
113
|
-
|
|
111
|
+
`
|
|
114
112
|
import React from 'react';
|
|
115
113
|
import { Editor } from '@atlaskit/editor-core';
|
|
116
114
|
|
|
@@ -118,13 +116,13 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
118
116
|
<Editor smartLinks={{ provider: Promise.resolve({}), allowEmbeds: true }} linking={{ smartLinks: { provider: Promise.resolve({}) } }} />
|
|
119
117
|
);
|
|
120
118
|
`, // -----
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
'rename nothing if linking prop already exists with smartLinks key',
|
|
120
|
+
);
|
|
123
121
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
defineInlineTest(
|
|
123
|
+
{ default: transformer, parser: 'tsx' },
|
|
124
|
+
{},
|
|
125
|
+
`
|
|
128
126
|
import React from 'react';
|
|
129
127
|
import { Editor } from '@atlaskit/editor-core';
|
|
130
128
|
|
|
@@ -132,7 +130,7 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
132
130
|
<Editor smartLinks={{ provider: Promise.resolve({}), allowEmbeds: true }} />
|
|
133
131
|
);
|
|
134
132
|
`, // -----
|
|
135
|
-
|
|
133
|
+
`
|
|
136
134
|
import React from 'react';
|
|
137
135
|
import { Editor } from '@atlaskit/editor-core';
|
|
138
136
|
|
|
@@ -145,13 +143,13 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
145
143
|
}} />
|
|
146
144
|
);
|
|
147
145
|
`, // -----
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
'rename smartLinks to key inside linking and do not change other options',
|
|
147
|
+
);
|
|
150
148
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
149
|
+
defineInlineTest(
|
|
150
|
+
{ default: transformer, parser: 'tsx' },
|
|
151
|
+
{},
|
|
152
|
+
`
|
|
155
153
|
import React from 'react';
|
|
156
154
|
import { Editor as AKEditor } from '@atlaskit/editor-core';
|
|
157
155
|
|
|
@@ -159,7 +157,7 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
159
157
|
<AKEditor smartLinks={{ provider: Promise.resolve({}) }} />
|
|
160
158
|
);
|
|
161
159
|
`, // -----
|
|
162
|
-
|
|
160
|
+
`
|
|
163
161
|
import React from 'react';
|
|
164
162
|
import { Editor as AKEditor } from '@atlaskit/editor-core';
|
|
165
163
|
|
|
@@ -171,13 +169,13 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
171
169
|
}} />
|
|
172
170
|
);
|
|
173
171
|
`, // -----
|
|
174
|
-
|
|
175
|
-
|
|
172
|
+
'rename smartLinks to key inside linking when Editor is renamed',
|
|
173
|
+
);
|
|
176
174
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
175
|
+
defineInlineTest(
|
|
176
|
+
{ default: transformer, parser: 'tsx' },
|
|
177
|
+
{},
|
|
178
|
+
`
|
|
181
179
|
import React from 'react';
|
|
182
180
|
|
|
183
181
|
const Editor = (props) => {
|
|
@@ -188,7 +186,7 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
188
186
|
<Editor smartLinks={{ provider: Promise.resolve({}) }} />
|
|
189
187
|
);
|
|
190
188
|
`, // -----
|
|
191
|
-
|
|
189
|
+
`
|
|
192
190
|
import React from 'react';
|
|
193
191
|
|
|
194
192
|
const Editor = (props) => {
|
|
@@ -199,6 +197,6 @@ describe('Rename smartLinks to inside linking prop', () => {
|
|
|
199
197
|
<Editor smartLinks={{ provider: Promise.resolve({}) }} />
|
|
200
198
|
);
|
|
201
199
|
`, // -----
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
'rename nothing if smartLinks for Editor is not from @atlaskit/editor-core',
|
|
201
|
+
);
|
|
204
202
|
});
|
|
@@ -7,14 +7,14 @@ import { createTransformer } from '../utils';
|
|
|
7
7
|
const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
|
|
8
8
|
|
|
9
9
|
const transformer = createTransformer('@atlaskit/editor-core', [
|
|
10
|
-
|
|
10
|
+
renameUnsafeAllowUndoRedoButtonsProp,
|
|
11
11
|
]);
|
|
12
12
|
|
|
13
13
|
describe('Rename UNSAFE_allowUndoRedoButtons to allowUndoRedoButtons', () => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
defineInlineTest(
|
|
15
|
+
{ default: transformer, parser: 'tsx' },
|
|
16
|
+
{},
|
|
17
|
+
`
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import { Editor } from '@atlaskit/editor-core';
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ describe('Rename UNSAFE_allowUndoRedoButtons to allowUndoRedoButtons', () => {
|
|
|
22
22
|
<Editor />
|
|
23
23
|
);
|
|
24
24
|
`, // -----
|
|
25
|
-
|
|
25
|
+
`
|
|
26
26
|
import React from 'react';
|
|
27
27
|
import { Editor } from '@atlaskit/editor-core';
|
|
28
28
|
|
|
@@ -30,13 +30,13 @@ describe('Rename UNSAFE_allowUndoRedoButtons to allowUndoRedoButtons', () => {
|
|
|
30
30
|
<Editor />
|
|
31
31
|
);
|
|
32
32
|
`, // -----
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
'rename nothing if UNSAFE_allowUndoRedoButtons prop not set',
|
|
34
|
+
);
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
defineInlineTest(
|
|
37
|
+
{ default: transformer, parser: 'tsx' },
|
|
38
|
+
{},
|
|
39
|
+
`
|
|
40
40
|
import React from 'react';
|
|
41
41
|
import { Editor } from '@atlaskit/editor-core';
|
|
42
42
|
|
|
@@ -44,7 +44,7 @@ describe('Rename UNSAFE_allowUndoRedoButtons to allowUndoRedoButtons', () => {
|
|
|
44
44
|
<Editor allowUndoRedoButtons />
|
|
45
45
|
);
|
|
46
46
|
`, // -----
|
|
47
|
-
|
|
47
|
+
`
|
|
48
48
|
import React from 'react';
|
|
49
49
|
import { Editor } from '@atlaskit/editor-core';
|
|
50
50
|
|
|
@@ -52,13 +52,13 @@ describe('Rename UNSAFE_allowUndoRedoButtons to allowUndoRedoButtons', () => {
|
|
|
52
52
|
<Editor allowUndoRedoButtons />
|
|
53
53
|
);
|
|
54
54
|
`, // -----
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
'rename nothing if boolean prop',
|
|
56
|
+
);
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
defineInlineTest(
|
|
59
|
+
{ default: transformer, parser: 'tsx' },
|
|
60
|
+
{},
|
|
61
|
+
`
|
|
62
62
|
import React from 'react';
|
|
63
63
|
import { Editor } from '@atlaskit/editor-core';
|
|
64
64
|
|
|
@@ -66,7 +66,7 @@ describe('Rename UNSAFE_allowUndoRedoButtons to allowUndoRedoButtons', () => {
|
|
|
66
66
|
<Editor allowUndoRedoButtons={true} />
|
|
67
67
|
);
|
|
68
68
|
`, // -----
|
|
69
|
-
|
|
69
|
+
`
|
|
70
70
|
import React from 'react';
|
|
71
71
|
import { Editor } from '@atlaskit/editor-core';
|
|
72
72
|
|
|
@@ -74,13 +74,13 @@ describe('Rename UNSAFE_allowUndoRedoButtons to allowUndoRedoButtons', () => {
|
|
|
74
74
|
<Editor allowUndoRedoButtons={true} />
|
|
75
75
|
);
|
|
76
76
|
`, // -----
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
'rename nothing if UNSAFE_allowUndoRedoButtons not found',
|
|
78
|
+
);
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
defineInlineTest(
|
|
81
|
+
{ default: transformer, parser: 'tsx' },
|
|
82
|
+
{},
|
|
83
|
+
`
|
|
84
84
|
import React from 'react';
|
|
85
85
|
import { Editor } from '@atlaskit/editor-core';
|
|
86
86
|
|
|
@@ -88,7 +88,7 @@ describe('Rename UNSAFE_allowUndoRedoButtons to allowUndoRedoButtons', () => {
|
|
|
88
88
|
<Editor UNSAFE_allowUndoRedoButtons={true} />
|
|
89
89
|
);
|
|
90
90
|
`, // -----
|
|
91
|
-
|
|
91
|
+
`
|
|
92
92
|
import React from 'react';
|
|
93
93
|
import { Editor } from '@atlaskit/editor-core';
|
|
94
94
|
|
|
@@ -96,13 +96,13 @@ describe('Rename UNSAFE_allowUndoRedoButtons to allowUndoRedoButtons', () => {
|
|
|
96
96
|
<Editor allowUndoRedoButtons={true} />
|
|
97
97
|
);
|
|
98
98
|
`, // -----
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
'rename UNSAFE_allowUndoRedoButtons to allowUndoRedoButtons and do not change other options',
|
|
100
|
+
);
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
defineInlineTest(
|
|
103
|
+
{ default: transformer, parser: 'tsx' },
|
|
104
|
+
{},
|
|
105
|
+
`
|
|
106
106
|
import React from 'react';
|
|
107
107
|
import { Editor as AKEditor } from '@atlaskit/editor-core';
|
|
108
108
|
|
|
@@ -110,7 +110,7 @@ describe('Rename UNSAFE_allowUndoRedoButtons to allowUndoRedoButtons', () => {
|
|
|
110
110
|
<AKEditor UNSAFE_allowUndoRedoButtons={true} />
|
|
111
111
|
);
|
|
112
112
|
`, // -----
|
|
113
|
-
|
|
113
|
+
`
|
|
114
114
|
import React from 'react';
|
|
115
115
|
import { Editor as AKEditor } from '@atlaskit/editor-core';
|
|
116
116
|
|
|
@@ -118,13 +118,13 @@ describe('Rename UNSAFE_allowUndoRedoButtons to allowUndoRedoButtons', () => {
|
|
|
118
118
|
<AKEditor allowUndoRedoButtons={true} />
|
|
119
119
|
);
|
|
120
120
|
`, // -----
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
'rename UNSAFE_allowUndoRedoButtons to allowUndoRedoButtons when Editor is renamed',
|
|
122
|
+
);
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
defineInlineTest(
|
|
125
|
+
{ default: transformer, parser: 'tsx' },
|
|
126
|
+
{},
|
|
127
|
+
`
|
|
128
128
|
import React from 'react';
|
|
129
129
|
|
|
130
130
|
const Editor = (props) => {
|
|
@@ -135,7 +135,7 @@ describe('Rename UNSAFE_allowUndoRedoButtons to allowUndoRedoButtons', () => {
|
|
|
135
135
|
<Editor UNSAFE_allowUndoRedoButtons={true} />
|
|
136
136
|
);
|
|
137
137
|
`, // -----
|
|
138
|
-
|
|
138
|
+
`
|
|
139
139
|
import React from 'react';
|
|
140
140
|
|
|
141
141
|
const Editor = (props) => {
|
|
@@ -146,6 +146,6 @@ describe('Rename UNSAFE_allowUndoRedoButtons to allowUndoRedoButtons', () => {
|
|
|
146
146
|
<Editor UNSAFE_allowUndoRedoButtons={true} />
|
|
147
147
|
);
|
|
148
148
|
`, // -----
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
'rename nothing if UNSAFE_allowUndoRedoButtons for Editor is not from @atlaskit/editor-core',
|
|
150
|
+
);
|
|
151
151
|
});
|