@atlaskit/link-picker 1.25.2 → 1.25.4
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/.eslintrc.js +18 -0
- package/CHANGELOG.md +12 -0
- package/compass.yml +43 -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 +4 -2
- package/dist/cjs/common/generic-error-svg/index.js +2 -3
- package/dist/cjs/common/utils/handleNavKeyDown.js +29 -0
- package/dist/cjs/controllers/use-fix-height/index.js +2 -3
- package/dist/cjs/services/use-plugins/index.js +7 -8
- package/dist/cjs/ui/error-boundary/error-boundary-fallback/index.js +5 -3
- package/dist/cjs/ui/error-boundary/index.js +8 -9
- package/dist/cjs/ui/index.js +13 -10
- package/dist/cjs/ui/link-picker/announcer.js +4 -5
- package/dist/cjs/ui/link-picker/form-footer/index.js +13 -14
- package/dist/cjs/ui/link-picker/index.js +37 -49
- package/dist/cjs/ui/link-picker/link-search-error/index.js +4 -5
- package/dist/cjs/ui/link-picker/link-search-list/index.js +18 -23
- package/dist/cjs/ui/link-picker/link-search-list/link-search-no-results/index.js +5 -6
- package/dist/cjs/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.js +2 -3
- package/dist/cjs/ui/link-picker/{list-item → link-search-list/list-item}/index.js +47 -43
- package/dist/cjs/ui/link-picker/{list-item → link-search-list/list-item}/styled.js +5 -3
- package/dist/cjs/ui/{scrolling-tabs → link-picker/scrolling-tabs}/index.js +5 -4
- package/dist/cjs/ui/link-picker/styled.js +5 -23
- package/dist/cjs/ui/link-picker/text-input/index.js +6 -7
- package/dist/cjs/ui/link-picker/text-input/utils.js +28 -0
- package/dist/cjs/ui/link-picker/track-mount/index.js +3 -5
- package/dist/cjs/ui/link-picker/track-tab-viewed/index.js +3 -5
- 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 +2 -1
- package/dist/es2019/common/generic-error-svg/index.js +2 -3
- package/dist/es2019/common/utils/handleNavKeyDown.js +22 -0
- package/dist/es2019/controllers/use-fix-height/index.js +2 -3
- package/dist/es2019/services/use-plugins/index.js +5 -6
- package/dist/es2019/ui/error-boundary/error-boundary-fallback/index.js +3 -2
- package/dist/es2019/ui/error-boundary/index.js +10 -9
- package/dist/es2019/ui/index.js +10 -7
- package/dist/es2019/ui/link-picker/announcer.js +3 -4
- package/dist/es2019/ui/link-picker/form-footer/index.js +6 -7
- package/dist/es2019/ui/link-picker/index.js +23 -34
- package/dist/es2019/ui/link-picker/link-search-error/index.js +4 -5
- package/dist/es2019/ui/link-picker/link-search-list/index.js +11 -12
- package/dist/es2019/ui/link-picker/link-search-list/link-search-no-results/index.js +4 -5
- package/dist/es2019/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.js +2 -3
- package/dist/es2019/ui/link-picker/{list-item → link-search-list/list-item}/index.js +42 -40
- package/dist/es2019/ui/link-picker/{list-item → link-search-list/list-item}/styled.js +2 -2
- package/dist/es2019/ui/link-picker/link-search-list/styled.js +1 -0
- package/dist/es2019/ui/{scrolling-tabs → link-picker/scrolling-tabs}/index.js +7 -5
- package/dist/es2019/ui/link-picker/styled.js +0 -30
- package/dist/es2019/ui/link-picker/text-input/index.js +7 -8
- package/dist/es2019/ui/link-picker/text-input/utils.js +22 -0
- package/dist/es2019/ui/link-picker/track-mount/index.js +3 -4
- package/dist/es2019/ui/link-picker/track-tab-viewed/index.js +3 -4
- 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 +2 -1
- package/dist/esm/common/generic-error-svg/index.js +2 -3
- package/dist/esm/common/utils/handleNavKeyDown.js +22 -0
- package/dist/esm/controllers/use-fix-height/index.js +2 -3
- package/dist/esm/services/use-plugins/index.js +5 -6
- package/dist/esm/ui/error-boundary/error-boundary-fallback/index.js +3 -2
- package/dist/esm/ui/error-boundary/index.js +9 -9
- package/dist/esm/ui/index.js +13 -9
- package/dist/esm/ui/link-picker/announcer.js +3 -4
- package/dist/esm/ui/link-picker/form-footer/index.js +6 -7
- package/dist/esm/ui/link-picker/index.js +23 -34
- package/dist/esm/ui/link-picker/link-search-error/index.js +4 -5
- package/dist/esm/ui/link-picker/link-search-list/index.js +11 -13
- package/dist/esm/ui/link-picker/link-search-list/link-search-no-results/index.js +4 -5
- package/dist/esm/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.js +2 -3
- package/dist/esm/ui/link-picker/{list-item → link-search-list/list-item}/index.js +42 -40
- package/dist/esm/ui/link-picker/{list-item → link-search-list/list-item}/styled.js +2 -2
- package/dist/esm/ui/link-picker/link-search-list/styled.js +1 -0
- package/dist/esm/ui/{scrolling-tabs → link-picker/scrolling-tabs}/index.js +7 -5
- package/dist/esm/ui/link-picker/styled.js +4 -19
- package/dist/esm/ui/link-picker/text-input/index.js +7 -8
- package/dist/esm/ui/link-picker/text-input/utils.js +20 -0
- package/dist/esm/ui/link-picker/track-mount/index.js +3 -4
- package/dist/esm/ui/link-picker/track-tab-viewed/index.js +3 -4
- 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 +1 -0
- package/dist/types/common/generic-error-svg/index.d.ts +1 -2
- package/dist/types/{ui → common}/types.d.ts +10 -0
- package/dist/types/common/utils/handleNavKeyDown.d.ts +2 -0
- package/dist/types/controllers/use-fix-height/index.d.ts +1 -2
- 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/error-boundary/index.d.ts +4 -5
- package/dist/types/ui/index.d.ts +0 -1
- package/dist/types/ui/link-picker/announcer.d.ts +2 -2
- package/dist/types/ui/link-picker/form-footer/index.d.ts +3 -4
- package/dist/types/ui/link-picker/form-footer/utils.d.ts +1 -1
- package/dist/types/ui/link-picker/index.d.ts +5 -16
- package/dist/types/ui/link-picker/link-search-error/index.d.ts +1 -2
- package/dist/types/ui/link-picker/link-search-list/index.d.ts +5 -4
- package/dist/types/ui/link-picker/link-search-list/link-search-no-results/index.d.ts +1 -2
- package/dist/types/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.d.ts +1 -2
- package/dist/types/ui/link-picker/link-search-list/list-item/index.d.ts +19 -0
- package/dist/types/ui/link-picker/link-search-list/use-track-results-shown/index.d.ts +1 -1
- package/dist/{types-ts4.5/ui → types/ui/link-picker}/scrolling-tabs/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 +2 -3
- package/dist/types/ui/link-picker/text-input/utils.d.ts +3 -0
- package/dist/types/ui/link-picker/track-mount/index.d.ts +1 -2
- package/dist/types/ui/link-picker/track-tab-viewed/index.d.ts +1 -2
- 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 +1 -0
- package/dist/types-ts4.5/common/generic-error-svg/index.d.ts +1 -2
- package/dist/types-ts4.5/{ui → common}/types.d.ts +10 -0
- package/dist/types-ts4.5/common/utils/handleNavKeyDown.d.ts +2 -0
- package/dist/types-ts4.5/controllers/use-fix-height/index.d.ts +1 -2
- 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/error-boundary/index.d.ts +4 -5
- package/dist/types-ts4.5/ui/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/link-picker/announcer.d.ts +2 -2
- package/dist/types-ts4.5/ui/link-picker/form-footer/index.d.ts +3 -4
- 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 +5 -16
- package/dist/types-ts4.5/ui/link-picker/link-search-error/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/link-search-list/index.d.ts +5 -4
- package/dist/types-ts4.5/ui/link-picker/link-search-list/link-search-no-results/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/link-search-list/list-item/index.d.ts +19 -0
- package/dist/types-ts4.5/ui/link-picker/link-search-list/use-track-results-shown/index.d.ts +1 -1
- package/dist/{types/ui → types-ts4.5/ui/link-picker}/scrolling-tabs/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 +2 -3
- package/dist/types-ts4.5/ui/link-picker/text-input/utils.d.ts +3 -0
- package/dist/types-ts4.5/ui/link-picker/track-mount/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/track-tab-viewed/index.d.ts +1 -2
- 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 +26 -6
- package/dist/types/ui/link-picker/list-item/index.d.ts +0 -16
- package/dist/types-ts4.5/ui/link-picker/list-item/index.d.ts +0 -16
- /package/dist/cjs/{ui → common}/types.js +0 -0
- /package/dist/cjs/ui/{scrolling-tabs → link-picker/scrolling-tabs}/scrolling-tabs.js +0 -0
- /package/dist/cjs/ui/{scrolling-tabs → link-picker/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/{scrolling-tabs → link-picker/scrolling-tabs}/scrolling-tabs.js +0 -0
- /package/dist/es2019/ui/{scrolling-tabs → link-picker/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/{scrolling-tabs → link-picker/scrolling-tabs}/scrolling-tabs.js +0 -0
- /package/dist/esm/ui/{scrolling-tabs → link-picker/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/{list-item → link-search-list/list-item}/styled.d.ts +0 -0
- /package/dist/types/ui/{scrolling-tabs → link-picker/scrolling-tabs}/scrolling-tabs.d.ts +0 -0
- /package/dist/types/ui/{scrolling-tabs → link-picker/scrolling-tabs}/styles.d.ts +0 -0
- /package/dist/types-ts4.5/ui/link-picker/{list-item → link-search-list/list-item}/styled.d.ts +0 -0
- /package/dist/types-ts4.5/ui/{scrolling-tabs → link-picker/scrolling-tabs}/scrolling-tabs.d.ts +0 -0
- /package/dist/types-ts4.5/ui/{scrolling-tabs → link-picker/scrolling-tabs}/styles.d.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { useLayoutEffect } from 'react';
|
|
3
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
|
-
import createEventPayload from '../../../common/utils/analytics/analytics.codegen';
|
|
5
4
|
import { ANALYTICS_CHANNEL } from '../../../common/constants';
|
|
6
|
-
|
|
5
|
+
import createEventPayload from '../../../common/utils/analytics/analytics.codegen';
|
|
6
|
+
export function TrackTabViewed(_ref) {
|
|
7
7
|
var activePlugin = _ref.activePlugin;
|
|
8
8
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
9
9
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
@@ -13,5 +13,4 @@ function TrackTabViewed(_ref) {
|
|
|
13
13
|
}
|
|
14
14
|
}, [activePlugin, createAnalyticsEvent]);
|
|
15
15
|
return null;
|
|
16
|
-
}
|
|
17
|
-
export default TrackTabViewed;
|
|
16
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import isYesterday from 'date-fns/isYesterday';
|
|
2
2
|
import { isMoreThanOneWeekAgo } from '../../common/utils/date';
|
|
3
3
|
import { selectUnit } from '../../common/utils/dateUtils';
|
|
4
|
-
import
|
|
4
|
+
import { timeMessages } from './messages';
|
|
5
5
|
var formatTime = function formatTime(timeStamp, intl) {
|
|
6
6
|
var isAbsolute = isMoreThanOneWeekAgo(timeStamp);
|
|
7
7
|
if (isAbsolute) {
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
import { browser } from '@atlaskit/linking-common/user-agent';
|
|
2
1
|
import { transformTimeStamp } from './transformTimeStamp';
|
|
3
|
-
var KeyZCode = 90;
|
|
4
|
-
var KeyYCode = 89;
|
|
5
|
-
export var isUndoEvent = function isUndoEvent(e) {
|
|
6
|
-
var _browser = browser(),
|
|
7
|
-
mac = _browser.mac;
|
|
8
|
-
return e.keyCode === KeyZCode && (
|
|
9
|
-
// cmd + z for mac
|
|
10
|
-
mac && e.metaKey && !e.shiftKey ||
|
|
11
|
-
// ctrl + z for non-mac
|
|
12
|
-
!mac && e.ctrlKey);
|
|
13
|
-
};
|
|
14
|
-
export var isRedoEvent = function isRedoEvent(e) {
|
|
15
|
-
var _browser2 = browser(),
|
|
16
|
-
mac = _browser2.mac;
|
|
17
|
-
return (
|
|
18
|
-
// ctrl + y for non-mac
|
|
19
|
-
!mac && e.ctrlKey && e.keyCode === KeyYCode || mac && e.metaKey && e.shiftKey && e.keyCode === KeyZCode || e.ctrlKey && e.shiftKey && e.keyCode === KeyZCode
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
2
|
|
|
23
3
|
/**
|
|
24
4
|
* Retrieve the data source for a link given the item and the plugin that resolved it
|
|
@@ -37,26 +17,4 @@ export function getScreenReaderText(items, selectedIndex, intl) {
|
|
|
37
17
|
var date = transformTimeStamp(intl, lastViewedDate, lastUpdatedDate);
|
|
38
18
|
return [name, container, date].filter(Boolean).join(', ');
|
|
39
19
|
}
|
|
40
|
-
}
|
|
41
|
-
export var handleNavKeyDown = function handleNavKeyDown(event, itemsLength, activeIndex) {
|
|
42
|
-
var updatedIndex = activeIndex;
|
|
43
|
-
switch (event.key) {
|
|
44
|
-
case 'ArrowDown':
|
|
45
|
-
event.preventDefault();
|
|
46
|
-
updatedIndex = (activeIndex + 1) % itemsLength;
|
|
47
|
-
break;
|
|
48
|
-
case 'ArrowUp':
|
|
49
|
-
event.preventDefault();
|
|
50
|
-
updatedIndex = activeIndex > 0 ? activeIndex - 1 : itemsLength - 1;
|
|
51
|
-
break;
|
|
52
|
-
case 'Home':
|
|
53
|
-
event.preventDefault();
|
|
54
|
-
updatedIndex = 0;
|
|
55
|
-
break;
|
|
56
|
-
case 'End':
|
|
57
|
-
event.preventDefault();
|
|
58
|
-
updatedIndex = itemsLength - 1;
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
return updatedIndex;
|
|
62
|
-
};
|
|
20
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import Spinner from '@atlaskit/spinner';
|
|
4
|
-
import { rootContainerStylesForLoaderWithDisplaytext, rootContainerStylesForLoaderWithoutDisplaytext } from '
|
|
4
|
+
import { rootContainerStylesForLoaderWithDisplaytext, rootContainerStylesForLoaderWithoutDisplaytext } from './styled';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Loader / skeleton for the Link Picker. Takes displayText prop - when no displayText is given the height of the skeleton
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
|
|
6
|
+
import { rootContainerStyles } from '../link-picker/styled';
|
|
7
|
+
|
|
8
|
+
/** Link Picker loader / skeleton will be taller in height when displayText field is shown */
|
|
9
|
+
// See lazy-load-height example to verify these
|
|
10
|
+
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_DISPLAYTEXT = 142;
|
|
11
|
+
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_DISPLAYTEXT = 220;
|
|
12
|
+
var rootContainerStylesForLoader = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n display: flex;\n align-items: center;\n justify-content: center;\n"])), rootContainerStyles);
|
|
13
|
+
export var rootContainerStylesForLoaderWithDisplaytext = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n min-height: ", "px;\n"])), rootContainerStylesForLoader, LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_DISPLAYTEXT);
|
|
14
|
+
|
|
15
|
+
/** Link Picker loader / skeleton will be shorter in height when displayText field isn't shown */
|
|
16
|
+
export var rootContainerStylesForLoaderWithoutDisplaytext = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n min-height: ", "px;\n"])), rootContainerStylesForLoader, LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_DISPLAYTEXT);
|
package/dist/esm/version.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { LinkPickerProps } from '../../index';
|
|
2
3
|
import { LinkPickerAnalyticsContextType } from '../utils/analytics/analytics.codegen';
|
|
3
|
-
import { LinkPickerProps } from '../../';
|
|
4
4
|
type AnalyticsContextAttributesType = LinkPickerAnalyticsContextType;
|
|
5
5
|
export type TrackAttribute = <K extends keyof LinkPickerAnalyticsContextType>(attribute: K, value: AnalyticsContextAttributesType[K]) => void;
|
|
6
6
|
interface AnalyticsContextType {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
declare const GenericErrorSVG: (props: React.SVGProps<SVGSVGElement>) => jsx.JSX.Element;
|
|
4
|
-
export default GenericErrorSVG;
|
|
3
|
+
export declare const GenericErrorSVG: (props: React.SVGProps<SVGSVGElement>) => jsx.JSX.Element;
|
|
@@ -61,3 +61,13 @@ export interface LinkPickerPluginAction {
|
|
|
61
61
|
}
|
|
62
62
|
export type LinkPickerPluginErrorFallback = (error: unknown, retry: () => void) => ReactNode;
|
|
63
63
|
export type LinkPickerPluginEmptyStateNoResults = () => ReactNode;
|
|
64
|
+
export interface PickerState {
|
|
65
|
+
selectedIndex: number;
|
|
66
|
+
activeIndex: number;
|
|
67
|
+
url: string;
|
|
68
|
+
displayText: string;
|
|
69
|
+
invalidUrl: boolean;
|
|
70
|
+
activeTab: number;
|
|
71
|
+
/** When true, even if the selected index is -1, don't hide the recents. */
|
|
72
|
+
preventHidingRecents: boolean;
|
|
73
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const useFixHeight: (shouldFixHeight: boolean) => {
|
|
2
|
+
export declare const useFixHeight: (shouldFixHeight: boolean) => {
|
|
3
3
|
ref: import("react").RefObject<HTMLDivElement>;
|
|
4
4
|
style: {
|
|
5
5
|
minHeight: string | number;
|
|
6
6
|
} | undefined;
|
|
7
7
|
};
|
|
8
|
-
export default useFixHeight;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { ComposedLinkPicker as LinkPicker } from './ui';
|
|
2
2
|
export type { LinkPickerProps } from './ui/link-picker';
|
|
3
|
-
export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, } from './
|
|
3
|
+
export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, } from './common/types';
|
|
4
4
|
export { UnauthenticatedError } from './common/utils/errors';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LinkPickerPlugin, LinkPickerPluginAction, LinkPickerPluginErrorFallback, LinkPickerState, LinkSearchListItemData } from '../../
|
|
1
|
+
import { LinkPickerPlugin, LinkPickerPluginAction, LinkPickerPluginErrorFallback, LinkPickerState, LinkSearchListItemData } from '../../common/types';
|
|
2
2
|
export interface LinkPickerPluginsService {
|
|
3
3
|
items: LinkSearchListItemData[] | null;
|
|
4
4
|
isLoading: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LinkPickerPlugin, LinkPickerState, ResolveResult } from '../../
|
|
1
|
+
import { LinkPickerPlugin, LinkPickerState, ResolveResult } from '../../common/types';
|
|
2
2
|
export declare class CancellationError extends Error {
|
|
3
3
|
}
|
|
4
4
|
export declare const cancellable: <T extends unknown>(promise: Promise<T>) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
interface ErrorBoundaryProps extends WithAnalyticsEventsProps {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface ErrorBoundaryProps {
|
|
4
3
|
children: ReactNode;
|
|
5
4
|
}
|
|
6
|
-
declare
|
|
7
|
-
export
|
|
5
|
+
export declare function ErrorBoundary({ children }: ErrorBoundaryProps): JSX.Element;
|
|
6
|
+
export {};
|
package/dist/types/ui/index.d.ts
CHANGED
|
@@ -18,5 +18,5 @@ type AnnouncerProps = {
|
|
|
18
18
|
* It can be useful for cases when the parent component re-renders with the same announcer's text. */
|
|
19
19
|
delay?: number;
|
|
20
20
|
};
|
|
21
|
-
declare const
|
|
22
|
-
export
|
|
21
|
+
export declare const Announcer: React.FC<AnnouncerProps>;
|
|
22
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/** @jsx jsx */
|
|
3
2
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { LinkPickerPluginAction, LinkPickerState, LinkSearchListItemData } from '
|
|
3
|
+
import { LinkPickerPluginAction, LinkPickerState, LinkSearchListItemData } from '../../../common/types';
|
|
5
4
|
export declare const testIds: {
|
|
6
5
|
readonly insertButton: "link-picker-insert-button";
|
|
7
6
|
readonly cancelButton: "link-picker-cancel-button";
|
|
@@ -18,5 +17,5 @@ interface FormFooterProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
18
17
|
onCancel?: () => void;
|
|
19
18
|
action?: LinkPickerPluginAction;
|
|
20
19
|
}
|
|
21
|
-
declare const
|
|
22
|
-
export
|
|
20
|
+
export declare const FormFooter: import("react").MemoExoticComponent<({ isLoading, error, url, queryState, items, isEditing, onCancel, action, ...restProps }: FormFooterProps) => jsx.JSX.Element | null>;
|
|
21
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LinkPickerState, LinkSearchListItemData } from '
|
|
1
|
+
import { LinkPickerState, LinkSearchListItemData } from '../../../common/types';
|
|
2
2
|
export declare const checkSubmitDisabled: (isLoading: boolean, error: unknown | null, url: string, queryState: LinkPickerState | null, items: LinkSearchListItemData[] | null) => boolean;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
import { LinkInputType, LinkPickerPlugin } from '
|
|
4
|
-
export declare const RECENT_SEARCH_LIST_SIZE = 5;
|
|
3
|
+
import { LinkInputType, LinkPickerPlugin } from '../../common/types';
|
|
5
4
|
export declare const testIds: {
|
|
6
5
|
readonly tabList: "link-picker-tabs";
|
|
7
6
|
readonly tabItem: "link-picker-tab";
|
|
8
7
|
readonly urlError: string;
|
|
9
8
|
readonly clearUrlButton: string;
|
|
10
9
|
readonly resultListTitle: string;
|
|
11
|
-
readonly searchResultItem: string;
|
|
12
10
|
readonly searchResultList: string;
|
|
13
11
|
readonly searchResultLoadingIndicator: string;
|
|
14
12
|
readonly tabsLoadingIndicator: string;
|
|
13
|
+
readonly searchResultItem: string;
|
|
14
|
+
readonly searchResultIcon: string;
|
|
15
15
|
readonly emptyResultPage: string;
|
|
16
16
|
readonly searchError: string;
|
|
17
17
|
readonly insertButton: "link-picker-insert-button";
|
|
@@ -21,7 +21,6 @@ export declare const testIds: {
|
|
|
21
21
|
readonly linkPicker: "link-picker";
|
|
22
22
|
readonly urlInputField: "link-url";
|
|
23
23
|
readonly textInputField: "link-text";
|
|
24
|
-
readonly searchIcon: "link-picker-search-icon";
|
|
25
24
|
};
|
|
26
25
|
interface Meta {
|
|
27
26
|
/** Indicates how the link was picked. */
|
|
@@ -69,15 +68,5 @@ export interface LinkPickerProps {
|
|
|
69
68
|
hideDisplayText?: boolean;
|
|
70
69
|
featureFlags?: Record<string, unknown>;
|
|
71
70
|
}
|
|
72
|
-
export
|
|
73
|
-
|
|
74
|
-
activeIndex: number;
|
|
75
|
-
url: string;
|
|
76
|
-
displayText: string;
|
|
77
|
-
invalidUrl: boolean;
|
|
78
|
-
activeTab: number;
|
|
79
|
-
/** When true, even if the selected index is -1, don't hide the recents. */
|
|
80
|
-
preventHidingRecents: boolean;
|
|
81
|
-
}
|
|
82
|
-
declare const _default: import("react").ComponentType<LinkPickerProps>;
|
|
83
|
-
export default _default;
|
|
71
|
+
export declare const LinkPicker: import("react").ComponentType<LinkPickerProps>;
|
|
72
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { KeyboardEvent } from 'react';
|
|
3
|
-
import { LinkPickerPlugin, LinkSearchListItemData } from '
|
|
3
|
+
import { LinkPickerPlugin, LinkSearchListItemData } from '../../../common/types';
|
|
4
4
|
export declare const messages: {
|
|
5
5
|
titleRecentlyViewed: {
|
|
6
6
|
id: string;
|
|
@@ -20,10 +20,11 @@ export declare const messages: {
|
|
|
20
20
|
};
|
|
21
21
|
export declare const testIds: {
|
|
22
22
|
resultListTitle: string;
|
|
23
|
-
searchResultItem: string;
|
|
24
23
|
searchResultList: string;
|
|
25
24
|
searchResultLoadingIndicator: string;
|
|
26
25
|
tabsLoadingIndicator: string;
|
|
26
|
+
searchResultItem: string;
|
|
27
|
+
searchResultIcon: string;
|
|
27
28
|
emptyResultPage: string;
|
|
28
29
|
};
|
|
29
30
|
type LinkSearchListElement = HTMLElement;
|
|
@@ -42,5 +43,5 @@ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<LinkSearc
|
|
|
42
43
|
hasSearchTerm?: boolean;
|
|
43
44
|
activePlugin?: LinkPickerPlugin;
|
|
44
45
|
}
|
|
45
|
-
declare const LinkSearchList: import("react").ForwardRefExoticComponent<LinkSearchListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
46
|
-
export
|
|
46
|
+
export declare const LinkSearchList: import("react").ForwardRefExoticComponent<LinkSearchListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { KeyboardEvent } from 'react';
|
|
3
|
+
import { LinkSearchListItemData } from '../../../../common/types';
|
|
4
|
+
export declare const testIds: {
|
|
5
|
+
searchResultItem: string;
|
|
6
|
+
searchResultIcon: string;
|
|
7
|
+
};
|
|
8
|
+
export interface LinkSearchListItemProps {
|
|
9
|
+
item: LinkSearchListItemData;
|
|
10
|
+
selected: boolean;
|
|
11
|
+
active: boolean;
|
|
12
|
+
tabIndex?: number;
|
|
13
|
+
onSelect: (objectId: string) => void;
|
|
14
|
+
onKeyDown: (e: KeyboardEvent<HTMLDivElement>) => void;
|
|
15
|
+
onFocus: () => void;
|
|
16
|
+
id?: string;
|
|
17
|
+
role?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const LinkSearchListItem: import("react").ForwardRefExoticComponent<LinkSearchListItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LinkSearchListItemData } from '
|
|
1
|
+
import { LinkSearchListItemData } from '../../../../common/types';
|
|
2
2
|
export declare const useTrackResultsShown: (isLoading: boolean, items?: LinkSearchListItemData[] | null | undefined, hasSearchTerm?: boolean) => void;
|
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
* Half padding on the top as the form field has a `gridSize()` margin top that cannot be overridden
|
|
3
3
|
*/
|
|
4
4
|
export declare const rootContainerStyles: import("@emotion/react").SerializedStyles;
|
|
5
|
-
/** Link Picker loader / skeleton will be taller in height when displayText field is shown */
|
|
6
|
-
export declare const rootContainerStylesForLoaderWithDisplaytext: import("@emotion/react").SerializedStyles;
|
|
7
|
-
/** Link Picker loader / skeleton will be shorter in height when displayText field isn't shown */
|
|
8
|
-
export declare const rootContainerStylesForLoaderWithoutDisplaytext: import("@emotion/react").SerializedStyles;
|
|
9
|
-
export declare const searchIconStyles: import("@emotion/react").SerializedStyles;
|
|
10
5
|
export declare const tabsWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
11
6
|
export declare const flexColumnStyles: import("@emotion/react").SerializedStyles;
|
|
12
7
|
export declare const formFooterMargin: import("@emotion/react").SerializedStyles;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { TextFieldProps } from '@atlaskit/textfield';
|
|
3
|
-
import { ConditionalSpotlightTargetWrapperProps } from '
|
|
3
|
+
import { ConditionalSpotlightTargetWrapperProps } from './conditional-spotlight-target-wrapper';
|
|
4
4
|
export type TextInputProps = Omit<TextFieldProps, 'name' | 'value'> & Pick<ConditionalSpotlightTargetWrapperProps, 'spotlightTargetName'> & {
|
|
5
5
|
name: string;
|
|
6
6
|
value: string;
|
|
@@ -15,5 +15,4 @@ export declare const testIds: {
|
|
|
15
15
|
urlError: string;
|
|
16
16
|
clearUrlButton: string;
|
|
17
17
|
};
|
|
18
|
-
declare const TextInput: ({ name, label, autoFocus, onRedo, onUndo, onKeyDown, onClear, clearLabel, error, spotlightTargetName, ...restProps }: TextInputProps) => jsx.JSX.Element;
|
|
19
|
-
export default TextInput;
|
|
18
|
+
export declare const TextInput: ({ name, label, autoFocus, onRedo, onUndo, onKeyDown, onClear, clearLabel, error, spotlightTargetName, ...restProps }: TextInputProps) => jsx.JSX.Element;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import { KeyboardEvent } from 'react';
|
|
2
1
|
import { IntlShape } from 'react-intl-next';
|
|
3
|
-
import { LinkPickerPlugin, LinkSearchListItemData } from '
|
|
4
|
-
export declare const isUndoEvent: (e: KeyboardEvent<HTMLInputElement>) => boolean;
|
|
5
|
-
export declare const isRedoEvent: (e: KeyboardEvent<HTMLInputElement>) => boolean;
|
|
2
|
+
import { LinkPickerPlugin, LinkSearchListItemData } from '../../common/types';
|
|
6
3
|
/**
|
|
7
4
|
* Retrieve the data source for a link given the item and the plugin that resolved it
|
|
8
5
|
*/
|
|
9
6
|
export declare const getDataSource: (item: LinkSearchListItemData, plugin?: LinkPickerPlugin) => string;
|
|
10
7
|
export declare function getScreenReaderText(items: LinkSearchListItemData[], selectedIndex: number, intl: IntlShape): string | undefined;
|
|
11
|
-
export declare const handleNavKeyDown: (event: KeyboardEvent<HTMLElement>, itemsLength: number, activeIndex: number) => number;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const rootContainerStylesForLoaderWithDisplaytext: import("@emotion/react").SerializedStyles;
|
|
2
|
+
/** Link Picker loader / skeleton will be shorter in height when displayText field isn't shown */
|
|
3
|
+
export declare const rootContainerStylesForLoaderWithoutDisplaytext: import("@emotion/react").SerializedStyles;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { LinkPickerProps } from '../../index';
|
|
2
3
|
import { LinkPickerAnalyticsContextType } from '../utils/analytics/analytics.codegen';
|
|
3
|
-
import { LinkPickerProps } from '../../';
|
|
4
4
|
type AnalyticsContextAttributesType = LinkPickerAnalyticsContextType;
|
|
5
5
|
export type TrackAttribute = <K extends keyof LinkPickerAnalyticsContextType>(attribute: K, value: AnalyticsContextAttributesType[K]) => void;
|
|
6
6
|
interface AnalyticsContextType {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
declare const GenericErrorSVG: (props: React.SVGProps<SVGSVGElement>) => jsx.JSX.Element;
|
|
4
|
-
export default GenericErrorSVG;
|
|
3
|
+
export declare const GenericErrorSVG: (props: React.SVGProps<SVGSVGElement>) => jsx.JSX.Element;
|
|
@@ -61,3 +61,13 @@ export interface LinkPickerPluginAction {
|
|
|
61
61
|
}
|
|
62
62
|
export type LinkPickerPluginErrorFallback = (error: unknown, retry: () => void) => ReactNode;
|
|
63
63
|
export type LinkPickerPluginEmptyStateNoResults = () => ReactNode;
|
|
64
|
+
export interface PickerState {
|
|
65
|
+
selectedIndex: number;
|
|
66
|
+
activeIndex: number;
|
|
67
|
+
url: string;
|
|
68
|
+
displayText: string;
|
|
69
|
+
invalidUrl: boolean;
|
|
70
|
+
activeTab: number;
|
|
71
|
+
/** When true, even if the selected index is -1, don't hide the recents. */
|
|
72
|
+
preventHidingRecents: boolean;
|
|
73
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const useFixHeight: (shouldFixHeight: boolean) => {
|
|
2
|
+
export declare const useFixHeight: (shouldFixHeight: boolean) => {
|
|
3
3
|
ref: import("react").RefObject<HTMLDivElement>;
|
|
4
4
|
style: {
|
|
5
5
|
minHeight: string | number;
|
|
6
6
|
} | undefined;
|
|
7
7
|
};
|
|
8
|
-
export default useFixHeight;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { ComposedLinkPicker as LinkPicker } from './ui';
|
|
2
2
|
export type { LinkPickerProps } from './ui/link-picker';
|
|
3
|
-
export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, } from './
|
|
3
|
+
export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, } from './common/types';
|
|
4
4
|
export { UnauthenticatedError } from './common/utils/errors';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LinkPickerPlugin, LinkPickerPluginAction, LinkPickerPluginErrorFallback, LinkPickerState, LinkSearchListItemData } from '../../
|
|
1
|
+
import { LinkPickerPlugin, LinkPickerPluginAction, LinkPickerPluginErrorFallback, LinkPickerState, LinkSearchListItemData } from '../../common/types';
|
|
2
2
|
export interface LinkPickerPluginsService {
|
|
3
3
|
items: LinkSearchListItemData[] | null;
|
|
4
4
|
isLoading: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LinkPickerPlugin, LinkPickerState, ResolveResult } from '../../
|
|
1
|
+
import { LinkPickerPlugin, LinkPickerState, ResolveResult } from '../../common/types';
|
|
2
2
|
export declare class CancellationError extends Error {
|
|
3
3
|
}
|
|
4
4
|
export declare const cancellable: <T extends unknown>(promise: Promise<T>) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
interface ErrorBoundaryProps extends WithAnalyticsEventsProps {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface ErrorBoundaryProps {
|
|
4
3
|
children: ReactNode;
|
|
5
4
|
}
|
|
6
|
-
declare
|
|
7
|
-
export
|
|
5
|
+
export declare function ErrorBoundary({ children }: ErrorBoundaryProps): JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -18,5 +18,5 @@ type AnnouncerProps = {
|
|
|
18
18
|
* It can be useful for cases when the parent component re-renders with the same announcer's text. */
|
|
19
19
|
delay?: number;
|
|
20
20
|
};
|
|
21
|
-
declare const
|
|
22
|
-
export
|
|
21
|
+
export declare const Announcer: React.FC<AnnouncerProps>;
|
|
22
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/** @jsx jsx */
|
|
3
2
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { LinkPickerPluginAction, LinkPickerState, LinkSearchListItemData } from '
|
|
3
|
+
import { LinkPickerPluginAction, LinkPickerState, LinkSearchListItemData } from '../../../common/types';
|
|
5
4
|
export declare const testIds: {
|
|
6
5
|
readonly insertButton: "link-picker-insert-button";
|
|
7
6
|
readonly cancelButton: "link-picker-cancel-button";
|
|
@@ -18,5 +17,5 @@ interface FormFooterProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
18
17
|
onCancel?: () => void;
|
|
19
18
|
action?: LinkPickerPluginAction;
|
|
20
19
|
}
|
|
21
|
-
declare const
|
|
22
|
-
export
|
|
20
|
+
export declare const FormFooter: import("react").MemoExoticComponent<({ isLoading, error, url, queryState, items, isEditing, onCancel, action, ...restProps }: FormFooterProps) => jsx.JSX.Element | null>;
|
|
21
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LinkPickerState, LinkSearchListItemData } from '
|
|
1
|
+
import { LinkPickerState, LinkSearchListItemData } from '../../../common/types';
|
|
2
2
|
export declare const checkSubmitDisabled: (isLoading: boolean, error: unknown | null, url: string, queryState: LinkPickerState | null, items: LinkSearchListItemData[] | null) => boolean;
|