@atlaskit/editor-plugin-media 2.3.4 → 2.3.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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 2.3.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 2.3.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [#122997](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122997)
14
+ [`791cc6fffe214`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/791cc6fffe214) -
15
+ Cleanup FF platform_editor_fix_edit_caption_on_edge
16
+ - [#122924](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122924)
17
+ [`cf36dece8da78`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cf36dece8da78) -
18
+ [ED-26945] Hide overflow menu when resizing media single
19
+
3
20
  ## 2.3.4
4
21
 
5
22
  ### Patch Changes
@@ -12,7 +12,6 @@ var _react2 = require("@emotion/react");
12
12
  var _reactIntlNext = require("react-intl-next");
13
13
  var _media = require("@atlaskit/editor-common/media");
14
14
  var _mediaSingle = require("@atlaskit/editor-common/media-single");
15
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
15
  var _primitives = require("@atlaskit/primitives");
17
16
  var _colors = require("@atlaskit/theme/colors");
18
17
  var _templateObject;
@@ -42,27 +41,12 @@ var CaptionPlaceholder = exports.CaptionPlaceholder = /*#__PURE__*/_react.defaul
42
41
 
43
42
  // This issue is a temporary fix for users being able to edit captions on edge browsers. This will be removed
44
43
  // replaced with CaptionPlaceholderButton in the near future and this code can be removed.
45
- if ((0, _platformFeatureFlags.fg)('platform_editor_fix_edit_caption_on_edge')) {
46
- return (
47
- // eslint-disable-next-line @atlaskit/design-system/use-primitives-text, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
48
- (0, _react2.jsx)("span", {
49
- ref: ref,
50
- css: placeholder,
51
- onPointerDown: handlePointerDown,
52
- "data-id": _mediaSingle.CAPTION_PLACEHOLDER_ID,
53
- "data-testid": "caption-placeholder"
54
- }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
55
- // Ignored via go/ees005
56
- // eslint-disable-next-line react/jsx-props-no-spreading
57
- , computedPlaceholderMessage))
58
- );
59
- }
60
44
  return (
61
45
  // eslint-disable-next-line @atlaskit/design-system/use-primitives-text, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
62
46
  (0, _react2.jsx)("span", {
63
47
  ref: ref,
64
48
  css: placeholder,
65
- onClick: onClick,
49
+ onPointerDown: handlePointerDown,
66
50
  "data-id": _mediaSingle.CAPTION_PLACEHOLDER_ID,
67
51
  "data-testid": "caption-placeholder"
68
52
  }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
@@ -45,7 +45,9 @@ var pixelEntryHiddenSubmit = exports.pixelEntryHiddenSubmit = (0, _react.css)({
45
45
  gridArea: 'submit',
46
46
  visibility: 'hidden',
47
47
  width: 0,
48
- height: 0
48
+ height: 0,
49
+ // this is needed so that this button doesn't contribute to scroll width of media floating toolbar and display scroll buttons unnecessarily
50
+ padding: 0
49
51
  });
50
52
 
51
53
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
@@ -747,18 +747,16 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
747
747
  };
748
748
  items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi);
749
749
  }
