@atlaskit/editor-common 76.18.4 → 76.18.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,19 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 76.18.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#42834](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42834) [`a4695f1205a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a4695f1205a) - Fix TS errors for editor packages in AFM
8
+
9
+ ## 76.18.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [#42746](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42746) [`ea352517252`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ea352517252) - Update editor dropdown menu component to support section behind platform.editor.menu.group-items FF
14
+ - [#42845](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42845) [`9a9260f905f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9a9260f905f) - Move state initialisation for WithPluginState in constructor
15
+ - Updated dependencies
16
+
3
17
  ## 76.18.4
4
18
 
5
19
  ### Patch Changes
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
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 = "76.18.4";
19
+ var packageVersion = "76.18.6";
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
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
24
24
  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); }; }
25
25
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "76.18.4";
27
+ var packageVersion = "76.18.6";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -54,7 +54,6 @@ var ErrorBoundary = exports.ErrorBoundary = /*#__PURE__*/function (_React$Compon
54
54
  attributes: {
55
55
  error: error,
56
56
  errorInfo: errorInfo,
57
- // @ts-expect-error
58
57
  errorRethrown: !this.hasFallback()
59
58
  }
60
59
  });
@@ -22,6 +22,7 @@ var _react = _interopRequireWildcard(require("react"));
22
22
  var _react2 = require("@emotion/react");
23
23
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
24
24
  var _menu = require("@atlaskit/menu");
25
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
25
26
  var _colors = require("@atlaskit/theme/colors");
26
27
  var _components = require("@atlaskit/theme/components");
