@atlaskit/editor-common 78.2.1 → 78.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 (64) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/element-browser/components/ElementList/ElementList.js +2 -1
  3. package/dist/cjs/element-browser/components/ElementSearch.js +28 -7
  4. package/dist/cjs/element-browser/components/StatelessElementBrowser.js +4 -2
  5. package/dist/cjs/element-browser/messages.js +3 -3
  6. package/dist/cjs/extensibility/MultiBodiedExtension/action-api.js +6 -5
  7. package/dist/cjs/extensibility/MultiBodiedExtension/index.js +3 -2
  8. package/dist/cjs/extensibility/MultiBodiedExtension/styles.js +3 -9
  9. package/dist/cjs/messages/list.js +5 -0
  10. package/dist/cjs/messages/toolbar.js +5 -0
  11. package/dist/cjs/monitoring/error.js +1 -1
  12. package/dist/cjs/resizer/Resizer.js +7 -2
  13. package/dist/cjs/styles/shared/resizer.js +1 -1
  14. package/dist/cjs/ui/DropList/index.js +1 -1
  15. package/dist/cjs/ui/MediaSingle/styled.js +1 -1
  16. package/dist/cjs/ui/MultiBodiedExtension/index.js +21 -0
  17. package/dist/cjs/ui/index.js +7 -0
  18. package/dist/es2019/element-browser/components/ElementList/ElementList.js +2 -1
  19. package/dist/es2019/element-browser/components/ElementSearch.js +25 -8
  20. package/dist/es2019/element-browser/components/StatelessElementBrowser.js +4 -2
  21. package/dist/es2019/element-browser/messages.js +3 -3
  22. package/dist/es2019/extensibility/MultiBodiedExtension/action-api.js +6 -5
  23. package/dist/es2019/extensibility/MultiBodiedExtension/index.js +5 -4
  24. package/dist/es2019/extensibility/MultiBodiedExtension/styles.js +2 -64
  25. package/dist/es2019/messages/list.js +5 -0
  26. package/dist/es2019/messages/toolbar.js +5 -0
  27. package/dist/es2019/monitoring/error.js +1 -1
  28. package/dist/es2019/resizer/Resizer.js +5 -1
  29. package/dist/es2019/styles/shared/resizer.js +5 -2
  30. package/dist/es2019/ui/DropList/index.js +1 -1
  31. package/dist/es2019/ui/MediaSingle/styled.js +1 -0
  32. package/dist/es2019/ui/MultiBodiedExtension/index.js +87 -0
  33. package/dist/es2019/ui/index.js +2 -1
  34. package/dist/esm/element-browser/components/ElementList/ElementList.js +2 -1
  35. package/dist/esm/element-browser/components/ElementSearch.js +29 -8
  36. package/dist/esm/element-browser/components/StatelessElementBrowser.js +4 -2
  37. package/dist/esm/element-browser/messages.js +3 -3
  38. package/dist/esm/extensibility/MultiBodiedExtension/action-api.js +6 -5
  39. package/dist/esm/extensibility/MultiBodiedExtension/index.js +4 -3
  40. package/dist/esm/extensibility/MultiBodiedExtension/styles.js +2 -8
  41. package/dist/esm/messages/list.js +5 -0
  42. package/dist/esm/messages/toolbar.js +5 -0
  43. package/dist/esm/monitoring/error.js +1 -1
  44. package/dist/esm/resizer/Resizer.js +7 -2
  45. package/dist/esm/styles/shared/resizer.js +1 -1
  46. package/dist/esm/ui/DropList/index.js +1 -1
  47. package/dist/esm/ui/MediaSingle/styled.js +1 -1
  48. package/dist/esm/ui/MultiBodiedExtension/index.js +15 -0
  49. package/dist/esm/ui/index.js +2 -1
  50. package/dist/types/element-browser/components/ElementSearch.d.ts +1 -0
  51. package/dist/types/extensibility/MultiBodiedExtension/styles.d.ts +0 -3
  52. package/dist/types/messages/list.d.ts +5 -0
  53. package/dist/types/messages/toolbar.d.ts +5 -0
  54. package/dist/types/resizer/Resizer.d.ts +4 -0
  55. package/dist/types/ui/MultiBodiedExtension/index.d.ts +6 -0
  56. package/dist/types/ui/index.d.ts +1 -0
  57. package/dist/types-ts4.5/element-browser/components/ElementSearch.d.ts +1 -0
  58. package/dist/types-ts4.5/extensibility/MultiBodiedExtension/styles.d.ts +0 -3
  59. package/dist/types-ts4.5/messages/list.d.ts +5 -0
  60. package/dist/types-ts4.5/messages/toolbar.d.ts +5 -0
  61. package/dist/types-ts4.5/resizer/Resizer.d.ts +4 -0
  62. package/dist/types-ts4.5/ui/MultiBodiedExtension/index.d.ts +6 -0
  63. package/dist/types-ts4.5/ui/index.d.ts +1 -0
  64. package/package.json +5 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 78.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#74333](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/74333) [`600bcf196eab`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/600bcf196eab) - [ux] ED-21950: CSS fixes related to MBE
