@atlaskit/link-picker 1.30.14 → 1.32.0

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 (33) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/ui/index.js +1 -1
  3. package/dist/cjs/ui/link-picker/form-footer/index.js +35 -10
  4. package/dist/cjs/ui/link-picker/form-footer/utils.js +4 -1
  5. package/dist/cjs/ui/link-picker/index.js +40 -11
  6. package/dist/cjs/ui/link-picker/search-results/index.js +2 -0
  7. package/dist/cjs/ui/link-picker/search-results/link-search-list/index.js +3 -1
  8. package/dist/cjs/ui/messages-provider/lazy-messages-provider/utils/fetch-messages-for-locale.js +5 -15
  9. package/dist/es2019/ui/index.js +1 -1
  10. package/dist/es2019/ui/link-picker/form-footer/index.js +31 -9
  11. package/dist/es2019/ui/link-picker/form-footer/utils.js +4 -1
  12. package/dist/es2019/ui/link-picker/index.js +39 -11
  13. package/dist/es2019/ui/link-picker/search-results/index.js +2 -0
  14. package/dist/es2019/ui/link-picker/search-results/link-search-list/index.js +2 -0
  15. package/dist/es2019/ui/messages-provider/lazy-messages-provider/utils/fetch-messages-for-locale.js +0 -10
  16. package/dist/esm/ui/index.js +1 -1
  17. package/dist/esm/ui/link-picker/form-footer/index.js +35 -10
  18. package/dist/esm/ui/link-picker/form-footer/utils.js +4 -1
  19. package/dist/esm/ui/link-picker/index.js +40 -11
  20. package/dist/esm/ui/link-picker/search-results/index.js +2 -0
  21. package/dist/esm/ui/link-picker/search-results/link-search-list/index.js +3 -1
  22. package/dist/esm/ui/messages-provider/lazy-messages-provider/utils/fetch-messages-for-locale.js +5 -15
  23. package/dist/types/ui/link-picker/form-footer/index.d.ts +28 -1
  24. package/dist/types/ui/link-picker/form-footer/utils.d.ts +1 -1
  25. package/dist/types/ui/link-picker/index.d.ts +20 -0
  26. package/dist/types/ui/link-picker/search-results/index.d.ts +2 -1
  27. package/dist/types/ui/link-picker/search-results/link-search-list/index.d.ts +1 -0
  28. package/dist/types-ts4.5/ui/link-picker/form-footer/index.d.ts +28 -1
  29. package/dist/types-ts4.5/ui/link-picker/form-footer/utils.d.ts +1 -1
  30. package/dist/types-ts4.5/ui/link-picker/index.d.ts +20 -0
  31. package/dist/types-ts4.5/ui/link-picker/search-results/index.d.ts +2 -1
  32. package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/index.d.ts +1 -0
  33. package/package.json +6 -9
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { MessageDescriptor } from 'react-intl-next';
2
3
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
4
  import { LinkInputType, LinkPickerPlugin } from '../../common/types';
