@atlaskit/link-picker 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/ui/link-picker/search-results/index.js +2 -1
- package/dist/cjs/ui/link-picker/search-results/link-search-list/index.js +7 -2
- package/dist/cjs/ui/main.js +1 -1
- package/dist/es2019/ui/link-picker/search-results/index.js +2 -1
- package/dist/es2019/ui/link-picker/search-results/link-search-list/index.js +6 -1
- package/dist/es2019/ui/main.js +1 -1
- package/dist/esm/ui/link-picker/search-results/index.js +2 -1
- package/dist/esm/ui/link-picker/search-results/link-search-list/index.js +7 -2
- package/dist/esm/ui/main.js +1 -1
- package/dist/types/ui/link-picker/search-results/link-search-list/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/index.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/link-picker
|
|
2
2
|
|
|
3
|
+
## 3.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#122927](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122927)
|
|
8
|
+
[`1a18023f54f1c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1a18023f54f1c) -
|
|
9
|
+
EDM-11900 adding a wrapper with correct id so aria-controls can find the right element for a11y
|
|
10
|
+
|
|
3
11
|
## 3.0.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -93,6 +93,7 @@ var SearchResults = exports.SearchResults = function SearchResults(_ref) {
|
|
|
93
93
|
onKeyDown: handleKeyDown,
|
|
94
94
|
hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
|
|
95
95
|
activePlugin: activePlugin,
|
|
96
|
-
adaptiveHeight: adaptiveHeight
|
|
96
|
+
adaptiveHeight: adaptiveHeight,
|
|
97
|
+
tabPanelId: "".concat(testIds.tabList, "-").concat(activeTab, "-tab")
|
|
97
98
|
}), error ? (_activePlugin$errorFa = activePlugin === null || activePlugin === void 0 || (_activePlugin$errorFa2 = activePlugin.errorFallback) === null || _activePlugin$errorFa2 === void 0 ? void 0 : _activePlugin$errorFa2.call(activePlugin, error, retry)) !== null && _activePlugin$errorFa !== void 0 ? _activePlugin$errorFa : /*#__PURE__*/React.createElement(_linkSearchError.LinkSearchError, null) : null));
|
|
98
99
|
};
|
|
@@ -23,7 +23,7 @@ var _handleNavKeyDown = require("../../../../common/utils/handleNavKeyDown");
|
|
|
23
23
|
var _linkSearchNoResults = require("./link-search-no-results");
|
|
24
24
|
var _listItem = require("./list-item");
|
|
25
25
|
var _useTrackResultsShown = require("./use-track-results-shown");
|
|
26
|
-
var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "ariaReadOnly", "role", "id", "hasSearchTerm", "activePlugin", "adaptiveHeight", "className"];
|
|
26
|
+
var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "ariaReadOnly", "role", "id", "hasSearchTerm", "activePlugin", "adaptiveHeight", "className", "tabPanelId"];
|
|
27
27
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
28
28
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
29
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -78,6 +78,7 @@ var LinkSearchList = exports.LinkSearchList = /*#__PURE__*/(0, _react.forwardRef
|
|
|
78
78
|
activePlugin = _ref.activePlugin,
|
|
79
79
|
adaptiveHeight = _ref.adaptiveHeight,
|
|
80
80
|
className = _ref.className,
|
|
81
|
+
tabPanelId = _ref.tabPanelId,
|
|
81
82
|
restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
82
83
|
var itemsContent;
|
|
83
84
|
var loadingContent;
|
|
@@ -123,11 +124,14 @@ var LinkSearchList = exports.LinkSearchList = /*#__PURE__*/(0, _react.forwardRef
|
|
|
123
124
|
var emptyState = activePlugin === null || activePlugin === void 0 || (_activePlugin$emptySt = activePlugin.emptyStateNoResults) === null || _activePlugin$emptySt === void 0 ? void 0 : _activePlugin$emptySt.call(activePlugin);
|
|
124
125
|
if (emptyState) {
|
|
125
126
|
return /*#__PURE__*/React.createElement("div", {
|
|
127
|
+
id: tabPanelId,
|
|
126
128
|
className: (0, _runtime.ax)([styles.emptyStateNoResultsWrapper])
|
|
127
129
|
}, emptyState);
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
|
-
return /*#__PURE__*/React.createElement(
|
|
132
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
133
|
+
id: tabPanelId
|
|
134
|
+
}, /*#__PURE__*/React.createElement(_linkSearchNoResults.NoResults, null));
|
|
131
135
|
}
|
|
132
136
|
var listItemNameMaxLines = activePlugin === null || activePlugin === void 0 || (_activePlugin$uiOptio = activePlugin.uiOptions) === null || _activePlugin$uiOptio === void 0 ? void 0 : _activePlugin$uiOptio.listItemNameMaxLines;
|
|
133
137
|
if (items && items.length > 0) {
|
|
@@ -183,6 +187,7 @@ var LinkSearchList = exports.LinkSearchList = /*#__PURE__*/(0, _react.forwardRef
|
|
|
183
187
|
}));
|
|
184
188
|
}
|
|
185
189
|
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
|
|
190
|
+
id: tabPanelId,
|
|
186
191
|
ref: ref,
|
|
187
192
|
className: (0, _runtime.ax)(["_1bsb1osq _ca0qidpf _1tkeys9h _19pkpxbi _otyrpxbi _16jlkb7n _1e0c1txw _2lx21bp4", className])
|
|
188
193
|
}, restProps), itemsContent, loadingContent);
|
package/dist/cjs/ui/main.js
CHANGED
|
@@ -26,7 +26,7 @@ var testIds = exports.testIds = {
|
|
|
26
26
|
};
|
|
27
27
|
var PACKAGE_DATA = exports.PACKAGE_DATA = {
|
|
28
28
|
packageName: "@atlaskit/link-picker" || '',
|
|
29
|
-
packageVersion: "3.0.
|
|
29
|
+
packageVersion: "3.0.3" || '',
|
|
30
30
|
componentName: _constants.COMPONENT_NAME,
|
|
31
31
|
source: _constants.COMPONENT_NAME
|
|
32
32
|
};
|
|
@@ -81,6 +81,7 @@ export const SearchResults = ({
|
|
|
81
81
|
onKeyDown: handleKeyDown,
|
|
82
82
|
hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
|
|
83
83
|
activePlugin: activePlugin,
|
|
84
|
-
adaptiveHeight: adaptiveHeight
|
|
84
|
+
adaptiveHeight: adaptiveHeight,
|
|
85
|
+
tabPanelId: `${testIds.tabList}-${activeTab}-tab`
|
|
85
86
|
}), error ? (_activePlugin$errorFa = activePlugin === null || activePlugin === void 0 ? void 0 : (_activePlugin$errorFa2 = activePlugin.errorFallback) === null || _activePlugin$errorFa2 === void 0 ? void 0 : _activePlugin$errorFa2.call(activePlugin, error, retry)) !== null && _activePlugin$errorFa !== void 0 ? _activePlugin$errorFa : /*#__PURE__*/React.createElement(LinkSearchError, null) : null));
|
|
86
87
|
};
|
|
@@ -64,6 +64,7 @@ export const LinkSearchList = /*#__PURE__*/forwardRef(({
|
|
|
64
64
|
activePlugin,
|
|
65
65
|
adaptiveHeight,
|
|
66
66
|
className,
|
|
67
|
+
tabPanelId,
|
|
67
68
|
...restProps
|
|
68
69
|
}, ref) => {
|
|
69
70
|
var _activePlugin$uiOptio;
|
|
@@ -111,11 +112,14 @@ export const LinkSearchList = /*#__PURE__*/forwardRef(({
|
|
|
111
112
|
const emptyState = activePlugin === null || activePlugin === void 0 ? void 0 : (_activePlugin$emptySt = activePlugin.emptyStateNoResults) === null || _activePlugin$emptySt === void 0 ? void 0 : _activePlugin$emptySt.call(activePlugin);
|
|
112
113
|
if (emptyState) {
|
|
113
114
|
return /*#__PURE__*/React.createElement("div", {
|
|
115
|
+
id: tabPanelId,
|
|
114
116
|
className: ax([styles.emptyStateNoResultsWrapper])
|
|
115
117
|
}, emptyState);
|
|
116
118
|
}
|
|
117
119
|
}
|
|
118
|
-
return /*#__PURE__*/React.createElement(
|
|
120
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
121
|
+
id: tabPanelId
|
|
122
|
+
}, /*#__PURE__*/React.createElement(NoResults, null));
|
|
119
123
|
}
|
|
120
124
|
const listItemNameMaxLines = activePlugin === null || activePlugin === void 0 ? void 0 : (_activePlugin$uiOptio = activePlugin.uiOptions) === null || _activePlugin$uiOptio === void 0 ? void 0 : _activePlugin$uiOptio.listItemNameMaxLines;
|
|
121
125
|
if (items && items.length > 0) {
|
|
@@ -165,6 +169,7 @@ export const LinkSearchList = /*#__PURE__*/forwardRef(({
|
|
|
165
169
|
}));
|
|
166
170
|
}
|
|
167
171
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
172
|
+
id: tabPanelId,
|
|
168
173
|
ref: ref,
|
|
169
174
|
className: ax(["_1bsb1osq _ca0qidpf _1tkeys9h _19pkpxbi _otyrpxbi _16jlkb7n _1e0c1txw _2lx21bp4", className])
|
|
170
175
|
}, restProps), itemsContent, loadingContent);
|
package/dist/es2019/ui/main.js
CHANGED
|
@@ -83,6 +83,7 @@ export var SearchResults = function SearchResults(_ref) {
|
|
|
83
83
|
onKeyDown: handleKeyDown,
|
|
84
84
|
hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
|
|
85
85
|
activePlugin: activePlugin,
|
|
86
|
-
adaptiveHeight: adaptiveHeight
|
|
86
|
+
adaptiveHeight: adaptiveHeight,
|
|
87
|
+
tabPanelId: "".concat(testIds.tabList, "-").concat(activeTab, "-tab")
|
|
87
88
|
}), error ? (_activePlugin$errorFa = activePlugin === null || activePlugin === void 0 || (_activePlugin$errorFa2 = activePlugin.errorFallback) === null || _activePlugin$errorFa2 === void 0 ? void 0 : _activePlugin$errorFa2.call(activePlugin, error, retry)) !== null && _activePlugin$errorFa !== void 0 ? _activePlugin$errorFa : /*#__PURE__*/React.createElement(LinkSearchError, null) : null));
|
|
88
89
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
-
var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "ariaReadOnly", "role", "id", "hasSearchTerm", "activePlugin", "adaptiveHeight", "className"];
|
|
5
|
+
var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "ariaReadOnly", "role", "id", "hasSearchTerm", "activePlugin", "adaptiveHeight", "className", "tabPanelId"];
|
|
6
6
|
import "./index.compiled.css";
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -68,6 +68,7 @@ export var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
68
68
|
activePlugin = _ref.activePlugin,
|
|
69
69
|
adaptiveHeight = _ref.adaptiveHeight,
|
|
70
70
|
className = _ref.className,
|
|
71
|
+
tabPanelId = _ref.tabPanelId,
|
|
71
72
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
72
73
|
var itemsContent;
|
|
73
74
|
var loadingContent;
|
|
@@ -113,11 +114,14 @@ export var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
113
114
|
var emptyState = activePlugin === null || activePlugin === void 0 || (_activePlugin$emptySt = activePlugin.emptyStateNoResults) === null || _activePlugin$emptySt === void 0 ? void 0 : _activePlugin$emptySt.call(activePlugin);
|
|
114
115
|
if (emptyState) {
|
|
115
116
|
return /*#__PURE__*/React.createElement("div", {
|
|
117
|
+
id: tabPanelId,
|
|
116
118
|
className: ax([styles.emptyStateNoResultsWrapper])
|
|
117
119
|
}, emptyState);
|
|
118
120
|
}
|
|
119
121
|
}
|
|
120
|
-
return /*#__PURE__*/React.createElement(
|
|
122
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
123
|
+
id: tabPanelId
|
|
124
|
+
}, /*#__PURE__*/React.createElement(NoResults, null));
|
|
121
125
|
}
|
|
122
126
|
var listItemNameMaxLines = activePlugin === null || activePlugin === void 0 || (_activePlugin$uiOptio = activePlugin.uiOptions) === null || _activePlugin$uiOptio === void 0 ? void 0 : _activePlugin$uiOptio.listItemNameMaxLines;
|
|
123
127
|
if (items && items.length > 0) {
|
|
@@ -173,6 +177,7 @@ export var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
173
177
|
}));
|
|
174
178
|
}
|
|
175
179
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
180
|
+
id: tabPanelId,
|
|
176
181
|
ref: ref,
|
|
177
182
|
className: ax(["_1bsb1osq _ca0qidpf _1tkeys9h _19pkpxbi _otyrpxbi _16jlkb7n _1e0c1txw _2lx21bp4", className])
|
|
178
183
|
}, restProps), itemsContent, loadingContent);
|
package/dist/esm/ui/main.js
CHANGED
|
@@ -47,6 +47,8 @@ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<LinkSearc
|
|
|
47
47
|
id?: string;
|
|
48
48
|
hasSearchTerm?: boolean;
|
|
49
49
|
activePlugin?: LinkPickerPlugin;
|
|
50
|
+
/** Because we don't use the DST TabPanels component, tabPanelId is needed to set the correct aria-controls for a11y. */
|
|
51
|
+
tabPanelId?: string;
|
|
50
52
|
}
|
|
51
53
|
export declare const LinkSearchList: import("react").ForwardRefExoticComponent<LinkSearchListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
52
54
|
export {};
|
|
@@ -47,6 +47,8 @@ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<LinkSearc
|
|
|
47
47
|
id?: string;
|
|
48
48
|
hasSearchTerm?: boolean;
|
|
49
49
|
activePlugin?: LinkPickerPlugin;
|
|
50
|
+
/** Because we don't use the DST TabPanels component, tabPanelId is needed to set the correct aria-controls for a11y. */
|
|
51
|
+
tabPanelId?: string;
|
|
50
52
|
}
|
|
51
53
|
export declare const LinkSearchList: import("react").ForwardRefExoticComponent<LinkSearchListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
52
54
|
export {};
|