@atlaskit/editor-common 78.36.4 → 78.37.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.
@@ -25,10 +25,12 @@ var commentBadgeWrapper = (0, _react2.css)({
25
25
  borderRadius: '3px',
26
26
  zIndex: _editorSharedStyles.akEditorUnitZIndex * 10
27
27
  });
28
- var commentBadgeEditorOverrides = (0, _react2.css)({
29
- right: '14px',
30
- zIndex: _constants.layers.card()
31
- });
28
+ var commentBadgeEditorOverrides = function commentBadgeEditorOverrides(commentsOnMediaBugFixEnabled, badgeOffsetRight) {
29
+ return (0, _react2.css)({
30
+ right: commentsOnMediaBugFixEnabled ? badgeOffsetRight : '14px',
31
+ zIndex: _constants.layers.card()
32
+ });
33
+ };
32
34
  var getBadgeSize = function getBadgeSize(width, height) {
33
35
  // width is the original width of image, not resized or currently rendered to user. Defaulting to medium for now
34
36
  return width && width < 70 || height && height < 70 ? 'small' : 'medium';
@@ -43,8 +45,8 @@ var CommentBadge = exports.CommentBadge = function CommentBadge(_ref) {
43
45
  onClick = _ref.onClick,
44
46
  onMouseEnter = _ref.onMouseEnter,
45
47
  onMouseLeave = _ref.onMouseLeave,
46
- _ref$isEditor = _ref.isEditor,
47
- isEditor = _ref$isEditor === void 0 ? false : _ref$isEditor;
48
+ badgeOffsetRight = _ref.badgeOffsetRight,
49
+ commentsOnMediaBugFixEnabled = _ref.commentsOnMediaBugFixEnabled;
48
50
  var _useState = (0, _react.useState)(getBadgeSize(width, height)),
49
51
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
50
52
  badgeSize = _useState2[0],
@@ -78,7 +80,7 @@ var CommentBadge = exports.CommentBadge = function CommentBadge(_ref) {
78
80
  }
79
81
  }, [status]);