27
28
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
@@ -137,7 +138,8 @@ var DropdownMenuWrapper = exports.default = /*#__PURE__*/function (_PureComponen
137
138
  zIndex = _this$props.zIndex,
138
139
  shouldUseDefaultRole = _this$props.shouldUseDefaultRole,
139
140
  onItemActivated = _this$props.onItemActivated,
140
- arrowKeyNavigationProviderOptions = _this$props.arrowKeyNavigationProviderOptions;
141
+ arrowKeyNavigationProviderOptions = _this$props.arrowKeyNavigationProviderOptions,
142
+ section = _this$props.section;
141
143
 
142
144
  // Note that this onSelection function can't be refactored to useMemo for
143
145
  // performance gains as it is being used as a dependency in a useEffect in
@@ -192,14 +194,32 @@ var DropdownMenuWrapper = exports.default = /*#__PURE__*/function (_PureComponen
192
194
  }
193
195
  }), (0, _react2.jsx)("div", {
194
196
  ref: this.popupRef
197
+ }, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.menu.group-items') && (0, _react2.jsx)(_menu.MenuGroup, {
198
+ role: shouldUseDefaultRole ? 'group' : 'menu'
195
199
  }, items.map(function (group, index) {
200
+ return (0, _react2.jsx)(_menu.Section, {
201
+ hasSeparator: (section === null || section === void 0 ? void 0 : section.hasSeparator) && index > 0,
202
+ title: section === null || section === void 0 ? void 0 : section.title,
203
+ key: index
204
+ }, group.items.map(function (item) {
205
+ var _item$key;
206
+ return (0, _react2.jsx)(DropdownMenuItem, {
207
+ key: (_item$key = item.key) !== null && _item$key !== void 0 ? _item$key : String(item.content),
208
+ item: item,
209
+ onItemActivated: _this2.props.onItemActivated,
210
+ shouldUseDefaultRole: _this2.props.shouldUseDefaultRole,
211
+ onMouseEnter: _this2.props.onMouseEnter,
212
+ onMouseLeave: _this2.props.onMouseLeave
213
+ });
214
+ }));
215
+ })), !(0, _platformFeatureFlags.getBooleanFF)('platform.editor.menu.group-items') && items.map(function (group, index) {
196
216
  return (0, _react2.jsx)(_menu.MenuGroup, {
197
217
  key: index,
198
218
  role: shouldUseDefaultRole ? 'group' : 'menu'
199
219
  }, group.items.map(function (item) {
200
- var _item$key;
220
+ var _item$key2;
201
221
  return (0, _react2.jsx)(DropdownMenuItem, {
202
- key: (_item$key = item.key) !== null && _item$key !== void 0 ? _item$key : String(item.content),
222
+ key: (_item$key2 = item.key) !== null && _item$key2 !== void 0 ? _item$key2 : String(item.content),
203
223
  item: item,
204
224
  onItemActivated: _this2.props.onItemActivated,
205
225
  shouldUseDefaultRole: _this2.props.shouldUseDefaultRole,
@@ -257,7 +277,7 @@ var DropdownMenuItemCustomComponent = /*#__PURE__*/_react.default.forwardRef(fun
257
277
  }), children);
258
278
  });
259
279
  function DropdownMenuItem(_ref) {
260
- var _item$key2;
280
+ var _item$key3;
261
281
  var item = _ref.item,
262
282
  onItemActivated = _ref.onItemActivated,
263
283
  shouldUseDefaultRole = _ref.shouldUseDefaultRole,
@@ -289,7 +309,7 @@ function DropdownMenuItem(_ref) {
289
309
  onMouseDown: _handleSubmenuActive
290
310
  }, (0, _react2.jsx)(_menu.CustomItem, {
291
311
  item: item,
292
- key: (_item$key2 = item.key) !== null && _item$key2 !== void 0 ? _item$key2 : String(item.content),
312
+ key: (_item$key3 = item.key) !== null && _item$key3 !== void 0 ? _item$key3 : String(item.content),
293
313
  testId: "dropdown-item__".concat(String(item.content)),
294
314
  role: shouldUseDefaultRole ? 'button' : 'menuitem',
295
315
  iconBefore: item.elemBefore,
@@ -319,9 +339,9 @@ function DropdownMenuItem(_ref) {
319
339
  }
320
340
  }, item.content));
321
341
  if (item.tooltipDescription) {
322
- var _item$key3;
342
+ var _item$key4;
323
343
  return (0, _react2.jsx)(_tooltip.default, {
324
- key: (_item$key3 = item.key) !== null && _item$key3 !== void 0 ? _item$key3 : String(item.content),
344
+ key: (_item$key4 = item.key) !== null && _item$key4 !== void 0 ? _item$key4 : String(item.content),
325
345
  content: item.tooltipDescription,
326
346
  position: item.tooltipPosition
327
347
  }, dropListItem);
@@ -67,19 +67,15 @@ var DEFAULT_SLOW_THRESHOLD = 4;
67
67
  var WithPluginState = exports.WithPluginState = /*#__PURE__*/function (_React$Component) {
68
68
  (0, _inherits2.default)(WithPluginState, _React$Component);
69
69
  var _super = _createSuper(WithPluginState);
70
- function WithPluginState() {
70
+ function WithPluginState(props, context) {
71
71
  var _this;
72
72
  (0, _classCallCheck2.default)(this, WithPluginState);
73
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
74
- args[_key] = arguments[_key];
75
- }
76
- _this = _super.call.apply(_super, [this].concat(args));
73
+ _this = _super.call(this, props, context);
77
74
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "listeners", {});
78
75
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "debounce", null);
79
76
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "notAppliedState", {});
80
77
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isSubscribed", false);
81
78
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callsCount", 0);
82
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", _this.getPluginsStates(_this.props.plugins, _this.getEditorView(_this.props, _this.context)));
83
79
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handlePluginStateChange", function (propName, pluginName, performanceOptions, skipEqualityCheck) {
84
80
  return function (pluginState) {
85
81
  // skipEqualityCheck is being used for old plugins since they are mutating plugin state instead of creating a new one
@@ -143,6 +139,7 @@ var WithPluginState = exports.WithPluginState = /*#__PURE__*/function (_React$Co
143
139
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onContextUpdate", function () {
144
140
  _this.subscribe(_this.props);
145
141
  });
142
+ _this.state = _this.getPluginsStates(_this.props.plugins, _this.getEditorView(props, context));
146
143
  return _this;
147
144
  }
148
145
  (0, _createClass2.default)(WithPluginState, [{
@@ -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 = "76.18.4";
3
+ const packageVersion = "76.18.6";
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
@@ -9,7 +9,7 @@ import { themed } from '@atlaskit/theme/components';
9
9
  import { borderRadius } from '@atlaskit/theme/constants';
10
10
  import Layer from '../Layer';
11
11
  const packageName = "@atlaskit/editor-common";
12
- const packageVersion = "76.18.4";
12
+ const packageVersion = "76.18.6";
13
13
  const halfFocusRing = 1;
14
14
  const dropOffset = '0, 8';
15
15
  class DropList extends Component {
@@ -25,7 +25,6 @@ export class ErrorBoundary extends React.Component {
25
25
  attributes: {
26
26
  error,
27
27
  errorInfo,
28
- // @ts-expect-error
29
28
  errorRethrown: !this.hasFallback()
30
29
  }
31
30
  });
@@ -5,7 +5,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
5
  import React, { PureComponent, useContext } from 'react';
6
6
  import { css, jsx } from '@emotion/react';
7
7
  import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
8
- import { CustomItem, MenuGroup } from '@atlaskit/menu';
8
+ import { CustomItem, MenuGroup, Section } from '@atlaskit/menu';
9
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
9
10
  import { B100, DN600, DN80, N70, N900 } from '@atlaskit/theme/colors';
10
11
  import { themed } from '@atlaskit/theme/components';
11
12
  import Tooltip from '@atlaskit/tooltip';
@@ -143,7 +144,8 @@ export default class DropdownMenuWrapper extends PureComponent {
143
144
  zIndex,
144
145
  shouldUseDefaultRole,
145
146
  onItemActivated,
146
- arrowKeyNavigationProviderOptions
147
+ arrowKeyNavigationProviderOptions,
148
+ section
147
149
  } = this.props;
148
150
 
149
151
  // Note that this onSelection function can't be refactored to useMemo for
@@ -200,9 +202,12 @@ export default class DropdownMenuWrapper extends PureComponent {
200
202
  }
201
203
  }), jsx("div", {
202
204
  ref: this.popupRef
203
- }, items.map((group, index) => jsx(MenuGroup, {
204
- key: index,
205
+ }, getBooleanFF('platform.editor.menu.group-items') && jsx(MenuGroup, {
205
206
  role: shouldUseDefaultRole ? 'group' : 'menu'
207
+ }, items.map((group, index) => jsx(Section, {
208
+ hasSeparator: (section === null || section === void 0 ? void 0 : section.hasSeparator) && index > 0,
209
+ title: section === null || section === void 0 ? void 0 : section.title,
210
+ key: index
206
211
  }, group.items.map(item => {
207
212
  var _item$key;
208
213
  return jsx(DropdownMenuItem, {
@@ -213,6 +218,19 @@ export default class DropdownMenuWrapper extends PureComponent {
213
218
  onMouseEnter: this.props.onMouseEnter,
214
219
  onMouseLeave: this.props.onMouseLeave
215
220
  });
221
+ })))), !getBooleanFF('platform.editor.menu.group-items') && items.map((group, index) => jsx(MenuGroup, {
222
+ key: index,
223
+ role: shouldUseDefaultRole ? 'group' : 'menu'
224
+ }, group.items.map(item => {
225
+ var _item$key2;
226
+ return jsx(DropdownMenuItem, {
227
+ key: (_item$key2 = item.key) !== null && _item$key2 !== void 0 ? _item$key2 : String(item.content),
228
+ item: item,
229
+ onItemActivated: this.props.onItemActivated,
230
+ shouldUseDefaultRole: this.props.shouldUseDefaultRole,
231
+ onMouseEnter: this.props.onMouseEnter,
232
+ onMouseLeave: this.props.onMouseLeave
233
+ });
216
234
  })))))));
217
235
  }
218
236
  render() {
@@ -266,7 +284,7 @@ function DropdownMenuItem({
266
284
  onMouseEnter,
267
285
  onMouseLeave
268
286
  }) {
269
- var _item$key2;
287
+ var _item$key3;
270
288
  const [submenuActive, setSubmenuActive] = React.useState(false);
271
289
 
272
290
  // onClick and value.name are the action indicators in the handlers
@@ -288,7 +306,7 @@ function DropdownMenuItem({
288
306
  onMouseDown: _handleSubmenuActive
289
307
  }, jsx(CustomItem, {
290
308
  item: item,
291
- key: (_item$key2 = item.key) !== null && _item$key2 !== void 0 ? _item$key2 : String(item.content),
309
+ key: (_item$key3 = item.key) !== null && _item$key3 !== void 0 ? _item$key3 : String(item.content),
292
310
  testId: `dropdown-item__${String(item.content)}`,
293
311
  role: shouldUseDefaultRole ? 'button' : 'menuitem',
294
312
  iconBefore: item.elemBefore,
@@ -312,9 +330,9 @@ function DropdownMenuItem({
312
330
  })
313
331
  }, item.content));
314
332
  if (item.tooltipDescription) {
315
- var _item$key3;
333
+ var _item$key4;
316
334
  return jsx(Tooltip, {
317
- key: (_item$key3 = item.key) !== null && _item$key3 !== void 0 ? _item$key3 : String(item.content),
335
+ key: (_item$key4 = item.key) !== null && _item$key4 !== void 0 ? _item$key4 : String(item.content),
318
336
  content: item.tooltipDescription,
319
337
  position: item.tooltipPosition
320
338
  }, dropListItem);
@@ -48,14 +48,13 @@ const DEFAULT_SLOW_THRESHOLD = 4;
48
48
  *
49
49
  */
50
50
  class WithPluginState extends React.Component {
51
- constructor(...args) {
52
- super(...args);
51
+ constructor(props, context) {
52
+ super(props, context);
53
53
  _defineProperty(this, "listeners", {});
54
54
  _defineProperty(this, "debounce", null);
55
55
  _defineProperty(this, "notAppliedState", {});
56
56
  _defineProperty(this, "isSubscribed", false);
57
57
  _defineProperty(this, "callsCount", 0);
58
- _defineProperty(this, "state", this.getPluginsStates(this.props.plugins, this.getEditorView(this.props, this.context)));
59
58
  _defineProperty(this, "handlePluginStateChange", (propName, pluginName, performanceOptions, skipEqualityCheck) => pluginState => {
60
59
  // skipEqualityCheck is being used for old plugins since they are mutating plugin state instead of creating a new one
61
60
  if (this.state[propName] !== pluginState || skipEqualityCheck) {
@@ -119,6 +118,7 @@ class WithPluginState extends React.Component {
119
118
  _defineProperty(this, "onContextUpdate", () => {
120
119
  this.subscribe(this.props);
121
120
  });
121
+ this.state = this.getPluginsStates(this.props.plugins, this.getEditorView(props, context));
122
122
  }
123
123
  getEditorView(maybeProps, maybeContext) {
124
124
  const props = maybeProps || this.props;
@@ -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 = "76.18.4";
9
+ var packageVersion = "76.18.6";
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
@@ -19,7 +19,7 @@ import { themed } from '@atlaskit/theme/components';
19
19
  import { borderRadius } from '@atlaskit/theme/constants';
20
20
  import Layer from '../Layer';
21
21
  var packageName = "@atlaskit/editor-common";
22
- var packageVersion = "76.18.4";
22
+ var packageVersion = "76.18.6";
23
23
  var halfFocusRing = 1;
24
24
  var dropOffset = '0, 8';
25
25
  var DropList = /*#__PURE__*/function (_Component) {
@@ -47,7 +47,6 @@ export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
47
47
  attributes: {
48
48
  error: error,
49
49
  errorInfo: errorInfo,
50
- // @ts-expect-error
51
50
  errorRethrown: !this.hasFallback()
52
51
  }
53
52
  });
@@ -21,7 +21,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
21
21
  import React, { PureComponent, useContext } from 'react';
22
22
  import { css, jsx } from '@emotion/react';
23
23
  import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
24
- import { CustomItem, MenuGroup } from '@atlaskit/menu';
24
+ import { CustomItem, MenuGroup, Section } from '@atlaskit/menu';
25
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
25
26
  import { B100, DN600, DN80, N70, N900 } from '@atlaskit/theme/colors';
26
27
  import { themed } from '@atlaskit/theme/components';
27
28
  import Tooltip from '@atlaskit/tooltip';
@@ -128,7 +129,8 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
128
129
  zIndex = _this$props.zIndex,
129
130
  shouldUseDefaultRole = _this$props.shouldUseDefaultRole,
130
131
  onItemActivated = _this$props.onItemActivated,
131
- arrowKeyNavigationProviderOptions = _this$props.arrowKeyNavigationProviderOptions;
132
+ arrowKeyNavigationProviderOptions = _this$props.arrowKeyNavigationProviderOptions,
133
+ section = _this$props.section;
132
134
 
133
135
  // Note that this onSelection function can't be refactored to useMemo for
134
136
  // performance gains as it is being used as a dependency in a useEffect in
@@ -183,14 +185,32 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
183
185
  }
184
186
  }), jsx("div", {
185
187
  ref: this.popupRef
188
+ }, getBooleanFF('platform.editor.menu.group-items') && jsx(MenuGroup, {
189
+ role: shouldUseDefaultRole ? 'group' : 'menu'
186
190
  }, items.map(function (group, index) {
191
+ return jsx(Section, {
192
+ hasSeparator: (section === null || section === void 0 ? void 0 : section.hasSeparator) && index > 0,
193
+ title: section === null || section === void 0 ? void 0 : section.title,
194
+ key: index
195
+ }, group.items.map(function (item) {
196
+ var _item$key;
197
+ return jsx(DropdownMenuItem, {
198
+ key: (_item$key = item.key) !== null && _item$key !== void 0 ? _item$key : String(item.content),
199
+ item: item,
200
+ onItemActivated: _this2.props.onItemActivated,
201
+ shouldUseDefaultRole: _this2.props.shouldUseDefaultRole,
202
+ onMouseEnter: _this2.props.onMouseEnter,
203
+ onMouseLeave: _this2.props.onMouseLeave
204
+ });
205
+ }));
206
+ })), !getBooleanFF('platform.editor.menu.group-items') && items.map(function (group, index) {
187
207
  return jsx(MenuGroup, {
188
208
  key: index,
189
209
  role: shouldUseDefaultRole ? 'group' : 'menu'
190
210
  }, group.items.map(function (item) {
191
- var _item$key;
211
+ var _item$key2;
192
212
  return jsx(DropdownMenuItem, {
193
- key: (_item$key = item.key) !== null && _item$key !== void 0 ? _item$key : String(item.content),
213
+ key: (_item$key2 = item.key) !== null && _item$key2 !== void 0 ? _item$key2 : String(item.content),
194
214
  item: item,
195
215
  onItemActivated: _this2.props.onItemActivated,
196
216
  shouldUseDefaultRole: _this2.props.shouldUseDefaultRole,
@@ -249,7 +269,7 @@ var DropdownMenuItemCustomComponent = /*#__PURE__*/React.forwardRef(function (pr
249
269
  }), children);
250
270
  });
251
271
  function DropdownMenuItem(_ref) {
252
- var _item$key2;
272
+ var _item$key3;
253
273
  var item = _ref.item,
254
274
  onItemActivated = _ref.onItemActivated,
255
275
  shouldUseDefaultRole = _ref.shouldUseDefaultRole,
@@ -281,7 +301,7 @@ function DropdownMenuItem(_ref) {
281
301
  onMouseDown: _handleSubmenuActive
282
302
  }, jsx(CustomItem, {
283
303
  item: item,
284
- key: (_item$key2 = item.key) !== null && _item$key2 !== void 0 ? _item$key2 : String(item.content),
304
+ key: (_item$key3 = item.key) !== null && _item$key3 !== void 0 ? _item$key3 : String(item.content),
285
305
  testId: "dropdown-item__".concat(String(item.content)),
286
306
  role: shouldUseDefaultRole ? 'button' : 'menuitem',
287
307
  iconBefore: item.elemBefore,
@@ -311,9 +331,9 @@ function DropdownMenuItem(_ref) {
311
331
  }
312
332
  }, item.content));
313
333
  if (item.tooltipDescription) {
314
- var _item$key3;
334
+ var _item$key4;
315
335
  return jsx(Tooltip, {
316
- key: (_item$key3 = item.key) !== null && _item$key3 !== void 0 ? _item$key3 : String(item.content),
336
+ key: (_item$key4 = item.key) !== null && _item$key4 !== void 0 ? _item$key4 : String(item.content),
317
337
  content: item.tooltipDescription,
318
338
  position: item.tooltipPosition
319
339
  }, dropListItem);
@@ -60,19 +60,15 @@ var DEFAULT_SLOW_THRESHOLD = 4;
60
60
  var WithPluginState = /*#__PURE__*/function (_React$Component) {
61
61
  _inherits(WithPluginState, _React$Component);
62
62
  var _super = _createSuper(WithPluginState);
63
- function WithPluginState() {
63
+ function WithPluginState(props, context) {
64
64
  var _this;
65
65
  _classCallCheck(this, WithPluginState);
66
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
67
- args[_key] = arguments[_key];
68
- }
69
- _this = _super.call.apply(_super, [this].concat(args));
66
+ _this = _super.call(this, props, context);
70
67
  _defineProperty(_assertThisInitialized(_this), "listeners", {});
71
68
  _defineProperty(_assertThisInitialized(_this), "debounce", null);
72
69
  _defineProperty(_assertThisInitialized(_this), "notAppliedState", {});
73
70
  _defineProperty(_assertThisInitialized(_this), "isSubscribed", false);
74
71
  _defineProperty(_assertThisInitialized(_this), "callsCount", 0);
75
- _defineProperty(_assertThisInitialized(_this), "state", _this.getPluginsStates(_this.props.plugins, _this.getEditorView(_this.props, _this.context)));
76
72
  _defineProperty(_assertThisInitialized(_this), "handlePluginStateChange", function (propName, pluginName, performanceOptions, skipEqualityCheck) {
77
73
  return function (pluginState) {
78
74
  // skipEqualityCheck is being used for old plugins since they are mutating plugin state instead of creating a new one
@@ -136,6 +132,7 @@ var WithPluginState = /*#__PURE__*/function (_React$Component) {
136
132
  _defineProperty(_assertThisInitialized(_this), "onContextUpdate", function () {
137
133
  _this.subscribe(_this.props);
138
134
  });
135
+ _this.state = _this.getPluginsStates(_this.props.plugins, _this.getEditorView(props, context));
139
136
  return _this;
140
137
  }
141
138
  _createClass(WithPluginState, [{
@@ -102,6 +102,7 @@ type ContentComponentErrorAEP = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.CO
102
102
  export type ErrorEventAttributes = {
103
103
  error: Error;
104
104
  errorInfo: React.ErrorInfo;
105
+ errorRethrown?: boolean;
105
106
  product?: string;
106
107
  browserInfo?: string;
107
108
  errorId?: string;
@@ -1,6 +1,10 @@
1
- import React from 'react';
2
- import { EditorActionsOptions as EditorActions } from '../../types';
3
- import { ArrowKeyNavigationProviderOptions } from '../ArrowKeyNavigationProvider/types';
1
+ import type React from 'react';
2
+ import type { EditorActionsOptions as EditorActions } from '../../types';
3
+ import type { ArrowKeyNavigationProviderOptions } from '../ArrowKeyNavigationProvider/types';
4
+ type SectionOptions = {
5
+ hasSeparator?: boolean;
6
+ title?: string;
7
+ };
4
8
  export interface Props {
5
9
  mountTo?: HTMLElement;
6
10
  boundariesElement?: HTMLElement;
@@ -21,6 +25,7 @@ export interface Props {
21
25
  disableArrowKeyNavigation?: boolean;
22
26
  shouldFocusFirstItem?: () => boolean;
23
27
  arrowKeyNavigationProviderOptions: ArrowKeyNavigationProviderOptions;
28
+ section?: SectionOptions;
24
29
  }
25
30
  export interface MenuItem {
26
31
  key?: string;
@@ -47,3 +52,4 @@ export interface State {
47
52
  popupPlacement: [string, string];
48
53
  selectionIndex: number;
49
54
  }
55
+ export {};
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import type { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
- import { EditorView } from '@atlaskit/editor-prosemirror/view';
5
- import { EventDispatcher } from '../event-dispatcher';
4
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { EventDispatcher } from '../event-dispatcher';
6
6
  import type { NamedPluginKeys, NamedPluginStates } from './types';
7
7
  export type PerformanceOptions = {
8
8
  samplingRate: number;
@@ -86,6 +86,7 @@ declare class WithPluginState<P extends NamedPluginKeys> extends React.Component
86
86
  };
87
87
  context: Context;
88
88
  state: NamedPluginStates<P>;
89
+ constructor(props: Props<P>, context: Context);
89
90
  private getEditorView;
90
91
  private getEventDispatcher;
91
92
  private handlePluginStateChange;
@@ -102,6 +102,7 @@ type ContentComponentErrorAEP = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.CO
102
102
  export type ErrorEventAttributes = {
103
103
  error: Error;
104
104
  errorInfo: React.ErrorInfo;
105
+ errorRethrown?: boolean;
105
106
  product?: string;
106
107
  browserInfo?: string;
107
108
  errorId?: string;
@@ -1,6 +1,10 @@
1
- import React from 'react';
2
- import { EditorActionsOptions as EditorActions } from '../../types';
3
- import { ArrowKeyNavigationProviderOptions } from '../ArrowKeyNavigationProvider/types';
1
+ import type React from 'react';
2
+ import type { EditorActionsOptions as EditorActions } from '../../types';
3
+ import type { ArrowKeyNavigationProviderOptions } from '../ArrowKeyNavigationProvider/types';
4
+ type SectionOptions = {
5
+ hasSeparator?: boolean;
6
+ title?: string;
7
+ };
4
8
  export interface Props {
5
9
  mountTo?: HTMLElement;
6
10
  boundariesElement?: HTMLElement;
@@ -21,6 +25,7 @@ export interface Props {
21
25
  disableArrowKeyNavigation?: boolean;
22
26
  shouldFocusFirstItem?: () => boolean;
23
27
  arrowKeyNavigationProviderOptions: ArrowKeyNavigationProviderOptions;
28
+ section?: SectionOptions;
24
29
  }
25
30
  export interface MenuItem {
26
31
  key?: string;
@@ -50,3 +55,4 @@ export interface State {
50
55
  ];
51
56
  selectionIndex: number;
52
57
  }
58
+ export {};
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import type { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
- import { EditorView } from '@atlaskit/editor-prosemirror/view';
5
- import { EventDispatcher } from '../event-dispatcher';
4
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { EventDispatcher } from '../event-dispatcher';
6
6
  import type { NamedPluginKeys, NamedPluginStates } from './types';
7
7
  export type PerformanceOptions = {
8
8
  samplingRate: number;
@@ -86,6 +86,7 @@ declare class WithPluginState<P extends NamedPluginKeys> extends React.Component
86
86
  };
87
87
  context: Context;
88
88
  state: NamedPluginStates<P>;
89
+ constructor(props: Props<P>, context: Context);
89
90
  private getEditorView;
90
91
  private getEventDispatcher;
91
92
  private handlePluginStateChange;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "76.18.4",
3
+ "version": "76.18.6",
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/"
@@ -105,9 +105,9 @@
105
105
  "@atlaskit/icon": "^21.12.0",
106
106
  "@atlaskit/icon-object": "^6.3.0",
107
107
  "@atlaskit/in-product-testing": "^0.2.0",
108
- "@atlaskit/link-datasource": "^1.13.0",
108
+ "@atlaskit/link-datasource": "^1.14.0",
109
109
  "@atlaskit/link-picker": "^1.30.0",
110
- "@atlaskit/media-card": "^77.2.0",
110
+ "@atlaskit/media-card": "^77.3.0",
111
111
  "@atlaskit/media-client": "^25.0.0",
112
112
  "@atlaskit/media-picker": "^66.2.0",
113
113
  "@atlaskit/mention": "^22.1.0",
@@ -155,7 +155,7 @@
155
155
  "devDependencies": {
156
156
  "@atlaskit/media-core": "^34.1.0",
157
157
  "@atlaskit/media-test-helpers": "^33.0.0",
158
- "@atlaskit/smart-card": "^26.41.0",
158
+ "@atlaskit/smart-card": "^26.42.0",
159
159
  "@atlaskit/util-data-test": "^17.8.0",
160
160
  "@atlaskit/visual-regression": "*",
161
161
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
@@ -210,6 +210,9 @@
210
210
  },
211
211
  "platform.editor.table.increase-shadow-visibility_lh89r": {
212
212
  "type": "boolean"
213
+ },
214
+ "platform.editor.menu.group-items": {
215
+ "type": "boolean"
213
216
  }
214
217
  }
215
218
  }