@atlaskit/link-picker 1.25.3 → 1.25.5
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 +12 -0
- package/dist/cjs/common/analytics/context.js +1 -1
- package/dist/cjs/common/analytics/input-field-tracking.js +3 -3
- package/dist/cjs/common/constants.js +6 -2
- package/dist/cjs/common/utils/handleNavKeyDown.js +29 -0
- package/dist/cjs/i18n/en.js +2 -1
- package/dist/cjs/i18n/en_GB.js +2 -1
- package/dist/cjs/i18n/en_ZZ.js +2 -1
- package/dist/cjs/services/use-plugins/index.js +7 -8
- package/dist/cjs/ui/error-boundary/error-boundary-fallback/index.js +3 -1
- package/dist/cjs/ui/error-boundary/index.js +3 -3
- package/dist/cjs/ui/index.js +2 -2
- package/dist/cjs/ui/link-picker/form-footer/index.js +10 -10
- package/dist/cjs/ui/link-picker/index.js +38 -81
- package/dist/cjs/ui/link-picker/search-results/index.js +90 -0
- package/dist/cjs/ui/link-picker/{link-search-error → search-results/link-search-error}/index.js +1 -1
- package/dist/cjs/ui/link-picker/{link-search-list → search-results/link-search-list}/index.js +11 -11
- package/dist/cjs/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/index.js +1 -1
- package/dist/cjs/ui/link-picker/{list-item → search-results/link-search-list/list-item}/index.js +3 -2
- package/dist/cjs/ui/link-picker/{list-item → search-results/link-search-list/list-item}/styled.js +7 -5
- package/dist/cjs/ui/link-picker/{link-search-list → search-results/link-search-list}/styled.js +1 -1
- package/dist/cjs/ui/link-picker/{link-search-list → search-results/link-search-list}/use-track-results-shown/index.js +2 -2
- package/dist/cjs/ui/{scrolling-tabs → link-picker/search-results/scrolling-tabs}/index.js +3 -0
- package/dist/cjs/ui/link-picker/search-results/styled.js +16 -0
- package/dist/cjs/ui/link-picker/{track-tab-viewed → search-results/track-tab-viewed}/index.js +2 -2
- package/dist/cjs/ui/link-picker/styled.js +5 -23
- package/dist/cjs/ui/link-picker/text-input/index.js +4 -4
- package/dist/cjs/ui/link-picker/text-input/utils.js +28 -0
- package/dist/cjs/ui/link-picker/track-mount/index.js +1 -1
- package/dist/cjs/ui/link-picker/transformTimeStamp.js +2 -2
- package/dist/cjs/ui/link-picker/utils.js +1 -48
- package/dist/cjs/ui/loader-fallback/index.js +1 -1
- package/dist/cjs/ui/loader-fallback/styled.js +21 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/common/analytics/context.js +1 -1
- package/dist/es2019/common/analytics/input-field-tracking.js +2 -2
- package/dist/es2019/common/constants.js +3 -1
- package/dist/es2019/common/utils/handleNavKeyDown.js +22 -0
- package/dist/es2019/i18n/en.js +2 -1
- package/dist/es2019/i18n/en_GB.js +2 -1
- package/dist/es2019/i18n/en_ZZ.js +2 -1
- package/dist/es2019/services/use-plugins/index.js +5 -6
- package/dist/es2019/ui/error-boundary/error-boundary-fallback/index.js +2 -1
- package/dist/es2019/ui/error-boundary/index.js +3 -3
- package/dist/es2019/ui/index.js +3 -3
- package/dist/es2019/ui/link-picker/announcer.js +1 -1
- package/dist/es2019/ui/link-picker/form-footer/index.js +4 -4
- package/dist/es2019/ui/link-picker/index.js +32 -69
- package/dist/es2019/ui/link-picker/search-results/index.js +77 -0
- package/dist/es2019/ui/link-picker/{link-search-error → search-results/link-search-error}/index.js +2 -2
- package/dist/es2019/ui/link-picker/{link-search-list → search-results/link-search-list}/index.js +5 -5
- package/dist/es2019/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/index.js +1 -1
- package/dist/es2019/ui/link-picker/{list-item → search-results/link-search-list/list-item}/index.js +3 -3
- package/dist/es2019/ui/link-picker/{list-item → search-results/link-search-list/list-item}/styled.js +4 -4
- package/dist/es2019/ui/link-picker/{link-search-list → search-results/link-search-list}/styled.js +2 -1
- package/dist/es2019/ui/link-picker/{link-search-list → search-results/link-search-list}/use-track-results-shown/index.js +2 -2
- package/dist/es2019/ui/{scrolling-tabs → link-picker/search-results/scrolling-tabs}/index.js +6 -3
- package/dist/es2019/ui/link-picker/search-results/styled.js +17 -0
- package/dist/es2019/ui/link-picker/{track-tab-viewed → search-results/track-tab-viewed}/index.js +2 -2
- package/dist/es2019/ui/link-picker/styled.js +0 -30
- package/dist/es2019/ui/link-picker/text-input/index.js +5 -5
- package/dist/es2019/ui/link-picker/text-input/utils.js +22 -0
- package/dist/es2019/ui/link-picker/track-mount/index.js +1 -1
- package/dist/es2019/ui/link-picker/transformTimeStamp.js +2 -2
- package/dist/es2019/ui/link-picker/utils.js +1 -45
- package/dist/es2019/ui/loader-fallback/index.js +1 -1
- package/dist/es2019/ui/loader-fallback/styled.js +25 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/common/analytics/context.js +1 -1
- package/dist/esm/common/analytics/input-field-tracking.js +2 -2
- package/dist/esm/common/constants.js +3 -1
- package/dist/esm/common/utils/handleNavKeyDown.js +22 -0
- package/dist/esm/i18n/en.js +2 -1
- package/dist/esm/i18n/en_GB.js +2 -1
- package/dist/esm/i18n/en_ZZ.js +2 -1
- package/dist/esm/services/use-plugins/index.js +5 -6
- package/dist/esm/ui/error-boundary/error-boundary-fallback/index.js +2 -1
- package/dist/esm/ui/error-boundary/index.js +3 -3
- package/dist/esm/ui/index.js +3 -3
- package/dist/esm/ui/link-picker/announcer.js +1 -1
- package/dist/esm/ui/link-picker/form-footer/index.js +4 -4
- package/dist/esm/ui/link-picker/index.js +33 -72
- package/dist/esm/ui/link-picker/search-results/index.js +79 -0
- package/dist/esm/ui/link-picker/{link-search-error → search-results/link-search-error}/index.js +2 -2
- package/dist/esm/ui/link-picker/{link-search-list → search-results/link-search-list}/index.js +5 -5
- package/dist/esm/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/index.js +1 -1
- package/dist/esm/ui/link-picker/{list-item → search-results/link-search-list/list-item}/index.js +3 -3
- package/dist/esm/ui/link-picker/{list-item → search-results/link-search-list/list-item}/styled.js +4 -4
- package/dist/esm/ui/link-picker/{link-search-list → search-results/link-search-list}/styled.js +2 -1
- package/dist/esm/ui/link-picker/{link-search-list → search-results/link-search-list}/use-track-results-shown/index.js +2 -2
- package/dist/esm/ui/{scrolling-tabs → link-picker/search-results/scrolling-tabs}/index.js +6 -3
- package/dist/esm/ui/link-picker/search-results/styled.js +6 -0
- package/dist/esm/ui/link-picker/{track-tab-viewed → search-results/track-tab-viewed}/index.js +2 -2
- package/dist/esm/ui/link-picker/styled.js +4 -19
- package/dist/esm/ui/link-picker/text-input/index.js +5 -5
- package/dist/esm/ui/link-picker/text-input/utils.js +20 -0
- package/dist/esm/ui/link-picker/track-mount/index.js +1 -1
- package/dist/esm/ui/link-picker/transformTimeStamp.js +2 -2
- package/dist/esm/ui/link-picker/utils.js +1 -43
- package/dist/esm/ui/loader-fallback/index.js +1 -1
- package/dist/esm/ui/loader-fallback/styled.js +16 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/common/analytics/context.d.ts +1 -1
- package/dist/types/common/constants.d.ts +2 -0
- package/dist/{types-ts4.5/ui → types/common}/types.d.ts +10 -0
- package/dist/types/common/utils/handleNavKeyDown.d.ts +2 -0
- package/dist/types/i18n/en.d.ts +1 -0
- package/dist/types/i18n/en_GB.d.ts +1 -0
- package/dist/types/i18n/en_ZZ.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/services/use-plugins/index.d.ts +1 -1
- package/dist/types/services/use-plugins/reducer.d.ts +1 -1
- package/dist/types/services/use-plugins/utils.d.ts +1 -1
- package/dist/types/services/use-search-query/index.d.ts +1 -2
- package/dist/types/ui/link-picker/form-footer/index.d.ts +1 -2
- package/dist/types/ui/link-picker/form-footer/utils.d.ts +1 -1
- package/dist/types/ui/link-picker/index.d.ts +7 -19
- package/dist/types/ui/link-picker/search-results/index.d.ts +40 -0
- package/dist/types/ui/link-picker/{link-search-list → search-results/link-search-list}/index.d.ts +1 -1
- package/dist/types/ui/link-picker/{list-item → search-results/link-search-list/list-item}/index.d.ts +1 -1
- package/dist/types/ui/link-picker/{link-search-list → search-results/link-search-list}/use-track-results-shown/index.d.ts +1 -1
- package/dist/types/ui/link-picker/search-results/styled.d.ts +3 -0
- package/dist/types/ui/link-picker/{track-tab-viewed → search-results/track-tab-viewed}/index.d.ts +1 -1
- package/dist/types/ui/link-picker/styled.d.ts +0 -5
- package/dist/types/ui/link-picker/{conditional-spotlight-target-wrapper → text-input/conditional-spotlight-target-wrapper}/index.d.ts +1 -2
- package/dist/types/ui/link-picker/text-input/index.d.ts +1 -1
- package/dist/types/ui/link-picker/text-input/utils.d.ts +3 -0
- package/dist/types/ui/link-picker/utils.d.ts +1 -5
- package/dist/types/ui/loader-fallback/styled.d.ts +3 -0
- package/dist/types-ts4.5/common/analytics/context.d.ts +1 -1
- package/dist/types-ts4.5/common/constants.d.ts +2 -0
- package/dist/{types/ui → types-ts4.5/common}/types.d.ts +10 -0
- package/dist/types-ts4.5/common/utils/handleNavKeyDown.d.ts +2 -0
- package/dist/types-ts4.5/i18n/en.d.ts +1 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +1 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +1 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/services/use-plugins/index.d.ts +1 -1
- package/dist/types-ts4.5/services/use-plugins/reducer.d.ts +1 -1
- package/dist/types-ts4.5/services/use-plugins/utils.d.ts +1 -1
- package/dist/types-ts4.5/services/use-search-query/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/form-footer/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/form-footer/utils.d.ts +1 -1
- package/dist/types-ts4.5/ui/link-picker/index.d.ts +7 -19
- package/dist/types-ts4.5/ui/link-picker/search-results/index.d.ts +40 -0
- package/dist/types-ts4.5/ui/link-picker/{link-search-list → search-results/link-search-list}/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/link-picker/{list-item → search-results/link-search-list/list-item}/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/link-picker/{link-search-list → search-results/link-search-list}/use-track-results-shown/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/link-picker/search-results/styled.d.ts +3 -0
- package/dist/types-ts4.5/ui/link-picker/{track-tab-viewed → search-results/track-tab-viewed}/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/link-picker/styled.d.ts +0 -5
- package/dist/types-ts4.5/ui/link-picker/{conditional-spotlight-target-wrapper → text-input/conditional-spotlight-target-wrapper}/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/text-input/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/link-picker/text-input/utils.d.ts +3 -0
- package/dist/types-ts4.5/ui/link-picker/utils.d.ts +1 -5
- package/dist/types-ts4.5/ui/loader-fallback/styled.d.ts +3 -0
- package/package.json +27 -6
- /package/dist/cjs/{ui → common}/types.js +0 -0
- /package/dist/cjs/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/no-results-svg/index.js +0 -0
- /package/dist/cjs/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/no-results-svg/styled.js +0 -0
- /package/dist/cjs/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/styled.js +0 -0
- /package/dist/cjs/ui/{scrolling-tabs → link-picker/search-results/scrolling-tabs}/scrolling-tabs.js +0 -0
- /package/dist/cjs/ui/{scrolling-tabs → link-picker/search-results/scrolling-tabs}/styles.js +0 -0
- /package/dist/cjs/ui/link-picker/{conditional-spotlight-target-wrapper → text-input/conditional-spotlight-target-wrapper}/index.js +0 -0
- /package/dist/es2019/{ui → common}/types.js +0 -0
- /package/dist/es2019/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/no-results-svg/index.js +0 -0
- /package/dist/es2019/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/no-results-svg/styled.js +0 -0
- /package/dist/es2019/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/styled.js +0 -0
- /package/dist/es2019/ui/{scrolling-tabs → link-picker/search-results/scrolling-tabs}/scrolling-tabs.js +0 -0
- /package/dist/es2019/ui/{scrolling-tabs → link-picker/search-results/scrolling-tabs}/styles.js +0 -0
- /package/dist/es2019/ui/link-picker/{conditional-spotlight-target-wrapper → text-input/conditional-spotlight-target-wrapper}/index.js +0 -0
- /package/dist/esm/{ui → common}/types.js +0 -0
- /package/dist/esm/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/no-results-svg/index.js +0 -0
- /package/dist/esm/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/no-results-svg/styled.js +0 -0
- /package/dist/esm/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/styled.js +0 -0
- /package/dist/esm/ui/{scrolling-tabs → link-picker/search-results/scrolling-tabs}/scrolling-tabs.js +0 -0
- /package/dist/esm/ui/{scrolling-tabs → link-picker/search-results/scrolling-tabs}/styles.js +0 -0
- /package/dist/esm/ui/link-picker/{conditional-spotlight-target-wrapper → text-input/conditional-spotlight-target-wrapper}/index.js +0 -0
- /package/dist/types/ui/link-picker/{link-search-error → search-results/link-search-error}/index.d.ts +0 -0
- /package/dist/types/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/index.d.ts +0 -0
- /package/dist/types/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/no-results-svg/index.d.ts +0 -0
- /package/dist/types/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/no-results-svg/styled.d.ts +0 -0
- /package/dist/types/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/styled.d.ts +0 -0
- /package/dist/types/ui/link-picker/{list-item → search-results/link-search-list/list-item}/styled.d.ts +0 -0
- /package/dist/types/ui/link-picker/{link-search-list → search-results/link-search-list}/styled.d.ts +0 -0
- /package/dist/types/ui/{scrolling-tabs → link-picker/search-results/scrolling-tabs}/index.d.ts +0 -0
- /package/dist/types/ui/{scrolling-tabs → link-picker/search-results/scrolling-tabs}/scrolling-tabs.d.ts +0 -0
- /package/dist/types/ui/{scrolling-tabs → link-picker/search-results/scrolling-tabs}/styles.d.ts +0 -0
- /package/dist/types-ts4.5/ui/link-picker/{link-search-error → search-results/link-search-error}/index.d.ts +0 -0
- /package/dist/types-ts4.5/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/index.d.ts +0 -0
- /package/dist/types-ts4.5/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/no-results-svg/index.d.ts +0 -0
- /package/dist/types-ts4.5/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/no-results-svg/styled.d.ts +0 -0
- /package/dist/types-ts4.5/ui/link-picker/{link-search-list → search-results/link-search-list}/link-search-no-results/styled.d.ts +0 -0
- /package/dist/types-ts4.5/ui/link-picker/{list-item → search-results/link-search-list/list-item}/styled.d.ts +0 -0
- /package/dist/types-ts4.5/ui/link-picker/{link-search-list → search-results/link-search-list}/styled.d.ts +0 -0
- /package/dist/types-ts4.5/ui/{scrolling-tabs → link-picker/search-results/scrolling-tabs}/index.d.ts +0 -0
- /package/dist/types-ts4.5/ui/{scrolling-tabs → link-picker/search-results/scrolling-tabs}/scrolling-tabs.d.ts +0 -0
- /package/dist/types-ts4.5/ui/{scrolling-tabs → link-picker/search-results/scrolling-tabs}/styles.d.ts +0 -0
package/dist/es2019/version.json
CHANGED
|
@@ -5,8 +5,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
import React, { useCallback, useContext, useMemo, useRef, useState } from 'react';
|
|
7
7
|
import { AnalyticsListener } from '@atlaskit/analytics-next';
|
|
8
|
-
import { ANALYTICS_CHANNEL } from '../constants';
|
|
9
8
|
import { normalizeUrl } from '@atlaskit/linking-common/url';
|
|
9
|
+
import { ANALYTICS_CHANNEL } from '../constants';
|
|
10
10
|
var DEFAULT_CONTEXT_ATTRIBUTES = {
|
|
11
11
|
linkState: 'newLink',
|
|
12
12
|
linkFieldContent: null,
|
|
@@ -3,9 +3,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
4
4
|
import React, { useCallback, useRef } from 'react';
|
|
5
5
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
|
-
import { ANALYTICS_CHANNEL } from '../constants';
|
|
7
6
|
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
8
|
-
import {
|
|
7
|
+
import { ANALYTICS_CHANNEL } from '../constants';
|
|
8
|
+
import { useLinkPickerAnalytics } from './index';
|
|
9
9
|
var isEventWithInputType = function isEventWithInputType(e) {
|
|
10
10
|
return _typeof(e) === 'object' && e !== null && 'inputType' in e;
|
|
11
11
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export var handleNavKeyDown = function handleNavKeyDown(event, itemsLength, activeIndex) {
|
|
2
|
+
var updatedIndex = activeIndex;
|
|
3
|
+
switch (event.key) {
|
|
4
|
+
case 'ArrowDown':
|
|
5
|
+
event.preventDefault();
|
|
6
|
+
updatedIndex = (activeIndex + 1) % itemsLength;
|
|
7
|
+
break;
|
|
8
|
+
case 'ArrowUp':
|
|
9
|
+
event.preventDefault();
|
|
10
|
+
updatedIndex = activeIndex > 0 ? activeIndex - 1 : itemsLength - 1;
|
|
11
|
+
break;
|
|
12
|
+
case 'Home':
|
|
13
|
+
event.preventDefault();
|
|
14
|
+
updatedIndex = 0;
|
|
15
|
+
break;
|
|
16
|
+
case 'End':
|
|
17
|
+
event.preventDefault();
|
|
18
|
+
updatedIndex = itemsLength - 1;
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
return updatedIndex;
|
|
22
|
+
};
|
package/dist/esm/i18n/en.js
CHANGED
|
@@ -32,5 +32,6 @@ export default {
|
|
|
32
32
|
'fabric.linkPicker.time.message.updated': 'Updated {time}',
|
|
33
33
|
'fabric.linkPicker.time.message.viewed': 'Viewed {time}',
|
|
34
34
|
'fabric.linkPicker.unhandledError.description': 'Try reloading the page.',
|
|
35
|
-
'fabric.linkPicker.unhandledError.heading': 'Something went wrong!'
|
|
35
|
+
'fabric.linkPicker.unhandledError.heading': 'Something went wrong!',
|
|
36
|
+
foo: 'Default string'
|
|
36
37
|
};
|
package/dist/esm/i18n/en_GB.js
CHANGED
|
@@ -32,5 +32,6 @@ export default {
|
|
|
32
32
|
'fabric.linkPicker.time.message.updated': 'Updated {time}',
|
|
33
33
|
'fabric.linkPicker.time.message.viewed': 'Viewed {time}',
|
|
34
34
|
'fabric.linkPicker.unhandledError.description': 'Try reloading the page.',
|
|
35
|
-
'fabric.linkPicker.unhandledError.heading': 'Something went wrong!'
|
|
35
|
+
'fabric.linkPicker.unhandledError.heading': 'Something went wrong!',
|
|
36
|
+
foo: 'Default string'
|
|
36
37
|
};
|
package/dist/esm/i18n/en_ZZ.js
CHANGED
|
@@ -32,5 +32,6 @@ export default {
|
|
|
32
32
|
'fabric.linkPicker.time.message.updated': 'Updated {time}',
|
|
33
33
|
'fabric.linkPicker.time.message.viewed': 'Viewed {time}',
|
|
34
34
|
'fabric.linkPicker.unhandledError.description': 'Try reloading the page.',
|
|
35
|
-
'fabric.linkPicker.unhandledError.heading': 'Something went wrong!'
|
|
35
|
+
'fabric.linkPicker.unhandledError.heading': 'Something went wrong!',
|
|
36
|
+
foo: 'Default string'
|
|
36
37
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
-
import { useEffect, useMemo, useState
|
|
5
|
-
import { convertToError } from '@atlaskit/frontend-utilities/convert-to-error';
|
|
4
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
5
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
|
-
import {
|
|
6
|
+
import { convertToError } from '@atlaskit/frontend-utilities/convert-to-error';
|
|
7
|
+
import { useLinkPickerAnalytics } from '../../common/analytics';
|
|
8
|
+
import { ANALYTICS_CHANNEL, RECENT_SEARCH_LIST_SIZE } from '../../common/constants';
|
|
8
9
|
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
9
|
-
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
10
|
-
import { CancellationError, resolvePluginUpdates } from './utils';
|
|
11
10
|
import { usePluginReducer } from './reducer';
|
|
12
|
-
import {
|
|
11
|
+
import { CancellationError, resolvePluginUpdates } from './utils';
|
|
13
12
|
export function usePlugins(state, activeTab, plugins) {
|
|
14
13
|
var _activePlugin$tabKey;
|
|
15
14
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import EmptyState from '@atlaskit/empty-state';
|
|
4
3
|
import { defineMessages, useIntl } from 'react-intl-next';
|
|
4
|
+
import EmptyState from '@atlaskit/empty-state';
|
|
5
5
|
import { GenericErrorSVG } from '../../../common/generic-error-svg';
|
|
6
|
+
// eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
|
|
6
7
|
import { rootContainerStyles } from '../../link-picker/styled';
|
|
7
8
|
var messages = defineMessages({
|
|
8
9
|
heading: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
|
-
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
4
|
-
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
5
3
|
import { failUfoExperience, ufoExperience } from '../../common/analytics/experiences';
|
|
4
|
+
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
5
|
+
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
6
6
|
import { useLinkPickerSessionId } from '../../controllers/session-provider';
|
|
7
|
-
import { ErrorBoundaryFallback } from './error-boundary-fallback';
|
|
8
7
|
import { BaseErrorBoundary } from './error-boundary-base';
|
|
8
|
+
import { ErrorBoundaryFallback } from './error-boundary-fallback';
|
|
9
9
|
export function ErrorBoundary(_ref) {
|
|
10
10
|
var children = _ref.children;
|
|
11
11
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
package/dist/esm/ui/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
2
|
import React, { memo } from 'react';
|
|
4
|
-
import {
|
|
3
|
+
import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
|
|
4
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
5
5
|
import { COMPONENT_NAME } from '../common/constants';
|
|
6
|
+
import { LinkPickerSessionProvider } from '../controllers/session-provider';
|
|
6
7
|
import { name as packageName, version as packageVersion } from '../version.json';
|
|
7
8
|
import { ErrorBoundary } from './error-boundary';
|
|
8
9
|
import { LoaderFallback } from './loader-fallback';
|
|
9
|
-
import { LinkPickerSessionProvider } from '../controllers/session-provider';
|
|
10
10
|
import { MessagesProvider } from './messages-provider';
|
|
11
11
|
export var testIds = {
|
|
12
12
|
linkPickerRoot: 'link-picker-root'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React, { forwardRef, memo,
|
|
2
|
+
import React, { forwardRef, memo, useEffect, useState } from 'react';
|
|
3
3
|
|
|
4
4
|
// How to use:
|
|
5
5
|
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#Preferring_specialized_live_region_roles
|
|
@@ -2,14 +2,14 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["isLoading", "error", "url", "queryState", "items", "isEditing", "onCancel", "action"];
|
|
4
4
|
/** @jsx jsx */
|
|
5
|
-
import { jsx } from '@emotion/react';
|
|
6
5
|
import { memo } from 'react';
|
|
7
|
-
import {
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
7
|
+
import { defineMessages, useIntl } from 'react-intl-next';
|
|
8
8
|
import Button, { ButtonGroup } from '@atlaskit/button';
|
|
9
9
|
import EditorAddIcon from '@atlaskit/icon/glyph/editor/add';
|
|
10
|
-
import { formFooterStyles, formFooterActionStyles } from './styled';
|
|
11
|
-
import { checkSubmitDisabled } from './utils';
|
|
12
10
|
import { UnauthenticatedError } from '../../../common/utils/errors';
|
|
11
|
+
import { formFooterActionStyles, formFooterStyles } from './styled';
|
|
12
|
+
import { checkSubmitDisabled } from './utils';
|
|
13
13
|
var messages = defineMessages({
|
|
14
14
|
cancelButton: {
|
|
15
15
|
id: 'fabric.linkPicker.button.cancel',
|
|
@@ -1,48 +1,35 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
5
|
/** @jsx jsx */
|
|
7
|
-
import {
|
|
6
|
+
import { memo, useCallback, useLayoutEffect, useReducer } from 'react';
|
|
8
7
|
import { jsx } from '@emotion/react';
|
|
9
|
-
import {
|
|
8
|
+
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
10
9
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
11
|
-
import
|
|
12
|
-
import
|
|
10
|
+
import { isSafeUrl, normalizeUrl } from '@atlaskit/linking-common/url';
|
|
11
|
+
import { browser } from '@atlaskit/linking-common/user-agent';
|
|
13
12
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
14
|
-
import Spinner from '@atlaskit/spinner/spinner';
|
|
15
|
-
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
16
|
-
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
17
13
|
import { useLinkPickerAnalytics, withInputFieldTracking, withLinkPickerAnalyticsContext } from '../../common/analytics';
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
14
|
+
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
15
|
+
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
16
|
+
import { handleNavKeyDown } from '../../common/utils/handleNavKeyDown';
|
|
20
17
|
import { usePlugins } from '../../services/use-plugins';
|
|
21
18
|
import { useSearchQuery } from '../../services/use-search-query';
|
|
22
|
-
import { useFixHeight } from '../../controllers/use-fix-height';
|
|
23
|
-
import { searchMessages, linkMessages, formMessages, linkTextMessages } from './messages';
|
|
24
|
-
import { TextInput, testIds as textFieldTestIds } from './text-input';
|
|
25
|
-
import { rootContainerStyles, searchIconStyles, tabsWrapperStyles, flexColumnStyles, formFooterMargin } from './styled';
|
|
26
19
|
import { Announcer } from './announcer';
|
|
27
|
-
import { ScrollingTabList } from '../scrolling-tabs';
|
|
28
|
-
import { LinkSearchList, testIds as listTestIds } from './link-search-list';
|
|
29
|
-
import { LinkSearchError, testIds as searchErrorTestIds } from './link-search-error';
|
|
30
20
|
import { FormFooter, testIds as formFooterTestIds } from './form-footer';
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
21
|
+
import { formMessages, linkMessages, linkTextMessages, searchMessages } from './messages';
|
|
22
|
+
import { SearchResults, testIds as searchTestIds } from './search-results';
|
|
23
|
+
import { formFooterMargin, rootContainerStyles } from './styled';
|
|
24
|
+
import { testIds as textFieldTestIds, TextInput } from './text-input';
|
|
33
25
|
import { TrackMount } from './track-mount';
|
|
34
|
-
import {
|
|
35
|
-
export var
|
|
36
|
-
export var testIds = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
26
|
+
import { getDataSource, getScreenReaderText } from './utils';
|
|
27
|
+
export var testIds = _objectSpread(_objectSpread(_objectSpread({
|
|
37
28
|
linkPickerRoot: 'link-picker-root',
|
|
38
29
|
linkPicker: 'link-picker',
|
|
39
30
|
urlInputField: 'link-url',
|
|
40
|
-
textInputField: 'link-text'
|
|
41
|
-
|
|
42
|
-
}, formFooterTestIds), searchErrorTestIds), listTestIds), textFieldTestIds), {}, {
|
|
43
|
-
tabList: 'link-picker-tabs',
|
|
44
|
-
tabItem: 'link-picker-tab'
|
|
45
|
-
});
|
|
31
|
+
textInputField: 'link-text'
|
|
32
|
+
}, searchTestIds), formFooterTestIds), textFieldTestIds);
|
|
46
33
|
var initState = {
|
|
47
34
|
url: '',
|
|
48
35
|
displayText: '',
|
|
@@ -79,7 +66,6 @@ var LinkInputField = withInputFieldTracking(TextInput, 'link', function (event,
|
|
|
79
66
|
});
|
|
80
67
|
var DisplayTextInputField = withInputFieldTracking(TextInput, 'displayText');
|
|
81
68
|
export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(function (_ref) {
|
|
82
|
-
var _activePlugin$errorFa, _activePlugin$errorFa2;
|
|
83
69
|
var onSubmit = _ref.onSubmit,
|
|
84
70
|
onCancel = _ref.onCancel,
|
|
85
71
|
onContentResize = _ref.onContentResize,
|
|
@@ -115,7 +101,6 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
115
101
|
error = _usePlugins.error,
|
|
116
102
|
retry = _usePlugins.retry,
|
|
117
103
|
pluginAction = _usePlugins.pluginAction;
|
|
118
|
-
var fixListHeightProps = useFixHeight(isLoadingResults);
|
|
119
104
|
var isEditing = !!initUrl;
|
|
120
105
|
var selectedItem = items === null || items === void 0 ? void 0 : items[selectedIndex];
|
|
121
106
|
var isSelectedItem = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.url) === url;
|
|
@@ -282,19 +267,6 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
282
267
|
// as the Aria design pattern for combobox does not work in this case
|
|
283
268
|
// for details: https://a11y-internal.atlassian.net/browse/AK-740
|
|
284
269
|
var screenReaderText = browser().safari && getScreenReaderText(items !== null && items !== void 0 ? items : [], selectedIndex, intl);
|
|
285
|
-
var searchIcon = isActivePlugin && jsx("span", {
|
|
286
|
-
css: searchIconStyles,
|
|
287
|
-
"data-testid": testIds.searchIcon
|
|
288
|
-
}, jsx(EditorSearchIcon, {
|
|
289
|
-
size: "medium",
|
|
290
|
-
label: ''
|
|
291
|
-
}));
|
|
292
|
-
var tabList = jsx(TabList, null, tabs.map(function (tab) {
|
|
293
|
-
return jsx(Tab, {
|
|
294
|
-
key: tab.tabTitle,
|
|
295
|
-
testId: testIds.tabItem
|
|
296
|
-
}, tab.tabTitle);
|
|
297
|
-
}));
|
|
298
270
|
return jsx("form", {
|
|
299
271
|
"data-testid": testIds.linkPicker,
|
|
300
272
|
css: rootContainerStyles,
|
|
@@ -315,7 +287,6 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
315
287
|
placeholder: intl.formatMessage(messages.linkPlaceholder),
|
|
316
288
|
value: url,
|
|
317
289
|
autoFocus: true,
|
|
318
|
-
elemBeforeInput: searchIcon,
|
|
319
290
|
clearLabel: intl.formatMessage(formMessages.clearLink),
|
|
320
291
|
"aria-expanded": true,
|
|
321
292
|
"aria-autocomplete": "list",
|
|
@@ -338,35 +309,25 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
338
309
|
"aria-label": intl.formatMessage(linkTextMessages.linkTextAriaLabel),
|
|
339
310
|
onClear: handleClear,
|
|
340
311
|
onChange: handleChangeText
|
|
341
|
-
}),
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
testId: testIds.tabList,
|
|
351
|
-
selected: activeTab,
|
|
352
|
-
onChange: handleTabChange
|
|
353
|
-
}, featureFlags !== null && featureFlags !== void 0 && featureFlags.scrollingTabs ? jsx(ScrollingTabList, null, tabList) : tabList), jsx(TrackTabViewed, {
|
|
354
|
-
activePlugin: activePlugin
|
|
355
|
-
})), jsx("div", _extends({
|
|
356
|
-
css: flexColumnStyles
|
|
357
|
-
}, fixListHeightProps), !error && jsx(LinkSearchList, {
|
|
358
|
-
id: linkSearchListId,
|
|
359
|
-
role: "listbox",
|
|
360
|
-
items: items,
|
|
361
|
-
isLoading: isLoadingResults,
|
|
362
|
-
selectedIndex: selectedIndex,
|
|
312
|
+
}), !!queryState && jsx(SearchResults, {
|
|
313
|
+
activeTab: activeTab,
|
|
314
|
+
tabs: tabs,
|
|
315
|
+
activePlugin: activePlugin,
|
|
316
|
+
isLoadingResults: isLoadingResults,
|
|
317
|
+
isLoadingPlugins: isLoadingPlugins,
|
|
318
|
+
linkSearchListId: linkSearchListId,
|
|
319
|
+
error: error,
|
|
320
|
+
featureFlags: featureFlags,
|
|
363
321
|
activeIndex: activeIndex,
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
322
|
+
selectedIndex: selectedIndex,
|
|
323
|
+
items: items,
|
|
324
|
+
queryState: queryState,
|
|
325
|
+
handleKeyDown: handleKeyDown,
|
|
326
|
+
handleSelected: handleSelected,
|
|
327
|
+
handleTabChange: handleTabChange,
|
|
328
|
+
handleSearchListOnChange: handleSearchListOnChange,
|
|
329
|
+
retry: retry
|
|
330
|
+
}), jsx(FormFooter, {
|
|
370
331
|
error: error,
|
|
371
332
|
items: items
|
|
372
333
|
/** If the results section appears to be loading, impact whether the submit button is disabled */,
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import { Fragment } from 'react';
|
|
7
|
+
import { jsx } from '@emotion/react';
|
|
8
|
+
import Spinner from '@atlaskit/spinner/spinner';
|
|
9
|
+
import Tabs, { Tab, TabList } from '@atlaskit/tabs';
|
|
10
|
+
import { useFixHeight } from '../../../controllers/use-fix-height';
|
|
11
|
+
import { LinkSearchError, testIds as searchErrorTestIds } from './link-search-error';
|
|
12
|
+
import { LinkSearchList, testIds as listTestIds } from './link-search-list';
|
|
13
|
+
import { ScrollingTabList } from './scrolling-tabs';
|
|
14
|
+
import { flexColumnStyles, spinnerContainerStyles, tabsWrapperStyles } from './styled';
|
|
15
|
+
import { TrackTabViewed } from './track-tab-viewed';
|
|
16
|
+
export var testIds = _objectSpread(_objectSpread(_objectSpread({}, searchErrorTestIds), listTestIds), {}, {
|
|
17
|
+
tabsLoadingIndicator: 'link-picker.tabs-loading-indicator',
|
|
18
|
+
tabList: 'link-picker-tabs',
|
|
19
|
+
tabItem: 'link-picker-tab'
|
|
20
|
+
});
|
|
21
|
+
export var SearchResults = function SearchResults(_ref) {
|
|
22
|
+
var _activePlugin$errorFa, _activePlugin$errorFa2;
|
|
23
|
+
var tabs = _ref.tabs,
|
|
24
|
+
activeTab = _ref.activeTab,
|
|
25
|
+
activePlugin = _ref.activePlugin,
|
|
26
|
+
isLoadingPlugins = _ref.isLoadingPlugins,
|
|
27
|
+
isLoadingResults = _ref.isLoadingResults,
|
|
28
|
+
handleTabChange = _ref.handleTabChange,
|
|
29
|
+
handleSearchListOnChange = _ref.handleSearchListOnChange,
|
|
30
|
+
featureFlags = _ref.featureFlags,
|
|
31
|
+
linkSearchListId = _ref.linkSearchListId,
|
|
32
|
+
error = _ref.error,
|
|
33
|
+
queryState = _ref.queryState,
|
|
34
|
+
items = _ref.items,
|
|
35
|
+
activeIndex = _ref.activeIndex,
|
|
36
|
+
selectedIndex = _ref.selectedIndex,
|
|
37
|
+
handleSelected = _ref.handleSelected,
|
|
38
|
+
handleKeyDown = _ref.handleKeyDown,
|
|
39
|
+
retry = _ref.retry;
|
|
40
|
+
var isActivePlugin = !!activePlugin;
|
|
41
|
+
|
|
42
|
+
// This will be redundant if we move towards fixed height search results section
|
|
43
|
+
var fixListHeightProps = useFixHeight(isLoadingResults);
|
|
44
|
+
var tabList = jsx(TabList, null, tabs.map(function (tab) {
|
|
45
|
+
return jsx(Tab, {
|
|
46
|
+
key: tab.tabTitle,
|
|
47
|
+
testId: testIds.tabItem
|
|
48
|
+
}, tab.tabTitle);
|
|
49
|
+
}));
|
|
50
|
+
return jsx(Fragment, null, isLoadingPlugins && !!queryState && jsx("div", {
|
|
51
|
+
css: spinnerContainerStyles
|
|
52
|
+
}, jsx(Spinner, {
|
|
53
|
+
testId: testIds.tabsLoadingIndicator,
|
|
54
|
+
size: "medium"
|
|
55
|
+
})), !isLoadingPlugins && isActivePlugin && !!queryState && jsx(Fragment, null, tabs.length > 0 && jsx("div", {
|
|
56
|
+
css: tabsWrapperStyles
|
|
57
|
+
}, jsx(Tabs, {
|
|
58
|
+
id: testIds.tabList,
|
|
59
|
+
testId: testIds.tabList,
|
|
60
|
+
selected: activeTab,
|
|
61
|
+
onChange: handleTabChange
|
|
62
|
+
}, featureFlags !== null && featureFlags !== void 0 && featureFlags.scrollingTabs ? jsx(ScrollingTabList, null, tabList) : tabList), jsx(TrackTabViewed, {
|
|
63
|
+
activePlugin: activePlugin
|
|
64
|
+
})), jsx("div", _extends({
|
|
65
|
+
css: flexColumnStyles
|
|
66
|
+
}, fixListHeightProps), !error && jsx(LinkSearchList, {
|
|
67
|
+
id: linkSearchListId,
|
|
68
|
+
role: "listbox",
|
|
69
|
+
items: items,
|
|
70
|
+
isLoading: isLoadingResults,
|
|
71
|
+
selectedIndex: selectedIndex,
|
|
72
|
+
activeIndex: activeIndex,
|
|
73
|
+
onSelect: handleSelected,
|
|
74
|
+
onChange: handleSearchListOnChange,
|
|
75
|
+
onKeyDown: handleKeyDown,
|
|
76
|
+
hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
|
|
77
|
+
activePlugin: activePlugin
|
|
78
|
+
}), 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 : jsx(LinkSearchError, null)))));
|
|
79
|
+
};
|
package/dist/esm/ui/link-picker/{link-search-error → search-results/link-search-error}/index.js
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import {
|
|
4
|
+
import { defineMessages, FormattedMessage, useIntl } from 'react-intl-next';
|
|
5
5
|
import Button from '@atlaskit/button';
|
|
6
6
|
import EmptyState from '@atlaskit/empty-state';
|
|
7
|
-
import { GenericErrorSVG } from '
|
|
7
|
+
import { GenericErrorSVG } from '../../../../common/generic-error-svg';
|
|
8
8
|
export var CONTACT_SUPPORT_LINK = 'https://support.atlassian.com/contact/';
|
|
9
9
|
export var messages = defineMessages({
|
|
10
10
|
searchErrorHeader: {
|
package/dist/esm/ui/link-picker/{link-search-list → search-results/link-search-list}/index.js
RENAMED
|
@@ -7,16 +7,16 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
/** @jsx jsx */
|
|
8
8
|
import { forwardRef, Fragment, useCallback, useRef } from 'react';
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
10
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
import { defineMessages, FormattedMessage } from 'react-intl-next';
|
|
11
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
12
12
|
import Spinner from '@atlaskit/spinner';
|
|
13
13
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
14
|
-
import {
|
|
15
|
-
import { listContainerStyles, spinnerContainerStyles, listStyles, listTitleStyles } from './styled';
|
|
14
|
+
import { handleNavKeyDown } from '../../../../common/utils/handleNavKeyDown';
|
|
16
15
|
import { NoResults, testIds as noResultsTestIds } from './link-search-no-results';
|
|
17
|
-
import { useTrackResultsShown } from './use-track-results-shown';
|
|
18
|
-
import { handleNavKeyDown } from '../utils';
|
|
19
16
|
import { emptyStateNoResultsWrapper } from './link-search-no-results/styled';
|
|
17
|
+
import { LinkSearchListItem, testIds as searchResultItemTestIds } from './list-item';
|
|
18
|
+
import { listContainerStyles, listStyles, listTitleStyles, spinnerContainerStyles } from './styled';
|
|
19
|
+
import { useTrackResultsShown } from './use-track-results-shown';
|
|
20
20
|
export var messages = defineMessages({
|
|
21
21
|
titleRecentlyViewed: {
|
|
22
22
|
id: 'fabric.linkPicker.listTitle.recentlyViewed',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
+
import { defineMessages, useIntl } from 'react-intl-next';
|
|
3
4
|
import EmptyState from '@atlaskit/empty-state';
|
|
4
|
-
import { useIntl, defineMessages } from 'react-intl-next';
|
|
5
5
|
import { NoResultsSVG } from './no-results-svg';
|
|
6
6
|
import { emptyStateWrapperStyles } from './styled';
|
|
7
7
|
export var messages = defineMessages({
|
package/dist/esm/ui/link-picker/{list-item → search-results/link-search-list/list-item}/index.js
RENAMED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { forwardRef, Fragment } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { useIntl } from 'react-intl-next';
|
|
5
|
-
|
|
6
|
-
import {
|
|
5
|
+
/* eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports */
|
|
6
|
+
import { transformTimeStamp } from '../../../transformTimeStamp';
|
|
7
|
+
import { composeListItemStyles, imgStyles, itemIconStyles, itemNameStyles, listItemContainerInnerStyles, listItemContainerStyles, listItemContextStyles, listItemNameStyles } from './styled';
|
|
7
8
|
export var testIds = {
|
|
8
9
|
searchResultItem: 'link-search-list-item',
|
|
9
10
|
searchResultIcon: 'link-search-list-item-icon'
|
|
@@ -44,7 +45,6 @@ var ListItemIcon = function ListItemIcon(props) {
|
|
|
44
45
|
export var LinkSearchListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
45
46
|
var item = _ref.item,
|
|
46
47
|
selected = _ref.selected,
|
|
47
|
-
active = _ref.active,
|
|
48
48
|
id = _ref.id,
|
|
49
49
|
role = _ref.role,
|
|
50
50
|
onSelect = _ref.onSelect,
|
package/dist/esm/ui/link-picker/{list-item → search-results/link-search-list/list-item}/styled.js
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import {
|
|
4
|
+
import { B100, B400, B50, N20, N200, N300, N800 } from '@atlaskit/theme/colors';
|
|
5
|
+
import { fontSize, fontSizeSmall } from '@atlaskit/theme/constants';
|
|
5
6
|
// AFP-2532 TODO: Fix automatic suppressions below
|
|
6
7
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
7
|
-
import { fontSizeSmall, fontSize } from '@atlaskit/theme';
|
|
8
8
|
export var relativeFontSizeToBase16 = function relativeFontSizeToBase16(px) {
|
|
9
9
|
if (typeof px === 'string') {
|
|
10
10
|
px = parseInt(px);
|
|
@@ -14,7 +14,7 @@ export var relativeFontSizeToBase16 = function relativeFontSizeToBase16(px) {
|
|
|
14
14
|
}
|
|
15
15
|
return "".concat(px / 16, "rem");
|
|
16
16
|
};
|
|
17
|
-
var listItemBaseStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n padding: ", " ", ";\n margin: 0
|
|
17
|
+
var listItemBaseStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n padding: ", " ", ";\n margin: 0;\n cursor: pointer;\n"])), "var(--ds-space-100, 8px)", "var(--ds-space-200, 16px)");
|
|
18
18
|
var listItemFocusStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ", " inset;\n text-decoration: none;\n }\n"])), "var(--ds-border-focused, ".concat(B100, ")"));
|
|
19
19
|
var listItemBoxShadow = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n box-shadow: inset 2px 0px 0px ", ";\n"])), "var(--ds-border-selected, ".concat(B400, ")"));
|
|
20
20
|
var listItemActive = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n &:hover {\n background-color: ", ";\n ", ";\n }\n"])), "var(--ds-background-neutral-subtle-hovered, ".concat(N20, ")"), listItemBoxShadow);
|
|
@@ -29,6 +29,6 @@ export var listItemContextStyles = css(_templateObject9 || (_templateObject9 = _
|
|
|
29
29
|
export var listItemContainerStyles = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n overflow: hidden;\n text-overflow: ellipsis;\n"])));
|
|
30
30
|
export var listItemContainerInnerStyles = css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n color: ", ";\n white-space: nowrap;\n"])), "var(--ds-text-subtlest, ".concat(N200, ")"));
|
|
31
31
|
|
|
32
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
32
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
33
33
|
export var itemIconStyles = css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n min-width: ", ";\n margin-top: 3px;\n margin-right: ", ";\n"])), "var(--ds-space-200, 16px)", "var(--ds-space-150, 12px)");
|
|
34
34
|
export var imgStyles = css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n max-width: ", ";\n"])), "var(--ds-space-200, 16px)");
|
package/dist/esm/ui/link-picker/{link-search-list → search-results/link-search-list}/styled.js
RENAMED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
+
|
|
4
5
|
// AFP-2532 TODO: Fix automatic suppressions below
|
|
5
6
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
6
7
|
import { typography } from '@atlaskit/theme';
|
|
7
8
|
export var listContainerStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-top: 0;\n min-height: 80px;\n margin-top: ", ";\n margin-bottom: ", ";\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n"])), "var(--ds-space-200, 16px)", "var(--ds-space-200, 16px)");
|
|
8
9
|
export var spinnerContainerStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n text-align: center;\n min-height: 80px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-grow: 1;\n"])));
|
|
9
|
-
export var listStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 0;\n margin: 0;\n list-style: none;\n"])));
|
|
10
|
+
export var listStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 0;\n margin: 0 calc(-1 * ", ");\n list-style: none;\n"])), "var(--ds-space-200, 16px)");
|
|
10
11
|
export var listTitleStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", "\n text-transform: uppercase;\n margin-top: 0;\n margin-bottom: ", ";\n"])), typography.h100(), "var(--ds-space-050, 4px)");
|
|
@@ -2,8 +2,8 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import { useEffect, useMemo, useRef } from 'react';
|
|
3
3
|
import { useDebounce } from 'use-debounce';
|
|
4
4
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
|
-
import { ANALYTICS_CHANNEL } from '
|
|
6
|
-
import createEventPayload from '
|
|
5
|
+
import { ANALYTICS_CHANNEL } from '../../../../../common/constants';
|
|
6
|
+
import createEventPayload from '../../../../../common/utils/analytics/analytics.codegen';
|
|
7
7
|
var DEBOUNCE_MS = 400;
|
|
8
8
|
export var useTrackResultsShown = function useTrackResultsShown(isLoading, items, hasSearchTerm) {
|
|
9
9
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
@@ -4,13 +4,13 @@ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol
|
|
|
4
4
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
5
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
6
|
/** @jsx jsx */
|
|
7
|
-
import React, {
|
|
7
|
+
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
9
|
import Button from '@atlaskit/button';
|
|
10
10
|
import ChevronLeftIcon from '@atlaskit/icon/glyph/chevron-left';
|
|
11
11
|
import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { calculateConditionalButtons, createGhost, getTabList, scrollBack, scrollForward } from './scrolling-tabs';
|
|
13
|
+
import { backButtonStyles, containerStyles, nextButtonStyles, scrollingContainerStyles } from './styles';
|
|
14
14
|
function isTouchDevice() {
|
|
15
15
|
return 'ontouchstart' in window ||
|
|
16
16
|
// eslint-disable-next-line compat/compat
|
|
@@ -20,6 +20,8 @@ var initialConditionalButtonsState = {
|
|
|
20
20
|
back: false,
|
|
21
21
|
forward: false
|
|
22
22
|
};
|
|
23
|
+
|
|
24
|
+
/* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
|
|
23
25
|
export var ScrollingTabList = function ScrollingTabList(props) {
|
|
24
26
|
var ref = useRef(null);
|
|
25
27
|
var _useState = useState(initialConditionalButtonsState),
|
|
@@ -97,6 +99,7 @@ export var ScrollingTabList = function ScrollingTabList(props) {
|
|
|
97
99
|
}
|
|
98
100
|
return function () {
|
|
99
101
|
if (scrollingContainer) {
|
|
102
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
100
103
|
scrollingContainer.removeEventListener('scroll', handleConditionalButtonsChange);
|
|
101
104
|
}
|
|
102
105
|
if (tabs.length) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
export var tabsWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-top: ", ";\n margin-left: calc(-1 * ", ");\n margin-right: calc(-1 * ", ");\n"])), "var(--ds-space-150, 12px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)");
|
|
5
|
+
export var spinnerContainerStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-height: 80px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-grow: 1;\n"])));
|
|
6
|
+
export var flexColumnStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n"])));
|
package/dist/esm/ui/link-picker/{track-tab-viewed → search-results/track-tab-viewed}/index.js
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { useLayoutEffect } from 'react';
|
|
3
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import { ANALYTICS_CHANNEL } from '../../../../common/constants';
|
|
5
|
+
import createEventPayload from '../../../../common/utils/analytics/analytics.codegen';
|
|
6
6
|
export function TrackTabViewed(_ref) {
|
|
7
7
|
var activePlugin = _ref.activePlugin;
|
|
8
8
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|