@atlaskit/editor-plugin-media 1.2.1 → 1.2.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,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 1.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#74284](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/74284) [`c88cf104546f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c88cf104546f) - fix copy paste issue in excel and numbers that paste table results in screenshot of table pasted
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 1.2.1
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -14,12 +14,14 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
16
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
18
|
var _BrowserWrapper = require("./BrowserWrapper");
|
|
18
19
|
var _ClipboardWrapper = require("./ClipboardWrapper");
|
|
19
20
|
var _DropzoneWrapper = require("./DropzoneWrapper");
|
|
20
21
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
21
22
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
22
23
|
var MediaPicker = function MediaPicker(_ref) {
|
|
24
|
+
var _editorDom$parentElem;
|
|
23
25
|
var api = _ref.api,
|
|
24
26
|
isPopupOpened = _ref.isPopupOpened,
|
|
25
27
|
appearance = _ref.appearance,
|
|
@@ -29,7 +31,16 @@ var MediaPicker = function MediaPicker(_ref) {
|
|
|
29
31
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['focus']),
|
|
30
32
|
focusState = _useSharedPluginState.focusState;
|
|
31
33
|
var featureFlags = mediaState.mediaOptions && mediaState.mediaOptions.featureFlags;
|
|
32
|
-
var
|
|
34
|
+
var editorDom = editorDomElement;
|
|
35
|
+
var editorParent = (_editorDom$parentElem = editorDom.parentElement) !== null && _editorDom$parentElem !== void 0 ? _editorDom$parentElem : undefined;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* https://product-fabric.atlassian.net/browse/ED-21993
|
|
39
|
+
* Avoid attach paste event to same dom element,
|
|
40
|
+
* so editor-paste-plugin can use stopPropagation,
|
|
41
|
+
* as stopImmediatePropagation could cause race condition issues
|
|
42
|
+
*/
|
|
43
|
+
var container = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.media.fix-copy-paste-excel_62g4s') ? editorParent : editorDom;
|
|
33
44
|
var clipboard = focusState !== null && focusState !== void 0 && focusState.hasFocus ? /*#__PURE__*/_react.default.createElement(_ClipboardWrapper.ClipboardWrapper, {
|
|
34
45
|
mediaState: mediaState,
|
|
35
46
|
featureFlags: featureFlags,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
4
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { BrowserWrapper } from './BrowserWrapper';
|
|
5
6
|
import { ClipboardWrapper } from './ClipboardWrapper';
|
|
6
7
|
import { DropzoneWrapper } from './DropzoneWrapper';
|
|
@@ -12,11 +13,21 @@ const MediaPicker = ({
|
|
|
12
13
|
onBrowseFn,
|
|
13
14
|
editorDomElement
|
|
14
15
|
}) => {
|
|
16
|
+
var _editorDom$parentElem;
|
|
15
17
|
const {
|
|
16
18
|
focusState
|
|
17
19
|
} = useSharedPluginState(api, ['focus']);
|
|
18
20
|
const featureFlags = mediaState.mediaOptions && mediaState.mediaOptions.featureFlags;
|
|
19
|
-
const
|
|
21
|
+
const editorDom = editorDomElement;
|
|
22
|
+
const editorParent = (_editorDom$parentElem = editorDom.parentElement) !== null && _editorDom$parentElem !== void 0 ? _editorDom$parentElem : undefined;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* https://product-fabric.atlassian.net/browse/ED-21993
|
|
26
|
+
* Avoid attach paste event to same dom element,
|
|
27
|
+
* so editor-paste-plugin can use stopPropagation,
|
|
28
|
+
* as stopImmediatePropagation could cause race condition issues
|
|
29
|
+
*/
|
|
30
|
+
const container = getBooleanFF('platform.editor.media.fix-copy-paste-excel_62g4s') ? editorParent : editorDom;
|
|
20
31
|
const clipboard = focusState !== null && focusState !== void 0 && focusState.hasFocus ? /*#__PURE__*/React.createElement(ClipboardWrapper, {
|
|
21
32
|
mediaState: mediaState,
|
|
22
33
|
featureFlags: featureFlags,
|
|
@@ -9,10 +9,12 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
9
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
12
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { BrowserWrapper } from './BrowserWrapper';
|
|
13
14
|
import { ClipboardWrapper } from './ClipboardWrapper';
|
|
14
15
|
import { DropzoneWrapper } from './DropzoneWrapper';
|
|
15
16
|
var MediaPicker = function MediaPicker(_ref) {
|
|
17
|
+
var _editorDom$parentElem;
|
|
16
18
|
var api = _ref.api,
|
|
17
19
|
isPopupOpened = _ref.isPopupOpened,
|
|
18
20
|
appearance = _ref.appearance,
|
|
@@ -22,7 +24,16 @@ var MediaPicker = function MediaPicker(_ref) {
|
|
|
22
24
|
var _useSharedPluginState = useSharedPluginState(api, ['focus']),
|
|
23
25
|
focusState = _useSharedPluginState.focusState;
|
|
24
26
|
var featureFlags = mediaState.mediaOptions && mediaState.mediaOptions.featureFlags;
|
|
25
|
-
var
|
|
27
|
+
var editorDom = editorDomElement;
|
|
28
|
+
var editorParent = (_editorDom$parentElem = editorDom.parentElement) !== null && _editorDom$parentElem !== void 0 ? _editorDom$parentElem : undefined;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* https://product-fabric.atlassian.net/browse/ED-21993
|
|
32
|
+
* Avoid attach paste event to same dom element,
|
|
33
|
+
* so editor-paste-plugin can use stopPropagation,
|
|
34
|
+
* as stopImmediatePropagation could cause race condition issues
|
|
35
|
+
*/
|
|
36
|
+
var container = getBooleanFF('platform.editor.media.fix-copy-paste-excel_62g4s') ? editorParent : editorDom;
|
|
26
37
|
var clipboard = focusState !== null && focusState !== void 0 && focusState.hasFocus ? /*#__PURE__*/React.createElement(ClipboardWrapper, {
|
|
27
38
|
mediaState: mediaState,
|
|
28
39
|
featureFlags: featureFlags,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/analytics-namespaced-context": "^6.9.0",
|
|
38
38
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
39
39
|
"@atlaskit/button": "^17.4.0",
|
|
40
|
-
"@atlaskit/editor-common": "^78.
|
|
40
|
+
"@atlaskit/editor-common": "^78.3.0",
|
|
41
41
|
"@atlaskit/editor-palette": "1.5.2",
|
|
42
42
|
"@atlaskit/editor-plugin-analytics": "^1.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-decorations": "^1.0.0",
|
|
@@ -140,6 +140,9 @@
|
|
|
140
140
|
},
|
|
141
141
|
"platform.editor.allow-extended-panel": {
|
|
142
142
|
"type": "boolean"
|
|
143
|
+
},
|
|
144
|
+
"platform.editor.media.fix-copy-paste-excel_62g4s": {
|
|
145
|
+
"type": "boolean"
|
|
143
146
|
}
|
|
144
147
|
},
|
|
145
148
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
|