@atlaskit/link-picker 1.16.7 → 1.16.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/link-picker
2
2
 
3
+ ## 1.16.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4ee60bafc6d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ee60bafc6d) - ED-16603: Remove tooltips from VR tests and make them opt in. To opt-in, add `allowedSideEffects` when loading the page.
8
+
9
+ ## 1.16.8
10
+
11
+ ### Patch Changes
12
+
13
+ - [`5441fa9235d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5441fa9235d) - [ux] XPC3P-106 Fix recents not showing when switching tabs in new link picker
14
+ - Updated dependencies
15
+
3
16
  ## 1.16.7
4
17
 
5
18
  ### Patch Changes
@@ -8,9 +8,9 @@ exports.default = void 0;
8
8
  /**
9
9
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
10
10
  *
11
- * Generates analytics utilities from the package analytics spec yaml
11
+ * Generates Typescript types for analytics events from analytics.spec.yaml
12
12
  *
13
- * @codegen <<SignedSource::758b8a20cae1b6d410cecd4493453a21>>
13
+ * @codegen <<SignedSource::254da005ee62004d45537995770eba56>>
14
14
  * @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
15
15
  */
16
16
  function createEventPayload(eventKey, attributes) {
@@ -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
- selectedIndex: -1,
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
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.16.7",
3
+ "version": "1.16.9",
4
4
  "sideEffects": false
5
5
  }
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
3
  *
4
- * Generates analytics utilities from the package analytics spec yaml
4
+ * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::758b8a20cae1b6d410cecd4493453a21>>
6
+ * @codegen <<SignedSource::254da005ee62004d45537995770eba56>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
8
8
  */
9
9
  function createEventPayload(eventKey, attributes) {
@@ -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
- selectedIndex: -1,
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
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.16.7",
3
+ "version": "1.16.9",
4
4
  "sideEffects": false
5
5
  }
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
3
  *
4
- * Generates analytics utilities from the package analytics spec yaml
4
+ * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::758b8a20cae1b6d410cecd4493453a21>>
6
+ * @codegen <<SignedSource::254da005ee62004d45537995770eba56>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
8
8
  */
9
9
  function createEventPayload(eventKey, attributes) {
@@ -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
- selectedIndex: -1,
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
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.16.7",
3
+ "version": "1.16.9",
4
4
  "sideEffects": false
5
5
  }
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
3
  *
4
- * Generates analytics utilities from the package analytics spec yaml
4
+ * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::758b8a20cae1b6d410cecd4493453a21>>
6
+ * @codegen <<SignedSource::254da005ee62004d45537995770eba56>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
8
8
  */
9
9
  export declare type PackageMetaDataType = {
@@ -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.7",
3
+ "version": "1.16.9",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -27,8 +27,7 @@
27
27
  },
28
28
  "scripts": {
29
29
  "ak-postbuild": "ls -d dist/* | grep -v dist/types | xargs -n 1 copyfiles -u 1 -V src/**/*.svg",
30
- "codegen-analytics": "ts-node --project ../../../tsconfig.node.json ./scripts/build/codegen-analytics",
31
- "docs-analytics": "ts-node --project ../../../tsconfig.node.json ./scripts/build/docs-analytics"
30
+ "codegen-analytics": "yarn run ts-analytics-codegen --command='yarn workspace @atlaskit/link-picker run codegen-analytics'"
32
31
  },
33
32
  "dependencies": {
34
33
  "@atlaskit/analytics-next": "^8.3.1",
@@ -37,7 +36,7 @@
37
36
  "@atlaskit/form": "^8.8.0",
38
37
  "@atlaskit/frontend-utilities": "^2.1.0",
39
38
  "@atlaskit/icon": "^21.11.0",
40
- "@atlaskit/linking-common": "^1.17.0",
39
+ "@atlaskit/linking-common": "^1.21.0",
41
40
  "@atlaskit/spinner": "^15.3.0",
42
41
  "@atlaskit/tabs": "^13.3.0",
43
42
  "@atlaskit/textfield": "^5.3.0",
@@ -59,12 +58,11 @@
59
58
  "react-intl-next": "npm:react-intl@^5.18.1"
60
59
  },
61
60
  "devDependencies": {
61
+ "@af/analytics-codegen": "^0.0.1",
62
62
  "@af/codegen": "*",
63
63
  "@atlaskit/activity-provider": "^2.3.2",
64
- "@atlaskit/adf-schema": "^25.0.0",
65
- "@atlaskit/adf-utils": "^18.0.0",
66
64
  "@atlaskit/docs": "*",
67
- "@atlaskit/link-analytics": "^2.0.0",
65
+ "@atlaskit/link-analytics": "^3.0.0",
68
66
  "@atlaskit/link-provider": "^1.3.0",
69
67
  "@atlaskit/link-test-helpers": "^2.0.0",
70
68
  "@atlaskit/popup": "^1.5.0",
@@ -73,20 +71,17 @@
73
71
  "@atlaskit/visual-regression": "*",
74
72
  "@atlaskit/webdriver-runner": "*",
75
73
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
76
- "@atlassian/link-picker-atlassian-plugin": "^26.0.0",
77
- "@atlassian/link-picker-plugins": "^14.0.0",
78
- "@atlassian/recent-work-client": "^1.6.0",
74
+ "@atlassian/link-picker-atlassian-plugin": "^26.1.0",
75
+ "@atlassian/link-picker-plugins": "^14.1.0",
76
+ "@atlassian/recent-work-client": "^1.7.0",
79
77
  "@atlassian/search-provider": "^2.3.0",
80
78
  "@testing-library/dom": "^8.17.1",
81
79
  "@testing-library/jest-dom": "^5.16.5",
82
80
  "@testing-library/react": "^12.1.5",
83
81
  "@testing-library/react-hooks": "^8.0.1",
84
82
  "@testing-library/user-event": "^14.4.3",
85
- "@types/js-yaml": "^3.12.5",
86
- "enquirer": "^2.3.4",
87
83
  "fetch-mock": "^8.0.0",
88
84
  "jest-extended": "^0.11.2",
89
- "js-yaml": "^3.13.1",
90
85
  "lodash": "^4.17.21",
91
86
  "mockdate": "^3.0.2",
92
87
  "node-fetch": "^2.6.7",