@atlaskit/editor-plugin-type-ahead 0.7.7 → 0.7.8
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 +6 -0
- package/dist/cjs/ui/AssistiveText.js +4 -4
- package/dist/cjs/ui/InputQuery.js +6 -4
- package/dist/cjs/ui/TypeAheadList.js +10 -9
- package/dist/cjs/ui/TypeAheadListItem.js +18 -17
- package/dist/cjs/ui/TypeAheadPopup.js +5 -4
- package/dist/es2019/ui/AssistiveText.js +6 -4
- package/dist/es2019/ui/InputQuery.js +6 -5
- package/dist/es2019/ui/TypeAheadList.js +12 -10
- package/dist/es2019/ui/TypeAheadListItem.js +19 -18
- package/dist/es2019/ui/TypeAheadPopup.js +6 -5
- package/dist/esm/ui/AssistiveText.js +6 -4
- package/dist/esm/ui/InputQuery.js +6 -5
- package/dist/esm/ui/TypeAheadList.js +12 -10
- package/dist/esm/ui/TypeAheadListItem.js +19 -18
- package/dist/esm/ui/TypeAheadPopup.js +6 -5
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-type-ahead
|
|
2
2
|
|
|
3
|
+
## 0.7.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#59147](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59147) [`f12e489f23b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f12e489f23b0) - Re-build and deploy packages to NPM to resolve React/Compiled not found error (HOT-106483).
|
|
8
|
+
|
|
3
9
|
## 0.7.7
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -16,7 +16,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
16
16
|
var _react2 = require("@emotion/react");
|
|
17
17
|
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
18
18
|
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); }; }
|
|
19
|
-
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; } }
|
|
19
|
+
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 */
|
|
20
20
|
var statusDebounceMillis = 1400;
|
|
21
21
|
var assitiveTextStyles = (0, _react2.css)({
|
|
22
22
|
border: 0,
|
|
@@ -93,14 +93,14 @@ var AssistveTextComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
93
93
|
debounced = _this$state.debounced,
|
|
94
94
|
silenced = _this$state.silenced;
|
|
95
95
|
this.debounceStatusUpdate();
|
|
96
|
-
return
|
|
96
|
+
return (0, _react2.jsx)("div", {
|
|
97
97
|
css: assitiveTextStyles
|
|
98
|
-
},
|
|
98
|
+
}, (0, _react2.jsx)("div", {
|
|
99
99
|
id: id + '__status--A',
|
|
100
100
|
role: "status",
|
|
101
101
|
"aria-atomic": "true",
|
|
102
102
|
"aria-live": "polite"
|
|
103
|
-
}, "".concat(!silenced && debounced && bump ? assistiveText : '')),
|
|
103
|
+
}, "".concat(!silenced && debounced && bump ? assistiveText : '')), (0, _react2.jsx)("div", {
|
|
104
104
|
id: id + '__status--B',
|
|
105
105
|
role: "status",
|
|
106
106
|
"aria-atomic": "true",
|
|
@@ -20,6 +20,8 @@ var _utils2 = require("../utils");
|
|
|
20
20
|
var _AssistiveText = require("./AssistiveText");
|
|
21
21
|
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); }
|
|
22
22
|
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; }
|
|
23
|
+
/** @jsx jsx */
|
|
24
|
+
|
|
23
25
|
var querySpanStyles = (0, _react2.css)({
|
|
24
26
|
outline: 'none',
|
|
25
27
|
'& input': {
|
|
@@ -366,7 +368,7 @@ var InputQuery = exports.InputQuery = /*#__PURE__*/_react.default.memo(function
|
|
|
366
368
|
jsx-a11y/interactive-supports-focus
|
|
367
369
|
Task added in https://product-fabric.atlassian.net/wiki/spaces/E/pages/3182068181/Potential+improvements#Moderate-changes.
|
|
368
370
|
*/
|
|
369
|
-
return
|
|
371
|
+
return (0, _react2.jsx)(_react.Fragment, null, triggerQueryPrefix, (0, _react2.jsx)("span", {
|
|
370
372
|
css: querySpanStyles,
|
|
371
373
|
contentEditable: true,
|
|
372
374
|
ref: ref,
|
|
@@ -379,15 +381,15 @@ var InputQuery = exports.InputQuery = /*#__PURE__*/_react.default.memo(function
|
|
|
379
381
|
"aria-labelledby": assistiveHintID,
|
|
380
382
|
suppressContentEditableWarning: true,
|
|
381
383
|
"data-query-prefix": triggerQueryPrefix
|
|
382
|
-
}, query === null ?
|
|
384
|
+
}, query === null ? (0, _react2.jsx)("input", {
|
|
383
385
|
ref: inputRef,
|
|
384
386
|
type: "text"
|
|
385
|
-
}) : query),
|
|
387
|
+
}) : query), (0, _react2.jsx)("span", {
|
|
386
388
|
id: assistiveHintID,
|
|
387
389
|
style: {
|
|
388
390
|
display: 'none'
|
|
389
391
|
}
|
|
390
|
-
}, intl.formatMessage(getAriaLabel(triggerQueryPrefix, intl)), ",", intl.formatMessage(_messages.typeAheadListMessages.inputQueryAssistiveLabel)),
|
|
392
|
+
}, intl.formatMessage(getAriaLabel(triggerQueryPrefix, intl)), ",", intl.formatMessage(_messages.typeAheadListMessages.inputQueryAssistiveLabel)), (0, _react2.jsx)(_AssistiveText.AssistiveText, {
|
|
391
393
|
assistiveText: items.length === 0 ? intl.formatMessage(_messages.typeAheadListMessages.noSearchResultsLabel, {
|
|
392
394
|
itemsLength: items.length
|
|
393
395
|
}) : '',
|
|
@@ -22,6 +22,7 @@ var _utils = require("../utils");
|
|
|
22
22
|
var _AssistiveText = require("./AssistiveText");
|
|
23
23
|
var _TypeAheadListItem = require("./TypeAheadListItem");
|
|
24
24
|
var _templateObject;
|
|
25
|
+
/** @jsx jsx */
|
|
25
26
|
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); }
|
|
26
27
|
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; }
|
|
27
28
|
var LIST_ITEM_ESTIMATED_HEIGHT = _TypeAheadListItem.ICON_HEIGHT + _TypeAheadListItem.ITEM_PADDING * 2;
|
|
@@ -29,7 +30,7 @@ var LIST_WIDTH = 320;
|
|
|
29
30
|
var TypeaheadAssistiveTextPureComponent = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
30
31
|
var numberOfResults = _ref.numberOfResults;
|
|
31
32
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
32
|
-
return
|
|
33
|
+
return (0, _react2.jsx)(_AssistiveText.AssistiveText, {
|
|
33
34
|
assistiveText: intl.formatMessage(_messages.typeAheadListMessages.searchResultsLabel, {
|
|
34
35
|
itemsLength: numberOfResults
|
|
35
36
|
})
|
|
@@ -228,21 +229,21 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref2) {
|
|
|
228
229
|
style = _ref4.style,
|
|
229
230
|
parent = _ref4.parent;
|
|
230
231
|
var currentItem = items[index];
|
|
231
|
-
return
|
|
232
|
+
return (0, _react2.jsx)(_CellMeasurer.CellMeasurer, {
|
|
232
233
|
key: key,
|
|
233
234
|
cache: cache,
|
|
234
235
|
parent: parent,
|
|
235
236
|
columnIndex: 0,
|
|
236
237
|
rowIndex: index
|
|
237
|
-
},
|
|
238
|
+
}, (0, _react2.jsx)("div", {
|
|
238
239
|
style: style,
|
|
239
240
|
"data-index": index
|
|
240
|
-
},
|
|
241
|
+
}, (0, _react2.jsx)("div", {
|
|
241
242
|
"data-testid": "list-item-height-observed-".concat(index),
|
|
242
243
|
onMouseMove: function onMouseMove(e) {
|
|
243
244
|
return _onMouseMove(e, index);
|
|
244
245
|
}
|
|
245
|
-
},
|
|
246
|
+
}, (0, _react2.jsx)(_TypeAheadListItem.TypeAheadListItem, {
|
|
246
247
|
key: items[index].title,
|
|
247
248
|
item: currentItem,
|
|
248
249
|
itemsLength: items.length,
|
|
@@ -257,13 +258,13 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref2) {
|
|
|
257
258
|
return null;
|
|
258
259
|
}
|
|
259
260
|
var menuGroupId = ((_decorationElement$qu2 = decorationElement.querySelector("[role='combobox']")) === null || _decorationElement$qu2 === void 0 ? void 0 : _decorationElement$qu2.getAttribute('aria-controls')) || _constants.TYPE_AHEAD_DECORATION_ELEMENT_ID;
|
|
260
|
-
return
|
|
261
|
+
return (0, _react2.jsx)(_menu.MenuGroup, {
|
|
261
262
|
"aria-label": popupAriaLabel,
|
|
262
263
|
"aria-relevant": "additions removals"
|
|
263
|
-
},
|
|
264
|
+
}, (0, _react2.jsx)("div", {
|
|
264
265
|
id: menuGroupId,
|
|
265
266
|
ref: listContainerRef
|
|
266
|
-
},
|
|
267
|
+
}, (0, _react2.jsx)(_List.List, {
|
|
267
268
|
rowRenderer: renderRow,
|
|
268
269
|
ref: listRef,
|
|
269
270
|
rowCount: items.length,
|
|
@@ -276,7 +277,7 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref2) {
|
|
|
276
277
|
containerRole: "presentation",
|
|
277
278
|
role: "listbox",
|
|
278
279
|
css: (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n button {\n padding: ", "\n ", " 11px;\n span:last-child span:last-child {\n white-space: normal;\n }\n }\n "])), "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)")
|
|
279
|
-
}),
|
|
280
|
+
}), (0, _react2.jsx)(TypeaheadAssistiveTextPureComponent, {
|
|
280
281
|
numberOfResults: items.length.toString()
|
|
281
282
|
})));
|
|
282
283
|
});
|
|
@@ -19,6 +19,7 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
19
19
|
var _constants = require("@atlaskit/theme/constants");
|
|
20
20
|
var _messages = require("../messages");
|
|
21
21
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
22
|
+
/** @jsx jsx */
|
|
22
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); }
|
|
23
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; }
|
|
24
25
|
var ICON_HEIGHT = exports.ICON_HEIGHT = 40;
|
|
@@ -52,7 +53,7 @@ var selectionFrame = {
|
|
|
52
53
|
var selectedStyle = (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n box-shadow: inset 2px 0px 0px ", ";\n"])), "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30, ")"), "var(--ds-border-focused, ".concat(_colors.B400, ")"));
|
|
53
54
|
var FallbackIcon = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
54
55
|
var label = _ref.label;
|
|
55
|
-
return
|
|
56
|
+
return (0, _react2.jsx)(_quickInsert.IconFallback, null);
|
|
56
57
|
});
|
|
57
58
|
var noop = function noop() {};
|
|
58
59
|
var AssistiveText = function AssistiveText(_ref2) {
|
|
@@ -62,7 +63,7 @@ var AssistiveText = function AssistiveText(_ref2) {
|
|
|
62
63
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
63
64
|
var descriptionText = description ? " ".concat(intl.formatMessage(_messages.typeAheadListMessages.descriptionLabel), " ").concat(description, ".") : '';
|
|
64
65
|
var shortcutText = shortcut ? " ".concat(intl.formatMessage(_messages.typeAheadListMessages.shortcutLabel), " ").concat(shortcut, ".") : '';
|
|
65
|
-
return
|
|
66
|
+
return (0, _react2.jsx)("span", {
|
|
66
67
|
className: "assistive"
|
|
67
68
|
}, "".concat(title, ". ").concat(descriptionText, " ").concat(shortcutText));
|
|
68
69
|
};
|
|
@@ -82,9 +83,9 @@ var TypeAheadListItem = exports.TypeAheadListItem = function TypeAheadListItem(_
|
|
|
82
83
|
title = item.title,
|
|
83
84
|
customRenderItem = item.render;
|
|
84
85
|
var elementIcon = (0, _react.useMemo)(function () {
|
|
85
|
-
return
|
|
86
|
+
return (0, _react2.jsx)("div", {
|
|
86
87
|
css: itemIcon
|
|
87
|
-
}, icon ? icon() :
|
|
88
|
+
}, icon ? icon() : (0, _react2.jsx)(FallbackIcon, {
|
|
88
89
|
label: title
|
|
89
90
|
}));
|
|
90
91
|
}, [icon, title]);
|
|
@@ -112,7 +113,7 @@ var TypeAheadListItem = exports.TypeAheadListItem = function TypeAheadListItem(_
|
|
|
112
113
|
}
|
|
113
114
|
var Comp = customRenderItem;
|
|
114
115
|
var listItemClasses = [customRenderItemDivStyle, isSelected && selectedStyle];
|
|
115
|
-
return
|
|
116
|
+
return (0, _react2.jsx)("div", {
|
|
116
117
|
"aria-selected": isSelected,
|
|
117
118
|
role: "option",
|
|
118
119
|
"aria-label": ariaLabel,
|
|
@@ -124,9 +125,9 @@ var TypeAheadListItem = exports.TypeAheadListItem = function TypeAheadListItem(_
|
|
|
124
125
|
//CSS classes added for test cases purpose
|
|
125
126
|
,
|
|
126
127
|
ref: customItemRef
|
|
127
|
-
},
|
|
128
|
+
}, (0, _react2.jsx)("div", {
|
|
128
129
|
"aria-hidden": true
|
|
129
|
-
},
|
|
130
|
+
}, (0, _react2.jsx)(Comp, {
|
|
130
131
|
onClick: insertSelectedItem,
|
|
131
132
|
isSelected: false //The selection styles are handled in the parent div instead. Hence isSelected is made false always.
|
|
132
133
|
,
|
|
@@ -137,9 +138,9 @@ var TypeAheadListItem = exports.TypeAheadListItem = function TypeAheadListItem(_
|
|
|
137
138
|
return customItem;
|
|
138
139
|
}
|
|
139
140
|
var listItemClasses = [selectionFrame, isSelected && selectedStyle];
|
|
140
|
-
return
|
|
141
|
+
return (0, _react2.jsx)("span", {
|
|
141
142
|
css: listItemClasses
|
|
142
|
-
},
|
|
143
|
+
}, (0, _react2.jsx)(_menu.ButtonItem, {
|
|
143
144
|
onClick: insertSelectedItem,
|
|
144
145
|
iconBefore: elementIcon,
|
|
145
146
|
isSelected: isSelected,
|
|
@@ -152,21 +153,21 @@ var TypeAheadListItem = exports.TypeAheadListItem = function TypeAheadListItem(_
|
|
|
152
153
|
// @ts-ignore
|
|
153
154
|
,
|
|
154
155
|
css: listItemClasses
|
|
155
|
-
},
|
|
156
|
+
}, (0, _react2.jsx)("div", {
|
|
156
157
|
"aria-hidden": true
|
|
157
|
-
},
|
|
158
|
+
}, (0, _react2.jsx)("div", {
|
|
158
159
|
css: itemText
|
|
159
|
-
},
|
|
160
|
+
}, (0, _react2.jsx)("div", {
|
|
160
161
|
css: itemBody
|
|
161
|
-
},
|
|
162
|
+
}, (0, _react2.jsx)("div", {
|
|
162
163
|
className: "item-title"
|
|
163
|
-
}, item.title),
|
|
164
|
+
}, item.title), (0, _react2.jsx)("div", {
|
|
164
165
|
css: itemAfter
|
|
165
|
-
}, item.keyshortcut &&
|
|
166
|
+
}, item.keyshortcut && (0, _react2.jsx)("div", {
|
|
166
167
|
css: _shortcut.shortcutStyle
|
|
167
|
-
}, item.keyshortcut))),
|
|
168
|
+
}, item.keyshortcut))), (0, _react2.jsx)("div", {
|
|
168
169
|
className: "item-description"
|
|
169
|
-
}, item.description))),
|
|
170
|
+
}, item.description))), (0, _react2.jsx)(AssistiveText, {
|
|
170
171
|
title: item.title,
|
|
171
172
|
description: item.description,
|
|
172
173
|
shortcut: item.keyshortcut
|
|
@@ -20,6 +20,7 @@ var _constants2 = require("../constants");
|
|
|
20
20
|
var _TypeAheadList = require("./TypeAheadList");
|
|
21
21
|
var _TypeAheadListItem = require("./TypeAheadListItem");
|
|
22
22
|
var _templateObject;
|
|
23
|
+
/** @jsx jsx */
|
|
23
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); }
|
|
24
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; }
|
|
25
26
|
var DEFAULT_TYPEAHEAD_MENU_HEIGHT = 380;
|
|
@@ -199,7 +200,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
199
200
|
element === null || element === void 0 || element.removeEventListener('keydown', escape);
|
|
200
201
|
};
|
|
201
202
|
}, [ref, cancel]);
|
|
202
|
-
return
|
|
203
|
+
return (0, _react2.jsx)(_ui.Popup, {
|
|
203
204
|
zIndex: _editorSharedStyles.akEditorFloatingDialogZIndex,
|
|
204
205
|
target: anchorElement,
|
|
205
206
|
mountTo: popupsMountPoint,
|
|
@@ -208,15 +209,15 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
208
209
|
fitHeight: fitHeight,
|
|
209
210
|
fitWidth: 340,
|
|
210
211
|
offset: OFFSET
|
|
211
|
-
},
|
|
212
|
+
}, (0, _react2.jsx)("div", {
|
|
212
213
|
css: typeAheadContent,
|
|
213
214
|
tabIndex: 0,
|
|
214
215
|
className: _constants2.TYPE_AHEAD_POPUP_CONTENT_CLASS,
|
|
215
216
|
ref: ref
|
|
216
|
-
},
|
|
217
|
+
}, (0, _react2.jsx)(Highlight, {
|
|
217
218
|
state: editorView.state,
|
|
218
219
|
triggerHandler: triggerHandler
|
|
219
|
-
}),
|
|
220
|
+
}), (0, _react2.jsx)(_TypeAheadList.TypeAheadList, {
|
|
220
221
|
items: items,
|
|
221
222
|
selectedIndex: selectedIndex,
|
|
222
223
|
onItemClick: onItemInsert,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
|
|
2
4
|
import React from 'react';
|
|
3
|
-
import { css } from '@emotion/react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
4
6
|
import debounce from 'lodash/debounce';
|
|
5
7
|
const statusDebounceMillis = 1400;
|
|
6
8
|
const assitiveTextStyles = css({
|
|
@@ -61,14 +63,14 @@ class AssistveTextComponent extends React.Component {
|
|
|
61
63
|
silenced
|
|
62
64
|
} = this.state;
|
|
63
65
|
this.debounceStatusUpdate();
|
|
64
|
-
return
|
|
66
|
+
return jsx("div", {
|
|
65
67
|
css: assitiveTextStyles
|
|
66
|
-
},
|
|
68
|
+
}, jsx("div", {
|
|
67
69
|
id: id + '__status--A',
|
|
68
70
|
role: "status",
|
|
69
71
|
"aria-atomic": "true",
|
|
70
72
|
"aria-live": "polite"
|
|
71
|
-
}, `${!silenced && debounced && bump ? assistiveText : ''}`),
|
|
73
|
+
}, `${!silenced && debounced && bump ? assistiveText : ''}`), jsx("div", {
|
|
72
74
|
id: id + '__status--B',
|
|
73
75
|
role: "status",
|
|
74
76
|
"aria-atomic": "true",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React, { Fragment, useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import { useIntl } from 'react-intl-next';
|
|
4
5
|
import { keyName as keyNameNormalized } from 'w3c-keyname';
|
|
5
6
|
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
@@ -359,7 +360,7 @@ export const InputQuery = /*#__PURE__*/React.memo(({
|
|
|
359
360
|
jsx-a11y/interactive-supports-focus
|
|
360
361
|
Task added in https://product-fabric.atlassian.net/wiki/spaces/E/pages/3182068181/Potential+improvements#Moderate-changes.
|
|
361
362
|
*/
|
|
362
|
-
return
|
|
363
|
+
return jsx(Fragment, null, triggerQueryPrefix, jsx("span", {
|
|
363
364
|
css: querySpanStyles,
|
|
364
365
|
contentEditable: true,
|
|
365
366
|
ref: ref,
|
|
@@ -372,15 +373,15 @@ export const InputQuery = /*#__PURE__*/React.memo(({
|
|
|
372
373
|
"aria-labelledby": assistiveHintID,
|
|
373
374
|
suppressContentEditableWarning: true,
|
|
374
375
|
"data-query-prefix": triggerQueryPrefix
|
|
375
|
-
}, query === null ?
|
|
376
|
+
}, query === null ? jsx("input", {
|
|
376
377
|
ref: inputRef,
|
|
377
378
|
type: "text"
|
|
378
|
-
}) : query),
|
|
379
|
+
}) : query), jsx("span", {
|
|
379
380
|
id: assistiveHintID,
|
|
380
381
|
style: {
|
|
381
382
|
display: 'none'
|
|
382
383
|
}
|
|
383
|
-
}, intl.formatMessage(getAriaLabel(triggerQueryPrefix, intl)), ",", intl.formatMessage(typeAheadListMessages.inputQueryAssistiveLabel)),
|
|
384
|
+
}, intl.formatMessage(getAriaLabel(triggerQueryPrefix, intl)), ",", intl.formatMessage(typeAheadListMessages.inputQueryAssistiveLabel)), jsx(AssistiveText, {
|
|
384
385
|
assistiveText: items.length === 0 ? intl.formatMessage(typeAheadListMessages.noSearchResultsLabel, {
|
|
385
386
|
itemsLength: items.length
|
|
386
387
|
}) : '',
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
|
|
1
3
|
import React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
-
import { css } from '@emotion/react';
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
3
5
|
import { injectIntl, useIntl } from 'react-intl-next';
|
|
4
6
|
import { CellMeasurer, CellMeasurerCache } from 'react-virtualized/dist/commonjs/CellMeasurer';
|
|
5
7
|
import { List } from 'react-virtualized/dist/commonjs/List';
|
|
@@ -17,7 +19,7 @@ const TypeaheadAssistiveTextPureComponent = /*#__PURE__*/React.memo(({
|
|
|
17
19
|
numberOfResults
|
|
18
20
|
}) => {
|
|
19
21
|
const intl = useIntl();
|
|
20
|
-
return
|
|
22
|
+
return jsx(AssistiveText, {
|
|
21
23
|
assistiveText: intl.formatMessage(typeAheadListMessages.searchResultsLabel, {
|
|
22
24
|
itemsLength: numberOfResults
|
|
23
25
|
})
|
|
@@ -209,19 +211,19 @@ const TypeAheadListComponent = /*#__PURE__*/React.memo(({
|
|
|
209
211
|
parent
|
|
210
212
|
}) => {
|
|
211
213
|
const currentItem = items[index];
|
|
212
|
-
return
|
|
214
|
+
return jsx(CellMeasurer, {
|
|
213
215
|
key: key,
|
|
214
216
|
cache: cache,
|
|
215
217
|
parent: parent,
|
|
216
218
|
columnIndex: 0,
|
|
217
219
|
rowIndex: index
|
|
218
|
-
},
|
|
220
|
+
}, jsx("div", {
|
|
219
221
|
style: style,
|
|
220
222
|
"data-index": index
|
|
221
|
-
},
|
|
223
|
+
}, jsx("div", {
|
|
222
224
|
"data-testid": `list-item-height-observed-${index}`,
|
|
223
225
|
onMouseMove: e => onMouseMove(e, index)
|
|
224
|
-
},
|
|
226
|
+
}, jsx(TypeAheadListItem, {
|
|
225
227
|
key: items[index].title,
|
|
226
228
|
item: currentItem,
|
|
227
229
|
itemsLength: items.length,
|
|
@@ -236,13 +238,13 @@ const TypeAheadListComponent = /*#__PURE__*/React.memo(({
|
|
|
236
238
|
return null;
|
|
237
239
|
}
|
|
238
240
|
const menuGroupId = ((_decorationElement$qu2 = decorationElement.querySelector(`[role='combobox']`)) === null || _decorationElement$qu2 === void 0 ? void 0 : _decorationElement$qu2.getAttribute('aria-controls')) || TYPE_AHEAD_DECORATION_ELEMENT_ID;
|
|
239
|
-
return
|
|
241
|
+
return jsx(MenuGroup, {
|
|
240
242
|
"aria-label": popupAriaLabel,
|
|
241
243
|
"aria-relevant": "additions removals"
|
|
242
|
-
},
|
|
244
|
+
}, jsx("div", {
|
|
243
245
|
id: menuGroupId,
|
|
244
246
|
ref: listContainerRef
|
|
245
|
-
},
|
|
247
|
+
}, jsx(List, {
|
|
246
248
|
rowRenderer: renderRow,
|
|
247
249
|
ref: listRef,
|
|
248
250
|
rowCount: items.length,
|
|
@@ -263,7 +265,7 @@ const TypeAheadListComponent = /*#__PURE__*/React.memo(({
|
|
|
263
265
|
}
|
|
264
266
|
}
|
|
265
267
|
`
|
|
266
|
-
}),
|
|
268
|
+
}), jsx(TypeaheadAssistiveTextPureComponent, {
|
|
267
269
|
numberOfResults: items.length.toString()
|
|
268
270
|
})));
|
|
269
271
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React, { useCallback, useLayoutEffect, useMemo } from 'react';
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import { useIntl } from 'react-intl-next';
|
|
4
5
|
import { IconFallback } from '@atlaskit/editor-common/quick-insert';
|
|
5
6
|
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
@@ -85,7 +86,7 @@ const selectedStyle = css`
|
|
|
85
86
|
const FallbackIcon = /*#__PURE__*/React.memo(({
|
|
86
87
|
label
|
|
87
88
|
}) => {
|
|
88
|
-
return
|
|
89
|
+
return jsx(IconFallback, null);
|
|
89
90
|
});
|
|
90
91
|
const noop = () => {};
|
|
91
92
|
const AssistiveText = ({
|
|
@@ -96,7 +97,7 @@ const AssistiveText = ({
|
|
|
96
97
|
const intl = useIntl();
|
|
97
98
|
const descriptionText = description ? ` ${intl.formatMessage(typeAheadListMessages.descriptionLabel)} ${description}.` : '';
|
|
98
99
|
const shortcutText = shortcut ? ` ${intl.formatMessage(typeAheadListMessages.shortcutLabel)} ${shortcut}.` : '';
|
|
99
|
-
return
|
|
100
|
+
return jsx("span", {
|
|
100
101
|
className: "assistive"
|
|
101
102
|
}, `${title}. ${descriptionText} ${shortcutText}`);
|
|
102
103
|
};
|
|
@@ -119,9 +120,9 @@ export const TypeAheadListItem = ({
|
|
|
119
120
|
render: customRenderItem
|
|
120
121
|
} = item;
|
|
121
122
|
const elementIcon = useMemo(() => {
|
|
122
|
-
return
|
|
123
|
+
return jsx("div", {
|
|
123
124
|
css: itemIcon
|
|
124
|
-
}, icon ? icon() :
|
|
125
|
+
}, icon ? icon() : jsx(FallbackIcon, {
|
|
125
126
|
label: title
|
|
126
127
|
}));
|
|
127
128
|
}, [icon, title]);
|
|
@@ -149,7 +150,7 @@ export const TypeAheadListItem = ({
|
|
|
149
150
|
}
|
|
150
151
|
const Comp = customRenderItem;
|
|
151
152
|
const listItemClasses = [customRenderItemDivStyle, isSelected && selectedStyle];
|
|
152
|
-
return
|
|
153
|
+
return jsx("div", {
|
|
153
154
|
"aria-selected": isSelected,
|
|
154
155
|
role: "option",
|
|
155
156
|
"aria-label": ariaLabel,
|
|
@@ -161,9 +162,9 @@ export const TypeAheadListItem = ({
|
|
|
161
162
|
//CSS classes added for test cases purpose
|
|
162
163
|
,
|
|
163
164
|
ref: customItemRef
|
|
164
|
-
},
|
|
165
|
+
}, jsx("div", {
|
|
165
166
|
"aria-hidden": true
|
|
166
|
-
},
|
|
167
|
+
}, jsx(Comp, {
|
|
167
168
|
onClick: insertSelectedItem,
|
|
168
169
|
isSelected: false //The selection styles are handled in the parent div instead. Hence isSelected is made false always.
|
|
169
170
|
,
|
|
@@ -174,9 +175,9 @@ export const TypeAheadListItem = ({
|
|
|
174
175
|
return customItem;
|
|
175
176
|
}
|
|
176
177
|
const listItemClasses = [selectionFrame, isSelected && selectedStyle];
|
|
177
|
-
return
|
|
178
|
+
return jsx("span", {
|
|
178
179
|
css: listItemClasses
|
|
179
|
-
},
|
|
180
|
+
}, jsx(ButtonItem, {
|
|
180
181
|
onClick: insertSelectedItem,
|
|
181
182
|
iconBefore: elementIcon,
|
|
182
183
|
isSelected: isSelected,
|
|
@@ -189,21 +190,21 @@ export const TypeAheadListItem = ({
|
|
|
189
190
|
// @ts-ignore
|
|
190
191
|
,
|
|
191
192
|
css: listItemClasses
|
|
192
|
-
},
|
|
193
|
+
}, jsx("div", {
|
|
193
194
|
"aria-hidden": true
|
|
194
|
-
},
|
|
195
|
+
}, jsx("div", {
|
|
195
196
|
css: itemText
|
|
196
|
-
},
|
|
197
|
+
}, jsx("div", {
|
|
197
198
|
css: itemBody
|
|
198
|
-
},
|
|
199
|
+
}, jsx("div", {
|
|
199
200
|
className: "item-title"
|
|
200
|
-
}, item.title),
|
|
201
|
+
}, item.title), jsx("div", {
|
|
201
202
|
css: itemAfter
|
|
202
|
-
}, item.keyshortcut &&
|
|
203
|
+
}, item.keyshortcut && jsx("div", {
|
|
203
204
|
css: shortcutStyle
|
|
204
|
-
}, item.keyshortcut))),
|
|
205
|
+
}, item.keyshortcut))), jsx("div", {
|
|
205
206
|
className: "item-description"
|
|
206
|
-
}, item.description))),
|
|
207
|
+
}, item.description))), jsx(AssistiveText, {
|
|
207
208
|
title: item.title,
|
|
208
209
|
description: item.description,
|
|
209
210
|
shortcut: item.keyshortcut
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import rafSchedule from 'raf-schd';
|
|
4
5
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
6
|
import { findOverflowScrollParent, Popup } from '@atlaskit/editor-common/ui';
|
|
@@ -202,7 +203,7 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
|
|
|
202
203
|
element === null || element === void 0 ? void 0 : element.removeEventListener('keydown', escape);
|
|
203
204
|
};
|
|
204
205
|
}, [ref, cancel]);
|
|
205
|
-
return
|
|
206
|
+
return jsx(Popup, {
|
|
206
207
|
zIndex: akEditorFloatingDialogZIndex,
|
|
207
208
|
target: anchorElement,
|
|
208
209
|
mountTo: popupsMountPoint,
|
|
@@ -211,15 +212,15 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
|
|
|
211
212
|
fitHeight: fitHeight,
|
|
212
213
|
fitWidth: 340,
|
|
213
214
|
offset: OFFSET
|
|
214
|
-
},
|
|
215
|
+
}, jsx("div", {
|
|
215
216
|
css: typeAheadContent,
|
|
216
217
|
tabIndex: 0,
|
|
217
218
|
className: TYPE_AHEAD_POPUP_CONTENT_CLASS,
|
|
218
219
|
ref: ref
|
|
219
|
-
},
|
|
220
|
+
}, jsx(Highlight, {
|
|
220
221
|
state: editorView.state,
|
|
221
222
|
triggerHandler: triggerHandler
|
|
222
|
-
}),
|
|
223
|
+
}), jsx(TypeAheadList, {
|
|
223
224
|
items: items,
|
|
224
225
|
selectedIndex: selectedIndex,
|
|
225
226
|
onItemClick: onItemInsert,
|
|
@@ -7,8 +7,10 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
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); }; }
|
|
9
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; } }
|
|
10
|
+
/** @jsx jsx */
|
|
11
|
+
|
|
10
12
|
import React from 'react';
|
|
11
|
-
import { css } from '@emotion/react';
|
|
13
|
+
import { css, jsx } from '@emotion/react';
|
|
12
14
|
import debounce from 'lodash/debounce';
|
|
13
15
|
var statusDebounceMillis = 1400;
|
|
14
16
|
var assitiveTextStyles = css({
|
|
@@ -86,14 +88,14 @@ var AssistveTextComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
86
88
|
debounced = _this$state.debounced,
|
|
87
89
|
silenced = _this$state.silenced;
|
|
88
90
|
this.debounceStatusUpdate();
|
|
89
|
-
return
|
|
91
|
+
return jsx("div", {
|
|
90
92
|
css: assitiveTextStyles
|
|
91
|
-
},
|
|
93
|
+
}, jsx("div", {
|
|
92
94
|
id: id + '__status--A',
|
|
93
95
|
role: "status",
|
|
94
96
|
"aria-atomic": "true",
|
|
95
97
|
"aria-live": "polite"
|
|
96
|
-
}, "".concat(!silenced && debounced && bump ? assistiveText : '')),
|
|
98
|
+
}, "".concat(!silenced && debounced && bump ? assistiveText : '')), jsx("div", {
|
|
97
99
|
id: id + '__status--B',
|
|
98
100
|
role: "status",
|
|
99
101
|
"aria-atomic": "true",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
/** @jsx jsx */
|
|
2
3
|
import React, { Fragment, useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
4
5
|
import { useIntl } from 'react-intl-next';
|
|
5
6
|
import { keyName as keyNameNormalized } from 'w3c-keyname';
|
|
6
7
|
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
@@ -356,7 +357,7 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
356
357
|
jsx-a11y/interactive-supports-focus
|
|
357
358
|
Task added in https://product-fabric.atlassian.net/wiki/spaces/E/pages/3182068181/Potential+improvements#Moderate-changes.
|
|
358
359
|
*/
|
|
359
|
-
return
|
|
360
|
+
return jsx(Fragment, null, triggerQueryPrefix, jsx("span", {
|
|
360
361
|
css: querySpanStyles,
|
|
361
362
|
contentEditable: true,
|
|
362
363
|
ref: ref,
|
|
@@ -369,15 +370,15 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
369
370
|
"aria-labelledby": assistiveHintID,
|
|
370
371
|
suppressContentEditableWarning: true,
|
|
371
372
|
"data-query-prefix": triggerQueryPrefix
|
|
372
|
-
}, query === null ?
|
|
373
|
+
}, query === null ? jsx("input", {
|
|
373
374
|
ref: inputRef,
|
|
374
375
|
type: "text"
|
|
375
|
-
}) : query),
|
|
376
|
+
}) : query), jsx("span", {
|
|
376
377
|
id: assistiveHintID,
|
|
377
378
|
style: {
|
|
378
379
|
display: 'none'
|
|
379
380
|
}
|
|
380
|
-
}, intl.formatMessage(getAriaLabel(triggerQueryPrefix, intl)), ",", intl.formatMessage(typeAheadListMessages.inputQueryAssistiveLabel)),
|
|
381
|
+
}, intl.formatMessage(getAriaLabel(triggerQueryPrefix, intl)), ",", intl.formatMessage(typeAheadListMessages.inputQueryAssistiveLabel)), jsx(AssistiveText, {
|
|
381
382
|
assistiveText: items.length === 0 ? intl.formatMessage(typeAheadListMessages.noSearchResultsLabel, {
|
|
382
383
|
itemsLength: items.length
|
|
383
384
|
}) : '',
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
var _templateObject;
|
|
4
|
+
/** @jsx jsx */
|
|
5
|
+
|
|
4
6
|
import React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
-
import { css } from '@emotion/react';
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
6
8
|
import { injectIntl, useIntl } from 'react-intl-next';
|
|
7
9
|
import { CellMeasurer, CellMeasurerCache } from 'react-virtualized/dist/commonjs/CellMeasurer';
|
|
8
10
|
import { List } from 'react-virtualized/dist/commonjs/List';
|
|
@@ -19,7 +21,7 @@ var LIST_WIDTH = 320;
|
|
|
19
21
|
var TypeaheadAssistiveTextPureComponent = /*#__PURE__*/React.memo(function (_ref) {
|
|
20
22
|
var numberOfResults = _ref.numberOfResults;
|
|
21
23
|
var intl = useIntl();
|
|
22
|
-
return
|
|
24
|
+
return jsx(AssistiveText, {
|
|
23
25
|
assistiveText: intl.formatMessage(typeAheadListMessages.searchResultsLabel, {
|
|
24
26
|
itemsLength: numberOfResults
|
|
25
27
|
})
|
|
@@ -218,21 +220,21 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
218
220
|
style = _ref4.style,
|
|
219
221
|
parent = _ref4.parent;
|
|
220
222
|
var currentItem = items[index];
|
|
221
|
-
return
|
|
223
|
+
return jsx(CellMeasurer, {
|
|
222
224
|
key: key,
|
|
223
225
|
cache: cache,
|
|
224
226
|
parent: parent,
|
|
225
227
|
columnIndex: 0,
|
|
226
228
|
rowIndex: index
|
|
227
|
-
},
|
|
229
|
+
}, jsx("div", {
|
|
228
230
|
style: style,
|
|
229
231
|
"data-index": index
|
|
230
|
-
},
|
|
232
|
+
}, jsx("div", {
|
|
231
233
|
"data-testid": "list-item-height-observed-".concat(index),
|
|
232
234
|
onMouseMove: function onMouseMove(e) {
|
|
233
235
|
return _onMouseMove(e, index);
|
|
234
236
|
}
|
|
235
|
-
},
|
|
237
|
+
}, jsx(TypeAheadListItem, {
|
|
236
238
|
key: items[index].title,
|
|
237
239
|
item: currentItem,
|
|
238
240
|
itemsLength: items.length,
|
|
@@ -247,13 +249,13 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
247
249
|
return null;
|
|
248
250
|
}
|
|
249
251
|
var menuGroupId = ((_decorationElement$qu2 = decorationElement.querySelector("[role='combobox']")) === null || _decorationElement$qu2 === void 0 ? void 0 : _decorationElement$qu2.getAttribute('aria-controls')) || TYPE_AHEAD_DECORATION_ELEMENT_ID;
|
|
250
|
-
return
|
|
252
|
+
return jsx(MenuGroup, {
|
|
251
253
|
"aria-label": popupAriaLabel,
|
|
252
254
|
"aria-relevant": "additions removals"
|
|
253
|
-
},
|
|
255
|
+
}, jsx("div", {
|
|
254
256
|
id: menuGroupId,
|
|
255
257
|
ref: listContainerRef
|
|
256
|
-
},
|
|
258
|
+
}, jsx(List, {
|
|
257
259
|
rowRenderer: renderRow,
|
|
258
260
|
ref: listRef,
|
|
259
261
|
rowCount: items.length,
|
|
@@ -266,7 +268,7 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
266
268
|
containerRole: "presentation",
|
|
267
269
|
role: "listbox",
|
|
268
270
|
css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n button {\n padding: ", "\n ", " 11px;\n span:last-child span:last-child {\n white-space: normal;\n }\n }\n "])), "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)")
|
|
269
|
-
}),
|
|
271
|
+
}), jsx(TypeaheadAssistiveTextPureComponent, {
|
|
270
272
|
numberOfResults: items.length.toString()
|
|
271
273
|
})));
|
|
272
274
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
3
|
+
/** @jsx jsx */
|
|
3
4
|
import React, { useCallback, useLayoutEffect, useMemo } from 'react';
|
|
4
|
-
import { css } from '@emotion/react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
5
6
|
import { useIntl } from 'react-intl-next';
|
|
6
7
|
import { IconFallback } from '@atlaskit/editor-common/quick-insert';
|
|
7
8
|
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
@@ -42,7 +43,7 @@ var selectionFrame = {
|
|
|
42
43
|
var selectedStyle = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n background-color: ", ";\n box-shadow: inset 2px 0px 0px ", ";\n"])), "var(--ds-background-neutral-subtle-hovered, ".concat(N30, ")"), "var(--ds-border-focused, ".concat(B400, ")"));
|
|
43
44
|
var FallbackIcon = /*#__PURE__*/React.memo(function (_ref) {
|
|
44
45
|
var label = _ref.label;
|
|
45
|
-
return
|
|
46
|
+
return jsx(IconFallback, null);
|
|
46
47
|
});
|
|
47
48
|
var noop = function noop() {};
|
|
48
49
|
var AssistiveText = function AssistiveText(_ref2) {
|
|
@@ -52,7 +53,7 @@ var AssistiveText = function AssistiveText(_ref2) {
|
|
|
52
53
|
var intl = useIntl();
|
|
53
54
|
var descriptionText = description ? " ".concat(intl.formatMessage(typeAheadListMessages.descriptionLabel), " ").concat(description, ".") : '';
|
|
54
55
|
var shortcutText = shortcut ? " ".concat(intl.formatMessage(typeAheadListMessages.shortcutLabel), " ").concat(shortcut, ".") : '';
|
|
55
|
-
return
|
|
56
|
+
return jsx("span", {
|
|
56
57
|
className: "assistive"
|
|
57
58
|
}, "".concat(title, ". ").concat(descriptionText, " ").concat(shortcutText));
|
|
58
59
|
};
|
|
@@ -72,9 +73,9 @@ export var TypeAheadListItem = function TypeAheadListItem(_ref3) {
|
|
|
72
73
|
title = item.title,
|
|
73
74
|
customRenderItem = item.render;
|
|
74
75
|
var elementIcon = useMemo(function () {
|
|
75
|
-
return
|
|
76
|
+
return jsx("div", {
|
|
76
77
|
css: itemIcon
|
|
77
|
-
}, icon ? icon() :
|
|
78
|
+
}, icon ? icon() : jsx(FallbackIcon, {
|
|
78
79
|
label: title
|
|
79
80
|
}));
|
|
80
81
|
}, [icon, title]);
|
|
@@ -102,7 +103,7 @@ export var TypeAheadListItem = function TypeAheadListItem(_ref3) {
|
|
|
102
103
|
}
|
|
103
104
|
var Comp = customRenderItem;
|
|
104
105
|
var listItemClasses = [customRenderItemDivStyle, isSelected && selectedStyle];
|
|
105
|
-
return
|
|
106
|
+
return jsx("div", {
|
|
106
107
|
"aria-selected": isSelected,
|
|
107
108
|
role: "option",
|
|
108
109
|
"aria-label": ariaLabel,
|
|
@@ -114,9 +115,9 @@ export var TypeAheadListItem = function TypeAheadListItem(_ref3) {
|
|
|
114
115
|
//CSS classes added for test cases purpose
|
|
115
116
|
,
|
|
116
117
|
ref: customItemRef
|
|
117
|
-
},
|
|
118
|
+
}, jsx("div", {
|
|
118
119
|
"aria-hidden": true
|
|
119
|
-
},
|
|
120
|
+
}, jsx(Comp, {
|
|
120
121
|
onClick: insertSelectedItem,
|
|
121
122
|
isSelected: false //The selection styles are handled in the parent div instead. Hence isSelected is made false always.
|
|
122
123
|
,
|
|
@@ -127,9 +128,9 @@ export var TypeAheadListItem = function TypeAheadListItem(_ref3) {
|
|
|
127
128
|
return customItem;
|
|
128
129
|
}
|
|
129
130
|
var listItemClasses = [selectionFrame, isSelected && selectedStyle];
|
|
130
|
-
return
|
|
131
|
+
return jsx("span", {
|
|
131
132
|
css: listItemClasses
|
|
132
|
-
},
|
|
133
|
+
}, jsx(ButtonItem, {
|
|
133
134
|
onClick: insertSelectedItem,
|
|
134
135
|
iconBefore: elementIcon,
|
|
135
136
|
isSelected: isSelected,
|
|
@@ -142,21 +143,21 @@ export var TypeAheadListItem = function TypeAheadListItem(_ref3) {
|
|
|
142
143
|
// @ts-ignore
|
|
143
144
|
,
|
|
144
145
|
css: listItemClasses
|
|
145
|
-
},
|
|
146
|
+
}, jsx("div", {
|
|
146
147
|
"aria-hidden": true
|
|
147
|
-
},
|
|
148
|
+
}, jsx("div", {
|
|
148
149
|
css: itemText
|
|
149
|
-
},
|
|
150
|
+
}, jsx("div", {
|
|
150
151
|
css: itemBody
|
|
151
|
-
},
|
|
152
|
+
}, jsx("div", {
|
|
152
153
|
className: "item-title"
|
|
153
|
-
}, item.title),
|
|
154
|
+
}, item.title), jsx("div", {
|
|
154
155
|
css: itemAfter
|
|
155
|
-
}, item.keyshortcut &&
|
|
156
|
+
}, item.keyshortcut && jsx("div", {
|
|
156
157
|
css: shortcutStyle
|
|
157
|
-
}, item.keyshortcut))),
|
|
158
|
+
}, item.keyshortcut))), jsx("div", {
|
|
158
159
|
className: "item-description"
|
|
159
|
-
}, item.description))),
|
|
160
|
+
}, item.description))), jsx(AssistiveText, {
|
|
160
161
|
title: item.title,
|
|
161
162
|
description: item.description,
|
|
162
163
|
shortcut: item.keyshortcut
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
var _templateObject;
|
|
4
|
+
/** @jsx jsx */
|
|
4
5
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
-
import { css } from '@emotion/react';
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
6
7
|
import rafSchedule from 'raf-schd';
|
|
7
8
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
8
9
|
import { findOverflowScrollParent, Popup } from '@atlaskit/editor-common/ui';
|
|
@@ -189,7 +190,7 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
|
|
|
189
190
|
element === null || element === void 0 || element.removeEventListener('keydown', escape);
|
|
190
191
|
};
|
|
191
192
|
}, [ref, cancel]);
|
|
192
|
-
return
|
|
193
|
+
return jsx(Popup, {
|
|
193
194
|
zIndex: akEditorFloatingDialogZIndex,
|
|
194
195
|
target: anchorElement,
|
|
195
196
|
mountTo: popupsMountPoint,
|
|
@@ -198,15 +199,15 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
|
|
|
198
199
|
fitHeight: fitHeight,
|
|
199
200
|
fitWidth: 340,
|
|
200
201
|
offset: OFFSET
|
|
201
|
-
},
|
|
202
|
+
}, jsx("div", {
|
|
202
203
|
css: typeAheadContent,
|
|
203
204
|
tabIndex: 0,
|
|
204
205
|
className: TYPE_AHEAD_POPUP_CONTENT_CLASS,
|
|
205
206
|
ref: ref
|
|
206
|
-
},
|
|
207
|
+
}, jsx(Highlight, {
|
|
207
208
|
state: editorView.state,
|
|
208
209
|
triggerHandler: triggerHandler
|
|
209
|
-
}),
|
|
210
|
+
}), jsx(TypeAheadList, {
|
|
210
211
|
items: items,
|
|
211
212
|
selectedIndex: selectedIndex,
|
|
212
213
|
onItemClick: onItemInsert,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-type-ahead",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.8",
|
|
4
4
|
"description": "Type-ahead plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^35.0.0",
|
|
35
35
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
36
|
-
"@atlaskit/editor-common": "^76.
|
|
36
|
+
"@atlaskit/editor-common": "^76.25.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
39
39
|
"@atlaskit/editor-shared-styles": "^2.8.0",
|