@atlaskit/editor-common 76.36.0 → 76.37.0
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 +10 -0
- package/dist/cjs/element-browser/components/ElementSearch.js +38 -14
- package/dist/cjs/element-browser/components/StatelessElementBrowser.js +4 -2
- package/dist/cjs/element-browser/messages.js +39 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/element-browser/components/ElementSearch.js +39 -15
- package/dist/es2019/element-browser/components/StatelessElementBrowser.js +4 -2
- package/dist/es2019/element-browser/messages.js +33 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/element-browser/components/ElementSearch.js +39 -15
- package/dist/esm/element-browser/components/StatelessElementBrowser.js +4 -2
- package/dist/esm/element-browser/messages.js +33 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/element-browser/components/ElementSearch.d.ts +2 -0
- package/dist/types/element-browser/messages.d.ts +33 -0
- package/dist/types/types/hyperlink.d.ts +0 -1
- package/dist/types-ts4.5/element-browser/components/ElementSearch.d.ts +2 -0
- package/dist/types-ts4.5/element-browser/messages.d.ts +33 -0
- package/dist/types-ts4.5/types/hyperlink.d.ts +0 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 76.37.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#66364](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/66364) [`212c782cb7a6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/212c782cb7a6) - No longer require `cardOptions` to be passed to the hyperlink plugin configuration, it exposes a new optional way to skip analytics via the prependToolbarButtons action.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#60550](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/60550) [`3016a811c0c7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3016a811c0c7) - ECA11Y-92 Added assistive hidden message which are announcing for the screen reader when do any actions at the search field
|
|
12
|
+
|
|
3
13
|
## 76.36.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -18,6 +18,7 @@ var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
|
|
|
18
18
|
var _colors = require("@atlaskit/theme/colors");
|
|
19
19
|
var _constants = require("../constants");
|
|
20
20
|
var _useFocus = _interopRequireDefault(require("../hooks/use-focus"));
|
|
21
|
+
var _messages = _interopRequireDefault(require("../messages"));
|
|
21
22
|
var _types = require("../types");
|
|
22
23
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
23
24
|
/** @jsx jsx */
|
|
@@ -30,14 +31,39 @@ function ElementSearch(_ref) {
|
|
|
30
31
|
focus = _ref.focus,
|
|
31
32
|
onClick = _ref.onClick,
|
|
32
33
|
onKeyDown = _ref.onKeyDown,
|
|
33
|
-
searchTerm = _ref.searchTerm
|
|
34
|
+
searchTerm = _ref.searchTerm,
|
|
35
|
+
items = _ref.items;
|
|
34
36
|
var ref = (0, _useFocus.default)(focus);
|
|
37
|
+
var assistiveTextRef = (0, _react.useRef)(null);
|
|
38
|
+
(0, _react.useLayoutEffect)(function () {
|
|
39
|
+
if (assistiveTextRef) {
|
|
40
|
+
var assistiveDiv = assistiveTextRef.current;
|
|
41
|
+
/**
|
|
42
|
+
* We need to remove and set attributes, for the proper working of screen readers.
|
|
43
|
+
*/
|
|
44
|
+
assistiveDiv === null || assistiveDiv === void 0 || assistiveDiv.removeAttribute('aria-live');
|
|
45
|
+
assistiveDiv === null || assistiveDiv === void 0 || assistiveDiv.setAttribute('aria-live', 'polite');
|
|
46
|
+
}
|
|
47
|
+
}, [items, formatMessage]);
|
|
35
48
|
var onChange = function onChange(_ref2) {
|
|
36
49
|
var value = _ref2.target.value;
|
|
37
50
|
onSearch(value);
|
|
38
51
|
};
|
|
39
52
|
var onFocus = function onFocus(e) {};
|
|
40
53
|
var onBlur = function onBlur(e) {};
|
|
54
|
+
var getFormattedMessage = function getFormattedMessage(itemsCount) {
|
|
55
|
+
if (searchTerm === '') {
|
|
56
|
+
return "".concat(itemsCount, " ").concat(formatMessage(_messages.default.assistiveTextSuggestionsDefault));
|
|
57
|
+
}
|
|
58
|
+
if (itemsCount > 1) {
|
|
59
|
+
return "".concat(itemsCount, " ").concat(formatMessage(_messages.default.assistiveTextSuggestions));
|
|
60
|
+
}
|
|
61
|
+
if (itemsCount === 1) {
|
|
62
|
+
return "".concat(itemsCount, " ").concat(formatMessage(_messages.default.assistiveTextSuggestion));
|
|
63
|
+
}
|
|
64
|
+
return formatMessage(_messages.default.assistiveTextSuggestionNothing);
|
|
65
|
+
};
|
|
66
|
+
var assistiveMessage = getFormattedMessage(items === null || items === void 0 ? void 0 : items.length);
|
|
41
67
|
return (0, _react2.jsx)("div", {
|
|
42
68
|
css: [wrapper, mode === _types.Modes.inline && wrapperInline]
|
|
43
69
|
}, (0, _react2.jsx)(_textfield.default, {
|
|
@@ -60,22 +86,20 @@ function ElementSearch(_ref) {
|
|
|
60
86
|
"data-testid": "element_search__element_after_input"
|
|
61
87
|
}, (0, _react2.jsx)("div", {
|
|
62
88
|
css: styledShortcut
|
|
63
|
-
}, "\u23CE ", formatMessage(elementAfterInputMessage))),
|
|
64
|
-
placeholder: formatMessage(placeHolderMessage),
|
|
89
|
+
}, "\u23CE ", formatMessage(_messages.default.elementAfterInputMessage))),
|
|
90
|
+
placeholder: formatMessage(_messages.default.placeHolderMessage),
|
|
65
91
|
"aria-label": "search",
|
|
92
|
+
"aria-labelledby": "search-assistive",
|
|
93
|
+
className: "js-search-input",
|
|
66
94
|
value: searchTerm
|
|
67
|
-
}))
|
|
95
|
+
}), (0, _react2.jsx)("span", {
|
|
96
|
+
id: "search-assistive",
|
|
97
|
+
ref: assistiveTextRef,
|
|
98
|
+
"aria-live": "polite",
|
|
99
|
+
"aria-atomic": "true",
|
|
100
|
+
className: "assistive"
|
|
101
|
+
}, assistiveMessage));
|
|
68
102
|
}
|
|
69
|
-
var elementAfterInputMessage = {
|
|
70
|
-
id: 'fabric.editor.elementbrowser.searchbar.elementAfterInput',
|
|
71
|
-
defaultMessage: 'Enter',
|
|
72
|
-
description: 'Enter to insert'
|
|
73
|
-
};
|
|
74
|
-
var placeHolderMessage = {
|
|
75
|
-
id: 'fabric.editor.elementbrowser.searchbar.placeholder',
|
|
76
|
-
defaultMessage: 'Search',
|
|
77
|
-
description: 'Search field placeholder'
|
|
78
|
-
};
|
|
79
103
|
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);
|
|
80
104
|
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);
|
|
81
105
|
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);
|
|
@@ -168,7 +168,8 @@ function MobileBrowser(_ref) {
|
|
|
168
168
|
mode: mode,
|
|
169
169
|
focus: focusOnSearch,
|
|
170
170
|
onClick: setFocusOnSearch,
|
|
171
|
-
searchTerm: searchTerm
|
|
171
|
+
searchTerm: searchTerm,
|
|
172
|
+
items: items
|
|
172
173
|
}), showCategories && (0, _react2.jsx)("nav", {
|
|
173
174
|
css: mobileCategoryListWrapper,
|
|
174
175
|
tabIndex: -1
|
|
@@ -247,7 +248,8 @@ function DesktopBrowser(_ref2) {
|
|
|
247
248
|
mode: mode,
|
|
248
249
|
focus: focusOnSearch,
|
|
249
250
|
onClick: setFocusOnSearch,
|
|
250
|
-
searchTerm: searchTerm
|
|
251
|
+
searchTerm: searchTerm,
|
|
252
|
+
items: items
|
|
251
253
|
})), (0, _react2.jsx)(_ElementList.default, {
|
|
252
254
|
items: items,
|
|
253
255
|
mode: mode,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactIntlNext = require("react-intl-next");
|
|
8
|
+
var _default = exports.default = (0, _reactIntlNext.defineMessages)({
|
|
9
|
+
elementAfterInputMessage: {
|
|
10
|
+
id: 'fabric.editor.elementbrowser.searchbar.elementAfterInput',
|
|
11
|
+
defaultMessage: 'Enter',
|
|
12
|
+
description: 'Enter to insert'
|
|
13
|
+
},
|
|
14
|
+
placeHolderMessage: {
|
|
15
|
+
id: 'fabric.editor.elementbrowser.searchbar.placeholder',
|
|
16
|
+
defaultMessage: 'Search',
|
|
17
|
+
description: 'Search field placeholder'
|
|
18
|
+
},
|
|
19
|
+
assistiveTextSuggestionsDefault: {
|
|
20
|
+
id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
|
|
21
|
+
defaultMessage: 'suggestions available by default.',
|
|
22
|
+
description: 'Assistive text to describe the default list of suggestions'
|
|
23
|
+
},
|
|
24
|
+
assistiveTextSuggestions: {
|
|
25
|
+
id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
|
|
26
|
+
defaultMessage: '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: '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'
|
|
38
|
+
}
|
|
39
|
+
});
|
|
@@ -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 = "76.
|
|
19
|
+
var packageVersion = "76.37.0";
|
|
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
|
|
@@ -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 = "76.
|
|
25
|
+
var packageVersion = "76.37.0";
|
|
26
26
|
var halfFocusRing = 1;
|
|
27
27
|
var dropOffset = '0, 8';
|
|
28
28
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import React, { memo } from 'react';
|
|
2
|
+
import React, { memo, useLayoutEffect, useRef } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { injectIntl } from 'react-intl-next';
|
|
5
5
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
@@ -10,6 +10,7 @@ import Textfield from '@atlaskit/textfield';
|
|
|
10
10
|
import { N200 } from '@atlaskit/theme/colors';
|
|
11
11
|
import { GRID_SIZE, SEARCH_ITEM_HEIGHT_WIDTH } from '../constants';
|
|
12
12
|
import useFocus from '../hooks/use-focus';
|
|
13
|
+
import commonMessages from '../messages';
|
|
13
14
|
import { Modes } from '../types';
|
|
14
15
|
function ElementSearch({
|
|
15
16
|
onSearch,
|
|
@@ -20,9 +21,21 @@ function ElementSearch({
|
|
|
20
21
|
focus,
|
|
21
22
|
onClick,
|
|
22
23
|
onKeyDown,
|
|
23
|
-
searchTerm
|
|
24
|
+
searchTerm,
|
|
25
|
+
items
|
|
24
26
|
}) {
|
|
25
27
|
const ref = useFocus(focus);
|
|
28
|
+
const assistiveTextRef = useRef(null);
|
|
29
|
+
useLayoutEffect(() => {
|
|
30
|
+
if (assistiveTextRef) {
|
|
31
|
+
const assistiveDiv = assistiveTextRef.current;
|
|
32
|
+
/**
|
|
33
|
+
* We need to remove and set attributes, for the proper working of screen readers.
|
|
34
|
+
*/
|
|
35
|
+
assistiveDiv === null || assistiveDiv === void 0 ? void 0 : assistiveDiv.removeAttribute('aria-live');
|
|
36
|
+
assistiveDiv === null || assistiveDiv === void 0 ? void 0 : assistiveDiv.setAttribute('aria-live', 'polite');
|
|
37
|
+
}
|
|
38
|
+
}, [items, formatMessage]);
|
|
26
39
|
const onChange = ({
|
|
27
40
|
target: {
|
|
28
41
|
value
|
|
@@ -32,6 +45,19 @@ function ElementSearch({
|
|
|
32
45
|
};
|
|
33
46
|
const onFocus = e => {};
|
|
34
47
|
const onBlur = e => {};
|
|
48
|
+
const getFormattedMessage = itemsCount => {
|
|
49
|
+
if (searchTerm === '') {
|
|
50
|
+
return `${itemsCount} ${formatMessage(commonMessages.assistiveTextSuggestionsDefault)}`;
|
|
51
|
+
}
|
|
52
|
+
if (itemsCount > 1) {
|
|
53
|
+
return `${itemsCount} ${formatMessage(commonMessages.assistiveTextSuggestions)}`;
|
|
54
|
+
}
|
|
55
|
+
if (itemsCount === 1) {
|
|
56
|
+
return `${itemsCount} ${formatMessage(commonMessages.assistiveTextSuggestion)}`;
|
|
57
|
+
}
|
|
58
|
+
return formatMessage(commonMessages.assistiveTextSuggestionNothing);
|
|
59
|
+
};
|
|
60
|
+
const assistiveMessage = getFormattedMessage(items === null || items === void 0 ? void 0 : items.length);
|
|
35
61
|
return jsx("div", {
|
|
36
62
|
css: [wrapper, mode === Modes.inline && wrapperInline]
|
|
37
63
|
}, jsx(Textfield, {
|
|
@@ -54,22 +80,20 @@ function ElementSearch({
|
|
|
54
80
|
"data-testid": "element_search__element_after_input"
|
|
55
81
|
}, jsx("div", {
|
|
56
82
|
css: styledShortcut
|
|
57
|
-
}, "\u23CE ", formatMessage(elementAfterInputMessage))),
|
|
58
|
-
placeholder: formatMessage(placeHolderMessage),
|
|
83
|
+
}, "\u23CE ", formatMessage(commonMessages.elementAfterInputMessage))),
|
|
84
|
+
placeholder: formatMessage(commonMessages.placeHolderMessage),
|
|
59
85
|
"aria-label": "search",
|
|
86
|
+
"aria-labelledby": "search-assistive",
|
|
87
|
+
className: "js-search-input",
|
|
60
88
|
value: searchTerm
|
|
61
|
-
})
|
|
89
|
+
}), jsx("span", {
|
|
90
|
+
id: "search-assistive",
|
|
91
|
+
ref: assistiveTextRef,
|
|
92
|
+
"aria-live": "polite",
|
|
93
|
+
"aria-atomic": "true",
|
|
94
|
+
className: "assistive"
|
|
95
|
+
}, assistiveMessage));
|
|
62
96
|
}
|
|
63
|
-
const elementAfterInputMessage = {
|
|
64
|
-
id: 'fabric.editor.elementbrowser.searchbar.elementAfterInput',
|
|
65
|
-
defaultMessage: 'Enter',
|
|
66
|
-
description: 'Enter to insert'
|
|
67
|
-
};
|
|
68
|
-
const placeHolderMessage = {
|
|
69
|
-
id: 'fabric.editor.elementbrowser.searchbar.placeholder',
|
|
70
|
-
defaultMessage: 'Search',
|
|
71
|
-
description: 'Search field placeholder'
|
|
72
|
-
};
|
|
73
97
|
const styledShortcut = css`
|
|
74
98
|
${shortcutStyle}
|
|
75
99
|
padding: ${GRID_SIZE / 2}px ${GRID_SIZE}px;
|
|
@@ -238,7 +238,8 @@ function MobileBrowser({
|
|
|
238
238
|
mode: mode,
|
|
239
239
|
focus: focusOnSearch,
|
|
240
240
|
onClick: setFocusOnSearch,
|
|
241
|
-
searchTerm: searchTerm
|
|
241
|
+
searchTerm: searchTerm,
|
|
242
|
+
items: items
|
|
242
243
|
}), showCategories && jsx("nav", {
|
|
243
244
|
css: mobileCategoryListWrapper,
|
|
244
245
|
tabIndex: -1
|
|
@@ -318,7 +319,8 @@ function DesktopBrowser({
|
|
|
318
319
|
mode: mode,
|
|
319
320
|
focus: focusOnSearch,
|
|
320
321
|
onClick: setFocusOnSearch,
|
|
321
|
-
searchTerm: searchTerm
|
|
322
|
+
searchTerm: searchTerm,
|
|
323
|
+
items: items
|
|
322
324
|
})), jsx(ElementList, {
|
|
323
325
|
items: items,
|
|
324
326
|
mode: mode,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export default defineMessages({
|
|
3
|
+
elementAfterInputMessage: {
|
|
4
|
+
id: 'fabric.editor.elementbrowser.searchbar.elementAfterInput',
|
|
5
|
+
defaultMessage: 'Enter',
|
|
6
|
+
description: 'Enter to insert'
|
|
7
|
+
},
|
|
8
|
+
placeHolderMessage: {
|
|
9
|
+
id: 'fabric.editor.elementbrowser.searchbar.placeholder',
|
|
10
|
+
defaultMessage: 'Search',
|
|
11
|
+
description: 'Search field placeholder'
|
|
12
|
+
},
|
|
13
|
+
assistiveTextSuggestionsDefault: {
|
|
14
|
+
id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
|
|
15
|
+
defaultMessage: 'suggestions available by default.',
|
|
16
|
+
description: 'Assistive text to describe the default list of suggestions'
|
|
17
|
+
},
|
|
18
|
+
assistiveTextSuggestions: {
|
|
19
|
+
id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
|
|
20
|
+
defaultMessage: '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: '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'
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -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 = "76.
|
|
3
|
+
const packageVersion = "76.37.0";
|
|
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
|
|
@@ -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 = "76.
|
|
10
|
+
const packageVersion = "76.37.0";
|
|
11
11
|
const halfFocusRing = 1;
|
|
12
12
|
const dropOffset = '0, 8';
|
|
13
13
|
class DropList extends Component {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import React, { memo } from 'react';
|
|
4
|
+
import React, { memo, useLayoutEffect, useRef } from 'react';
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
7
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
@@ -12,6 +12,7 @@ import Textfield from '@atlaskit/textfield';
|
|
|
12
12
|
import { N200 } from '@atlaskit/theme/colors';
|
|
13
13
|
import { GRID_SIZE, SEARCH_ITEM_HEIGHT_WIDTH } from '../constants';
|
|
14
14
|
import useFocus from '../hooks/use-focus';
|
|
15
|
+
import commonMessages from '../messages';
|
|
15
16
|
import { Modes } from '../types';
|
|
16
17
|
function ElementSearch(_ref) {
|
|
17
18
|
var onSearch = _ref.onSearch,
|
|
@@ -20,14 +21,39 @@ function ElementSearch(_ref) {
|
|
|
20
21
|
focus = _ref.focus,
|
|
21
22
|
onClick = _ref.onClick,
|
|
22
23
|
onKeyDown = _ref.onKeyDown,
|
|
23
|
-
searchTerm = _ref.searchTerm
|
|
24
|
+
searchTerm = _ref.searchTerm,
|
|
25
|
+
items = _ref.items;
|
|
24
26
|
var ref = useFocus(focus);
|
|
27
|
+
var assistiveTextRef = useRef(null);
|
|
28
|
+
useLayoutEffect(function () {
|
|
29
|
+
if (assistiveTextRef) {
|
|
30
|
+
var assistiveDiv = assistiveTextRef.current;
|
|
31
|
+
/**
|
|
32
|
+
* We need to remove and set attributes, for the proper working of screen readers.
|
|
33
|
+
*/
|
|
34
|
+
assistiveDiv === null || assistiveDiv === void 0 || assistiveDiv.removeAttribute('aria-live');
|
|
35
|
+
assistiveDiv === null || assistiveDiv === void 0 || assistiveDiv.setAttribute('aria-live', 'polite');
|
|
36
|
+
}
|
|
37
|
+
}, [items, formatMessage]);
|
|
25
38
|
var onChange = function onChange(_ref2) {
|
|
26
39
|
var value = _ref2.target.value;
|
|
27
40
|
onSearch(value);
|
|
28
41
|
};
|
|
29
42
|
var onFocus = function onFocus(e) {};
|
|
30
43
|
var onBlur = function onBlur(e) {};
|
|
44
|
+
var getFormattedMessage = function getFormattedMessage(itemsCount) {
|
|
45
|
+
if (searchTerm === '') {
|
|
46
|
+
return "".concat(itemsCount, " ").concat(formatMessage(commonMessages.assistiveTextSuggestionsDefault));
|
|
47
|
+
}
|
|
48
|
+
if (itemsCount > 1) {
|
|
49
|
+
return "".concat(itemsCount, " ").concat(formatMessage(commonMessages.assistiveTextSuggestions));
|
|
50
|
+
}
|
|
51
|
+
if (itemsCount === 1) {
|
|
52
|
+
return "".concat(itemsCount, " ").concat(formatMessage(commonMessages.assistiveTextSuggestion));
|
|
53
|
+
}
|
|
54
|
+
return formatMessage(commonMessages.assistiveTextSuggestionNothing);
|
|
55
|
+
};
|
|
56
|
+
var assistiveMessage = getFormattedMessage(items === null || items === void 0 ? void 0 : items.length);
|
|
31
57
|
return jsx("div", {
|
|
32
58
|
css: [wrapper, mode === Modes.inline && wrapperInline]
|
|
33
59
|
}, jsx(Textfield, {
|
|
@@ -50,22 +76,20 @@ function ElementSearch(_ref) {
|
|
|
50
76
|
"data-testid": "element_search__element_after_input"
|
|
51
77
|
}, jsx("div", {
|
|
52
78
|
css: styledShortcut
|
|
53
|
-
}, "\u23CE ", formatMessage(elementAfterInputMessage))),
|
|
54
|
-
placeholder: formatMessage(placeHolderMessage),
|
|
79
|
+
}, "\u23CE ", formatMessage(commonMessages.elementAfterInputMessage))),
|
|
80
|
+
placeholder: formatMessage(commonMessages.placeHolderMessage),
|
|
55
81
|
"aria-label": "search",
|
|
82
|
+
"aria-labelledby": "search-assistive",
|
|
83
|
+
className: "js-search-input",
|
|
56
84
|
value: searchTerm
|
|
57
|
-
})
|
|
85
|
+
}), jsx("span", {
|
|
86
|
+
id: "search-assistive",
|
|
87
|
+
ref: assistiveTextRef,
|
|
88
|
+
"aria-live": "polite",
|
|
89
|
+
"aria-atomic": "true",
|
|
90
|
+
className: "assistive"
|
|
91
|
+
}, assistiveMessage));
|
|
58
92
|
}
|
|
59
|
-
var elementAfterInputMessage = {
|
|
60
|
-
id: 'fabric.editor.elementbrowser.searchbar.elementAfterInput',
|
|
61
|
-
defaultMessage: 'Enter',
|
|
62
|
-
description: 'Enter to insert'
|
|
63
|
-
};
|
|
64
|
-
var placeHolderMessage = {
|
|
65
|
-
id: 'fabric.editor.elementbrowser.searchbar.placeholder',
|
|
66
|
-
defaultMessage: 'Search',
|
|
67
|
-
description: 'Search field placeholder'
|
|
68
|
-
};
|
|
69
93
|
var styledShortcut = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n padding: ", "px ", "px;\n width: ", "px;\n"])), shortcutStyle, GRID_SIZE / 2, GRID_SIZE, GRID_SIZE * 6);
|
|
70
94
|
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);
|
|
71
95
|
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);
|
|
@@ -158,7 +158,8 @@ function MobileBrowser(_ref) {
|
|
|
158
158
|
mode: mode,
|
|
159
159
|
focus: focusOnSearch,
|
|
160
160
|
onClick: setFocusOnSearch,
|
|
161
|
-
searchTerm: searchTerm
|
|
161
|
+
searchTerm: searchTerm,
|
|
162
|
+
items: items
|
|
162
163
|
}), showCategories && jsx("nav", {
|
|
163
164
|
css: mobileCategoryListWrapper,
|
|
164
165
|
tabIndex: -1
|
|
@@ -237,7 +238,8 @@ function DesktopBrowser(_ref2) {
|
|
|
237
238
|
mode: mode,
|
|
238
239
|
focus: focusOnSearch,
|
|
239
240
|
onClick: setFocusOnSearch,
|
|
240
|
-
searchTerm: searchTerm
|
|
241
|
+
searchTerm: searchTerm,
|
|
242
|
+
items: items
|
|
241
243
|
})), jsx(ElementList, {
|
|
242
244
|
items: items,
|
|
243
245
|
mode: mode,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export default defineMessages({
|
|
3
|
+
elementAfterInputMessage: {
|
|
4
|
+
id: 'fabric.editor.elementbrowser.searchbar.elementAfterInput',
|
|
5
|
+
defaultMessage: 'Enter',
|
|
6
|
+
description: 'Enter to insert'
|
|
7
|
+
},
|
|
8
|
+
placeHolderMessage: {
|
|
9
|
+
id: 'fabric.editor.elementbrowser.searchbar.placeholder',
|
|
10
|
+
defaultMessage: 'Search',
|
|
11
|
+
description: 'Search field placeholder'
|
|
12
|
+
},
|
|
13
|
+
assistiveTextSuggestionsDefault: {
|
|
14
|
+
id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
|
|
15
|
+
defaultMessage: 'suggestions available by default.',
|
|
16
|
+
description: 'Assistive text to describe the default list of suggestions'
|
|
17
|
+
},
|
|
18
|
+
assistiveTextSuggestions: {
|
|
19
|
+
id: 'fabric.editor.elementbrowser.searchbar.assistive.text.suggestions',
|
|
20
|
+
defaultMessage: '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: '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'
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -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 = "76.
|
|
9
|
+
var packageVersion = "76.37.0";
|
|
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
|
|
@@ -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 = "76.
|
|
20
|
+
var packageVersion = "76.37.0";
|
|
21
21
|
var halfFocusRing = 1;
|
|
22
22
|
var dropOffset = '0, 8';
|
|
23
23
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { QuickInsertItem } from '../../provider-factory';
|
|
4
5
|
import { Modes } from '../types';
|
|
5
6
|
interface Props {
|
|
6
7
|
onSearch: (value: string) => void;
|
|
@@ -9,6 +10,7 @@ interface Props {
|
|
|
9
10
|
onClick: (e: React.MouseEvent) => void;
|
|
10
11
|
onKeyDown: (e: React.KeyboardEvent) => void;
|
|
11
12
|
searchTerm?: string;
|
|
13
|
+
items: QuickInsertItem[];
|
|
12
14
|
}
|
|
13
15
|
declare const MemoizedElementSearchWithAnalytics: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<Props & WrappedComponentProps<"intl">, "intl"> & {
|
|
14
16
|
forwardedRef?: React.Ref<any> | undefined;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
elementAfterInputMessage: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
placeHolderMessage: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
assistiveTextSuggestionsDefault: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
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: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export default _default;
|
|
@@ -28,7 +28,6 @@ export interface LinkingOptions {
|
|
|
28
28
|
* Configuration for the Hyperlink plugin
|
|
29
29
|
*/
|
|
30
30
|
export interface HyperlinkPluginOptions {
|
|
31
|
-
cardOptions?: CardOptions;
|
|
32
31
|
linkPicker?: LinkPickerOptions;
|
|
33
32
|
platform?: 'mobile' | 'web';
|
|
34
33
|
editorAppearance?: EditorAppearance;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { QuickInsertItem } from '../../provider-factory';
|
|
4
5
|
import { Modes } from '../types';
|
|
5
6
|
interface Props {
|
|
6
7
|
onSearch: (value: string) => void;
|
|
@@ -9,6 +10,7 @@ interface Props {
|
|
|
9
10
|
onClick: (e: React.MouseEvent) => void;
|
|
10
11
|
onKeyDown: (e: React.KeyboardEvent) => void;
|
|
11
12
|
searchTerm?: string;
|
|
13
|
+
items: QuickInsertItem[];
|
|
12
14
|
}
|
|
13
15
|
declare const MemoizedElementSearchWithAnalytics: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<Props & WrappedComponentProps<"intl">, "intl"> & {
|
|
14
16
|
forwardedRef?: React.Ref<any> | undefined;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
elementAfterInputMessage: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
placeHolderMessage: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
assistiveTextSuggestionsDefault: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
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: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export default _default;
|
|
@@ -28,7 +28,6 @@ export interface LinkingOptions {
|
|
|
28
28
|
* Configuration for the Hyperlink plugin
|
|
29
29
|
*/
|
|
30
30
|
export interface HyperlinkPluginOptions {
|
|
31
|
-
cardOptions?: CardOptions;
|
|
32
31
|
linkPicker?: LinkPickerOptions;
|
|
33
32
|
platform?: 'mobile' | 'web';
|
|
34
33
|
editorAppearance?: EditorAppearance;
|
package/package.json
CHANGED