@atlaskit/editor-plugin-media 0.11.1 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 0.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#66510](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/66510) [`de9aee7692ab`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/de9aee7692ab) - [ux] ED-21829 Hiding Inline and Original size floating toolbar buttons for external images
8
+ - Updated dependencies
9
+
3
10
  ## 0.11.1
4
11
 
5
12
  ### Patch Changes
@@ -254,44 +254,49 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
254
254
 
255
255
  // floating and inline switcher
256
256
  if (pluginState.allowInlineImages && selectedNode && (0, _utils2.canShowSwitchButtons)(selectedNode.node)) {
257
- var _pluginInjectionApi$a4;
257
+ var _selectedNode$node$fi;
258
258
  var inlineSwitcherTitle = intl.formatMessage(_messages.mediaAndEmbedToolbarMessages.changeToMediaInlineImage);
259
259
  var floatingSwitcherTitle = intl.formatMessage(_messages.mediaAndEmbedToolbarMessages.changeToMediaSingle);
260
260
 
261
261
  // This is temporary for PF release and can be removed once we have border and link support for inline images
262
262
  // TODO: [ED-20261] remove this once both border and link marks are supported for inline image
263
263
  var tempTooltipContent = /*#__PURE__*/_react.default.createElement("span", null, "Display inline ", /*#__PURE__*/_react.default.createElement("br", null), " \u26A0 This feature is being developed. The conversion process will not retain the image size, link, border, or any other data.");
264
- toolbarButtons.push({
265
- type: 'button',
266
- id: 'editor.media.image.view.switcher.inline',
267
- title: inlineSwitcherTitle,
268
- tooltipContent: tempTooltipContent,
269
- icon: function icon() {
270
- return /*#__PURE__*/_react.default.createElement(_card.IconInline, {
271
- size: "medium",
272
- label: inlineSwitcherTitle
273
- });
274
- },
275
- onClick: (0, _commands.changeMediaSingleToMediaInline)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions),
276
- testId: 'image-inline-appearance'
277
- }, {
278
- type: 'button',
279
- id: 'editor.media.image.view.switcher.floating',
280
- title: floatingSwitcherTitle,
281
- icon: function icon() {
282
- return /*#__PURE__*/_react.default.createElement(_card.IconEmbed, {
283
- size: "medium",
284
- label: floatingSwitcherTitle
285
- });
286
- },
287
- onClick: function onClick() {
288
- return true;
289
- },
290
- testId: 'image-floating-appearance',
291
- selected: true
292
- }, {
293
- type: 'separator'
294
- });
264
+
265
+ // mediaInlne doesn't suppprt external images, so hiding buttons to prevent conversion from mediaSingle to mediaInline
266
+ if (((_selectedNode$node$fi = selectedNode.node.firstChild) === null || _selectedNode$node$fi === void 0 ? void 0 : _selectedNode$node$fi.attrs.type) !== 'external') {
267
+ var _pluginInjectionApi$a4;
268
+ toolbarButtons.push({
269
+ type: 'button',
270
+ id: 'editor.media.image.view.switcher.inline',
271
+ title: inlineSwitcherTitle,
272
+ tooltipContent: tempTooltipContent,
273
+ icon: function icon() {
274
+ return /*#__PURE__*/_react.default.createElement(_card.IconInline, {
275
+ size: "medium",
276
+ label: inlineSwitcherTitle
277
+ });
278
+ },
279
+ onClick: (0, _commands.changeMediaSingleToMediaInline)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions),
280
+ testId: 'image-inline-appearance'
281
+ }, {
282
+ type: 'button',
283
+ id: 'editor.media.image.view.switcher.floating',
284
+ title: floatingSwitcherTitle,
285
+ icon: function icon() {
286
+ return /*#__PURE__*/_react.default.createElement(_card.IconEmbed, {
287
+ size: "medium",
288
+ label: floatingSwitcherTitle
289
+ });
290
+ },
291
+ onClick: function onClick() {
292
+ return true;
293
+ },
294
+ testId: 'image-floating-appearance',
295
+ selected: true
296
+ }, {
297
+ type: 'separator'
298
+ });
299
+ }
295
300
  }
