@atlaskit/editor-plugin-media 2.3.9 → 2.3.11
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/nodeviews/mediaGroup.js +2 -1
- package/dist/cjs/nodeviews/mediaGroupNext.js +2 -1
- package/dist/cjs/nodeviews/mediaInline.js +3 -1
- package/dist/cjs/ui/MediaViewer/MediaViewerContainer.js +2 -1
- package/dist/cjs/ui/toolbar/index.js +117 -64
- package/dist/cjs/ui/toolbar/linking.js +3 -1
- package/dist/cjs/ui/toolbar/mediaInline.js +121 -63
- package/dist/es2019/nodeviews/mediaGroup.js +2 -1
- package/dist/es2019/nodeviews/mediaGroupNext.js +2 -1
- package/dist/es2019/nodeviews/mediaInline.js +3 -1
- package/dist/es2019/ui/MediaViewer/MediaViewerContainer.js +2 -1
- package/dist/es2019/ui/toolbar/index.js +114 -64
- package/dist/es2019/ui/toolbar/linking.js +3 -1
- package/dist/es2019/ui/toolbar/mediaInline.js +114 -61
- package/dist/esm/nodeviews/mediaGroup.js +2 -1
- package/dist/esm/nodeviews/mediaGroupNext.js +2 -1
- package/dist/esm/nodeviews/mediaInline.js +3 -1
- package/dist/esm/ui/MediaViewer/MediaViewerContainer.js +2 -1
- package/dist/esm/ui/toolbar/index.js +117 -64
- package/dist/esm/ui/toolbar/linking.js +3 -1
- package/dist/esm/ui/toolbar/mediaInline.js +121 -63
- package/dist/types/pm-plugins/pixel-resizing/reducer.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/reducer.d.ts +2 -2
- package/package.json +6 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
6
6
|
import React from 'react';
|
|
@@ -81,41 +81,10 @@ export var handleShowMediaViewer = function handleShowMediaViewer(_ref) {
|
|
|
81
81
|
};
|
|
82
82
|
var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, editorAnalyticsAPI, forceFocusSelector, isViewOnly) {
|
|
83
83
|
var _mediaPluginState$med, _pluginInjectionApi$c;
|
|
84
|
-
if (isViewOnly) {
|
|
85
|
-
return [];
|
|
86
|
-
}
|
|
87
84
|
var enforceMediaDataSecurityPolicy = mediaPluginState === null || mediaPluginState === void 0 || (_mediaPluginState$med = mediaPluginState.mediaClientConfig) === null || _mediaPluginState$med === void 0 ? void 0 : _mediaPluginState$med.enforceDataSecurityPolicy;
|
|
88
85
|
var disableDownloadButton = typeof enforceMediaDataSecurityPolicy === 'boolean' ? enforceMediaDataSecurityPolicy : false;
|
|
89
|
-
var
|
|
90
|
-
var
|
|
91
|
-
id: 'editor.media.view.switcher.inline',
|
|
92
|
-
type: 'button',
|
|
93
|
-
icon: ImageInlineIcon,
|
|
94
|
-
iconFallback: IconInline,
|
|
95
|
-
selected: false,
|
|
96
|
-
focusEditoronEnter: true,
|
|
97
|
-
disabled: false,
|
|
98
|
-
onClick: changeMediaCardToInline(editorAnalyticsAPI, forceFocusSelector),
|
|
99
|
-
title: intl.formatMessage(cardMessages.inlineTitle),
|
|
100
|
-
testId: 'inline-appearance',
|
|
101
|
-
className: 'inline-appearance' // a11y. uses to force focus on item
|
|
102
|
-
}, {
|
|
103
|
-
id: 'editor.media.view.switcher.thumbnail',
|
|
104
|
-
type: 'button',
|
|
105
|
-
icon: SmartLinkCardIcon,
|
|
106
|
-
iconFallback: IconCard,
|
|
107
|
-
selected: true,
|
|
108
|
-
disabled: false,
|
|
109
|
-
focusEditoronEnter: true,
|
|
110
|
-
onClick: function onClick() {
|
|
111
|
-
return true;
|
|
112
|
-
},
|
|
113
|
-
title: intl.formatMessage(cardMessages.blockTitle),
|
|
114
|
-
testId: 'thumbnail-appearance',
|
|
115
|
-
className: 'thumbnail-appearance' // a11y. uses to force focus on item
|
|
116
|
-
}, {
|
|
117
|
-
type: 'separator'
|
|
118
|
-
}, {
|
|
86
|
+
var isEditorControlsEnabled = editorExperiment('platform_editor_controls', 'variant1');
|
|
87
|
+
var preview = {
|
|
119
88
|
id: 'editor.media.viewer',
|
|
120
89
|
testId: 'file-preview-toolbar-button',
|
|
121
90
|
type: 'button',
|
|
@@ -131,9 +100,8 @@ var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar
|
|
|
131
100
|
},
|
|
132
101
|
disabled: (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.connectivity) === null || _pluginInjectionApi$c === void 0 || (_pluginInjectionApi$c = _pluginInjectionApi$c.sharedState) === null || _pluginInjectionApi$c === void 0 || (_pluginInjectionApi$c = _pluginInjectionApi$c.currentState()) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.mode) === 'offline',
|
|
133
102
|
supportsViewMode: true
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
}, {
|
|
103
|
+
};
|
|
104
|
+
var download = _objectSpread({
|
|
137
105
|
id: 'editor.media.card.download',
|
|
138
106
|
type: 'button',
|
|
139
107
|
icon: DownloadIcon,
|
|
@@ -143,33 +111,118 @@ var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar
|
|
|
143
111
|
},
|
|
144
112
|
title: intl.formatMessage(messages.download),
|
|
145
113
|
disabled: disableDownloadButton
|
|
146
|
-
}, {
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
114
|
+
}, isEditorControlsEnabled && {
|
|
115
|
+
supportsViewMode: true
|
|
116
|
+
});
|
|
117
|
+
if (isViewOnly && !isEditorControlsEnabled) {
|
|
118
|
+
return [];
|
|
119
|
+
}
|
|
120
|
+
var mediaGroup = state.schema.nodes.mediaGroup;
|
|
121
|
+
var items = [];
|
|
122
|
+
if (!isEditorControlsEnabled) {
|
|
123
|
+
items.push({
|
|
124
|
+
id: 'editor.media.view.switcher.inline',
|
|
125
|
+
type: 'button',
|
|
126
|
+
icon: ImageInlineIcon,
|
|
127
|
+
iconFallback: IconInline,
|
|
128
|
+
selected: false,
|
|
129
|
+
focusEditoronEnter: true,
|
|
130
|
+
disabled: false,
|
|
131
|
+
onClick: changeMediaCardToInline(editorAnalyticsAPI, forceFocusSelector),
|
|
132
|
+
title: intl.formatMessage(cardMessages.inlineTitle),
|
|
133
|
+
testId: 'inline-appearance',
|
|
134
|
+
className: 'inline-appearance' // a11y. uses to force focus on item
|
|
135
|
+
}, {
|
|
136
|
+
id: 'editor.media.view.switcher.thumbnail',
|
|
137
|
+
type: 'button',
|
|
138
|
+
icon: SmartLinkCardIcon,
|
|
139
|
+
iconFallback: IconCard,
|
|
140
|
+
selected: true,
|
|
141
|
+
disabled: false,
|
|
142
|
+
focusEditoronEnter: true,
|
|
143
|
+
onClick: function onClick() {
|
|
144
|
+
return true;
|
|
145
|
+
},
|
|
146
|
+
title: intl.formatMessage(cardMessages.blockTitle),
|
|
147
|
+
testId: 'thumbnail-appearance',
|
|
148
|
+
className: 'thumbnail-appearance' // a11y. uses to force focus on item
|
|
149
|
+
}, {
|
|
150
|
+
type: 'separator'
|
|
151
|
+
}, preview, {
|
|
152
|
+
type: 'separator'
|
|
153
|
+
}, download, {
|
|
154
|
+
type: 'separator'
|
|
155
|
+
}, {
|
|
156
|
+
type: 'copy-button',
|
|
157
|
+
supportsViewMode: true,
|
|
158
|
+
items: [{
|
|
159
|
+
state: state,
|
|
160
|
+
formatMessage: intl.formatMessage,
|
|
161
|
+
nodeType: mediaGroup
|
|
162
|
+
}]
|
|
163
|
+
}, {
|
|
164
|
+
type: 'separator'
|
|
165
|
+
}, {
|
|
166
|
+
id: 'editor.media.delete',
|
|
167
|
+
type: 'button',
|
|
168
|
+
appearance: 'danger',
|
|
169
|
+
focusEditoronEnter: true,
|
|
170
|
+
icon: DeleteIcon,
|
|
171
|
+
iconFallback: RemoveIcon,
|
|
172
|
+
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaGroup, true),
|
|
173
|
+
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaGroup, false),
|
|
174
|
+
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaGroup, true),
|
|
175
|
+
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaGroup, false),
|
|
176
|
+
title: intl.formatMessage(commonMessages.remove),
|
|
177
|
+
onClick: handleRemoveMediaGroup,
|
|
178
|
+
testId: 'media-toolbar-remove-button'
|
|
179
|
+
});
|
|
180
|
+
} else {
|
|
181
|
+
var options = [{
|
|
182
|
+
id: 'editor.media.view.switcher.inline',
|
|
183
|
+
title: intl.formatMessage(cardMessages.inlineTitle),
|
|
184
|
+
onClick: changeMediaCardToInline(editorAnalyticsAPI, forceFocusSelector),
|
|
185
|
+
icon: /*#__PURE__*/React.createElement(ImageInlineIcon, {
|
|
186
|
+
label: "",
|
|
187
|
+
spacing: "spacious"
|
|
188
|
+
})
|
|
189
|
+
}, {
|
|
190
|
+
id: 'editor.media.view.switcher.thumbnail',
|
|
191
|
+
title: intl.formatMessage(cardMessages.blockTitle),
|
|
192
|
+
selected: true,
|
|
193
|
+
onClick: function onClick() {
|
|
194
|
+
return true;
|
|
195
|
+
},
|
|
196
|
+
icon: /*#__PURE__*/React.createElement(SmartLinkCardIcon, {
|
|
197
|
+
label: "",
|
|
198
|
+
spacing: "spacious"
|
|
199
|
+
})
|
|
200
|
+
}];
|
|
201
|
+
var switcherDropdown = {
|
|
202
|
+
title: intl.formatMessage(messages.fileDisplayOptions),
|
|
203
|
+
id: 'media-group-inline-switcher-toolbar-item',
|
|
204
|
+
testId: 'media-group-inline-switcher-dropdown',
|
|
205
|
+
type: 'dropdown',
|
|
206
|
+
options: options,
|
|
207
|
+
icon: function icon() {
|
|
208
|
+
return /*#__PURE__*/React.createElement(SmartLinkCardIcon, {
|
|
209
|
+
label: "",
|
|
210
|
+
spacing: "spacious"
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
items.push(switcherDropdown, {
|
|
215
|
+
type: 'separator',
|
|
216
|
+
fullHeight: true
|
|
217
|
+
}, download, {
|
|
218
|
+
type: 'separator',
|
|
219
|
+
fullHeight: true,
|
|
220
|
+
supportsViewMode: true
|
|
221
|
+
}, preview, {
|
|
222
|
+
type: 'separator',
|
|
223
|
+
fullHeight: true
|
|
224
|
+
});
|
|
225
|
+
}
|
|
173
226
|
return items;
|
|
174
227
|
};
|
|
175
228
|
var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToolbar(state, intl, options, pluginState, mediaLinkingState, pluginInjectionApi) {
|
|
@@ -110,7 +110,9 @@ export var getLinkingDropdownOptions = function getLinkingDropdownOptions(editor
|
|
|
110
110
|
var selectedNodeTypeSingle = mediaNode === null || mediaNode === void 0 ? void 0 : mediaNode.attrs.__fileMimeType;
|
|
111
111
|
mediaType = getMediaType(selectedNodeTypeSingle);
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
|
|
114
|
+
// Only show link dropdown option for images and external media (shown as images)
|
|
115
|
+
if (mediaType !== 'image' && (mediaNode === null || mediaNode === void 0 ? void 0 : mediaNode.attrs.type) !== 'external') {
|
|
114
116
|
return [];
|
|
115
117
|
}
|
|
116
118
|
if (mediaLinkingState && mediaLinkingState.editable) {
|
|
@@ -1,9 +1,13 @@
|
|
|
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 from 'react';
|
|
2
5
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
6
|
import { IconCard, IconEmbed, IconInline } from '@atlaskit/editor-common/card';
|
|
4
7
|
import commonMessages, { cardMessages, mediaAndEmbedToolbarMessages } from '@atlaskit/editor-common/messages';
|
|
5
8
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
9
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
10
|
+
import GrowDiagonalIcon from '@atlaskit/icon/core/grow-diagonal';
|
|
7
11
|
import ImageFullscreenIcon from '@atlaskit/icon/core/image-fullscreen';
|
|
8
12
|
import ImageInlineIcon from '@atlaskit/icon/core/image-inline';
|
|
9
13
|
import MaximizeIcon from '@atlaskit/icon/core/maximize';
|
|
@@ -36,39 +40,13 @@ export var generateMediaInlineFloatingToolbar = function generateMediaInlineFloa
|
|
|
36
40
|
if (mediaPluginState.allowInlineImages && isImage(mediaType)) {
|
|
37
41
|
return getMediaInlineImageToolbar(state, intl, mediaPluginState, hoverDecoration, editorAnalyticsAPI, pluginInjectionApi, mediaLinkingState, options);
|
|
38
42
|
}
|
|
39
|
-
var items = [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
icon: ImageInlineIcon,
|
|
43
|
-
iconFallback: IconInline,
|
|
44
|
-
selected: true,
|
|
45
|
-
disabled: false,
|
|
46
|
-
focusEditoronEnter: true,
|
|
47
|
-
onClick: function onClick() {
|
|
48
|
-
return true;
|
|
49
|
-
},
|
|
50
|
-
title: intl.formatMessage(cardMessages.inlineTitle),
|
|
51
|
-
testId: 'inline-appearance',
|
|
52
|
-
className: 'inline-appearance' // a11y. uses to force focus on item
|
|
53
|
-
}, {
|
|
54
|
-
id: 'editor.media.view.switcher.thumbnail',
|
|
55
|
-
type: 'button',
|
|
56
|
-
icon: SmartLinkCardIcon,
|
|
57
|
-
iconFallback: IconCard,
|
|
58
|
-
selected: false,
|
|
59
|
-
disabled: false,
|
|
60
|
-
focusEditoronEnter: true,
|
|
61
|
-
onClick: changeInlineToMediaCard(editorAnalyticsAPI, forceFocusSelector),
|
|
62
|
-
title: intl.formatMessage(cardMessages.blockTitle),
|
|
63
|
-
testId: 'thumbnail-appearance',
|
|
64
|
-
className: 'thumbnail-appearance' // a11y. uses to force focus on item
|
|
65
|
-
}, {
|
|
66
|
-
type: 'separator'
|
|
67
|
-
}, {
|
|
43
|
+
var items = [];
|
|
44
|
+
var isEditorControlsEnabled = editorExperiment('platform_editor_controls', 'variant1');
|
|
45
|
+
var preview = _objectSpread({
|
|
68
46
|
id: 'editor.media.viewer',
|
|
69
47
|
testId: 'file-preview-toolbar-button',
|
|
70
48
|
type: 'button',
|
|
71
|
-
icon: MaximizeIcon,
|
|
49
|
+
icon: editorExperiment('platform_editor_controls', 'variant1') ? GrowDiagonalIcon : MaximizeIcon,
|
|
72
50
|
iconFallback: FilePreviewIcon,
|
|
73
51
|
title: intl.formatMessage(messages.preview),
|
|
74
52
|
onClick: function onClick() {
|
|
@@ -78,10 +56,10 @@ export var generateMediaInlineFloatingToolbar = function generateMediaInlineFloa
|
|
|
78
56
|
api: pluginInjectionApi
|
|
79
57
|
})) !== null && _handleShowMediaViewe !== void 0 ? _handleShowMediaViewe : false;
|
|
80
58
|
}
|
|
81
|
-
}, {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
59
|
+
}, isEditorControlsEnabled && {
|
|
60
|
+
supportsViewMode: true
|
|
61
|
+
});
|
|
62
|
+
var download = _objectSpread({
|
|
85
63
|
id: 'editor.media.card.download',
|
|
86
64
|
type: 'button',
|
|
87
65
|
icon: DownloadIcon,
|
|
@@ -90,33 +68,113 @@ export var generateMediaInlineFloatingToolbar = function generateMediaInlineFloa
|
|
|
90
68
|
return true;
|
|
91
69
|
},
|
|
92
70
|
title: intl.formatMessage(messages.download)
|
|
93
|
-
}, {
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
71
|
+
}, isEditorControlsEnabled && {
|
|
72
|
+
supportsViewMode: true
|
|
73
|
+
});
|
|
74
|
+
if (!isEditorControlsEnabled) {
|
|
75
|
+
items.push({
|
|
76
|
+
id: 'editor.media.view.switcher.inline',
|
|
77
|
+
type: 'button',
|
|
78
|
+
icon: ImageInlineIcon,
|
|
79
|
+
iconFallback: IconInline,
|
|
80
|
+
selected: true,
|
|
81
|
+
disabled: false,
|
|
82
|
+
focusEditoronEnter: true,
|
|
83
|
+
onClick: function onClick() {
|
|
84
|
+
return true;
|
|
85
|
+
},
|
|
86
|
+
title: intl.formatMessage(cardMessages.inlineTitle),
|
|
87
|
+
testId: 'inline-appearance',
|
|
88
|
+
className: 'inline-appearance' // a11y. uses to force focus on item
|
|
89
|
+
}, {
|
|
90
|
+
id: 'editor.media.view.switcher.thumbnail',
|
|
91
|
+
type: 'button',
|
|
92
|
+
icon: SmartLinkCardIcon,
|
|
93
|
+
iconFallback: IconCard,
|
|
94
|
+
selected: false,
|
|
95
|
+
disabled: false,
|
|
96
|
+
focusEditoronEnter: true,
|
|
97
|
+
onClick: changeInlineToMediaCard(editorAnalyticsAPI, forceFocusSelector),
|
|
98
|
+
title: intl.formatMessage(cardMessages.blockTitle),
|
|
99
|
+
testId: 'thumbnail-appearance',
|
|
100
|
+
className: 'thumbnail-appearance' // a11y. uses to force focus on item
|
|
101
|
+
}, {
|
|
102
|
+
type: 'separator'
|
|
103
|
+
}, preview, {
|
|
104
|
+
type: 'separator'
|
|
105
|
+
}, download, {
|
|
106
|
+
type: 'separator'
|
|
107
|
+
}, {
|
|
108
|
+
type: 'copy-button',
|
|
109
|
+
supportsViewMode: true,
|
|
110
|
+
items: [{
|
|
111
|
+
state: state,
|
|
112
|
+
formatMessage: intl.formatMessage,
|
|
113
|
+
nodeType: mediaInline
|
|
114
|
+
}]
|
|
115
|
+
}, {
|
|
116
|
+
type: 'separator'
|
|
117
|
+
}, {
|
|
118
|
+
id: 'editor.media.delete',
|
|
119
|
+
type: 'button',
|
|
120
|
+
appearance: 'danger',
|
|
121
|
+
focusEditoronEnter: true,
|
|
122
|
+
icon: DeleteIcon,
|
|
123
|
+
iconFallback: RemoveIcon,
|
|
124
|
+
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, true),
|
|
125
|
+
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, false),
|
|
126
|
+
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, true),
|
|
127
|
+
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, false),
|
|
128
|
+
title: intl.formatMessage(commonMessages.remove),
|
|
129
|
+
onClick: removeInlineCard,
|
|
130
|
+
testId: 'media-toolbar-remove-button'
|
|
131
|
+
});
|
|
132
|
+
} else {
|
|
133
|
+
var _options = [{
|
|
134
|
+
id: 'editor.media.view.switcher.inline',
|
|
135
|
+
title: intl.formatMessage(cardMessages.inlineTitle),
|
|
136
|
+
onClick: function onClick() {
|
|
137
|
+
return true;
|
|
138
|
+
},
|
|
139
|
+
selected: true,
|
|
140
|
+
icon: /*#__PURE__*/React.createElement(ImageInlineIcon, {
|
|
141
|
+
label: "",
|
|
142
|
+
spacing: "spacious"
|
|
143
|
+
})
|
|
144
|
+
}, {
|
|
145
|
+
id: 'editor.media.view.switcher.thumbnail',
|
|
146
|
+
title: intl.formatMessage(cardMessages.blockTitle),
|
|
147
|
+
onClick: changeInlineToMediaCard(editorAnalyticsAPI, forceFocusSelector),
|
|
148
|
+
icon: /*#__PURE__*/React.createElement(SmartLinkCardIcon, {
|
|
149
|
+
label: "",
|
|
150
|
+
spacing: "spacious"
|
|
151
|
+
})
|
|
152
|
+
}];
|
|
153
|
+
var switcherDropdown = {
|
|
154
|
+
title: intl.formatMessage(messages.fileDisplayOptions),
|
|
155
|
+
id: 'media-group-inline-switcher-toolbar-item',
|
|
156
|
+
testId: 'media-group-inline-switcher-dropdown',
|
|
157
|
+
type: 'dropdown',
|
|
158
|
+
options: _options,
|
|
159
|
+
icon: function icon() {
|
|
160
|
+
return /*#__PURE__*/React.createElement(ImageInlineIcon, {
|
|
161
|
+
label: "",
|
|
162
|
+
spacing: "spacious"
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
items.push(switcherDropdown, {
|
|
167
|
+
type: 'separator',
|
|
168
|
+
fullHeight: true
|
|
169
|
+
}, download, {
|
|
170
|
+
type: 'separator',
|
|
171
|
+
fullHeight: true,
|
|
172
|
+
supportsViewMode: true
|
|
173
|
+
}, preview, {
|
|
174
|
+
type: 'separator',
|
|
175
|
+
fullHeight: true
|
|
176
|
+
});
|
|
177
|
+
}
|
|
120
178
|
return items;
|
|
121
179
|
};
|
|
122
180
|
var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl, mediaPluginState, hoverDecoration, editorAnalyticsAPI, pluginInjectionApi, mediaLinkingState) {
|
|
@@ -194,7 +252,7 @@ var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl
|
|
|
194
252
|
type: 'separator'
|
|
195
253
|
});
|
|
196
254
|
} else {
|
|
197
|
-
var
|
|
255
|
+
var _options2 = [{
|
|
198
256
|
id: 'editor.media.convert.mediainline',
|
|
199
257
|
title: mediaInlineImageTitle,
|
|
200
258
|
onClick: function onClick() {
|
|
@@ -225,7 +283,7 @@ var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl
|
|
|
225
283
|
id: 'media-inline-to-block-toolbar-item',
|
|
226
284
|
testId: 'media-inline-to-block-dropdown',
|
|
227
285
|
type: 'dropdown',
|
|
228
|
-
options:
|
|
286
|
+
options: _options2,
|
|
229
287
|
title: intl.formatMessage(messages.sizeOptions),
|
|
230
288
|
icon: function icon() {
|
|
231
289
|
return /*#__PURE__*/React.createElement(ImageInlineIcon, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type
|
|
1
|
+
type MediaPixelResizingState = {
|
|
2
2
|
isPixelEditorOpen: boolean;
|
|
3
3
|
};
|
|
4
4
|
type OpenPixelEditor = {
|
|
@@ -8,5 +8,5 @@ type ClosePixelEditor = {
|
|
|
8
8
|
type: 'closePixelEditor';
|
|
9
9
|
};
|
|
10
10
|
type MediaPixelResizingAction = OpenPixelEditor | ClosePixelEditor;
|
|
11
|
-
declare const _default: (state:
|
|
11
|
+
declare const _default: (state: MediaPixelResizingState, action: MediaPixelResizingAction) => MediaPixelResizingState;
|
|
12
12
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type
|
|
1
|
+
type MediaPixelResizingState = {
|
|
2
2
|
isPixelEditorOpen: boolean;
|
|
3
3
|
};
|
|
4
4
|
type OpenPixelEditor = {
|
|
@@ -8,5 +8,5 @@ type ClosePixelEditor = {
|
|
|
8
8
|
type: 'closePixelEditor';
|
|
9
9
|
};
|
|
10
10
|
type MediaPixelResizingAction = OpenPixelEditor | ClosePixelEditor;
|
|
11
|
-
declare const _default: (state:
|
|
11
|
+
declare const _default: (state: MediaPixelResizingState, action: MediaPixelResizingAction) => MediaPixelResizingState;
|
|
12
12
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.11",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/analytics-namespaced-context": "^7.0.0",
|
|
39
39
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
40
40
|
"@atlaskit/button": "^21.1.0",
|
|
41
|
-
"@atlaskit/editor-common": "^102.
|
|
41
|
+
"@atlaskit/editor-common": "^102.12.0",
|
|
42
42
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
43
43
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
44
44
|
"@atlaskit/editor-plugin-annotation": "^2.1.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@atlaskit/media-common": "^12.0.0",
|
|
64
64
|
"@atlaskit/media-filmstrip": "^49.0.0",
|
|
65
65
|
"@atlaskit/media-picker": "^68.0.0",
|
|
66
|
-
"@atlaskit/media-ui": "^28.
|
|
66
|
+
"@atlaskit/media-ui": "^28.1.0",
|
|
67
67
|
"@atlaskit/media-viewer": "^52.0.0",
|
|
68
68
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
69
69
|
"@atlaskit/primitives": "^14.2.0",
|
|
@@ -164,6 +164,9 @@
|
|
|
164
164
|
},
|
|
165
165
|
"platform_editor_safari_media_clipboard_fix": {
|
|
166
166
|
"type": "boolean"
|
|
167
|
+
},
|
|
168
|
+
"platform_editor_render_media_viewer_as_inline": {
|
|
169
|
+
"type": "boolean"
|
|
167
170
|
}
|
|
168
171
|
},
|
|
169
172
|
"stricter": {
|