@atlaskit/editor-common 78.8.1 → 78.8.3

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 (43) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/card/MediaAndEmbedsToolbar/index.js +1 -1
  3. package/dist/cjs/element-browser/components/ElementSearch.js +45 -12
  4. package/dist/cjs/element-browser/messages.js +6 -16
  5. package/dist/cjs/extensibility/MultiBodiedExtension/action-api.js +9 -3
  6. package/dist/cjs/link/LinkSearch/LinkSearchListItem.js +35 -12
  7. package/dist/cjs/link/LinkSearch/listItemAlts.js +1 -1
  8. package/dist/cjs/messages/insert-block.js +2 -2
  9. package/dist/cjs/messages/table.js +1 -1
  10. package/dist/cjs/monitoring/error.js +1 -1
  11. package/dist/cjs/node-width/index.js +4 -1
  12. package/dist/cjs/ui/DropList/index.js +1 -1
  13. package/dist/es2019/card/MediaAndEmbedsToolbar/index.js +1 -1
  14. package/dist/es2019/element-browser/components/ElementSearch.js +39 -41
  15. package/dist/es2019/element-browser/messages.js +6 -16
  16. package/dist/es2019/extensibility/MultiBodiedExtension/action-api.js +9 -3
  17. package/dist/es2019/link/LinkSearch/LinkSearchListItem.js +32 -33
  18. package/dist/es2019/link/LinkSearch/listItemAlts.js +1 -1
  19. package/dist/es2019/messages/insert-block.js +2 -2
  20. package/dist/es2019/messages/table.js +1 -1
  21. package/dist/es2019/monitoring/error.js +1 -1
  22. package/dist/es2019/node-width/index.js +4 -1
  23. package/dist/es2019/ui/DropList/index.js +1 -1
  24. package/dist/esm/card/MediaAndEmbedsToolbar/index.js +1 -1
  25. package/dist/esm/element-browser/components/ElementSearch.js +43 -11
  26. package/dist/esm/element-browser/messages.js +6 -16
  27. package/dist/esm/extensibility/MultiBodiedExtension/action-api.js +9 -3
  28. package/dist/esm/link/LinkSearch/LinkSearchListItem.js +33 -8
  29. package/dist/esm/link/LinkSearch/listItemAlts.js +1 -1
  30. package/dist/esm/messages/insert-block.js +2 -2
  31. package/dist/esm/messages/table.js +1 -1
  32. package/dist/esm/monitoring/error.js +1 -1
  33. package/dist/esm/node-width/index.js +4 -1
  34. package/dist/esm/ui/DropList/index.js +1 -1
  35. package/dist/types/element-browser/messages.d.ts +2 -12
  36. package/dist/types/link/LinkSearch/LinkSearchListItem.d.ts +2 -2
  37. package/dist/types/link/LinkSearch/listItemAlts.d.ts +1 -1
  38. package/dist/types/node-width/index.d.ts +2 -2
  39. package/dist/types-ts4.5/element-browser/messages.d.ts +2 -12
  40. package/dist/types-ts4.5/link/LinkSearch/LinkSearchListItem.d.ts +2 -2
  41. package/dist/types-ts4.5/link/LinkSearch/listItemAlts.d.ts +1 -1
  42. package/dist/types-ts4.5/node-width/index.d.ts +2 -2
  43. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 78.8.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#77599](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/77599) [`a7b1a6b762eb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a7b1a6b762eb) - [ux] Table picker popup displays text using column x rows pattern and table picker button uses label column by row.
8
+ - [#75436](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75436) [`bfcf32bb4fa3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bfcf32bb4fa3) - [ux] ED-21941 Disable resize/layout options for table, media and extension when added to MBE. Table rendering fixed for Confluence editor
9
+ - [#77543](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/77543) [`5b4b40dddddf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5b4b40dddddf) - Updates default message of Background color option in table's menus
10
+
11
+ ## 78.8.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [#75915](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75915) [`2d614b4e4dab`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2d614b4e4dab) - ED-22271 Adding cursor selections to MBE APIs
16
+
3
17
  ## 78.8.1
4
18
 
5
19
  ### Patch Changes
@@ -145,7 +145,7 @@ var mapIconsToToolbarItem = function mapIconsToToolbarItem(icons, layout, intl,
145
145
  };
146
146
  var shouldHideLayoutToolbar = function shouldHideLayoutToolbar(selection, _ref2, allowResizingInTables) {
147
147
  var nodes = _ref2.nodes;
148
- return (0, _utils.hasParentNodeOfType)([nodes.bodiedExtension, nodes.listItem, nodes.expand, nodes.nestedExpand].concat((0, _toConsumableArray2.default)(allowResizingInTables ? [] : [nodes.table])).filter(Boolean))(selection);
148
+ return (0, _utils.hasParentNodeOfType)([nodes.bodiedExtension, nodes.extensionFrame, nodes.listItem, nodes.expand, nodes.nestedExpand].concat((0, _toConsumableArray2.default)(allowResizingInTables ? [] : [nodes.table])).filter(Boolean))(selection);
149
149
  };
150
150
  var buildLayoutButtons = function buildLayoutButtons(state, intl, nodeType, widthPluginDependencyApi, analyticsApi, allowResizing, allowResizingInTables) {
151
151
  var allowWrapping = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
10
  var _react = _interopRequireWildcard(require("react"));
12
11
  var _react2 = require("@emotion/react");
@@ -21,10 +20,10 @@ var _constants = require("../constants");
21
20
  var _useFocus = _interopRequireDefault(require("../hooks/use-focus"));
22
21
  var _messages = _interopRequireDefault(require("../messages"));
23
22
  var _types = require("../types");
24
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
25
- /** @jsx jsx */
26
23
  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); }
27
24
  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; }
