@atlaskit/editor-plugin-caption 1.6.0 → 1.6.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
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-caption
|
|
2
2
|
|
|
3
|
+
## 1.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#121438](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/121438)
|
|
8
|
+
[`35e0addb19a19`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35e0addb19a19) -
|
|
9
|
+
[ux] Fixing media caption to stop them infinitely re-rendering in react 18 when using createRoot
|
|
10
|
+
|
|
11
|
+
## 1.6.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 1.6.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -55,6 +55,20 @@ var CaptionNodeView = exports.CaptionNodeView = /*#__PURE__*/function (_Selectio
|
|
|
55
55
|
dom: dom
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
+
|
|
59
|
+
// ED-24114: We need to ignore mutations that are not related to the caption node
|
|
60
|
+
// since these mutations can cause an infinite loop in React 18 when using createRoot
|
|
61
|
+
}, {
|
|
62
|
+
key: "ignoreMutation",
|
|
63
|
+
value: function ignoreMutation(mutation) {
|
|
64
|
+
if (!(0, _platformFeatureFlags.fg)('react_18_caption_concurrent_mode')) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (!this.contentDOM) {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
return !this.contentDOM.contains(mutation.target) && mutation.type !== 'selection';
|
|
71
|
+
}
|
|
58
72
|
}, {
|
|
59
73
|
key: "handleEditorDisabledChanged",
|
|
60
74
|
value: function handleEditorDisabledChanged() {
|
|
@@ -30,6 +30,18 @@ export class CaptionNodeView extends SelectionBasedNodeView {
|
|
|
30
30
|
dom
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
// ED-24114: We need to ignore mutations that are not related to the caption node
|
|
35
|
+
// since these mutations can cause an infinite loop in React 18 when using createRoot
|
|
36
|
+
ignoreMutation(mutation) {
|
|
37
|
+
if (!fg('react_18_caption_concurrent_mode')) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if (!this.contentDOM) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
return !this.contentDOM.contains(mutation.target) && mutation.type !== 'selection';
|
|
44
|
+
}
|
|
33
45
|
handleEditorDisabledChanged() {
|
|
34
46
|
var _this$pluginInjection4;
|
|
35
47
|
if ((_this$pluginInjection4 = this.pluginInjectionApi) !== null && _this$pluginInjection4 !== void 0 && _this$pluginInjection4.editorDisabled) {
|
|
@@ -47,6 +47,20 @@ export var CaptionNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
47
47
|
dom: dom
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
+
|
|
51
|
+
// ED-24114: We need to ignore mutations that are not related to the caption node
|
|
52
|
+
// since these mutations can cause an infinite loop in React 18 when using createRoot
|
|
53
|
+
}, {
|
|
54
|
+
key: "ignoreMutation",
|
|
55
|
+
value: function ignoreMutation(mutation) {
|
|
56
|
+
if (!fg('react_18_caption_concurrent_mode')) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
if (!this.contentDOM) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
return !this.contentDOM.contains(mutation.target) && mutation.type !== 'selection';
|
|
63
|
+
}
|
|
50
64
|
}, {
|
|
51
65
|
key: "handleEditorDisabledChanged",
|
|
52
66
|
value: function handleEditorDisabledChanged() {
|
|
@@ -16,6 +16,10 @@ export declare class CaptionNodeView extends SelectionBasedNodeView {
|
|
|
16
16
|
getContentDOM(): {
|
|
17
17
|
dom: HTMLDivElement;
|
|
18
18
|
};
|
|
19
|
+
ignoreMutation(mutation: MutationRecord | {
|
|
20
|
+
type: 'selection';
|
|
21
|
+
target: Element;
|
|
22
|
+
}): boolean;
|
|
19
23
|
handleEditorDisabledChanged(): void;
|
|
20
24
|
render(_props: never, forwardRef: ForwardRef): JSX.Element;
|
|
21
25
|
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
@@ -16,6 +16,10 @@ export declare class CaptionNodeView extends SelectionBasedNodeView {
|
|
|
16
16
|
getContentDOM(): {
|
|
17
17
|
dom: HTMLDivElement;
|
|
18
18
|
};
|
|
19
|
+
ignoreMutation(mutation: MutationRecord | {
|
|
20
|
+
type: 'selection';
|
|
21
|
+
target: Element;
|
|
22
|
+
}): boolean;
|
|
19
23
|
handleEditorDisabledChanged(): void;
|
|
20
24
|
render(_props: never, forwardRef: ForwardRef): JSX.Element;
|
|
21
25
|
viewShouldUpdate(nextNode: PMNode): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-caption",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "Caption plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/adf-schema": "^39.0.3",
|
|
36
|
-
"@atlaskit/editor-common": "^
|
|
36
|
+
"@atlaskit/editor-common": "^86.2.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.4.0",
|
|
38
38
|
"@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
|
|
39
39
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
@@ -88,6 +88,9 @@
|
|
|
88
88
|
"platform-feature-flags": {
|
|
89
89
|
"platform.editor.live-view.disable-editing-in-view-mode_fi1rx": {
|
|
90
90
|
"type": "boolean"
|
|
91
|
+
},
|
|
92
|
+
"react_18_caption_concurrent_mode": {
|
|
93
|
+
"type": "boolean"
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
96
|
}
|