@atlaskit/editor-plugin-media 6.0.3 → 6.2.0

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/mediaPlugin.js +1 -1
  3. package/dist/cjs/pm-plugins/alt-text/ui/AltTextEdit.js +6 -2
  4. package/dist/cjs/ui/MediaLinkingToolbar.js +7 -3
  5. package/dist/cjs/ui/toolbar/alt-text.js +2 -1
  6. package/dist/cjs/ui/toolbar/index.js +23 -19
  7. package/dist/cjs/ui/toolbar/layout-group.js +8 -4
  8. package/dist/cjs/ui/toolbar/linking-toolbar-appearance.js +14 -6
  9. package/dist/cjs/ui/toolbar/linking.js +3 -1
  10. package/dist/cjs/ui/toolbar/mediaInline.js +7 -6
  11. package/dist/es2019/mediaPlugin.js +1 -1
  12. package/dist/es2019/pm-plugins/alt-text/ui/AltTextEdit.js +6 -2
  13. package/dist/es2019/ui/MediaLinkingToolbar.js +7 -3
  14. package/dist/es2019/ui/toolbar/alt-text.js +2 -1
  15. package/dist/es2019/ui/toolbar/index.js +23 -19
  16. package/dist/es2019/ui/toolbar/layout-group.js +8 -4
  17. package/dist/es2019/ui/toolbar/linking-toolbar-appearance.js +14 -6
  18. package/dist/es2019/ui/toolbar/linking.js +3 -1
  19. package/dist/es2019/ui/toolbar/mediaInline.js +7 -6
  20. package/dist/esm/mediaPlugin.js +1 -1
  21. package/dist/esm/pm-plugins/alt-text/ui/AltTextEdit.js +6 -2
  22. package/dist/esm/ui/MediaLinkingToolbar.js +7 -3
  23. package/dist/esm/ui/toolbar/alt-text.js +2 -1
  24. package/dist/esm/ui/toolbar/index.js +23 -19
  25. package/dist/esm/ui/toolbar/layout-group.js +8 -4
  26. package/dist/esm/ui/toolbar/linking-toolbar-appearance.js +14 -6
  27. package/dist/esm/ui/toolbar/linking.js +3 -1
  28. package/dist/esm/ui/toolbar/mediaInline.js +7 -6
  29. package/dist/types/mediaPluginType.d.ts +3 -1
  30. package/dist/types/pm-plugins/alt-text/ui/AltTextEdit.d.ts +1 -0
  31. package/dist/types/types/index.d.ts +1 -0
  32. package/dist/types/ui/MediaLinkingToolbar.d.ts +1 -0
  33. package/dist/types/ui/toolbar/alt-text.d.ts +1 -0
  34. package/dist/types/ui/toolbar/layout-group.d.ts +2 -1
  35. package/dist/types/ui/toolbar/linking-toolbar-appearance.d.ts +2 -1
  36. package/dist/types-ts4.5/mediaPluginType.d.ts +3 -1
  37. package/dist/types-ts4.5/pm-plugins/alt-text/ui/AltTextEdit.d.ts +1 -0
  38. package/dist/types-ts4.5/types/index.d.ts +1 -0
  39. package/dist/types-ts4.5/ui/MediaLinkingToolbar.d.ts +1 -0
  40. package/dist/types-ts4.5/ui/toolbar/alt-text.d.ts +1 -0
  41. package/dist/types-ts4.5/ui/toolbar/layout-group.d.ts +2 -1
  42. package/dist/types-ts4.5/ui/toolbar/linking-toolbar-appearance.d.ts +2 -1
  43. package/package.json +8 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 6.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c0113eeccb2df`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c0113eeccb2df) -
8
+ [ux] ED-29120 add a new config option for default editor preset
9
+ (`toolbar.enableNewToolbarExperience`) which allows the new toolbar to be disabled. This is needed
10
+ for editors that can't be excluded at the experiment level.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 6.1.0
17
+
18
+ ### Minor Changes
19
+
20
+ - [`a498274ad526d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a498274ad526d) -
21
+ Allow hiding of the 'Media' quick-insert option using `disableQuickInsert` boolean option
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+
3
27
  ## 6.0.3
