@atlaskit/editor-core 204.3.2 → 204.3.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 +9 -0
- package/dist/cjs/create-editor/ReactEditorView/handleEditorFocus.js +17 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView/handleEditorFocus.js +12 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorView/handleEditorFocus.js +16 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 204.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#121098](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/121098)
|
|
8
|
+
[`61ec93eced435`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/61ec93eced435) -
|
|
9
|
+
Revert autofocus setTimeout changes.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 204.3.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.handleEditorFocus = handleEditorFocus;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
9
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
11
|
function handleEditorFocus(view) {
|
|
9
12
|
if (view !== null && view !== void 0 && view.hasFocus()) {
|
|
10
13
|
return;
|
|
11
14
|
}
|
|
12
|
-
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* If startTransition is available (in React 18),
|
|
18
|
+
* don't use setTimeout as startTransition will be used in ReactEditorViewNext.
|
|
19
|
+
* setTimeout(fn, 0) will not defer the focus reliably in React 18 with
|
|
20
|
+
* concurrent rendering.
|
|
21
|
+
*/
|
|
22
|
+
var react16OnlySetTimeout = _react.default !== null && _react.default !== void 0 && _react.default.startTransition && (0, _platformFeatureFlags.fg)('platform_editor_react_18_autofocus_fix') ? function (fn) {
|
|
23
|
+
return fn();
|
|
24
|
+
} : function (fn) {
|
|
25
|
+
return window.setTimeout(fn, 0);
|
|
26
|
+
};
|
|
27
|
+
return react16OnlySetTimeout(function () {
|
|
13
28
|
if (view !== null && view !== void 0 && view.hasFocus()) {
|
|
14
29
|
return;
|
|
15
30
|
}
|
|
@@ -42,5 +57,5 @@ function handleEditorFocus(view) {
|
|
|
42
57
|
view.dispatch(tr);
|
|
43
58
|
view.focus();
|
|
44
59
|
}
|
|
45
|
-
}
|
|
60
|
+
});
|
|
46
61
|
}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
4
|
export function handleEditorFocus(view) {
|
|
3
5
|
if (view !== null && view !== void 0 && view.hasFocus()) {
|
|
4
6
|
return;
|
|
5
7
|
}
|
|
6
|
-
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* If startTransition is available (in React 18),
|
|
11
|
+
* don't use setTimeout as startTransition will be used in ReactEditorViewNext.
|
|
12
|
+
* setTimeout(fn, 0) will not defer the focus reliably in React 18 with
|
|
13
|
+
* concurrent rendering.
|
|
14
|
+
*/
|
|
15
|
+
const react16OnlySetTimeout = React !== null && React !== void 0 && React.startTransition && fg('platform_editor_react_18_autofocus_fix') ? fn => fn() : fn => window.setTimeout(fn, 0);
|
|
16
|
+
return react16OnlySetTimeout(() => {
|
|
7
17
|
if (view !== null && view !== void 0 && view.hasFocus()) {
|
|
8
18
|
return;
|
|
9
19
|
}
|
|
@@ -36,5 +46,5 @@ export function handleEditorFocus(view) {
|
|
|
36
46
|
view.dispatch(tr);
|
|
37
47
|
view.focus();
|
|
38
48
|
}
|
|
39
|
-
}
|
|
49
|
+
});
|
|
40
50
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "204.3.
|
|
2
|
+
export const version = "204.3.3";
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
4
|
export function handleEditorFocus(view) {
|
|
3
5
|
if (view !== null && view !== void 0 && view.hasFocus()) {
|
|
4
6
|
return;
|
|
5
7
|
}
|
|
6
|
-
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* If startTransition is available (in React 18),
|
|
11
|
+
* don't use setTimeout as startTransition will be used in ReactEditorViewNext.
|
|
12
|
+
* setTimeout(fn, 0) will not defer the focus reliably in React 18 with
|
|
13
|
+
* concurrent rendering.
|
|
14
|
+
*/
|
|
15
|
+
var react16OnlySetTimeout = React !== null && React !== void 0 && React.startTransition && fg('platform_editor_react_18_autofocus_fix') ? function (fn) {
|
|
16
|
+
return fn();
|
|
17
|
+
} : function (fn) {
|
|
18
|
+
return window.setTimeout(fn, 0);
|
|
19
|
+
};
|
|
20
|
+
return react16OnlySetTimeout(function () {
|
|
7
21
|
if (view !== null && view !== void 0 && view.hasFocus()) {
|
|
8
22
|
return;
|
|
9
23
|
}
|
|
@@ -36,5 +50,5 @@ export function handleEditorFocus(view) {
|
|
|
36
50
|
view.dispatch(tr);
|
|
37
51
|
view.focus();
|
|
38
52
|
}
|
|
39
|
-
}
|
|
53
|
+
});
|
|
40
54
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "204.3.
|
|
2
|
+
export var version = "204.3.3";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "204.3.
|
|
3
|
+
"version": "204.3.3",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@atlaskit/react-ufo": "^3.1.0",
|
|
62
62
|
"@atlaskit/task-decision": "^19.0.0",
|
|
63
63
|
"@atlaskit/tmp-editor-statsig": "^3.3.0",
|
|
64
|
-
"@atlaskit/tokens": "^4.
|
|
64
|
+
"@atlaskit/tokens": "^4.3.0",
|
|
65
65
|
"@atlaskit/tooltip": "^20.0.0",
|
|
66
66
|
"@atlaskit/width-detector": "^5.0.0",
|
|
67
67
|
"@babel/runtime": "^7.0.0",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@af/visual-regression": "*",
|
|
89
89
|
"@atlaskit/adf-utils": "^19.18.0",
|
|
90
90
|
"@atlaskit/analytics-listeners": "^9.0.0",
|
|
91
|
-
"@atlaskit/collab-provider": "10.8.
|
|
91
|
+
"@atlaskit/collab-provider": "10.8.1",
|
|
92
92
|
"@atlaskit/editor-plugin-annotation": "2.0.2",
|
|
93
93
|
"@atlaskit/editor-plugin-card": "^5.0.0",
|
|
94
94
|
"@atlaskit/editor-plugin-list": "^4.0.0",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@atlaskit/visual-regression": "*",
|
|
109
109
|
"@atlassian/adf-schema-json": "^1.27.0",
|
|
110
110
|
"@atlassian/feature-flags-test-utils": "*",
|
|
111
|
-
"@atlassian/search-provider": "3.0.
|
|
111
|
+
"@atlassian/search-provider": "3.0.40",
|
|
112
112
|
"@emotion/jest": "^11.8.0",
|
|
113
113
|
"@storybook/addon-knobs": "^6.4.0",
|
|
114
114
|
"@testing-library/react": "^13.4.0",
|