@atlaskit/editor-common 87.2.1 → 87.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +19 -1
  2. package/dist/cjs/element-browser/components/StatelessElementBrowser.js +3 -1
  3. package/dist/cjs/element-browser/constants.js +3 -2
  4. package/dist/cjs/element-browser/index.js +6 -0
  5. package/dist/cjs/lazy-node-view/css-helper.js +40 -0
  6. package/dist/cjs/lazy-node-view/index.js +7 -0
  7. package/dist/cjs/monitoring/error.js +1 -1
  8. package/dist/cjs/ui/DropList/index.js +1 -1
  9. package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.js +1 -2
  10. package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +1 -1
  11. package/dist/cjs/ui-menu/DropdownMenu/index.js +1 -1
  12. package/dist/cjs/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +12 -2
  13. package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +2 -3
  14. package/dist/cjs/utils/page-element-counts.js +5 -0
  15. package/dist/es2019/element-browser/components/StatelessElementBrowser.js +4 -2
  16. package/dist/es2019/element-browser/constants.js +2 -1
  17. package/dist/es2019/element-browser/index.js +1 -1
  18. package/dist/es2019/lazy-node-view/css-helper.js +19 -0
  19. package/dist/es2019/lazy-node-view/index.js +1 -0
  20. package/dist/es2019/monitoring/error.js +1 -1
  21. package/dist/es2019/ui/DropList/index.js +1 -1
  22. package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.js +1 -2
  23. package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +1 -1
  24. package/dist/es2019/ui-menu/DropdownMenu/index.js +1 -1
  25. package/dist/es2019/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +12 -2
  26. package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +2 -3
  27. package/dist/es2019/utils/page-element-counts.js +6 -1
  28. package/dist/esm/element-browser/components/StatelessElementBrowser.js +4 -2
  29. package/dist/esm/element-browser/constants.js +2 -1
  30. package/dist/esm/element-browser/index.js +1 -1
  31. package/dist/esm/lazy-node-view/css-helper.js +33 -0
  32. package/dist/esm/lazy-node-view/index.js +1 -0
  33. package/dist/esm/monitoring/error.js +1 -1
  34. package/dist/esm/ui/DropList/index.js +1 -1
  35. package/dist/esm/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.js +1 -2
  36. package/dist/esm/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +1 -1
  37. package/dist/esm/ui-menu/DropdownMenu/index.js +1 -1
  38. package/dist/esm/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +12 -2
  39. package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +2 -3
  40. package/dist/esm/utils/page-element-counts.js +5 -0
  41. package/dist/types/element-browser/constants.d.ts +1 -0
  42. package/dist/types/element-browser/index.d.ts +1 -1
  43. package/dist/types/lazy-node-view/css-helper.d.ts +7 -0
  44. package/dist/types/lazy-node-view/index.d.ts +1 -0
  45. package/dist/types/types/editor-plugin.d.ts +0 -2
  46. package/dist/types/types/floating-toolbar.d.ts +1 -0
  47. package/dist/types-ts4.5/element-browser/constants.d.ts +1 -0
  48. package/dist/types-ts4.5/element-browser/index.d.ts +1 -1
  49. package/dist/types-ts4.5/lazy-node-view/css-helper.d.ts +7 -0
  50. package/dist/types-ts4.5/lazy-node-view/index.d.ts +1 -0
  51. package/dist/types-ts4.5/types/editor-plugin.d.ts +0 -2
  52. package/dist/types-ts4.5/types/floating-toolbar.d.ts +1 -0
  53. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,12 +1,30 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
- ## 87.2.1
3
+ ## 87.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f42945811476f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f42945811476f) -
8
+ [NO-ISSUE] Mapping macro extensionKeys for the pageElementCounts analytics events to remove
9
+ prefixes with UUIDs
10
+
11
+ ## 87.3.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#125595](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/125595)
16
+ [`88881a6e5b2e9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/88881a6e5b2e9) -
17
+ added a css util for lnv
4
18
 
5
19
  ### Patch Changes
6
20
 
7
21
  - [#125984](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/125984)
8
22
  [`167a210dfd672`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/167a210dfd672) -
9
23
  [ux] Update shortcuts for element dnd
24
+ - [#125082](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/125082)
25
+ [`ba605ab4da0e1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ba605ab4da0e1) -
26
+ [ED-23977] This change cleans up the use of the feature flag
27
+ 'platform.editor.a11y-main-toolbar-navigation_osrty'.
10
28
  - Updated dependencies
11
29
 
12
30
  ## 87.2.0
@@ -12,6 +12,7 @@ var _react = _interopRequireWildcard(require("react"));
12
12
  var _react2 = require("@emotion/react");
13
13
  var _reactIntlNext = require("react-intl-next");
14
14
  var _analyticsNext = require("@atlaskit/analytics-next");
15
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
16
  var _analytics = require("../../analytics");
16
17
  var _constants = require("../constants");
17
18
  var _useContainerWidth2 = _interopRequireDefault(require("../hooks/use-container-width"));
@@ -223,7 +224,8 @@ function StatelessElementBrowser(props) {
223
224
  }, [categoryBeenChosen, onSelectCategory]);
