@atlaskit/editor-plugin-media-insert 3.2.5 → 3.2.6
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 +10 -0
- package/dist/cjs/ui/MediaInsertPicker.js +27 -23
- package/dist/cjs/ui/MediaInsertWrapper.js +7 -4
- package/dist/es2019/ui/MediaInsertPicker.js +5 -3
- package/dist/es2019/ui/MediaInsertWrapper.js +5 -4
- package/dist/esm/ui/MediaInsertPicker.js +28 -24
- package/dist/esm/ui/MediaInsertWrapper.js +4 -3
- package/dist/types/ui/MediaInsertWrapper.d.ts +2 -2
- package/dist/types-ts4.5/ui/MediaInsertWrapper.d.ts +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media-insert
|
|
2
2
|
|
|
3
|
+
## 3.2.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#157489](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/157489)
|
|
8
|
+
[`00657197923b2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/00657197923b2) -
|
|
9
|
+
We are testing replacing findDOMNode with an explicit ref behind a feature flag. If this fix is
|
|
10
|
+
successful it will be available in a later release.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 3.2.5
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -138,27 +138,31 @@ var MediaInsertPicker = exports.MediaInsertPicker = function MediaInsertPicker(_
|
|
|
138
138
|
preventOverflow: true,
|
|
139
139
|
onPositionCalculated: onPositionCalculated,
|
|
140
140
|
focusTrap: true
|
|
141
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
141
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.PlainOutsideClickTargetRefContext.Consumer, null, function (setOutsideClickTargetRef) {
|
|
142
|
+
return /*#__PURE__*/_react.default.createElement(_MediaInsertWrapper.MediaInsertWrapper, {
|
|
143
|
+
ref: setOutsideClickTargetRef
|
|
144
|
+
}, /*#__PURE__*/_react.default.createElement(_tabs.default, {
|
|
145
|
+
id: "media-insert-tab-navigation"
|
|
146
|
+
}, /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
147
|
+
paddingBlockEnd: "space.150"
|
|
148
|
+
}, /*#__PURE__*/_react.default.createElement(_tabs.TabList, null, /*#__PURE__*/_react.default.createElement(_tabs.Tab, null, intl.formatMessage(_messages.mediaInsertMessages.fileTabTitle)), /*#__PURE__*/_react.default.createElement(_tabs.Tab, null, intl.formatMessage(_messages.mediaInsertMessages.linkTabTitle)))), /*#__PURE__*/_react.default.createElement(CustomTabPanel, null, /*#__PURE__*/_react.default.createElement(_LocalMedia.LocalMedia, {
|
|
149
|
+
ref: autofocusRef,
|
|
150
|
+
mediaProvider: mediaProvider,
|
|
151
|
+
closeMediaInsertPicker: function closeMediaInsertPicker() {
|
|
152
|
+
_closeMediaInsertPicker();
|
|
153
|
+
focusEditor();
|
|
154
|
+
},
|
|
155
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
156
|
+
insertFile: insertFile
|
|
157
|
+
})), /*#__PURE__*/_react.default.createElement(CustomTabPanel, null, /*#__PURE__*/_react.default.createElement(_MediaFromURL.MediaFromURL, {
|
|
158
|
+
mediaProvider: mediaProvider,
|
|
159
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
160
|
+
closeMediaInsertPicker: function closeMediaInsertPicker() {
|
|
161
|
+
_closeMediaInsertPicker();
|
|
162
|
+
focusEditor();
|
|
163
|
+
},
|
|
164
|
+
insertMediaSingle: insertMediaSingle,
|
|
165
|
+
insertExternalMediaSingle: insertExternalMediaSingle
|
|
166
|
+
}))));
|
|
167
|
+
}));
|
|
164
168
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.MediaInsertWrapper = void 0;
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _primitives = require("@atlaskit/primitives");
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
12
|
var styles = (0, _primitives.xcss)({
|
|
11
13
|
/* Reset inherited styles from toolbar */
|
|
12
14
|
whiteSpace: 'initial',
|
|
@@ -17,9 +19,10 @@ var styles = (0, _primitives.xcss)({
|
|
|
17
19
|
borderRadius: 'border.radius',
|
|
18
20
|
backgroundColor: 'elevation.surface.overlay'
|
|
19
21
|
});
|
|
20
|
-
var MediaInsertWrapper = exports.MediaInsertWrapper = function
|
|
22
|
+
var MediaInsertWrapper = exports.MediaInsertWrapper = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
21
23
|
var children = _ref.children;
|
|
22
24
|
return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
25
|
+
ref: ref,
|
|
23
26
|
xcss: styles
|
|
24
27
|
}, children);
|
|
25
|
-
};
|
|
28
|
+
});
|
|
@@ -4,7 +4,7 @@ import { useIntl } from 'react-intl-next';
|
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
6
6
|
import { mediaInsertMessages } from '@atlaskit/editor-common/messages';
|
|
7
|
-
import { Popup, withOuterListeners } from '@atlaskit/editor-common/ui';
|
|
7
|
+
import { PlainOutsideClickTargetRefContext, Popup, withOuterListeners } from '@atlaskit/editor-common/ui';
|
|
8
8
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
9
9
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import { Box } from '@atlaskit/primitives';
|
|
@@ -130,7 +130,9 @@ export const MediaInsertPicker = ({
|
|
|
130
130
|
preventOverflow: true,
|
|
131
131
|
onPositionCalculated: onPositionCalculated,
|
|
132
132
|
focusTrap: true
|
|
133
|
-
}, /*#__PURE__*/React.createElement(
|
|
133
|
+
}, /*#__PURE__*/React.createElement(PlainOutsideClickTargetRefContext.Consumer, null, setOutsideClickTargetRef => /*#__PURE__*/React.createElement(MediaInsertWrapper, {
|
|
134
|
+
ref: setOutsideClickTargetRef
|
|
135
|
+
}, /*#__PURE__*/React.createElement(Tabs, {
|
|
134
136
|
id: "media-insert-tab-navigation"
|
|
135
137
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
136
138
|
paddingBlockEnd: "space.150"
|
|
@@ -152,5 +154,5 @@ export const MediaInsertPicker = ({
|
|
|
152
154
|
},
|
|
153
155
|
insertMediaSingle: insertMediaSingle,
|
|
154
156
|
insertExternalMediaSingle: insertExternalMediaSingle
|
|
155
|
-
})))));
|
|
157
|
+
}))))));
|
|
156
158
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
2
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
3
3
|
const styles = xcss({
|
|
4
4
|
/* Reset inherited styles from toolbar */
|
|
@@ -10,10 +10,11 @@ const styles = xcss({
|
|
|
10
10
|
borderRadius: 'border.radius',
|
|
11
11
|
backgroundColor: 'elevation.surface.overlay'
|
|
12
12
|
});
|
|
13
|
-
export const MediaInsertWrapper = ({
|
|
13
|
+
export const MediaInsertWrapper = /*#__PURE__*/forwardRef(({
|
|
14
14
|
children
|
|
15
|
-
}) => {
|
|
15
|
+
}, ref) => {
|
|
16
16
|
return /*#__PURE__*/React.createElement(Box, {
|
|
17
|
+
ref: ref,
|
|
17
18
|
xcss: styles
|
|
18
19
|
}, children);
|
|
19
|
-
};
|
|
20
|
+
});
|
|
@@ -4,7 +4,7 @@ import { useIntl } from 'react-intl-next';
|
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
6
6
|
import { mediaInsertMessages } from '@atlaskit/editor-common/messages';
|
|
7
|
-
import { Popup, withOuterListeners } from '@atlaskit/editor-common/ui';
|
|
7
|
+
import { PlainOutsideClickTargetRefContext, Popup, withOuterListeners } from '@atlaskit/editor-common/ui';
|
|
8
8
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
9
9
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import { Box } from '@atlaskit/primitives';
|
|
@@ -128,27 +128,31 @@ export var MediaInsertPicker = function MediaInsertPicker(_ref2) {
|
|
|
128
128
|
preventOverflow: true,
|
|
129
129
|
onPositionCalculated: onPositionCalculated,
|
|
130
130
|
focusTrap: true
|
|
131
|
-
}, /*#__PURE__*/React.createElement(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
131
|
+
}, /*#__PURE__*/React.createElement(PlainOutsideClickTargetRefContext.Consumer, null, function (setOutsideClickTargetRef) {
|
|
132
|
+
return /*#__PURE__*/React.createElement(MediaInsertWrapper, {
|
|
133
|
+
ref: setOutsideClickTargetRef
|
|
134
|
+
}, /*#__PURE__*/React.createElement(Tabs, {
|
|
135
|
+
id: "media-insert-tab-navigation"
|
|
136
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
137
|
+
paddingBlockEnd: "space.150"
|
|
138
|
+
}, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, null, intl.formatMessage(mediaInsertMessages.fileTabTitle)), /*#__PURE__*/React.createElement(Tab, null, intl.formatMessage(mediaInsertMessages.linkTabTitle)))), /*#__PURE__*/React.createElement(CustomTabPanel, null, /*#__PURE__*/React.createElement(LocalMedia, {
|
|
139
|
+
ref: autofocusRef,
|
|
140
|
+
mediaProvider: mediaProvider,
|
|
141
|
+
closeMediaInsertPicker: function closeMediaInsertPicker() {
|
|
142
|
+
_closeMediaInsertPicker();
|
|
143
|
+
focusEditor();
|
|
144
|
+
},
|
|
145
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
146
|
+
insertFile: insertFile
|
|
147
|
+
})), /*#__PURE__*/React.createElement(CustomTabPanel, null, /*#__PURE__*/React.createElement(MediaFromURL, {
|
|
148
|
+
mediaProvider: mediaProvider,
|
|
149
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
150
|
+
closeMediaInsertPicker: function closeMediaInsertPicker() {
|
|
151
|
+
_closeMediaInsertPicker();
|
|
152
|
+
focusEditor();
|
|
153
|
+
},
|
|
154
|
+
insertMediaSingle: insertMediaSingle,
|
|
155
|
+
insertExternalMediaSingle: insertExternalMediaSingle
|
|
156
|
+
}))));
|
|
157
|
+
}));
|
|
154
158
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
2
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
3
3
|
var styles = xcss({
|
|
4
4
|
/* Reset inherited styles from toolbar */
|
|
@@ -10,9 +10,10 @@ var styles = xcss({
|
|
|
10
10
|
borderRadius: 'border.radius',
|
|
11
11
|
backgroundColor: 'elevation.surface.overlay'
|
|
12
12
|
});
|
|
13
|
-
export var MediaInsertWrapper = function
|
|
13
|
+
export var MediaInsertWrapper = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
14
14
|
var children = _ref.children;
|
|
15
15
|
return /*#__PURE__*/React.createElement(Box, {
|
|
16
|
+
ref: ref,
|
|
16
17
|
xcss: styles
|
|
17
18
|
}, children);
|
|
18
|
-
};
|
|
19
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media-insert",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.6",
|
|
4
4
|
"description": "Media Insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@atlaskit/adf-schema": "^42.3.1",
|
|
27
27
|
"@atlaskit/button": "^20.3.0",
|
|
28
|
-
"@atlaskit/editor-common": "^94.
|
|
28
|
+
"@atlaskit/editor-common": "^94.6.0",
|
|
29
29
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
30
30
|
"@atlaskit/editor-plugin-media": "^1.38.0",
|
|
31
31
|
"@atlaskit/editor-prosemirror": "6.0.0",
|