25
+ /** @jsx jsx */
26
+
28
27
  function ElementSearch(_ref) {
29
28
  var onSearch = _ref.onSearch,
30
29
  mode = _ref.mode,
@@ -63,21 +62,23 @@ function ElementSearch(_ref) {
63
62
  };
64
63
  var getFormattedMessage = function getFormattedMessage(itemsCount) {
65
64
  if (searchTerm === '') {
66
- return "".concat(formatMessage(_messages.default.assistiveTextSuggestionsDefault, {
65
+ return "".concat(formatMessage(_messages.default.assistiveTextDefault, {
67
66
  count: itemsCount
68
67
  }));
69
68
  }
70
69
  if (itemsCount > 1) {
71
- return "".concat(formatMessage(_messages.default.assistiveTextSuggestions, {
70
+ return "".concat(formatMessage(_messages.default.assistiveTextResult, {
72
71
  count: itemsCount
73
72
  }));
74
73
  }
75
74
  if (itemsCount === 1) {
76
- return "".concat(formatMessage(_messages.default.assistiveTextSuggestion, {
75
+ return "".concat(formatMessage(_messages.default.assistiveTextResult, {
77
76
  count: itemsCount
78
77
  }));
79
78
  }
80
- return formatMessage(_messages.default.assistiveTextSuggestionNothing);
79
+ return formatMessage(_messages.default.assistiveTextResult, {
80
+ count: itemsCount
81
+ });
81
82
  };
82
83
  var assistiveMessage = getFormattedMessage(items === null || items === void 0 ? void 0 : items.length);
83
84
  var isInputNotFocusedAndItemSelected = !inputFocused && selectedItemIndex !== undefined;
@@ -121,11 +122,43 @@ function ElementSearch(_ref) {
121
122
  className: "assistive"
122
123
  }, assistiveMessage));
123
124
  }
124
- var styledShortcut = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n padding: ", "px ", "px;\n width: ", "px;\n"])), _shortcut.shortcutStyle, _constants.GRID_SIZE / 2, _constants.GRID_SIZE, _constants.GRID_SIZE * 6);
125
- var wrapper = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n & > [data-ds--text-field--container] {\n height: ", "px;\n border-radius: ", "px;\n flex: 1 1 100%;\n overflow: visible;\n & > [data-ds--text-field--input] {\n margin-bottom: 3px;\n font-size: ", ";\n padding: ", "px ", " ", "px 0;\n }\n }\n"])), _constants.GRID_SIZE * 6, _constants.GRID_SIZE, (0, _editorSharedStyles.relativeFontSizeToBase16)(14), _constants.GRID_SIZE, "var(--ds-space-075, 6px)", _constants.GRID_SIZE);
126
- var wrapperInline = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n & > [data-ds--text-field--container] {\n height: ", "px;\n flex: none;\n overflow: revert;\n }\n"])), _constants.GRID_SIZE * 5);
127
- var elementBeforeInput = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n margin: 1px ", " 0 ", ";\n color: ", ";\n\n // Custom SearchIcon style\n span,\n svg {\n height: 20px;\n width: 20px;\n }\n"])), "var(--ds-space-075, 6px)", "var(--ds-space-100, 8px)", "var(--ds-icon, ".concat(_colors.N200, ")"));
128
- var elementAfterInput = (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 ", ";\n height: ", ";\n text-align: center;\n"])), "var(--ds-space-100, 8px)", _constants.SEARCH_ITEM_HEIGHT_WIDTH);
125
+ var styledShortcut = (0, _react2.css)(_shortcut.shortcutStyle, {
126
+ padding: "".concat(_constants.GRID_SIZE / 2, "px ").concat(_constants.GRID_SIZE, "px"),
127
+ width: "".concat(_constants.GRID_SIZE * 6, "px")
128
+ });
129
+ var wrapper = (0, _react2.css)({
130
+ '& > [data-ds--text-field--container]': {
131
+ height: "".concat(_constants.GRID_SIZE * 6, "px"),
132
+ borderRadius: "".concat(_constants.GRID_SIZE, "px"),
133
+ flex: '1 1 100%',
134
+ overflow: 'visible',
135
+ '& > [data-ds--text-field--input]': {
136
+ marginBottom: '3px',
137
+ fontSize: (0, _editorSharedStyles.relativeFontSizeToBase16)(14),
138
+ padding: "".concat(_constants.GRID_SIZE, "px ", "var(--ds-space-075, 6px)", " ").concat(_constants.GRID_SIZE, "px 0")
139
+ }
140
+ }
141
+ });
142
+ var wrapperInline = (0, _react2.css)({
143
+ '& > [data-ds--text-field--container]': {
144
+ height: "".concat(_constants.GRID_SIZE * 5, "px"),
145
+ flex: 'none',
146
+ overflow: 'revert'
147
+ }
148
+ });
149
+ var elementBeforeInput = (0, _react2.css)({
150
+ margin: "1px ".concat("var(--ds-space-075, 6px)", " 0 ", "var(--ds-space-100, 8px)"),
151
+ color: "var(--ds-icon, ".concat(_colors.N200, ")"),
152
+ 'span, svg': {
153
+ height: '20px',
154
+ width: '20px'
155
+ }
156
+ });
157
+ var elementAfterInput = (0, _react2.css)({
158
+ margin: "0 ".concat("var(--ds-space-100, 8px)"),
159
+ height: _constants.SEARCH_ITEM_HEIGHT_WIDTH,
160
+ textAlign: 'center'
161
+ });
129
162
  var MemoizedElementSearchWithAnalytics = /*#__PURE__*/(0, _react.memo)((0, _analyticsNext.withAnalyticsContext)({
130
163
  component: 'Searchbar'
131
164
  })((0, _reactIntlNext.injectIntl)(ElementSearch)));
@@ -16,24 +16,14 @@ var _default = exports.default = (0, _reactIntlNext.defineMessages)({
16
16
  defaultMessage: 'Search',
17
17
  description: 'Search field placeholder'
18
18
  },
19
- assistiveTextSuggestionsDefault: {
20
- id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
19
+ assistiveTextDefault: {
20
+ id: 'fabric.editor.elementbrowser.searchbar.assistive.text.default',
21
21
  defaultMessage: '{count} suggestions available by default.',
22
22
  description: 'Assistive text to describe the default list of suggestions'
23
23
  },
24
- assistiveTextSuggestions: {
25
- id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
26
- defaultMessage: '{count} suggestions available for typed text.',
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
- },
29
- assistiveTextSuggestion: {
30
- id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestion',
31
- defaultMessage: '{count} suggestion available for typed text.',
32
- description: 'Assistive text to describe the that there is one suggestion for the users typed input'
33
- },
34
- assistiveTextSuggestionNothing: {
35
- id: 'fabric.editor.elementbrowser.searchbar.assistive.text.nothing',
36
- defaultMessage: 'Nothing matches your search',
37
- description: 'Assistive text to describe that no suggestions match the users typed input'
24
+ assistiveTextResult: {
25
+ id: 'fabric.editor.elementbrowser.searchbar.assistive.text.result',
26
+ defaultMessage: '{count, plural, =0 {Nothing matches your search} one {{count} suggestion available for typed text.} other {{count} suggestions available for typed text.}}',
27
+ description: 'Assistive text to describe the list of suggestions filtered by typed user input'
38
28
  }
39
29
  });
@@ -29,8 +29,12 @@ var useMultiBodiedExtensionActions = exports.useMultiBodiedExtensionActions = fu
29
29
  (0, _utils.sendMBEAnalyticsEvent)(_analytics.ACTION.CHANGE_ACTIVE, node, eventDispatcher);
30
30
  }
31
31
  // On selection of a childFrame, we need to change the focus/selection to the end of the target child Frame
32
- var possiblyMbeNode = state.doc.nodeAt(state.tr.selection.from);
33
- var desiredPos = state.tr.selection.from || 0;
32
+ var pos = getPos();
33
+ if (typeof pos !== 'number') {
34
+ return updateActiveChildResult;
35
+ }
36
+ var possiblyMbeNode = state.doc.nodeAt(pos);
37
+ var desiredPos = pos;
34
38
  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
39
  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
40
  var _possiblyMbeNode$cont, _possiblyMbeNode$cont2;
@@ -59,7 +63,9 @@ var useMultiBodiedExtensionActions = exports.useMultiBodiedExtensionActions = fu
59
63
  throw new Error('Could not create frame or position not valid');
60
64
  }
61
65
  var insertAt = Math.min((pos || 1) + node.content.size, state.doc.content.size);
62
- dispatch(state.tr.insert(insertAt, frame));
66
+ var tr = state.tr.insert(insertAt, frame);
67
+ tr.setSelection(new _state.TextSelection(tr.doc.resolve(insertAt + 1)));
68
+ dispatch(tr);
63
69
  if (eventDispatcher) {
64
70
  (0, _utils.sendMBEAnalyticsEvent)(_analytics.ACTION.ADD_CHILD, node, eventDispatcher);
65
71
  }
@@ -13,7 +13,6 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
13
13
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
14
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
17
16
  var _react = _interopRequireWildcard(require("react"));
18
17
  var _react2 = require("@emotion/react");
19
18
  var _reactIntlNext = require("react-intl-next");
@@ -22,20 +21,44 @@ var _colors = require("@atlaskit/theme/colors");
22
21
  var _constants = require("@atlaskit/theme/constants");
23
22
  var _listItemAlts = require("./listItemAlts");
24
23
  var _transformTimeStamp = require("./transformTimeStamp");
25
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
26
- /** @jsx jsx */
27
- // AFP-2532 TODO: Fix automatic suppressions below
28
- // eslint-disable-next-line @atlassian/tangerine/import/entry-points
29
24
  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); }
30
25
  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; }
31
26
  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); }; }
32
- 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; } }
33
- var container = exports.container = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: transparent;\n padding: ", " ", ";\n cursor: pointer;\n display: flex;\n margin-top: 0;\n"])), "var(--ds-space-100, 8px)", "var(--ds-space-150, 12px)");
34
- var containerSelected = exports.containerSelected = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n"])), "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N20, ")"));
35
- var nameWrapper = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n overflow: hidden;\n"])));
36
- var nameStyle = exports.nameStyle = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n line-height: 20px;\n"])), "var(--ds-text, ".concat(_colors.N800, ")"));
37
- var containerName = exports.containerName = (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n line-height: 14px;\n font-size: ", ";\n"])), "var(--ds-text-subtlest, ".concat(_colors.N300, ")"), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSizeSmall)()));
38
- var iconStyle = (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n min-width: 16px;\n margin-top: 3px;\n margin-right: ", ";\n\n img {\n max-width: 16px;\n }\n"])), "var(--ds-space-150, 12px)");
27
+ 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 */ // AFP-2532 TODO: Fix automatic suppressions below
28
+ // eslint-disable-next-line @atlassian/tangerine/import/entry-points
29
+ var container = exports.container = (0, _react2.css)({
30
+ backgroundColor: 'transparent',
31
+ padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-150, 12px)"),
32
+ cursor: 'pointer',
33
+ display: 'flex',
34
+ marginTop: 0
35
+ });
36
+ var containerSelected = exports.containerSelected = (0, _react2.css)({
37
+ backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N20, ")")
38
+ });
39
+ var nameWrapper = (0, _react2.css)({
40
+ overflow: 'hidden'
41
+ });
42
+ var nameStyle = exports.nameStyle = (0, _react2.css)({
43
+ color: "var(--ds-text, ".concat(_colors.N800, ")"),
44
+ overflow: 'hidden',
45
+ textOverflow: 'ellipsis',
46
+ whiteSpace: 'nowrap',
47
+ lineHeight: '20px'
48
+ });
49
+ var containerName = exports.containerName = (0, _react2.css)({
50
+ color: "var(--ds-text-subtlest, ".concat(_colors.N300, ")"),
51
+ lineHeight: '14px',
52
+ fontSize: (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSizeSmall)())
53
+ });
54
+ var iconStyle = (0, _react2.css)({
55
+ minWidth: '16px',
56
+ marginTop: '3px',
57
+ marginRight: "var(--ds-space-150, 12px)",
58
+ img: {
59
+ maxWidth: '16px'
60
+ }
61
+ });
39
62
  var LinkSearchListItem = /*#__PURE__*/function (_React$PureComponent) {
40
63
  (0, _inherits2.default)(LinkSearchListItem, _React$PureComponent);
41
64
  var _super = _createSuper(LinkSearchListItem);
@@ -38,7 +38,7 @@ var messages = (0, _reactIntlNext.defineMessages)({
38
38
  },
39
39
  defaultAltText: {
40
40
  id: 'fabric.editor.defaultAltText',
41
- defaultMessage: 'List item',
41
+ defaultMessage: 'Document',
42
42
  description: 'Default alt text for ListItem image'
43
43
  }
44
44
  });
