@atlaskit/editor-plugin-base 2.0.1 → 2.0.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
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-base
|
|
2
2
|
|
|
3
|
+
## 2.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#159176](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/159176)
|
|
8
|
+
[`8f1d77592a9dc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8f1d77592a9dc) -
|
|
9
|
+
Bump adf-schema to 44.2.0
|
|
10
|
+
|
|
11
|
+
## 2.0.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#156556](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156556)
|
|
16
|
+
[`fa4db989cfa70`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fa4db989cfa70) -
|
|
17
|
+
[HOT-112603] Reduce memory leak footage by using WeakRef to store HTML element
|
|
18
|
+
|
|
3
19
|
## 2.0.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -56,8 +56,9 @@ function createGutter(gutterSize) {
|
|
|
56
56
|
return {
|
|
57
57
|
addGutter: function addGutter(parent) {
|
|
58
58
|
if (parent) {
|
|
59
|
+
var _parent$deref;
|
|
59
60
|
currentParent = parent;
|
|
60
|
-
parent.appendChild(gutter);
|
|
61
|
+
(_parent$deref = parent.deref()) === null || _parent$deref === void 0 || _parent$deref.appendChild(gutter);
|
|
61
62
|
mounted = true;
|
|
62
63
|
if (observer) {
|
|
63
64
|
observer.observe(gutter);
|
|
@@ -65,9 +66,11 @@ function createGutter(gutterSize) {
|
|
|
65
66
|
}
|
|
66
67
|
},
|
|
67
68
|
removeGutter: function removeGutter() {
|
|
68
|
-
|
|
69
|
+
var _currentParent;
|
|
70
|
+
var parentRef = (_currentParent = currentParent) === null || _currentParent === void 0 ? void 0 : _currentParent.deref();
|
|
71
|
+
if (parentRef && mounted) {
|
|
69
72
|
mounted = false;
|
|
70
|
-
|
|
73
|
+
parentRef.removeChild(gutter);
|
|
71
74
|
if (observer) {
|
|
72
75
|
observer.unobserve(gutter);
|
|
73
76
|
}
|
|
@@ -205,7 +208,7 @@ var _default = exports.default = function _default() {
|
|
|
205
208
|
var addAndObserveGutter = function addAndObserveGutter() {
|
|
206
209
|
if (!gutter.isMounted()) {
|
|
207
210
|
gutter.observe(scrollElement);
|
|
208
|
-
gutter.addGutter(editorParentElement);
|
|
211
|
+
gutter.addGutter(editorParentElement ? new WeakRef(editorParentElement) : null);
|
|
209
212
|
}
|
|
210
213
|
};
|
|
211
214
|
var toggleGutter = function toggleGutter(contentSize, threshold) {
|
|
@@ -47,8 +47,9 @@ function createGutter(gutterSize) {
|
|
|
47
47
|
return {
|
|
48
48
|
addGutter(parent) {
|
|
49
49
|
if (parent) {
|
|
50
|
+
var _parent$deref;
|
|
50
51
|
currentParent = parent;
|
|
51
|
-
parent.appendChild(gutter);
|
|
52
|
+
(_parent$deref = parent.deref()) === null || _parent$deref === void 0 ? void 0 : _parent$deref.appendChild(gutter);
|
|
52
53
|
mounted = true;
|
|
53
54
|
if (observer) {
|
|
54
55
|
observer.observe(gutter);
|
|
@@ -56,9 +57,11 @@ function createGutter(gutterSize) {
|
|
|
56
57
|
}
|
|
57
58
|
},
|
|
58
59
|
removeGutter() {
|
|
59
|
-
|
|
60
|
+
var _currentParent;
|
|
61
|
+
const parentRef = (_currentParent = currentParent) === null || _currentParent === void 0 ? void 0 : _currentParent.deref();
|
|
62
|
+
if (parentRef && mounted) {
|
|
60
63
|
mounted = false;
|
|
61
|
-
|
|
64
|
+
parentRef.removeChild(gutter);
|
|
62
65
|
if (observer) {
|
|
63
66
|
observer.unobserve(gutter);
|
|
64
67
|
}
|
|
@@ -192,7 +195,7 @@ export default ((pluginOptions = {}) => {
|
|
|
192
195
|
const addAndObserveGutter = () => {
|
|
193
196
|
if (!gutter.isMounted()) {
|
|
194
197
|
gutter.observe(scrollElement);
|
|
195
|
-
gutter.addGutter(editorParentElement);
|
|
198
|
+
gutter.addGutter(editorParentElement ? new WeakRef(editorParentElement) : null);
|
|
196
199
|
}
|
|
197
200
|
};
|
|
198
201
|
const toggleGutter = (contentSize, threshold) => {
|
|
@@ -50,8 +50,9 @@ function createGutter(gutterSize) {
|
|
|
50
50
|
return {
|
|
51
51
|
addGutter: function addGutter(parent) {
|
|
52
52
|
if (parent) {
|
|
53
|
+
var _parent$deref;
|
|
53
54
|
currentParent = parent;
|
|
54
|
-
parent.appendChild(gutter);
|
|
55
|
+
(_parent$deref = parent.deref()) === null || _parent$deref === void 0 || _parent$deref.appendChild(gutter);
|
|
55
56
|
mounted = true;
|
|
56
57
|
if (observer) {
|
|
57
58
|
observer.observe(gutter);
|
|
@@ -59,9 +60,11 @@ function createGutter(gutterSize) {
|
|
|
59
60
|
}
|
|
60
61
|
},
|
|
61
62
|
removeGutter: function removeGutter() {
|
|
62
|
-
|
|
63
|
+
var _currentParent;
|
|
64
|
+
var parentRef = (_currentParent = currentParent) === null || _currentParent === void 0 ? void 0 : _currentParent.deref();
|
|
65
|
+
if (parentRef && mounted) {
|
|
63
66
|
mounted = false;
|
|
64
|
-
|
|
67
|
+
parentRef.removeChild(gutter);
|
|
65
68
|
if (observer) {
|
|
66
69
|
observer.unobserve(gutter);
|
|
67
70
|
}
|
|
@@ -199,7 +202,7 @@ export default (function () {
|
|
|
199
202
|
var addAndObserveGutter = function addAndObserveGutter() {
|
|
200
203
|
if (!gutter.isMounted()) {
|
|
201
204
|
gutter.observe(scrollElement);
|
|
202
|
-
gutter.addGutter(editorParentElement);
|
|
205
|
+
gutter.addGutter(editorParentElement ? new WeakRef(editorParentElement) : null);
|
|
203
206
|
}
|
|
204
207
|
};
|
|
205
208
|
var toggleGutter = function toggleGutter(contentSize, threshold) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-base",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Base plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/adf-schema": "^
|
|
35
|
-
"@atlaskit/editor-common": "^94.
|
|
34
|
+
"@atlaskit/adf-schema": "^44.2.0",
|
|
35
|
+
"@atlaskit/editor-common": "^94.9.0",
|
|
36
36
|
"@atlaskit/editor-plugin-context-identifier": "^1.3.0",
|
|
37
37
|
"@atlaskit/editor-plugin-feature-flags": "^1.2.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
40
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
40
|
+
"@atlaskit/tmp-editor-statsig": "^2.10.0",
|
|
41
41
|
"@babel/runtime": "^7.0.0"
|
|
42
42
|
},
|
|
43
43
|
"techstack": {
|