4
28
 
5
29
  ### Patch Changes
@@ -323,7 +323,7 @@ var mediaPlugin = exports.mediaPlugin = function mediaPlugin(_ref3) {
323
323
  pluginsOptions: {
324
324
  quickInsert: function quickInsert(_ref12) {
325
325
  var formatMessage = _ref12.formatMessage;
326
- return (0, _platformFeatureFlags.fg)('platform_editor_add_media_from_url_rollout') ? [] : [{
326
+ return (0, _platformFeatureFlags.fg)('platform_editor_add_media_from_url_rollout') || options !== null && options !== void 0 && options.disableQuickInsert ? [] : [{
327
327
  id: 'media',
328
328
  title: formatMessage(_messages.toolbarInsertBlockMessages.mediaFiles),
329
329
  description: formatMessage(_messages.toolbarInsertBlockMessages.mediaFilesDescription),
@@ -18,6 +18,7 @@ var _analyticsNext = require("@atlaskit/analytics-next");
18
18
  var _analytics = require("@atlaskit/editor-common/analytics");
19
19
  var _keymaps = require("@atlaskit/editor-common/keymaps");
20
20
  var _media = require("@atlaskit/editor-common/media");
21
+ var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
21
22
  var _ui = require("@atlaskit/editor-common/ui");
22
23
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
23
24
  var _chevronLeftChevronLeftLarge = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-left--chevron-left-large"));
@@ -181,6 +182,7 @@ var AltTextEditComponent = exports.AltTextEditComponent = /*#__PURE__*/function
181
182
  }, {
182
183
  key: "render",
183
184
  value: function render() {
185
+ var _this$props$areAnyNew, _this$props$areAnyNew2;
184
186
  var formatMessage = this.props.intl.formatMessage;
185
187
  var showClearTextButton = this.state.showClearTextButton;
186
188
  var backButtonMessage = formatMessage(_media.altTextMessages.back);
@@ -211,7 +213,8 @@ var AltTextEditComponent = exports.AltTextEditComponent = /*#__PURE__*/function
211
213
  size: "small"
212
214
  }),
213
215
  tooltipContent: backButtonMessageComponent,
214
- onClick: this.closeMediaAltTextMenu
216
+ onClick: this.closeMediaAltTextMenu,
217
+ areAnyNewToolbarFlagsEnabled: (_this$props$areAnyNew = this.props.areAnyNewToolbarFlagsEnabled) !== null && _this$props$areAnyNew !== void 0 ? _this$props$areAnyNew : (0, _toolbarFlagCheck.areToolbarFlagsEnabled)()
215
218
  })), (0, _react2.jsx)(_ui.PanelTextInput, {
216
219
  testId: "alt-text-input",
217
220
  ariaLabel: formatMessage(_media.altTextMessages.placeholder),
@@ -237,7 +240,8 @@ var AltTextEditComponent = exports.AltTextEditComponent = /*#__PURE__*/function
237
240
  label: formatMessage(_media.altTextMessages.clear)
238
241
  })),
239
242
  tooltipContent: formatMessage(_media.altTextMessages.clear),
240
- onClick: this.handleClearText
243
+ onClick: this.handleClearText,
244
+ areAnyNewToolbarFlagsEnabled: (_this$props$areAnyNew2 = this.props.areAnyNewToolbarFlagsEnabled) !== null && _this$props$areAnyNew2 !== void 0 ? _this$props$areAnyNew2 : (0, _toolbarFlagCheck.areToolbarFlagsEnabled)()
241
245
  }))), hasErrors && (0, _react2.jsx)("section", {
242
246
  id: "errors-list",
243
247
  ref: this.errorsListRef,
@@ -141,7 +141,8 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
141
141
  inputMethod: currentInputMethod
142
142
  }, true);
143
143
  }
