@atlaskit/editor-common 110.21.0 → 110.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 110.21.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`bee3e79187ed5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bee3e79187ed5) -
8
+ [ux] cleanup platform_editor_a11y_insert_link_item_focus
9
+ - Updated dependencies
10
+
11
+ ## 110.21.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`ff3e1422d5b70`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ff3e1422d5b70) -
16
+ [ux] EDITOR-2437 implement request access to sync block component
17
+
3
18
  ## 110.21.0
4
19
 
5
20
  ### Minor Changes
@@ -33,7 +33,7 @@ var _analytics = require("../../../analytics");
33
33
  var _ui = require("../../../ui");
34
34
  var _utils = require("../../../utils");
35
35
  var _browser = require("../../../utils/browser");
36
- var _LinkSearchList = _interopRequireWildcard(require("../../LinkSearch/LinkSearchList"));
36
+ var _LinkSearchList = _interopRequireDefault(require("../../LinkSearch/LinkSearchList"));
37
37
  var _ToolbarComponents = require("../../LinkSearch/ToolbarComponents");
38
38
  var _transformTimeStamp = require("../../LinkSearch/transformTimeStamp");
39
39
  var _utils2 = require("./utils");
@@ -172,7 +172,6 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
172
172
  (0, _defineProperty2.default)(_this, "urlInputContainer", null);
173
173
  (0, _defineProperty2.default)(_this, "displayTextInputContainer", null);
174
174
  (0, _defineProperty2.default)(_this, "wrapperRef", /*#__PURE__*/_react.default.createRef());
175
- // introduced via ff platform_editor_a11y_insert_link_item_focus, remove this comment cleaning up
176
175
  (0, _defineProperty2.default)(_this, "listItemRefs", {
177
176
  current: {}
178
177
  });
@@ -424,7 +423,6 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
424
423
  return "".concat(name, ", ").concat(_container, ", ").concat(date === null || date === void 0 ? void 0 : date.pageAction, " ").concat(date === null || date === void 0 ? void 0 : date.dateString, " ").concat((date === null || date === void 0 ? void 0 : date.timeSince) || '');
425
424
  }
426
425
  });
427
- // introduced via ff platform_editor_a11y_insert_link_item_focus, remove this comment cleaning up
428
426
  (0, _defineProperty2.default)(_this, "listItemRefCallback", function (el, id) {
429
427
  if (!_this.listItemRefs.current) {
430
428
  return;
@@ -538,7 +536,7 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
538
536
  if (keyCode === KEY_CODE_TAB) {
539
537
  /** If there are items in the list, allow normal tabbing so focus moves to the next interactive element (in this case, a search result item).
540
538
  */
541
- if (_this.state.items.length > 0 && (0, _platformFeatureFlags.fg)('platform_editor_a11y_insert_link_item_focus')) {
539
+ if (_this.state.items.length > 0) {
542
540
  return;
543
541
  }
544
542
  if (!_this.submitted) {
@@ -552,7 +550,6 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
552
550
  return;
553
551
  }
554
552
  });
555
- // introduced via ff platform_editor_a11y_insert_link_item_focus, remove this comment cleaning up
556
553
  (0, _defineProperty2.default)(_this, "handleListItemFocus", function (index) {
557
554
  _this.setState({
558
555
  selectedIndex: index
@@ -594,7 +591,6 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
594
591
  updatedIndex = selectedIndex > 0 ? selectedIndex - 1 : items.length - 1;
595
592
  }
596
593
  if ([KEY_CODE_ARROW_DOWN, KEY_CODE_ARROW_UP].includes(keyCode) && items[updatedIndex]) {
597
- // introduced via ff platform_editor_a11y_insert_link_item_focus, remove this comment cleaning up
598
594
  if (_this.listItemRefs.current) {
599
595
  var _this$listItemRefs$cu;
600
596
  (_this$listItemRefs$cu = _this.listItemRefs.current[items[updatedIndex].objectId]) === null || _this$listItemRefs$cu === void 0 || _this$listItemRefs$cu.focus();
@@ -972,7 +968,7 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
972
968
  id: "fabric.editor.hyperlink.suggested.results"
973
969
  }, displayUrl && formatMessage(messages.searchLinkResults, {
974
970
  count: items.length
975
- })), (0, _platformFeatureFlags.fg)('platform_editor_a11y_insert_link_item_focus') ? (0, _react2.jsx)(_LinkSearchList.LinkSearchListNext, {
971
+ })), (0, _react2.jsx)(_LinkSearchList.default, {
976
972
  ariaControls: "fabric.editor.hyperlink.suggested.results",
977
973
  id: linkSearchListId,
978
974
  role: "listbox",
@@ -985,16 +981,6 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
985
981
  onSelect: this.handleSelected,
986
982
  onMouseEnter: this.handleMouseEnterResultItem,
987
983
  onMouseLeave: this.handleMouseLeaveResultItem
988
- }) : (0, _react2.jsx)(_LinkSearchList.default, {
989
- ariaControls: "fabric.editor.hyperlink.suggested.results",
990
- id: linkSearchListId,
991
- role: "listbox",
992
- items: items,
993
- isLoading: isLoading,
994
- selectedIndex: selectedIndex,
995
- onSelect: this.handleSelected,
996
- onMouseEnter: this.handleMouseEnterResultItem,
997
- onMouseLeave: this.handleMouseLeaveResultItem
998
984
  })));
999
985
  }
1000
986
  }]);
@@ -1,43 +1,37 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports.linkSearchList = exports.default = exports.LinkSearchListNext = void 0;
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
- var _react = require("react");
15
- var _react2 = require("@emotion/react");
7
+ exports.linkSearchList = exports.default = void 0;
8
+ var _react = require("@emotion/react");
16
9
  var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
17
- var _LinkSearchListItem = _interopRequireWildcard(require("./LinkSearchListItem"));
18
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
19
- function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
20
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
10
+ var _LinkSearchListItem = _interopRequireDefault(require("./LinkSearchListItem"));
11
+ /**
21
12
  * @jsxRuntime classic
22
13
  * @jsx jsx
23
- */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
24
- var listContainer = (0, _react2.css)({
14
+ */
15
+
16
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
17
+
18
+ var listContainer = (0, _react.css)({
25
19
  paddingTop: 0,
26
20
  marginTop: "var(--ds-space-150, 12px)",
27
21
  borderTop: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, #091E4224)")
28
22
  });
29
- var spinnerContainer = (0, _react2.css)({
23
+ var spinnerContainer = (0, _react.css)({
30
24
  textAlign: 'center',
31
25
  minHeight: '80px',
32
26
  marginTop: "var(--ds-space-400, 32px)"
33
27
  });
34
28
 
35
29
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
36
- var linkSearchList = exports.linkSearchList = (0, _react2.css)({
30
+ var linkSearchList = exports.linkSearchList = (0, _react.css)({
37
31
  padding: 0,
38
32
  listStyle: 'none'
39
33
  });
40
- var LinkSearchListNext = exports.LinkSearchListNext = function LinkSearchListNext(_ref) {
34
+ var LinkSearchList = function LinkSearchList(_ref) {
41
35
  var listItemRefCallback = _ref.listItemRefCallback,
42
36
  _onFocus = _ref.onFocus,
43
37
  onKeyDown = _ref.onKeyDown,
@@ -54,14 +48,14 @@ var LinkSearchListNext = exports.LinkSearchListNext = function LinkSearchListNex
54
48
  var itemsContent;
55
49
  var loadingContent;
56
50
  if (items && items.length > 0) {
57
- itemsContent = (0, _react2.jsx)("ul", {
51
+ itemsContent = (0, _react.jsx)("ul", {
58
52
  css: linkSearchList,
59
53
  id: id,
60
54
  role: role,
61
55
  "aria-controls": ariaControls,
62
56
  "data-testid": "".concat(id, "--items")
63
57
  }, items.map(function (item, index) {
64
- return (0, _react2.jsx)(_LinkSearchListItem.ForwardedLinkSearchListItemNextWithIntl, {
58
+ return (0, _react.jsx)(_LinkSearchListItem.default, {
65
59
  id: "link-search-list-item-".concat(index),
66
60
  item: item,
67
61
  selected: selectedIndex === index,
@@ -81,82 +75,17 @@ var LinkSearchListNext = exports.LinkSearchListNext = function LinkSearchListNex
81
75
  }));
82
76
  }
83
77
  if (isLoading) {
84
- loadingContent = (0, _react2.jsx)("div", {
78
+ loadingContent = (0, _react.jsx)("div", {
85
79
  id: id,
86
80
  "data-testid": "".concat(id, "--loading"),
87
81
  css: spinnerContainer
88
- }, (0, _react2.jsx)(_spinner.default, {
82
+ }, (0, _react.jsx)(_spinner.default, {
89
83
  size: "medium",
90
84
  interactionName: "link-search-spinner"
91
85
  }));
92
86
  }
93
- return (0, _react2.jsx)("div", {
87
+ return (0, _react.jsx)("div", {
94
88
  css: listContainer
95
89
  }, itemsContent, loadingContent);
96
90
  };
97
- /**
98
- * *Warning:* With `platform_editor_a11y_insert_link_item_focus` enabled this component is no longer used and is replaced with `<LinkSearchListNext />`.
99
- *
100
- * If making changes to this component please ensure to also update `<LinkSearchListNext />`.
101
- */
102
- // Ignored via go/ees005
103
- // eslint-disable-next-line @repo/internal/react/no-class-components
104
- var LinkSearchList = exports.default = /*#__PURE__*/function (_PureComponent) {
105
- function LinkSearchList() {
106
- (0, _classCallCheck2.default)(this, LinkSearchList);
107
- return _callSuper(this, LinkSearchList, arguments);
108
- }
109
- (0, _inherits2.default)(LinkSearchList, _PureComponent);
110
- return (0, _createClass2.default)(LinkSearchList, [{
111
- key: "render",
112
- value: function render() {
113
- var _this$props = this.props,
114
- onSelect = _this$props.onSelect,
115
- onMouseMove = _this$props.onMouseMove,
116
- onMouseEnter = _this$props.onMouseEnter,
117
- onMouseLeave = _this$props.onMouseLeave,
118
- items = _this$props.items,
119
- selectedIndex = _this$props.selectedIndex,
120
- isLoading = _this$props.isLoading,
121
- ariaControls = _this$props.ariaControls,
122
- role = _this$props.role,
123
- id = _this$props.id;
124
- var itemsContent;
125
- var loadingContent;
126
- if (items && items.length > 0) {
127
- itemsContent = (0, _react2.jsx)("ul", {
128
- css: linkSearchList,
129
- id: id,
130
- role: role,
131
- "aria-controls": ariaControls,
132
- "data-testid": "".concat(id, "--items")
133
- }, items.map(function (item, index) {
134
- return (0, _react2.jsx)(_LinkSearchListItem.default, {
135
- id: "link-search-list-item-".concat(index),
136
- role: role && 'option',
137
- item: item,
138
- selected: selectedIndex === index,
139
- onMouseMove: onMouseMove,
140
- onMouseEnter: onMouseEnter,
141
- onMouseLeave: onMouseLeave,
142
- onSelect: onSelect,
143
- key: item.objectId
144
- });
145
- }));
146
- }
147
- if (isLoading) {
148
- loadingContent = (0, _react2.jsx)("div", {
149
- id: id,
150
- "data-testid": "".concat(id, "--loading"),
151
- css: spinnerContainer
152
- }, (0, _react2.jsx)(_spinner.default, {
153
- size: "medium",
154
- interactionName: "link-search-spinner"
155
- }));
156
- }
157
- return (0, _react2.jsx)("div", {
158
- css: listContainer
159
- }, itemsContent, loadingContent);
160
- }
161
- }]);
162
- }(_react.PureComponent);
91
+ var _default = exports.default = LinkSearchList;
@@ -1,17 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports.nameStyle = exports.default = exports.containerSelected = exports.containerName = exports.container = exports.ForwardedLinkSearchListItemNextWithIntl = void 0;
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
+ exports.nameStyle = exports.default = exports.containerSelected = exports.containerName = exports.container = exports.ForwardedLinkSearchListItemWithIntl = void 0;
15
8
  var _react = _interopRequireWildcard(require("react"));
16
9
  var _react2 = require("@emotion/react");
17
10
  var _reactIntlNext = require("react-intl-next");
@@ -19,13 +12,16 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
19
12
  var _listItemAlts = require("./listItemAlts");
20
13
  var _transformTimeStamp = require("./transformTimeStamp");
21
14
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
22
- function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
23
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
15
+ /**
24
16
  * @jsxRuntime classic
25
17
  * @jsx jsx
26
- */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
18
+ */
19
+
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
21
+
27
22
  // AFP-2532 TODO: Fix automatic suppressions below
28
23
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
24
+
29
25
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
30
26
  var container = exports.container = (0, _react2.css)({
31
27
  backgroundColor: 'transparent',
@@ -70,7 +66,7 @@ var iconStyle = (0, _react2.css)({
70
66
  maxWidth: '16px'
71
67
  }
72
68
  });
73
- var LinkSearchListItemNext = function LinkSearchListItemNext(props, ref) {
69
+ var LinkSearchListItem = function LinkSearchListItem(props, ref) {
74
70
  var id = props.id,
75
71
  item = props.item,
76
72
  onFocus = props.onFocus,
@@ -149,123 +145,8 @@ var LinkSearchListItemNext = function LinkSearchListItemNext(props, ref) {
149
145
  css: containerName
150
146
  }, item.container, renderTimeStamp())));
151
147
  };
152
- var ForwardedLinkSearchListItemNext = /*#__PURE__*/(0, _react.forwardRef)(LinkSearchListItemNext);
153
- var ForwardedLinkSearchListItemNextWithIntl = exports.ForwardedLinkSearchListItemNextWithIntl = (0, _reactIntlNext.injectIntl)(ForwardedLinkSearchListItemNext, {
148
+ var ForwardedLinkSearchListItem = /*#__PURE__*/(0, _react.forwardRef)(LinkSearchListItem);
149
+ var ForwardedLinkSearchListItemWithIntl = exports.ForwardedLinkSearchListItemWithIntl = (0, _reactIntlNext.injectIntl)(ForwardedLinkSearchListItem, {
154
150
  forwardRef: true
155
151
  });
156
- /**
157
- * *Warning:* With `platform_editor_a11y_insert_link_item_focus` enabled this component is no longer used and is replaced with `<LinkSearchListItemNext />`.
158
- *
159
- * If making changes to this component please ensure to also update `<LinkSearchListItemNext />`.
160
- */
161
- // Ignored via go/ees005
162
- // eslint-disable-next-line @repo/internal/react/no-class-components
163
- var LinkSearchListItem = /*#__PURE__*/function (_React$PureComponent) {
164
- function LinkSearchListItem() {
165
- var _this;
166
- (0, _classCallCheck2.default)(this, LinkSearchListItem);
167
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
168
- args[_key] = arguments[_key];
169
- }
170
- _this = _callSuper(this, LinkSearchListItem, [].concat(args));
171
- (0, _defineProperty2.default)(_this, "handleSelect", function (e) {
172
- e.preventDefault(); // don't let editor lose focus
173
- var _this$props = _this.props,
174
- item = _this$props.item,
175
- onSelect = _this$props.onSelect;
176
- onSelect(item.url, item.name);
177
- });
178
- (0, _defineProperty2.default)(_this, "handleMouseMove", function () {
179
- var _this$props2 = _this.props,
180
- onMouseMove = _this$props2.onMouseMove,
181
- item = _this$props2.item;
182
- onMouseMove && onMouseMove(item.objectId);
183
- });
184
- (0, _defineProperty2.default)(_this, "handleMouseEnter", function () {
185
- var _this$props3 = _this.props,
186
- onMouseEnter = _this$props3.onMouseEnter,
187
- item = _this$props3.item;
188
- onMouseEnter && onMouseEnter(item.objectId);
189
- });
190
- (0, _defineProperty2.default)(_this, "handleMouseLeave", function () {
191
- var _this$props4 = _this.props,
192
- onMouseLeave = _this$props4.onMouseLeave,
193
- item = _this$props4.item;
194
- onMouseLeave && onMouseLeave(item.objectId);
195
- });
196
- return _this;
197
- }
198
- (0, _inherits2.default)(LinkSearchListItem, _React$PureComponent);
199
- return (0, _createClass2.default)(LinkSearchListItem, [{
200
- key: "renderIcon",
201
- value: function renderIcon() {
202
- var _this$props5 = this.props,
203
- _this$props5$item = _this$props5.item,
204
- icon = _this$props5$item.icon,
205
- iconUrl = _this$props5$item.iconUrl,
206
- intl = _this$props5.intl;
207
- if (icon) {
208
- return (0, _react2.jsx)("span", {
209
- css: iconStyle
210
- }, icon);
211
- }
212
- if (iconUrl) {
213
- return (0, _react2.jsx)("span", {
214
- css: iconStyle
215
- }, (0, _react2.jsx)("img", {
216
- src: iconUrl,
217
- alt: (0, _listItemAlts.getCorrectAltByIconUrl)(iconUrl, intl)
218
- }));
219
- }
220
- return null;
221
- }
222
- }, {
223
- key: "renderTimeStamp",
224
- value: function renderTimeStamp() {
225
- var _this$props6 = this.props,
226
- item = _this$props6.item,
227
- intl = _this$props6.intl;
228
- var date = (0, _transformTimeStamp.transformTimeStamp)(intl, item.lastViewedDate, item.lastUpdatedDate);
229
- return date && (0, _react2.jsx)(_react.Fragment, null, "\xA0 \u2022", (0, _react2.jsx)("span", {
230
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
231
- className: "link-search-timestamp",
232
- "data-test-id": "link-search-timestamp"
233
- }, "\xA0 ", date.pageAction, " ", date.dateString, " ", date.timeSince || ''));
234
- }
235
- }, {
236
- key: "render",
237
- value: function render() {
238
- var _this$props7 = this.props,
239
- item = _this$props7.item,
240
- selected = _this$props7.selected,
241
- id = _this$props7.id,
242
- role = _this$props7.role;
243
- return (
244
- // eslint-disable-next-line @atlassian/a11y/no-noninteractive-element-interactions, @atlassian/a11y/click-events-have-key-events
245
- (0, _react2.jsx)("li", {
246
- css: [container, selected && containerSelected],
247
- role: role,
248
- id: id,
249
- "aria-selected": selected,
250
- "data-testid": "link-search-list-item",
251
- onMouseMove: this.handleMouseMove
252
- // eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
253
- ,
254
- onMouseEnter: this.handleMouseEnter
255
- // eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
256
- ,
257
- onMouseLeave: this.handleMouseLeave,
258
- onClick: this.handleSelect
259
- }, this.renderIcon(), (0, _react2.jsx)("span", {
260
- css: nameWrapper
261
- }, (0, _react2.jsx)("div", {
262
- css: nameStyle
263
- }, item.name), (0, _react2.jsx)("div", {
264
- "data-testid": "link-search-list-item-container",
265
- css: containerName
266
- }, item.container, this.renderTimeStamp())))
267
- );
268
- }
269
- }]);
270
- }(_react.default.PureComponent);
271
- var _default = exports.default = (0, _reactIntlNext.injectIntl)(LinkSearchListItem);
152
+ var _default = exports.default = ForwardedLinkSearchListItemWithIntl;
@@ -40,5 +40,35 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
40
40
  id: 'fabric.editor.syncedBlock',
41
41
  defaultMessage: 'Synced block',
42
42
  description: 'Label which appears above the synced block when it is selected'
43
+ },
44
+ permissionDeniedHeading: {
45
+ id: 'fabric.editor.syncedBlockPermissionDeniedHeading',
46
+ defaultMessage: "You don't have permission to view this synced block",
47
+ description: 'Heading for error state where the user does not have permission to view the synced block'
48
+ },
49
+ permissionDeniedDescription: {
50
+ id: 'fabric.editor.syncedBlockPermissionDeniedDescription',
51
+ defaultMessage: "The source of this synced block is a content item you don't have access to.",
52
+ description: 'Description for error state where the user does not have permission to view the synced block'
53
+ },
54
+ permissionDeniedAltText: {
55
+ id: 'fabric.editor.syncedBlockPermissionDeniedIconAltText',
56
+ defaultMessage: 'Permission denied.',
57
+ description: 'Alt text for icon on error state where the user does not have permission to view the synced block'
58
+ },
59
+ requestAccessButton: {
60
+ id: 'fabric.editor.requestAccessToSyncedBlock',
61
+ defaultMessage: 'Request access',
62
+ description: 'Label for button which requests access to view the source page of the sync block'
63
+ },
64
+ accessRequested: {
65
+ id: 'fabric.editor.accessToSyncedBlockRequested',
66
+ defaultMessage: 'Access requested',
67
+ description: 'Text which displays after the request to view the source page of the sync block has been sent and is still pending'
68
+ },
69
+ requestAccessError: {
70
+ id: 'fabric.editor.requestAccessToSyncedBlockError',
71
+ defaultMessage: 'Something went wrong. Click to try again',
72
+ description: 'Text which displays next to the request access button after something went wrong after clicking the button.'
43
73
  }
44
74
  });
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
16
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "110.20.1";
19
+ var packageVersion = "110.21.1";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // Ignored via go/ees007
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "110.20.1";
27
+ var packageVersion = "110.21.1";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -24,7 +24,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEve
24
24
  import { Announcer, PanelTextInput } from '../../../ui';
25
25
  import { normalizeUrl } from '../../../utils';
26
26
  import { browser as browserLegacy, getBrowserInfo } from '../../../utils/browser';
27
- import LinkSearchList, { LinkSearchListNext } from '../../LinkSearch/LinkSearchList';
27
+ import LinkSearchList from '../../LinkSearch/LinkSearchList';
28
28
  import { container, containerWithProvider, narrowContainerWidth, inputWrapper } from '../../LinkSearch/ToolbarComponents';
29
29
  import { transformTimeStamp } from '../../LinkSearch/transformTimeStamp';
30
30
  import { filterUniqueItems, mapContentTypeToIcon, sha1, wordCount } from './utils';
@@ -153,7 +153,6 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
153
153
  _defineProperty(this, "urlInputContainer", null);
154
154
  _defineProperty(this, "displayTextInputContainer", null);
155
155
  _defineProperty(this, "wrapperRef", /*#__PURE__*/React.createRef());
156
- // introduced via ff platform_editor_a11y_insert_link_item_focus, remove this comment cleaning up
157
156
  _defineProperty(this, "listItemRefs", {
158
157
  current: {}
159
158
  });
@@ -337,7 +336,6 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
337
336
  return `${name}, ${container}, ${date === null || date === void 0 ? void 0 : date.pageAction} ${date === null || date === void 0 ? void 0 : date.dateString} ${(date === null || date === void 0 ? void 0 : date.timeSince) || ''}`;
338
337
  }
339
338
  });
340
- // introduced via ff platform_editor_a11y_insert_link_item_focus, remove this comment cleaning up
341
339
  _defineProperty(this, "listItemRefCallback", (el, id) => {
342
340
  if (!this.listItemRefs.current) {
343
341
  return;
@@ -456,7 +454,7 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
456
454
  if (keyCode === KEY_CODE_TAB) {
457
455
  /** If there are items in the list, allow normal tabbing so focus moves to the next interactive element (in this case, a search result item).
458
456
  */
459
- if (this.state.items.length > 0 && fg('platform_editor_a11y_insert_link_item_focus')) {
457
+ if (this.state.items.length > 0) {
460
458
  return;
461
459
  }
462
460
  if (!this.submitted) {
@@ -471,7 +469,6 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
471
469
  return;
472
470
  }
473
471
  });
474
- // introduced via ff platform_editor_a11y_insert_link_item_focus, remove this comment cleaning up
475
472
  _defineProperty(this, "handleListItemFocus", index => {
476
473
  this.setState({
477
474
  selectedIndex: index
@@ -519,7 +516,6 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
519
516
  updatedIndex = selectedIndex > 0 ? selectedIndex - 1 : items.length - 1;
520
517
  }
521
518
  if ([KEY_CODE_ARROW_DOWN, KEY_CODE_ARROW_UP].includes(keyCode) && items[updatedIndex]) {
522
- // introduced via ff platform_editor_a11y_insert_link_item_focus, remove this comment cleaning up
523
519
  if (this.listItemRefs.current) {
524
520
  var _this$listItemRefs$cu;
525
521
  (_this$listItemRefs$cu = this.listItemRefs.current[items[updatedIndex].objectId]) === null || _this$listItemRefs$cu === void 0 ? void 0 : _this$listItemRefs$cu.focus();
@@ -820,7 +816,7 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
820
816
  id: "fabric.editor.hyperlink.suggested.results"
821
817
  }, displayUrl && formatMessage(messages.searchLinkResults, {
822
818
  count: items.length
823
- })), fg('platform_editor_a11y_insert_link_item_focus') ? jsx(LinkSearchListNext, {
819
+ })), jsx(LinkSearchList, {
824
820
  ariaControls: "fabric.editor.hyperlink.suggested.results",
825
821
  id: linkSearchListId,
826
822
  role: "listbox",
@@ -833,16 +829,6 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
833
829
  onSelect: this.handleSelected,
834
830
  onMouseEnter: this.handleMouseEnterResultItem,
835
831
  onMouseLeave: this.handleMouseLeaveResultItem
836
- }) : jsx(LinkSearchList, {
837
- ariaControls: "fabric.editor.hyperlink.suggested.results",
838
- id: linkSearchListId,
839
- role: "listbox",
840
- items: items,
841
- isLoading: isLoading,
842
- selectedIndex: selectedIndex,
843
- onSelect: this.handleSelected,
844
- onMouseEnter: this.handleMouseEnterResultItem,
845
- onMouseLeave: this.handleMouseLeaveResultItem
846
832
  })));
847
833
  }
848
834
  }
@@ -2,12 +2,11 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { PureComponent } from 'react';
6
5
 
7
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
7
  import { css, jsx } from '@emotion/react';
9
8
  import Spinner from '@atlaskit/spinner';
10
- import LinkSearchListItem, { ForwardedLinkSearchListItemNextWithIntl } from './LinkSearchListItem';
9
+ import ForwardedLinkSearchListItemNextWithIntl from './LinkSearchListItem';
11
10
  const listContainer = css({
12
11
  paddingTop: 0,
13
12
  marginTop: "var(--ds-space-150, 12px)",
@@ -24,7 +23,7 @@ export const linkSearchList = css({
24
23
  padding: 0,
25
24
  listStyle: 'none'
26
25
  });
27
- export const LinkSearchListNext = ({
26
+ const LinkSearchList = ({
28
27
  listItemRefCallback,
29
28
  onFocus,
30
29
  onKeyDown,
@@ -76,60 +75,4 @@ export const LinkSearchListNext = ({
76
75
  css: listContainer
77
76
  }, itemsContent, loadingContent);
78
77
  };
79
- /**
80
- * *Warning:* With `platform_editor_a11y_insert_link_item_focus` enabled this component is no longer used and is replaced with `<LinkSearchListNext />`.
81
- *
82
- * If making changes to this component please ensure to also update `<LinkSearchListNext />`.
83
- */
84
- // Ignored via go/ees005
85
- // eslint-disable-next-line @repo/internal/react/no-class-components
86
- export default class LinkSearchList extends PureComponent {
87
- render() {
88
- const {
89
- onSelect,
90
- onMouseMove,
91
- onMouseEnter,
92
- onMouseLeave,
93
- items,
94
- selectedIndex,
95
- isLoading,
96
- ariaControls,
97
- role,
98
- id
99
- } = this.props;
100
- let itemsContent;
101
- let loadingContent;
102
- if (items && items.length > 0) {
103
- itemsContent = jsx("ul", {
104
- css: linkSearchList,
105
- id: id,
106
- role: role,
107
- "aria-controls": ariaControls,
108
- "data-testid": `${id}--items`
109
- }, items.map((item, index) => jsx(LinkSearchListItem, {
110
- id: `link-search-list-item-${index}`,
111
- role: role && 'option',
112
- item: item,
113
- selected: selectedIndex === index,
114
- onMouseMove: onMouseMove,
115
- onMouseEnter: onMouseEnter,
116
- onMouseLeave: onMouseLeave,
117
- onSelect: onSelect,
118
- key: item.objectId
119
- })));
120
- }
121
- if (isLoading) {
122
- loadingContent = jsx("div", {
123
- id: id,
124
- "data-testid": `${id}--loading`,
125
- css: spinnerContainer
126
- }, jsx(Spinner, {
127
- size: "medium",
128
- interactionName: "link-search-spinner"
129
- }));
130
- }
131
- return jsx("div", {
132
- css: listContainer
133
- }, itemsContent, loadingContent);
134
- }
135
- }
78
+ export default LinkSearchList;