@atlaskit/link-picker 1.16.7 → 1.16.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 +7 -0
- package/dist/cjs/services/use-search-query/index.js +5 -3
- package/dist/cjs/ui/link-picker/index.js +10 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/services/use-search-query/index.js +5 -3
- package/dist/es2019/ui/link-picker/index.js +10 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/services/use-search-query/index.js +5 -3
- package/dist/esm/ui/link-picker/index.js +10 -3
- package/dist/esm/version.json +1 -1
- package/dist/types/ui/link-picker/index.d.ts +2 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/link-picker
|
|
2
2
|
|
|
3
|
+
## 1.16.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5441fa9235d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5441fa9235d) - [ux] XPC3P-106 Fix recents not showing when switching tabs in new link picker
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 1.16.7
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -14,11 +14,13 @@ function useSearchQuery(state) {
|
|
|
14
14
|
|
|
15
15
|
var queryState = (0, _react.useRef)(null);
|
|
16
16
|
/*
|
|
17
|
-
* When state contains a valid url AND is NOT selected from results
|
|
18
|
-
* queryState should be null to clear the items in plugin state
|
|
17
|
+
* When state contains a valid url AND is NOT selected from results, and the url was updated
|
|
18
|
+
* from the textbox, queryState should be null to clear the items in plugin state.
|
|
19
|
+
*
|
|
20
|
+
* Checking `lastEditedBy` prevents the items being cleared when the tab is changed.
|
|
19
21
|
*/
|
|
20
22
|
|
|
21
|
-
if ((0, _url.isSafeUrl)(state.url) && state.selectedIndex === -1) {
|
|
23
|
+
if ((0, _url.isSafeUrl)(state.url) && state.selectedIndex === -1 && !state.preventHidingRecents) {
|
|
22
24
|
queryState.current = null;
|
|
23
25
|
}
|
|
24
26
|
/*
|
|
@@ -100,7 +100,8 @@ var initState = {
|
|
|
100
100
|
activeIndex: -1,
|
|
101
101
|
selectedIndex: -1,
|
|
102
102
|
invalidUrl: false,
|
|
103
|
-
activeTab: 0
|
|
103
|
+
activeTab: 0,
|
|
104
|
+
preventHidingRecents: false
|
|
104
105
|
};
|
|
105
106
|
|
|
106
107
|
function reducer(state, payload) {
|
|
@@ -193,7 +194,9 @@ function LinkPicker(_ref) {
|
|
|
193
194
|
/** Any on change event is triggered by manual input or paste, so source is null */
|
|
194
195
|
trackAttribute('linkFieldContentInputSource', null);
|
|
195
196
|
dispatch({
|
|
196
|
-
url: e.currentTarget.value
|
|
197
|
+
url: e.currentTarget.value,
|
|
198
|
+
// If the last action was changing tabs, make sure we're now allowing recents to be hidden
|
|
199
|
+
preventHidingRecents: false
|
|
197
200
|
});
|
|
198
201
|
}, [dispatch, trackAttribute]);
|
|
199
202
|
var handleChangeText = (0, _react.useCallback)(function (e) {
|
|
@@ -332,8 +335,12 @@ function LinkPicker(_ref) {
|
|
|
332
335
|
var _plugins$activeTab$ta, _plugins$activeTab;
|
|
333
336
|
|
|
334
337
|
dispatch({
|
|
335
|
-
|
|
338
|
+
// We don't want any selection to exist after changing tab, as the selection
|
|
339
|
+
// wouldn't mean anything.
|
|
336
340
|
activeIndex: -1,
|
|
341
|
+
selectedIndex: -1,
|
|
342
|
+
// We don't want recents to be hidden, even though we don't have a selection
|
|
343
|
+
preventHidingRecents: true,
|
|
337
344
|
invalidUrl: false,
|
|
338
345
|
activeTab: activeTab
|
|
339
346
|
});
|
package/dist/cjs/version.json
CHANGED
|
@@ -5,11 +5,13 @@ export function useSearchQuery(state) {
|
|
|
5
5
|
|
|
6
6
|
const queryState = useRef(null);
|
|
7
7
|
/*
|
|
8
|
-
* When state contains a valid url AND is NOT selected from results
|
|
9
|
-
* queryState should be null to clear the items in plugin state
|
|
8
|
+
* When state contains a valid url AND is NOT selected from results, and the url was updated
|
|
9
|
+
* from the textbox, queryState should be null to clear the items in plugin state.
|
|
10
|
+
*
|
|
11
|
+
* Checking `lastEditedBy` prevents the items being cleared when the tab is changed.
|
|
10
12
|
*/
|
|
11
13
|
|
|
12
|
-
if (isSafeUrl(state.url) && state.selectedIndex === -1) {
|
|
14
|
+
if (isSafeUrl(state.url) && state.selectedIndex === -1 && !state.preventHidingRecents) {
|
|
13
15
|
queryState.current = null;
|
|
14
16
|
}
|
|
15
17
|
/*
|
|
@@ -47,7 +47,8 @@ const initState = {
|
|
|
47
47
|
activeIndex: -1,
|
|
48
48
|
selectedIndex: -1,
|
|
49
49
|
invalidUrl: false,
|
|
50
|
-
activeTab: 0
|
|
50
|
+
activeTab: 0,
|
|
51
|
+
preventHidingRecents: false
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
function reducer(state, payload) {
|
|
@@ -137,7 +138,9 @@ function LinkPicker({
|
|
|
137
138
|
/** Any on change event is triggered by manual input or paste, so source is null */
|
|
138
139
|
trackAttribute('linkFieldContentInputSource', null);
|
|
139
140
|
dispatch({
|
|
140
|
-
url: e.currentTarget.value
|
|
141
|
+
url: e.currentTarget.value,
|
|
142
|
+
// If the last action was changing tabs, make sure we're now allowing recents to be hidden
|
|
143
|
+
preventHidingRecents: false
|
|
141
144
|
});
|
|
142
145
|
}, [dispatch, trackAttribute]);
|
|
143
146
|
const handleChangeText = useCallback(e => {
|
|
@@ -277,8 +280,12 @@ function LinkPicker({
|
|
|
277
280
|
var _plugins$activeTab$ta, _plugins$activeTab;
|
|
278
281
|
|
|
279
282
|
dispatch({
|
|
280
|
-
|
|
283
|
+
// We don't want any selection to exist after changing tab, as the selection
|
|
284
|
+
// wouldn't mean anything.
|
|
281
285
|
activeIndex: -1,
|
|
286
|
+
selectedIndex: -1,
|
|
287
|
+
// We don't want recents to be hidden, even though we don't have a selection
|
|
288
|
+
preventHidingRecents: true,
|
|
282
289
|
invalidUrl: false,
|
|
283
290
|
activeTab
|
|
284
291
|
});
|
package/dist/es2019/version.json
CHANGED
|
@@ -5,11 +5,13 @@ export function useSearchQuery(state) {
|
|
|
5
5
|
|
|
6
6
|
var queryState = useRef(null);
|
|
7
7
|
/*
|
|
8
|
-
* When state contains a valid url AND is NOT selected from results
|
|
9
|
-
* queryState should be null to clear the items in plugin state
|
|
8
|
+
* When state contains a valid url AND is NOT selected from results, and the url was updated
|
|
9
|
+
* from the textbox, queryState should be null to clear the items in plugin state.
|
|
10
|
+
*
|
|
11
|
+
* Checking `lastEditedBy` prevents the items being cleared when the tab is changed.
|
|
10
12
|
*/
|
|
11
13
|
|
|
12
|
-
if (isSafeUrl(state.url) && state.selectedIndex === -1) {
|
|
14
|
+
if (isSafeUrl(state.url) && state.selectedIndex === -1 && !state.preventHidingRecents) {
|
|
13
15
|
queryState.current = null;
|
|
14
16
|
}
|
|
15
17
|
/*
|
|
@@ -52,7 +52,8 @@ var initState = {
|
|
|
52
52
|
activeIndex: -1,
|
|
53
53
|
selectedIndex: -1,
|
|
54
54
|
invalidUrl: false,
|
|
55
|
-
activeTab: 0
|
|
55
|
+
activeTab: 0,
|
|
56
|
+
preventHidingRecents: false
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
function reducer(state, payload) {
|
|
@@ -145,7 +146,9 @@ function LinkPicker(_ref) {
|
|
|
145
146
|
/** Any on change event is triggered by manual input or paste, so source is null */
|
|
146
147
|
trackAttribute('linkFieldContentInputSource', null);
|
|
147
148
|
dispatch({
|
|
148
|
-
url: e.currentTarget.value
|
|
149
|
+
url: e.currentTarget.value,
|
|
150
|
+
// If the last action was changing tabs, make sure we're now allowing recents to be hidden
|
|
151
|
+
preventHidingRecents: false
|
|
149
152
|
});
|
|
150
153
|
}, [dispatch, trackAttribute]);
|
|
151
154
|
var handleChangeText = useCallback(function (e) {
|
|
@@ -284,8 +287,12 @@ function LinkPicker(_ref) {
|
|
|
284
287
|
var _plugins$activeTab$ta, _plugins$activeTab;
|
|
285
288
|
|
|
286
289
|
dispatch({
|
|
287
|
-
|
|
290
|
+
// We don't want any selection to exist after changing tab, as the selection
|
|
291
|
+
// wouldn't mean anything.
|
|
288
292
|
activeIndex: -1,
|
|
293
|
+
selectedIndex: -1,
|
|
294
|
+
// We don't want recents to be hidden, even though we don't have a selection
|
|
295
|
+
preventHidingRecents: true,
|
|
289
296
|
invalidUrl: false,
|
|
290
297
|
activeTab: activeTab
|
|
291
298
|
});
|
package/dist/esm/version.json
CHANGED
|
@@ -72,6 +72,8 @@ export interface PickerState {
|
|
|
72
72
|
displayText: string;
|
|
73
73
|
invalidUrl: boolean;
|
|
74
74
|
activeTab: number;
|
|
75
|
+
/** When true, even if the selected index is -1, don't hide the recents. */
|
|
76
|
+
preventHidingRecents: boolean;
|
|
75
77
|
}
|
|
76
78
|
declare const _default: import("react").ComponentType<LinkPickerProps>;
|
|
77
79
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-picker",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.8",
|
|
4
4
|
"description": "Standalone link picker",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/form": "^8.8.0",
|
|
38
38
|
"@atlaskit/frontend-utilities": "^2.1.0",
|
|
39
39
|
"@atlaskit/icon": "^21.11.0",
|
|
40
|
-
"@atlaskit/linking-common": "^1.
|
|
40
|
+
"@atlaskit/linking-common": "^1.18.0",
|
|
41
41
|
"@atlaskit/spinner": "^15.3.0",
|
|
42
42
|
"@atlaskit/tabs": "^13.3.0",
|
|
43
43
|
"@atlaskit/textfield": "^5.3.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@atlaskit/webdriver-runner": "*",
|
|
75
75
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
76
76
|
"@atlassian/link-picker-atlassian-plugin": "^26.0.0",
|
|
77
|
-
"@atlassian/link-picker-plugins": "^14.
|
|
77
|
+
"@atlassian/link-picker-plugins": "^14.1.0",
|
|
78
78
|
"@atlassian/recent-work-client": "^1.6.0",
|
|
79
79
|
"@atlassian/search-provider": "^2.3.0",
|
|
80
80
|
"@testing-library/dom": "^8.17.1",
|