296
301
 
297
302
  // Pixel Entry Toolbar Support
@@ -247,40 +247,45 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
247
247
 
248
248
  // floating and inline switcher
249
249
  if (pluginState.allowInlineImages && selectedNode && canShowSwitchButtons(selectedNode.node)) {
250
- var _pluginInjectionApi$a4;
250
+ var _selectedNode$node$fi;
251
251
  const inlineSwitcherTitle = intl.formatMessage(mediaAndEmbedToolbarMessages.changeToMediaInlineImage);
252
252
  const floatingSwitcherTitle = intl.formatMessage(mediaAndEmbedToolbarMessages.changeToMediaSingle);
253
253
 
254
254
  // This is temporary for PF release and can be removed once we have border and link support for inline images
255
255
  // TODO: [ED-20261] remove this once both border and link marks are supported for inline image
256
256
  const tempTooltipContent = /*#__PURE__*/React.createElement("span", null, "Display inline ", /*#__PURE__*/React.createElement("br", null), " \u26A0 This feature is being developed. The conversion process will not retain the image size, link, border, or any other data.");
257
- toolbarButtons.push({
258
- type: 'button',
259
- id: 'editor.media.image.view.switcher.inline',
260
- title: inlineSwitcherTitle,
261
- tooltipContent: tempTooltipContent,
262
- icon: () => /*#__PURE__*/React.createElement(IconInline, {
263
- size: "medium",
264
- label: inlineSwitcherTitle
265
- }),
266
- onClick: changeMediaSingleToMediaInline(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions),
267
- testId: 'image-inline-appearance'
268
- }, {
269
- type: 'button',
270
- id: 'editor.media.image.view.switcher.floating',
271
- title: floatingSwitcherTitle,
272
- icon: () => /*#__PURE__*/React.createElement(IconEmbed, {
273
- size: "medium",
274
- label: floatingSwitcherTitle
275
- }),
276
- onClick: () => {
277
- return true;
278
- },
279
- testId: 'image-floating-appearance',
280
- selected: true
281
- }, {
282
- type: 'separator'
283
- });
257
+
258
+ // mediaInlne doesn't suppprt external images, so hiding buttons to prevent conversion from mediaSingle to mediaInline
259
+ if (((_selectedNode$node$fi = selectedNode.node.firstChild) === null || _selectedNode$node$fi === void 0 ? void 0 : _selectedNode$node$fi.attrs.type) !== 'external') {
260
+ var _pluginInjectionApi$a4;
261
+ toolbarButtons.push({
262
+ type: 'button',
263
+ id: 'editor.media.image.view.switcher.inline',
264
+ title: inlineSwitcherTitle,
265
+ tooltipContent: tempTooltipContent,
266
+ icon: () => /*#__PURE__*/React.createElement(IconInline, {
267
+ size: "medium",
268
+ label: inlineSwitcherTitle
269
+ }),
270
+ onClick: changeMediaSingleToMediaInline(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions),
271
+ testId: 'image-inline-appearance'
272
+ }, {
273
+ type: 'button',
274
+ id: 'editor.media.image.view.switcher.floating',
275
+ title: floatingSwitcherTitle,
276
+ icon: () => /*#__PURE__*/React.createElement(IconEmbed, {
277
+ size: "medium",
278
+ label: floatingSwitcherTitle
279
+ }),
280
+ onClick: () => {
281
+ return true;
282
+ },
283
+ testId: 'image-floating-appearance',
284
+ selected: true
285
+ }, {
286
+ type: 'separator'
287
+ });
288
+ }
284
289
  }
285
290
 
286
291
  // Pixel Entry Toolbar Support
@@ -244,44 +244,49 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
244
244
 
245
245
  // floating and inline switcher
