@atlaskit/editor-plugin-media 9.6.4 → 9.7.1
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/mediaPlugin.js +15 -7
- package/dist/cjs/nodeviews/mediaNodeView/media.js +26 -1
- package/dist/es2019/mediaPlugin.js +12 -6
- package/dist/es2019/nodeviews/mediaNodeView/media.js +27 -1
- package/dist/esm/mediaPlugin.js +15 -7
- package/dist/esm/nodeviews/mediaNodeView/media.js +26 -1
- package/dist/types/mediaPluginType.d.ts +1 -1
- package/dist/types/nodeviews/mediaNodeView/media.d.ts +6 -0
- package/dist/types-ts4.5/mediaPluginType.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/mediaNodeView/media.d.ts +6 -0
- package/package.json +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 9.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 9.7.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`27de3457c3a79`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/27de3457c3a79) -
|
|
14
|
+
EDITOR-5532 add context to media error events
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 9.6.4
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/cjs/mediaPlugin.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.mediaPlugin = void 0;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
12
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
@@ -16,6 +17,7 @@ var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
|
16
17
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
17
18
|
var _mediaCommon = require("@atlaskit/media-common");
|
|
18
19
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
19
21
|
var _lazyMediaGroup = require("./nodeviews/lazy-media-group");
|
|
20
22
|
var _lazyMediaInline = require("./nodeviews/lazy-media-inline");
|
|
21
23
|
var _mediaNodeView = require("./nodeviews/mediaNodeView");
|
|
@@ -41,6 +43,8 @@ var _PortalWrapper = require("./ui/MediaViewer/PortalWrapper");
|
|
|
41
43
|
var _toolbar = require("./ui/toolbar");
|
|
42
44
|
var _ToolbarMedia = _interopRequireDefault(require("./ui/ToolbarMedia"));
|
|
43
45
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
46
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
47
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
44
48
|
var selector = function selector(states) {
|
|
45
49
|
var _states$mediaState, _states$mediaState2;
|
|
46
50
|
return {
|
|
@@ -122,22 +126,26 @@ var mediaPlugin = exports.mediaPlugin = function mediaPlugin(_ref3) {
|
|
|
122
126
|
return _pluginKey.stateKey.getState(editorState) || null;
|
|
123
127
|
},
|
|
124
128
|
actions: {
|
|
125
|
-
handleMediaNodeRenderError: function handleMediaNodeRenderError(node, reason) {
|
|
129
|
+
handleMediaNodeRenderError: function handleMediaNodeRenderError(node, reason, nestedUnder) {
|
|
126
130
|
var _api$analytics;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
131
|
+
if (!(0, _platformFeatureFlags.fg)('platform_synced_block_patch_5')) {
|
|
132
|
+
// Only fire the errored event once per media node
|
|
133
|
+
if (mediaErrorLocalIds.has(node.attrs.localId)) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
mediaErrorLocalIds.add(node.attrs.localId);
|
|
130
137
|
}
|
|
131
|
-
mediaErrorLocalIds.add(node.attrs.localId);
|
|
132
138
|
api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.fireAnalyticsEvent({
|
|
133
139
|
action: _analytics.ACTION.ERRORED,
|
|
134
140
|
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
135
141
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.MEDIA,
|
|
136
142
|
eventType: _analytics.EVENT_TYPE.UI,
|
|
137
|
-
attributes: {
|
|
143
|
+
attributes: _objectSpread({
|
|
138
144
|
reason: reason,
|
|
139
145
|
external: node.attrs.__external
|
|
140
|
-
}
|
|
146
|
+
}, nestedUnder && (0, _expValEquals.expValEquals)('platform_synced_block', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_5') ? {
|
|
147
|
+
nestedUnder: nestedUnder
|
|
148
|
+
} : {})
|
|
141
149
|
});
|
|
142
150
|
},
|
|
143
151
|
insertMediaAsMediaSingle: function insertMediaAsMediaSingle(view, node, inputMethod, insertMediaVia) {
|
|
@@ -21,6 +21,7 @@ var _analyticsNamespacedContext = require("@atlaskit/analytics-namespaced-contex
|
|
|
21
21
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
22
22
|
var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
23
23
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
24
|
+
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
24
25
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
25
26
|
var _mediaCard = require("@atlaskit/media-card");
|
|
26
27
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -121,7 +122,31 @@ var MediaNode = exports.MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
121
122
|
}));
|
|
122
123
|
(0, _defineProperty2.default)(_this, "onError", function (reason) {
|
|
123
124
|
var _this$props$api;
|
|
124
|
-
|
|
125
|
+
var nestedUnder = (0, _platformFeatureFlags.fg)('platform_synced_block_patch_5') ? _this.getNestedUnder() : undefined;
|
|
126
|
+
(_this$props$api = _this.props.api) === null || _this$props$api === void 0 || _this$props$api.media.actions.handleMediaNodeRenderError(_this.props.node, reason, nestedUnder);
|
|
127
|
+
});
|
|
128
|
+
/**
|
|
129
|
+
* This function checks if the media node is nested under a certain nodes, and if so,
|
|
130
|
+
* returns the name of the parent node type. This is used for providing more context in media render errors.
|
|
131
|
+
* @returns
|
|
132
|
+
*/
|
|
133
|
+
(0, _defineProperty2.default)(_this, "getNestedUnder", function () {
|
|
134
|
+
var pos = _this.props.getPos();
|
|
135
|
+
if (typeof pos !== 'number') {
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
var _this$props$view$stat = _this.props.view.state,
|
|
139
|
+
doc = _this$props$view$stat.doc,
|
|
140
|
+
schema = _this$props$view$stat.schema;
|
|
141
|
+
var bodiedSyncBlock = schema.nodes.bodiedSyncBlock;
|
|
142
|
+
if (!bodiedSyncBlock) {
|
|
143
|
+
return undefined;
|
|
144
|
+
}
|
|
145
|
+
var resolvedPos = doc.resolve(pos);
|
|
146
|
+
var bodiedSyncBlockNode = (0, _utils2.findParentNodeClosestToPos)(resolvedPos, function (currentNode) {
|
|
147
|
+
return currentNode.type === bodiedSyncBlock;
|
|
148
|
+
});
|
|
149
|
+
return bodiedSyncBlockNode === null || bodiedSyncBlockNode === void 0 ? void 0 : bodiedSyncBlockNode.node.type.name;
|
|
125
150
|
});
|
|
126
151
|
(0, _defineProperty2.default)(_this, "onFullscreenChange", function (fullscreen) {
|
|
127
152
|
var _this$mediaPluginStat;
|
|
@@ -8,6 +8,7 @@ import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-che
|
|
|
8
8
|
import { NodeSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
12
|
import { lazyMediaGroupView } from './nodeviews/lazy-media-group';
|
|
12
13
|
import { lazyMediaInlineView } from './nodeviews/lazy-media-inline';
|
|
13
14
|
import { ReactMediaNode } from './nodeviews/mediaNodeView';
|
|
@@ -117,13 +118,15 @@ export const mediaPlugin = ({
|
|
|
117
118
|
return stateKey.getState(editorState) || null;
|
|
118
119
|
},
|
|
119
120
|
actions: {
|
|
120
|
-
handleMediaNodeRenderError: (node, reason) => {
|
|
121
|
+
handleMediaNodeRenderError: (node, reason, nestedUnder) => {
|
|
121
122
|
var _api$analytics;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
if (!fg('platform_synced_block_patch_5')) {
|
|
124
|
+
// Only fire the errored event once per media node
|
|
125
|
+
if (mediaErrorLocalIds.has(node.attrs.localId)) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
mediaErrorLocalIds.add(node.attrs.localId);
|
|
125
129
|
}
|
|
126
|
-
mediaErrorLocalIds.add(node.attrs.localId);
|
|
127
130
|
api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.fireAnalyticsEvent({
|
|
128
131
|
action: ACTION.ERRORED,
|
|
129
132
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
@@ -131,7 +134,10 @@ export const mediaPlugin = ({
|
|
|
131
134
|
eventType: EVENT_TYPE.UI,
|
|
132
135
|
attributes: {
|
|
133
136
|
reason,
|
|
134
|
-
external: node.attrs.__external
|
|
137
|
+
external: node.attrs.__external,
|
|
138
|
+
...(nestedUnder && expValEquals('platform_synced_block', 'isEnabled', true) && fg('platform_synced_block_patch_5') ? {
|
|
139
|
+
nestedUnder
|
|
140
|
+
} : {})
|
|
135
141
|
}
|
|
136
142
|
});
|
|
137
143
|
},
|
|
@@ -6,6 +6,7 @@ import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context';
|
|
|
6
6
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
7
7
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
8
8
|
import { setNodeSelection, setTextSelection, withImageLoader } from '@atlaskit/editor-common/utils';
|
|
9
|
+
import { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
9
10
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
10
11
|
import { Card, CardLoading } from '@atlaskit/media-card';
|
|
11
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -92,7 +93,32 @@ export class MediaNode extends Component {
|
|
|
92
93
|
})));
|
|
93
94
|
_defineProperty(this, "onError", reason => {
|
|
94
95
|
var _this$props$api;
|
|
95
|
-
|
|
96
|
+
const nestedUnder = fg('platform_synced_block_patch_5') ? this.getNestedUnder() : undefined;
|
|
97
|
+
(_this$props$api = this.props.api) === null || _this$props$api === void 0 ? void 0 : _this$props$api.media.actions.handleMediaNodeRenderError(this.props.node, reason, nestedUnder);
|
|
98
|
+
});
|
|
99
|
+
/**
|
|
100
|
+
* This function checks if the media node is nested under a certain nodes, and if so,
|
|
101
|
+
* returns the name of the parent node type. This is used for providing more context in media render errors.
|
|
102
|
+
* @returns
|
|
103
|
+
*/
|
|
104
|
+
_defineProperty(this, "getNestedUnder", () => {
|
|
105
|
+
const pos = this.props.getPos();
|
|
106
|
+
if (typeof pos !== 'number') {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
const {
|
|
110
|
+
doc,
|
|
111
|
+
schema
|
|
112
|
+
} = this.props.view.state;
|
|
113
|
+
const {
|
|
114
|
+
bodiedSyncBlock
|
|
115
|
+
} = schema.nodes;
|
|
116
|
+
if (!bodiedSyncBlock) {
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
const resolvedPos = doc.resolve(pos);
|
|
120
|
+
const bodiedSyncBlockNode = findParentNodeClosestToPos(resolvedPos, currentNode => currentNode.type === bodiedSyncBlock);
|
|
121
|
+
return bodiedSyncBlockNode === null || bodiedSyncBlockNode === void 0 ? void 0 : bodiedSyncBlockNode.node.type.name;
|
|
96
122
|
});
|
|
97
123
|
_defineProperty(this, "onFullscreenChange", fullscreen => {
|
|
98
124
|
var _this$mediaPluginStat;
|
package/dist/esm/mediaPlugin.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1
4
|
import React, { useMemo } from 'react';
|
|
2
5
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
6
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
@@ -8,6 +11,7 @@ import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-che
|
|
|
8
11
|
import { NodeSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
9
12
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
10
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
15
|
import { lazyMediaGroupView } from './nodeviews/lazy-media-group';
|
|
12
16
|
import { lazyMediaInlineView } from './nodeviews/lazy-media-inline';
|
|
13
17
|
import { ReactMediaNode } from './nodeviews/mediaNodeView';
|
|
@@ -113,22 +117,26 @@ export var mediaPlugin = function mediaPlugin(_ref3) {
|
|
|
113
117
|
return stateKey.getState(editorState) || null;
|
|
114
118
|
},
|
|
115
119
|
actions: {
|
|
116
|
-
handleMediaNodeRenderError: function handleMediaNodeRenderError(node, reason) {
|
|
120
|
+
handleMediaNodeRenderError: function handleMediaNodeRenderError(node, reason, nestedUnder) {
|
|
117
121
|
var _api$analytics;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
122
|
+
if (!fg('platform_synced_block_patch_5')) {
|
|
123
|
+
// Only fire the errored event once per media node
|
|
124
|
+
if (mediaErrorLocalIds.has(node.attrs.localId)) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
mediaErrorLocalIds.add(node.attrs.localId);
|
|
121
128
|
}
|
|
122
|
-
mediaErrorLocalIds.add(node.attrs.localId);
|
|
123
129
|
api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.fireAnalyticsEvent({
|
|
124
130
|
action: ACTION.ERRORED,
|
|
125
131
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
126
132
|
actionSubjectId: ACTION_SUBJECT_ID.MEDIA,
|
|
127
133
|
eventType: EVENT_TYPE.UI,
|
|
128
|
-
attributes: {
|
|
134
|
+
attributes: _objectSpread({
|
|
129
135
|
reason: reason,
|
|
130
136
|
external: node.attrs.__external
|
|
131
|
-
}
|
|
137
|
+
}, nestedUnder && expValEquals('platform_synced_block', 'isEnabled', true) && fg('platform_synced_block_patch_5') ? {
|
|
138
|
+
nestedUnder: nestedUnder
|
|
139
|
+
} : {})
|
|
132
140
|
});
|
|
133
141
|
},
|
|
134
142
|
insertMediaAsMediaSingle: function insertMediaAsMediaSingle(view, node, inputMethod, insertMediaVia) {
|
|
@@ -15,6 +15,7 @@ import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context';
|
|
|
15
15
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
16
16
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
17
17
|
import { setNodeSelection, setTextSelection, withImageLoader } from '@atlaskit/editor-common/utils';
|
|
18
|
+
import { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
18
19
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
19
20
|
import { Card, CardLoading } from '@atlaskit/media-card';
|
|
20
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -113,7 +114,31 @@ export var MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
113
114
|
}));
|
|
114
115
|
_defineProperty(_this, "onError", function (reason) {
|
|
115
116
|
var _this$props$api;
|
|
116
|
-
|
|
117
|
+
var nestedUnder = fg('platform_synced_block_patch_5') ? _this.getNestedUnder() : undefined;
|
|
118
|
+
(_this$props$api = _this.props.api) === null || _this$props$api === void 0 || _this$props$api.media.actions.handleMediaNodeRenderError(_this.props.node, reason, nestedUnder);
|
|
119
|
+
});
|
|
120
|
+
/**
|
|
121
|
+
* This function checks if the media node is nested under a certain nodes, and if so,
|
|
122
|
+
* returns the name of the parent node type. This is used for providing more context in media render errors.
|
|
123
|
+
* @returns
|
|
124
|
+
*/
|
|
125
|
+
_defineProperty(_this, "getNestedUnder", function () {
|
|
126
|
+
var pos = _this.props.getPos();
|
|
127
|
+
if (typeof pos !== 'number') {
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
var _this$props$view$stat = _this.props.view.state,
|
|
131
|
+
doc = _this$props$view$stat.doc,
|
|
132
|
+
schema = _this$props$view$stat.schema;
|
|
133
|
+
var bodiedSyncBlock = schema.nodes.bodiedSyncBlock;
|
|
134
|
+
if (!bodiedSyncBlock) {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
var resolvedPos = doc.resolve(pos);
|
|
138
|
+
var bodiedSyncBlockNode = findParentNodeClosestToPos(resolvedPos, function (currentNode) {
|
|
139
|
+
return currentNode.type === bodiedSyncBlock;
|
|
140
|
+
});
|
|
141
|
+
return bodiedSyncBlockNode === null || bodiedSyncBlockNode === void 0 ? void 0 : bodiedSyncBlockNode.node.type.name;
|
|
117
142
|
});
|
|
118
143
|
_defineProperty(_this, "onFullscreenChange", function (fullscreen) {
|
|
119
144
|
var _this$mediaPluginStat;
|
|
@@ -50,7 +50,7 @@ export type MediaNextEditorPluginType = NextEditorPlugin<'media', {
|
|
|
50
50
|
/**
|
|
51
51
|
* Callback to be called when there is an error rendering a media node.
|
|
52
52
|
*/
|
|
53
|
-
handleMediaNodeRenderError: (node: PMNode, reason: string) => void;
|
|
53
|
+
handleMediaNodeRenderError: (node: PMNode, reason: string, nestedUnder?: string) => void;
|
|
54
54
|
/**
|
|
55
55
|
* @private
|
|
56
56
|
* @deprecated Use the command `insertMediaSingle` instead which is decoupled from EditorView
|
|
@@ -49,6 +49,12 @@ export declare class MediaNode extends Component<MediaNodeProps, MediaNodeState>
|
|
|
49
49
|
private selectMediaSingle;
|
|
50
50
|
private getMediaSettings;
|
|
51
51
|
private onError;
|
|
52
|
+
/**
|
|
53
|
+
* This function checks if the media node is nested under a certain nodes, and if so,
|
|
54
|
+
* returns the name of the parent node type. This is used for providing more context in media render errors.
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
private getNestedUnder;
|
|
52
58
|
render(): React.JSX.Element;
|
|
53
59
|
private onFullscreenChange;
|
|
54
60
|
private handleNewNode;
|
|
@@ -50,7 +50,7 @@ export type MediaNextEditorPluginType = NextEditorPlugin<'media', {
|
|
|
50
50
|
/**
|
|
51
51
|
* Callback to be called when there is an error rendering a media node.
|
|
52
52
|
*/
|
|
53
|
-
handleMediaNodeRenderError: (node: PMNode, reason: string) => void;
|
|
53
|
+
handleMediaNodeRenderError: (node: PMNode, reason: string, nestedUnder?: string) => void;
|
|
54
54
|
/**
|
|
55
55
|
* @private
|
|
56
56
|
* @deprecated Use the command `insertMediaSingle` instead which is decoupled from EditorView
|
|
@@ -49,6 +49,12 @@ export declare class MediaNode extends Component<MediaNodeProps, MediaNodeState>
|
|
|
49
49
|
private selectMediaSingle;
|
|
50
50
|
private getMediaSettings;
|
|
51
51
|
private onError;
|
|
52
|
+
/**
|
|
53
|
+
* This function checks if the media node is nested under a certain nodes, and if so,
|
|
54
|
+
* returns the name of the parent node type. This is used for providing more context in media render errors.
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
private getNestedUnder;
|
|
52
58
|
render(): React.JSX.Element;
|
|
53
59
|
private onFullscreenChange;
|
|
54
60
|
private handleNewNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.7.1",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
],
|
|
30
30
|
"atlaskit:src": "src/index.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/adf-schema": "^52.
|
|
32
|
+
"@atlaskit/adf-schema": "^52.1.0",
|
|
33
33
|
"@atlaskit/analytics-namespaced-context": "^7.2.0",
|
|
34
34
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
35
|
-
"@atlaskit/button": "^23.
|
|
35
|
+
"@atlaskit/button": "^23.10.0",
|
|
36
36
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^7.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-annotation": "^7.1.0",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
66
66
|
"@atlaskit/primitives": "^18.0.0",
|
|
67
67
|
"@atlaskit/textfield": "^8.2.0",
|
|
68
|
-
"@atlaskit/theme": "^
|
|
69
|
-
"@atlaskit/tmp-editor-statsig": "^32.
|
|
68
|
+
"@atlaskit/theme": "^22.0.0",
|
|
69
|
+
"@atlaskit/tmp-editor-statsig": "^32.6.0",
|
|
70
70
|
"@atlaskit/tokens": "^11.0.0",
|
|
71
71
|
"@atlaskit/tooltip": "^20.14.0",
|
|
72
72
|
"@babel/runtime": "^7.0.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"uuid": "^3.1.0"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
-
"@atlaskit/editor-common": "^111.
|
|
81
|
+
"@atlaskit/editor-common": "^111.23.0",
|
|
82
82
|
"@atlaskit/media-core": "^37.0.0",
|
|
83
83
|
"react": "^18.2.0",
|
|
84
84
|
"react-dom": "^18.2.0",
|
|
@@ -160,6 +160,9 @@
|
|
|
160
160
|
"platform_editor_media_insert_check": {
|
|
161
161
|
"type": "boolean"
|
|
162
162
|
},
|
|
163
|
+
"platform_synced_block_patch_5": {
|
|
164
|
+
"type": "boolean"
|
|
165
|
+
},
|
|
163
166
|
"confluence_fe_create_inline_comment_exp_coverage_2": {
|
|
164
167
|
"type": "boolean"
|
|
165
168
|
}
|