144
- }
144
+ },
145
+ areAnyNewToolbarFlagsEnabled: _this.props.areAnyNewToolbarFlagsEnabled
145
146
  })), (0, _react2.jsx)(_ui.PanelTextInput, {
146
147
  inputId: "media-link-search-input",
147
148
  testId: "media-link-input",
@@ -168,7 +169,9 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
168
169
  }), (0, _react2.jsx)("label", {
169
170
  className: "assistive",
170
171
  htmlFor: "media-link-search-input"
171
- }, formatMessage(_messages.linkToolbarMessages.searchInput)), (0, _utils.normalizeUrl)(displayUrl) && (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null), (0, _react2.jsx)(_ui.FloatingToolbarButton, {
172
+ }, formatMessage(_messages.linkToolbarMessages.searchInput)), (0, _utils.normalizeUrl)(displayUrl) && (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_ui.FloatingToolbarSeparator, {
173
+ areAnyNewToolbarFlagsEnabled: _this.props.areAnyNewToolbarFlagsEnabled
174
+ }), (0, _react2.jsx)(_ui.FloatingToolbarButton, {
172
175
  title: formatUnlinkText,
173
176
  icon: (0, _react2.jsx)(_linkBrokenEditorUnlink.default, {
174
177
  label: formatUnlinkText
@@ -181,7 +184,8 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
181
184
  event.preventDefault();
182
185
  _this.handleUnlink(true);
183
186
  }
184
- }
187
+ },
188
+ areAnyNewToolbarFlagsEnabled: _this.props.areAnyNewToolbarFlagsEnabled
185
189
  }))), !!errorsList.length && (0, _react2.jsx)("section", {
186
190
  css: validationWrapper
187
191
  }, errorsList), renderRecentList()))
@@ -77,7 +77,8 @@ var altTextEditComponent = function altTextEditComponent(options) {
77
77
  value: mediaNode.attrs.alt,
78
78
  altTextValidator: options && options.altTextValidator,
79
79
  onEscape: setFocus,
80
- onEnter: setFocus
80
+ onEnter: setFocus,
81
+ areAnyNewToolbarFlagsEnabled: options === null || options === void 0 ? void 0 : options.areAnyNewToolbarFlagsEnabled
81
82
  });
82
83
  }
83
84
  };
@@ -123,12 +123,12 @@ var handleShowMediaViewer = exports.handleShowMediaViewer = function handleShowM
123
123
  var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, editorAnalyticsAPI, forceFocusSelector, isViewOnly) {
124
124
  var _pluginInjectionApi$c;
125
125
  var disableDownloadButton = (0, _utils2.getIsDownloadDisabledByDataSecurityPolicy)(mediaPluginState);
126
- var isNewEditorToolbarEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)();
126
+ var areAnyNewToolbarFlagsEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar));
127
127
  var preview = {
128
128
  id: 'editor.media.viewer',
129
129
  testId: 'file-preview-toolbar-button',
130
130
  type: 'button',
131
- icon: isNewEditorToolbarEnabled ? _growDiagonal.default : _maximize.default,
131
+ icon: areAnyNewToolbarFlagsEnabled ? _growDiagonal.default : _maximize.default,
132
132
  title: intl.formatMessage(_mediaUi.messages.preview),
133
133
  onClick: function onClick() {
134
134
  var _handleShowMediaViewe;
@@ -150,15 +150,15 @@ var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar
150
150
  },
151
151
  title: intl.formatMessage(_mediaUi.messages.download),
152
152
  disabled: disableDownloadButton
153
- }, isNewEditorToolbarEnabled && {
153
+ }, areAnyNewToolbarFlagsEnabled && {
154
154
  supportsViewMode: true
155
155
  });
156
- if (isViewOnly && !isNewEditorToolbarEnabled) {
156
+ if (isViewOnly && !areAnyNewToolbarFlagsEnabled) {
157
157
  return [];
158
158
  }
159
159
  var mediaGroup = state.schema.nodes.mediaGroup;
160
160
  var items = [];
161
- if (!isNewEditorToolbarEnabled) {
161
+ if (!areAnyNewToolbarFlagsEnabled) {
162
162
  items.push({
163
163
  id: 'editor.media.view.switcher.inline',
164
164
  type: 'button',
@@ -278,7 +278,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
278
278
  var toolbarButtons = [];
279
279
  var _ref2 = (_pluginInjectionApi$d = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$d2 = pluginInjectionApi.decorations) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions) !== null && _pluginInjectionApi$d !== void 0 ? _pluginInjectionApi$d : {},
280
280
  hoverDecoration = _ref2.hoverDecoration;
281
- var isNewEditorToolbarEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)();
281
+ var areAnyNewToolbarFlagsEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar));
282
282
  var disableDownloadButton = (0, _utils2.getIsDownloadDisabledByDataSecurityPolicy)(pluginState);
283
283
  if ((0, _imageBorder.shouldShowImageBorder)(state)) {
284
284
  toolbarButtons.push({
@@ -305,7 +305,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
305
305
  });
306
306
  }
307
307
  });