80
82
  return (0, _react2.jsx)("div", {
81
- css: isEditor ? [commentBadgeWrapper, commentBadgeEditorOverrides] : commentBadgeWrapper
83
+ css: badgeOffsetRight ? [commentBadgeWrapper, commentBadgeEditorOverrides(commentsOnMediaBugFixEnabled, badgeOffsetRight)] : commentBadgeWrapper
82
84
  // This is needed so that mediaWrapperStyle in editor/editor-common/src/ui/MediaSingle/styled.tsx
83
85
  // can target the correct div
84
86
  ,
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
16
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "78.36.4";
19
+ var packageVersion = "78.37.0";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -20,7 +20,7 @@ var _Layer = _interopRequireDefault(require("../Layer"));
20
20
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
21
21
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "78.36.4";
23
+ var packageVersion = "78.37.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  var DropList = /*#__PURE__*/function (_Component) {
@@ -16,8 +16,8 @@ const commentBadgeWrapper = css({
16
16
  borderRadius: '3px',
17
17
  zIndex: akEditorUnitZIndex * 10
18
18
  });
19
- const commentBadgeEditorOverrides = css({
20
- right: '14px',
19
+ const commentBadgeEditorOverrides = (commentsOnMediaBugFixEnabled, badgeOffsetRight) => css({
20
+ right: commentsOnMediaBugFixEnabled ? badgeOffsetRight : '14px',
21
21
  zIndex: layers.card()
22
22
  });
23
23
  const getBadgeSize = (width, height) => {
@@ -33,7 +33,8 @@ export const CommentBadge = ({
33
33
  onClick,
34
34
  onMouseEnter,
35
35
  onMouseLeave,
36
- isEditor = false
36
+ badgeOffsetRight,
37
+ commentsOnMediaBugFixEnabled
37
38
  }) => {
38
39
  const [badgeSize, setBadgeSize] = useState(getBadgeSize(width, height));
39
40
  const title = intl.formatMessage(messages.viewCommentsOnMedia);
@@ -65,7 +66,7 @@ export const CommentBadge = ({
65
66
  }
66
67
  }, [status]);
67
68
  return jsx("div", {
68
- css: isEditor ? [commentBadgeWrapper, commentBadgeEditorOverrides] : commentBadgeWrapper
69
+ css: badgeOffsetRight ? [commentBadgeWrapper, commentBadgeEditorOverrides(commentsOnMediaBugFixEnabled, badgeOffsetRight)] : commentBadgeWrapper
69
70
  // This is needed so that mediaWrapperStyle in editor/editor-common/src/ui/MediaSingle/styled.tsx
70
71
  // can target the correct div
71
72
  ,
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "78.36.4";
3
+ const packageVersion = "78.37.0";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
7
7
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
8
8
  import Layer from '../Layer';
9
9
  const packageName = "@atlaskit/editor-common";
10
- const packageVersion = "78.36.4";
10
+ const packageVersion = "78.37.0";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {
@@ -17,10 +17,12 @@ var commentBadgeWrapper = css({
17
17
  borderRadius: '3px',
18
18
  zIndex: akEditorUnitZIndex * 10
19
19
  });
20
- var commentBadgeEditorOverrides = css({
21
- right: '14px',
22
- zIndex: layers.card()
23
- });
20
+ var commentBadgeEditorOverrides = function commentBadgeEditorOverrides(commentsOnMediaBugFixEnabled, badgeOffsetRight) {
21
+ return css({
22
+ right: commentsOnMediaBugFixEnabled ? badgeOffsetRight : '14px',
23
+ zIndex: layers.card()
24
+ });
25
+ };
24
26
  var getBadgeSize = function getBadgeSize(width, height) {
25
27
  // width is the original width of image, not resized or currently rendered to user. Defaulting to medium for now
26
28
  return width && width < 70 || height && height < 70 ? 'small' : 'medium';
@@ -35,8 +37,8 @@ export var CommentBadge = function CommentBadge(_ref) {
35
37
  onClick = _ref.onClick,
36
38
  onMouseEnter = _ref.onMouseEnter,
37
39
  onMouseLeave = _ref.onMouseLeave,
38
- _ref$isEditor = _ref.isEditor,
39
- isEditor = _ref$isEditor === void 0 ? false : _ref$isEditor;
40
+ badgeOffsetRight = _ref.badgeOffsetRight,
41
+ commentsOnMediaBugFixEnabled = _ref.commentsOnMediaBugFixEnabled;
40
42
  var _useState = useState(getBadgeSize(width, height)),
41
43
  _useState2 = _slicedToArray(_useState, 2),
42
44
  badgeSize = _useState2[0],
@@ -70,7 +72,7 @@ export var CommentBadge = function CommentBadge(_ref) {
70
72
  }
71
73
  }, [status]);
72
74
  return jsx("div", {
73
- css: isEditor ? [commentBadgeWrapper, commentBadgeEditorOverrides] : commentBadgeWrapper
75
+ css: badgeOffsetRight ? [commentBadgeWrapper, commentBadgeEditorOverrides(commentsOnMediaBugFixEnabled, badgeOffsetRight)] : commentBadgeWrapper
74
76
  // This is needed so that mediaWrapperStyle in editor/editor-common/src/ui/MediaSingle/styled.tsx
75
77
  // can target the correct div
76
78
  ,
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "78.36.4";
9
+ var packageVersion = "78.37.0";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -15,7 +15,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
15
15
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
16
16
  import Layer from '../Layer';
17
17
  var packageName = "@atlaskit/editor-common";
18
- var packageVersion = "78.36.4";
18
+ var packageVersion = "78.37.0";
19
19
  var halfFocusRing = 1;
20
20
  var dropOffset = '0, 8';
21
21
  var DropList = /*#__PURE__*/function (_Component) {
@@ -12,5 +12,7 @@ export type CommentBadgeProps = {
12
12
  onMouseLeave?: (e: React.MouseEvent) => void;
13
13
  isEditor?: boolean;
14
14
  isDrafting?: boolean;
15
+ badgeOffsetRight?: string;
16
+ commentsOnMediaBugFixEnabled?: boolean;
15
17
  };
16
- export declare const CommentBadge: ({ intl, width, height, status, mediaElement, onClick, onMouseEnter, onMouseLeave, isEditor, }: CommentBadgeProps) => jsx.JSX.Element;
18
+ export declare const CommentBadge: ({ intl, width, height, status, mediaElement, onClick, onMouseEnter, onMouseLeave, badgeOffsetRight, commentsOnMediaBugFixEnabled, }: CommentBadgeProps) => jsx.JSX.Element;
@@ -237,6 +237,14 @@ export type FeatureFlags = {
237
237
  * @default false
238
238
  */
239
239
  macroInteractionUpdates?: boolean;
240
+ /**
241
+ * @description
242
+ * Enables bug fix on media comments
243
+ *
244
+ // * @see https://product-fabric.atlassian.net/browse/ED-23093
245
+ * @default false
246
+ */
247
+ commentsOnMediaBugFix?: boolean;
240
248
  };
241
249
  export type FeatureFlagKey = keyof FeatureFlags;
242
250
  export type GetEditorFeatureFlags = () => FeatureFlags;
@@ -96,6 +96,7 @@ export type FloatingToolbarCopyButton = {
96
96
  type: 'copy-button';
97
97
  items: Array<FloatingToolbarSeparator | MarkOptions | NodeOptions>;
98
98
  hidden?: boolean;
99
+ supportsViewMode?: boolean;
99
100
  };
100
101
  export type FloatingToolbarButton<T extends {}> = {
101
102
  id?: string;
@@ -155,6 +156,7 @@ export type FloatingToolbarCustom<T extends {}> = {
155
156
  fallback: Array<FloatingToolbarFallbackItem<T>>;
156
157
  render: (view?: EditorView, idx?: number, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => React.ReactNode;
157
158
  hidden?: boolean;
159
+ supportsViewMode?: boolean;
158
160
  };
159
161
  type FloatingToolbarSelectBase<T extends {}, V = SelectOption> = {
160
162
  id: string;
@@ -190,6 +192,7 @@ export type FloatingToolbarSelect<T extends {}> = FloatingToolbarEmojiPicker<T>
190
192
  export type FloatingToolbarSeparator = {
191
193
  type: 'separator';
192
194
  hidden?: boolean;
195
+ supportsViewMode?: boolean;
193
196
  };
194
197
  export type FloatingToolbarDropdown<T extends {}> = {
195
198
  testId?: string;
@@ -12,5 +12,7 @@ export type CommentBadgeProps = {
12
12
  onMouseLeave?: (e: React.MouseEvent) => void;
13
13
  isEditor?: boolean;
14
14
  isDrafting?: boolean;
15
+ badgeOffsetRight?: string;
16
+ commentsOnMediaBugFixEnabled?: boolean;
15
17
  };
16
- export declare const CommentBadge: ({ intl, width, height, status, mediaElement, onClick, onMouseEnter, onMouseLeave, isEditor, }: CommentBadgeProps) => jsx.JSX.Element;
18
+ export declare const CommentBadge: ({ intl, width, height, status, mediaElement, onClick, onMouseEnter, onMouseLeave, badgeOffsetRight, commentsOnMediaBugFixEnabled, }: CommentBadgeProps) => jsx.JSX.Element;
@@ -237,6 +237,14 @@ export type FeatureFlags = {
237
237
  * @default false
238
238
  */
239
239
  macroInteractionUpdates?: boolean;
240
+ /**
241
+ * @description
242
+ * Enables bug fix on media comments
243
+ *
244
+ // * @see https://product-fabric.atlassian.net/browse/ED-23093
245
+ * @default false
246
+ */
247
+ commentsOnMediaBugFix?: boolean;
240
248
  };
241
249
  export type FeatureFlagKey = keyof FeatureFlags;
242
250
  export type GetEditorFeatureFlags = () => FeatureFlags;
@@ -96,6 +96,7 @@ export type FloatingToolbarCopyButton = {
96
96
  type: 'copy-button';
97
97
  items: Array<FloatingToolbarSeparator | MarkOptions | NodeOptions>;
98
98
  hidden?: boolean;
99
+ supportsViewMode?: boolean;
99
100
  };
100
101
  export type FloatingToolbarButton<T extends {}> = {
101
102
  id?: string;
@@ -155,6 +156,7 @@ export type FloatingToolbarCustom<T extends {}> = {
155
156
  fallback: Array<FloatingToolbarFallbackItem<T>>;
156
157
  render: (view?: EditorView, idx?: number, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => React.ReactNode;
157
158
  hidden?: boolean;
159
+ supportsViewMode?: boolean;
158
160
  };
159
161
  type FloatingToolbarSelectBase<T extends {}, V = SelectOption> = {
160
162
  id: string;
@@ -190,6 +192,7 @@ export type FloatingToolbarSelect<T extends {}> = FloatingToolbarEmojiPicker<T>
190
192
  export type FloatingToolbarSeparator = {
191
193
  type: 'separator';
192
194
  hidden?: boolean;
195
+ supportsViewMode?: boolean;
193
196
  };
194
197
  export type FloatingToolbarDropdown<T extends {}> = {
195
198
  testId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "78.36.4",
3
+ "version": "78.37.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -116,7 +116,7 @@
116
116
  "@atlaskit/icon": "^22.1.0",
117
117
  "@atlaskit/icon-object": "^6.3.0",
118
118
  "@atlaskit/in-product-testing": "^0.2.0",
119
- "@atlaskit/link-datasource": "^1.30.0",
119
+ "@atlaskit/link-datasource": "^1.31.0",
120
120
  "@atlaskit/link-picker": "^1.36.0",
121
121
  "@atlaskit/media-card": "^77.11.0",
122
122
  "@atlaskit/media-client": "^26.3.0",
@@ -131,7 +131,7 @@
131
131
  "@atlaskit/platform-feature-flags": "^0.2.0",
132
132
  "@atlaskit/primitives": "^5.7.0",
133
133
  "@atlaskit/profilecard": "^19.11.0",
134
- "@atlaskit/section-message": "^6.4.0",
134
+ "@atlaskit/section-message": "^6.5.0",
135
135
  "@atlaskit/smart-card": "^26.58.0",
136
136
  "@atlaskit/smart-user-picker": "^6.9.0",
137
137
  "@atlaskit/spinner": "^16.0.0",
@@ -139,7 +139,7 @@
139
139
  "@atlaskit/textfield": "^6.1.0",
140
140
  "@atlaskit/theme": "^12.7.0",
141
141
  "@atlaskit/tokens": "^1.44.0",
142
- "@atlaskit/tooltip": "^18.2.0",
142
+ "@atlaskit/tooltip": "^18.3.0",
143
143
  "@atlaskit/ufo": "^0.2.0",
144
144
  "@atlaskit/width-detector": "^4.1.0",
145
145
  "@babel/runtime": "^7.0.0",