@atlaskit/editor-plugin-media 14.2.18 → 14.3.1

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,24 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 14.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4fa93c380fa24`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4fa93c380fa24) -
8
+ Clean up platform editor typography UGC feature gate
9
+
10
+ ## 14.3.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [`1bdd62ad6abf9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1bdd62ad6abf9) -
15
+ Fix the AI "Ask Rovo" / "Edit image" loading overlay appearing on every copy of a duplicated
16
+ image, so only the acted-on image shows the loading state. Behind an experiment.
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
3
22
  ## 14.2.18
4
23
 
5
24
  ### Patch Changes
@@ -21,7 +21,6 @@ var _ui = require("@atlaskit/editor-common/ui");
21
21
  var _state = require("@atlaskit/editor-prosemirror/state");
22
22
  var _utils = require("@atlaskit/editor-prosemirror/utils");
23
23
  var _mediaClient = require("@atlaskit/media-client");
24
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
25
24
  var _captions = require("../pm-plugins/commands/captions");
26
25
  var _mediaCommon = require("../pm-plugins/utils/media-common");
27
26
  var _CaptionPlaceholder = require("../ui/CaptionPlaceholder");
@@ -503,18 +502,11 @@ var MediaSingleNodeNext = exports.MediaSingleNodeNext = function MediaSingleNode
503
502
  }));