308
- if (!isNewEditorToolbarEnabled) {
308
+ if (!areAnyNewToolbarFlagsEnabled) {
309
309
  toolbarButtons.push({
310
310
  type: 'separator'
311
311
  });
@@ -326,7 +326,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
326
326
  }
327
327
  var layoutButtons = (0, _card.buildLayoutButtons)(state, intl, state.schema.nodes.mediaSingle, widthPlugin, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions, allowResizing, allowResizingInTables, true, true, isChangingLayoutDisabled, allowPixelResizing);
328
328
  var addLayoutDropdownToToolbar = function addLayoutDropdownToToolbar() {
329
- if (isNewEditorToolbarEnabled) {
329
+ if (areAnyNewToolbarFlagsEnabled) {
330
330
  var _pluginInjectionApi$a4;
331
331
  var layoutDropdown = (0, _card.buildLayoutDropdown)(state, intl, state.schema.nodes.mediaSingle, widthPlugin, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions, allowResizing, allowResizingInTables, true, true, isChangingLayoutDisabled, allowPixelResizing);
332
332
  toolbarButtons = [].concat((0, _toConsumableArray2.default)(toolbarButtons), (0, _toConsumableArray2.default)(layoutDropdown));
@@ -341,7 +341,9 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
341
341
  layoutButtons: layoutButtons
342
342
  // Ignored via go/ees005
343
343
  // eslint-disable-next-line react/jsx-props-no-spreading
344
- }, props));
344
+ }, props, {
345
+ areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
346
+ }));
345
347
  },
346
348
  width: 188,
347
349
  height: 32
@@ -354,7 +356,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
354
356
  title: intl.formatMessage(_card.layoutToMessages[selectedLayoutIcon.value]),
355
357
  icon: selectedLayoutIcon.icon
356
358
  };