224
225
  return (0, _react2.jsx)("div", {
225
226
  css: wrapper,
226
- "data-testid": "element-browser"
227
+ "data-testid": "element-browser",
228
+ id: (0, _platformFeatureFlags.fg)('editor-fix-esc-main-toolbar-navigation') ? _constants.ELEMENT_BROWSER_ID : undefined
227
229
  }, (0, _react2.jsx)(ContainerWidthMonitor, null), containerWidth < _constants.DEVICE_BREAKPOINT_NUMBERS.medium ? (0, _react2.jsx)(MobileBrowser, (0, _extends2.default)({}, props, {
228
230
  selectedItemIndex: selectedItemIndex,
229
231
  focusedItemIndex: focusedItemIndex,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SIDEBAR_WIDTH = exports.SIDEBAR_HEADING_WRAPPER_HEIGHT = exports.SIDEBAR_HEADING_PADDING_LEFT = exports.SEARCH_ITEM_HEIGHT_WIDTH = exports.SCROLLBAR_WIDTH = exports.INLINE_SIDEBAR_HEIGHT = exports.GRID_SIZE = exports.FLEX_ITEMS_CONTAINER_BREAKPOINT_NUMBERS = exports.ELEMENT_LIST_PADDING = exports.ELEMENT_ITEM_PADDING = exports.ELEMENT_ITEM_HEIGHT = exports.DEVICE_BREAKPOINT_NUMBERS = void 0;
6
+ exports.SIDEBAR_WIDTH = exports.SIDEBAR_HEADING_WRAPPER_HEIGHT = exports.SIDEBAR_HEADING_PADDING_LEFT = exports.SEARCH_ITEM_HEIGHT_WIDTH = exports.SCROLLBAR_WIDTH = exports.INLINE_SIDEBAR_HEIGHT = exports.GRID_SIZE = exports.FLEX_ITEMS_CONTAINER_BREAKPOINT_NUMBERS = exports.ELEMENT_LIST_PADDING = exports.ELEMENT_ITEM_PADDING = exports.ELEMENT_ITEM_HEIGHT = exports.ELEMENT_BROWSER_ID = exports.DEVICE_BREAKPOINT_NUMBERS = void 0;
7
7
  var _constants = require("@atlaskit/theme/constants");
8
8
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
9
9
 
@@ -28,4 +28,5 @@ var SEARCH_ITEM_HEIGHT_WIDTH = exports.SEARCH_ITEM_HEIGHT_WIDTH = '20px';
28
28
  var SCROLLBAR_WIDTH = exports.SCROLLBAR_WIDTH = 15;
29
29
  var ELEMENT_LIST_PADDING = exports.ELEMENT_LIST_PADDING = 2;
30
30
  var ELEMENT_ITEM_HEIGHT = exports.ELEMENT_ITEM_HEIGHT = 75;
31
- var ELEMENT_ITEM_PADDING = exports.ELEMENT_ITEM_PADDING = 10;
31
+ var ELEMENT_ITEM_PADDING = exports.ELEMENT_ITEM_PADDING = 10;
32
+ var ELEMENT_BROWSER_ID = exports.ELEMENT_BROWSER_ID = 'editor-element-browser';
@@ -4,6 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ Object.defineProperty(exports, "ELEMENT_BROWSER_ID", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _constants.ELEMENT_BROWSER_ID;
11
+ }
12
+ });
7
13
  Object.defineProperty(exports, "ELEMENT_ITEM_HEIGHT", {
8
14
  enumerable: true,
9
15
  get: function get() {
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.convertToInlineCss = convertToInlineCss;
8
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
+ /**
10
+ * Converts a camelCased CSS property name to a hyphenated CSS property name.
11
+ *
12
+ * @param property - CamelCased CSS property name.
13
+ * @returns Hyphenated CSS property name.
14
+ */
15
+ function hyphenate(property) {
16
+ return property.replace(/[A-Z]/g, function (match) {
17
+ return "-".concat(match.toLowerCase());
18
+ }).replace(/^ms/, '-ms');
19
+ }
20
+
21
+ /**
22
+ * Converts a CSS properties object to a CSS string.
23
+ * @param properties - CSS properties object.
24
+ * @returns CSS string.
25
+ */
26
+ function convertToInlineCss(properties) {
27
+ var cssString = Object.entries(properties).sort(function (_ref, _ref2) {
28
+ var _ref3 = (0, _slicedToArray2.default)(_ref, 1),
29
+ a = _ref3[0];
30
+ var _ref4 = (0, _slicedToArray2.default)(_ref2, 1),
31
+ b = _ref4[0];
32
+ return a.localeCompare(b);
33
+ }).map(function (_ref5) {
34
+ var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
35
+ property = _ref6[0],
36
+ value = _ref6[1];
37
+ return "".concat(hyphenate(property), ": ").concat(value, ";");
38
+ }).join(' ');
39
+ return cssString;
40
+ }
@@ -3,9 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "convertToInlineCss", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _cssHelper.convertToInlineCss;
10
+ }
11
+ });
6
12
  exports.withLazyLoading = void 0;
7
13
  var _nodeView = require("./node-view");
8
14
  var _replaceNodeViews = require("./replace-node-views");
15
+ var _cssHelper = require("./css-helper");
9
16
  /**
10
17
  * 📢 Public Type
11
18
  *
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  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; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "87.2.1";
20
+ var packageVersion = "87.3.1";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // TODO: Sanitise the URL instead of just removing it
@@ -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 = "87.2.1";
26
+ var packageVersion = "87.3.1";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  var DropList = /*#__PURE__*/function (_Component) {
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.ColorPaletteArrowKeyNavigationProvider = void 0;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _react = _interopRequireWildcard(require("react"));
11
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
11
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
13
12
  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; }
14
13
  /**
@@ -29,7 +28,7 @@ var ColorPaletteArrowKeyNavigationProvider = exports.ColorPaletteArrowKeyNavigat
29
28
  var wrapperRef = (0, _react.useRef)(null);
30
29
  var currentSelectedColumnIndex = (0, _react.useRef)(selectedColumnIndex === -1 ? 0 : selectedColumnIndex);
31
30
  var currentSelectedRowIndex = (0, _react.useRef)(selectedRowIndex === -1 ? 0 : selectedRowIndex);
32
- var element = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-main-toolbar-navigation_osrty') && popupsMountPoint ? popupsMountPoint : editorRef.current;
31
+ var element = popupsMountPoint ? popupsMountPoint : editorRef.current;
33
32
  var _useState = (0, _react.useState)(element),
34
33
  _useState2 = (0, _slicedToArray2.default)(_useState, 1),
35
34
  listenerTargetElement = _useState2[0];
@@ -36,7 +36,7 @@ var MenuArrowKeyNavigationProvider = exports.MenuArrowKeyNavigationProvider = fu
36
36
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
37
37
  currentSelectedItemIndex = _useState2[0],
38
38
  setCurrentSelectedItemIndex = _useState2[1];
39
- var element = popupsMountPoint && (0, _platformFeatureFlags.fg)('platform.editor.a11y-main-toolbar-navigation_osrty') ? [popupsMountPoint, editorRef.current] : [editorRef.current];
39
+ var element = popupsMountPoint ? [popupsMountPoint, editorRef.current] : [editorRef.current];
40
40
  var _useState3 = (0, _react.useState)(element),
41
41
  _useState4 = (0, _slicedToArray2.default)(_useState3, 1),
42
42
  listenerTargetElement = _useState4[0];
@@ -259,7 +259,7 @@ var DropdownMenuWrapper = exports.default = /*#__PURE__*/function (_PureComponen
259
259
  key: 'ArrowDown',
260
260
  bubbles: true
261
261
  });
262
- if (mountTo && (0, _platformFeatureFlags.fg)('platform.editor.a11y-main-toolbar-navigation_osrty')) {
262
+ if (mountTo) {
263
263
  mountTo.dispatchEvent(keyboardEvent);
264
264
  return;
265
265
  }
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.ToolbarArrowKeyNavigationProvider = exports.KeyDownHandlerContext = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _react2 = require("@emotion/react");
10
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
+ var _elementBrowser = require("../../element-browser");
10
12
  var _messages = require("../../messages");
11
13
  var _ui = require("../../ui");
12
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
@@ -120,7 +122,7 @@ var ToolbarArrowKeyNavigationProvider = exports.ToolbarArrowKeyNavigationProvide
120
122
  * @param event
121
123
  */
122
124
  var handleKeyDown = function handleKeyDown(event) {
123
- var _document$querySelect, _document$querySelect2, _wrapperRef$current;
125
+ var _document$querySelect, _document$querySelect2, _wrapperRef$current2;
124
126
  // To trap the focus inside the horizontal toolbar for left and right arrow keys
125
127
  var targetElement = event.target;
126
128
  if (targetElement instanceof HTMLElement && !targetElement.closest("".concat(childComponentSelector))) {
@@ -134,11 +136,19 @@ var ToolbarArrowKeyNavigationProvider = exports.ToolbarArrowKeyNavigationProvide
134
136
  // if menu wrapper exists, then a menu is open and arrow keys will be handled by MenuArrowKeyNavigationProvider
135
137
  return;
136
138
  }
139
+ if ((0, _platformFeatureFlags.fg)('editor-fix-esc-main-toolbar-navigation')) {
140
+ var _wrapperRef$current;
141
+ var elementBrowser = wrapperRef === null || wrapperRef === void 0 || (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.querySelector("#".concat(_elementBrowser.ELEMENT_BROWSER_ID));
142
+ if (elementBrowser) {
143
+ // if element browser is open, then arrow keys will be handled by MenuArrowKeyNavigationProvider
144
+ return;
145
+ }
146
+ }
137
147
  var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
138
148
  if (!filteredFocusableElements || (filteredFocusableElements === null || filteredFocusableElements === void 0 ? void 0 : filteredFocusableElements.length) === 0) {
139
149
  return;
140
150
  }
141
- if (targetElement instanceof HTMLElement && !((_wrapperRef$current = wrapperRef.current) !== null && _wrapperRef$current !== void 0 && _wrapperRef$current.contains(targetElement))) {
151
+ if (targetElement instanceof HTMLElement && !((_wrapperRef$current2 = wrapperRef.current) !== null && _wrapperRef$current2 !== void 0 && _wrapperRef$current2.contains(targetElement))) {
142
152
  selectedItemIndex.current = -1;
143
153
  } else {
144
154
  selectedItemIndex.current = targetElement instanceof HTMLElement && filteredFocusableElements.indexOf(targetElement) > -1 ? filteredFocusableElements.indexOf(targetElement) : selectedItemIndex.current;
@@ -17,7 +17,6 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
17
17
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
18
18
  var _react = _interopRequireWildcard(require("react"));
19
19
  var _reactDom = _interopRequireDefault(require("react-dom"));
20
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
20
  var _ReactEditorViewContext = _interopRequireDefault(require("./ReactEditorViewContext"));
22
21
  var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "closeOnTab"];
23
22
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
@@ -80,7 +79,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
80
79
  if (this.props.handleEscapeKeydown) {
81
80
  var _this$props$editorRef;
82
81
  // Attached event to the menu so that 'ESC' events from the opened menu also will be handled.
83
- ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-main-toolbar-navigation_osrty') && this.props.popupsMountPoint ? this.props.popupsMountPoint : undefined || ((_this$props$editorRef = this.props.editorRef) === null || _this$props$editorRef === void 0 ? void 0 : _this$props$editorRef.current) || this.props.targetRef || document).addEventListener('keydown', this.handleKeydown, false);
82
+ (this.props.popupsMountPoint ? this.props.popupsMountPoint : undefined || ((_this$props$editorRef = this.props.editorRef) === null || _this$props$editorRef === void 0 ? void 0 : _this$props$editorRef.current) || this.props.targetRef || document).addEventListener('keydown', this.handleKeydown, false);
84
83
  }
85
84
  }
86
85
  }, {
@@ -91,7 +90,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
91
90
  }
92
91
  if (this.props.handleEscapeKeydown) {
93
92
  var _this$props$editorRef2;
94
- ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-main-toolbar-navigation_osrty') && this.props.popupsMountPoint ? this.props.popupsMountPoint : undefined || ((_this$props$editorRef2 = this.props.editorRef) === null || _this$props$editorRef2 === void 0 ? void 0 : _this$props$editorRef2.current) || this.props.targetRef || document).removeEventListener('keydown', this.handleKeydown, false);
93
+ (this.props.popupsMountPoint ? this.props.popupsMountPoint : undefined || ((_this$props$editorRef2 = this.props.editorRef) === null || _this$props$editorRef2 === void 0 ? void 0 : _this$props$editorRef2.current) || this.props.targetRef || document).removeEventListener('keydown', this.handleKeydown, false);
95
94
  }
96
95
  }
97
96
  }, {
@@ -32,6 +32,11 @@ var getPageElementCounts = exports.getPageElementCounts = function getPageElemen
32
32
  if ('attrs' in node && node.attrs && 'extensionKey' in node.attrs && node.attrs.extensionKey) {
33
33
  var _acc$macros$extension;
34
34
  var extensionKey = node.attrs.extensionKey;
35
+ // If macros extensionKey has <UUID>/<UUID>/static/ prepended to it, remove the prefix
36
+ if (extensionKey.includes('/static/')) {
37
+ var extensionKeyParts = extensionKey.split('/');
38
+ extensionKey = extensionKeyParts[extensionKeyParts.length - 1];
39
+ }
35
40
  acc.macros[extensionKey] = ((_acc$macros$extension = acc.macros[extensionKey]) !== null && _acc$macros$extension !== void 0 ? _acc$macros$extension : 0) + 1;
36
41
  }
37
42
  } else {
@@ -9,8 +9,9 @@ import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
9
9
  import { css, jsx } from '@emotion/react';
10
10
  import { FormattedMessage } from 'react-intl-next';
11
11
  import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
12
13
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '../../analytics';
13
- import { DEVICE_BREAKPOINT_NUMBERS, GRID_SIZE, INLINE_SIDEBAR_HEIGHT, SIDEBAR_HEADING_WRAPPER_HEIGHT, SIDEBAR_WIDTH } from '../constants';
14
+ import { DEVICE_BREAKPOINT_NUMBERS, ELEMENT_BROWSER_ID, GRID_SIZE, INLINE_SIDEBAR_HEIGHT, SIDEBAR_HEADING_WRAPPER_HEIGHT, SIDEBAR_WIDTH } from '../constants';
14
15
  import useContainerWidth from '../hooks/use-container-width';
15
16
  import useSelectAndFocusOnArrowNavigation from '../hooks/use-select-and-focus-on-arrow-navigation';
16
17
  import { ViewMore } from '../ViewMore';
@@ -212,7 +213,8 @@ function StatelessElementBrowser(props) {
212
213
  }, [categoryBeenChosen, onSelectCategory]);
213
214
  return jsx("div", {
214
215
  css: wrapper,
215
- "data-testid": "element-browser"
216
+ "data-testid": "element-browser",
217
+ id: fg('editor-fix-esc-main-toolbar-navigation') ? ELEMENT_BROWSER_ID : undefined
216
218
  }, jsx(ContainerWidthMonitor, null), containerWidth < DEVICE_BREAKPOINT_NUMBERS.medium ? jsx(MobileBrowser, _extends({}, props, {
217
219
  selectedItemIndex: selectedItemIndex,
218
220
  focusedItemIndex: focusedItemIndex,
@@ -21,4 +21,5 @@ export const SEARCH_ITEM_HEIGHT_WIDTH = '20px';
21
21
  export const SCROLLBAR_WIDTH = 15;
22
22
  export const ELEMENT_LIST_PADDING = 2;
23
23
  export const ELEMENT_ITEM_HEIGHT = 75;
24
- export const ELEMENT_ITEM_PADDING = 10;
24
+ export const ELEMENT_ITEM_PADDING = 10;
25
+ export const ELEMENT_BROWSER_ID = 'editor-element-browser';
@@ -1,2 +1,2 @@
1
1
  export { default as ElementBrowser } from './components/ElementBrowserLoader';
2
- export { ELEMENT_ITEM_HEIGHT } from './constants';
2
+ export { ELEMENT_ITEM_HEIGHT, ELEMENT_BROWSER_ID } from './constants';
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Converts a camelCased CSS property name to a hyphenated CSS property name.
3
+ *
4
+ * @param property - CamelCased CSS property name.
5
+ * @returns Hyphenated CSS property name.
6
+ */
7
+ function hyphenate(property) {
8
+ return property.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`).replace(/^ms/, '-ms');
9
+ }
10
+
11
+ /**
12
+ * Converts a CSS properties object to a CSS string.
13
+ * @param properties - CSS properties object.
14
+ * @returns CSS string.
15
+ */
16
+ export function convertToInlineCss(properties) {
17
+ const cssString = Object.entries(properties).sort(([a], [b]) => a.localeCompare(b)).map(([property, value]) => `${hyphenate(property)}: ${value};`).join(' ');
18
+ return cssString;
19
+ }
@@ -1,5 +1,6 @@
1
1
  import { LazyNodeView } from './node-view';
2
2
  import { queueReplaceNodeViews } from './replace-node-views';
3
+ export { convertToInlineCss } from './css-helper';
3
4
 
4
5
  /**
5
6
  * 📢 Public Type
@@ -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 = "87.2.1";
4
+ const packageVersion = "87.3.1";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // TODO: Sanitise the URL instead of just removing it
@@ -12,7 +12,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
12
12
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
13
13
  import Layer from '../Layer';
14
14
  const packageName = "@atlaskit/editor-common";
15
- const packageVersion = "87.2.1";
15
+ const packageVersion = "87.3.1";
16
16
  const halfFocusRing = 1;
17
17
  const dropOffset = '0, 8';
18
18
  class DropList extends Component {
@@ -1,5 +1,4 @@
1
1
  import React, { useLayoutEffect, useRef, useState } from 'react';
2
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
2
  /**
4
3
  * This component is a wrapper for color picker which listens to keydown events of children
5
4
  * and handles arrow key navigation
@@ -19,7 +18,7 @@ export const ColorPaletteArrowKeyNavigationProvider = ({
19
18
  const wrapperRef = useRef(null);
20
19
  const currentSelectedColumnIndex = useRef(selectedColumnIndex === -1 ? 0 : selectedColumnIndex);
21
20
  const currentSelectedRowIndex = useRef(selectedRowIndex === -1 ? 0 : selectedRowIndex);
22
- const element = getBooleanFF('platform.editor.a11y-main-toolbar-navigation_osrty') && popupsMountPoint ? popupsMountPoint : editorRef.current;
21
+ const element = popupsMountPoint ? popupsMountPoint : editorRef.current;
23
22
  const [listenerTargetElement] = useState(element);
24
23
  const incrementRowIndex = (rowElements, columnElements) => {
25
24
  if (currentSelectedRowIndex.current === rowElements.length - 1) {
@@ -19,7 +19,7 @@ export const MenuArrowKeyNavigationProvider = ({
19
19
  }) => {
20
20
  const wrapperRef = useRef(null);
21
21
  const [currentSelectedItemIndex, setCurrentSelectedItemIndex] = useState(-1);
22
- const element = popupsMountPoint && fg('platform.editor.a11y-main-toolbar-navigation_osrty') ? [popupsMountPoint, editorRef.current] : [editorRef.current];
22
+ const element = popupsMountPoint ? [popupsMountPoint, editorRef.current] : [editorRef.current];
23
23
  const [listenerTargetElement] = useState(element);
24
24
  const incrementIndex = useCallback(list => {
25
25
  const currentIndex = currentSelectedItemIndex;
@@ -257,7 +257,7 @@ export default class DropdownMenuWrapper extends PureComponent {
257
257
  key: 'ArrowDown',
258
258
  bubbles: true
259
259
  });
260
- if (mountTo && fg('platform.editor.a11y-main-toolbar-navigation_osrty')) {
260
+ if (mountTo) {
261
261
  mountTo.dispatchEvent(keyboardEvent);
262
262
  return;
263
263
  }
@@ -8,6 +8,8 @@ import React, { useCallback, useLayoutEffect, useRef } from 'react';
8
8
 
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { css, jsx } from '@emotion/react';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
12
+ import { ELEMENT_BROWSER_ID } from '../../element-browser';
11
13
  import { fullPageMessages as messages } from '../../messages';
12
14
  import { EDIT_AREA_ID } from '../../ui';
13
15
  /*
@@ -113,7 +115,7 @@ export const ToolbarArrowKeyNavigationProvider = ({
113
115
  * @param event
114
116
  */
115
117
  const handleKeyDown = event => {
116
- var _document$querySelect, _document$querySelect2, _wrapperRef$current;
118
+ var _document$querySelect, _document$querySelect2, _wrapperRef$current2;
117
119
  // To trap the focus inside the horizontal toolbar for left and right arrow keys
118
120
  const targetElement = event.target;
119
121
  if (targetElement instanceof HTMLElement && !targetElement.closest(`${childComponentSelector}`)) {
@@ -127,11 +129,19 @@ export const ToolbarArrowKeyNavigationProvider = ({
127
129
  // if menu wrapper exists, then a menu is open and arrow keys will be handled by MenuArrowKeyNavigationProvider
128
130
  return;
129
131
  }
132
+ if (fg('editor-fix-esc-main-toolbar-navigation')) {
133
+ var _wrapperRef$current;
134
+ const elementBrowser = wrapperRef === null || wrapperRef === void 0 ? void 0 : (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.querySelector(`#${ELEMENT_BROWSER_ID}`);
135
+ if (elementBrowser) {
136
+ // if element browser is open, then arrow keys will be handled by MenuArrowKeyNavigationProvider
137
+ return;
138
+ }
139
+ }
130
140
  const filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
131
141
  if (!filteredFocusableElements || (filteredFocusableElements === null || filteredFocusableElements === void 0 ? void 0 : filteredFocusableElements.length) === 0) {
132
142
  return;
133
143
  }
134
- if (targetElement instanceof HTMLElement && !((_wrapperRef$current = wrapperRef.current) !== null && _wrapperRef$current !== void 0 && _wrapperRef$current.contains(targetElement))) {
144
+ if (targetElement instanceof HTMLElement && !((_wrapperRef$current2 = wrapperRef.current) !== null && _wrapperRef$current2 !== void 0 && _wrapperRef$current2.contains(targetElement))) {
135
145
  selectedItemIndex.current = -1;
136
146
  } else {
137
147
  selectedItemIndex.current = targetElement instanceof HTMLElement && filteredFocusableElements.indexOf(targetElement) > -1 ? filteredFocusableElements.indexOf(targetElement) : selectedItemIndex.current;
@@ -1,7 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import React, { PureComponent, useEffect, useState } from 'react';
3
3
  import ReactDOM from 'react-dom';
4
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
4
  import ReactEditorViewContext from './ReactEditorViewContext';
6
5
 
7
6
  // This needs exporting to be used alongisde `withReactEditorViewOuterListeners`
@@ -51,7 +50,7 @@ class WithOutsideClick extends PureComponent {
51
50
  if (this.props.handleEscapeKeydown) {
52
51
  var _this$props$editorRef;
53
52
  // Attached event to the menu so that 'ESC' events from the opened menu also will be handled.
54
- (getBooleanFF('platform.editor.a11y-main-toolbar-navigation_osrty') && this.props.popupsMountPoint ? this.props.popupsMountPoint : undefined || ((_this$props$editorRef = this.props.editorRef) === null || _this$props$editorRef === void 0 ? void 0 : _this$props$editorRef.current) || this.props.targetRef || document).addEventListener('keydown', this.handleKeydown, false);
53
+ (this.props.popupsMountPoint ? this.props.popupsMountPoint : undefined || ((_this$props$editorRef = this.props.editorRef) === null || _this$props$editorRef === void 0 ? void 0 : _this$props$editorRef.current) || this.props.targetRef || document).addEventListener('keydown', this.handleKeydown, false);
55
54
  }
56
55
  }
57
56
  componentWillUnmount() {
@@ -60,7 +59,7 @@ class WithOutsideClick extends PureComponent {
60
59
  }
61
60
  if (this.props.handleEscapeKeydown) {
62
61
  var _this$props$editorRef2;
63
- (getBooleanFF('platform.editor.a11y-main-toolbar-navigation_osrty') && this.props.popupsMountPoint ? this.props.popupsMountPoint : undefined || ((_this$props$editorRef2 = this.props.editorRef) === null || _this$props$editorRef2 === void 0 ? void 0 : _this$props$editorRef2.current) || this.props.targetRef || document).removeEventListener('keydown', this.handleKeydown, false);
62
+ (this.props.popupsMountPoint ? this.props.popupsMountPoint : undefined || ((_this$props$editorRef2 = this.props.editorRef) === null || _this$props$editorRef2 === void 0 ? void 0 : _this$props$editorRef2.current) || this.props.targetRef || document).removeEventListener('keydown', this.handleKeydown, false);
64
63
  }
65
64
  }
66
65
  render() {
@@ -25,7 +25,12 @@ export const getPageElementCounts = doc => {
25
25
  else if (node.type === 'extension' || node.type === 'inlineExtension' || node.type === 'bodiedExtension' || node.type === 'multiBodiedExtension' || node.type === 'extensionFrame') {
26
26
  if ('attrs' in node && node.attrs && 'extensionKey' in node.attrs && node.attrs.extensionKey) {
27
27
  var _acc$macros$extension;
28
- const extensionKey = node.attrs.extensionKey;
28
+ let extensionKey = node.attrs.extensionKey;
29
+ // If macros extensionKey has <UUID>/<UUID>/static/ prepended to it, remove the prefix
30
+ if (extensionKey.includes('/static/')) {
31
+ const extensionKeyParts = extensionKey.split('/');
32
+ extensionKey = extensionKeyParts[extensionKeyParts.length - 1];
33
+ }
29
34
  acc.macros[extensionKey] = ((_acc$macros$extension = acc.macros[extensionKey]) !== null && _acc$macros$extension !== void 0 ? _acc$macros$extension : 0) + 1;
30
35
  }
31
36
  } else {
@@ -10,8 +10,9 @@ import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
10
10
  import { css, jsx } from '@emotion/react';
11
11
  import { FormattedMessage } from 'react-intl-next';
12
12
  import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
13
+ import { fg } from '@atlaskit/platform-feature-flags';
13
14
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '../../analytics';
14
- import { DEVICE_BREAKPOINT_NUMBERS, GRID_SIZE, INLINE_SIDEBAR_HEIGHT, SIDEBAR_HEADING_WRAPPER_HEIGHT, SIDEBAR_WIDTH } from '../constants';
15
+ import { DEVICE_BREAKPOINT_NUMBERS, ELEMENT_BROWSER_ID, GRID_SIZE, INLINE_SIDEBAR_HEIGHT, SIDEBAR_HEADING_WRAPPER_HEIGHT, SIDEBAR_WIDTH } from '../constants';
15
16
  import useContainerWidth from '../hooks/use-container-width';
16
17
  import useSelectAndFocusOnArrowNavigation from '../hooks/use-select-and-focus-on-arrow-navigation';
17
18
  import { ViewMore } from '../ViewMore';
@@ -212,7 +213,8 @@ function StatelessElementBrowser(props) {
212
213
  }, [categoryBeenChosen, onSelectCategory]);
213
214
  return jsx("div", {
214
215
  css: wrapper,
215
- "data-testid": "element-browser"
216
+ "data-testid": "element-browser",
217
+ id: fg('editor-fix-esc-main-toolbar-navigation') ? ELEMENT_BROWSER_ID : undefined
216
218
  }, jsx(ContainerWidthMonitor, null), containerWidth < DEVICE_BREAKPOINT_NUMBERS.medium ? jsx(MobileBrowser, _extends({}, props, {
217
219
  selectedItemIndex: selectedItemIndex,
218
220
  focusedItemIndex: focusedItemIndex,
@@ -21,4 +21,5 @@ export var SEARCH_ITEM_HEIGHT_WIDTH = '20px';
21
21
  export var SCROLLBAR_WIDTH = 15;
22
22
  export var ELEMENT_LIST_PADDING = 2;
23
23
  export var ELEMENT_ITEM_HEIGHT = 75;
24
- export var ELEMENT_ITEM_PADDING = 10;
24
+ export var ELEMENT_ITEM_PADDING = 10;
25
+ export var ELEMENT_BROWSER_ID = 'editor-element-browser';
@@ -1,2 +1,2 @@
1
1
  export { default as ElementBrowser } from './components/ElementBrowserLoader';
2
- export { ELEMENT_ITEM_HEIGHT } from './constants';
2
+ export { ELEMENT_ITEM_HEIGHT, ELEMENT_BROWSER_ID } from './constants';
@@ -0,0 +1,33 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ /**
3
+ * Converts a camelCased CSS property name to a hyphenated CSS property name.
4
+ *
5
+ * @param property - CamelCased CSS property name.
6
+ * @returns Hyphenated CSS property name.
7
+ */
8
+ function hyphenate(property) {
9
+ return property.replace(/[A-Z]/g, function (match) {
10
+ return "-".concat(match.toLowerCase());
11
+ }).replace(/^ms/, '-ms');
12
+ }
13
+
14
+ /**
15
+ * Converts a CSS properties object to a CSS string.
16
+ * @param properties - CSS properties object.
17
+ * @returns CSS string.
18
+ */
19
+ export function convertToInlineCss(properties) {
20
+ var cssString = Object.entries(properties).sort(function (_ref, _ref2) {
21
+ var _ref3 = _slicedToArray(_ref, 1),
22
+ a = _ref3[0];
23
+ var _ref4 = _slicedToArray(_ref2, 1),
24
+ b = _ref4[0];
25
+ return a.localeCompare(b);
26
+ }).map(function (_ref5) {
27
+ var _ref6 = _slicedToArray(_ref5, 2),
28
+ property = _ref6[0],
29
+ value = _ref6[1];
30
+ return "".concat(hyphenate(property), ": ").concat(value, ";");
31
+ }).join(' ');
32
+ return cssString;
33
+ }
@@ -1,5 +1,6 @@
1
1
  import { LazyNodeView } from './node-view';
2
2
  import { queueReplaceNodeViews } from './replace-node-views';
3
+ export { convertToInlineCss } from './css-helper';
3
4
 
4
5
  /**
5
6
  * 📢 Public Type
@@ -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 = "87.2.1";
10
+ var packageVersion = "87.3.1";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // TODO: Sanitise the URL instead of just removing it
@@ -20,7 +20,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
20
20
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "87.2.1";
23
+ var packageVersion = "87.3.1";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,6 +1,5 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import React, { useLayoutEffect, useRef, useState } from 'react';
3
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
4
3
  /**
5
4
  * This component is a wrapper for color picker which listens to keydown events of children
6
5
  * and handles arrow key navigation
@@ -19,7 +18,7 @@ export var ColorPaletteArrowKeyNavigationProvider = function ColorPaletteArrowKe
19
18
  var wrapperRef = useRef(null);
20
19
  var currentSelectedColumnIndex = useRef(selectedColumnIndex === -1 ? 0 : selectedColumnIndex);
21
20
  var currentSelectedRowIndex = useRef(selectedRowIndex === -1 ? 0 : selectedRowIndex);
22
- var element = getBooleanFF('platform.editor.a11y-main-toolbar-navigation_osrty') && popupsMountPoint ? popupsMountPoint : editorRef.current;
21
+ var element = popupsMountPoint ? popupsMountPoint : editorRef.current;
23
22
  var _useState = useState(element),
24
23
  _useState2 = _slicedToArray(_useState, 1),
25
24
  listenerTargetElement = _useState2[0];
@@ -26,7 +26,7 @@ export var MenuArrowKeyNavigationProvider = function MenuArrowKeyNavigationProvi
26
26
  _useState2 = _slicedToArray(_useState, 2),
27
27
  currentSelectedItemIndex = _useState2[0],
28
28
  setCurrentSelectedItemIndex = _useState2[1];
29
- var element = popupsMountPoint && fg('platform.editor.a11y-main-toolbar-navigation_osrty') ? [popupsMountPoint, editorRef.current] : [editorRef.current];
29
+ var element = popupsMountPoint ? [popupsMountPoint, editorRef.current] : [editorRef.current];
30
30
  var _useState3 = useState(element),
31
31
  _useState4 = _slicedToArray(_useState3, 1),
32
32
  listenerTargetElement = _useState4[0];
@@ -248,7 +248,7 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
248
248
  key: 'ArrowDown',
249
249
  bubbles: true
250
250
  });
251
- if (mountTo && fg('platform.editor.a11y-main-toolbar-navigation_osrty')) {
251
+ if (mountTo) {
252
252
  mountTo.dispatchEvent(keyboardEvent);
253
253
  return;
254
254
  }
@@ -8,6 +8,8 @@ import React, { useCallback, useLayoutEffect, useRef } from 'react';
8
8
 
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { css, jsx } from '@emotion/react';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
12
+ import { ELEMENT_BROWSER_ID } from '../../element-browser';
11
13
  import { fullPageMessages as messages } from '../../messages';
12
14
  import { EDIT_AREA_ID } from '../../ui';
13
15
  /*
@@ -111,7 +113,7 @@ export var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigatio
111
113
  * @param event
112
114
  */
113
115
  var handleKeyDown = function handleKeyDown(event) {
114
- var _document$querySelect, _document$querySelect2, _wrapperRef$current;
116
+ var _document$querySelect, _document$querySelect2, _wrapperRef$current2;
115
117
  // To trap the focus inside the horizontal toolbar for left and right arrow keys
116
118
  var targetElement = event.target;
117
119
  if (targetElement instanceof HTMLElement && !targetElement.closest("".concat(childComponentSelector))) {
@@ -125,11 +127,19 @@ export var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigatio
125
127
  // if menu wrapper exists, then a menu is open and arrow keys will be handled by MenuArrowKeyNavigationProvider
126
128
  return;
127
129
  }
130
+ if (fg('editor-fix-esc-main-toolbar-navigation')) {
131
+ var _wrapperRef$current;
132
+ var elementBrowser = wrapperRef === null || wrapperRef === void 0 || (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.querySelector("#".concat(ELEMENT_BROWSER_ID));
133
+ if (elementBrowser) {
134
+ // if element browser is open, then arrow keys will be handled by MenuArrowKeyNavigationProvider
135
+ return;
136
+ }
137
+ }
128
138
  var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
129
139
  if (!filteredFocusableElements || (filteredFocusableElements === null || filteredFocusableElements === void 0 ? void 0 : filteredFocusableElements.length) === 0) {
130
140
  return;
131
141
  }
132
- if (targetElement instanceof HTMLElement && !((_wrapperRef$current = wrapperRef.current) !== null && _wrapperRef$current !== void 0 && _wrapperRef$current.contains(targetElement))) {
142
+ if (targetElement instanceof HTMLElement && !((_wrapperRef$current2 = wrapperRef.current) !== null && _wrapperRef$current2 !== void 0 && _wrapperRef$current2.contains(targetElement))) {
133
143
  selectedItemIndex.current = -1;
134
144
  } else {
135
145
  selectedItemIndex.current = targetElement instanceof HTMLElement && filteredFocusableElements.indexOf(targetElement) > -1 ? filteredFocusableElements.indexOf(targetElement) : selectedItemIndex.current;
@@ -12,7 +12,6 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
12
12
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
13
  import React, { PureComponent, useEffect, useState } from 'react';
14
14
  import ReactDOM from 'react-dom';
15
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
16
15
  import ReactEditorViewContext from './ReactEditorViewContext';
17
16
 
18
17
  // This needs exporting to be used alongisde `withReactEditorViewOuterListeners`
@@ -71,7 +70,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
71
70
  if (this.props.handleEscapeKeydown) {
72
71
  var _this$props$editorRef;
73
72
  // Attached event to the menu so that 'ESC' events from the opened menu also will be handled.
74
- (getBooleanFF('platform.editor.a11y-main-toolbar-navigation_osrty') && this.props.popupsMountPoint ? this.props.popupsMountPoint : undefined || ((_this$props$editorRef = this.props.editorRef) === null || _this$props$editorRef === void 0 ? void 0 : _this$props$editorRef.current) || this.props.targetRef || document).addEventListener('keydown', this.handleKeydown, false);
73
+ (this.props.popupsMountPoint ? this.props.popupsMountPoint : undefined || ((_this$props$editorRef = this.props.editorRef) === null || _this$props$editorRef === void 0 ? void 0 : _this$props$editorRef.current) || this.props.targetRef || document).addEventListener('keydown', this.handleKeydown, false);
75
74
  }
76
75
  }
77
76
  }, {
@@ -82,7 +81,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
82
81
  }
83
82
  if (this.props.handleEscapeKeydown) {
84
83
  var _this$props$editorRef2;
85
- (getBooleanFF('platform.editor.a11y-main-toolbar-navigation_osrty') && this.props.popupsMountPoint ? this.props.popupsMountPoint : undefined || ((_this$props$editorRef2 = this.props.editorRef) === null || _this$props$editorRef2 === void 0 ? void 0 : _this$props$editorRef2.current) || this.props.targetRef || document).removeEventListener('keydown', this.handleKeydown, false);
84
+ (this.props.popupsMountPoint ? this.props.popupsMountPoint : undefined || ((_this$props$editorRef2 = this.props.editorRef) === null || _this$props$editorRef2 === void 0 ? void 0 : _this$props$editorRef2.current) || this.props.targetRef || document).removeEventListener('keydown', this.handleKeydown, false);
86
85
  }
87
86
  }
88
87
  }, {
@@ -26,6 +26,11 @@ export var getPageElementCounts = function getPageElementCounts(doc) {
26
26
  if ('attrs' in node && node.attrs && 'extensionKey' in node.attrs && node.attrs.extensionKey) {
27
27
  var _acc$macros$extension;
28
28
  var extensionKey = node.attrs.extensionKey;
29
+ // If macros extensionKey has <UUID>/<UUID>/static/ prepended to it, remove the prefix
30
+ if (extensionKey.includes('/static/')) {
31
+ var extensionKeyParts = extensionKey.split('/');
32
+ extensionKey = extensionKeyParts[extensionKeyParts.length - 1];
33
+ }
29
34
  acc.macros[extensionKey] = ((_acc$macros$extension = acc.macros[extensionKey]) !== null && _acc$macros$extension !== void 0 ? _acc$macros$extension : 0) + 1;
30
35
  }
31
36
  } else {
@@ -18,3 +18,4 @@ export declare const SCROLLBAR_WIDTH = 15;
18
18
  export declare const ELEMENT_LIST_PADDING = 2;
19
19
  export declare const ELEMENT_ITEM_HEIGHT = 75;
20
20
  export declare const ELEMENT_ITEM_PADDING = 10;
21
+ export declare const ELEMENT_BROWSER_ID = "editor-element-browser";
@@ -1,2 +1,2 @@
1
1
  export { default as ElementBrowser } from './components/ElementBrowserLoader';
2
- export { ELEMENT_ITEM_HEIGHT } from './constants';
2
+ export { ELEMENT_ITEM_HEIGHT, ELEMENT_BROWSER_ID } from './constants';
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * Converts a CSS properties object to a CSS string.
4
+ * @param properties - CSS properties object.
5
+ * @returns CSS string.
6
+ */
7
+ export declare function convertToInlineCss(properties: React.CSSProperties): string;
@@ -2,6 +2,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { DispatchAnalyticsEvent } from '../analytics';
4
4
  import type { NodeViewConstructor } from './types';
5
+ export { convertToInlineCss } from './css-helper';
5
6
  export type { NodeViewConstructor };
6
7
  /**
7
8
  * 📢 Public Type
@@ -23,8 +23,6 @@ export type PluginsOptions = {
23
23
  * The selection toolbar is a floating toolbar that is displayed for
24
24
  * range selections when any plugins return a selection toolbar group with
25
25
  * items.
26
- * @private
27
- * @deprecated Do not use this plugin option, it is for AI purposes only and will be removed soon.
28
26
  */
29
27
  selectionToolbar?: SelectionToolbarHandler;
30
28
  /**
@@ -273,6 +273,7 @@ export interface FloatingToolbarConfig {
273
273
  focusTrap?: boolean;
274
274
  preventPopupOverflow?: boolean;
275
275
  mediaAssistiveMessage?: string;
276
+ stick?: boolean;
276
277
  }
277
278
  export type FloatingToolbarHandler = (state: EditorState, intl: IntlShape, providerFactory: ProviderFactory) => FloatingToolbarConfig | undefined;
278
279
  export {};
@@ -18,3 +18,4 @@ export declare const SCROLLBAR_WIDTH = 15;
18
18
  export declare const ELEMENT_LIST_PADDING = 2;
19
19
  export declare const ELEMENT_ITEM_HEIGHT = 75;
20
20
  export declare const ELEMENT_ITEM_PADDING = 10;
21
+ export declare const ELEMENT_BROWSER_ID = "editor-element-browser";
@@ -1,2 +1,2 @@
1
1
  export { default as ElementBrowser } from './components/ElementBrowserLoader';
2
- export { ELEMENT_ITEM_HEIGHT } from './constants';
2
+ export { ELEMENT_ITEM_HEIGHT, ELEMENT_BROWSER_ID } from './constants';
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * Converts a CSS properties object to a CSS string.
4
+ * @param properties - CSS properties object.
5
+ * @returns CSS string.
6
+ */
7
+ export declare function convertToInlineCss(properties: React.CSSProperties): string;
@@ -2,6 +2,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { DispatchAnalyticsEvent } from '../analytics';
4
4
  import type { NodeViewConstructor } from './types';
5
+ export { convertToInlineCss } from './css-helper';
5
6
  export type { NodeViewConstructor };
6
7
  /**
7
8
  * 📢 Public Type
@@ -23,8 +23,6 @@ export type PluginsOptions = {
23
23
  * The selection toolbar is a floating toolbar that is displayed for
24
24
  * range selections when any plugins return a selection toolbar group with
25
25
  * items.
26
- * @private
27
- * @deprecated Do not use this plugin option, it is for AI purposes only and will be removed soon.
28
26
  */
29
27
  selectionToolbar?: SelectionToolbarHandler;
30
28
  /**
@@ -276,6 +276,7 @@ export interface FloatingToolbarConfig {
276
276
  focusTrap?: boolean;
277
277
  preventPopupOverflow?: boolean;
278
278
  mediaAssistiveMessage?: string;
279
+ stick?: boolean;
279
280
  }
280
281
  export type FloatingToolbarHandler = (state: EditorState, intl: IntlShape, providerFactory: ProviderFactory) => FloatingToolbarConfig | undefined;
281
282
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "87.2.1",
3
+ "version": "87.3.1",
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/editor-shared-styles": "^2.13.0",
117
117
  "@atlaskit/editor-tables": "^2.8.0",
118
118
  "@atlaskit/emoji": "^67.7.0",
119
- "@atlaskit/icon": "^22.8.0",
119
+ "@atlaskit/icon": "^22.9.0",
120
120
  "@atlaskit/icon-object": "^6.4.0",
121
121
  "@atlaskit/link-datasource": "^2.9.0",
122
122
  "@atlaskit/link-picker": "^1.41.0",
@@ -134,7 +134,7 @@
134
134
  "@atlaskit/primitives": "^11.1.0",
135
135
  "@atlaskit/profilecard": "^19.17.0",
136
136
  "@atlaskit/section-message": "^6.5.0",
137
- "@atlaskit/smart-card": "^27.11.0",
137
+ "@atlaskit/smart-card": "^27.12.0",
138
138
  "@atlaskit/smart-user-picker": "^6.10.0",
139
139
  "@atlaskit/spinner": "^16.2.0",
140
140
  "@atlaskit/task-decision": "^17.10.0",
@@ -254,9 +254,6 @@
254
254
  "platform_editor_a11y_table_context_menu": {
255
255
  "type": "boolean"
256
256
  },
257
- "platform.editor.a11y-main-toolbar-navigation_osrty": {
258
- "type": "boolean"
259
- },
260
257
  "platform.editor.review-text-highlighting-styling": {
261
258
  "type": "boolean"
262
259
  },
@@ -266,6 +263,9 @@
266
263
  "editor_inline_comments_paste_insert_nodes": {
267
264
  "type": "boolean"
268
265
  },
266
+ "editor-fix-esc-main-toolbar-navigation": {
267
+ "type": "boolean"
268
+ },
269
269
  "editor_support_code_block_wrapping": {
270
270
  "type": "boolean"
271
271
  }