246
246
  if (pluginState.allowInlineImages && selectedNode && canShowSwitchButtons(selectedNode.node)) {
247
- var _pluginInjectionApi$a4;
247
+ var _selectedNode$node$fi;
248
248
  var inlineSwitcherTitle = intl.formatMessage(mediaAndEmbedToolbarMessages.changeToMediaInlineImage);
249
249
  var floatingSwitcherTitle = intl.formatMessage(mediaAndEmbedToolbarMessages.changeToMediaSingle);
250
250
 
251
251
  // This is temporary for PF release and can be removed once we have border and link support for inline images
252
252
  // TODO: [ED-20261] remove this once both border and link marks are supported for inline image
253
253
  var tempTooltipContent = /*#__PURE__*/React.createElement("span", null, "Display inline ", /*#__PURE__*/React.createElement("br", null), " \u26A0 This feature is being developed. The conversion process will not retain the image size, link, border, or any other data.");
254
- toolbarButtons.push({
255
- type: 'button',
256
- id: 'editor.media.image.view.switcher.inline',
257
- title: inlineSwitcherTitle,
258
- tooltipContent: tempTooltipContent,
259
- icon: function icon() {
260
- return /*#__PURE__*/React.createElement(IconInline, {
261
- size: "medium",
262
- label: inlineSwitcherTitle
263
- });
264
- },
265
- onClick: changeMediaSingleToMediaInline(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions),
266
- testId: 'image-inline-appearance'
267
- }, {
268
- type: 'button',
269
- id: 'editor.media.image.view.switcher.floating',
270
- title: floatingSwitcherTitle,
271
- icon: function icon() {
272
- return /*#__PURE__*/React.createElement(IconEmbed, {
273
- size: "medium",
274
- label: floatingSwitcherTitle
275
- });
276
- },
277
- onClick: function onClick() {
278
- return true;
279
- },
280
- testId: 'image-floating-appearance',
281
- selected: true
282
- }, {
283
- type: 'separator'
284
- });
254
+
255
+ // mediaInlne doesn't suppprt external images, so hiding buttons to prevent conversion from mediaSingle to mediaInline
256
+ if (((_selectedNode$node$fi = selectedNode.node.firstChild) === null || _selectedNode$node$fi === void 0 ? void 0 : _selectedNode$node$fi.attrs.type) !== 'external') {
257
+ var _pluginInjectionApi$a4;
258
+ toolbarButtons.push({
259
+ type: 'button',
260
+ id: 'editor.media.image.view.switcher.inline',
261
+ title: inlineSwitcherTitle,
262
+ tooltipContent: tempTooltipContent,
263
+ icon: function icon() {
264
+ return /*#__PURE__*/React.createElement(IconInline, {
265
+ size: "medium",
266
+ label: inlineSwitcherTitle
267
+ });
268
+ },
269
+ onClick: changeMediaSingleToMediaInline(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions),
270
+ testId: 'image-inline-appearance'
271
+ }, {
272
+ type: 'button',
273
+ id: 'editor.media.image.view.switcher.floating',
274
+ title: floatingSwitcherTitle,
275
+ icon: function icon() {
276
+ return /*#__PURE__*/React.createElement(IconEmbed, {
277
+ size: "medium",
278
+ label: floatingSwitcherTitle
279
+ });
280
+ },
281
+ onClick: function onClick() {
282
+ return true;
283
+ },
284
+ testId: 'image-floating-appearance',
285
+ selected: true
286
+ }, {
287
+ type: 'separator'
288
+ });
289
+ }
285
290
  }
286
291
 
287
292
  // Pixel Entry Toolbar Support
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/editor-tables": "^2.3.0",
55
55
  "@atlaskit/form": "^9.0.3",
56
56
  "@atlaskit/icon": "^22.0.0",
57
- "@atlaskit/media-card": "^77.6.0",
57
+ "@atlaskit/media-card": "^77.7.0",
58
58
  "@atlaskit/media-client": "^26.1.0",
59
59
  "@atlaskit/media-client-react": "^2.0.0",
60
60
  "@atlaskit/media-common": "^11.0.0",