357
- toolbarButtons = [].concat((0, _toConsumableArray2.default)(toolbarButtons), [trigger], (0, _toConsumableArray2.default)(isNewEditorToolbarEnabled ? [] : [{
359
+ toolbarButtons = [].concat((0, _toConsumableArray2.default)(toolbarButtons), [trigger], (0, _toConsumableArray2.default)(areAnyNewToolbarFlagsEnabled ? [] : [{
358
360
  type: 'separator'
359
361
  }]));
360
362
  }
@@ -376,7 +378,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
376
378
  addLayoutDropdownToToolbar();
377
379
  } else {
378
380
  toolbarButtons = [].concat((0, _toConsumableArray2.default)(toolbarButtons), (0, _toConsumableArray2.default)(layoutButtons));
379
- if (layoutButtons.length && !isNewEditorToolbarEnabled) {
381
+ if (layoutButtons.length && !areAnyNewToolbarFlagsEnabled) {
380
382
  toolbarButtons.push({
381
383
  type: 'separator'
382
384
  });
@@ -392,7 +394,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
392
394
  var hasCaption = (0, _utils.contains)(selectedNode.node, state.schema.nodes.caption);
393
395
  var inlineSwitcherTitle = intl.formatMessage(hasCaption ? _messages.mediaAndEmbedToolbarMessages.changeToMediaInlineImageCaptionWarning : _messages.mediaAndEmbedToolbarMessages.changeToMediaInlineImage);
394
396
  var floatingSwitcherTitle = intl.formatMessage(_messages.mediaAndEmbedToolbarMessages.changeToMediaSingle);
395
- if (!isNewEditorToolbarEnabled) {
397
+ if (!areAnyNewToolbarFlagsEnabled) {
396
398
  var _pluginInjectionApi$a5;
397
399
  toolbarButtons.push({
398
400
  type: 'button',
@@ -437,7 +439,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
437
439
  }
438
440
 
439
441
  // A separator is needed regardless switcher is enabled or not
440
- if ((0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true)) {
442
+ if (Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar) && (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true)) {
441
443
  toolbarButtons.push({
442
444
  type: 'separator',
443
445
  fullHeight: true
@@ -488,14 +490,14 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
488
490
  }
489
491
  return [sizeInput];
490
492
  }
491
- if (!isNewEditorToolbarEnabled) {
493
+ if (!areAnyNewToolbarFlagsEnabled) {
492
494
  toolbarButtons.push(sizeInput);
493
495
  toolbarButtons.push({
494
496
  type: 'separator'
495
497
  });
496
498
  }
497
499
  }
498
- if (!isNewEditorToolbarEnabled) {
500
+ if (!areAnyNewToolbarFlagsEnabled) {
499
501
  if (allowCommentsOnMedia) {
500
502
  toolbarButtons.push((0, _comments.commentButton)(intl, state, pluginInjectionApi, onCommentButtonMount), {
501
503
  type: 'separator',
@@ -538,7 +540,8 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
538
540
  onAddLink: editLink,
539
541
  onEditLink: editLink,
540
542
  onOpenLink: openLink,
541
- isViewOnly: isViewOnly
543
+ isViewOnly: isViewOnly,
544
+ areAnyNewToolbarFlagsEnabled: false
542
545
  });
543
546
  }
544
547
  return null;
@@ -593,7 +596,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
593
596
  supportsViewMode: true
594
597
  });
595
598
  }
596
- if (!isNewEditorToolbarEnabled) {
599
+ if (!areAnyNewToolbarFlagsEnabled) {
597
600
  var _pluginInjectionApi$a8;
598
601
  if (allowAltTextOnImages) {
599
602
  var _pluginInjectionApi$a7;
@@ -759,7 +762,8 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
759
762
  return (0, _altText2.getAltTextToolbar)(baseToolbar, {
760
763
  altTextValidator: altTextValidator,
761
764
  forceFocusSelector: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f === void 0 || (_pluginInjectionApi$f = _pluginInjectionApi$f.actions) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.forceFocusSelector,
762
- triggerButtonSelector: overflowButtonSelector
765
+ triggerButtonSelector: overflowButtonSelector,
766
+ areAnyNewToolbarFlagsEnabled: (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar))
763
767
  });
764
768
  }
765
769
  }
@@ -807,7 +811,7 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
807
811
  };
808
812
  items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi);
809
813
  }
810
- if (!mediaPluginState.isResizing && (0, _toolbarFlagCheck.areToolbarFlagsEnabled)()) {
814
+ if (!mediaPluginState.isResizing && (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar))) {
811
815
  var _pluginInjectionApi$a0, _pluginInjectionApi$a1;
812
816
  (0, _utils2.updateToFullHeightSeparator)(items);
813
817
  var customOptions = [].concat((0, _toConsumableArray2.default)((0, _linking3.getLinkingDropdownOptions)(state, intl, mediaLinkingState, allowMediaInline && selectedNodeType && selectedNodeType === mediaInline, allowLinking, isViewOnly)), (0, _toConsumableArray2.default)((0, _altText2.getAltTextDropdownOption)(state, intl.formatMessage, allowAltTextOnImages, selectedNodeType, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a0 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a0 === void 0 ? void 0 : _pluginInjectionApi$a0.actions)), (0, _toConsumableArray2.default)((0, _pixelResizing2.getResizeDropdownOption)(options, state, intl.formatMessage, selectedNodeType)));
@@ -22,16 +22,19 @@ var containerStyles = (0, _primitives.xcss)({
22
22
  var LayoutGroup = exports.LayoutGroup = function LayoutGroup(_ref) {
23
23
  var layoutButtons = _ref.layoutButtons,
24
24
  dispatchCommand = _ref.dispatchCommand,
25
- hide = _ref.hide;
25
+ hide = _ref.hide,
26
+ areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled;
26
27
  return (0, _react.jsx)(_primitives.Box, {
27
28
  xcss: containerStyles
28
29
  }, (0, _react.jsx)(_button.ButtonGroup, null, layoutButtons.map(function (item, idx) {
29
30
  switch (item.type) {
30
31
  case 'separator':
32
+ return (0, _react.jsx)(_ui.FloatingToolbarSeparator
31
33
  // Ignored via go/ees005
32
34
  // eslint-disable-next-line react/no-array-index-key
33
- return (0, _react.jsx)(_ui.FloatingToolbarSeparator, {
34
- key: idx
35
+ , {
36
+ key: idx,
37
+ areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
35
38
  });
36
39
  case 'button':
37
40
  // Ignored via go/ees005
@@ -51,7 +54,8 @@ var LayoutGroup = exports.LayoutGroup = function LayoutGroup(_ref) {
51
54
  onClick: function onClick() {
52
55
  dispatchCommand(item.onClick);
53
56
  hide();
54
- }
57
+ },
58
+ areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
55
59
  });
56
60
  }
57
61
  })));
@@ -38,7 +38,8 @@ var LinkToolbarAppearance = exports.LinkToolbarAppearance = function LinkToolbar
38
38
  onEditLink = _ref.onEditLink,
39
39
  onOpenLink = _ref.onOpenLink,
40
40
  isInlineNode = _ref.isInlineNode,
41
- isViewOnly = _ref.isViewOnly;
41
+ isViewOnly = _ref.isViewOnly,
42
+ areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled;
42
43
  var _useState = (0, _react.useState)(true),
43
44
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
44
45
  showLinkingControls = _useState2[0],
@@ -75,7 +76,8 @@ var LinkToolbarAppearance = exports.LinkToolbarAppearance = function LinkToolbar
75
76
  description: title,
76
77
  keymap: _keymaps.addLink
77
78
  }),
78
- testId: "edit-link-button"
79
+ testId: "edit-link-button",
80
+ areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
79
81
  }, title)), (0, _react2.jsx)(_ui.FloatingToolbarButton, {
80
82
  target: "_blank",
81
83
  href: isValidUrl ? mediaLinkingState.link : undefined,
@@ -89,8 +91,11 @@ var LinkToolbarAppearance = exports.LinkToolbarAppearance = function LinkToolbar
89
91
  })
90
92
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
91
93
  ,
92
- className: "hyperlink-open-link"
93
- }), (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
94
+ className: "hyperlink-open-link",
95
+ areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
96
+ }), (0, _react2.jsx)(_ui.FloatingToolbarSeparator, {
97
+ areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
98
+ }));
94
99
  } else {
95
100
  var _title = intl.formatMessage(_messages.linkToolbarMessages.addLink);
96
101
  return !isViewOnly ? (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_ui.FloatingToolbarButton, {
@@ -105,7 +110,10 @@ var LinkToolbarAppearance = exports.LinkToolbarAppearance = function LinkToolbar
105
110
  color: "currentColor",
106
111
  label: _title,
107
112
  spacing: "spacious"
108
- })
109
- }), (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null)) : null;
113
+ }),
114
+ areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
115
+ }), (0, _react2.jsx)(_ui.FloatingToolbarSeparator, {
116
+ areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
117
+ })) : null;
110
118
  }
