@atlaskit/link-picker 1.20.1 → 1.20.2

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.
Files changed (77) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/version.json +1 -1
  3. package/dist/es2019/version.json +1 -1
  4. package/dist/esm/version.json +1 -1
  5. package/dist/types-ts4.5/analytics.codegen.d.ts +63 -0
  6. package/dist/types-ts4.5/common/analytics/context.d.ts +31 -0
  7. package/dist/types-ts4.5/common/analytics/experiences.d.ts +11 -0
  8. package/dist/types-ts4.5/common/analytics/index.d.ts +2 -0
  9. package/dist/types-ts4.5/common/analytics/input-field-tracking.d.ts +17 -0
  10. package/dist/types-ts4.5/common/constants.d.ts +2 -0
  11. package/dist/types-ts4.5/common/generic-error-svg/index.d.ts +4 -0
  12. package/dist/types-ts4.5/common/generic-error-svg/styled.d.ts +1 -0
  13. package/dist/types-ts4.5/common/utils/errors.d.ts +6 -0
  14. package/dist/types-ts4.5/controllers/session-provider/index.d.ts +10 -0
  15. package/dist/types-ts4.5/controllers/use-fix-height/index.d.ts +8 -0
  16. package/dist/types-ts4.5/i18n/cs.d.ts +33 -0
  17. package/dist/types-ts4.5/i18n/da.d.ts +36 -0
  18. package/dist/types-ts4.5/i18n/de.d.ts +33 -0
  19. package/dist/types-ts4.5/i18n/en.d.ts +36 -0
  20. package/dist/types-ts4.5/i18n/en_GB.d.ts +36 -0
  21. package/dist/types-ts4.5/i18n/es.d.ts +33 -0
  22. package/dist/types-ts4.5/i18n/fi.d.ts +36 -0
  23. package/dist/types-ts4.5/i18n/fr.d.ts +33 -0
  24. package/dist/types-ts4.5/i18n/hu.d.ts +33 -0
  25. package/dist/types-ts4.5/i18n/it.d.ts +36 -0
  26. package/dist/types-ts4.5/i18n/ja.d.ts +36 -0
  27. package/dist/types-ts4.5/i18n/ko.d.ts +36 -0
  28. package/dist/types-ts4.5/i18n/nb.d.ts +33 -0
  29. package/dist/types-ts4.5/i18n/nl.d.ts +36 -0
  30. package/dist/types-ts4.5/i18n/pl.d.ts +33 -0
  31. package/dist/types-ts4.5/i18n/pt_BR.d.ts +36 -0
  32. package/dist/types-ts4.5/i18n/ru.d.ts +36 -0
  33. package/dist/types-ts4.5/i18n/sv.d.ts +36 -0
  34. package/dist/types-ts4.5/i18n/th.d.ts +36 -0
  35. package/dist/types-ts4.5/i18n/tr.d.ts +33 -0
  36. package/dist/types-ts4.5/i18n/uk.d.ts +33 -0
  37. package/dist/types-ts4.5/i18n/vi.d.ts +36 -0
  38. package/dist/types-ts4.5/i18n/zh.d.ts +33 -0
  39. package/dist/types-ts4.5/i18n/zh_TW.d.ts +33 -0
  40. package/dist/types-ts4.5/index.d.ts +4 -0
  41. package/dist/types-ts4.5/services/use-plugins/index.d.ts +15 -0
  42. package/dist/types-ts4.5/services/use-plugins/reducer.d.ts +33 -0
  43. package/dist/types-ts4.5/services/use-plugins/utils.d.ts +18 -0
  44. package/dist/types-ts4.5/services/use-search-query/index.d.ts +3 -0
  45. package/dist/types-ts4.5/ui/error-boundary/error-boundary-base/index.d.ts +18 -0
  46. package/dist/types-ts4.5/ui/error-boundary/error-boundary-fallback/index.d.ts +3 -0
  47. package/dist/types-ts4.5/ui/error-boundary/index.d.ts +7 -0
  48. package/dist/types-ts4.5/ui/index.d.ts +6 -0
  49. package/dist/types-ts4.5/ui/link-picker/announcer.d.ts +22 -0
  50. package/dist/types-ts4.5/ui/link-picker/form-footer/index.d.ts +20 -0
  51. package/dist/types-ts4.5/ui/link-picker/form-footer/styled.d.ts +2 -0
  52. package/dist/types-ts4.5/ui/link-picker/form-footer/utils.d.ts +2 -0
  53. package/dist/types-ts4.5/ui/link-picker/index.d.ts +80 -0
  54. package/dist/types-ts4.5/ui/link-picker/link-search-error/index.d.ts +20 -0
  55. package/dist/types-ts4.5/ui/link-picker/link-search-list/index.d.ts +44 -0
  56. package/dist/types-ts4.5/ui/link-picker/link-search-list/link-search-no-results/index.d.ts +19 -0
  57. package/dist/types-ts4.5/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.d.ts +4 -0
  58. package/dist/types-ts4.5/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/styled.d.ts +1 -0
  59. package/dist/types-ts4.5/ui/link-picker/link-search-list/link-search-no-results/styled.d.ts +1 -0
  60. package/dist/types-ts4.5/ui/link-picker/link-search-list/styled.d.ts +4 -0
  61. package/dist/types-ts4.5/ui/link-picker/link-search-list/use-track-results-shown/index.d.ts +2 -0
  62. package/dist/types-ts4.5/ui/link-picker/list-item/index.d.ts +16 -0
  63. package/dist/types-ts4.5/ui/link-picker/list-item/styled.d.ts +9 -0
  64. package/dist/types-ts4.5/ui/link-picker/messages.d.ts +85 -0
  65. package/dist/types-ts4.5/ui/link-picker/styled.d.ts +12 -0
  66. package/dist/types-ts4.5/ui/link-picker/text-input/index.d.ts +18 -0
  67. package/dist/types-ts4.5/ui/link-picker/text-input/styled.d.ts +2 -0
  68. package/dist/types-ts4.5/ui/link-picker/track-mount/index.d.ts +5 -0
  69. package/dist/types-ts4.5/ui/link-picker/track-tab-viewed/index.d.ts +4 -0
  70. package/dist/types-ts4.5/ui/link-picker/transformTimeStamp.d.ts +3 -0
  71. package/dist/types-ts4.5/ui/link-picker/utils.d.ts +11 -0
  72. package/dist/types-ts4.5/ui/loader-fallback/index.d.ts +9 -0
  73. package/dist/types-ts4.5/ui/scrolling-tabs/index.d.ts +7 -0
  74. package/dist/types-ts4.5/ui/scrolling-tabs/scrolling-tabs.d.ts +11 -0
  75. package/dist/types-ts4.5/ui/scrolling-tabs/styles.d.ts +6 -0
  76. package/dist/types-ts4.5/ui/types.d.ts +65 -0
  77. package/package.json +4 -4