@@ -88,8 +88,8 @@ var toolbarInsertBlockMessages = exports.toolbarInsertBlockMessages = (0, _react
88
88
  },
89
89
  tableSizeSelectorButton: {
90
90
  id: 'fabric.editor.tableSizeSelectorButton',
91
- defaultMessage: 'Create table of size',
92
- description: 'Creates table popup grid of defined size'
91
+ defaultMessage: '{numberOfColumns} by {numberOfRows}',
92
+ description: 'Creates a table of custom size'
93
93
  },
94
94
  tableSizeSelectorPopup: {
95
95
  id: 'fabric.editor.tableSizeSelectorPopup',
@@ -173,7 +173,7 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
173
173
  },
174
174
  backgroundColor: {
175
175
  id: 'fabric.editor.backgroundColor',
176
- defaultMessage: 'Background Color',
176
+ defaultMessage: 'Background color',
177
177
  description: 'Change the background color of a table cell.'
178
178
  },
179
179
  mergeCells: {
@@ -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.8.1";
19
+ var packageVersion = "78.8.3";
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
@@ -73,6 +73,9 @@ var getParentNodeWidth = exports.getParentNodeWidth = function getParentNodeWidt
73
73
  case schema.nodes.bodiedExtension:
74
74
  parentWidth -= _extension.BODIED_EXT_PADDING * 2;
75
75
  break;
76
+ case schema.nodes.extensionFrame:
77
+ parentWidth -= _extension.BODIED_EXT_PADDING * 2;
78
+ break;
76
79
 
77
80
  // TODO: Migrate away from gridSize
78
81
  // Recommendation: Replace gridSize with 8
@@ -96,7 +99,7 @@ var getNestedParentNode = function getNestedParentNode(tablePos, state) {
96
99
  return null;
97
100
  }
98
101
  var $pos = state.doc.resolve(tablePos);
99
- var parent = (0, _utils.findParentNodeOfTypeClosestToPos)($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.layoutSection, state.schema.nodes.expand]);
102
+ var parent = (0, _utils.findParentNodeOfTypeClosestToPos)($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand]);
100
103
  return parent ? parent.node : null;
