@atlaskit/editor-plugin-media 1.29.4 → 1.29.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 +18 -0
- package/dist/cjs/nodeviews/mediaInline.js +3 -3
- package/dist/cjs/plugin.js +1 -7
- package/dist/cjs/pm-plugins/alt-text/commands.js +2 -2
- package/dist/cjs/pm-plugins/alt-text/index.js +2 -2
- package/dist/cjs/pm-plugins/keymap.js +0 -1
- package/dist/cjs/toolbar/alt-text.js +2 -2
- package/dist/cjs/toolbar/mediaInline.js +2 -2
- package/dist/cjs/toolbar/utils.js +2 -2
- package/dist/cjs/ui/MediaLinkingToolbar.js +2 -2
- package/dist/cjs/ui/MediaViewer/MediaViewerContainer.js +3 -3
- package/dist/cjs/utils/media-common.js +3 -3
- package/dist/cjs/utils/media-single.js +2 -12
- package/dist/es2019/nodeviews/mediaInline.js +2 -2
- package/dist/es2019/plugin.js +1 -2
- package/dist/es2019/pm-plugins/alt-text/commands.js +1 -1
- package/dist/es2019/pm-plugins/alt-text/index.js +1 -1
- package/dist/es2019/pm-plugins/keymap.js +1 -1
- package/dist/es2019/toolbar/alt-text.js +1 -1
- package/dist/es2019/toolbar/mediaInline.js +1 -1
- package/dist/es2019/toolbar/utils.js +1 -1
- package/dist/es2019/ui/MediaLinkingToolbar.js +1 -1
- package/dist/es2019/ui/MediaViewer/MediaViewerContainer.js +3 -3
- package/dist/es2019/utils/media-common.js +2 -2
- package/dist/es2019/utils/media-single.js +1 -11
- package/dist/esm/nodeviews/mediaInline.js +2 -2
- package/dist/esm/plugin.js +1 -2
- package/dist/esm/pm-plugins/alt-text/commands.js +1 -1
- package/dist/esm/pm-plugins/alt-text/index.js +1 -1
- package/dist/esm/pm-plugins/keymap.js +1 -1
- package/dist/esm/toolbar/alt-text.js +1 -1
- package/dist/esm/toolbar/mediaInline.js +1 -1
- package/dist/esm/toolbar/utils.js +1 -1
- package/dist/esm/ui/MediaLinkingToolbar.js +1 -1
- package/dist/esm/ui/MediaViewer/MediaViewerContainer.js +3 -3
- package/dist/esm/utils/media-common.js +2 -2
- package/dist/esm/utils/media-single.js +1 -9
- package/dist/types/nodeviews/mediaGroup.d.ts +1 -5
- package/dist/types/nodeviews/mediaInline.d.ts +2 -10
- package/dist/types/nodeviews/mediaNodeUpdater.d.ts +2 -1
- package/dist/types/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types/picker-facade.d.ts +4 -8
- package/dist/types/plugin.d.ts +0 -5
- package/dist/types/pm-plugins/alt-text/commands.d.ts +0 -2
- package/dist/types/pm-plugins/alt-text/index.d.ts +0 -2
- package/dist/types/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/pm-plugins/linking/actions.d.ts +5 -4
- package/dist/types/pm-plugins/main.d.ts +2 -2
- package/dist/types/toolbar/alt-text.d.ts +3 -3
- package/dist/types/toolbar/mediaInline.d.ts +0 -3
- package/dist/types/toolbar/utils.d.ts +0 -1
- package/dist/types/ui/Media/DropPlaceholder.d.ts +1 -1
- package/dist/types/ui/MediaLinkingToolbar.d.ts +2 -2
- package/dist/types/ui/MediaPicker/PickerFacadeProvider.d.ts +2 -1
- package/dist/types/ui/MediaViewer/MediaViewerContainer.d.ts +0 -1
- package/dist/types/ui/PixelEntry/types.d.ts +2 -1
- package/dist/types/ui/ToolbarMedia/index.d.ts +1 -1
- package/dist/types/utils/media-common.d.ts +0 -2
- package/dist/types/utils/media-files.d.ts +0 -4
- package/dist/types/utils/media-inline.d.ts +2 -1
- package/dist/types/utils/media-single.d.ts +0 -10
- package/dist/types-ts4.5/nodeviews/mediaGroup.d.ts +1 -5
- package/dist/types-ts4.5/nodeviews/mediaInline.d.ts +2 -10
- package/dist/types-ts4.5/nodeviews/mediaNodeUpdater.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types-ts4.5/picker-facade.d.ts +4 -8
- package/dist/types-ts4.5/plugin.d.ts +0 -5
- package/dist/types-ts4.5/pm-plugins/alt-text/commands.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/alt-text/index.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/linking/actions.d.ts +5 -4
- package/dist/types-ts4.5/pm-plugins/main.d.ts +2 -2
- package/dist/types-ts4.5/toolbar/alt-text.d.ts +3 -3
- package/dist/types-ts4.5/toolbar/mediaInline.d.ts +0 -3
- package/dist/types-ts4.5/toolbar/utils.d.ts +0 -1
- package/dist/types-ts4.5/ui/Media/DropPlaceholder.d.ts +1 -1
- package/dist/types-ts4.5/ui/MediaLinkingToolbar.d.ts +2 -2
- package/dist/types-ts4.5/ui/MediaPicker/PickerFacadeProvider.d.ts +2 -1
- package/dist/types-ts4.5/ui/MediaViewer/MediaViewerContainer.d.ts +0 -1
- package/dist/types-ts4.5/ui/PixelEntry/types.d.ts +2 -1
- package/dist/types-ts4.5/ui/ToolbarMedia/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/media-common.d.ts +0 -2
- package/dist/types-ts4.5/utils/media-files.d.ts +0 -4
- package/dist/types-ts4.5/utils/media-inline.d.ts +2 -1
- package/dist/types-ts4.5/utils/media-single.d.ts +0 -10
- package/package.json +2 -2
- package/dist/cjs/commands/index.js +0 -24
- package/dist/es2019/commands/index.js +0 -1
- package/dist/esm/commands/index.js +0 -1
- package/dist/types/commands/index.d.ts +0 -1
- package/dist/types-ts4.5/commands/index.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 1.29.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#133462](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/133462)
|
|
8
|
+
[`bfd75eee7c115`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bfd75eee7c115) -
|
|
9
|
+
added keyword to media plugin so /file shows insert media first
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 1.29.5
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`638f18de80136`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/638f18de80136) -
|
|
17
|
+
Remove unused exports
|
|
18
|
+
- [`638f18de80136`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/638f18de80136) -
|
|
19
|
+
Remove unused exports
|
|
20
|
+
|
|
3
21
|
## 1.29.4
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.handleNewNode = exports.ReactMediaInlineNode = exports.MediaInlineNodeView = exports.MediaInline = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -34,7 +34,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
34
34
|
* @jsxRuntime classic
|
|
35
35
|
* @jsx jsx
|
|
36
36
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
37
|
-
var createMediaNodeUpdater =
|
|
37
|
+
var createMediaNodeUpdater = function createMediaNodeUpdater(props) {
|
|
38
38
|
var node = props.node;
|
|
39
39
|
return new _mediaNodeUpdater.MediaNodeUpdater(_objectSpread(_objectSpread({}, props), {}, {
|
|
40
40
|
isMediaSingle: true,
|
|
@@ -50,7 +50,7 @@ var createMediaNodeUpdater = exports.createMediaNodeUpdater = function createMed
|
|
|
50
50
|
* using the contextid
|
|
51
51
|
*
|
|
52
52
|
*/
|
|
53
|
-
var updateMediaNodeAttributes =
|
|
53
|
+
var updateMediaNodeAttributes = /*#__PURE__*/function () {
|
|
54
54
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(props, mediaNodeUpdater) {
|
|
55
55
|
var addPendingTask, node, contextId, hasDifferentContextId, copyNode;
|
|
56
56
|
return _regenerator.default.wrap(function _callee$(_context) {
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -4,12 +4,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
Object.defineProperty(exports, "insertMediaSingleNode", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function get() {
|
|
10
|
-
return _mediaSingle2.insertMediaSingleNode;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
7
|
exports.mediaPlugin = void 0;
|
|
14
8
|
var _react = _interopRequireDefault(require("react"));
|
|
15
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
@@ -262,7 +256,7 @@ var mediaPlugin = exports.mediaPlugin = function mediaPlugin(_ref2) {
|
|
|
262
256
|
title: formatMessage(_messages.toolbarInsertBlockMessages.mediaFiles),
|
|
263
257
|
description: formatMessage(_messages.toolbarInsertBlockMessages.mediaFilesDescription),
|
|
264
258
|
priority: 400,
|
|
265
|
-
keywords: ['attachment', 'gif', 'media', 'picture', 'image', 'video'],
|
|
259
|
+
keywords: ['attachment', 'gif', 'media', 'picture', 'image', 'video', 'file'],
|
|
266
260
|
icon: function icon() {
|
|
267
261
|
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconImages, null);
|
|
268
262
|
},
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.updateAltText = exports.openMediaAltTextMenu = exports.closeMediaAltTextMenuAndSave = exports.closeMediaAltTextMenu = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
10
|
var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
|
|
@@ -56,7 +56,7 @@ var openMediaAltTextMenu = exports.openMediaAltTextMenu = createCommandWithAnaly
|
|
|
56
56
|
}, function (tr) {
|
|
57
57
|
return tr.setMeta('scrollIntoView', false);
|
|
58
58
|
});
|
|
59
|
-
var updateAltTextTransform =
|
|
59
|
+
var updateAltTextTransform = function updateAltTextTransform(newAltText) {
|
|
60
60
|
return function (tr, state) {
|
|
61
61
|
var mediaNode = (0, _mediaCommon.getMediaSingleOrInlineNodeFromSelection)(state);
|
|
62
62
|
if (mediaNode) {
|
|
@@ -4,12 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.getPluginState = exports.createPlugin = exports.createCommand = void 0;
|
|
8
8
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
9
9
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
10
10
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
11
|
var _reducer = _interopRequireDefault(require("./reducer"));
|
|
12
|
-
var pluginKey =
|
|
12
|
+
var pluginKey = new _state.PluginKey('mediaAltTextPlugin');
|
|
13
13
|
var _pluginFactory = (0, _utils.pluginFactory)(pluginKey, _reducer.default, {
|
|
14
14
|
onSelectionChanged: function onSelectionChanged(tr, newState) {
|
|
15
15
|
// dont close alt text for undo/redo transactions (if it comes from prosemirror-history)
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
exports.keymapPlugin = keymapPlugin;
|
|
8
7
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
9
8
|
var _media = require("@atlaskit/editor-common/media");
|
|
10
9
|
var _mediaSingle = require("@atlaskit/editor-common/media-single");
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.getAltTextToolbar = exports.
|
|
8
|
+
exports.getAltTextToolbar = exports.altTextButton = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
@@ -37,7 +37,7 @@ var altTextButton = exports.altTextButton = function altTextButton(intl, state,
|
|
|
37
37
|
})
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
var altTextEditComponent =
|
|
40
|
+
var altTextEditComponent = function altTextEditComponent(options) {
|
|
41
41
|
return {
|
|
42
42
|
type: 'custom',
|
|
43
43
|
fallback: [],
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.generateMediaInlineFloatingToolbar = void 0;
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
11
|
var _card = require("@atlaskit/editor-common/card");
|
|
@@ -114,7 +114,7 @@ var generateMediaInlineFloatingToolbar = exports.generateMediaInlineFloatingTool
|
|
|
114
114
|
}];
|
|
115
115
|
return items;
|
|
116
116
|
};
|
|
117
|
-
var getMediaInlineImageToolbar =
|
|
117
|
+
var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl, mediaPluginState, hoverDecoration, editorAnalyticsAPI, pluginInjectionApi, mediaLinkingState) {
|
|
118
118
|
var _pluginInjectionApi$w;
|
|
119
119
|
var options = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {};
|
|
120
120
|
var mediaInline = state.schema.nodes.mediaInline;
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.removeMediaGroupNode = exports.getSelectedNearestMediaContainerNodeAttrs = exports.getSelectedMediaSingle = exports.
|
|
7
|
+
exports.removeMediaGroupNode = exports.getSelectedNearestMediaContainerNodeAttrs = exports.getSelectedMediaSingle = exports.getSelectedLayoutIcon = exports.getPixelWidthOfElement = exports.getMaxToolbarWidth = exports.downloadMedia = exports.canShowSwitchButtons = exports.calcNewLayout = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
@@ -14,7 +14,7 @@ var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
|
14
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
15
|
var _mediaClientReact = require("@atlaskit/media-client-react");
|
|
16
16
|
var _mediaSingle2 = require("../utils/media-single");
|
|
17
|
-
var getSelectedMediaContainerNodeAttrs =
|
|
17
|
+
var getSelectedMediaContainerNodeAttrs = function getSelectedMediaContainerNodeAttrs(mediaPluginState) {
|
|
18
18
|
var _mediaPluginState$sel;
|
|
19
19
|
var selectedNode = (_mediaPluginState$sel = mediaPluginState.selectedMediaContainerNode) === null || _mediaPluginState$sel === void 0 ? void 0 : _mediaPluginState$sel.call(mediaPluginState);
|
|
20
20
|
if (selectedNode && selectedNode.attrs) {
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = void 0;
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
11
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
@@ -46,7 +46,7 @@ var buttonWrapper = (0, _react2.css)({
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
49
|
-
var LinkAddToolbar =
|
|
49
|
+
var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
50
50
|
(0, _inherits2.default)(LinkAddToolbar, _React$PureComponent);
|
|
51
51
|
var _super = _createSuper(LinkAddToolbar);
|
|
52
52
|
function LinkAddToolbar() {
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.MediaViewerContainer = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
@@ -25,7 +25,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
25
25
|
var interactiveStyles = (0, _react2.css)({
|
|
26
26
|
cursor: 'pointer'
|
|
27
27
|
});
|
|
28
|
-
var mediaViewerContainerTestID =
|
|
28
|
+
var mediaViewerContainerTestID = 'media-viewer-container-test';
|
|
29
29
|
var MediaViewerContainer = exports.MediaViewerContainer = function MediaViewerContainer(_ref) {
|
|
30
30
|
var _mediaNode$firstChild;
|
|
31
31
|
var mediaNode = _ref.mediaNode,
|
|
@@ -53,7 +53,7 @@ var MediaViewerContainer = exports.MediaViewerContainer = function MediaViewerCo
|
|
|
53
53
|
setShowMediaViewer(false);
|
|
54
54
|
};
|
|
55
55
|
var isVideoMedia = (0, _isType.isVideo)((_mediaNode$firstChild = mediaNode.firstChild) === null || _mediaNode$firstChild === void 0 ? void 0 : _mediaNode$firstChild.attrs.__fileMimeType);
|
|
56
|
-
var enableMediaViewer = (0, _platformFeatureFlags.
|
|
56
|
+
var enableMediaViewer = (0, _platformFeatureFlags.fg)('platform.editor.media.preview-in-full-page') && isEditorViewMode;
|
|
57
57
|
var shouldShowViewer = enableMediaViewer && showViewer && selectedNodeAttrs && mediaClientConfig && !isVideoMedia;
|
|
58
58
|
return (0, _react2.jsx)(_react.Fragment, null, enableMediaViewer ? (0, _react2.jsx)(_react.Fragment, null, isInline ? (0, _react2.jsx)("span", {
|
|
59
59
|
onClick: showMediaViewer,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.splitMediaGroup = exports.removeMediaNode = exports.posOfPrecedingMediaGroup = exports.posOfParentMediaGroup = exports.posOfMediaGroupNearby = exports.isSelectionNonMediaBlockNode = exports.isSelectionMediaSingleNode = exports.
|
|
6
|
+
exports.splitMediaGroup = exports.removeMediaNode = exports.posOfPrecedingMediaGroup = exports.posOfParentMediaGroup = exports.posOfMediaGroupNearby = exports.isSelectionNonMediaBlockNode = exports.isSelectionMediaSingleNode = exports.isMediaSingleOrInlineNodeSelected = exports.isMediaBlobUrlFromAttrs = exports.isInsidePotentialEmptyParagraph = exports.getMediaSingleOrInlineNodeFromSelection = exports.getMediaNodeFromSelection = exports.copyOptionalAttrsFromMediaState = void 0;
|
|
7
7
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
8
8
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
9
|
var _commands = require("@atlaskit/editor-prosemirror/commands");
|
|
@@ -30,7 +30,7 @@ var isSelectionMediaSingleNode = exports.isSelectionMediaSingleNode = function i
|
|
|
30
30
|
node = _ref2.node;
|
|
31
31
|
return node && node.type === state.schema.nodes.mediaSingle;
|
|
32
32
|
};
|
|
33
|
-
var isSelectionMediaInlineNode =
|
|
33
|
+
var isSelectionMediaInlineNode = function isSelectionMediaInlineNode(state) {
|
|
34
34
|
var _ref3 = state.selection,
|
|
35
35
|
node = _ref3.node;
|
|
36
36
|
return node && node.type === state.schema.nodes.mediaInline;
|
|
@@ -185,7 +185,7 @@ var getMediaNodeFromSelection = exports.getMediaNodeFromSelection = function get
|
|
|
185
185
|
}
|
|
186
186
|
return null;
|
|
187
187
|
};
|
|
188
|
-
var getMediaInlineNodeFromSelection =
|
|
188
|
+
var getMediaInlineNodeFromSelection = function getMediaInlineNodeFromSelection(state) {
|
|
189
189
|
if (!isSelectionMediaInlineNode(state)) {
|
|
190
190
|
return null;
|
|
191
191
|
}
|
|
@@ -4,9 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
8
|
-
exports.isCaptionNode = isCaptionNode;
|
|
9
|
-
exports.isVideo = exports.isMediaSingle = void 0;
|
|
7
|
+
exports.isVideo = exports.isMediaSingle = exports.insertMediaSingleNode = exports.insertMediaAsMediaSingle = exports.changeFromMediaInlineToMediaSingleNode = void 0;
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
9
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
12
10
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
@@ -198,7 +196,7 @@ var changeFromMediaInlineToMediaSingleNode = exports.changeFromMediaInlineToMedi
|
|
|
198
196
|
}
|
|
199
197
|
return true;
|
|
200
198
|
};
|
|
201
|
-
var createMediaSingleNode =
|
|
199
|
+
var createMediaSingleNode = function createMediaSingleNode(schema, collection, maxWidth, minWidth, alignLeftOnInsert) {
|
|
202
200
|
return function (mediaState) {
|
|
203
201
|
var id = mediaState.id,
|
|
204
202
|
dimensions = mediaState.dimensions,
|
|
@@ -254,14 +252,6 @@ var replaceWithMediaSingleNode = function replaceWithMediaSingleNode(schema, max
|
|
|
254
252
|
return mediaSingle.createChecked(extendedMediaSingleAttrs, copiedMediaNode);
|
|
255
253
|
};
|
|
256
254
|
};
|
|
257
|
-
function isCaptionNode(editorView) {
|
|
258
|
-
var $from = editorView.state.selection.$from;
|
|
259
|
-
var immediateWrapperParentNode = editorView.state.doc.nodeAt($from.before(Math.max($from.depth, 1)));
|
|
260
|
-
if (immediateWrapperParentNode && immediateWrapperParentNode.type.name === 'caption') {
|
|
261
|
-
return true;
|
|
262
|
-
}
|
|
263
|
-
return false;
|
|
264
|
-
}
|
|
265
255
|
var isVideo = exports.isVideo = (0, _memoizeOne.default)(function (fileType) {
|
|
266
256
|
return !!fileType && fileType.includes('video');
|
|
267
257
|
});
|
|
@@ -16,7 +16,7 @@ import { MediaInlineCardLoadingView } from '@atlaskit/media-ui';
|
|
|
16
16
|
import { MediaViewerContainer } from '../ui/MediaViewer/MediaViewerContainer';
|
|
17
17
|
import { isImage } from '../utils/is-type';
|
|
18
18
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
19
|
-
|
|
19
|
+
const createMediaNodeUpdater = props => {
|
|
20
20
|
const node = props.node;
|
|
21
21
|
return new MediaNodeUpdater({
|
|
22
22
|
...props,
|
|
@@ -33,7 +33,7 @@ export const createMediaNodeUpdater = props => {
|
|
|
33
33
|
* using the contextid
|
|
34
34
|
*
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
const updateMediaNodeAttributes = async (props, mediaNodeUpdater) => {
|
|
37
37
|
const {
|
|
38
38
|
addPendingTask
|
|
39
39
|
} = props.mediaPluginState;
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -26,7 +26,6 @@ import { floatingToolbar } from './toolbar';
|
|
|
26
26
|
import { MediaPickerComponents } from './ui/MediaPicker';
|
|
27
27
|
import ToolbarMedia from './ui/ToolbarMedia';
|
|
28
28
|
import { insertMediaAsMediaSingle } from './utils/media-single';
|
|
29
|
-
export { insertMediaSingleNode } from './utils/media-single';
|
|
30
29
|
const MediaPickerFunctionalComponent = ({
|
|
31
30
|
api,
|
|
32
31
|
editorDomElement,
|
|
@@ -257,7 +256,7 @@ export const mediaPlugin = ({
|
|
|
257
256
|
title: formatMessage(messages.mediaFiles),
|
|
258
257
|
description: formatMessage(messages.mediaFilesDescription),
|
|
259
258
|
priority: 400,
|
|
260
|
-
keywords: ['attachment', 'gif', 'media', 'picture', 'image', 'video'],
|
|
259
|
+
keywords: ['attachment', 'gif', 'media', 'picture', 'image', 'video', 'file'],
|
|
261
260
|
icon: () => /*#__PURE__*/React.createElement(IconImages, null),
|
|
262
261
|
action(insert, state) {
|
|
263
262
|
var _api$analytics4;
|
|
@@ -44,7 +44,7 @@ export const openMediaAltTextMenu = createCommandWithAnalytics(ACTION.OPENED, st
|
|
|
44
44
|
}
|
|
45
45
|
return false;
|
|
46
46
|
}, tr => tr.setMeta('scrollIntoView', false));
|
|
47
|
-
|
|
47
|
+
const updateAltTextTransform = newAltText => (tr, state) => {
|
|
48
48
|
const mediaNode = getMediaSingleOrInlineNodeFromSelection(state);
|
|
49
49
|
if (mediaNode) {
|
|
50
50
|
// mediaSingle or mediaInline
|
|
@@ -3,7 +3,7 @@ import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
|
3
3
|
import { pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import reducer from './reducer';
|
|
6
|
-
|
|
6
|
+
const pluginKey = new PluginKey('mediaAltTextPlugin');
|
|
7
7
|
const {
|
|
8
8
|
createPluginState,
|
|
9
9
|
createCommand,
|
|
@@ -10,7 +10,7 @@ import { insertAndSelectCaptionFromMediaSinglePos, selectCaptionFromMediaSingleP
|
|
|
10
10
|
import { stateKey } from '../pm-plugins/plugin-key';
|
|
11
11
|
import { updateMediaSingleWidth } from '../toolbar/commands';
|
|
12
12
|
import { calcNewLayout, getSelectedMediaSingle } from '../toolbar/utils';
|
|
13
|
-
|
|
13
|
+
function keymapPlugin(options, editorAnalyticsAPI, editorSelectionAPI, widthPlugin, getIntl) {
|
|
14
14
|
const list = {};
|
|
15
15
|
bindKeymapWithCommand(undo.common, ignoreLinksInSteps, list);
|
|
16
16
|
if (options !== null && options !== void 0 && options.allowCaptions) {
|
|
@@ -103,7 +103,7 @@ export const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState
|
|
|
103
103
|
}];
|
|
104
104
|
return items;
|
|
105
105
|
};
|
|
106
|
-
|
|
106
|
+
const getMediaInlineImageToolbar = (state, intl, mediaPluginState, hoverDecoration, editorAnalyticsAPI, pluginInjectionApi, mediaLinkingState, options = {}) => {
|
|
107
107
|
var _pluginInjectionApi$w;
|
|
108
108
|
const {
|
|
109
109
|
mediaInline
|
|
@@ -5,7 +5,7 @@ import { findParentNodeOfType, findSelectedNodeOfType, removeParentNodeOfType, r
|
|
|
5
5
|
import { akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
7
7
|
import { isVideo } from '../utils/media-single';
|
|
8
|
-
|
|
8
|
+
const getSelectedMediaContainerNodeAttrs = mediaPluginState => {
|
|
9
9
|
var _mediaPluginState$sel;
|
|
10
10
|
const selectedNode = (_mediaPluginState$sel = mediaPluginState.selectedMediaContainerNode) === null || _mediaPluginState$sel === void 0 ? void 0 : _mediaPluginState$sel.call(mediaPluginState);
|
|
11
11
|
if (selectedNode && selectedNode.attrs) {
|
|
@@ -33,7 +33,7 @@ const buttonWrapper = css({
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
36
|
-
|
|
36
|
+
class LinkAddToolbar extends React.PureComponent {
|
|
37
37
|
constructor(...args) {
|
|
38
38
|
super(...args);
|
|
39
39
|
_defineProperty(this, "state", {
|
|
@@ -6,14 +6,14 @@ import React, { Fragment, useEffect, useState } from 'react';
|
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
|
-
import {
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { getSelectedNearestMediaContainerNodeAttrs } from '../../toolbar/utils';
|
|
11
11
|
import { isVideo } from '../../utils/is-type';
|
|
12
12
|
import { RenderMediaViewer } from './PortalWrapper';
|
|
13
13
|
const interactiveStyles = css({
|
|
14
14
|
cursor: 'pointer'
|
|
15
15
|
});
|
|
16
|
-
|
|
16
|
+
const mediaViewerContainerTestID = 'media-viewer-container-test';
|
|
17
17
|
export const MediaViewerContainer = ({
|
|
18
18
|
mediaNode,
|
|
19
19
|
mediaPluginState,
|
|
@@ -36,7 +36,7 @@ export const MediaViewerContainer = ({
|
|
|
36
36
|
setShowMediaViewer(false);
|
|
37
37
|
};
|
|
38
38
|
const isVideoMedia = isVideo((_mediaNode$firstChild = mediaNode.firstChild) === null || _mediaNode$firstChild === void 0 ? void 0 : _mediaNode$firstChild.attrs.__fileMimeType);
|
|
39
|
-
const enableMediaViewer =
|
|
39
|
+
const enableMediaViewer = fg('platform.editor.media.preview-in-full-page') && isEditorViewMode;
|
|
40
40
|
const shouldShowViewer = enableMediaViewer && showViewer && selectedNodeAttrs && mediaClientConfig && !isVideoMedia;
|
|
41
41
|
return jsx(Fragment, null, enableMediaViewer ? jsx(Fragment, null, isInline ? jsx("span", {
|
|
42
42
|
onClick: showMediaViewer,
|
|
@@ -26,7 +26,7 @@ export const isSelectionMediaSingleNode = state => {
|
|
|
26
26
|
} = state.selection;
|
|
27
27
|
return node && node.type === state.schema.nodes.mediaSingle;
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
const isSelectionMediaInlineNode = state => {
|
|
30
30
|
const {
|
|
31
31
|
node
|
|
32
32
|
} = state.selection;
|
|
@@ -194,7 +194,7 @@ export const getMediaNodeFromSelection = state => {
|
|
|
194
194
|
}
|
|
195
195
|
return null;
|
|
196
196
|
};
|
|
197
|
-
|
|
197
|
+
const getMediaInlineNodeFromSelection = state => {
|
|
198
198
|
if (!isSelectionMediaInlineNode(state)) {
|
|
199
199
|
return null;
|
|
200
200
|
}
|
|
@@ -193,7 +193,7 @@ export const changeFromMediaInlineToMediaSingleNode = (view, fromNode, widthPlug
|
|
|
193
193
|
}
|
|
194
194
|
return true;
|
|
195
195
|
};
|
|
196
|
-
|
|
196
|
+
const createMediaSingleNode = (schema, collection, maxWidth, minWidth, alignLeftOnInsert) => mediaState => {
|
|
197
197
|
const {
|
|
198
198
|
id,
|
|
199
199
|
dimensions,
|
|
@@ -254,16 +254,6 @@ const replaceWithMediaSingleNode = (schema, maxWidth, minWidth) => mediaNode =>
|
|
|
254
254
|
} : {};
|
|
255
255
|
return mediaSingle.createChecked(extendedMediaSingleAttrs, copiedMediaNode);
|
|
256
256
|
};
|
|
257
|
-
export function isCaptionNode(editorView) {
|
|
258
|
-
const {
|
|
259
|
-
$from
|
|
260
|
-
} = editorView.state.selection;
|
|
261
|
-
const immediateWrapperParentNode = editorView.state.doc.nodeAt($from.before(Math.max($from.depth, 1)));
|
|
262
|
-
if (immediateWrapperParentNode && immediateWrapperParentNode.type.name === 'caption') {
|
|
263
|
-
return true;
|
|
264
|
-
}
|
|
265
|
-
return false;
|
|
266
|
-
}
|
|
267
257
|
export const isVideo = memoizeOne(fileType => {
|
|
268
258
|
return !!fileType && fileType.includes('video');
|
|
269
259
|
});
|
|
@@ -30,7 +30,7 @@ import { MediaInlineCardLoadingView } from '@atlaskit/media-ui';
|
|
|
30
30
|
import { MediaViewerContainer } from '../ui/MediaViewer/MediaViewerContainer';
|
|
31
31
|
import { isImage } from '../utils/is-type';
|
|
32
32
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
33
|
-
|
|
33
|
+
var createMediaNodeUpdater = function createMediaNodeUpdater(props) {
|
|
34
34
|
var node = props.node;
|
|
35
35
|
return new MediaNodeUpdater(_objectSpread(_objectSpread({}, props), {}, {
|
|
36
36
|
isMediaSingle: true,
|
|
@@ -46,7 +46,7 @@ export var createMediaNodeUpdater = function createMediaNodeUpdater(props) {
|
|
|
46
46
|
* using the contextid
|
|
47
47
|
*
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
var updateMediaNodeAttributes = /*#__PURE__*/function () {
|
|
50
50
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(props, mediaNodeUpdater) {
|
|
51
51
|
var addPendingTask, node, contextId, hasDifferentContextId, copyNode;
|
|
52
52
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
package/dist/esm/plugin.js
CHANGED
|
@@ -26,7 +26,6 @@ import { floatingToolbar as _floatingToolbar } from './toolbar';
|
|
|
26
26
|
import { MediaPickerComponents } from './ui/MediaPicker';
|
|
27
27
|
import ToolbarMedia from './ui/ToolbarMedia';
|
|
28
28
|
import { insertMediaAsMediaSingle as _insertMediaAsMediaSingle } from './utils/media-single';
|
|
29
|
-
export { insertMediaSingleNode } from './utils/media-single';
|
|
30
29
|
var MediaPickerFunctionalComponent = function MediaPickerFunctionalComponent(_ref) {
|
|
31
30
|
var api = _ref.api,
|
|
32
31
|
editorDomElement = _ref.editorDomElement,
|
|
@@ -250,7 +249,7 @@ export var mediaPlugin = function mediaPlugin(_ref2) {
|
|
|
250
249
|
title: formatMessage(messages.mediaFiles),
|
|
251
250
|
description: formatMessage(messages.mediaFilesDescription),
|
|
252
251
|
priority: 400,
|
|
253
|
-
keywords: ['attachment', 'gif', 'media', 'picture', 'image', 'video'],
|
|
252
|
+
keywords: ['attachment', 'gif', 'media', 'picture', 'image', 'video', 'file'],
|
|
254
253
|
icon: function icon() {
|
|
255
254
|
return /*#__PURE__*/React.createElement(IconImages, null);
|
|
256
255
|
},
|
|
@@ -49,7 +49,7 @@ export var openMediaAltTextMenu = createCommandWithAnalytics(ACTION.OPENED, func
|
|
|
49
49
|
}, function (tr) {
|
|
50
50
|
return tr.setMeta('scrollIntoView', false);
|
|
51
51
|
});
|
|
52
|
-
|
|
52
|
+
var updateAltTextTransform = function updateAltTextTransform(newAltText) {
|
|
53
53
|
return function (tr, state) {
|
|
54
54
|
var mediaNode = getMediaSingleOrInlineNodeFromSelection(state);
|
|
55
55
|
if (mediaNode) {
|
|
@@ -3,7 +3,7 @@ import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
|
3
3
|
import { pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import reducer from './reducer';
|
|
6
|
-
|
|
6
|
+
var pluginKey = new PluginKey('mediaAltTextPlugin');
|
|
7
7
|
var _pluginFactory = pluginFactory(pluginKey, reducer, {
|
|
8
8
|
onSelectionChanged: function onSelectionChanged(tr, newState) {
|
|
9
9
|
// dont close alt text for undo/redo transactions (if it comes from prosemirror-history)
|
|
@@ -10,7 +10,7 @@ import { insertAndSelectCaptionFromMediaSinglePos, selectCaptionFromMediaSingleP
|
|
|
10
10
|
import { stateKey } from '../pm-plugins/plugin-key';
|
|
11
11
|
import { updateMediaSingleWidth } from '../toolbar/commands';
|
|
12
12
|
import { calcNewLayout, getSelectedMediaSingle } from '../toolbar/utils';
|
|
13
|
-
|
|
13
|
+
function keymapPlugin(options, editorAnalyticsAPI, editorSelectionAPI, widthPlugin, getIntl) {
|
|
14
14
|
var list = {};
|
|
15
15
|
bindKeymapWithCommand(undo.common, ignoreLinksInSteps, list);
|
|
16
16
|
if (options !== null && options !== void 0 && options.allowCaptions) {
|
|
@@ -27,7 +27,7 @@ export var altTextButton = function altTextButton(intl, state, editorAnalyticsAP
|
|
|
27
27
|
})
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
var altTextEditComponent = function altTextEditComponent(options) {
|
|
31
31
|
return {
|
|
32
32
|
type: 'custom',
|
|
33
33
|
fallback: [],
|
|
@@ -104,7 +104,7 @@ export var generateMediaInlineFloatingToolbar = function generateMediaInlineFloa
|
|
|
104
104
|
}];
|
|
105
105
|
return items;
|
|
106
106
|
};
|
|
107
|
-
|
|
107
|
+
var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl, mediaPluginState, hoverDecoration, editorAnalyticsAPI, pluginInjectionApi, mediaLinkingState) {
|
|
108
108
|
var _pluginInjectionApi$w;
|
|
109
109
|
var options = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {};
|
|
110
110
|
var mediaInline = state.schema.nodes.mediaInline;
|
|
@@ -7,7 +7,7 @@ import { findParentNodeOfType, findSelectedNodeOfType, removeParentNodeOfType, r
|
|
|
7
7
|
import { akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
9
9
|
import { isVideo } from '../utils/media-single';
|
|
10
|
-
|
|
10
|
+
var getSelectedMediaContainerNodeAttrs = function getSelectedMediaContainerNodeAttrs(mediaPluginState) {
|
|
11
11
|
var _mediaPluginState$sel;
|
|
12
12
|
var selectedNode = (_mediaPluginState$sel = mediaPluginState.selectedMediaContainerNode) === null || _mediaPluginState$sel === void 0 ? void 0 : _mediaPluginState$sel.call(mediaPluginState);
|
|
13
13
|
if (selectedNode && selectedNode.attrs) {
|
|
@@ -41,7 +41,7 @@ var buttonWrapper = css({
|
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
44
|
-
|
|
44
|
+
var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
45
45
|
_inherits(LinkAddToolbar, _React$PureComponent);
|
|
46
46
|
var _super = _createSuper(LinkAddToolbar);
|
|
47
47
|
function LinkAddToolbar() {
|
|
@@ -7,14 +7,14 @@ import React, { Fragment, useEffect, useState } from 'react';
|
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
|
-
import {
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
11
|
import { getSelectedNearestMediaContainerNodeAttrs } from '../../toolbar/utils';
|
|
12
12
|
import { isVideo } from '../../utils/is-type';
|
|
13
13
|
import { RenderMediaViewer } from './PortalWrapper';
|
|
14
14
|
var interactiveStyles = css({
|
|
15
15
|
cursor: 'pointer'
|
|
16
16
|
});
|
|
17
|
-
|
|
17
|
+
var mediaViewerContainerTestID = 'media-viewer-container-test';
|
|
18
18
|
export var MediaViewerContainer = function MediaViewerContainer(_ref) {
|
|
19
19
|
var _mediaNode$firstChild;
|
|
20
20
|
var mediaNode = _ref.mediaNode,
|
|
@@ -42,7 +42,7 @@ export var MediaViewerContainer = function MediaViewerContainer(_ref) {
|
|
|
42
42
|
setShowMediaViewer(false);
|
|
43
43
|
};
|
|
44
44
|
var isVideoMedia = isVideo((_mediaNode$firstChild = mediaNode.firstChild) === null || _mediaNode$firstChild === void 0 ? void 0 : _mediaNode$firstChild.attrs.__fileMimeType);
|
|
45
|
-
var enableMediaViewer =
|
|
45
|
+
var enableMediaViewer = fg('platform.editor.media.preview-in-full-page') && isEditorViewMode;
|
|
46
46
|
var shouldShowViewer = enableMediaViewer && showViewer && selectedNodeAttrs && mediaClientConfig && !isVideoMedia;
|
|
47
47
|
return jsx(Fragment, null, enableMediaViewer ? jsx(Fragment, null, isInline ? jsx("span", {
|
|
48
48
|
onClick: showMediaViewer,
|
|
@@ -24,7 +24,7 @@ export var isSelectionMediaSingleNode = function isSelectionMediaSingleNode(stat
|
|
|
24
24
|
node = _ref2.node;
|
|
25
25
|
return node && node.type === state.schema.nodes.mediaSingle;
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
var isSelectionMediaInlineNode = function isSelectionMediaInlineNode(state) {
|
|
28
28
|
var _ref3 = state.selection,
|
|
29
29
|
node = _ref3.node;
|
|
30
30
|
return node && node.type === state.schema.nodes.mediaInline;
|
|
@@ -179,7 +179,7 @@ export var getMediaNodeFromSelection = function getMediaNodeFromSelection(state)
|
|
|
179
179
|
}
|
|
180
180
|
return null;
|
|
181
181
|
};
|
|
182
|
-
|
|
182
|
+
var getMediaInlineNodeFromSelection = function getMediaInlineNodeFromSelection(state) {
|
|
183
183
|
if (!isSelectionMediaInlineNode(state)) {
|
|
184
184
|
return null;
|
|
185
185
|
}
|