@atlaskit/editor-plugin-media 1.2.1 → 1.2.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,18 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 1.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 1.2.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#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
14
+ - Updated dependencies
15
+
3
16
  ## 1.2.1
4
17
 
5
18
  ### Patch Changes
@@ -123,6 +123,7 @@ var LinkAddToolbar = exports.LinkAddToolbar = /*#__PURE__*/function (_React$Pure
123
123
  });
124
124
  }
125
125
  })), (0, _react2.jsx)(_ui.PanelTextInput, {
126
+ inputId: "media-link-search-input",
126
127
  testId: "media-link-input",
127
128
  placeholder: getPlaceholder(!!activityProvider),
128
129
  autoFocus: true,
@@ -144,7 +145,10 @@ var LinkAddToolbar = exports.LinkAddToolbar = /*#__PURE__*/function (_React$Pure
144
145
  _onChange(value);
145
146
  },
146
147
  onKeyDown: onKeyDown
147
- }), (0, _utils.normalizeUrl)(displayUrl) && (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null), (0, _react2.jsx)(_ui.FloatingToolbarButton, {
148
+ }), (0, _react2.jsx)("label", {
149
+ className: "assistive",
150
+ htmlFor: "media-link-search-input"
151
+ }, formatMessage(_messages.linkToolbarMessages.searchInput)), (0, _utils.normalizeUrl)(displayUrl) && (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null), (0, _react2.jsx)(_ui.FloatingToolbarButton, {
148
152
  title: formatUnlinkText,
149
153
  icon: (0, _react2.jsx)(_unlink.default, {
150
154
  label: formatUnlinkText
@@ -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 container = editorDomElement;
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,
@@ -119,6 +119,7 @@ export class LinkAddToolbar extends React.PureComponent {
119
119
  inputMethod: currentInputMethod
120
120
  })
121
121
  })), jsx(PanelTextInput, {
122
+ inputId: "media-link-search-input",
122
123
  testId: "media-link-input",
123
124
  placeholder: getPlaceholder(!!activityProvider),
124
125
  autoFocus: true,
@@ -140,7 +141,10 @@ export class LinkAddToolbar extends React.PureComponent {
140
141
  onChange(value);
141
142
  },
142
143
  onKeyDown: onKeyDown
143
- }), normalizeUrl(displayUrl) && jsx(Fragment, null, jsx(Separator, null), jsx(Button, {
144
+ }), jsx("label", {
145
+ className: "assistive",
146
+ htmlFor: "media-link-search-input"
147
+ }, formatMessage(linkToolbarMessages.searchInput)), normalizeUrl(displayUrl) && jsx(Fragment, null, jsx(Separator, null), jsx(Button, {
144
148
  title: formatUnlinkText,
145
149
  icon: jsx(EditorUnlinkIcon, {
146
150
  label: formatUnlinkText
@@ -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 container = editorDomElement;
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,
@@ -115,6 +115,7 @@ export var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
115
115
  });
116
116
  }
117
117
  })), jsx(PanelTextInput, {
118
+ inputId: "media-link-search-input",
118
119
  testId: "media-link-input",
119
120
  placeholder: getPlaceholder(!!activityProvider),
120
121
  autoFocus: true,
@@ -136,7 +137,10 @@ export var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
136
137
  _onChange(value);
137
138
  },
138
139
  onKeyDown: onKeyDown
139
- }), normalizeUrl(displayUrl) && jsx(Fragment, null, jsx(Separator, null), jsx(Button, {
140
+ }), jsx("label", {
141
+ className: "assistive",
142
+ htmlFor: "media-link-search-input"
143
+ }, formatMessage(linkToolbarMessages.searchInput)), normalizeUrl(displayUrl) && jsx(Fragment, null, jsx(Separator, null), jsx(Button, {
140
144
  title: formatUnlinkText,
141
145
  icon: jsx(EditorUnlinkIcon, {
142
146
  label: formatUnlinkText
@@ -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 container = editorDomElement;
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.1",
3
+ "version": "1.2.3",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,36 +36,36 @@
36
36
  "@atlaskit/adf-schema": "^35.5.1",
37
37
  "@atlaskit/analytics-namespaced-context": "^6.9.0",
38
38
  "@atlaskit/analytics-next": "^9.2.0",
39
- "@atlaskit/button": "^17.4.0",
40
- "@atlaskit/editor-common": "^78.0.0",
39
+ "@atlaskit/button": "^17.6.0",
40
+ "@atlaskit/editor-common": "^78.7.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",
44
44
  "@atlaskit/editor-plugin-editor-disabled": "^1.0.0",
45
- "@atlaskit/editor-plugin-floating-toolbar": "^1.1.0",
45
+ "@atlaskit/editor-plugin-floating-toolbar": "^1.2.0",
46
46
  "@atlaskit/editor-plugin-focus": "^1.0.0",
47
47
  "@atlaskit/editor-plugin-grid": "^1.0.0",
48
48
  "@atlaskit/editor-plugin-guideline": "^1.0.0",
49
- "@atlaskit/editor-plugin-selection": "^1.0.0",
49
+ "@atlaskit/editor-plugin-selection": "^1.1.0",
50
50
  "@atlaskit/editor-plugin-width": "^1.0.0",
51
51
  "@atlaskit/editor-prosemirror": "3.0.0",
52
52
  "@atlaskit/editor-shared-styles": "^2.9.0",
53
53
  "@atlaskit/editor-tables": "^2.5.0",
54
54
  "@atlaskit/form": "^9.0.3",
55
- "@atlaskit/icon": "^22.0.0",
55
+ "@atlaskit/icon": "^22.1.0",
56
56
  "@atlaskit/media-card": "^77.10.0",
57
57
  "@atlaskit/media-client": "^26.2.0",
58
58
  "@atlaskit/media-client-react": "^2.0.0",
59
59
  "@atlaskit/media-common": "^11.0.0",
60
60
  "@atlaskit/media-filmstrip": "^47.0.0",
61
61
  "@atlaskit/media-picker": "^66.3.0",
62
- "@atlaskit/media-ui": "^25.1.0",
62
+ "@atlaskit/media-ui": "^25.2.0",
63
63
  "@atlaskit/media-viewer": "^48.2.0",
64
64
  "@atlaskit/platform-feature-flags": "^0.2.0",
65
- "@atlaskit/primitives": "^2.0.0",
65
+ "@atlaskit/primitives": "^3.0.0",
66
66
  "@atlaskit/textfield": "^6.0.0",
67
67
  "@atlaskit/theme": "^12.6.0",
68
- "@atlaskit/tokens": "^1.37.0",
68
+ "@atlaskit/tokens": "^1.38.0",
69
69
  "@atlaskit/tooltip": "^18.1.0",
70
70
  "@babel/runtime": "^7.0.0",
71
71
  "@emotion/react": "^11.7.1",
@@ -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",