111
119
  };
@@ -11,6 +11,7 @@ var _react = _interopRequireDefault(require("react"));
11
11
  var _adfSchema = require("@atlaskit/adf-schema");
12
12
  var _analytics = require("@atlaskit/editor-common/analytics");
13
13
  var _messages = require("@atlaskit/editor-common/messages");
14
+ var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
14
15
  var _ui = require("@atlaskit/editor-common/ui");
15
16
  var _link = _interopRequireDefault(require("@atlaskit/icon/core/link"));
16
17
  var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
@@ -109,7 +110,8 @@ var getLinkingToolbar = exports.getLinkingToolbar = function getLinkingToolbar(t
109
110
  },
110
111
  onBlur: function onBlur() {
111
112
  (0, _linking.hideLinkingToolbar)(view.state, view.dispatch, view);
112
- }
113
+ },
114
+ areAnyNewToolbarFlagsEnabled: (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar))
113
115
  });
114
116
  }
115
117
  }]
@@ -48,12 +48,12 @@ var generateMediaInlineFloatingToolbar = exports.generateMediaInlineFloatingTool
48
48
  return getMediaInlineImageToolbar(state, intl, mediaPluginState, hoverDecoration, editorAnalyticsAPI, pluginInjectionApi, mediaLinkingState, options);
