@atlaskit/editor-plugin-media 8.4.2 → 8.4.4
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 +17 -0
- package/dist/cjs/pm-plugins/main.js +16 -1
- package/dist/cjs/ui/toolbar/index.js +1 -1
- package/dist/es2019/pm-plugins/main.js +16 -1
- package/dist/es2019/ui/toolbar/index.js +1 -1
- package/dist/esm/pm-plugins/main.js +16 -1
- package/dist/esm/ui/toolbar/index.js +1 -1
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 8.4.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`dba0cb8c22976`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dba0cb8c22976) -
|
|
8
|
+
Cleans up FG platform_editor_fix_media_card_removal
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 8.4.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`da82d015556d4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/da82d015556d4) -
|
|
16
|
+
Fix a bug where repeatedly cloning the media plugin state would cause severe performance
|
|
17
|
+
degradation over time
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 8.4.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -28,6 +28,7 @@ var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
|
28
28
|
var _mediaClient = require("@atlaskit/media-client");
|
|
29
29
|
var _mediaCommon = require("@atlaskit/media-common");
|
|
30
30
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
31
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
31
32
|
var _helpers = _interopRequireWildcard(require("../pm-plugins/commands/helpers"));
|
|
32
33
|
var helpers = _helpers;
|
|
33
34
|
var _mediaCommon2 = require("../pm-plugins/utils/media-common");
|
|
@@ -484,11 +485,25 @@ var MediaPluginStateImplementation = exports.MediaPluginStateImplementation = /*
|
|
|
484
485
|
key: "clone",
|
|
485
486
|
value: function clone() {
|
|
486
487
|
var clonedAt = (performance || Date).now();
|
|
487
|
-
|
|
488
|
+
|
|
489
|
+
// Prevent double wrapping
|
|
490
|
+
// If clone is repeatedly called, we want to proxy the underlying MediaPluginStateImplementation target, rather than the proxy itself
|
|
491
|
+
// If we proxy the proxy, then calling get in future will need to recursively unwrap proxies to find the original target, which causes performance issues
|
|
492
|
+
// Instead, we check if there is an original target stored on "this", and if so, we use that as the proxy target instead
|
|
493
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias -- This is required while this is behind a feature-gate. Once the feature-gate is removed, we can inline proxyTarget as "(this as unknown as { originalTarget?: typeof proxyTarget }).originalTarget ?? this"
|
|
494
|
+
var proxyTarget = this;
|
|
495
|
+
var originalTarget = this.originalTarget;
|
|
496
|
+
if (originalTarget !== undefined && (0, _expValEquals.expValEquals)('platform_editor_fix_clone_nesting_exp', 'isEnabled', true)) {
|
|
497
|
+
proxyTarget = originalTarget;
|
|
498
|
+
}
|
|
499
|
+
return new Proxy(proxyTarget, {
|
|
488
500
|
get: function get(target, prop, receiver) {
|
|
489
501
|
if (prop === 'singletonCreatedAt') {
|
|
490
502
|
return clonedAt;
|
|
491
503
|
}
|
|
504
|
+
if (prop === 'originalTarget') {
|
|
505
|
+
return target;
|
|
506
|
+
}
|
|
492
507
|
return Reflect.get(target, prop, receiver);
|
|
493
508
|
}
|
|
494
509
|
});
|
|
@@ -846,7 +846,7 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
|
|
|
846
846
|
})
|
|
847
847
|
}, hoverDecorationProps(nodeType, _editorSharedStyles.akEditorSelectedNodeClassName)), _objectSpread({
|
|
848
848
|
title: intl === null || intl === void 0 ? void 0 : intl.formatMessage(_messages.default.delete),
|
|
849
|
-
onClick: (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup
|
|
849
|
+
onClick: (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup ? handleRemoveMediaGroupWithAnalytics(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a1 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a1 === void 0 ? void 0 : _pluginInjectionApi$a1.actions) : removeWithAnalytics(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a10 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a10 === void 0 ? void 0 : _pluginInjectionApi$a10.actions, selectedNodeType),
|
|
850
850
|
icon: /*#__PURE__*/_react.default.createElement(_delete.default, {
|
|
851
851
|
label: ""
|
|
852
852
|
})
|
|
@@ -16,6 +16,7 @@ import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
|
16
16
|
import { isFileIdentifier } from '@atlaskit/media-client';
|
|
17
17
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
18
18
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
19
20
|
import { updateMediaNodeAttrs } from '../pm-plugins/commands/helpers';
|
|
20
21
|
// Ignored via go/ees005
|
|
21
22
|
// eslint-disable-next-line import/no-namespace
|
|
@@ -461,11 +462,25 @@ export class MediaPluginStateImplementation {
|
|
|
461
462
|
}
|
|
462
463
|
clone() {
|
|
463
464
|
const clonedAt = (performance || Date).now();
|
|
464
|
-
|
|
465
|
+
|
|
466
|
+
// Prevent double wrapping
|
|
467
|
+
// If clone is repeatedly called, we want to proxy the underlying MediaPluginStateImplementation target, rather than the proxy itself
|
|
468
|
+
// If we proxy the proxy, then calling get in future will need to recursively unwrap proxies to find the original target, which causes performance issues
|
|
469
|
+
// Instead, we check if there is an original target stored on "this", and if so, we use that as the proxy target instead
|
|
470
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias -- This is required while this is behind a feature-gate. Once the feature-gate is removed, we can inline proxyTarget as "(this as unknown as { originalTarget?: typeof proxyTarget }).originalTarget ?? this"
|
|
471
|
+
let proxyTarget = this;
|
|
472
|
+
const originalTarget = this.originalTarget;
|
|
473
|
+
if (originalTarget !== undefined && expValEquals('platform_editor_fix_clone_nesting_exp', 'isEnabled', true)) {
|
|
474
|
+
proxyTarget = originalTarget;
|
|
475
|
+
}
|
|
476
|
+
return new Proxy(proxyTarget, {
|
|
465
477
|
get(target, prop, receiver) {
|
|
466
478
|
if (prop === 'singletonCreatedAt') {
|
|
467
479
|
return clonedAt;
|
|
468
480
|
}
|
|
481
|
+
if (prop === 'originalTarget') {
|
|
482
|
+
return target;
|
|
483
|
+
}
|
|
469
484
|
return Reflect.get(target, prop, receiver);
|
|
470
485
|
}
|
|
471
486
|
});
|
|
@@ -847,7 +847,7 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
|
|
|
847
847
|
...hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)
|
|
848
848
|
}, {
|
|
849
849
|
title: intl === null || intl === void 0 ? void 0 : intl.formatMessage(commonMessages.delete),
|
|
850
|
-
onClick: (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup
|
|
850
|
+
onClick: (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup ? handleRemoveMediaGroupWithAnalytics(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a1 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a1 === void 0 ? void 0 : _pluginInjectionApi$a1.actions) : removeWithAnalytics(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a10 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a10 === void 0 ? void 0 : _pluginInjectionApi$a10.actions, selectedNodeType),
|
|
851
851
|
icon: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
852
852
|
label: ""
|
|
853
853
|
}),
|
|
@@ -25,6 +25,7 @@ import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
|
25
25
|
import { isFileIdentifier } from '@atlaskit/media-client';
|
|
26
26
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
27
27
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
28
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
28
29
|
import { updateMediaNodeAttrs } from '../pm-plugins/commands/helpers';
|
|
29
30
|
// Ignored via go/ees005
|
|
30
31
|
// eslint-disable-next-line import/no-namespace
|
|
@@ -476,11 +477,25 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
476
477
|
key: "clone",
|
|
477
478
|
value: function clone() {
|
|
478
479
|
var clonedAt = (performance || Date).now();
|
|
479
|
-
|
|
480
|
+
|
|
481
|
+
// Prevent double wrapping
|
|
482
|
+
// If clone is repeatedly called, we want to proxy the underlying MediaPluginStateImplementation target, rather than the proxy itself
|
|
483
|
+
// If we proxy the proxy, then calling get in future will need to recursively unwrap proxies to find the original target, which causes performance issues
|
|
484
|
+
// Instead, we check if there is an original target stored on "this", and if so, we use that as the proxy target instead
|
|
485
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias -- This is required while this is behind a feature-gate. Once the feature-gate is removed, we can inline proxyTarget as "(this as unknown as { originalTarget?: typeof proxyTarget }).originalTarget ?? this"
|
|
486
|
+
var proxyTarget = this;
|
|
487
|
+
var originalTarget = this.originalTarget;
|
|
488
|
+
if (originalTarget !== undefined && expValEquals('platform_editor_fix_clone_nesting_exp', 'isEnabled', true)) {
|
|
489
|
+
proxyTarget = originalTarget;
|
|
490
|
+
}
|
|
491
|
+
return new Proxy(proxyTarget, {
|
|
480
492
|
get: function get(target, prop, receiver) {
|
|
481
493
|
if (prop === 'singletonCreatedAt') {
|
|
482
494
|
return clonedAt;
|
|
483
495
|
}
|
|
496
|
+
if (prop === 'originalTarget') {
|
|
497
|
+
return target;
|
|
498
|
+
}
|
|
484
499
|
return Reflect.get(target, prop, receiver);
|
|
485
500
|
}
|
|
486
501
|
});
|
|
@@ -837,7 +837,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
837
837
|
})
|
|
838
838
|
}, hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)), _objectSpread({
|
|
839
839
|
title: intl === null || intl === void 0 ? void 0 : intl.formatMessage(commonMessages.delete),
|
|
840
|
-
onClick: (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup
|
|
840
|
+
onClick: (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup ? handleRemoveMediaGroupWithAnalytics(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a1 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a1 === void 0 ? void 0 : _pluginInjectionApi$a1.actions) : removeWithAnalytics(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a10 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a10 === void 0 ? void 0 : _pluginInjectionApi$a10.actions, selectedNodeType),
|
|
841
841
|
icon: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
842
842
|
label: ""
|
|
843
843
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.4",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@atlaskit/primitives": "^16.0.0",
|
|
67
67
|
"@atlaskit/textfield": "^8.0.0",
|
|
68
68
|
"@atlaskit/theme": "^21.0.0",
|
|
69
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
69
|
+
"@atlaskit/tmp-editor-statsig": "^13.19.0",
|
|
70
70
|
"@atlaskit/tokens": "^7.0.0",
|
|
71
71
|
"@atlaskit/tooltip": "^20.6.0",
|
|
72
72
|
"@babel/runtime": "^7.0.0",
|
|
@@ -160,9 +160,6 @@
|
|
|
160
160
|
"platform_media_video_captions": {
|
|
161
161
|
"type": "boolean"
|
|
162
162
|
},
|
|
163
|
-
"platform_editor_fix_media_card_removal": {
|
|
164
|
-
"type": "boolean"
|
|
165
|
-
},
|
|
166
163
|
"jira_kuro-jjj_disable_auto_focus_after_img_upload": {
|
|
167
164
|
"type": "boolean"
|
|
168
165
|
}
|