504
503
  }), (0, _react2.jsx)(_reactNodeView.NodeViewContentHole, {
505
504
  ref: forwardRef
506
- }), shouldShowPlaceholder && ((0, _platformFeatureFlags.fg)('platform_editor_typography_ugc') ? (0, _react2.jsx)(_CaptionPlaceholder.CaptionPlaceholderButton
507
- // platform_editor_typography_ugc clean up
508
- // remove typecasting
509
- , {
505
+ }), shouldShowPlaceholder && (0, _react2.jsx)(_CaptionPlaceholder.CaptionPlaceholderButton, {
510
506
  ref: captionPlaceHolderRef,
511
507
  onClick: clickPlaceholder,
512
508
  placeholderMessage: mediaOptions.allowImagePreview ? _media.captionMessages.placeholderWithDoubleClickPrompt : _media.captionMessages.placeholder
513
- }) : (0, _react2.jsx)(_CaptionPlaceholder.CaptionPlaceholder, {
514
- ref: captionPlaceHolderRef,
515
- onClick: clickPlaceholder,
516
- placeholderMessage: mediaOptions.allowImagePreview ? _media.captionMessages.placeholderWithDoubleClickPrompt : _media.captionMessages.placeholder
517
- })));
509
+ }));
518
510
  if (widthType !== 'pixel') {
519
511
  return (0, _react2.jsx)(_react.Fragment, null, canResize ? mediaOptions.allowPixelResizing ? (0, _react2.jsx)(_ResizableMediaSingleNext.default, {
520
512
  view: view,
@@ -39,15 +39,27 @@ var AI_GENERATING_DECORATION_TYPE = 'ai-generating';
39
39
 
40
40
  /**
41
41
  * Build a DecorationSet containing a Decoration.node for every media node
42
- * whose `id` is in the given set.
42
+ * targeted by the given set.
43
+ *
44
+ * Targets are matched by `localId` first (the mediaSingle wrapper's or the media
45
+ * node's own) so that duplicate copies of the same image — which share a media
46
+ * file `id` — don't all get decorated; only the node the user acted on lights
47
+ * up. Falls back to the media file `id` for the CWR flow and for any node that
48
+ * has no localId yet.
43
49
  */
44
- function buildDecorationSet(doc, mediaIds) {
45
- if (mediaIds.size === 0) {
50
+ function buildDecorationSet(doc, targetIds) {
51
+ if (targetIds.size === 0) {
46
52
  return _view.DecorationSet.empty;
47
53
  }
48
54
  var decorations = [];
49
- doc.descendants(function (node, pos) {
50
- if (node.type.name === 'media' && mediaIds.has(node.attrs.id)) {
55
+ doc.descendants(function (node, pos, parent) {
56
+ var _parent$attrs;
57
+ if (node.type.name !== 'media') {
58
+ return;
59
+ }
60
+ var wrapperLocalId = parent === null || parent === void 0 || (_parent$attrs = parent.attrs) === null || _parent$attrs === void 0 ? void 0 : _parent$attrs.localId;
61
+ var matches = wrapperLocalId && targetIds.has(wrapperLocalId) || node.attrs.localId && targetIds.has(node.attrs.localId) || targetIds.has(node.attrs.id);
62
+ if (matches) {
51
63
  decorations.push(_view.Decoration.node(pos, pos + node.nodeSize, {},
52
64
  // no DOM attrs needed — the NodeView reads the decoration spec
53
65
  {
@@ -1,32 +1,27 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports.CaptionPlaceholderButton = exports.CaptionPlaceholder = void 0;
9
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
7
+ exports.CaptionPlaceholderButton = void 0;
10
8
  var _react = _interopRequireWildcard(require("react"));
11
9
  var _react2 = require("@emotion/react");
12
10
  var _reactIntl = require("react-intl");
13
11
  var _media = require("@atlaskit/editor-common/media");
14
12
  var _mediaSingle = require("@atlaskit/editor-common/media-single");
15
13
  var _primitives = require("@atlaskit/primitives");
16
- var _templateObject;
14
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
17
15
  /* eslint-disable @atlaskit/design-system/use-primitives-text */
18
- // This had to be disabled to add an id and styles to a component that could not be replaced with Text
19
- // This was added in a experiment cleanup and should be removed if possible
20
- // Be sure to use primitives in this file as needed
21
16
  /**
22
17
  * @jsxRuntime classic
23
18
  * @jsx jsx
24
19
  */
20
+
25
21
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
22
+
26
23
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
27
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
28
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
29
- var placeholder = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tcolor: ", ";\n\twidth: 100%;\n\ttext-align: center;\n\tmargin-top: ", " !important;\n\tdisplay: block;\n"])), "var(--ds-text-subtlest, #6B6E76)", "var(--ds-space-100, 8px)");
24
+
30
25
  var placeholderText = (0, _react2.css)({
31
26
  color: "var(--ds-text-subtlest, #6B6E76)"
32
27
  });
@@ -34,40 +29,9 @@ var placeholderButton = (0, _primitives.xcss)({
34
29
  width: '100%',
35
30
  marginTop: 'space.100'
36
31
  });
37
- // platform_editor_typography_ugc clean up
38
- // Remove this component
39
- var CaptionPlaceholder = exports.CaptionPlaceholder = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
32
+ var CaptionPlaceholderButton = exports.CaptionPlaceholderButton = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
40
33
  var onClick = _ref.onClick,
41
34
  placeholderMessage = _ref.placeholderMessage;
42
- var handlePointerDown = (0, _react.useCallback)(function (e) {
43
- e.preventDefault();
44
- onClick();
45
- }, [onClick]);
46
- var computedPlaceholderMessage = placeholderMessage ? placeholderMessage : _media.captionMessages.placeholder;
47
-
48
- // This issue is a temporary fix for users being able to edit captions on edge browsers. This will be removed
49
- // replaced with CaptionPlaceholderButton in the near future and this code can be removed.
50
- return (
51
- // eslint-disable-next-line @atlaskit/design-system/use-primitives-text
52
- (0, _react2.jsx)("span", {
53
- ref: ref,
54
- css: placeholder,
55
- onPointerDown: handlePointerDown
56
- // This id is just used for setting styles at the moment, if it's needed for anything more specific
57
- // It may need to be generated to avoid overlap
58
- ,
59
- id: _mediaSingle.CAPTION_PLACEHOLDER_ID,
60
- "data-id": _mediaSingle.CAPTION_PLACEHOLDER_ID,
61
- "data-testid": "caption-placeholder"
62
- }, (0, _react2.jsx)(_reactIntl.FormattedMessage
63
- // Ignored via go/ees005
64
- // eslint-disable-next-line react/jsx-props-no-spreading
65
- , computedPlaceholderMessage))
66
- );
67
- });
68
- var CaptionPlaceholderButton = exports.CaptionPlaceholderButton = /*#__PURE__*/_react.default.forwardRef(function (_ref2, ref) {
69
- var onClick = _ref2.onClick,
70
- placeholderMessage = _ref2.placeholderMessage;
71
35
  var handleMouseDown = (0, _react.useCallback)(function (e) {
72
36
  // In firefox, button is focused when mouse down, which make editor lose focus
73
37
  // Hence we want to disabled it so that user can type in caption directly after click
@@ -16,10 +16,9 @@ import { MediaSingle } from '@atlaskit/editor-common/ui';
16
16
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
17
17
  import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
18
18
  import { getAttrsFromUrl } from '@atlaskit/media-client';
19
- import { fg } from '@atlaskit/platform-feature-flags';
20
19
  import { insertAndSelectCaptionFromMediaSinglePos } from '../pm-plugins/commands/captions';
21
20
  import { isMediaBlobUrlFromAttrs } from '../pm-plugins/utils/media-common';
22
- import { CaptionPlaceholder, CaptionPlaceholderButton } from '../ui/CaptionPlaceholder';
21
+ import { CaptionPlaceholderButton } from '../ui/CaptionPlaceholder';
23
22
  import { CommentBadgeWrapper } from '../ui/CommentBadge';
24
23
  import ResizableMediaSingle from '../ui/ResizableMediaSingle';
25
24
  import ResizableMediaSingleNext from '../ui/ResizableMediaSingle/ResizableMediaSingleNext';
@@ -462,18 +461,11 @@ export const MediaSingleNodeNext = mediaSingleNodeNextProps => {
462
461
  isDrafting: isCurrentNodeDrafting
463
462
  }))), jsx(NodeViewContentHole, {
464
463
  ref: forwardRef
465
- }), shouldShowPlaceholder && (fg('platform_editor_typography_ugc') ? jsx(CaptionPlaceholderButton
466
- // platform_editor_typography_ugc clean up
467
- // remove typecasting
468
- , {
464
+ }), shouldShowPlaceholder && jsx(CaptionPlaceholderButton, {
469
465
  ref: captionPlaceHolderRef,
470
466
  onClick: clickPlaceholder,
471
467
  placeholderMessage: mediaOptions.allowImagePreview ? captionMessages.placeholderWithDoubleClickPrompt : captionMessages.placeholder
472
- }) : jsx(CaptionPlaceholder, {
473
- ref: captionPlaceHolderRef,
474
- onClick: clickPlaceholder,
475
- placeholderMessage: mediaOptions.allowImagePreview ? captionMessages.placeholderWithDoubleClickPrompt : captionMessages.placeholder
476
- })));
468
+ }));
477
469
  if (widthType !== 'pixel') {
478
470
  return jsx(Fragment, null, canResize ? mediaOptions.allowPixelResizing ? jsx(ResizableMediaSingleNext, {
479
471
  view: view,
@@ -25,15 +25,27 @@ const AI_GENERATING_DECORATION_TYPE = 'ai-generating';
25
25
 
26
26
  /**
27
27
  * Build a DecorationSet containing a Decoration.node for every media node
28
- * whose `id` is in the given set.
28
+ * targeted by the given set.
29
+ *
30
+ * Targets are matched by `localId` first (the mediaSingle wrapper's or the media
31
+ * node's own) so that duplicate copies of the same image — which share a media
32
+ * file `id` — don't all get decorated; only the node the user acted on lights
33
+ * up. Falls back to the media file `id` for the CWR flow and for any node that
34
+ * has no localId yet.
29
35
  */
30
- function buildDecorationSet(doc, mediaIds) {
31
- if (mediaIds.size === 0) {
36
+ function buildDecorationSet(doc, targetIds) {
37
+ if (targetIds.size === 0) {
32
38
  return DecorationSet.empty;
33
39
  }
34
40
  const decorations = [];
35
- doc.descendants((node, pos) => {
36
- if (node.type.name === 'media' && mediaIds.has(node.attrs.id)) {
41
+ doc.descendants((node, pos, parent) => {
42
+ var _parent$attrs;
43
+ if (node.type.name !== 'media') {
44
+ return;
45
+ }
46
+ const wrapperLocalId = parent === null || parent === void 0 ? void 0 : (_parent$attrs = parent.attrs) === null || _parent$attrs === void 0 ? void 0 : _parent$attrs.localId;
47
+ const matches = wrapperLocalId && targetIds.has(wrapperLocalId) || node.attrs.localId && targetIds.has(node.attrs.localId) || targetIds.has(node.attrs.id);
48
+ if (matches) {
37
49
  decorations.push(Decoration.node(pos, pos + node.nodeSize, {},
38
50
  // no DOM attrs needed — the NodeView reads the decoration spec
39
51
  {
@@ -1,7 +1,4 @@
1
1
  /* eslint-disable @atlaskit/design-system/use-primitives-text */
2
- // This had to be disabled to add an id and styles to a component that could not be replaced with Text
3
- // This was added in a experiment cleanup and should be removed if possible
4
- // Be sure to use primitives in this file as needed
5
2
  /**
6
3
  * @jsxRuntime classic
7
4
  * @jsx jsx
@@ -15,14 +12,6 @@ import { captionMessages as messages } from '@atlaskit/editor-common/media';
15
12
  import { CAPTION_PLACEHOLDER_ID } from '@atlaskit/editor-common/media-single';
16
13
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
17
14
  import { Pressable, xcss } from '@atlaskit/primitives';
18
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
19
- const placeholder = css`
20
- color: ${"var(--ds-text-subtlest, #6B6E76)"};
21
- width: 100%;
22
- text-align: center;
23
- margin-top: ${"var(--ds-space-100, 8px)"} !important;
24
- display: block;
25
- `;
26
15
  const placeholderText = css({
27
16
  color: "var(--ds-text-subtlest, #6B6E76)"
28
17
  });
@@ -30,38 +19,6 @@ const placeholderButton = xcss({
30
19
  width: '100%',
31
20
  marginTop: 'space.100'
32
21
  });
33
- // platform_editor_typography_ugc clean up
34
- // Remove this component
35
- export const CaptionPlaceholder = /*#__PURE__*/React.forwardRef(({
36
- onClick,
37
- placeholderMessage
38
- }, ref) => {
39
- const handlePointerDown = useCallback(e => {
40
- e.preventDefault();
41
- onClick();
42
- }, [onClick]);
43
- const computedPlaceholderMessage = placeholderMessage ? placeholderMessage : messages.placeholder;
44
-
45
- // This issue is a temporary fix for users being able to edit captions on edge browsers. This will be removed
46
- // replaced with CaptionPlaceholderButton in the near future and this code can be removed.
47
- return (
48
- // eslint-disable-next-line @atlaskit/design-system/use-primitives-text
49
- jsx("span", {
50
- ref: ref,
51
- css: placeholder,
52
- onPointerDown: handlePointerDown
53
- // This id is just used for setting styles at the moment, if it's needed for anything more specific
54
- // It may need to be generated to avoid overlap
55
- ,
56
- id: CAPTION_PLACEHOLDER_ID,
57
- "data-id": CAPTION_PLACEHOLDER_ID,
58
- "data-testid": "caption-placeholder"
59
- }, jsx(FormattedMessage
60
- // Ignored via go/ees005
61
- // eslint-disable-next-line react/jsx-props-no-spreading
62
- , computedPlaceholderMessage))
63
- );
64
- });
65
22
  export const CaptionPlaceholderButton = /*#__PURE__*/React.forwardRef(({
66
23
  onClick,
67
24
  placeholderMessage
@@ -22,10 +22,9 @@ import { MediaSingle } from '@atlaskit/editor-common/ui';
22
22
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
23
23
  import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
24
24
  import { getAttrsFromUrl } from '@atlaskit/media-client';
25
- import { fg } from '@atlaskit/platform-feature-flags';
26
25
  import { insertAndSelectCaptionFromMediaSinglePos } from '../pm-plugins/commands/captions';
27
26
  import { isMediaBlobUrlFromAttrs } from '../pm-plugins/utils/media-common';
28
- import { CaptionPlaceholder, CaptionPlaceholderButton } from '../ui/CaptionPlaceholder';
27
+ import { CaptionPlaceholderButton } from '../ui/CaptionPlaceholder';
29
28
  import { CommentBadgeWrapper } from '../ui/CommentBadge';
30
29
  import ResizableMediaSingle from '../ui/ResizableMediaSingle';
31
30
  import ResizableMediaSingleNext from '../ui/ResizableMediaSingle/ResizableMediaSingleNext';
@@ -497,18 +496,11 @@ export var MediaSingleNodeNext = function MediaSingleNodeNext(mediaSingleNodeNex
497
496
  }));
498
497
  }), jsx(NodeViewContentHole, {
499
498
  ref: forwardRef
500
- }), shouldShowPlaceholder && (fg('platform_editor_typography_ugc') ? jsx(CaptionPlaceholderButton
501
- // platform_editor_typography_ugc clean up
502
- // remove typecasting
503
- , {
499
+ }), shouldShowPlaceholder && jsx(CaptionPlaceholderButton, {
504
500
  ref: captionPlaceHolderRef,
505
501
  onClick: clickPlaceholder,
506
502
  placeholderMessage: mediaOptions.allowImagePreview ? captionMessages.placeholderWithDoubleClickPrompt : captionMessages.placeholder
507
- }) : jsx(CaptionPlaceholder, {
508
- ref: captionPlaceHolderRef,
509
- onClick: clickPlaceholder,
510
- placeholderMessage: mediaOptions.allowImagePreview ? captionMessages.placeholderWithDoubleClickPrompt : captionMessages.placeholder
511
- })));
503
+ }));
512
504
  if (widthType !== 'pixel') {
513
505
  return jsx(Fragment, null, canResize ? mediaOptions.allowPixelResizing ? jsx(ResizableMediaSingleNext, {
514
506
  view: view,
@@ -29,15 +29,27 @@ var AI_GENERATING_DECORATION_TYPE = 'ai-generating';
29
29
 
30
30
  /**
31
31
  * Build a DecorationSet containing a Decoration.node for every media node
32
- * whose `id` is in the given set.
32
+ * targeted by the given set.
33
+ *
34
+ * Targets are matched by `localId` first (the mediaSingle wrapper's or the media
35
+ * node's own) so that duplicate copies of the same image — which share a media
36
+ * file `id` — don't all get decorated; only the node the user acted on lights
37
+ * up. Falls back to the media file `id` for the CWR flow and for any node that
38
+ * has no localId yet.
33
39
  */
34
- function buildDecorationSet(doc, mediaIds) {
35
- if (mediaIds.size === 0) {
40
+ function buildDecorationSet(doc, targetIds) {
41
+ if (targetIds.size === 0) {
36
42
  return DecorationSet.empty;
37
43
  }
38
44
  var decorations = [];
39
- doc.descendants(function (node, pos) {
40
- if (node.type.name === 'media' && mediaIds.has(node.attrs.id)) {
45
+ doc.descendants(function (node, pos, parent) {
46
+ var _parent$attrs;
47
+ if (node.type.name !== 'media') {
48
+ return;
49
+ }
50
+ var wrapperLocalId = parent === null || parent === void 0 || (_parent$attrs = parent.attrs) === null || _parent$attrs === void 0 ? void 0 : _parent$attrs.localId;
51
+ var matches = wrapperLocalId && targetIds.has(wrapperLocalId) || node.attrs.localId && targetIds.has(node.attrs.localId) || targetIds.has(node.attrs.id);
52
+ if (matches) {
41
53
  decorations.push(Decoration.node(pos, pos + node.nodeSize, {},
42
54
  // no DOM attrs needed — the NodeView reads the decoration spec
43
55
  {
@@ -1,9 +1,4 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject;
3
1
  /* eslint-disable @atlaskit/design-system/use-primitives-text */
4
- // This had to be disabled to add an id and styles to a component that could not be replaced with Text
5
- // This was added in a experiment cleanup and should be removed if possible
6
- // Be sure to use primitives in this file as needed
7
2
  /**
8
3
  * @jsxRuntime classic
9
4
  * @jsx jsx
@@ -17,8 +12,6 @@ import { captionMessages as messages } from '@atlaskit/editor-common/media';
17
12
  import { CAPTION_PLACEHOLDER_ID } from '@atlaskit/editor-common/media-single';
18
13
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
19
14
  import { Pressable, xcss } from '@atlaskit/primitives';
20
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
21
- var placeholder = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tcolor: ", ";\n\twidth: 100%;\n\ttext-align: center;\n\tmargin-top: ", " !important;\n\tdisplay: block;\n"])), "var(--ds-text-subtlest, #6B6E76)", "var(--ds-space-100, 8px)");
22
15
  var placeholderText = css({
23
16
  color: "var(--ds-text-subtlest, #6B6E76)"
24
17
  });
@@ -26,40 +19,9 @@ var placeholderButton = xcss({
26
19
  width: '100%',
27
20
  marginTop: 'space.100'
28
21
  });
29
- // platform_editor_typography_ugc clean up
30
- // Remove this component
31
- export var CaptionPlaceholder = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
22
+ export var CaptionPlaceholderButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
32
23
  var onClick = _ref.onClick,
33
24
  placeholderMessage = _ref.placeholderMessage;
34
- var handlePointerDown = useCallback(function (e) {
35
- e.preventDefault();
36
- onClick();
37
- }, [onClick]);
38
- var computedPlaceholderMessage = placeholderMessage ? placeholderMessage : messages.placeholder;
39
-
40
- // This issue is a temporary fix for users being able to edit captions on edge browsers. This will be removed
41
- // replaced with CaptionPlaceholderButton in the near future and this code can be removed.
42
- return (
43
- // eslint-disable-next-line @atlaskit/design-system/use-primitives-text
44
- jsx("span", {
45
- ref: ref,
46
- css: placeholder,
47
- onPointerDown: handlePointerDown
48
- // This id is just used for setting styles at the moment, if it's needed for anything more specific
49
- // It may need to be generated to avoid overlap
50
- ,
51
- id: CAPTION_PLACEHOLDER_ID,
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
- , computedPlaceholderMessage))
58
- );
59
- });
60
- export var CaptionPlaceholderButton = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
61
- var onClick = _ref2.onClick,
62
- placeholderMessage = _ref2.placeholderMessage;
63
25
  var handleMouseDown = useCallback(function (e) {
64
26
  // In firefox, button is focused when mouse down, which make editor lose focus
65
27
  // Hence we want to disabled it so that user can type in caption directly after click
@@ -11,6 +11,5 @@ type CaptionPlaceholderProps = {
11
11
  id: string;
12
12
  };
13
13
  };
14
- export declare const CaptionPlaceholder: React.ForwardRefExoticComponent<CaptionPlaceholderProps & React.RefAttributes<HTMLSpanElement>>;
15
14
  export declare const CaptionPlaceholderButton: React.ForwardRefExoticComponent<CaptionPlaceholderProps & React.RefAttributes<HTMLButtonElement>>;
16
15
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "14.2.18",
3
+ "version": "14.3.1",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/form": "^16.1.0",
47
47
  "@atlaskit/icon": "^36.2.0",
48
48
  "@atlaskit/icon-lab": "^7.3.0",
49
- "@atlaskit/media-card": "^81.3.0",
49
+ "@atlaskit/media-card": "^81.4.0",
50
50
  "@atlaskit/media-client": "^37.2.0",
51
51
  "@atlaskit/media-client-react": "^6.1.0",
52
52
  "@atlaskit/media-common": "^14.3.0",
@@ -57,7 +57,7 @@
57
57
  "@atlaskit/platform-feature-flags": "^2.0.0",
58
58
  "@atlaskit/primitives": "^20.5.0",
59
59
  "@atlaskit/textfield": "^9.1.0",
60
- "@atlaskit/tmp-editor-statsig": "^124.0.0",
60
+ "@atlaskit/tmp-editor-statsig": "^124.1.0",
61
61
  "@atlaskit/tokens": "^15.5.0",
62
62
  "@atlaskit/tooltip": "^23.1.0",
63
63
  "@babel/runtime": "^7.0.0",
@@ -69,7 +69,7 @@
69
69
  "uuid": "^3.1.0"
70
70
  },
71
71
  "peerDependencies": {
72
- "@atlaskit/editor-common": "^116.24.0",
72
+ "@atlaskit/editor-common": "^116.25.0",
73
73
  "@atlaskit/media-core": "^38.0.0",
74
74
  "react": "^18.2.0",
75
75
  "react-dom": "^18.2.0",
@@ -118,9 +118,6 @@
118
118
  "platform_media_cross_client_copy_with_auth": {
119
119
  "type": "boolean"
120
120
  },
121
- "platform_editor_typography_ugc": {
122
- "type": "boolean"
123
- },
124
121
  "platform_editor_introduce_insert_media_command": {
125
122
  "type": "boolean"
126
123
  },