750
- if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
750
+ if (!mediaPluginState.isResizing && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
751
751
  var _pluginInjectionApi$a10;
752
- if (items.length) {
753
- if (items[items.length - 1].type === 'separator') {
754
- var separatorItem = items[items.length - 1];
755
- separatorItem.fullHeight = true;
756
- } else {
757
- items.push({
758
- type: 'separator',
759
- fullHeight: true
760
- });
761
- }
752
+ var lastItem = items.at(-1);
753
+ if ((lastItem === null || lastItem === void 0 ? void 0 : lastItem.type) === 'separator') {
754
+ lastItem.fullHeight = true;
755
+ } else if (items.length) {
756
+ items.push({
757
+ type: 'separator',
758
+ fullHeight: true
759
+ });
762
760
  }
763
761
  var altTextTitle = intl.formatMessage(_media.altTextMessages.addAltText);
764
762
  items.push({
@@ -9,7 +9,6 @@ import { css, jsx } from '@emotion/react';
9
9
  import { FormattedMessage } from 'react-intl-next';
10
10
  import { captionMessages as messages } from '@atlaskit/editor-common/media';
11
11
  import { CAPTION_PLACEHOLDER_ID } from '@atlaskit/editor-common/media-single';
12
- import { fg } from '@atlaskit/platform-feature-flags';
13
12
  import { Pressable, Text, xcss } from '@atlaskit/primitives';
14
13
  import { N200 } from '@atlaskit/theme/colors';
15
14
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
@@ -38,27 +37,12 @@ export const CaptionPlaceholder = /*#__PURE__*/React.forwardRef(({
38
37
 
39
38
  // This issue is a temporary fix for users being able to edit captions on edge browsers. This will be removed
40
39
  // replaced with CaptionPlaceholderButton in the near future and this code can be removed.
41
- if (fg('platform_editor_fix_edit_caption_on_edge')) {
42
- return (
43
- // eslint-disable-next-line @atlaskit/design-system/use-primitives-text, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
44
- jsx("span", {
45
- ref: ref,
46
- css: placeholder,
47
- onPointerDown: handlePointerDown,
48
- "data-id": CAPTION_PLACEHOLDER_ID,
49
- "data-testid": "caption-placeholder"
50
- }, jsx(FormattedMessage
51
- // Ignored via go/ees005
52
- // eslint-disable-next-line react/jsx-props-no-spreading
53
- , computedPlaceholderMessage))
54
- );
55
- }
56
40
  return (
57
41
  // eslint-disable-next-line @atlaskit/design-system/use-primitives-text, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
58
42
  jsx("span", {
59
43
  ref: ref,
60
44
  css: placeholder,
61
- onClick: onClick,
45
+ onPointerDown: handlePointerDown,
62
46
  "data-id": CAPTION_PLACEHOLDER_ID,
63
47
  "data-testid": "caption-placeholder"
64
48
  }, jsx(FormattedMessage
@@ -50,7 +50,9 @@ export const pixelEntryHiddenSubmit = css({
50
50
  gridArea: 'submit',
51
51
  visibility: 'hidden',
52
52
  width: 0,
53
- height: 0
53
+ height: 0,
54
+ // this is needed so that this button doesn't contribute to scroll width of media floating toolbar and display scroll buttons unnecessarily
55
+ padding: 0
54
56
  });
55
57
 
56
58
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
@@ -747,18 +747,16 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
747
747
  };
748
748
  items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi);
749
749
  }
750
- if (editorExperiment('platform_editor_controls', 'variant1')) {
750
+ if (!mediaPluginState.isResizing && editorExperiment('platform_editor_controls', 'variant1')) {
751
751
  var _pluginInjectionApi$a10;
752
- if (items.length) {
753
- if (items[items.length - 1].type === 'separator') {
754
- const separatorItem = items[items.length - 1];
755
- separatorItem.fullHeight = true;
756
- } else {
757
- items.push({
758
- type: 'separator',
759
- fullHeight: true
760
- });
761
- }
752
+ const lastItem = items.at(-1);
753
+ if ((lastItem === null || lastItem === void 0 ? void 0 : lastItem.type) === 'separator') {
754
+ lastItem.fullHeight = true;
755
+ } else if (items.length) {
756
+ items.push({
757
+ type: 'separator',
758
+ fullHeight: true
759
+ });
762
760
  }
763
761
  const altTextTitle = intl.formatMessage(altTextMessages.addAltText);
764
762
  items.push({
@@ -11,7 +11,6 @@ import { css, jsx } from '@emotion/react';
11
11
  import { FormattedMessage } from 'react-intl-next';
12
12
  import { captionMessages as messages } from '@atlaskit/editor-common/media';
13
13
  import { CAPTION_PLACEHOLDER_ID } from '@atlaskit/editor-common/media-single';
14
- import { fg } from '@atlaskit/platform-feature-flags';
15
14
  import { Pressable, Text, xcss } from '@atlaskit/primitives';
16
15
  import { N200 } from '@atlaskit/theme/colors';
17
16
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
@@ -33,27 +32,12 @@ export var CaptionPlaceholder = /*#__PURE__*/React.forwardRef(function (_ref, re
33
32
 
34
33
  // This issue is a temporary fix for users being able to edit captions on edge browsers. This will be removed
35
34
  // replaced with CaptionPlaceholderButton in the near future and this code can be removed.
36
- if (fg('platform_editor_fix_edit_caption_on_edge')) {
37
- return (
38
- // eslint-disable-next-line @atlaskit/design-system/use-primitives-text, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
39
- jsx("span", {
40
- ref: ref,
41
- css: placeholder,
42
- onPointerDown: handlePointerDown,
43
- "data-id": CAPTION_PLACEHOLDER_ID,
44
- "data-testid": "caption-placeholder"
45
- }, jsx(FormattedMessage
46
- // Ignored via go/ees005
47
- // eslint-disable-next-line react/jsx-props-no-spreading
48
- , computedPlaceholderMessage))
49
- );
50
- }
51
35
  return (
52
36
  // eslint-disable-next-line @atlaskit/design-system/use-primitives-text, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
53
37
  jsx("span", {
54
38
  ref: ref,
55
39
  css: placeholder,
56
- onClick: onClick,
40
+ onPointerDown: handlePointerDown,
57
41
  "data-id": CAPTION_PLACEHOLDER_ID,
58
42
  "data-testid": "caption-placeholder"
59
43
  }, jsx(FormattedMessage
@@ -39,7 +39,9 @@ export var pixelEntryHiddenSubmit = css({
39
39
  gridArea: 'submit',
40
40
  visibility: 'hidden',
41
41
  width: 0,
42
- height: 0
42
+ height: 0,
43
+ // this is needed so that this button doesn't contribute to scroll width of media floating toolbar and display scroll buttons unnecessarily
44
+ padding: 0
43
45
  });
44
46
 
45
47
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
@@ -737,18 +737,16 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
737
737
  };
738
738
  items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi);
739
739
  }
740
- if (editorExperiment('platform_editor_controls', 'variant1')) {
740
+ if (!mediaPluginState.isResizing && editorExperiment('platform_editor_controls', 'variant1')) {
741
741
  var _pluginInjectionApi$a10;
742
- if (items.length) {
743
- if (items[items.length - 1].type === 'separator') {
744
- var separatorItem = items[items.length - 1];
745
- separatorItem.fullHeight = true;
746
- } else {
747
- items.push({
748
- type: 'separator',
749
- fullHeight: true
750
- });
751
- }
742
+ var lastItem = items.at(-1);
743
+ if ((lastItem === null || lastItem === void 0 ? void 0 : lastItem.type) === 'separator') {
744
+ lastItem.fullHeight = true;
745
+ } else if (items.length) {
746
+ items.push({
747
+ type: 'separator',
748
+ fullHeight: true
749
+ });
752
750
  }
753
751
  var altTextTitle = intl.formatMessage(altTextMessages.addAltText);
754
752
  items.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "2.3.4",
3
+ "version": "2.3.6",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,10 +38,10 @@
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": "^101.1.0",
42
- "@atlaskit/editor-palette": "2.0.0",
41
+ "@atlaskit/editor-common": "^102.0.0",
42
+ "@atlaskit/editor-palette": "^2.0.0",
43
43
  "@atlaskit/editor-plugin-analytics": "^2.1.0",
44
- "@atlaskit/editor-plugin-annotation": "2.1.1",
44
+ "@atlaskit/editor-plugin-annotation": "^2.1.0",
45
45
  "@atlaskit/editor-plugin-connectivity": "^2.0.0",
46
46
  "@atlaskit/editor-plugin-decorations": "^2.0.0",
47
47
  "@atlaskit/editor-plugin-editor-disabled": "^2.0.0",