8
+ - [#75026](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75026) [`7a7995739cfa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7a7995739cfa) - ED-22247 Set max-width to 100% when rendering media inside panel
9
+ - [#73364](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/73364) [`1c4d3e31c0e8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1c4d3e31c0e8) - fix last insert row button hard to select issue
10
+ - Updated dependencies
11
+
12
+ ## 78.3.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#68408](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68408) [`ab8f885fd0a5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ab8f885fd0a5) - ECA11Y-180: Updated announce translates structure, added required attributes
17
+ - [#73123](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/73123) [`7b46579bdbd6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7b46579bdbd6) - ECA11Y-206: updated unit tests
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 78.2.1
4
24
 
5
25
  ### Patch Changes
@@ -187,7 +187,8 @@ function ElementItem(_ref4) {
187
187
  isSelected: selected,
188
188
  "aria-describedby": title,
189
189
  ref: ref,
190
- testId: "element-item-".concat(index)
190
+ testId: "element-item-".concat(index),
191
+ id: "searched-item-".concat(index)
191
192
  }, (0, _react2.jsx)(ItemContent, {
192
193
  style: inlineMode ? null : itemStyleOverrides,
193
194
  tabIndex: 0,
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
11
  var _react = _interopRequireWildcard(require("react"));
11
12
  var _react2 = require("@emotion/react");
12
13
  var _reactIntlNext = require("react-intl-next");
@@ -32,9 +33,14 @@ function ElementSearch(_ref) {
32
33
  onClick = _ref.onClick,
33
34
  onKeyDown = _ref.onKeyDown,
34
35
  searchTerm = _ref.searchTerm,
35
- items = _ref.items;
36
+ items = _ref.items,
37
+ selectedItemIndex = _ref.selectedItemIndex;
36
38
  var ref = (0, _useFocus.default)(focus);
37
39
  var assistiveTextRef = (0, _react.useRef)(null);
40
+ var _useState = (0, _react.useState)(false),
41
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
42
+ inputFocused = _useState2[0],
43
+ setInputFocused = _useState2[1];
38
44
  (0, _react.useLayoutEffect)(function () {
39
45
  if (assistiveTextRef) {
40
46
  var assistiveDiv = assistiveTextRef.current;
@@ -49,21 +55,33 @@ function ElementSearch(_ref) {
49
55
  var value = _ref2.target.value;
50
56
  onSearch(value);
51
57
  };
52
- var onFocus = function onFocus(e) {};
53
- var onBlur = function onBlur(e) {};
58
+ var onFocus = function onFocus(e) {
59
+ setInputFocused(true);
60
+ };
61
+ var onBlur = function onBlur(e) {
62
+ setInputFocused(false);
63
+ };
54
64
  var getFormattedMessage = function getFormattedMessage(itemsCount) {
55
65
  if (searchTerm === '') {
56
- return "".concat(itemsCount, " ").concat(formatMessage(_messages.default.assistiveTextSuggestionsDefault));
66
+ return "".concat(formatMessage(_messages.default.assistiveTextSuggestionsDefault, {
67
+ count: itemsCount
68
+ }));
57
69
  }
58
70
  if (itemsCount > 1) {
59
- return "".concat(itemsCount, " ").concat(formatMessage(_messages.default.assistiveTextSuggestions));
71
+ return "".concat(formatMessage(_messages.default.assistiveTextSuggestions, {
72
+ count: itemsCount
73
+ }));
60
74
  }
61
75
  if (itemsCount === 1) {
62
- return "".concat(itemsCount, " ").concat(formatMessage(_messages.default.assistiveTextSuggestion));
76
+ return "".concat(formatMessage(_messages.default.assistiveTextSuggestion, {
77
+ count: itemsCount
78
+ }));
63
79
  }
64
80
  return formatMessage(_messages.default.assistiveTextSuggestionNothing);
65
81
  };
66
82
  var assistiveMessage = getFormattedMessage(items === null || items === void 0 ? void 0 : items.length);
83
+ var isInputNotFocusedAndItemSelected = !inputFocused && selectedItemIndex !== undefined;
84
+ var ariaActiveDescendant = isInputNotFocusedAndItemSelected ? "searched-item-".concat(selectedItemIndex) : undefined;
67
85
  return (0, _react2.jsx)("div", {
68
86
  css: [wrapper, mode === _types.Modes.inline && wrapperInline]
69
87
  }, (0, _react2.jsx)(_textfield.default, {
@@ -75,7 +93,8 @@ function ElementSearch(_ref) {
75
93
  onBlur: onBlur,
76
94
  elemBeforeInput: (0, _react2.jsx)("div", {
77
95
  css: elementBeforeInput,
78
- "data-testid": "element_search__element_before_input"
96
+ "data-testid": "element_search__element_before_input",
97
+ "aria-hidden": "true"
79
98
  }, (0, _react2.jsx)(_search.default, {
80
99
  size: "medium",
81
100
  label: "Advanced search",
@@ -91,6 +110,8 @@ function ElementSearch(_ref) {
91
110
  "aria-label": "search",
92
111
  "aria-labelledby": "search-assistive",
93
112
  className: "js-search-input",
113
+ role: "combobox",
114
+ "aria-activedescendant": ariaActiveDescendant,
94
115
  value: searchTerm
95
116
  }), (0, _react2.jsx)("span", {
96
117
  id: "search-assistive",
@@ -169,7 +169,8 @@ function MobileBrowser(_ref) {
169
169
  focus: focusOnSearch,
170
170
  onClick: setFocusOnSearch,
171
171
  searchTerm: searchTerm,
172
- items: items
172
+ items: items,
173
+ selectedItemIndex: selectedItemIndex
173
174
  }), showCategories && (0, _react2.jsx)("nav", {
174
175
  css: mobileCategoryListWrapper,
175
176
  tabIndex: -1
@@ -249,7 +250,8 @@ function DesktopBrowser(_ref2) {
249
250
  focus: focusOnSearch,
250
251
  onClick: setFocusOnSearch,
251
252
  searchTerm: searchTerm,
252
- items: items
253
+ items: items,
254
+ selectedItemIndex: selectedItemIndex
253
255
  })), (0, _react2.jsx)(_ElementList.default, {
254
256
  items: items,
255
257
  mode: mode,
@@ -18,17 +18,17 @@ var _default = exports.default = (0, _reactIntlNext.defineMessages)({
18
18
  },
19
19
  assistiveTextSuggestionsDefault: {
20
20
  id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
21
- defaultMessage: 'suggestions available by default.',
21
+ defaultMessage: '{count} suggestions available by default.',
22
22
  description: 'Assistive text to describe the default list of suggestions'
23
23
  },
24
24
  assistiveTextSuggestions: {
25
25
  id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
26
- defaultMessage: 'suggestions available for typed text.',
26
+ defaultMessage: '{count} suggestions available for typed text.',
27
27
  description: 'Assistive text to describe the list of suggestions filtered by typed user input, plural of fabric.editor.elementbrowser.searchbar.assistive.text.suggestion'
28
28
  },
29
29
  assistiveTextSuggestion: {
30
30
  id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestion',
31
- defaultMessage: 'suggestion available for typed text.',
31
+ defaultMessage: '{count} suggestion available for typed text.',
32
32
  description: 'Assistive text to describe the that there is one suggestion for the users typed input'
33
33
  },
34
34
  assistiveTextSuggestionNothing: {
@@ -21,6 +21,7 @@ var useMultiBodiedExtensionActions = exports.useMultiBodiedExtensionActions = fu
21
21
  var actions = _react.default.useMemo(function () {
22
22
  return {
23
23
  changeActive: function changeActive(index) {
24
+ var _possiblyMbeNode$type;
24
25
  var state = editorView.state,
25
26
  dispatch = editorView.dispatch;
26
27
  var updateActiveChildResult = updateActiveChild(index);
@@ -28,12 +29,12 @@ var useMultiBodiedExtensionActions = exports.useMultiBodiedExtensionActions = fu
28
29
  (0, _utils.sendMBEAnalyticsEvent)(_analytics.ACTION.CHANGE_ACTIVE, node, eventDispatcher);
29
30
  }
30
31
  // On selection of a childFrame, we need to change the focus/selection to the end of the target child Frame
31
- var mbeNode = state.doc.nodeAt(state.tr.selection.from);
32
+ var possiblyMbeNode = state.doc.nodeAt(state.tr.selection.from);
32
33
  var desiredPos = state.tr.selection.from || 0;
33
- if (mbeNode && mbeNode !== null && mbeNode !== void 0 && mbeNode.content) {
34
- for (var i = 0; i <= index && i < (mbeNode === null || mbeNode === void 0 || (_mbeNode$content = mbeNode.content) === null || _mbeNode$content === void 0 ? void 0 : _mbeNode$content.childCount); i++) {
35
- var _mbeNode$content, _mbeNode$content2;
36
- desiredPos += (mbeNode === null || mbeNode === void 0 || (_mbeNode$content2 = mbeNode.content) === null || _mbeNode$content2 === void 0 || (_mbeNode$content2 = _mbeNode$content2.child(i)) === null || _mbeNode$content2 === void 0 ? void 0 : _mbeNode$content2.nodeSize) || 0;
34
+ if (possiblyMbeNode && (possiblyMbeNode === null || possiblyMbeNode === void 0 || (_possiblyMbeNode$type = possiblyMbeNode.type) === null || _possiblyMbeNode$type === void 0 ? void 0 : _possiblyMbeNode$type.name) === 'multiBodiedExtension' && possiblyMbeNode !== null && possiblyMbeNode !== void 0 && possiblyMbeNode.content) {
35
+ for (var i = 0; i <= index && i < (possiblyMbeNode === null || possiblyMbeNode === void 0 || (_possiblyMbeNode$cont = possiblyMbeNode.content) === null || _possiblyMbeNode$cont === void 0 ? void 0 : _possiblyMbeNode$cont.childCount); i++) {
36
+ var _possiblyMbeNode$cont, _possiblyMbeNode$cont2;
37
+ desiredPos += (possiblyMbeNode === null || possiblyMbeNode === void 0 || (_possiblyMbeNode$cont2 = possiblyMbeNode.content) === null || _possiblyMbeNode$cont2 === void 0 || (_possiblyMbeNode$cont2 = _possiblyMbeNode$cont2.child(i)) === null || _possiblyMbeNode$cont2 === void 0 ? void 0 : _possiblyMbeNode$cont2.nodeSize) || 0;
37
38
  }
38
39
  /* desiredPos gives the cursor at the end of last child of the current frame, in case of paragraph nodes, this will be the end of the paragraph
39
40
  * Performing -1 brings the cursor inside the paragraph, similar to a user click, so any pasted text will be inside the last paragraph rather than a new line
@@ -16,6 +16,7 @@ var _react2 = require("@emotion/react");
16
16
  var _classnames = _interopRequireDefault(require("classnames"));
17
17
  var _file = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/file"));
18
18
  var _hooks = require("../../hooks");
19
+ var _MultiBodiedExtension = require("../../ui/MultiBodiedExtension");
19
20
  var _utils = require("../../utils");
20
21
  var _withPluginState = require("../../with-plugin-state");
21
22
  var _actionApi = require("./action-api");
@@ -89,7 +90,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref)
89
90
  var articleRef = _react.default.useCallback(function (node) {
90
91
  return handleContentDOMRef(node);
91
92
  }, [handleContentDOMRef]);
92
- var containerCssExtended = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n .multiBodiedExtension-content-dom-wrapper\n > [data-extension-frame='true']:nth-of-type(", ") {\n ", "\n }\n "])), _styles.mbeExtensionContainerCSS, activeChildIndex + 1, _styles.extensionFrameContentCSS);
93
+ var containerCssExtended = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n .multiBodiedExtension-content-dom-wrapper\n > [data-extension-frame='true']:nth-of-type(", ") {\n ", "\n }\n "])), _MultiBodiedExtension.sharedMultiBodiedExtensionStyles.mbeExtensionContainer, activeChildIndex + 1, _MultiBodiedExtension.sharedMultiBodiedExtensionStyles.extensionFrameContent);
93
94
  var shouldBreakout =
94
95
  // Extension should breakout when the layout is set to 'full-width' or 'wide'.
95
96
  ['full-width', 'wide'].includes(node.attrs.layout) &&
@@ -118,7 +119,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref)
118
119
  "data-active-child-index": activeChildIndex
119
120
  }, (0, _react2.jsx)("nav", {
120
121
  className: "multiBodiedExtension-navigation",
121
- css: _styles.mbeNavigationCSS,
122
+ css: _MultiBodiedExtension.sharedMultiBodiedExtensionStyles.mbeNavigation,
122
123
  "data-testid": "multiBodiedExtension-navigation"
123
124
  }, extensionHandlerResult), (0, _react2.jsx)("article", {
124
125
  className: "multiBodiedExtension--frames",
@@ -4,16 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.mbeNavigationCSS = exports.mbeExtensionWrapperCSS = exports.mbeExtensionContainerCSS = exports.extensionFrameContentCSS = void 0;
7
+ exports.mbeExtensionWrapperCSS = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
9
  var _react = require("@emotion/react");
10
- var _colors = require("@atlaskit/theme/colors");
11
10
  var _styles = require("../Extension/styles");
12
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
11
+ var _templateObject;
13
12
  // Wrapper the extension title and extensionContainer
14
- var mbeExtensionWrapperCSS = exports.mbeExtensionWrapperCSS = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n cursor: pointer;\n .extension-title {\n display: flex;\n align-items: center;\n line-height: 16px !important;\n margin-bottom: ", ";\n margin-left: ", " !important;\n margin-right: ", ";\n padding-top: ", " !important;\n }\n"])), _styles.wrapperDefault, "var(--ds-space-100, 8px)", "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)");
15
-
16
- // Wraps the navigation bar and extensionFrames
17
- var mbeExtensionContainerCSS = exports.mbeExtensionContainerCSS = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background: transpaent !important;\n padding: {\n bottom: ", " !important;\n left: ", " !important;\n right: ", " !important;\n }\n padding-bottom: ", ";\n position: relative;\n vertical-align: middle;\n cursor: pointer;\n\n .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true'] {\n display: none;\n background: ", ";\n }\n"])), "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-surface, white)");
18
- var mbeNavigationCSS = exports.mbeNavigationCSS = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n // make sure the user can't see a range selection inside the navigation\n // This is really important to keep the navigation working properly\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n\n user-select: none;\n -webkit-user-modify: read-only;\n border: 1px solid ", ";\n border-bottom: none;\n background: ", ";\n margin-left: ", ";\n margin-right: ", ";\n"])), "var(--ds-border-radius, 3px)", "var(--ds-border-radius, 3px)", "var(--ds-border, ".concat(_colors.N40, ")"), "var(--ds-surface, white)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)");
19
- var extensionFrameContentCSS = exports.extensionFrameContentCSS = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", " !important;\n border: 1px solid ", ";\n display: block;\n min-height: 100px;\n background: ", ";\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n\n margin-left: ", ";\n margin-right: ", ";\n cursor: initial;\n\n .pm-table-container {\n margin-left: ", " !important;\n padding-right: ", " !important;\n }\n .pm-table-with-controls {\n margin-left: ", " !important;\n padding-right: ", " !important;\n }\n .bodiedExtensionView-content-wrap {\n margin-top: ", " !important;\n }\n // Extension wrap have an additional margin on all four borders, so we need to adjust the spacing\n // compared to the bodiedExtensionView-content-wrap\n .extensionView-content-wrap {\n margin-top: ", " !important;\n }\n"])), "var(--ds-space-100, 8px)", "var(--ds-border, ".concat(_colors.N30, ")"), "var(--ds-surface, white)", "var(--ds-border-radius, 3px)", "var(--ds-border-radius, 3px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-200, 16px)", "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)", "var(--ds-space-100, 8px)");
13
+ var mbeExtensionWrapperCSS = exports.mbeExtensionWrapperCSS = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n cursor: pointer;\n margin-top: ", ";\n margin-bottom: ", ";\n .extension-title {\n display: flex;\n align-items: center;\n line-height: 16px !important;\n margin-bottom: ", ";\n margin-left: ", " !important;\n margin-right: ", ";\n padding-top: ", " !important;\n }\n"])), _styles.wrapperDefault, "var(--ds-space-250, 24px)", "var(--ds-space-200, 16px)", "var(--ds-space-100, 8px)", "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)");
@@ -32,5 +32,10 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
32
32
  id: 'fabric.editor.lists',
33
33
  defaultMessage: 'Lists',
34
34
  description: 'Menu shows ordered/bullet list and unordered/numbered lists'
35
+ },
36
+ listsFormat: {
37
+ id: 'fabric.editor.listsFormat',
38
+ defaultMessage: 'List formating',
39
+ description: 'Aria label for the wrapper of list buttons'
35
40
  }
36
41
  });
@@ -56,6 +56,11 @@ var toolbarMessages = exports.toolbarMessages = (0, _reactIntlNext.defineMessage
56
56
  defaultMessage: 'More formatting',
57
57
  description: 'Clicking this will show a menu with additional formatting options'
58
58
  },
59
+ textFormatting: {
60
+ id: 'fabric.editor.textFormatting',
61
+ defaultMessage: 'Text formatting',
62
+ description: 'Aria label for the wrapper of text format buttons'
63
+ },
59
64
  bold: {
60
65
  id: 'fabric.editor.bold',
61
66
  defaultMessage: 'Bold',
@@ -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 = "78.2.1";
19
+ var packageVersion = "78.3.1";
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
@@ -15,7 +15,7 @@ var _classnames2 = _interopRequireDefault(require("classnames"));
15
15
  var _reResizable = require("re-resizable");
16
16
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
17
17
  var _resizer = require("../styles/shared/resizer");
18
- var _excluded = ["width", "children", "handleClassName", "className", "handleResize", "handleResizeStart", "handleResizeStop", "handleSize", "handleAlignmentMethod", "handlePositioning", "appearance", "handleStyles", "resizeRatio", "snap", "snapGap", "isHandleVisible", "handleHighlight", "handleTooltipContent"];
18
+ var _excluded = ["width", "children", "handleClassName", "className", "handleResize", "handleResizeStart", "handleResizeStop", "handleSize", "handleAlignmentMethod", "handlePositioning", "appearance", "handleStyles", "resizeRatio", "snap", "snapGap", "isHandleVisible", "handleHighlight", "handleTooltipContent", "needExtendedResizeZone"];
19
19
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
20
  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; }
21
21
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -59,6 +59,8 @@ var ResizerNext = function ResizerNext(props, ref) {
59
59
  _props$handleHighligh = props.handleHighlight,
60
60
  handleHighlight = _props$handleHighligh === void 0 ? 'none' : _props$handleHighligh,
61
61
  handleTooltipContent = props.handleTooltipContent,
62
+ _props$needExtendedRe = props.needExtendedResizeZone,
63
+ needExtendedResizeZone = _props$needExtendedRe === void 0 ? true : _props$needExtendedRe,
62
64
  otherProps = (0, _objectWithoutProperties2.default)(props, _excluded);
63
65
  var onResizeStart = (0, _react.useCallback)(function (event) {
64
66
  // prevent creating a drag event on Firefox
@@ -111,6 +113,9 @@ var ResizerNext = function ResizerNext(props, ref) {
111
113
  'is-resizing': isResizing,
112
114
  'display-handle': isHandleVisible
113
115
  }, _resizer.resizerDangerClassName, appearance === 'danger'));
116
+ var resizerZoneClassName = (0, _classnames2.default)(_resizer.resizerHoverZoneClassName, {
117
+ 'is-extended': needExtendedResizeZone
118
+ });
114
119
  var handleComponent = (0, _react.useMemo)(function () {
115
120
  return SUPPORTED_HANDLES.reduce(function (result, position) {
116
121
  var thumb = /*#__PURE__*/_react.default.createElement("button", {
@@ -172,7 +177,7 @@ var ResizerNext = function ResizerNext(props, ref) {
172
177
  snap: snap,
173
178
  handleComponent: handleComponent
174
179
  }, otherProps), /*#__PURE__*/_react.default.createElement("span", {
175
- className: _resizer.resizerHoverZoneClassName
180
+ className: resizerZoneClassName
176
181
  }, children));
177
182
  };
178
183
  var _default = exports.default = /*#__PURE__*/(0, _react.forwardRef)(ResizerNext);
@@ -26,4 +26,4 @@ var resizerDangerClassName = exports.resizerDangerClassName = "".concat(resizerH
26
26
  var akEditorSelectedNodeClassName = 'ak-editor-selected-node';
27
27
  var handleWrapperClass = exports.handleWrapperClass = 'resizer-handle-wrapper';
28
28
  var resizerHandleZIndex = exports.resizerHandleZIndex = 1;
29
- var resizerStyles = exports.resizerStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n will-change: width;\n\n &:hover,\n &.display-handle {\n & > .", " > .", " {\n visibility: visible;\n opacity: 1;\n }\n }\n\n &.is-resizing {\n & .", " {\n background: ", ";\n }\n }\n\n &.", " {\n & .", " {\n transition: none;\n background: ", ";\n }\n }\n }\n\n .", " {\n display: flex;\n visibility: hidden;\n opacity: 0;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 7px;\n transition: visibility 0.2s, opacity 0.2s;\n\n /*\n NOTE: The below style is targeted at the div element added by the tooltip. We don't have any means of injecting styles\n into the tooltip\n */\n & div[role='presentation'] {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n margin-top: ", ";\n white-space: normal;\n }\n\n /*\n Handle Positions\n */\n &.left {\n align-items: flex-start;\n }\n &.right {\n align-items: flex-end;\n }\n\n /*\n Handle Sizing\n */\n &.small {\n & .", " {\n height: 43px;\n }\n }\n &.medium {\n & .", " {\n height: 64px;\n }\n }\n &.large {\n & .", " {\n height: 96px;\n }\n }\n\n /*\n Handle Alignment\n */\n &.sticky {\n & .", " {\n position: sticky;\n top: ", ";\n bottom: ", ";\n }\n }\n\n &:hover {\n & .", " {\n background: ", ";\n }\n\n & .", " {\n visibility: visible;\n opacity: 0.5;\n }\n }\n }\n\n .", " {\n content: ' ';\n display: flex;\n width: 3px;\n margin: 0 ", ";\n height: 64px;\n transition: background-color 0.2s;\n border-radius: 6px;\n border: 0;\n padding: 0;\n z-index: 2;\n outline: none;\n min-height: 24px;\n background: ", ";\n\n &:hover {\n cursor: col-resize;\n }\n\n &:focus {\n background: ", ";\n\n &::after {\n content: '';\n position: absolute;\n top: ", ";\n right: ", ";\n bottom: ", ";\n left: ", ";\n border: 2px solid ", ";\n border-radius: inherit;\n z-index: -1;\n }\n }\n }\n\n .", " {\n visibility: hidden;\n position: absolute;\n width: 7px;\n height: calc(100% - 40px);\n border-radius: 4px;\n opacity: 0;\n transition: background-color 0.2s, visibility 0.2s, opacity 0.2s;\n\n &.none {\n background: none;\n }\n\n &.shadow {\n background: ", ";\n }\n\n &.full-height {\n background: ", ";\n height: 100%;\n min-height: 36px;\n }\n }\n\n .", " {\n & .", " {\n background: ", ";\n }\n }\n\n .", " {\n padding: 0 ", ";\n position: relative;\n display: inline-block;\n width: 100%;\n left: ", ";\n }\n\n // This below style is here to make sure the image width is correct when nested in a table\n table .", " {\n padding: unset;\n left: unset;\n }\n"])), resizerItemClassName, handleWrapperClass, resizerHandleClassName, resizerHandleThumbClassName, "var(--ds-border-focused, ".concat(_colors.B200, ")"), resizerDangerClassName, resizerHandleThumbClassName, "var(--ds-icon-danger, ".concat(_editorSharedStyles.akEditorDeleteIconColor, ")"), resizerHandleClassName, "var(--ds-space-negative-200, -16px)", resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)", resizerHandleThumbClassName, "var(--ds-border-focused, ".concat(_colors.B200, ")"), resizerHandleTrackClassName, resizerHandleThumbClassName, "var(--ds-space-025, 2px)", "var(--ds-border, ".concat(_colors.N60, ")"), "var(--ds-border-selected, #0C66E4)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-border-focused, #388BFF)", resizerHandleTrackClassName, "var(--ds-background-selected, ".concat(_colors.B50, ")"), "var(--ds-background-selected, ".concat(_colors.B50, ")"), akEditorSelectedNodeClassName, resizerHandleThumbClassName, "var(--ds-border-focused, ".concat(_colors.B200, ")"), resizerHoverZoneClassName, "var(--ds-space-150, 12px)", "var(--ds-space-negative-150, -12px)", resizerHoverZoneClassName);
29
+ var resizerStyles = exports.resizerStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n will-change: width;\n\n &:hover,\n &.display-handle {\n & > .", " > .", " {\n visibility: visible;\n opacity: 1;\n }\n }\n\n &.is-resizing {\n & .", " {\n background: ", ";\n }\n }\n\n &.", " {\n & .", " {\n transition: none;\n background: ", ";\n }\n }\n }\n\n .", " {\n display: flex;\n visibility: hidden;\n opacity: 0;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 7px;\n transition: visibility 0.2s, opacity 0.2s;\n\n /*\n NOTE: The below style is targeted at the div element added by the tooltip. We don't have any means of injecting styles\n into the tooltip\n */\n & div[role='presentation'] {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n margin-top: ", ";\n white-space: normal;\n }\n\n /*\n Handle Positions\n */\n &.left {\n align-items: flex-start;\n }\n &.right {\n align-items: flex-end;\n }\n\n /*\n Handle Sizing\n */\n &.small {\n & .", " {\n height: 43px;\n }\n }\n &.medium {\n & .", " {\n height: 64px;\n }\n }\n &.large {\n & .", " {\n height: 96px;\n }\n }\n\n /*\n Handle Alignment\n */\n &.sticky {\n & .", " {\n position: sticky;\n top: ", ";\n bottom: ", ";\n }\n }\n\n &:hover {\n & .", " {\n background: ", ";\n }\n\n & .", " {\n visibility: visible;\n opacity: 0.5;\n }\n }\n }\n\n .", " {\n content: ' ';\n display: flex;\n width: 3px;\n margin: 0 ", ";\n height: 64px;\n transition: background-color 0.2s;\n border-radius: 6px;\n border: 0;\n padding: 0;\n z-index: 2;\n outline: none;\n min-height: 24px;\n background: ", ";\n\n &:hover {\n cursor: col-resize;\n }\n\n &:focus {\n background: ", ";\n\n &::after {\n content: '';\n position: absolute;\n top: ", ";\n right: ", ";\n bottom: ", ";\n left: ", ";\n border: 2px solid ", ";\n border-radius: inherit;\n z-index: -1;\n }\n }\n }\n\n .", " {\n visibility: hidden;\n position: absolute;\n width: 7px;\n height: calc(100% - 40px);\n border-radius: 4px;\n opacity: 0;\n transition: background-color 0.2s, visibility 0.2s, opacity 0.2s;\n\n &.none {\n background: none;\n }\n\n &.shadow {\n background: ", ";\n }\n\n &.full-height {\n background: ", ";\n height: 100%;\n min-height: 36px;\n }\n }\n\n .", " {\n & .", " {\n background: ", ";\n }\n }\n\n .", " {\n position: relative;\n display: inline-block;\n width: 100%;\n\n &.is-extended {\n padding: 0 ", ";\n left: ", ";\n }\n }\n\n // This below style is here to make sure the image width is correct when nested in a table\n table .", " {\n padding: unset;\n left: unset;\n }\n"])), resizerItemClassName, handleWrapperClass, resizerHandleClassName, resizerHandleThumbClassName, "var(--ds-border-focused, ".concat(_colors.B200, ")"), resizerDangerClassName, resizerHandleThumbClassName, "var(--ds-icon-danger, ".concat(_editorSharedStyles.akEditorDeleteIconColor, ")"), resizerHandleClassName, "var(--ds-space-negative-200, -16px)", resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)", resizerHandleThumbClassName, "var(--ds-border-focused, ".concat(_colors.B200, ")"), resizerHandleTrackClassName, resizerHandleThumbClassName, "var(--ds-space-025, 2px)", "var(--ds-border, ".concat(_colors.N60, ")"), "var(--ds-border-selected, #0C66E4)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-border-focused, #388BFF)", resizerHandleTrackClassName, "var(--ds-background-selected, ".concat(_colors.B50, ")"), "var(--ds-background-selected, ".concat(_colors.B50, ")"), akEditorSelectedNodeClassName, resizerHandleThumbClassName, "var(--ds-border-focused, ".concat(_colors.B200, ")"), resizerHoverZoneClassName, "var(--ds-space-150, 12px)", "var(--ds-space-negative-150, -12px)", resizerHoverZoneClassName);
@@ -22,7 +22,7 @@ var _templateObject, _templateObject2, _templateObject3;
22
22
  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); }; }
23
23
  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 */
24
24
  var packageName = "@atlaskit/editor-common";
25
- var packageVersion = "78.2.1";
25
+ var packageVersion = "78.3.1";
26
26
  var halfFocusRing = 1;
27
27
  var dropOffset = '0, 8';
28
28
  var DropList = /*#__PURE__*/function (_Component) {
@@ -123,7 +123,7 @@ var MediaSingleDimensionHelper = exports.MediaSingleDimensionHelper = function M
123
123
  isExtendedResizeExperienceOn = _ref.isExtendedResizeExperienceOn,
124
124
  _ref$isNestedNode = _ref.isNestedNode,
125
125
  isNestedNode = _ref$isNestedNode === void 0 ? false : _ref$isNestedNode;
126
- return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* For nested rich media items, set max-width to 100% */\n tr &,\n [data-layout-column] &,\n [data-node-type='expand'] &,\n li & {\n max-width: 100%;\n }\n\n width: ", ";\n ", "\n max-width: ", ";\n\n ", "\n\n &:not(.is-resizing) {\n transition: width 100ms ease-in;\n }\n\n float: ", ";\n margin: ", ";\n\n &[class*='not-resizing'] {\n ", "\n }\n\n ", ";\n"])), isExtendedResizeExperienceOn ? "".concat(mediaSingleWidth || width, "px") : mediaSingleWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized), layout === 'full-width' &&
126
+ return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* For nested rich media items, set max-width to 100% */\n tr &,\n [data-layout-column] &,\n [data-node-type='expand'] &,\n [data-panel-type] &,\n li & {\n max-width: 100%;\n }\n\n width: ", ";\n ", "\n max-width: ", ";\n\n ", "\n\n &:not(.is-resizing) {\n transition: width 100ms ease-in;\n }\n\n float: ", ";\n margin: ", ";\n\n &[class*='not-resizing'] {\n ", "\n }\n\n ", ";\n"])), isExtendedResizeExperienceOn ? "".concat(mediaSingleWidth || width, "px") : mediaSingleWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized), layout === 'full-width' &&
127
127
  /* This causes issues for new experience where we don't strip layout attributes
128
128
  when copying top-level node and pasting into a table/layout,
129
129
  because full-width layout will remain, causing node to be edge-to-edge */
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.sharedMultiBodiedExtensionStyles = void 0;
8
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
+ var _react = require("@emotion/react");
10
+ var _colors = require("@atlaskit/theme/colors");
11
+ var _templateObject, _templateObject2, _templateObject3;
12
+ /** @jsx jsx */
13
+ // Wraps the navigation bar and extensionFrames
14
+ var mbeExtensionContainer = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: transpaent !important;\n padding: {\n bottom: ", " !important;\n left: ", " !important;\n right: ", " !important;\n }\n padding-bottom: ", ";\n position: relative;\n vertical-align: middle;\n cursor: pointer;\n\n .multiBodiedExtension-handler-result {\n margin-left: ", ";\n }\n\n .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true'],\n .multiBodiedExtension--frames > [data-extension-frame='true'] {\n display: none;\n background: ", ";\n }\n\n .multiBodiedExtension-content-dom-wrapper,\n .multiBodiedExtension--frames {\n [data-extension-frame='true'] > :not(style):first-child,\n [data-extension-frame='true'] > style:first-child + * {\n margin-top: 0;\n }\n }\n"])), "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-surface, white)");
15
+ var mbeNavigation = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n // make sure the user can't see a range selection inside the navigation\n // This is really important to keep the navigation working properly\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n\n user-select: none;\n -webkit-user-modify: read-only;\n border: 1px solid ", ";\n border-bottom: none !important;\n background: ", ";\n margin-left: ", ";\n margin-right: ", ";\n"])), "var(--ds-border-radius, 3px)", "var(--ds-border-radius, 3px)", "var(--ds-border, ".concat(_colors.N40, ")"), "var(--ds-surface, white)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)");
16
+ var extensionFrameContent = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", " !important;\n border: 1px solid ", ";\n display: block;\n min-height: 100px;\n background: ", ";\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n\n margin-left: ", ";\n margin-right: ", ";\n cursor: initial;\n\n .pm-table-with-controls {\n margin-left: ", " !important;\n padding-right: ", " !important;\n }\n .bodiedExtensionView-content-wrap {\n margin-top: ", " !important;\n }\n // Extension wrap have an additional margin on all four borders, so we need to adjust the spacing\n // compared to the bodiedExtensionView-content-wrap\n .extensionView-content-wrap {\n margin-top: ", " !important;\n }\n .decisionItemView-content-wrap {\n margin-top: 0px !important;\n }\n\n .decisionItemView-content-wrap > [data-decision-wrapper] {\n margin-top: 0px !important;\n }\n"])), "var(--ds-space-100, 8px)", "var(--ds-border, ".concat(_colors.N30, ")"), "var(--ds-surface, white)", "var(--ds-border-radius, 3px)", "var(--ds-border-radius, 3px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)", "var(--ds-space-100, 8px)");
17
+ var sharedMultiBodiedExtensionStyles = exports.sharedMultiBodiedExtensionStyles = {
18
+ mbeExtensionContainer: mbeExtensionContainer,
19
+ mbeNavigation: mbeNavigation,
20
+ extensionFrameContent: extensionFrameContent
21
+ };
@@ -353,6 +353,12 @@ Object.defineProperty(exports, "sharedExpandStyles", {
353
353
  return _Expand.sharedExpandStyles;
354
354
  }
355
355
  });
356
+ Object.defineProperty(exports, "sharedMultiBodiedExtensionStyles", {
357
+ enumerable: true,
358
+ get: function get() {
359
+ return _MultiBodiedExtension.sharedMultiBodiedExtensionStyles;
360
+ }
361
+ });
356
362
  Object.defineProperty(exports, "snapTo", {
357
363
  enumerable: true,
358
364
  get: function get() {
@@ -415,5 +421,6 @@ var _PanelTextInput = _interopRequireDefault(require("./PanelTextInput"));
415
421
  var _announcer = _interopRequireDefault(require("./Announcer/announcer"));
416
422
  var _Toolbar = require("./Toolbar");
417
423
  var _DropList = _interopRequireDefault(require("./DropList"));
424
+ var _MultiBodiedExtension = require("./MultiBodiedExtension");
418
425
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
419
426
  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; }
@@ -187,7 +187,8 @@ export function ElementItem({
187
187
  isSelected: selected,
188
188
  "aria-describedby": title,
189
189
  ref: ref,
190
- testId: `element-item-${index}`
190
+ testId: `element-item-${index}`,
191
+ id: `searched-item-${index}`
191
192
  }, jsx(ItemContent, {
192
193
  style: inlineMode ? null : itemStyleOverrides,
193
194
  tabIndex: 0,
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import React, { memo, useLayoutEffect, useRef } from 'react';
2
+ import React, { memo, useLayoutEffect, useRef, useState } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { injectIntl } from 'react-intl-next';
5
5
  import { withAnalyticsContext } from '@atlaskit/analytics-next';
@@ -22,10 +22,12 @@ function ElementSearch({
22
22
  onClick,
23
23
  onKeyDown,
24
24
  searchTerm,
25
- items
25
+ items,
26
+ selectedItemIndex
26
27
  }) {
27
28
  const ref = useFocus(focus);
28
29
  const assistiveTextRef = useRef(null);
30
+ const [inputFocused, setInputFocused] = useState(false);
29
31
  useLayoutEffect(() => {
30
32
  if (assistiveTextRef) {
31
33
  const assistiveDiv = assistiveTextRef.current;
@@ -43,21 +45,33 @@ function ElementSearch({
43
45
  }) => {
44
46
  onSearch(value);
45
47
  };
46
- const onFocus = e => {};
47
- const onBlur = e => {};
48
+ const onFocus = e => {
49
+ setInputFocused(true);
50
+ };
51
+ const onBlur = e => {
52
+ setInputFocused(false);
53
+ };
48
54
  const getFormattedMessage = itemsCount => {
49
55
  if (searchTerm === '') {
50
- return `${itemsCount} ${formatMessage(commonMessages.assistiveTextSuggestionsDefault)}`;
56
+ return `${formatMessage(commonMessages.assistiveTextSuggestionsDefault, {
57
+ count: itemsCount
58
+ })}`;
51
59
  }
52
60
  if (itemsCount > 1) {
53
- return `${itemsCount} ${formatMessage(commonMessages.assistiveTextSuggestions)}`;
61
+ return `${formatMessage(commonMessages.assistiveTextSuggestions, {
62
+ count: itemsCount
63
+ })}`;
54
64
  }
55
65
  if (itemsCount === 1) {
56
- return `${itemsCount} ${formatMessage(commonMessages.assistiveTextSuggestion)}`;
66
+ return `${formatMessage(commonMessages.assistiveTextSuggestion, {
67
+ count: itemsCount
68
+ })}`;
57
69
  }
58
70
  return formatMessage(commonMessages.assistiveTextSuggestionNothing);
59
71
  };
60
72
  const assistiveMessage = getFormattedMessage(items === null || items === void 0 ? void 0 : items.length);
73
+ const isInputNotFocusedAndItemSelected = !inputFocused && selectedItemIndex !== undefined;
74
+ const ariaActiveDescendant = isInputNotFocusedAndItemSelected ? `searched-item-${selectedItemIndex}` : undefined;
61
75
  return jsx("div", {
62
76
  css: [wrapper, mode === Modes.inline && wrapperInline]
63
77
  }, jsx(Textfield, {
@@ -69,7 +83,8 @@ function ElementSearch({
69
83
  onBlur: onBlur,
70
84
  elemBeforeInput: jsx("div", {
71
85
  css: elementBeforeInput,
72
- "data-testid": "element_search__element_before_input"
86
+ "data-testid": "element_search__element_before_input",
87
+ "aria-hidden": "true"
73
88
  }, jsx(SearchIcon, {
74
89
  size: "medium",
75
90
  label: "Advanced search",
@@ -85,6 +100,8 @@ function ElementSearch({
85
100
  "aria-label": "search",
86
101
  "aria-labelledby": "search-assistive",
87
102
  className: "js-search-input",
103
+ role: "combobox",
104
+ "aria-activedescendant": ariaActiveDescendant,
88
105
  value: searchTerm
89
106
  }), jsx("span", {
90
107
  id: "search-assistive",
@@ -239,7 +239,8 @@ function MobileBrowser({
239
239
  focus: focusOnSearch,
240
240
  onClick: setFocusOnSearch,
241
241
  searchTerm: searchTerm,
242
- items: items
242
+ items: items,
243
+ selectedItemIndex: selectedItemIndex
243
244
  }), showCategories && jsx("nav", {
244
245
  css: mobileCategoryListWrapper,
245
246
  tabIndex: -1
@@ -320,7 +321,8 @@ function DesktopBrowser({
320
321
  focus: focusOnSearch,
321
322
  onClick: setFocusOnSearch,
322
323
  searchTerm: searchTerm,
323
- items: items
324
+ items: items,
325
+ selectedItemIndex: selectedItemIndex
324
326
  })), jsx(ElementList, {
325
327
  items: items,
326
328
  mode: mode,
@@ -12,17 +12,17 @@ export default defineMessages({
12
12
  },
13
13
  assistiveTextSuggestionsDefault: {
14
14
  id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
15
- defaultMessage: 'suggestions available by default.',
15
+ defaultMessage: '{count} suggestions available by default.',
16
16
  description: 'Assistive text to describe the default list of suggestions'
17
17
  },
18
18
  assistiveTextSuggestions: {
19
19
  id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
20
- defaultMessage: 'suggestions available for typed text.',
20
+ defaultMessage: '{count} suggestions available for typed text.',
21
21
  description: 'Assistive text to describe the list of suggestions filtered by typed user input, plural of fabric.editor.elementbrowser.searchbar.assistive.text.suggestion'
22
22
  },
23
23
  assistiveTextSuggestion: {
24
24
  id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestion',
25
- defaultMessage: 'suggestion available for typed text.',
25
+ defaultMessage: '{count} suggestion available for typed text.',
26
26
  description: 'Assistive text to describe the that there is one suggestion for the users typed input'
27
27
  },
28
28
  assistiveTextSuggestionNothing: {
@@ -12,6 +12,7 @@ export const useMultiBodiedExtensionActions = ({
12
12
  const actions = React.useMemo(() => {
13
13
  return {
14
14
  changeActive(index) {
15
+ var _possiblyMbeNode$type;
15
16
  const {
16
17
  state,
17
18
  dispatch
@@ -21,12 +22,12 @@ export const useMultiBodiedExtensionActions = ({
21
22
  sendMBEAnalyticsEvent(ACTION.CHANGE_ACTIVE, node, eventDispatcher);
22
23
  }
23
24
  // On selection of a childFrame, we need to change the focus/selection to the end of the target child Frame
24
- const mbeNode = state.doc.nodeAt(state.tr.selection.from);
25
+ const possiblyMbeNode = state.doc.nodeAt(state.tr.selection.from);
25
26
  let desiredPos = state.tr.selection.from || 0;
26
- if (mbeNode && mbeNode !== null && mbeNode !== void 0 && mbeNode.content) {
27
- for (let i = 0; i <= index && i < (mbeNode === null || mbeNode === void 0 ? void 0 : (_mbeNode$content = mbeNode.content) === null || _mbeNode$content === void 0 ? void 0 : _mbeNode$content.childCount); i++) {
28
- var _mbeNode$content, _mbeNode$content2, _mbeNode$content2$chi;
29
- desiredPos += (mbeNode === null || mbeNode === void 0 ? void 0 : (_mbeNode$content2 = mbeNode.content) === null || _mbeNode$content2 === void 0 ? void 0 : (_mbeNode$content2$chi = _mbeNode$content2.child(i)) === null || _mbeNode$content2$chi === void 0 ? void 0 : _mbeNode$content2$chi.nodeSize) || 0;
27
+ if (possiblyMbeNode && (possiblyMbeNode === null || possiblyMbeNode === void 0 ? void 0 : (_possiblyMbeNode$type = possiblyMbeNode.type) === null || _possiblyMbeNode$type === void 0 ? void 0 : _possiblyMbeNode$type.name) === 'multiBodiedExtension' && possiblyMbeNode !== null && possiblyMbeNode !== void 0 && possiblyMbeNode.content) {
28
+ for (let i = 0; i <= index && i < (possiblyMbeNode === null || possiblyMbeNode === void 0 ? void 0 : (_possiblyMbeNode$cont = possiblyMbeNode.content) === null || _possiblyMbeNode$cont === void 0 ? void 0 : _possiblyMbeNode$cont.childCount); i++) {
29
+ var _possiblyMbeNode$cont, _possiblyMbeNode$cont2, _possiblyMbeNode$cont3;
30
+ desiredPos += (possiblyMbeNode === null || possiblyMbeNode === void 0 ? void 0 : (_possiblyMbeNode$cont2 = possiblyMbeNode.content) === null || _possiblyMbeNode$cont2 === void 0 ? void 0 : (_possiblyMbeNode$cont3 = _possiblyMbeNode$cont2.child(i)) === null || _possiblyMbeNode$cont3 === void 0 ? void 0 : _possiblyMbeNode$cont3.nodeSize) || 0;
30
31
  }
31
32
  /* desiredPos gives the cursor at the end of last child of the current frame, in case of paragraph nodes, this will be the end of the paragraph
32
33
  * Performing -1 brings the cursor inside the paragraph, similar to a user click, so any pasted text will be inside the last paragraph rather than a new line