49
49
  }
50
50
  var items = [];
51
- var isNewEditorToolbarEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)();
51
+ var areAnyNewToolbarFlagsEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar));
52
52
  var preview = _objectSpread({
53
53
  id: 'editor.media.viewer',
54
54
  testId: 'file-preview-toolbar-button',
55
55
  type: 'button',
56
- icon: isNewEditorToolbarEnabled ? _growDiagonal.default : _maximize.default,
56
+ icon: areAnyNewToolbarFlagsEnabled ? _growDiagonal.default : _maximize.default,
57
57
  title: intl.formatMessage(_mediaUi.messages.preview),
58
58
  onClick: function onClick() {
59
59
  var _handleShowMediaViewe;
@@ -62,7 +62,7 @@ var generateMediaInlineFloatingToolbar = exports.generateMediaInlineFloatingTool
62
62
  api: pluginInjectionApi
63
63
  })) !== null && _handleShowMediaViewe !== void 0 ? _handleShowMediaViewe : false;
64
64
  }
65
- }, isNewEditorToolbarEnabled && {
65
+ }, areAnyNewToolbarFlagsEnabled && {
66
66
  supportsViewMode: true
67
67
  });
68
68
  var disableDownloadButton = (0, _utils.getIsDownloadDisabledByDataSecurityPolicy)(mediaPluginState);
@@ -76,10 +76,10 @@ var generateMediaInlineFloatingToolbar = exports.generateMediaInlineFloatingTool
76
76
  },
77
77
  disabled: disableDownloadButton,
78
78
  title: intl.formatMessage(_mediaUi.messages.download)
79
- }, isNewEditorToolbarEnabled && {
79
+ }, areAnyNewToolbarFlagsEnabled && {
80
80
  supportsViewMode: true
81
81
  });
82
- if (!isNewEditorToolbarEnabled) {
82
+ if (!areAnyNewToolbarFlagsEnabled) {
83
83
  items.push({
84
84
  id: 'editor.media.view.switcher.inline',
85
85
  type: 'button',
@@ -304,7 +304,8 @@ var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl
304
304
  onEditLink: editLink,
305
305
  onOpenLink: openLink,
306
306
  isInlineNode: true,
307
- isViewOnly: options.isViewOnly
307
+ isViewOnly: options.isViewOnly,
308
+ areAnyNewToolbarFlagsEnabled: (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar))
308
309
  });
309
310
  }
310
311
  return null;