101
104
  };
102
105
  var calcBreakoutNodeWidth = function calcBreakoutNodeWidth(layout, containerWidth, isFullWidthModeEnabled) {
@@ -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.8.1";
25
+ var packageVersion = "78.8.3";
26
26
  var halfFocusRing = 1;
27
27
  var dropOffset = '0, 8';
28
28
  var DropList = /*#__PURE__*/function (_Component) {
@@ -152,7 +152,7 @@ const mapIconsToToolbarItem = (icons, layout, intl, nodeType, widthPluginDepende
152
152
  const shouldHideLayoutToolbar = (selection, {
153
153
  nodes
154
154
  }, allowResizingInTables) => {
155
- return hasParentNodeOfType([nodes.bodiedExtension, nodes.listItem, nodes.expand, nodes.nestedExpand, ...(allowResizingInTables ? [] : [nodes.table])].filter(Boolean))(selection);
155
+ return hasParentNodeOfType([nodes.bodiedExtension, nodes.extensionFrame, nodes.listItem, nodes.expand, nodes.nestedExpand, ...(allowResizingInTables ? [] : [nodes.table])].filter(Boolean))(selection);
156
156
  };
157
157
  const buildLayoutButtons = (state, intl, nodeType, widthPluginDependencyApi, analyticsApi, allowResizing, allowResizingInTables, allowWrapping = true, allowAlignment = true, isChangingLayoutDisabled) => {
158
158
  const {
@@ -53,21 +53,23 @@ function ElementSearch({
53
53
  };
54
54
  const getFormattedMessage = itemsCount => {
55
55
  if (searchTerm === '') {
56
- return `${formatMessage(commonMessages.assistiveTextSuggestionsDefault, {
56
+ return `${formatMessage(commonMessages.assistiveTextDefault, {
57
57
  count: itemsCount
58
58
  })}`;
59
59
  }
60
60
  if (itemsCount > 1) {
61
- return `${formatMessage(commonMessages.assistiveTextSuggestions, {
61
+ return `${formatMessage(commonMessages.assistiveTextResult, {
62
62
  count: itemsCount
63
63
  })}`;
64
64
  }
65
65
  if (itemsCount === 1) {
66
- return `${formatMessage(commonMessages.assistiveTextSuggestion, {
66
+ return `${formatMessage(commonMessages.assistiveTextResult, {
67
67
  count: itemsCount
68
68
  })}`;
69
69
  }
70
- return formatMessage(commonMessages.assistiveTextSuggestionNothing);
70
+ return formatMessage(commonMessages.assistiveTextResult, {
71
+ count: itemsCount
72
+ });
71
73
  };
72
74
  const assistiveMessage = getFormattedMessage(items === null || items === void 0 ? void 0 : items.length);
73
75
  const isInputNotFocusedAndItemSelected = !inputFocused && selectedItemIndex !== undefined;
@@ -111,47 +113,43 @@ function ElementSearch({
111
113
  className: "assistive"
112
114
  }, assistiveMessage));
113
115
  }
114
- const styledShortcut = css`
115
- ${shortcutStyle}
116
- padding: ${GRID_SIZE / 2}px ${GRID_SIZE}px;
117
- width: ${GRID_SIZE * 6}px;
118
- `;
119
- const wrapper = css`
120
- & > [data-ds--text-field--container] {
121
- height: ${GRID_SIZE * 6}px;
122
- border-radius: ${GRID_SIZE}px;
123
- flex: 1 1 100%;
124
- overflow: visible;
125
- & > [data-ds--text-field--input] {
126
- margin-bottom: 3px;
127
- font-size: ${relativeFontSizeToBase16(14)};
128
- padding: ${GRID_SIZE}px ${"var(--ds-space-075, 6px)"} ${GRID_SIZE}px 0;
116
+ const styledShortcut = css(shortcutStyle, {
117
+ padding: `${GRID_SIZE / 2}px ${GRID_SIZE}px`,
118
+ width: `${GRID_SIZE * 6}px`
119
+ });
120
+ const wrapper = css({
121
+ '& > [data-ds--text-field--container]': {
122
+ height: `${GRID_SIZE * 6}px`,
123
+ borderRadius: `${GRID_SIZE}px`,
124
+ flex: '1 1 100%',
125
+ overflow: 'visible',
126
+ '& > [data-ds--text-field--input]': {
127
+ marginBottom: '3px',
128
+ fontSize: relativeFontSizeToBase16(14),
129
+ padding: `${GRID_SIZE}px ${"var(--ds-space-075, 6px)"} ${GRID_SIZE}px 0`
129
130
  }
130
131
  }
131
- `;
132
- const wrapperInline = css`
133
- & > [data-ds--text-field--container] {
134
- height: ${GRID_SIZE * 5}px;
135
- flex: none;
136
- overflow: revert;
132
+ });
133
+ const wrapperInline = css({
134
+ '& > [data-ds--text-field--container]': {
135
+ height: `${GRID_SIZE * 5}px`,
136
+ flex: 'none',
137
+ overflow: 'revert'
137
138
  }
138
- `;
139
- const elementBeforeInput = css`
140
- margin: 1px ${"var(--ds-space-075, 6px)"} 0 ${"var(--ds-space-100, 8px)"};
141
- color: ${`var(--ds-icon, ${N200})`};
142
-
143
- // Custom SearchIcon style
144
- span,
145
- svg {
146
- height: 20px;
147
- width: 20px;
139
+ });
140
+ const elementBeforeInput = css({
141
+ margin: `1px ${"var(--ds-space-075, 6px)"} 0 ${"var(--ds-space-100, 8px)"}`,
142
+ color: `var(--ds-icon, ${N200})`,
143
+ 'span, svg': {
144
+ height: '20px',
145
+ width: '20px'
148
146
  }
149
- `;
150
- const elementAfterInput = css`
151
- margin: 0 ${"var(--ds-space-100, 8px)"};
152
- height: ${SEARCH_ITEM_HEIGHT_WIDTH};
153
- text-align: center;
154
- `;
147
+ });
148
+ const elementAfterInput = css({
149
+ margin: `0 ${"var(--ds-space-100, 8px)"}`,
150
+ height: SEARCH_ITEM_HEIGHT_WIDTH,
151
+ textAlign: 'center'
152
+ });
155
153
  const MemoizedElementSearchWithAnalytics = /*#__PURE__*/memo(withAnalyticsContext({
156
154
  component: 'Searchbar'
157
155
  })(injectIntl(ElementSearch)));
@@ -10,24 +10,14 @@ export default defineMessages({
10
10
  defaultMessage: 'Search',
11
11
  description: 'Search field placeholder'
12
12
  },
13
- assistiveTextSuggestionsDefault: {
14
- id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
13
+ assistiveTextDefault: {
14
+ id: 'fabric.editor.elementbrowser.searchbar.assistive.text.default',
15
15
  defaultMessage: '{count} suggestions available by default.',
16
16
  description: 'Assistive text to describe the default list of suggestions'
17
17
  },
18
- assistiveTextSuggestions: {
19
- id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
20
- defaultMessage: '{count} suggestions available for typed text.',
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
- },
23
- assistiveTextSuggestion: {
24
- id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestion',
25
- defaultMessage: '{count} suggestion available for typed text.',
26
- description: 'Assistive text to describe the that there is one suggestion for the users typed input'
27
- },
28
- assistiveTextSuggestionNothing: {
29
- id: 'fabric.editor.elementbrowser.searchbar.assistive.text.nothing',
30
- defaultMessage: 'Nothing matches your search',
31
- description: 'Assistive text to describe that no suggestions match the users typed input'
18
+ assistiveTextResult: {
19
+ id: 'fabric.editor.elementbrowser.searchbar.assistive.text.result',
20
+ defaultMessage: '{count, plural, =0 {Nothing matches your search} one {{count} suggestion available for typed text.} other {{count} suggestions available for typed text.}}',
21
+ description: 'Assistive text to describe the list of suggestions filtered by typed user input'
32
22
  }
33
23
  });
@@ -22,8 +22,12 @@ export const useMultiBodiedExtensionActions = ({
22
22
  sendMBEAnalyticsEvent(ACTION.CHANGE_ACTIVE, node, eventDispatcher);
23
23
  }
24
24
  // On selection of a childFrame, we need to change the focus/selection to the end of the target child Frame
25
- const possiblyMbeNode = state.doc.nodeAt(state.tr.selection.from);
26
- let desiredPos = state.tr.selection.from || 0;
25
+ const pos = getPos();
26
+ if (typeof pos !== 'number') {
27
+ return updateActiveChildResult;
28
+ }
29
+ const possiblyMbeNode = state.doc.nodeAt(pos);
30
+ let desiredPos = pos;
27
31
  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
32
  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
33
  var _possiblyMbeNode$cont, _possiblyMbeNode$cont2, _possiblyMbeNode$cont3;
@@ -54,7 +58,9 @@ export const useMultiBodiedExtensionActions = ({
54
58
  throw new Error('Could not create frame or position not valid');
55
59
  }
56
60
  const insertAt = Math.min((pos || 1) + node.content.size, state.doc.content.size);
57
- dispatch(state.tr.insert(insertAt, frame));
61
+ const tr = state.tr.insert(insertAt, frame);
62
+ tr.setSelection(new TextSelection(tr.doc.resolve(insertAt + 1)));
63
+ dispatch(tr);
58
64
  if (eventDispatcher) {
59
65
  sendMBEAnalyticsEvent(ACTION.ADD_CHILD, node, eventDispatcher);
60
66
  }
@@ -10,40 +10,39 @@ import { N20, N300, N800 } from '@atlaskit/theme/colors';
10
10
  import { fontSizeSmall } from '@atlaskit/theme/constants';
11
11
  import { getCorrectAltByIconUrl } from './listItemAlts';
12
12
  import { transformTimeStamp } from './transformTimeStamp';
13
- export const container = css`
14
- background-color: transparent;
15
- padding: ${"var(--ds-space-100, 8px)"} ${"var(--ds-space-150, 12px)"};
16
- cursor: pointer;
17
- display: flex;
18
- margin-top: 0;
19
- `;
20
- export const containerSelected = css`
21
- background-color: ${`var(--ds-background-neutral-subtle-hovered, ${N20})`};
22
- `;
23
- const nameWrapper = css`
24
- overflow: hidden;
25
- `;
26
- export const nameStyle = css`
27
- color: ${`var(--ds-text, ${N800})`};
28
- overflow: hidden;
29
- text-overflow: ellipsis;
30
- white-space: nowrap;
31
- line-height: 20px;
32
- `;
33
- export const containerName = css`
34
- color: ${`var(--ds-text-subtlest, ${N300})`};
35
- line-height: 14px;
36
- font-size: ${relativeFontSizeToBase16(fontSizeSmall())};
37
- `;
38
- const iconStyle = css`
39
- min-width: 16px;
40
- margin-top: 3px;
41
- margin-right: ${"var(--ds-space-150, 12px)"};
42
-
43
- img {
44
- max-width: 16px;
13
+ export const container = css({
14
+ backgroundColor: 'transparent',
15
+ padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-150, 12px)"}`,
16
+ cursor: 'pointer',
17
+ display: 'flex',
18
+ marginTop: 0
19
+ });
20
+ export const containerSelected = css({
21
+ backgroundColor: `var(--ds-background-neutral-subtle-hovered, ${N20})`
22
+ });
23
+ const nameWrapper = css({
24
+ overflow: 'hidden'
25
+ });
26
+ export const nameStyle = css({
27
+ color: `var(--ds-text, ${N800})`,
28
+ overflow: 'hidden',
29
+ textOverflow: 'ellipsis',
30
+ whiteSpace: 'nowrap',
31
+ lineHeight: '20px'
32
+ });
33
+ export const containerName = css({
34
+ color: `var(--ds-text-subtlest, ${N300})`,
35
+ lineHeight: '14px',
36
+ fontSize: relativeFontSizeToBase16(fontSizeSmall())
37
+ });
38
+ const iconStyle = css({
39
+ minWidth: '16px',
40
+ marginTop: '3px',
41
+ marginRight: "var(--ds-space-150, 12px)",
42
+ img: {
43
+ maxWidth: '16px'
45
44
  }
46
- `;
45
+ });
47
46
  class LinkSearchListItem extends React.PureComponent {
48
47
  constructor(...args) {
49
48
  super(...args);
@@ -32,7 +32,7 @@ const messages = defineMessages({
32
32
  },
33
33
  defaultAltText: {
34
34
  id: 'fabric.editor.defaultAltText',
35
- defaultMessage: 'List item',
35
+ defaultMessage: 'Document',
36
36
  description: 'Default alt text for ListItem image'
37
37
  }
38
38
  });
@@ -82,8 +82,8 @@ export const toolbarInsertBlockMessages = defineMessages({
82
82
  },
83
83
  tableSizeSelectorButton: {
84
84
  id: 'fabric.editor.tableSizeSelectorButton',
85
- defaultMessage: 'Create table of size',
86
- description: 'Creates table popup grid of defined size'
85
+ defaultMessage: '{numberOfColumns} by {numberOfRows}',
86
+ description: 'Creates a table of custom size'
87
87
  },
88
88
  tableSizeSelectorPopup: {
89
89
  id: 'fabric.editor.tableSizeSelectorPopup',
@@ -167,7 +167,7 @@ export const messages = defineMessages({
167
167
  },
168
168
  backgroundColor: {
169
169
  id: 'fabric.editor.backgroundColor',
170
- defaultMessage: 'Background Color',
170
+ defaultMessage: 'Background color',
171
171
  description: 'Change the background color of a table cell.'
172
172
  },
173
173
  mergeCells: {
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "78.8.1";
3
+ const packageVersion = "78.8.3";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -68,6 +68,9 @@ export const getParentNodeWidth = (pos, state, containerWidth, isFullWidthModeEn
68
68
  case schema.nodes.bodiedExtension:
69
69
  parentWidth -= BODIED_EXT_PADDING * 2;
70
70
  break;
71
+ case schema.nodes.extensionFrame:
72
+ parentWidth -= BODIED_EXT_PADDING * 2;
73
+ break;
71
74
 
72
75
  // TODO: Migrate away from gridSize
73
76
  // Recommendation: Replace gridSize with 8
@@ -91,7 +94,7 @@ const getNestedParentNode = (tablePos, state) => {
91
94
  return null;
92
95
  }
93
96
  const $pos = state.doc.resolve(tablePos);
94
- const parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.layoutSection, state.schema.nodes.expand]);
97
+ const parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand]);
95
98
  return parent ? parent.node : null;
96
99
  };
97
100
  const calcBreakoutNodeWidth = (layout, containerWidth, isFullWidthModeEnabled) => {
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
7
7
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
8
8
  import Layer from '../Layer';
9
9
  const packageName = "@atlaskit/editor-common";
10
- const packageVersion = "78.8.1";
10
+ const packageVersion = "78.8.3";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {
@@ -135,7 +135,7 @@ var mapIconsToToolbarItem = function mapIconsToToolbarItem(icons, layout, intl,
135
135
  };
136
136
  var shouldHideLayoutToolbar = function shouldHideLayoutToolbar(selection, _ref2, allowResizingInTables) {
137
137
  var nodes = _ref2.nodes;
138
- return hasParentNodeOfType([nodes.bodiedExtension, nodes.listItem, nodes.expand, nodes.nestedExpand].concat(_toConsumableArray(allowResizingInTables ? [] : [nodes.table])).filter(Boolean))(selection);
138
+ return hasParentNodeOfType([nodes.bodiedExtension, nodes.extensionFrame, nodes.listItem, nodes.expand, nodes.nestedExpand].concat(_toConsumableArray(allowResizingInTables ? [] : [nodes.table])).filter(Boolean))(selection);
139
139
  };
140
140
  var buildLayoutButtons = function buildLayoutButtons(state, intl, nodeType, widthPluginDependencyApi, analyticsApi, allowResizing, allowResizingInTables) {
141
141
  var allowWrapping = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
@@ -1,6 +1,4 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
4
2
  /** @jsx jsx */
5
3
  import React, { memo, useLayoutEffect, useRef, useState } from 'react';
6
4
  import { css, jsx } from '@emotion/react';
@@ -53,21 +51,23 @@ function ElementSearch(_ref) {
53
51
  };
54
52
  var getFormattedMessage = function getFormattedMessage(itemsCount) {
55
53
  if (searchTerm === '') {
56
- return "".concat(formatMessage(commonMessages.assistiveTextSuggestionsDefault, {
54
+ return "".concat(formatMessage(commonMessages.assistiveTextDefault, {
57
55
  count: itemsCount
58
56
  }));
59
57
  }
60
58
  if (itemsCount > 1) {
61
- return "".concat(formatMessage(commonMessages.assistiveTextSuggestions, {
59
+ return "".concat(formatMessage(commonMessages.assistiveTextResult, {
62
60
  count: itemsCount
63
61
  }));
64
62
  }
65
63
  if (itemsCount === 1) {
66
- return "".concat(formatMessage(commonMessages.assistiveTextSuggestion, {
64
+ return "".concat(formatMessage(commonMessages.assistiveTextResult, {
67
65
  count: itemsCount
68
66
  }));
69
67
  }
70
- return formatMessage(commonMessages.assistiveTextSuggestionNothing);
68
+ return formatMessage(commonMessages.assistiveTextResult, {
69
+ count: itemsCount
70
+ });
71
71
  };
72
72
  var assistiveMessage = getFormattedMessage(items === null || items === void 0 ? void 0 : items.length);
73
73
  var isInputNotFocusedAndItemSelected = !inputFocused && selectedItemIndex !== undefined;
@@ -111,11 +111,43 @@ function ElementSearch(_ref) {
111
111
  className: "assistive"
112
112
  }, assistiveMessage));
113
113
  }
114
- var styledShortcut = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n padding: ", "px ", "px;\n width: ", "px;\n"])), shortcutStyle, GRID_SIZE / 2, GRID_SIZE, GRID_SIZE * 6);
115
- var wrapper = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n & > [data-ds--text-field--container] {\n height: ", "px;\n border-radius: ", "px;\n flex: 1 1 100%;\n overflow: visible;\n & > [data-ds--text-field--input] {\n margin-bottom: 3px;\n font-size: ", ";\n padding: ", "px ", " ", "px 0;\n }\n }\n"])), GRID_SIZE * 6, GRID_SIZE, relativeFontSizeToBase16(14), GRID_SIZE, "var(--ds-space-075, 6px)", GRID_SIZE);
116
- var wrapperInline = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n & > [data-ds--text-field--container] {\n height: ", "px;\n flex: none;\n overflow: revert;\n }\n"])), GRID_SIZE * 5);
117
- var elementBeforeInput = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin: 1px ", " 0 ", ";\n color: ", ";\n\n // Custom SearchIcon style\n span,\n svg {\n height: 20px;\n width: 20px;\n }\n"])), "var(--ds-space-075, 6px)", "var(--ds-space-100, 8px)", "var(--ds-icon, ".concat(N200, ")"));
118
- var elementAfterInput = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: 0 ", ";\n height: ", ";\n text-align: center;\n"])), "var(--ds-space-100, 8px)", SEARCH_ITEM_HEIGHT_WIDTH);
114
+ var styledShortcut = css(shortcutStyle, {
115
+ padding: "".concat(GRID_SIZE / 2, "px ").concat(GRID_SIZE, "px"),
116
+ width: "".concat(GRID_SIZE * 6, "px")
117
+ });
118
+ var wrapper = css({
119
+ '& > [data-ds--text-field--container]': {
120
+ height: "".concat(GRID_SIZE * 6, "px"),
121
+ borderRadius: "".concat(GRID_SIZE, "px"),
122
+ flex: '1 1 100%',
123
+ overflow: 'visible',
124
+ '& > [data-ds--text-field--input]': {
125
+ marginBottom: '3px',
126
+ fontSize: relativeFontSizeToBase16(14),
127
+ padding: "".concat(GRID_SIZE, "px ", "var(--ds-space-075, 6px)", " ").concat(GRID_SIZE, "px 0")
128
+ }
129
+ }
130
+ });
131
+ var wrapperInline = css({
132
+ '& > [data-ds--text-field--container]': {
133
+ height: "".concat(GRID_SIZE * 5, "px"),
134
+ flex: 'none',
135
+ overflow: 'revert'
136
+ }
137
+ });
138
+ var elementBeforeInput = css({
139
+ margin: "1px ".concat("var(--ds-space-075, 6px)", " 0 ", "var(--ds-space-100, 8px)"),
140
+ color: "var(--ds-icon, ".concat(N200, ")"),
141
+ 'span, svg': {
142
+ height: '20px',
143
+ width: '20px'
144
+ }
145
+ });
146
+ var elementAfterInput = css({
147
+ margin: "0 ".concat("var(--ds-space-100, 8px)"),
148
+ height: SEARCH_ITEM_HEIGHT_WIDTH,
149
+ textAlign: 'center'
150
+ });
119
151
  var MemoizedElementSearchWithAnalytics = /*#__PURE__*/memo(withAnalyticsContext({
120
152
  component: 'Searchbar'
121
153
  })(injectIntl(ElementSearch)));
@@ -10,24 +10,14 @@ export default defineMessages({
10
10
  defaultMessage: 'Search',
11
11
  description: 'Search field placeholder'
12
12
  },
13
- assistiveTextSuggestionsDefault: {
14
- id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
13
+ assistiveTextDefault: {
14
+ id: 'fabric.editor.elementbrowser.searchbar.assistive.text.default',
15
15
  defaultMessage: '{count} suggestions available by default.',
16
16
  description: 'Assistive text to describe the default list of suggestions'
17
17
  },
18
- assistiveTextSuggestions: {
19
- id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
20
- defaultMessage: '{count} suggestions available for typed text.',
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
- },
23
- assistiveTextSuggestion: {
24
- id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestion',
25
- defaultMessage: '{count} suggestion available for typed text.',
26
- description: 'Assistive text to describe the that there is one suggestion for the users typed input'
27
- },
28
- assistiveTextSuggestionNothing: {
29
- id: 'fabric.editor.elementbrowser.searchbar.assistive.text.nothing',
30
- defaultMessage: 'Nothing matches your search',
31
- description: 'Assistive text to describe that no suggestions match the users typed input'
18
+ assistiveTextResult: {
19
+ id: 'fabric.editor.elementbrowser.searchbar.assistive.text.result',
20
+ defaultMessage: '{count, plural, =0 {Nothing matches your search} one {{count} suggestion available for typed text.} other {{count} suggestions available for typed text.}}',
21
+ description: 'Assistive text to describe the list of suggestions filtered by typed user input'
32
22
  }
33
23
  });
@@ -22,8 +22,12 @@ export var useMultiBodiedExtensionActions = function useMultiBodiedExtensionActi
22
22
  sendMBEAnalyticsEvent(ACTION.CHANGE_ACTIVE, node, eventDispatcher);
23
23
  }
24
24
  // On selection of a childFrame, we need to change the focus/selection to the end of the target child Frame
25
- var possiblyMbeNode = state.doc.nodeAt(state.tr.selection.from);
26
- var desiredPos = state.tr.selection.from || 0;
25
+ var pos = getPos();
26
+ if (typeof pos !== 'number') {
27
+ return updateActiveChildResult;
28
+ }
29
+ var possiblyMbeNode = state.doc.nodeAt(pos);
30
+ var desiredPos = pos;
27
31
  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) {
28
32
  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++) {
29
33
  var _possiblyMbeNode$cont, _possiblyMbeNode$cont2;
@@ -52,7 +56,9 @@ export var useMultiBodiedExtensionActions = function useMultiBodiedExtensionActi
52
56
  throw new Error('Could not create frame or position not valid');
53
57
  }
54
58
  var insertAt = Math.min((pos || 1) + node.content.size, state.doc.content.size);
55
- dispatch(state.tr.insert(insertAt, frame));
59
+ var tr = state.tr.insert(insertAt, frame);
60
+ tr.setSelection(new TextSelection(tr.doc.resolve(insertAt + 1)));
61
+ dispatch(tr);
56
62
  if (eventDispatcher) {
57
63
  sendMBEAnalyticsEvent(ACTION.ADD_CHILD, node, eventDispatcher);
58
64
  }
@@ -5,8 +5,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
5
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
9
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
10
8
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
9
  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; } }
12
10
  /** @jsx jsx */
@@ -20,12 +18,39 @@ import { N20, N300, N800 } from '@atlaskit/theme/colors';
20
18
  import { fontSizeSmall } from '@atlaskit/theme/constants';
21
19
  import { getCorrectAltByIconUrl } from './listItemAlts';
22
20
  import { transformTimeStamp } from './transformTimeStamp';
23
- export var container = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: transparent;\n padding: ", " ", ";\n cursor: pointer;\n display: flex;\n margin-top: 0;\n"])), "var(--ds-space-100, 8px)", "var(--ds-space-150, 12px)");
24
- export var containerSelected = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color: ", ";\n"])), "var(--ds-background-neutral-subtle-hovered, ".concat(N20, ")"));
25
- var nameWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: hidden;\n"])));
26
- export var nameStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n line-height: 20px;\n"])), "var(--ds-text, ".concat(N800, ")"));
27
- export var containerName = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: ", ";\n line-height: 14px;\n font-size: ", ";\n"])), "var(--ds-text-subtlest, ".concat(N300, ")"), relativeFontSizeToBase16(fontSizeSmall()));
28
- var iconStyle = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n min-width: 16px;\n margin-top: 3px;\n margin-right: ", ";\n\n img {\n max-width: 16px;\n }\n"])), "var(--ds-space-150, 12px)");
21
+ export var container = css({
22
+ backgroundColor: 'transparent',
23
+ padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-150, 12px)"),
24
+ cursor: 'pointer',
25
+ display: 'flex',
26
+ marginTop: 0
27
+ });
28
+ export var containerSelected = css({
29
+ backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(N20, ")")
30
+ });
31
+ var nameWrapper = css({
32
+ overflow: 'hidden'
33
+ });
34
+ export var nameStyle = css({
35
+ color: "var(--ds-text, ".concat(N800, ")"),
36
+ overflow: 'hidden',
37
+ textOverflow: 'ellipsis',
38
+ whiteSpace: 'nowrap',
39
+ lineHeight: '20px'
40
+ });
41
+ export var containerName = css({
42
+ color: "var(--ds-text-subtlest, ".concat(N300, ")"),
43
+ lineHeight: '14px',
44
+ fontSize: relativeFontSizeToBase16(fontSizeSmall())
45
+ });
46
+ var iconStyle = css({
47
+ minWidth: '16px',
48
+ marginTop: '3px',
49
+ marginRight: "var(--ds-space-150, 12px)",
50
+ img: {
51
+ maxWidth: '16px'
52
+ }
53
+ });
29
54
  var LinkSearchListItem = /*#__PURE__*/function (_React$PureComponent) {
30
55
  _inherits(LinkSearchListItem, _React$PureComponent);
31
56
  var _super = _createSuper(LinkSearchListItem);
@@ -32,7 +32,7 @@ var messages = defineMessages({
32
32
  },
33
33
  defaultAltText: {
34
34
  id: 'fabric.editor.defaultAltText',
35
- defaultMessage: 'List item',
35
+ defaultMessage: 'Document',
36
36
  description: 'Default alt text for ListItem image'
37
37
  }
38
38
  });
@@ -82,8 +82,8 @@ export var toolbarInsertBlockMessages = defineMessages({
82
82
  },
83
83
  tableSizeSelectorButton: {
84
84
  id: 'fabric.editor.tableSizeSelectorButton',
85
- defaultMessage: 'Create table of size',
86
- description: 'Creates table popup grid of defined size'
85
+ defaultMessage: '{numberOfColumns} by {numberOfRows}',
86
+ description: 'Creates a table of custom size'
87
87
  },
88
88
  tableSizeSelectorPopup: {
89
89
  id: 'fabric.editor.tableSizeSelectorPopup',
@@ -167,7 +167,7 @@ export var messages = defineMessages({
167
167
  },
168
168
  backgroundColor: {
169
169
  id: 'fabric.editor.backgroundColor',
170
- defaultMessage: 'Background Color',
170
+ defaultMessage: 'Background color',
171
171
  description: 'Change the background color of a table cell.'
172
172
  },
173
173
  mergeCells: {
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "78.8.1";
9
+ var packageVersion = "78.8.3";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -66,6 +66,9 @@ export var getParentNodeWidth = function getParentNodeWidth(pos, state, containe
66
66
  case schema.nodes.bodiedExtension:
67
67
  parentWidth -= BODIED_EXT_PADDING * 2;
68
68
  break;
69
+ case schema.nodes.extensionFrame:
70
+ parentWidth -= BODIED_EXT_PADDING * 2;
71
+ break;
69
72
 
70
73
  // TODO: Migrate away from gridSize
71
74
  // Recommendation: Replace gridSize with 8
@@ -89,7 +92,7 @@ var getNestedParentNode = function getNestedParentNode(tablePos, state) {
89
92
  return null;
90
93
  }
91
94
  var $pos = state.doc.resolve(tablePos);
92
- var parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.layoutSection, state.schema.nodes.expand]);
95
+ var parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand]);
93
96
  return parent ? parent.node : null;
94
97
  };
95
98
  var calcBreakoutNodeWidth = function calcBreakoutNodeWidth(layout, containerWidth, isFullWidthModeEnabled) {
@@ -17,7 +17,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
17
17
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
18
18
  import Layer from '../Layer';
19
19
  var packageName = "@atlaskit/editor-common";
20
- var packageVersion = "78.8.1";
20
+ var packageVersion = "78.8.3";
21
21
  var halfFocusRing = 1;
22
22
  var dropOffset = '0, 8';
23
23
  var DropList = /*#__PURE__*/function (_Component) {
@@ -9,22 +9,12 @@ declare const _default: {
9
9
  defaultMessage: string;
10
10
  description: string;
11
11
  };
12
- assistiveTextSuggestionsDefault: {
12
+ assistiveTextDefault: {
13
13
  id: string;
14
14
  defaultMessage: string;
15
15
  description: string;
16
16
  };
17
- assistiveTextSuggestions: {
18
- id: string;
19
- defaultMessage: string;
20
- description: string;
21
- };
22
- assistiveTextSuggestion: {
23
- id: string;
24
- defaultMessage: string;
25
- description: string;
26
- };
27
- assistiveTextSuggestionNothing: {
17
+ assistiveTextResult: {
28
18
  id: string;
29
19
  defaultMessage: string;
30
20
  description: string;
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
- import { WrappedComponentProps } from 'react-intl-next';
4
- import { LinkSearchListItemData } from './types';
3
+ import type { WrappedComponentProps } from 'react-intl-next';
4
+ import type { LinkSearchListItemData } from './types';
5
5
  export declare const container: import("@emotion/react").SerializedStyles;
6
6
  export declare const containerSelected: import("@emotion/react").SerializedStyles;
7
7
  export declare const nameStyle: import("@emotion/react").SerializedStyles;
@@ -1,2 +1,2 @@
1
- import { IntlShape } from 'react-intl-next';
1
+ import type { IntlShape } from 'react-intl-next';
2
2
  export declare const getCorrectAltByIconUrl: (iconUrl: string, intl: IntlShape) => string;
@@ -1,5 +1,5 @@
1
- import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import { EditorState } from '@atlaskit/editor-prosemirror/state';
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { EditorContainerWidth } from '../types/editor-container-width';
4
4
  export declare const layoutToWidth: {
5
5
  default: number;
@@ -9,22 +9,12 @@ declare const _default: {
9
9
  defaultMessage: string;
10
10
  description: string;
11
11
  };
12
- assistiveTextSuggestionsDefault: {
12
+ assistiveTextDefault: {
13
13
  id: string;
14
14
  defaultMessage: string;
15
15
  description: string;
16
16
  };
17
- assistiveTextSuggestions: {
18
- id: string;
19
- defaultMessage: string;
20
- description: string;
21
- };
22
- assistiveTextSuggestion: {
23
- id: string;
24
- defaultMessage: string;
25
- description: string;
26
- };
27
- assistiveTextSuggestionNothing: {
17
+ assistiveTextResult: {
28
18
  id: string;
29
19
  defaultMessage: string;
30
20
  description: string;
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
- import { WrappedComponentProps } from 'react-intl-next';
4
- import { LinkSearchListItemData } from './types';
3
+ import type { WrappedComponentProps } from 'react-intl-next';
4
+ import type { LinkSearchListItemData } from './types';
5
5
  export declare const container: import("@emotion/react").SerializedStyles;
6
6
  export declare const containerSelected: import("@emotion/react").SerializedStyles;
7
7
  export declare const nameStyle: import("@emotion/react").SerializedStyles;
@@ -1,2 +1,2 @@
1
- import { IntlShape } from 'react-intl-next';
1
+ import type { IntlShape } from 'react-intl-next';
2
2
  export declare const getCorrectAltByIconUrl: (iconUrl: string, intl: IntlShape) => string;
@@ -1,5 +1,5 @@
1
- import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import { EditorState } from '@atlaskit/editor-prosemirror/state';
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { EditorContainerWidth } from '../types/editor-container-width';
4
4
  export declare const layoutToWidth: {
5
5
  default: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "78.8.1",
3
+ "version": "78.8.3",
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/"