@atlaskit/editor-core 204.7.1 → 204.7.2
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 +18 -0
- package/dist/cjs/create-editor/ReactEditorView/handleEditorFocus.js +9 -0
- package/dist/cjs/ui/ToolbarHelp/index.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView/handleEditorFocus.js +9 -0
- package/dist/es2019/ui/ToolbarHelp/index.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorView/handleEditorFocus.js +9 -0
- package/dist/esm/ui/ToolbarHelp/index.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 204.7.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#131485](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/131485)
|
|
8
|
+
[`bd6274bb72cb1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bd6274bb72cb1) -
|
|
9
|
+
ENGHEALTH-23692 Iconography uplift for editor-core
|
|
10
|
+
- [#131407](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/131407)
|
|
11
|
+
[`59a88ee61a0c5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/59a88ee61a0c5) -
|
|
12
|
+
[ux] EDF-2626: Add view isDestroyed check in editor auto-focusing logic to ensure bail before
|
|
13
|
+
posFromDOM and editor selection operations committed on destroyed docView instance, behind
|
|
14
|
+
platform_editor_posfromdom_null_fix
|
|
15
|
+
- [#131280](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/131280)
|
|
16
|
+
[`9ff92ea2432f2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9ff92ea2432f2) -
|
|
17
|
+
[ED-27082] Fix media overflow toolbar to show correct options + update separators between button
|
|
18
|
+
groups
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 204.7.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -25,6 +25,14 @@ function handleEditorFocus(view) {
|
|
|
25
25
|
return window.setTimeout(fn, 0);
|
|
26
26
|
};
|
|
27
27
|
return react16OnlySetTimeout(function () {
|
|
28
|
+
// Due to race conditions during editor lifecycle transitions (e.g. SPA route changes during opening or closing)
|
|
29
|
+
// where the view (and its internal docView) may have been destroyed, the timeout callback may fire on a stale view.
|
|
30
|
+
// Bail out in that scenario to prevent operating on an unmounted view.
|
|
31
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_posfromdom_null_fix')) {
|
|
32
|
+
if (view !== null && view !== void 0 && view.isDestroyed) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
28
36
|
if (view !== null && view !== void 0 && view.hasFocus()) {
|
|
29
37
|
return;
|
|
30
38
|
}
|
|
@@ -43,6 +51,7 @@ function handleEditorFocus(view) {
|
|
|
43
51
|
view.focus();
|
|
44
52
|
return;
|
|
45
53
|
}
|
|
54
|
+
|
|
46
55
|
// set cursor/selection and focus
|
|
47
56
|
var anchor = view === null || view === void 0 ? void 0 : view.posAtDOM(range.startContainer, range.startOffset);
|
|
48
57
|
var head = view === null || view === void 0 ? void 0 : view.posAtDOM(range.endContainer, range.endOffset);
|
|
@@ -8,7 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactIntlNext = require("react-intl-next");
|
|
10
10
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
11
|
-
var
|
|
11
|
+
var _questionCircleQuestion = _interopRequireDefault(require("@atlaskit/icon/core/migration/question-circle--question"));
|
|
12
12
|
var _EditorContext = require("../EditorContext");
|
|
13
13
|
var _messages = require("./messages");
|
|
14
14
|
// Please, do not copy or use this kind of code below
|
|
@@ -59,7 +59,7 @@ var TooltipHelpTrigger = function TooltipHelpTrigger(_ref) {
|
|
|
59
59
|
onClick: showHelp,
|
|
60
60
|
title: displayTitle,
|
|
61
61
|
titlePosition: titlePosition,
|
|
62
|
-
iconBefore: /*#__PURE__*/_react.default.createElement(
|
|
62
|
+
iconBefore: /*#__PURE__*/_react.default.createElement(_questionCircleQuestion.default, {
|
|
63
63
|
label: displayTitle
|
|
64
64
|
})
|
|
65
65
|
});
|
|
@@ -14,6 +14,14 @@ export function handleEditorFocus(view) {
|
|
|
14
14
|
*/
|
|
15
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
16
|
return react16OnlySetTimeout(() => {
|
|
17
|
+
// Due to race conditions during editor lifecycle transitions (e.g. SPA route changes during opening or closing)
|
|
18
|
+
// where the view (and its internal docView) may have been destroyed, the timeout callback may fire on a stale view.
|
|
19
|
+
// Bail out in that scenario to prevent operating on an unmounted view.
|
|
20
|
+
if (fg('platform_editor_posfromdom_null_fix')) {
|
|
21
|
+
if (view !== null && view !== void 0 && view.isDestroyed) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
17
25
|
if (view !== null && view !== void 0 && view.hasFocus()) {
|
|
18
26
|
return;
|
|
19
27
|
}
|
|
@@ -32,6 +40,7 @@ export function handleEditorFocus(view) {
|
|
|
32
40
|
view.focus();
|
|
33
41
|
return;
|
|
34
42
|
}
|
|
43
|
+
|
|
35
44
|
// set cursor/selection and focus
|
|
36
45
|
const anchor = view === null || view === void 0 ? void 0 : view.posAtDOM(range.startContainer, range.startOffset);
|
|
37
46
|
const head = view === null || view === void 0 ? void 0 : view.posAtDOM(range.endContainer, range.endOffset);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { injectIntl } from 'react-intl-next';
|
|
3
3
|
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
4
|
-
import QuestionIcon from '@atlaskit/icon/
|
|
4
|
+
import QuestionIcon from '@atlaskit/icon/core/migration/question-circle--question';
|
|
5
5
|
import { useEditorContext } from '../EditorContext';
|
|
6
6
|
import { messages } from './messages';
|
|
7
7
|
// Please, do not copy or use this kind of code below
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "204.7.
|
|
2
|
+
export const version = "204.7.2";
|
|
@@ -18,6 +18,14 @@ export function handleEditorFocus(view) {
|
|
|
18
18
|
return window.setTimeout(fn, 0);
|
|
19
19
|
};
|
|
20
20
|
return react16OnlySetTimeout(function () {
|
|
21
|
+
// Due to race conditions during editor lifecycle transitions (e.g. SPA route changes during opening or closing)
|
|
22
|
+
// where the view (and its internal docView) may have been destroyed, the timeout callback may fire on a stale view.
|
|
23
|
+
// Bail out in that scenario to prevent operating on an unmounted view.
|
|
24
|
+
if (fg('platform_editor_posfromdom_null_fix')) {
|
|
25
|
+
if (view !== null && view !== void 0 && view.isDestroyed) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
21
29
|
if (view !== null && view !== void 0 && view.hasFocus()) {
|
|
22
30
|
return;
|
|
23
31
|
}
|
|
@@ -36,6 +44,7 @@ export function handleEditorFocus(view) {
|
|
|
36
44
|
view.focus();
|
|
37
45
|
return;
|
|
38
46
|
}
|
|
47
|
+
|
|
39
48
|
// set cursor/selection and focus
|
|
40
49
|
var anchor = view === null || view === void 0 ? void 0 : view.posAtDOM(range.startContainer, range.startOffset);
|
|
41
50
|
var head = view === null || view === void 0 ? void 0 : view.posAtDOM(range.endContainer, range.endOffset);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { injectIntl } from 'react-intl-next';
|
|
3
3
|
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
4
|
-
import QuestionIcon from '@atlaskit/icon/
|
|
4
|
+
import QuestionIcon from '@atlaskit/icon/core/migration/question-circle--question';
|
|
5
5
|
import { useEditorContext } from '../EditorContext';
|
|
6
6
|
import { messages } from './messages';
|
|
7
7
|
// Please, do not copy or use this kind of code below
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "204.7.
|
|
2
|
+
export var version = "204.7.2";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "204.7.
|
|
3
|
+
"version": "204.7.2",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"@atlaskit/media-test-helpers": "^35.0.0",
|
|
101
101
|
"@atlaskit/modal-dialog": "^13.4.0",
|
|
102
102
|
"@atlaskit/primitives": "^14.2.0",
|
|
103
|
-
"@atlaskit/renderer": "^114.
|
|
103
|
+
"@atlaskit/renderer": "^114.5.0",
|
|
104
104
|
"@atlaskit/smart-card": "^36.0.0",
|
|
105
105
|
"@atlaskit/synchrony-test-helpers": "^3.1.0",
|
|
106
106
|
"@atlaskit/toggle": "^15.0.0",
|
|
@@ -567,6 +567,9 @@
|
|
|
567
567
|
},
|
|
568
568
|
"platform_editor_keep_focus_on_content_comp_clicks": {
|
|
569
569
|
"type": "boolean"
|
|
570
|
+
},
|
|
571
|
+
"platform_editor_posfromdom_null_fix": {
|
|
572
|
+
"type": "boolean"
|
|
570
573
|
}
|
|
571
574
|
},
|
|
572
575
|
"stricter": {
|