@atlaskit/editor-plugin-media 1.43.8 → 1.43.9

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,14 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 1.43.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#97992](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97992)
8
+ [`129bc0e5c4f11`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/129bc0e5c4f11) -
9
+ ED-26104 fix editing captions on edge browsers
10
+ - Updated dependencies
11
+
3
12
  ## 1.43.8
4
13
 
5
14
  ### Patch Changes
@@ -37,7 +37,29 @@ var placeholderButton = (0, _primitives.xcss)({
37
37
  // Remove this component
38
38
  var CaptionPlaceholder = exports.CaptionPlaceholder = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
39
39
  var onClick = _ref.onClick;
40
+ var handlePointerDown = (0, _react.useCallback)(function (e) {
41
+ e.preventDefault();
42
+ onClick();
43
+ }, [onClick]);
40
44
  var message = (0, _platformFeatureFlags.fg)('platform_editor_media_interaction_improvements') ? _objectSpread({}, _media.captionMessages.placeholderWithDoubleClickPrompt) : _objectSpread({}, _media.captionMessages.placeholder);
45
+
46
+ // This issue is a temporary fix for users being able to edit captions on edge browsers. This will be removed
47
+ // replaced with CaptionPlaceholderButton in the near future and this code can be removed.
48
+ if ((0, _platformFeatureFlags.fg)('platform_editor_fix_edit_caption_on_edge')) {
49
+ return (
50
+ // eslint-disable-next-line @atlaskit/design-system/use-primitives-text, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
51
+ (0, _react2.jsx)("span", {
52
+ ref: ref,
53
+ css: placeholder,
54
+ onPointerDown: handlePointerDown,
55
+ "data-id": _mediaSingle.CAPTION_PLACEHOLDER_ID,
56
+ "data-testid": "caption-placeholder"
57
+ }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
58
+ // Ignored via go/ees005
59
+ // eslint-disable-next-line react/jsx-props-no-spreading
60
+ , message))
61
+ );
62
+ }
41
63
  return (
42
64
  // eslint-disable-next-line @atlaskit/design-system/use-primitives-text, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
43
65
  (0, _react2.jsx)("span", {
@@ -30,11 +30,33 @@ const placeholderButton = xcss({
30
30
  export const CaptionPlaceholder = /*#__PURE__*/React.forwardRef(({
31
31
  onClick
32
32
  }, ref) => {
33
+ const handlePointerDown = useCallback(e => {
34
+ e.preventDefault();
35
+ onClick();
36
+ }, [onClick]);
33
37
  const message = fg('platform_editor_media_interaction_improvements') ? {
34
38
  ...messages.placeholderWithDoubleClickPrompt
35
39
  } : {
36
40
  ...messages.placeholder
37
41
  };
42
+
43
+ // This issue is a temporary fix for users being able to edit captions on edge browsers. This will be removed
44
+ // replaced with CaptionPlaceholderButton in the near future and this code can be removed.
45
+ if (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
+ jsx("span", {
49
+ ref: ref,
50
+ css: placeholder,
51
+ onPointerDown: handlePointerDown,
52
+ "data-id": CAPTION_PLACEHOLDER_ID,
53
+ "data-testid": "caption-placeholder"
54
+ }, jsx(FormattedMessage
55
+ // Ignored via go/ees005
56
+ // eslint-disable-next-line react/jsx-props-no-spreading
57
+ , message))
58
+ );
59
+ }
38
60
  return (
39
61
  // eslint-disable-next-line @atlaskit/design-system/use-primitives-text, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
40
62
  jsx("span", {
@@ -28,7 +28,29 @@ var placeholderButton = xcss({
28
28
  // Remove this component
29
29
  export var CaptionPlaceholder = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
30
30
  var onClick = _ref.onClick;
31
+ var handlePointerDown = useCallback(function (e) {
32
+ e.preventDefault();
33
+ onClick();
34
+ }, [onClick]);
31
35
  var message = fg('platform_editor_media_interaction_improvements') ? _objectSpread({}, messages.placeholderWithDoubleClickPrompt) : _objectSpread({}, messages.placeholder);
36
+
37
+ // This issue is a temporary fix for users being able to edit captions on edge browsers. This will be removed
38
+ // replaced with CaptionPlaceholderButton in the near future and this code can be removed.
39
+ if (fg('platform_editor_fix_edit_caption_on_edge')) {
40
+ return (
41
+ // eslint-disable-next-line @atlaskit/design-system/use-primitives-text, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
42
+ jsx("span", {
43
+ ref: ref,
44
+ css: placeholder,
45
+ onPointerDown: handlePointerDown,
46
+ "data-id": CAPTION_PLACEHOLDER_ID,
47
+ "data-testid": "caption-placeholder"
48
+ }, jsx(FormattedMessage
49
+ // Ignored via go/ees005
50
+ // eslint-disable-next-line react/jsx-props-no-spreading
51
+ , message))
52
+ );
53
+ }
32
54
  return (
33
55
  // eslint-disable-next-line @atlaskit/design-system/use-primitives-text, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
34
56
  jsx("span", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "1.43.8",
3
+ "version": "1.43.9",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/editor-common": "^97.2.0",
40
40
  "@atlaskit/editor-palette": "1.6.3",
41
41
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
42
- "@atlaskit/editor-plugin-annotation": "1.26.7",
42
+ "@atlaskit/editor-plugin-annotation": "1.26.8",
43
43
  "@atlaskit/editor-plugin-connectivity": "^1.1.0",
44
44
  "@atlaskit/editor-plugin-decorations": "^1.3.0",
45
45
  "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
@@ -67,7 +67,7 @@
67
67
  "@atlaskit/primitives": "^13.3.0",
68
68
  "@atlaskit/textfield": "^6.7.0",
69
69
  "@atlaskit/theme": "^14.0.0",
70
- "@atlaskit/tmp-editor-statsig": "^2.29.0",
70
+ "@atlaskit/tmp-editor-statsig": "^2.30.0",
71
71
  "@atlaskit/tokens": "^2.5.0",
72
72
  "@atlaskit/tooltip": "^19.0.0",
73
73
  "@babel/runtime": "^7.0.0",
@@ -162,6 +162,9 @@
162
162
  },
163
163
  "platform_editor_media_block_default": {
164
164
  "type": "boolean"
165
+ },
166
+ "platform_editor_fix_edit_caption_on_edge": {
167
+ "type": "boolean"
165
168
  }
166
169
  },
167
170
  "stricter": {