@@ -322,7 +322,7 @@ export const mediaPlugin = ({
322
322
  pluginsOptions: {
323
323
  quickInsert: ({
324
324
  formatMessage
325
- }) => fg('platform_editor_add_media_from_url_rollout') ? [] : [{
325
+ }) => fg('platform_editor_add_media_from_url_rollout') || options !== null && options !== void 0 && options.disableQuickInsert ? [] : [{
326
326
  id: 'media',
327
327
  title: formatMessage(messages.mediaFiles),
328
328
  description: formatMessage(messages.mediaFilesDescription),
@@ -13,6 +13,7 @@ import { withAnalyticsEvents } from '@atlaskit/analytics-next';
13
13
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
14
14
  import { escape, ToolTipContent } from '@atlaskit/editor-common/keymaps';
15
15
  import { altTextMessages as messages } from '@atlaskit/editor-common/media';
16
+ import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
16
17
  import { RECENT_SEARCH_WIDTH_IN_PX as CONTAINER_WIDTH_IN_PX, FloatingToolbarButton as Button, ErrorMessage, PanelTextInput } from '@atlaskit/editor-common/ui';
17
18
  import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
18
19
  import ChevronLeftLargeIcon from '@atlaskit/icon/core/migration/chevron-left--chevron-left-large';
@@ -164,6 +165,7 @@ export class AltTextEditComponent extends React.Component {
164
165
  return [];
165
166
  }
166
167
  render() {
168
+ var _this$props$areAnyNew, _this$props$areAnyNew2;
167
169
  const {
168
170
  intl: {
169
171
  formatMessage
@@ -200,7 +202,8 @@ export class AltTextEditComponent extends React.Component {
200
202
  size: "small"
201
203
  }),
202
204
  tooltipContent: backButtonMessageComponent,
203
- onClick: this.closeMediaAltTextMenu
205
+ onClick: this.closeMediaAltTextMenu,
206
+ areAnyNewToolbarFlagsEnabled: (_this$props$areAnyNew = this.props.areAnyNewToolbarFlagsEnabled) !== null && _this$props$areAnyNew !== void 0 ? _this$props$areAnyNew : areToolbarFlagsEnabled()
204
207
  })), jsx(PanelTextInput, {
205
208
  testId: "alt-text-input",
206
209
  ariaLabel: formatMessage(messages.placeholder),
@@ -226,7 +229,8 @@ export class AltTextEditComponent extends React.Component {
226
229
  label: formatMessage(messages.clear)
227
230
  })),
228
231
  tooltipContent: formatMessage(messages.clear),
229
- onClick: this.handleClearText
232
+ onClick: this.handleClearText,
233
+ areAnyNewToolbarFlagsEnabled: (_this$props$areAnyNew2 = this.props.areAnyNewToolbarFlagsEnabled) !== null && _this$props$areAnyNew2 !== void 0 ? _this$props$areAnyNew2 : areToolbarFlagsEnabled()
230
234
  }))), hasErrors && jsx("section", {
231
235
  id: "errors-list",
232
236
  ref: this.errorsListRef,
@@ -134,7 +134,8 @@ class LinkAddToolbar extends React.PureComponent {
134
134
  inputMethod: currentInputMethod
135
135
  }, true);
136
136
  }
137
- }
137
+ },
138
+ areAnyNewToolbarFlagsEnabled: this.props.areAnyNewToolbarFlagsEnabled
138
139
  })), jsx(PanelTextInput, {
139
140
  inputId: "media-link-search-input",
140
141
  testId: "media-link-input",
@@ -161,7 +162,9 @@ class LinkAddToolbar extends React.PureComponent {
161
162
  }), jsx("label", {
162
163
  className: "assistive",
163
164
  htmlFor: "media-link-search-input"
164
- }, formatMessage(linkToolbarMessages.searchInput)), normalizeUrl(displayUrl) && jsx(Fragment, null, jsx(Separator, null), jsx(Button, {
165
+ }, formatMessage(linkToolbarMessages.searchInput)), normalizeUrl(displayUrl) && jsx(Fragment, null, jsx(Separator, {
166
+ areAnyNewToolbarFlagsEnabled: this.props.areAnyNewToolbarFlagsEnabled
167
+ }), jsx(Button, {
165
168
  title: formatUnlinkText,
166
169
  icon: jsx(EditorUnlinkIcon, {
167
170
  label: formatUnlinkText
@@ -172,7 +175,8 @@ class LinkAddToolbar extends React.PureComponent {
172
175
  event.preventDefault();
173
176
  this.handleUnlink(true);
174
177
  }
175
- }
178
+ },
179
+ areAnyNewToolbarFlagsEnabled: this.props.areAnyNewToolbarFlagsEnabled
176
180
  }))), !!errorsList.length && jsx("section", {
177
181
  css: validationWrapper
178
182
  }, errorsList), renderRecentList()))
@@ -71,7 +71,8 @@ const altTextEditComponent = options => {
71
71
  value: mediaNode.attrs.alt,
72
72
  altTextValidator: options && options.altTextValidator,
73
73
  onEscape: setFocus,
74
- onEnter: setFocus
74
+ onEnter: setFocus,
75
+ areAnyNewToolbarFlagsEnabled: options === null || options === void 0 ? void 0 : options.areAnyNewToolbarFlagsEnabled
75
76
  });
76
77
  }
77
78
  };