@@ -0,0 +1,80 @@
1
+ /// <reference types="react" />
2
+ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
+ import { LinkInputType, LinkPickerPlugin } from '../types';
4
+ export declare const RECENT_SEARCH_LIST_SIZE = 5;
5
+ export declare const testIds: {
6
+ readonly tabList: "link-picker-tabs";
7
+ readonly tabItem: "link-picker-tab";
8
+ readonly urlError: string;
9
+ readonly clearUrlButton: string;
10
+ readonly resultListTitle: string;
11
+ readonly searchResultItem: string;
12
+ readonly searchResultList: string;
13
+ readonly searchResultLoadingIndicator: string;
14
+ readonly emptyResultPage: string;
15
+ readonly searchError: string;
16
+ readonly insertButton: "link-picker-insert-button";
17
+ readonly cancelButton: "link-picker-cancel-button";
18
+ readonly actionButton: "link-picker-action-button";
19
+ readonly linkPickerRoot: "link-picker-root";
20
+ readonly linkPicker: "link-picker";
21
+ readonly urlInputField: "link-url";
22
+ readonly textInputField: "link-text";
23
+ readonly searchIcon: "link-picker-search-icon";
24
+ };
25
+ interface Meta {
26
+ /** Indicates how the link was picked. */
27
+ inputMethod: LinkInputType;
28
+ }
29
+ interface OnSubmitParameter {
30
+ /** The `url` of the linked resource. */
31
+ url: string;
32
+ /** The desired text to be displayed alternatively to the title of the linked resource. */
33
+ displayText: string | null;
34
+ /** The resolved `title` of the resource at the time of link picking (if applicable, null if not known). */
35
+ title: string | null;
36
+ /** Meta data about the link picking submission. */
37
+ meta: Meta;
38
+ /**
39
+ * The input value of the `url` field at time of submission if inserted "manually".
40
+ * This can useful if the `url` was manually inserted with a value that is different from the normalised value returned as `url`.
41
+ * @example
42
+ * { url: 'https://google.com', rawUrl: 'google.com' }
43
+ */
44
+ rawUrl?: string;
45
+ }
46
+ export interface LinkPickerProps {
47
+ /**
48
+ * Callback to fire on form submission.
49
+ */
50
+ onSubmit: (arg: OnSubmitParameter, analytic?: UIAnalyticsEvent | null) => void;
51
+ /** Callback to fire when the cancel button is clicked. */
52
+ onCancel: () => void;
53
+ /** Callback to fire when content is changed inside the link picker e.g. items, when loading, tabs */
54
+ onContentResize?: () => void;
55
+ /** The url of the linked resource for editing. */
56
+ url?: string;
57
+ /** The desired text to be displayed alternatively to the title of the linked resource for editing. */
58
+ displayText?: string | null;
59
+ /** Plugins that provide link suggestions / search capabilities. */
60
+ plugins?: LinkPickerPlugin[];
61
+ /** Customise the link picker root component */
62
+ component?: React.ComponentType<Partial<LinkPickerProps> & {
63
+ children: React.ReactElement;
64
+ }>;
65
+ /** Hides the link picker display text field if set to true. */
66
+ hideDisplayText?: boolean;
67
+ featureFlags?: Record<string, unknown>;
68
+ }
69
+ export interface PickerState {
70
+ selectedIndex: number;
71
+ activeIndex: number;
72
+ url: string;
73
+ displayText: string;
74
+ invalidUrl: boolean;
75
+ activeTab: number;
76
+ /** When true, even if the selected index is -1, don't hide the recents. */
77
+ preventHidingRecents: boolean;
78
+ }
79
+ declare const _default: import("react").ComponentType<LinkPickerProps>;
80
+ export default _default;
@@ -0,0 +1,20 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ export declare const CONTACT_SUPPORT_LINK = "https://support.atlassian.com/contact/";
4
+ export declare const messages: {
5
+ searchErrorHeader: {
6
+ id: string;
7
+ defaultMessage: string;
8
+ description: string;
9
+ };
10
+ searchErrorDescription: {
11
+ id: string;
12
+ defaultMessage: string;
13
+ description: string;
14
+ };
15
+ };
16
+ export declare const testIds: {
17
+ searchError: string;
18
+ };
19
+ declare const LinkSearchError: () => jsx.JSX.Element;
20
+ export default LinkSearchError;
@@ -0,0 +1,44 @@
1
+ /** @jsx jsx */
2
+ import { KeyboardEvent } from 'react';
3
+ import { LinkSearchListItemData } from '../../types';
4
+ export declare const messages: {
5
+ titleRecentlyViewed: {
6
+ id: string;
7
+ defaultMessage: string;
8
+ description: string;
9
+ };
10
+ titleResults: {
11
+ id: string;
12
+ defaultMessage: string;
13
+ description: string;
14
+ };
15
+ searchLinkResults: {
16
+ id: string;
17
+ defaultMessage: string;
18
+ description: string;
19
+ };
20
+ };
21
+ export declare const testIds: {
22
+ resultListTitle: string;
23
+ searchResultItem: string;
24
+ searchResultList: string;
25
+ searchResultLoadingIndicator: string;
26
+ emptyResultPage: string;
27
+ };
28
+ type LinkSearchListElement = HTMLElement;
29
+ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<LinkSearchListElement>, 'onSelect' | 'onChange'> {
30
+ items?: LinkSearchListItemData[] | null;
31
+ isLoading: boolean;
32
+ selectedIndex: number;
33
+ activeIndex: number;
34
+ onChange: (objectId: string) => void;
35
+ onSelect: (objectId: string) => void;
36
+ onKeyDown?: (e: KeyboardEvent<LinkSearchListElement>) => void;
37
+ ariaControls?: string;
38
+ ariaLabelledBy?: string;
39
+ role?: string;
40
+ id?: string;
41
+ hasSearchTerm?: boolean;
42
+ }
43
+ declare const LinkSearchList: import("react").ForwardRefExoticComponent<LinkSearchListProps & import("react").RefAttributes<HTMLDivElement>>;
44
+ export default LinkSearchList;
@@ -0,0 +1,19 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ export declare const messages: {
4
+ noResults: {
5
+ id: string;
6
+ defaultMessage: string;
7
+ description: string;
8
+ };
9
+ noResultsDescription: {
10
+ id: string;
11
+ defaultMessage: string;
12
+ description: string;
13
+ };
14
+ };
15
+ export declare const testIds: {
16
+ emptyResultPage: string;
17
+ };
18
+ declare const NoResults: () => jsx.JSX.Element;
19
+ export default NoResults;
@@ -0,0 +1,4 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ declare const NoResultsSVG: () => jsx.JSX.Element;
4
+ export default NoResultsSVG;
@@ -0,0 +1 @@
1
+ export declare const noResultsSVGStyles: import("@emotion/react").SerializedStyles;
@@ -0,0 +1 @@
1
+ export declare const emptyStateWrapperStyles: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,4 @@
1
+ export declare const listContainerStyles: import("@emotion/react").SerializedStyles;
2
+ export declare const spinnerContainerStyles: import("@emotion/react").SerializedStyles;
3
+ export declare const listStyles: import("@emotion/react").SerializedStyles;
4
+ export declare const listTitleStyles: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,2 @@
1
+ import { LinkSearchListItemData } from '../../../types';
2
+ export declare const useTrackResultsShown: (isLoading: boolean, items?: LinkSearchListItemData[] | null | undefined, hasSearchTerm?: boolean) => void;
@@ -0,0 +1,16 @@
1
+ /** @jsx jsx */
2
+ import { KeyboardEvent } from 'react';
3
+ import { LinkSearchListItemData } from '../../types';
4
+ export interface Props {
5
+ item: LinkSearchListItemData;
6
+ selected: boolean;
7
+ active: boolean;
8
+ tabIndex?: number;
9
+ onSelect: (objectId: string) => void;
10
+ onKeyDown: (e: KeyboardEvent<HTMLDivElement>) => void;
11
+ onFocus: () => void;
12
+ id?: string;
13
+ role?: string;
14
+ }
15
+ declare const LinkSearchListItem: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
16
+ export default LinkSearchListItem;
@@ -0,0 +1,9 @@
1
+ export declare const relativeFontSizeToBase16: (px: number | string) => string;
2
+ export declare const composeListItemStyles: (selected?: boolean) => import("@emotion/react").SerializedStyles;
3
+ export declare const itemNameStyles: import("@emotion/react").SerializedStyles;
4
+ export declare const listItemNameStyles: import("@emotion/react").SerializedStyles;
5
+ export declare const listItemContextStyles: import("@emotion/react").SerializedStyles;
6
+ export declare const listItemContainerStyles: import("@emotion/react").SerializedStyles;
7
+ export declare const listItemContainerInnerStyles: import("@emotion/react").SerializedStyles;
8
+ export declare const itemIconStyles: import("@emotion/react").SerializedStyles;
9
+ export declare const imgStyles: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,85 @@
1
+ export declare const searchMessages: {
2
+ linkLabel: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ linkAriaLabel: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ linkPlaceholder: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
17
+ };
18
+ export declare const linkMessages: {
19
+ linkLabel: {
20
+ id: string;
21
+ defaultMessage: string;
22
+ description: string;
23
+ };
24
+ linkAriaLabel: {
25
+ id: string;
26
+ defaultMessage: string;
27
+ description: string;
28
+ };
29
+ linkPlaceholder: {
30
+ id: string;
31
+ defaultMessage: string;
32
+ description: string;
33
+ };
34
+ };
35
+ export declare const formMessages: {
36
+ linkInvalid: {
37
+ id: string;
38
+ defaultMessage: string;
39
+ description: string;
40
+ };
41
+ clearLink: {
42
+ id: string;
43
+ defaultMessage: string;
44
+ description: string;
45
+ };
46
+ };
47
+ export declare const linkTextMessages: {
48
+ linkTextLabel: {
49
+ id: string;
50
+ defaultMessage: string;
51
+ description: string;
52
+ };
53
+ linkTextAriaLabel: {
54
+ id: string;
55
+ defaultMessage: string;
56
+ description: string;
57
+ };
58
+ linkTextPlaceholder: {
59
+ id: string;
60
+ defaultMessage: string;
61
+ description: string;
62
+ };
63
+ clearLinkText: {
64
+ id: string;
65
+ defaultMessage: string;
66
+ description: string;
67
+ };
68
+ };
69
+ export declare const messages: {
70
+ timeUpdated: {
71
+ id: string;
72
+ defaultMessage: string;
73
+ description: string;
74
+ };
75
+ timeViewed: {
76
+ id: string;
77
+ defaultMessage: string;
78
+ description: string;
79
+ };
80
+ timeAgo: {
81
+ id: string;
82
+ defaultMessage: string;
83
+ description: string;
84
+ };
85
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Half padding on the top as the form field has a `gridSize()` margin top that cannot be overridden
3
+ */
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
+ export declare const tabsWrapperStyles: import("@emotion/react").SerializedStyles;
11
+ export declare const flexColumnStyles: import("@emotion/react").SerializedStyles;
12
+ export declare const formFooterMargin: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,18 @@
1
+ import { jsx } from '@emotion/react';
2
+ import { TextFieldProps } from '@atlaskit/textfield';
3
+ export type TextInputProps = Omit<TextFieldProps, 'name' | 'value'> & {
4
+ name: string;
5
+ value: string;
6
+ label?: string;
7
+ onUndo?: Function;
8
+ onRedo?: Function;
9
+ onClear?: (name: string) => void;
10
+ clearLabel?: string;
11
+ error?: string | null;
12
+ };
13
+ export declare const testIds: {
14
+ urlError: string;
15
+ clearUrlButton: string;
16
+ };
17
+ declare const TextInput: ({ name, label, autoFocus, onRedo, onUndo, onKeyDown, onClear, clearLabel, error, ...restProps }: TextInputProps) => jsx.JSX.Element;
18
+ export default TextInput;
@@ -0,0 +1,2 @@
1
+ export declare const clearTextButtonStyles: import("@emotion/react").SerializedStyles;
2
+ export declare const fieldStyles: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * UFO + Analytics tracking for component mount (and unmount)
3
+ */
4
+ declare function TrackMount(): null;
5
+ export default TrackMount;
@@ -0,0 +1,4 @@
1
+ declare function TrackTabViewed({ activeTab }: {
2
+ activeTab: number | null;
3
+ }): null;
4
+ export default TrackTabViewed;
@@ -0,0 +1,3 @@
1
+ import { IntlShape } from 'react-intl-next';
2
+ import { ListItemTimeStamp } from '../types';
3
+ export declare const transformTimeStamp: (intl: IntlShape, lastViewedDate?: Date, lastUpdatedDate?: Date) => ListItemTimeStamp | undefined;
@@ -0,0 +1,11 @@
1
+ import { KeyboardEvent } from 'react';
2
+ import { IntlShape } from 'react-intl-next';
3
+ import { LinkPickerPlugin, LinkSearchListItemData } from '../types';
4
+ export declare const isUndoEvent: (e: KeyboardEvent<HTMLInputElement>) => boolean;
5
+ export declare const isRedoEvent: (e: KeyboardEvent<HTMLInputElement>) => boolean;
6
+ /**
7
+ * Retrieve the data source for a link given the item and the plugin that resolved it
8
+ */
9
+ export declare const getDataSource: (item: LinkSearchListItemData, plugin?: LinkPickerPlugin) => string;
10
+ 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,9 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ /**
4
+ * Loader / skeleton for the Link Picker. Takes displayText prop - when no displayText is given the height of the skeleton
5
+ * is shorter to prevent jump when loading in Link Picker.
6
+ */
7
+ export declare const LoaderFallback: ({ hideDisplayText, }: {
8
+ hideDisplayText?: boolean | undefined;
9
+ }) => jsx.JSX.Element;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { jsx } from '@emotion/react';
3
+ interface ScrollingTabListProps {
4
+ children: JSX.Element;
5
+ }
6
+ export declare const ScrollingTabList: (props: ScrollingTabListProps) => jsx.JSX.Element;
7
+ export default ScrollingTabList;
@@ -0,0 +1,11 @@
1
+ import { RefObject } from 'react';
2
+ export interface ConditionalButtons {
3
+ back: boolean;
4
+ forward: boolean;
5
+ }
6
+ export declare const scrollBack: (ref: RefObject<HTMLDivElement>) => void;
7
+ export declare const scrollForward: (ref: RefObject<HTMLDivElement>) => void;
8
+ export declare const calculateConditionalButtons: (container: HTMLElement | null | undefined, hideButtons: boolean) => ConditionalButtons;
9
+ export declare const createGhost: () => HTMLDivElement;
10
+ export declare const getTabList: (ref: RefObject<HTMLDivElement>) => Element | null | undefined;
11
+ export declare const getContainer: (ref: RefObject<HTMLDivElement>) => HTMLElement | null | undefined;
@@ -0,0 +1,6 @@
1
+ import { SerializedStyles } from '@emotion/react';
2
+ export declare const scrollingContainerStyles: SerializedStyles;
3
+ export declare const containerStyles: SerializedStyles;
4
+ export declare const buttonContainerStyles: SerializedStyles;
5
+ export declare const backButtonStyles: SerializedStyles;
6
+ export declare const nextButtonStyles: SerializedStyles;
@@ -0,0 +1,65 @@
1
+ import { ReactNode } from 'react';
2
+ import { MessageDescriptor } from 'react-intl-next';
3
+ export type LinkInputType = 'manual' | 'typeAhead';
4
+ export interface LinkSearchListItemData {
5
+ /** Unique identifiable attribute for the item */
6
+ objectId: string;
7
+ /** Name / title / display text of the link */
8
+ name: string;
9
+ /** URL of the resource being linked to */
10
+ url: string;
11
+ /** Icon to display in link result */
12
+ icon: string | React.ComponentType<{
13
+ alt: string;
14
+ }>;
15
+ /** Alt text describing the icon */
16
+ iconAlt: string | MessageDescriptor;
17
+ /** Context to display in link result */
18
+ container?: string;
19
+ /** Optional last view date to display in link result */
20
+ lastViewedDate?: Date;
21
+ /** Optional last updated date to display in link result */
22
+ lastUpdatedDate?: Date;
23
+ /** Whether the result is pre-fetched from activity provider */
24
+ prefetch?: boolean;
25
+ /** Metadata about the result */
26
+ meta?: {
27
+ /** The data source that provided the result */
28
+ source?: string;
29
+ };
30
+ }
31
+ export type ListItemTimeStamp = {
32
+ pageAction: string;
33
+ dateString: string;
34
+ timeSince?: string | undefined;
35
+ };
36
+ export interface LinkPickerState {
37
+ /** Current query string / URL input field value */
38
+ query: string;
39
+ }
40
+ export interface ResolveResult {
41
+ data: LinkSearchListItemData[];
42
+ }
43
+ export interface LinkPickerPlugin {
44
+ resolve: (state: LinkPickerState) => Promise<ResolveResult> | AsyncGenerator<ResolveResult, ResolveResult>;
45
+ /** Uniquely identify the tab */
46
+ tabKey?: string;
47
+ /** Human-readable label for the plugin */
48
+ tabTitle?: string;
49
+ /** Render function to customise the UI that is displayed when an error occurs resolving results */
50
+ errorFallback?: LinkPickerPluginErrorFallback;
51
+ /** Metadata about the plugin */
52
+ meta?: {
53
+ /** The data source that provides all results provided by the plugin */
54
+ source?: string;
55
+ };
56
+ /** Callback for plugin activation */
57
+ UNSAFE_onActivation?: () => void;
58
+ /** Register Plugin Actions */
59
+ action?: LinkPickerPluginAction;
60
+ }
61
+ export interface LinkPickerPluginAction {
62
+ label: MessageDescriptor | string;
63
+ callback: () => void;
64
+ }
65
+ export type LinkPickerPluginErrorFallback = (error: unknown, retry: () => void) => ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.20.1",
3
+ "version": "1.20.2",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/form": "^8.11.0",
45
45
  "@atlaskit/frontend-utilities": "^2.6.0",
46
46
  "@atlaskit/icon": "^21.12.0",
47
- "@atlaskit/linking-common": "^2.9.0",
47
+ "@atlaskit/linking-common": "^2.10.0",
48
48
  "@atlaskit/spinner": "^15.5.0",
49
49
  "@atlaskit/tabs": "^13.4.0",
50
50
  "@atlaskit/textfield": "^5.4.0",
@@ -79,8 +79,8 @@
79
79
  "@atlaskit/webdriver-runner": "*",
80
80
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
81
81
  "@atlassian/codegen": "^0.1.0",
82
- "@atlassian/link-picker-atlassian-plugin": "^30.0.0",
83
- "@atlassian/link-picker-plugins": "^20.0.0",
82
+ "@atlassian/link-picker-atlassian-plugin": "^30.1.0",
83
+ "@atlassian/link-picker-plugins": "^20.1.0",
84
84
  "@atlassian/recent-work-client": "^1.8.0",
85
85
  "@atlassian/search-provider": "^2.4.0",
86
86
  "@testing-library/dom": "^8.17.1",