@atlaskit/editor-common 107.7.6 → 107.8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 107.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#185643](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/185643)
8
+ [`5954e6c1fbac5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5954e6c1fbac5) -
9
+ [ux] [ED-28432] Add orange highlight color and reorder color swatches
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 107.7.7
16
+
17
+ ### Patch Changes
18
+
19
+ - [#184257](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/184257)
20
+ [`eec473181c818`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/eec473181c818) -
21
+ Cleanup platform_editor_react18_mention_with_provider_jira fg
22
+ - Updated dependencies
23
+
3
24
  ## 107.7.6
4
25
 
5
26
  ### Patch Changes
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
16
16
  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
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 = "107.7.5";
19
+ var packageVersion = "107.7.7";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // Ignored via go/ees007
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "107.7.5";
26
+ var packageVersion = "107.7.7";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -13,7 +13,6 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
13
13
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
  var _react = _interopRequireWildcard(require("react"));
16
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
16
  var _providerFactory = require("../../provider-factory");
18
17
  var _mentionWithProviders = require("./mention-with-providers");
19
18
  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); }
@@ -33,18 +32,7 @@ var Mention = exports.default = /*#__PURE__*/function (_PureComponent) {
33
32
  localId = _this$props.localId;
34
33
  var mentionProvider = providers.mentionProvider,
35
34
  profilecardProvider = providers.profilecardProvider;
36
- if ((0, _platformFeatureFlags.fg)('platform_editor_react18_mention_with_provider_fix') || (0, _platformFeatureFlags.fg)('platform_editor_react18_mention_with_provider_jira')) {
37
- return /*#__PURE__*/_react.default.createElement(_mentionWithProviders.MentionWithProviders, {
38
- id: id,
39
- text: text,
40
- accessLevel: accessLevel,
41
- localId: localId,
42
- eventHandlers: eventHandlers,
43
- mentionProvider: mentionProvider,
44
- profilecardProvider: profilecardProvider
45
- });
46
- }
47
- return /*#__PURE__*/_react.default.createElement(_mentionWithProviders.MentionWithProvidersOld, {
35
+ return /*#__PURE__*/_react.default.createElement(_mentionWithProviders.MentionWithProviders, {
48
36
  id: id,
49
37
  text: text,
50
38
  accessLevel: accessLevel,
@@ -5,24 +5,14 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.MentionWithProvidersOld = exports.MentionWithProviders = void 0;
9
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
8
+ exports.MentionWithProviders = void 0;
16
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
17
10
  var _react = _interopRequireWildcard(require("react"));
18
11
  var _element = require("@atlaskit/mention/element");
19
12
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
13
  var _mentionWithProfilecard = _interopRequireDefault(require("./mention-with-profilecard"));
21
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); }
22
- function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
23
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
24
15
  var GENERIC_USER_IDS = ['HipChat', 'all', 'here'];
25
- var noop = function noop() {};
26
16
  var MentionWithProviders = exports.MentionWithProviders = /*#__PURE__*/_react.default.memo(function (_ref) {
27
17
  var accessLevel = _ref.accessLevel,
28
18
  eventHandlers = _ref.eventHandlers,
@@ -74,97 +64,4 @@ var MentionWithProviders = exports.MentionWithProviders = /*#__PURE__*/_react.de
74
64
  onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave,
75
65
  ssrPlaceholderId: ssrPlaceholderId
76
66
  });
77
- });
78
-
79
- // eslint-disable-next-line @repo/internal/react/no-class-components
80
- var MentionWithProvidersOld = exports.MentionWithProvidersOld = /*#__PURE__*/function (_PureComponent) {
81
- function MentionWithProvidersOld() {
82
- var _this;
83
- (0, _classCallCheck2.default)(this, MentionWithProvidersOld);
84
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
85
- args[_key] = arguments[_key];
86
- }
87
- _this = _callSuper(this, MentionWithProvidersOld, [].concat(args));
88
- (0, _defineProperty2.default)(_this, "state", {
89
- profilecardProvider: null
90
- });
91
- return _this;
92
- }
93
- (0, _inherits2.default)(MentionWithProvidersOld, _PureComponent);
94
- return (0, _createClass2.default)(MentionWithProvidersOld, [{
95
- key: "UNSAFE_componentWillMount",
96
- value:
97
- // Ignored via go/ees005
98
- // eslint-disable-next-line react/no-unsafe
99
- function UNSAFE_componentWillMount() {
100
- this.updateProfilecardProvider(this.props);
101
- }
102
-
103
- // Ignored via go/ees005
104
- // eslint-disable-next-line react/no-unsafe
105
- }, {
106
- key: "UNSAFE_componentWillReceiveProps",
107
- value: function UNSAFE_componentWillReceiveProps(nextProps) {
108
- if (nextProps.profilecardProvider !== this.props.profilecardProvider) {
109
- this.updateProfilecardProvider(nextProps);
110
- }
111
- }
112
- }, {
113
- key: "updateProfilecardProvider",
114
- value: function updateProfilecardProvider(props) {
115
- var _this2 = this;
116
- // We are not using async/await here to avoid having an intermediate Promise
117
- // introduced by the transpiler.
118
- // This will allow consumer to use a SynchronousPromise.resolve and avoid useless
119
- // rerendering
120
- if (props.profilecardProvider) {
121
- props.profilecardProvider.then(function (profilecardProvider) {
122
- _this2.setState({
123
- profilecardProvider: profilecardProvider
124
- });
125
- }).catch(function () {
126
- _this2.setState({
127
- profilecardProvider: null
128
- });
129
- });
130
- } else {
131
- this.setState({
132
- profilecardProvider: null
133
- });
134
- }
135
- }
136
- }, {
137
- key: "render",
138
- value: function render() {
139
- var _this$props = this.props,
140
- accessLevel = _this$props.accessLevel,
141
- eventHandlers = _this$props.eventHandlers,
142
- id = _this$props.id,
143
- mentionProvider = _this$props.mentionProvider,
144
- text = _this$props.text,
145
- localId = _this$props.localId;
146
- var profilecardProvider = this.state.profilecardProvider;
147
-
148
- // Ignored via go/ees005
149
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
150
- var actionHandlers = {};
151
- ['onClick', 'onMouseEnter', 'onMouseLeave'].forEach(function (handler) {
152
- actionHandlers[handler] = eventHandlers && eventHandlers[handler] || noop;
153
- });
154
- var MentionComponent = profilecardProvider && GENERIC_USER_IDS.indexOf(id) === -1 ? _mentionWithProfilecard.default : _element.ResourcedMention;
155
- return /*#__PURE__*/_react.default.createElement(MentionComponent, (0, _extends2.default)({
156
- id: id,
157
- text: text,
158
- accessLevel: accessLevel,
159
- localId: localId,
160
- mentionProvider: mentionProvider
161
- // Ignored via go/ees005
162
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
163
- ,
164
- profilecardProvider: profilecardProvider
165
- // Ignored via go/ees005
166
- // eslint-disable-next-line react/jsx-props-no-spreading
167
- }, actionHandlers));
168
- }
169
- }]);
170
- }(_react.PureComponent);
67
+ });
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.highlightColorPalette = exports.REMOVE_HIGHLIGHT_COLOR = exports.EditorDiagonalLineIcon = void 0;
7
+ exports.highlightColorPaletteNext = exports.highlightColorPalette = exports.REMOVE_HIGHLIGHT_COLOR = exports.EditorDiagonalLineIcon = void 0;
8
8
  var _react = require("@emotion/react");
9
9
  var _adfSchema = require("@atlaskit/adf-schema");
10
10
  var _icon = _interopRequireDefault(require("@atlaskit/icon"));
@@ -50,6 +50,12 @@ var EditorDiagonalLineIcon = exports.EditorDiagonalLineIcon = function EditorDia
50
50
  primaryColor: primaryColor
51
51
  });
52
52
  };
53
+
54
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
55
+ /**
56
+ * @deprecated Use `highlightColorPaletteNext` instead, which supports both orange and yellow highlight color
57
+ * This will be removed when platform_editor_add_orange_highlight_color is cleaned up
58
+ */
53
59
  var highlightColorPalette = exports.highlightColorPalette = [{
54
60
  value: REMOVE_HIGHLIGHT_COLOR,
55
61
  label: 'No color',
@@ -60,4 +66,15 @@ var highlightColorPalette = exports.highlightColorPalette = [{
60
66
  }];
61
67
  _adfSchema.backgroundColorPalette.forEach(function (label, color) {
62
68
  highlightColorPalette.push((0, _textColorPalette.mapPaletteColor)(label, color));
69
+ });
70
+ var highlightColorPaletteNext = exports.highlightColorPaletteNext = [{
71
+ value: REMOVE_HIGHLIGHT_COLOR,
72
+ label: 'No color',
73
+ // Mostly informative, only used for analytics
74
+ border: "var(--ds-border, #091E4224)",
75
+ message: (0, _getColorMessage.default)(_paletteMessages.default, 'no-color'),
76
+ decorator: (0, _react.jsx)(EditorDiagonalLineIcon, null)
77
+ }];
78
+ _adfSchema.backgroundColorPaletteNext.forEach(function (label, color) {
79
+ highlightColorPaletteNext.push((0, _textColorPalette.mapPaletteColor)(label, color));
63
80
  });
@@ -94,6 +94,12 @@ Object.defineProperty(exports, "highlightColorPalette", {
94
94
  return _highlightColorPalette.highlightColorPalette;
95
95
  }
96
96
  });
97
+ Object.defineProperty(exports, "highlightColorPaletteNext", {
98
+ enumerable: true,
99
+ get: function get() {
100
+ return _highlightColorPalette.highlightColorPaletteNext;
101
+ }
102
+ });
97
103
  Object.defineProperty(exports, "panelBackgroundPalette", {
98
104
  enumerable: true,
99
105
  get: function get() {
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "107.7.5";
4
+ const packageVersion = "107.7.7";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "107.7.5";
16
+ const packageVersion = "107.7.7";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -1,9 +1,8 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  /* eslint-disable @repo/internal/react/no-class-components */
3
3
  import React, { PureComponent } from 'react';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { ProviderFactory, WithProviders } from '../../provider-factory';
6
- import { MentionWithProviders, MentionWithProvidersOld } from './mention-with-providers';
5
+ import { MentionWithProviders } from './mention-with-providers';
7
6
  export default class Mention extends PureComponent {
8
7
  constructor(props) {
9
8
  super(props);
@@ -19,18 +18,7 @@ export default class Mention extends PureComponent {
19
18
  mentionProvider,
20
19
  profilecardProvider
21
20
  } = providers;
22
- if (fg('platform_editor_react18_mention_with_provider_fix') || fg('platform_editor_react18_mention_with_provider_jira')) {
23
- return /*#__PURE__*/React.createElement(MentionWithProviders, {
24
- id: id,
25
- text: text,
26
- accessLevel: accessLevel,
27
- localId: localId,
28
- eventHandlers: eventHandlers,
29
- mentionProvider: mentionProvider,
30
- profilecardProvider: profilecardProvider
31
- });
32
- }
33
- return /*#__PURE__*/React.createElement(MentionWithProvidersOld, {
21
+ return /*#__PURE__*/React.createElement(MentionWithProviders, {
34
22
  id: id,
35
23
  text: text,
36
24
  accessLevel: accessLevel,
@@ -1,11 +1,8 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import React, { PureComponent, useLayoutEffect, useRef, useState } from 'react';
1
+ import React, { useLayoutEffect, useRef, useState } from 'react';
4
2
  import { ResourcedMention } from '@atlaskit/mention/element';
5
3
  import { fg } from '@atlaskit/platform-feature-flags';
6
4
  import ResourcedMentionWithProfilecard from './mention-with-profilecard';
7
5
  const GENERIC_USER_IDS = ['HipChat', 'all', 'here'];
8
- const noop = () => {};
9
6
  export const MentionWithProviders = /*#__PURE__*/React.memo(({
10
7
  accessLevel,
11
8
  eventHandlers,
@@ -55,82 +52,4 @@ export const MentionWithProviders = /*#__PURE__*/React.memo(({
55
52
  onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave,
56
53
  ssrPlaceholderId: ssrPlaceholderId
57
54
  });
58
- });
59
-
60
- // eslint-disable-next-line @repo/internal/react/no-class-components
61
- export class MentionWithProvidersOld extends PureComponent {
62
- constructor(...args) {
63
- super(...args);
64
- _defineProperty(this, "state", {
65
- profilecardProvider: null
66
- });
67
- }
68
- // Ignored via go/ees005
69
- // eslint-disable-next-line react/no-unsafe
70
- UNSAFE_componentWillMount() {
71
- this.updateProfilecardProvider(this.props);
72
- }
73
-
74
- // Ignored via go/ees005
75
- // eslint-disable-next-line react/no-unsafe
76
- UNSAFE_componentWillReceiveProps(nextProps) {
77
- if (nextProps.profilecardProvider !== this.props.profilecardProvider) {
78
- this.updateProfilecardProvider(nextProps);
79
- }
80
- }
81
- updateProfilecardProvider(props) {
82
- // We are not using async/await here to avoid having an intermediate Promise
83
- // introduced by the transpiler.
84
- // This will allow consumer to use a SynchronousPromise.resolve and avoid useless
85
- // rerendering
86
- if (props.profilecardProvider) {
87
- props.profilecardProvider.then(profilecardProvider => {
88
- this.setState({
89
- profilecardProvider
90
- });
91
- }).catch(() => {
92
- this.setState({
93
- profilecardProvider: null
94
- });
95
- });
96
- } else {
97
- this.setState({
98
- profilecardProvider: null
99
- });
100
- }
101
- }
102
- render() {
103
- const {
104
- accessLevel,
105
- eventHandlers,
106
- id,
107
- mentionProvider,
108
- text,
109
- localId
110
- } = this.props;
111
- const {
112
- profilecardProvider
113
- } = this.state;
114
-
115
- // Ignored via go/ees005
116
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
117
- const actionHandlers = {};
118
- ['onClick', 'onMouseEnter', 'onMouseLeave'].forEach(handler => {
119
- actionHandlers[handler] = eventHandlers && eventHandlers[handler] || noop;
120
- });
121
- const MentionComponent = profilecardProvider && GENERIC_USER_IDS.indexOf(id) === -1 ? ResourcedMentionWithProfilecard : ResourcedMention;
122
- return /*#__PURE__*/React.createElement(MentionComponent, _extends({
123
- id: id,
124
- text: text,
125
- accessLevel: accessLevel,
126
- localId: localId,
127
- mentionProvider: mentionProvider
128
- // Ignored via go/ees005
129
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
130
- ,
131
- profilecardProvider: profilecardProvider
132
- // Ignored via go/ees005
133
- // eslint-disable-next-line react/jsx-props-no-spreading
134
- }, actionHandlers));
135
- }
136
- }
55
+ });
@@ -5,7 +5,7 @@
5
5
 
6
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
7
  import { jsx } from '@emotion/react';
8
- import { backgroundColorPalette } from '@atlaskit/adf-schema';
8
+ import { backgroundColorPalette, backgroundColorPaletteNext } from '@atlaskit/adf-schema';
9
9
  import Icon from '@atlaskit/icon';
10
10
  import { useThemeObserver } from '@atlaskit/tokens';
11
11
  import getColorMessage from './getColorMessage';
@@ -41,6 +41,12 @@ export const EditorDiagonalLineIcon = () => {
41
41
  primaryColor: primaryColor
42
42
  });
43
43
  };
44
+
45
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
46
+ /**
47
+ * @deprecated Use `highlightColorPaletteNext` instead, which supports both orange and yellow highlight color
48
+ * This will be removed when platform_editor_add_orange_highlight_color is cleaned up
49
+ */
44
50
  export const highlightColorPalette = [{
45
51
  value: REMOVE_HIGHLIGHT_COLOR,
46
52
  label: 'No color',
@@ -51,4 +57,15 @@ export const highlightColorPalette = [{
51
57
  }];
52
58
  backgroundColorPalette.forEach((label, color) => {
53
59
  highlightColorPalette.push(mapPaletteColor(label, color));
60
+ });
61
+ export const highlightColorPaletteNext = [{
62
+ value: REMOVE_HIGHLIGHT_COLOR,
63
+ label: 'No color',
64
+ // Mostly informative, only used for analytics
65
+ border: "var(--ds-border, #091E4224)",
66
+ message: getColorMessage(paletteMessages, 'no-color'),
67
+ decorator: jsx(EditorDiagonalLineIcon, null)
68
+ }];
69
+ backgroundColorPaletteNext.forEach((label, color) => {
70
+ highlightColorPaletteNext.push(mapPaletteColor(label, color));
54
71
  });
@@ -8,7 +8,7 @@ export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/c
8
8
  export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
9
9
  export { panelBackgroundPalette, panelDarkModeBackgroundPalette } from './ColorPalette/Palettes/panelBackgroundPalette';
10
10
  export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
11
- export { highlightColorPalette, REMOVE_HIGHLIGHT_COLOR } from './ColorPalette/Palettes/highlightColorPalette';
11
+ export { highlightColorPalette, highlightColorPaletteNext, REMOVE_HIGHLIGHT_COLOR } from './ColorPalette/Palettes/highlightColorPalette';
12
12
  export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages } from './ColorPalette/Palettes/paletteMessagesTokenModeNames';
13
13
  export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
14
14
  export { default as borderColorPalette } from './ColorPalette/Palettes/borderColorPalette';
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "107.7.5";
10
+ var packageVersion = "107.7.7";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "107.7.5";
23
+ var packageVersion = "107.7.7";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -8,9 +8,8 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
8
8
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
9
  /* eslint-disable @repo/internal/react/no-class-components */
10
10
  import React, { PureComponent } from 'react';
11
- import { fg } from '@atlaskit/platform-feature-flags';
12
11
  import { ProviderFactory, WithProviders } from '../../provider-factory';
13
- import { MentionWithProviders, MentionWithProvidersOld } from './mention-with-providers';
12
+ import { MentionWithProviders } from './mention-with-providers';
14
13
  var Mention = /*#__PURE__*/function (_PureComponent) {
15
14
  function Mention(props) {
16
15
  var _this;
@@ -25,18 +24,7 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
25
24
  localId = _this$props.localId;
26
25
  var mentionProvider = providers.mentionProvider,
27
26
  profilecardProvider = providers.profilecardProvider;
28
- if (fg('platform_editor_react18_mention_with_provider_fix') || fg('platform_editor_react18_mention_with_provider_jira')) {
29
- return /*#__PURE__*/React.createElement(MentionWithProviders, {
30
- id: id,
31
- text: text,
32
- accessLevel: accessLevel,
33
- localId: localId,
34
- eventHandlers: eventHandlers,
35
- mentionProvider: mentionProvider,
36
- profilecardProvider: profilecardProvider
37
- });
38
- }
39
- return /*#__PURE__*/React.createElement(MentionWithProvidersOld, {
27
+ return /*#__PURE__*/React.createElement(MentionWithProviders, {
40
28
  id: id,
41
29
  text: text,
42
30
  accessLevel: accessLevel,
@@ -1,19 +1,9 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
- import _inherits from "@babel/runtime/helpers/inherits";
7
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
9
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
- import React, { PureComponent, useLayoutEffect, useRef, useState } from 'react';
2
+ import React, { useLayoutEffect, useRef, useState } from 'react';
12
3
  import { ResourcedMention } from '@atlaskit/mention/element';
13
4
  import { fg } from '@atlaskit/platform-feature-flags';
14
5
  import ResourcedMentionWithProfilecard from './mention-with-profilecard';
15
6
  var GENERIC_USER_IDS = ['HipChat', 'all', 'here'];
16
- var noop = function noop() {};
17
7
  export var MentionWithProviders = /*#__PURE__*/React.memo(function (_ref) {
18
8
  var accessLevel = _ref.accessLevel,
19
9
  eventHandlers = _ref.eventHandlers,
@@ -65,97 +55,4 @@ export var MentionWithProviders = /*#__PURE__*/React.memo(function (_ref) {
65
55
  onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave,
66
56
  ssrPlaceholderId: ssrPlaceholderId
67
57
  });
68
- });
69
-
70
- // eslint-disable-next-line @repo/internal/react/no-class-components
71
- export var MentionWithProvidersOld = /*#__PURE__*/function (_PureComponent) {
72
- function MentionWithProvidersOld() {
73
- var _this;
74
- _classCallCheck(this, MentionWithProvidersOld);
75
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
76
- args[_key] = arguments[_key];
77
- }
78
- _this = _callSuper(this, MentionWithProvidersOld, [].concat(args));
79
- _defineProperty(_this, "state", {
80
- profilecardProvider: null
81
- });
82
- return _this;
83
- }
84
- _inherits(MentionWithProvidersOld, _PureComponent);
85
- return _createClass(MentionWithProvidersOld, [{
86
- key: "UNSAFE_componentWillMount",
87
- value:
88
- // Ignored via go/ees005
89
- // eslint-disable-next-line react/no-unsafe
90
- function UNSAFE_componentWillMount() {
91
- this.updateProfilecardProvider(this.props);
92
- }
93
-
94
- // Ignored via go/ees005
95
- // eslint-disable-next-line react/no-unsafe
96
- }, {
97
- key: "UNSAFE_componentWillReceiveProps",
98
- value: function UNSAFE_componentWillReceiveProps(nextProps) {
99
- if (nextProps.profilecardProvider !== this.props.profilecardProvider) {
100
- this.updateProfilecardProvider(nextProps);
101
- }
102
- }
103
- }, {
104
- key: "updateProfilecardProvider",
105
- value: function updateProfilecardProvider(props) {
106
- var _this2 = this;
107
- // We are not using async/await here to avoid having an intermediate Promise
108
- // introduced by the transpiler.
109
- // This will allow consumer to use a SynchronousPromise.resolve and avoid useless
110
- // rerendering
111
- if (props.profilecardProvider) {
112
- props.profilecardProvider.then(function (profilecardProvider) {
113
- _this2.setState({
114
- profilecardProvider: profilecardProvider
115
- });
116
- }).catch(function () {
117
- _this2.setState({
118
- profilecardProvider: null
119
- });
120
- });
121
- } else {
122
- this.setState({
123
- profilecardProvider: null
124
- });
125
- }
126
- }
127
- }, {
128
- key: "render",
129
- value: function render() {
130
- var _this$props = this.props,
131
- accessLevel = _this$props.accessLevel,
132
- eventHandlers = _this$props.eventHandlers,
133
- id = _this$props.id,
134
- mentionProvider = _this$props.mentionProvider,
135
- text = _this$props.text,
136
- localId = _this$props.localId;
137
- var profilecardProvider = this.state.profilecardProvider;
138
-
139
- // Ignored via go/ees005
140
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
141
- var actionHandlers = {};
142
- ['onClick', 'onMouseEnter', 'onMouseLeave'].forEach(function (handler) {
143
- actionHandlers[handler] = eventHandlers && eventHandlers[handler] || noop;
144
- });
145
- var MentionComponent = profilecardProvider && GENERIC_USER_IDS.indexOf(id) === -1 ? ResourcedMentionWithProfilecard : ResourcedMention;
146
- return /*#__PURE__*/React.createElement(MentionComponent, _extends({
147
- id: id,
148
- text: text,
149
- accessLevel: accessLevel,
150
- localId: localId,
151
- mentionProvider: mentionProvider
152
- // Ignored via go/ees005
153
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
154
- ,
155
- profilecardProvider: profilecardProvider
156
- // Ignored via go/ees005
157
- // eslint-disable-next-line react/jsx-props-no-spreading
158
- }, actionHandlers));
159
- }
160
- }]);
161
- }(PureComponent);
58
+ });
@@ -5,7 +5,7 @@
5
5
 
6
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
7
  import { jsx } from '@emotion/react';
8
- import { backgroundColorPalette } from '@atlaskit/adf-schema';
8
+ import { backgroundColorPalette, backgroundColorPaletteNext } from '@atlaskit/adf-schema';
9
9
  import Icon from '@atlaskit/icon';
10
10
  import { useThemeObserver } from '@atlaskit/tokens';
11
11
  import getColorMessage from './getColorMessage';
@@ -42,6 +42,12 @@ export var EditorDiagonalLineIcon = function EditorDiagonalLineIcon() {
42
42
  primaryColor: primaryColor
43
43
  });
44
44
  };
45
+
46
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
47
+ /**
48
+ * @deprecated Use `highlightColorPaletteNext` instead, which supports both orange and yellow highlight color
49
+ * This will be removed when platform_editor_add_orange_highlight_color is cleaned up
50
+ */
45
51
  export var highlightColorPalette = [{
46
52
  value: REMOVE_HIGHLIGHT_COLOR,
47
53
  label: 'No color',
@@ -52,4 +58,15 @@ export var highlightColorPalette = [{
52
58
  }];
53
59
  backgroundColorPalette.forEach(function (label, color) {
54
60
  highlightColorPalette.push(mapPaletteColor(label, color));
61
+ });
62
+ export var highlightColorPaletteNext = [{
63
+ value: REMOVE_HIGHLIGHT_COLOR,
64
+ label: 'No color',
65
+ // Mostly informative, only used for analytics
66
+ border: "var(--ds-border, #091E4224)",
67
+ message: getColorMessage(paletteMessages, 'no-color'),
68
+ decorator: jsx(EditorDiagonalLineIcon, null)
69
+ }];
70
+ backgroundColorPaletteNext.forEach(function (label, color) {
71
+ highlightColorPaletteNext.push(mapPaletteColor(label, color));
55
72
  });
@@ -8,7 +8,7 @@ export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/c
8
8
  export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
9
9
  export { panelBackgroundPalette, panelDarkModeBackgroundPalette } from './ColorPalette/Palettes/panelBackgroundPalette';
10
10
  export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
11
- export { highlightColorPalette, REMOVE_HIGHLIGHT_COLOR } from './ColorPalette/Palettes/highlightColorPalette';
11
+ export { highlightColorPalette, highlightColorPaletteNext, REMOVE_HIGHLIGHT_COLOR } from './ColorPalette/Palettes/highlightColorPalette';
12
12
  export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages } from './ColorPalette/Palettes/paletteMessagesTokenModeNames';
13
13
  export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
14
14
  export { default as borderColorPalette } from './ColorPalette/Palettes/borderColorPalette';
@@ -1,4 +1,4 @@
1
- import React, { PureComponent } from 'react';
1
+ import React from 'react';
2
2
  import type { MentionProvider } from '@atlaskit/mention/resource';
3
3
  import type { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
4
4
  import type { MentionEventHandlers } from '../EventHandlers';
@@ -15,10 +15,3 @@ export interface State {
15
15
  profilecardProvider: ProfilecardProvider | null;
16
16
  }
17
17
  export declare const MentionWithProviders: React.MemoExoticComponent<({ accessLevel, eventHandlers, id, mentionProvider, profilecardProvider: profilecardProviderResolver, text, localId, }: Props) => React.JSX.Element>;
18
- export declare class MentionWithProvidersOld extends PureComponent<Props, State> {
19
- state: State;
20
- UNSAFE_componentWillMount(): void;
21
- UNSAFE_componentWillReceiveProps(nextProps: Props): void;
22
- private updateProfilecardProvider;
23
- render(): React.JSX.Element;
24
- }
@@ -6,4 +6,9 @@ import { jsx } from '@emotion/react';
6
6
  import type { PaletteColor } from './type';
7
7
  export declare const REMOVE_HIGHLIGHT_COLOR = "#00000000";
8
8
  export declare const EditorDiagonalLineIcon: () => jsx.JSX.Element;
9
+ /**
10
+ * @deprecated Use `highlightColorPaletteNext` instead, which supports both orange and yellow highlight color
11
+ * This will be removed when platform_editor_add_orange_highlight_color is cleaned up
12
+ */
9
13
  export declare const highlightColorPalette: Array<PaletteColor>;
14
+ export declare const highlightColorPaletteNext: Array<PaletteColor>;
@@ -5,7 +5,7 @@ export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/c
5
5
  export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
6
6
  export { panelBackgroundPalette, panelDarkModeBackgroundPalette, } from './ColorPalette/Palettes/panelBackgroundPalette';
7
7
  export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
8
- export { highlightColorPalette, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/highlightColorPalette';
8
+ export { highlightColorPalette, highlightColorPaletteNext, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/highlightColorPalette';
9
9
  export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages, } from './ColorPalette/Palettes/paletteMessagesTokenModeNames';
10
10
  export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
11
11
  export type { PaletteColor, PaletteTooltipMessages } from './ColorPalette/Palettes/type';
@@ -1,4 +1,4 @@
1
- import React, { PureComponent } from 'react';
1
+ import React from 'react';
2
2
  import type { MentionProvider } from '@atlaskit/mention/resource';
3
3
  import type { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
4
4
  import type { MentionEventHandlers } from '../EventHandlers';
@@ -15,10 +15,3 @@ export interface State {
15
15
  profilecardProvider: ProfilecardProvider | null;
16
16
  }
17
17
  export declare const MentionWithProviders: React.MemoExoticComponent<({ accessLevel, eventHandlers, id, mentionProvider, profilecardProvider: profilecardProviderResolver, text, localId, }: Props) => React.JSX.Element>;
18
- export declare class MentionWithProvidersOld extends PureComponent<Props, State> {
19
- state: State;
20
- UNSAFE_componentWillMount(): void;
21
- UNSAFE_componentWillReceiveProps(nextProps: Props): void;
22
- private updateProfilecardProvider;
23
- render(): React.JSX.Element;
24
- }
@@ -6,4 +6,9 @@ import { jsx } from '@emotion/react';
6
6
  import type { PaletteColor } from './type';
7
7
  export declare const REMOVE_HIGHLIGHT_COLOR = "#00000000";
8
8
  export declare const EditorDiagonalLineIcon: () => jsx.JSX.Element;
9
+ /**
10
+ * @deprecated Use `highlightColorPaletteNext` instead, which supports both orange and yellow highlight color
11
+ * This will be removed when platform_editor_add_orange_highlight_color is cleaned up
12
+ */
9
13
  export declare const highlightColorPalette: Array<PaletteColor>;
14
+ export declare const highlightColorPaletteNext: Array<PaletteColor>;
@@ -5,7 +5,7 @@ export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/c
5
5
  export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
6
6
  export { panelBackgroundPalette, panelDarkModeBackgroundPalette, } from './ColorPalette/Palettes/panelBackgroundPalette';
7
7
  export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
8
- export { highlightColorPalette, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/highlightColorPalette';
8
+ export { highlightColorPalette, highlightColorPaletteNext, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/highlightColorPalette';
9
9
  export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages, } from './ColorPalette/Palettes/paletteMessagesTokenModeNames';
10
10
  export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
11
11
  export type { PaletteColor, PaletteTooltipMessages } from './ColorPalette/Palettes/type';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "107.7.6",
3
+ "version": "107.8.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/"
@@ -122,7 +122,7 @@
122
122
  },
123
123
  "dependencies": {
124
124
  "@atlaskit/activity-provider": "^2.5.0",
125
- "@atlaskit/adf-schema": "^49.0.5",
125
+ "@atlaskit/adf-schema": "^49.0.6",
126
126
  "@atlaskit/adf-utils": "^19.20.0",
127
127
  "@atlaskit/analytics-listeners": "^9.0.0",
128
128
  "@atlaskit/analytics-namespaced-context": "^7.0.0",
@@ -146,7 +146,7 @@
146
146
  "@atlaskit/link-datasource": "^4.13.0",
147
147
  "@atlaskit/link-picker": "^3.6.0",
148
148
  "@atlaskit/media-card": "^79.4.0",
149
- "@atlaskit/media-client": "^35.0.0",
149
+ "@atlaskit/media-client": "^35.1.0",
150
150
  "@atlaskit/media-client-react": "^4.1.0",
151
151
  "@atlaskit/media-common": "^12.3.0",
152
152
  "@atlaskit/media-file-preview": "^0.11.0",
@@ -163,14 +163,14 @@
163
163
  "@atlaskit/profilecard": "^23.21.0",
164
164
  "@atlaskit/react-ufo": "^3.14.0",
165
165
  "@atlaskit/section-message": "^8.2.0",
166
- "@atlaskit/smart-card": "^39.4.0",
166
+ "@atlaskit/smart-card": "^40.0.0",
167
167
  "@atlaskit/smart-user-picker": "^8.0.0",
168
168
  "@atlaskit/spinner": "^18.0.0",
169
169
  "@atlaskit/status": "^3.0.0",
170
170
  "@atlaskit/task-decision": "^19.2.0",
171
171
  "@atlaskit/textfield": "^8.0.0",
172
172
  "@atlaskit/theme": "^19.0.0",
173
- "@atlaskit/tmp-editor-statsig": "^9.4.0",
173
+ "@atlaskit/tmp-editor-statsig": "^9.6.0",
174
174
  "@atlaskit/tokens": "^5.5.0",
175
175
  "@atlaskit/tooltip": "^20.3.0",
176
176
  "@atlaskit/width-detector": "^5.0.0",
@@ -260,12 +260,6 @@
260
260
  "editor_inline_comments_paste_insert_nodes": {
261
261
  "type": "boolean"
262
262
  },
263
- "platform_editor_react18_mention_with_provider_fix": {
264
- "type": "boolean"
265
- },
266
- "platform_editor_react18_mention_with_provider_jira": {
267
- "type": "boolean"
268
- },
269
263
  "platform_editor_typography_ugc": {
270
264
  "type": "boolean"
271
265
  },