4
5
  export declare const testIds: {
@@ -7,6 +8,7 @@ export declare const testIds: {
7
8
  readonly insertButton: "link-picker-insert-button";
8
9
  readonly cancelButton: "link-picker-cancel-button";
9
10
  readonly actionButton: "link-picker-action-button";
11
+ readonly submitStatusA11yIndicator: "link-picker-submit-status-a11y-indicator";
10
12
  readonly actionButtonDiscovery: "link-picker-action-button-discovery";
11
13
  readonly tabsLoadingIndicator: string;
12
14
  readonly tabList: string;
@@ -77,7 +79,25 @@ export interface LinkPickerProps {
77
79
  component?: React.ComponentType<Partial<LinkPickerProps> & {
78
80
  children: React.ReactElement;
79
81
  }>;
82
+ /** Allows for customisation of text in the link picker. */
83
+ customMessages?: CustomLinkPickerMessages;
80
84
  featureFlags?: Record<string, unknown>;
85
+ /** Controls showing a "submission in-progres" UX */
86
+ isSubmitting?: boolean;
81
87
  }
88
+ type CustomLinkPickerMessages = {
89
+ /** Label for the link input field */
90
+ linkLabel?: MessageDescriptor;
91
+ /** Aria label for the link input field */
92
+ linkAriaLabel?: MessageDescriptor;
93
+ /** Placeholder for the link input field */
94
+ linkPlaceholder?: MessageDescriptor;
95
+ /** Label for the link display text field */
96
+ linkTextLabel?: MessageDescriptor;
97
+ /** Placeholder for the link display text field */
98
+ linkTextPlaceholder?: MessageDescriptor;
99
+ /** Label for the submit button */
100
+ submitButtonLabel?: MessageDescriptor;
101
+ };
82
102
  export declare const LinkPicker: import("react").ComponentType<LinkPickerProps>;
83
103
  export {};
@@ -21,6 +21,7 @@ export type SearchResultsProps = {
21
21
  }[];
22
22
  isLoadingPlugins?: boolean;
23
23
  isLoadingResults: boolean;
24
+ isSubmitting?: boolean;
24
25
  activeTab: number;
25
26
  handleTabChange: (activeTab: number) => void;
26
27
  handleSearchListOnChange: (id: string) => void;
@@ -37,4 +38,4 @@ export type SearchResultsProps = {
37
38
  error?: unknown;
38
39
  retry: () => void;
39
40
  };
40
- export declare const SearchResults: ({ tabs, activeTab, activePlugin, isLoadingPlugins, isLoadingResults, handleTabChange, handleSearchListOnChange, featureFlags, linkSearchListId, error, queryState, items, activeIndex, selectedIndex, handleSelected, handleKeyDown, retry, }: SearchResultsProps) => jsx.JSX.Element;
41
+ export declare const SearchResults: ({ tabs, activeTab, activePlugin, isLoadingPlugins, isLoadingResults, isSubmitting, handleTabChange, handleSearchListOnChange, featureFlags, linkSearchListId, error, queryState, items, activeIndex, selectedIndex, handleSelected, handleKeyDown, retry, }: SearchResultsProps) => jsx.JSX.Element;
@@ -38,6 +38,7 @@ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<LinkSearc
38
38
  onKeyDown?: (e: KeyboardEvent<LinkSearchListElement>) => void;
39
39
  ariaControls?: string;
40
40
  ariaLabelledBy?: string;
41
+ ariaReadOnly?: boolean;
41
42
  role?: string;
42
43
  id?: string;
43
44
  hasSearchTerm?: boolean;
@@ -1,16 +1,42 @@
1
1
  /// <reference types="react" />
2
2
  import { jsx } from '@emotion/react';
3
+ import { MessageDescriptor } from 'react-intl-next';
3
4
  import { LinkPickerPluginAction, LinkPickerState, LinkSearchListItemData } from '../../../common/types';
5
+ export declare const messages: {
6
+ cancelButton: {
7
+ id: string;
8
+ defaultMessage: string;
9
+ description: string;
10
+ };
11
+ saveButton: {
12
+ id: string;
13
+ defaultMessage: string;
14
+ description: string;
15
+ };
16
+ insertButton: {
17
+ id: string;
18
+ defaultMessage: string;
19
+ description: string;
20
+ };
21
+ submittingStatusMessage: {
22
+ id: string;
23
+ defaultMessage: string;
24
+ description: string;
25
+ };
26
+ };
4
27
  export declare const testIds: {
5
28
  readonly insertButton: "link-picker-insert-button";
6
29
  readonly cancelButton: "link-picker-cancel-button";
7
30
  readonly actionButton: "link-picker-action-button";
31
+ readonly submitStatusA11yIndicator: "link-picker-submit-status-a11y-indicator";
8
32
  /** Feature discovery for action button (css pulse) */
9
33
  readonly actionButtonDiscovery: "link-picker-action-button-discovery";
10
34
  };
11
35
  interface FormFooterProps extends React.HTMLAttributes<HTMLElement> {
12
36
  /** If the results section appears to be loading, impact whether the submit button is disabled */
13
37
  isLoading: boolean;
38
+ /** Controls showing a "submission in-progres" UX */
39
+ isSubmitting?: boolean;
14
40
  error: unknown | null;
15
41
  url: string;
16
42
  queryState: LinkPickerState | null;
@@ -19,6 +45,7 @@ interface FormFooterProps extends React.HTMLAttributes<HTMLElement> {
19
45
  onCancel?: () => void;
20
46
  action?: LinkPickerPluginAction;
21
47
  createFeatureDiscovery?: boolean;
48
+ customSubmitButtonLabel?: MessageDescriptor;
22
49
  }
23
- export declare const FormFooter: import("react").MemoExoticComponent<({ isLoading, error, url, queryState, items, isEditing, onCancel, action, createFeatureDiscovery, ...restProps }: FormFooterProps) => jsx.JSX.Element | null>;
50
+ export declare const FormFooter: import("react").MemoExoticComponent<({ isLoading, isSubmitting, error, url, queryState, items, isEditing, onCancel, action, createFeatureDiscovery, customSubmitButtonLabel, ...restProps }: FormFooterProps) => jsx.JSX.Element | null>;
24
51
  export {};
@@ -1,2 +1,2 @@
1
1
  import { LinkPickerState, LinkSearchListItemData } from '../../../common/types';
2
- export declare const checkSubmitDisabled: (isLoading: boolean, error: unknown | null, url: string, queryState: LinkPickerState | null, items: LinkSearchListItemData[] | null) => boolean;
2
+ export declare const checkSubmitDisabled: (isLoading: boolean, isSubmitting: boolean, error: unknown | null, url: string, queryState: LinkPickerState | null, items: LinkSearchListItemData[] | null) => boolean;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { MessageDescriptor } from 'react-intl-next';
2
3
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
4
  import { LinkInputType, LinkPickerPlugin } from '../../common/types';
4
5
  export declare const testIds: {
@@ -7,6 +8,7 @@ export declare const testIds: {
7
8
  readonly insertButton: "link-picker-insert-button";
8
9
  readonly cancelButton: "link-picker-cancel-button";
9
10
  readonly actionButton: "link-picker-action-button";
11
+ readonly submitStatusA11yIndicator: "link-picker-submit-status-a11y-indicator";
10
12
  readonly actionButtonDiscovery: "link-picker-action-button-discovery";
11
13
  readonly tabsLoadingIndicator: string;
12
14
  readonly tabList: string;
@@ -77,7 +79,25 @@ export interface LinkPickerProps {
77
79
  component?: React.ComponentType<Partial<LinkPickerProps> & {
78
80
  children: React.ReactElement;
79
81
  }>;
82
+ /** Allows for customisation of text in the link picker. */
83
+ customMessages?: CustomLinkPickerMessages;
80
84
  featureFlags?: Record<string, unknown>;
85
+ /** Controls showing a "submission in-progres" UX */
86
+ isSubmitting?: boolean;
81
87
  }
88
+ type CustomLinkPickerMessages = {
89
+ /** Label for the link input field */
90
+ linkLabel?: MessageDescriptor;
91
+ /** Aria label for the link input field */
92
+ linkAriaLabel?: MessageDescriptor;
93
+ /** Placeholder for the link input field */
94
+ linkPlaceholder?: MessageDescriptor;
95
+ /** Label for the link display text field */
96
+ linkTextLabel?: MessageDescriptor;
97
+ /** Placeholder for the link display text field */
98
+ linkTextPlaceholder?: MessageDescriptor;
99
+ /** Label for the submit button */
100
+ submitButtonLabel?: MessageDescriptor;
101
+ };
82
102
  export declare const LinkPicker: import("react").ComponentType<LinkPickerProps>;
83
103
  export {};
@@ -21,6 +21,7 @@ export type SearchResultsProps = {
21
21
  }[];
22
22
  isLoadingPlugins?: boolean;
23
23
  isLoadingResults: boolean;
24
+ isSubmitting?: boolean;
24
25
  activeTab: number;
25
26
  handleTabChange: (activeTab: number) => void;
26
27
  handleSearchListOnChange: (id: string) => void;
@@ -37,4 +38,4 @@ export type SearchResultsProps = {
37
38
  error?: unknown;
38
39
  retry: () => void;
39
40
  };
40
- export declare const SearchResults: ({ tabs, activeTab, activePlugin, isLoadingPlugins, isLoadingResults, handleTabChange, handleSearchListOnChange, featureFlags, linkSearchListId, error, queryState, items, activeIndex, selectedIndex, handleSelected, handleKeyDown, retry, }: SearchResultsProps) => jsx.JSX.Element;
41
+ export declare const SearchResults: ({ tabs, activeTab, activePlugin, isLoadingPlugins, isLoadingResults, isSubmitting, handleTabChange, handleSearchListOnChange, featureFlags, linkSearchListId, error, queryState, items, activeIndex, selectedIndex, handleSelected, handleKeyDown, retry, }: SearchResultsProps) => jsx.JSX.Element;
@@ -38,6 +38,7 @@ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<LinkSearc
38
38
  onKeyDown?: (e: KeyboardEvent<LinkSearchListElement>) => void;
39
39
  ariaControls?: string;
40
40
  ariaLabelledBy?: string;
41
+ ariaReadOnly?: boolean;
41
42
  role?: string;
42
43
  id?: string;
43
44
  hasSearchTerm?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.30.14",
3
+ "version": "1.32.0",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -49,9 +49,6 @@
49
49
  },
50
50
  "platform.linking-platform.link-picker.enable-jira-create": {
51
51
  "type": "boolean"
52
- },
53
- "platform.linking-platform.link-create.tmp-fix-translations": {
54
- "type": "boolean"
55
52
  }
56
53
  },
57
54
  "scripts": {
@@ -60,20 +57,20 @@
60
57
  },
61
58
  "dependencies": {
62
59
  "@atlaskit/analytics-next": "^9.1.0",
63
- "@atlaskit/button": "^17.1.0",
60
+ "@atlaskit/button": "^17.2.0",
64
61
  "@atlaskit/empty-state": "^7.6.0",
65
62
  "@atlaskit/form": "^9.0.3",
66
63
  "@atlaskit/frontend-utilities": "^2.7.0",
67
64
  "@atlaskit/icon": "^22.0.0",
68
65
  "@atlaskit/intl-messages-provider": "^1.0.2",
69
- "@atlaskit/linking-common": "^5.1.0",
70
- "@atlaskit/onboarding": "^11.1.2",
66
+ "@atlaskit/linking-common": "^5.3.0",
67
+ "@atlaskit/onboarding": "^11.2.0",
71
68
  "@atlaskit/platform-feature-flags": "^0.2.1",
72
69
  "@atlaskit/spinner": "^16.0.0",
73
70
  "@atlaskit/tabs": "^14.0.0",
74
71
  "@atlaskit/textfield": "^6.0.0",
75
72
  "@atlaskit/theme": "^12.6.0",
76
- "@atlaskit/tokens": "^1.32.0",
73
+ "@atlaskit/tokens": "^1.33.0",
77
74
  "@atlaskit/tooltip": "^18.1.0",
78
75
  "@atlaskit/ufo": "^0.2.0",
79
76
  "@atlaskit/visually-hidden": "^1.2.0",
@@ -96,7 +93,7 @@
96
93
  "@atlaskit/dropdown-menu": "^12.1.0",
97
94
  "@atlaskit/link-provider": "^1.6.0",
98
95
  "@atlaskit/link-test-helpers": "^6.2.0",
99
- "@atlaskit/primitives": "^1.15.0",
96
+ "@atlaskit/primitives": "^1.16.0",
100
97
  "@atlaskit/visual-regression": "*",
101
98
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
102
99
  "@atlassian/feature-flags-test-utils": "*",