@atlaskit/link-picker 1.42.5 → 1.44.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.
- package/CHANGELOG.md +24 -0
- package/dist/cjs/ui/link-picker/form-footer/index.js +15 -26
- package/dist/cjs/ui/link-picker/form-footer/link-picker-submit-button/index.js +52 -0
- package/dist/cjs/ui/link-picker/index.js +32 -3
- package/dist/cjs/ui/link-picker/search-results/link-search-list/index.js +16 -14
- package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/index.js +54 -30
- package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/styled.js +3 -11
- package/dist/cjs/ui/main.js +1 -1
- package/dist/es2019/ui/link-picker/form-footer/index.js +15 -24
- package/dist/es2019/ui/link-picker/form-footer/link-picker-submit-button/index.js +45 -0
- package/dist/es2019/ui/link-picker/index.js +30 -4
- package/dist/es2019/ui/link-picker/search-results/link-search-list/index.js +17 -15
- package/dist/es2019/ui/link-picker/search-results/link-search-list/list-item/index.js +43 -23
- package/dist/es2019/ui/link-picker/search-results/link-search-list/list-item/styled.js +3 -11
- package/dist/es2019/ui/main.js +1 -1
- package/dist/esm/ui/link-picker/form-footer/index.js +16 -27
- package/dist/esm/ui/link-picker/form-footer/link-picker-submit-button/index.js +44 -0
- package/dist/esm/ui/link-picker/index.js +33 -4
- package/dist/esm/ui/link-picker/search-results/link-search-list/index.js +17 -15
- package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/index.js +54 -31
- package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/styled.js +3 -11
- package/dist/esm/ui/main.js +1 -1
- package/dist/types/common/types.d.ts +17 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/ui/link-picker/form-footer/index.d.ts +3 -11
- package/dist/types/ui/link-picker/form-footer/link-picker-submit-button/index.d.ts +33 -0
- package/dist/{types-ts4.5/ui/link-picker/form-footer → types/ui/link-picker/form-footer/link-picker-submit-button}/utils.d.ts +1 -1
- package/dist/types/ui/link-picker/search-results/link-search-list/list-item/index.d.ts +1 -0
- package/dist/types/ui/link-picker/search-results/link-search-list/list-item/styled.d.ts +0 -1
- package/dist/types-ts4.5/common/types.d.ts +20 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/link-picker/form-footer/index.d.ts +3 -11
- package/dist/types-ts4.5/ui/link-picker/form-footer/link-picker-submit-button/index.d.ts +33 -0
- package/dist/{types/ui/link-picker/form-footer → types-ts4.5/ui/link-picker/form-footer/link-picker-submit-button}/utils.d.ts +1 -1
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/list-item/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/list-item/styled.d.ts +0 -1
- package/package.json +2 -2
- /package/dist/cjs/ui/link-picker/form-footer/{utils.js → link-picker-submit-button/utils.js} +0 -0
- /package/dist/es2019/ui/link-picker/form-footer/{utils.js → link-picker-submit-button/utils.js} +0 -0
- /package/dist/esm/ui/link-picker/form-footer/{utils.js → link-picker-submit-button/utils.js} +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
2
|
/**
|
|
2
3
|
* @jsxRuntime classic
|
|
3
4
|
* @jsx jsx
|
|
@@ -7,9 +8,10 @@ import { forwardRef, Fragment } from 'react';
|
|
|
7
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
9
|
import { jsx } from '@emotion/react';
|
|
9
10
|
import { useIntl } from 'react-intl-next';
|
|
11
|
+
import { Text } from '@atlaskit/primitives';
|
|
10
12
|
/* eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports */
|
|
11
13
|
import { transformTimeStamp } from '../../../transformTimeStamp';
|
|
12
|
-
import { composeListItemStyles, imgStyles, itemIconStyles, itemNameStyles, listItemContainerInnerStyles, listItemContainerStyles, listItemContextStyles
|
|
14
|
+
import { composeListItemStyles, imgStyles, itemIconStyles, itemNameStyles, listItemContainerInnerStyles, listItemContainerStyles, listItemContextStyles } from './styled';
|
|
13
15
|
export var testIds = {
|
|
14
16
|
searchResultItem: 'link-search-list-item',
|
|
15
17
|
searchResultIcon: 'link-search-list-item-icon'
|
|
@@ -55,21 +57,54 @@ var ListItemIcon = function ListItemIcon(props) {
|
|
|
55
57
|
}))
|
|
56
58
|
);
|
|
57
59
|
};
|
|
58
|
-
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
var ListItemSubtitle = function ListItemSubtitle(_ref) {
|
|
61
|
+
var _ref$items = _slicedToArray(_ref.items, 2),
|
|
62
|
+
firstItem = _ref$items[0],
|
|
63
|
+
secondItem = _ref$items[1];
|
|
64
|
+
return /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766 */(
|
|
65
|
+
jsx("div", {
|
|
66
|
+
"data-testid": "".concat(testIds.searchResultItem, "-subtitle"),
|
|
67
|
+
css: listItemContextStyles
|
|
68
|
+
}, jsx("div", {
|
|
69
|
+
css: listItemContainerStyles
|
|
70
|
+
}, jsx("span", {
|
|
71
|
+
css: listItemContainerInnerStyles
|
|
72
|
+
}, firstItem)), secondItem && jsx("div", {
|
|
73
|
+
css: listItemContainerInnerStyles
|
|
74
|
+
}, jsx(Fragment, null, "\xA0 \u2022\xA0 "), jsx(Fragment, null, secondItem)))
|
|
75
|
+
);
|
|
76
|
+
/* eslint-enable @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766 */
|
|
77
|
+
};
|
|
78
|
+
var getDefaultSubtitleItems = function getDefaultSubtitleItems(item, intl) {
|
|
79
|
+
var container = item.container;
|
|
80
|
+
var date = transformTimeStamp(intl, item.lastViewedDate, item.lastUpdatedDate);
|
|
81
|
+
if (container) {
|
|
82
|
+
if (date) {
|
|
83
|
+
return [container, date];
|
|
84
|
+
}
|
|
85
|
+
return [container];
|
|
86
|
+
}
|
|
87
|
+
if (date) {
|
|
88
|
+
return [date];
|
|
89
|
+
}
|
|
90
|
+
return undefined;
|
|
91
|
+
};
|
|
92
|
+
export var LinkSearchListItem = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
93
|
+
var item = _ref2.item,
|
|
94
|
+
selected = _ref2.selected,
|
|
95
|
+
id = _ref2.id,
|
|
96
|
+
role = _ref2.role,
|
|
97
|
+
onSelect = _ref2.onSelect,
|
|
98
|
+
tabIndex = _ref2.tabIndex,
|
|
99
|
+
onKeyDown = _ref2.onKeyDown,
|
|
100
|
+
onFocus = _ref2.onFocus,
|
|
101
|
+
_ref2$nameMaxLines = _ref2.nameMaxLines,
|
|
102
|
+
nameMaxLines = _ref2$nameMaxLines === void 0 ? 1 : _ref2$nameMaxLines;
|
|
67
103
|
var intl = useIntl();
|
|
68
104
|
var handleSelect = function handleSelect() {
|
|
69
105
|
return onSelect(item.objectId);
|
|
70
106
|
};
|
|
71
|
-
var
|
|
72
|
-
var date = transformTimeStamp(intl, item.lastViewedDate, item.lastUpdatedDate);
|
|
107
|
+
var subtitleItems = item.subtitleItems || getDefaultSubtitleItems(item, intl);
|
|
73
108
|
return jsx("div", {
|
|
74
109
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
75
110
|
css: composeListItemStyles(selected),
|
|
@@ -87,24 +122,12 @@ export var LinkSearchListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
87
122
|
intl: intl
|
|
88
123
|
}), jsx("div", {
|
|
89
124
|
css: itemNameStyles
|
|
90
|
-
}, jsx(
|
|
91
|
-
|
|
92
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
93
|
-
,
|
|
94
|
-
css: listItemNameStyles,
|
|
95
|
-
title: item.name
|
|
96
|
-
}, item.name), jsx("div", {
|
|
97
|
-
"data-testid": "".concat(testIds.searchResultItem, "-subtitle"),
|
|
98
|
-
css: listItemContextStyles
|
|
99
|
-
}, container &&
|
|
100
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
101
|
-
jsx("div", {
|
|
102
|
-
css: listItemContainerStyles
|
|
125
|
+
}, jsx(Text, {
|
|
126
|
+
maxLines: nameMaxLines
|
|
103
127
|
}, jsx("span", {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}, container && jsx(Fragment, null, "\xA0 \u2022\xA0 "), jsx(Fragment, null, date)))));
|
|
128
|
+
"data-testid": "".concat(testIds.searchResultItem, "-title"),
|
|
129
|
+
title: item.name
|
|
130
|
+
}, item.name)), subtitleItems && jsx(ListItemSubtitle, {
|
|
131
|
+
items: subtitleItems
|
|
132
|
+
})));
|
|
110
133
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
|
-
import { B100, B400, B50, N20, N200, N300
|
|
3
|
+
import { B100, B400, B50, N20, N200, N300 } from '@atlaskit/theme/colors';
|
|
4
4
|
import { fontSize, fontSizeSmall } from '@atlaskit/theme/constants';
|
|
5
5
|
// AFP-2532 TODO: Fix automatic suppressions below
|
|
6
6
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
@@ -61,16 +61,8 @@ export var composeListItemStyles = function composeListItemStyles() {
|
|
|
61
61
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
62
62
|
export var itemNameStyles = css({
|
|
63
63
|
overflow: 'hidden',
|
|
64
|
-
alignContent: 'center'
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
68
|
-
export var listItemNameStyles = css({
|
|
69
|
-
color: "var(--ds-text, ".concat(N800, ")"),
|
|
70
|
-
overflow: 'hidden',
|
|
71
|
-
textOverflow: 'ellipsis',
|
|
72
|
-
whiteSpace: 'nowrap',
|
|
73
|
-
lineHeight: '20px'
|
|
64
|
+
alignContent: 'center',
|
|
65
|
+
width: '100%'
|
|
74
66
|
});
|
|
75
67
|
|
|
76
68
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
package/dist/esm/ui/main.js
CHANGED
|
@@ -28,6 +28,11 @@ export interface LinkSearchListItemData {
|
|
|
28
28
|
/** The data source that provided the result */
|
|
29
29
|
source?: string;
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Optionally override the strings shown in the link result's subtitle
|
|
33
|
+
* (by default, the subtitle is the container and date). Provide translated strings.
|
|
34
|
+
*/
|
|
35
|
+
subtitleItems?: Readonly<[string, string?]>;
|
|
31
36
|
}
|
|
32
37
|
export interface LinkPickerState {
|
|
33
38
|
/** Current query string / URL input field value */
|
|
@@ -36,6 +41,10 @@ export interface LinkPickerState {
|
|
|
36
41
|
export interface ResolveResult {
|
|
37
42
|
data: LinkSearchListItemData[];
|
|
38
43
|
}
|
|
44
|
+
export interface LinkPickerUiOptions {
|
|
45
|
+
/** Maximum number of lines to display for the item name */
|
|
46
|
+
listItemNameMaxLines?: number;
|
|
47
|
+
}
|
|
39
48
|
export interface LinkPickerPlugin {
|
|
40
49
|
resolve: (state: LinkPickerState) => Promise<ResolveResult> | AsyncGenerator<ResolveResult, ResolveResult>;
|
|
41
50
|
/** Uniquely identify the tab */
|
|
@@ -55,6 +64,8 @@ export interface LinkPickerPlugin {
|
|
|
55
64
|
UNSAFE_onActivation?: () => void;
|
|
56
65
|
/** Register Plugin Actions */
|
|
57
66
|
action?: LinkPickerPluginAction;
|
|
67
|
+
/** Options to override certain configurable styles in the link picker */
|
|
68
|
+
uiOptions?: LinkPickerUiOptions;
|
|
58
69
|
}
|
|
59
70
|
export interface LinkPickerPluginAction {
|
|
60
71
|
label: MessageDescriptor | string;
|
|
@@ -137,6 +148,12 @@ export interface LinkPickerProps {
|
|
|
137
148
|
featureFlags?: Record<string, unknown>;
|
|
138
149
|
/** Controls showing a "submission in-progres" UX */
|
|
139
150
|
isSubmitting?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Do not utilize this! This is a temporary prop that is being used for a specific experiment.
|
|
153
|
+
* This prop controls where the submit button appears. When true the submit button will move below the input field and be full width
|
|
154
|
+
* @internal
|
|
155
|
+
* */
|
|
156
|
+
UNSAFE_moveSubmitButton?: boolean;
|
|
140
157
|
}
|
|
141
158
|
type CustomLinkPickerMessages = {
|
|
142
159
|
/** Label for the link input field */
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default } from './ui';
|
|
2
2
|
export { DeprecatedLazyLinkPickerExport as LinkPicker } from './ui';
|
|
3
3
|
export type { LinkPickerProps } from './common/types';
|
|
4
|
-
export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, } from './common/types';
|
|
4
|
+
export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, LinkPickerUiOptions, } from './common/types';
|
|
5
5
|
export { UnauthenticatedError } from './common/utils/errors';
|
|
6
6
|
export { LoaderFallback } from './ui/loader-fallback';
|
|
@@ -8,16 +8,6 @@ export declare const messages: {
|
|
|
8
8
|
defaultMessage: string;
|
|
9
9
|
description: string;
|
|
10
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
11
|
submittingStatusMessage: {
|
|
22
12
|
id: string;
|
|
23
13
|
defaultMessage: string;
|
|
@@ -46,6 +36,8 @@ interface FormFooterProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
46
36
|
action?: LinkPickerPluginAction;
|
|
47
37
|
createFeatureDiscovery?: boolean;
|
|
48
38
|
customSubmitButtonLabel?: MessageDescriptor;
|
|
39
|
+
submitMessageId?: string;
|
|
40
|
+
hideSubmitButton?: boolean;
|
|
49
41
|
}
|
|
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>;
|
|
42
|
+
export declare const FormFooter: import("react").MemoExoticComponent<({ isLoading, isSubmitting, error, url, queryState, items, isEditing, onCancel, action, createFeatureDiscovery, customSubmitButtonLabel, submitMessageId, hideSubmitButton, ...restProps }: FormFooterProps) => jsx.JSX.Element | null>;
|
|
51
43
|
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
6
|
+
import { type MessageDescriptor } from 'react-intl-next';
|
|
7
|
+
import type { LinkPickerState, LinkSearchListItemData } from '../../../../common/types';
|
|
8
|
+
type LinkPickerButtonGroupProps = {
|
|
9
|
+
isEditing?: boolean;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
isSubmitting: boolean;
|
|
12
|
+
customSubmitButtonLabel?: MessageDescriptor;
|
|
13
|
+
error: unknown | null;
|
|
14
|
+
items: LinkSearchListItemData[] | null;
|
|
15
|
+
queryState: LinkPickerState | null;
|
|
16
|
+
submitMessageId?: string;
|
|
17
|
+
testId?: string;
|
|
18
|
+
url: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const messages: {
|
|
21
|
+
saveButton: {
|
|
22
|
+
id: string;
|
|
23
|
+
defaultMessage: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
insertButton: {
|
|
27
|
+
id: string;
|
|
28
|
+
defaultMessage: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export declare const LinkPickerSubmitButton: ({ isEditing, isLoading, isSubmitting, customSubmitButtonLabel, error, items, queryState, submitMessageId, testId, url, }: LinkPickerButtonGroupProps) => jsx.JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type LinkPickerState, type LinkSearchListItemData } from '
|
|
1
|
+
import { type LinkPickerState, type LinkSearchListItemData } from '../../../../common/types';
|
|
2
2
|
export declare const checkSubmitDisabled: (isLoading: boolean, isSubmitting: boolean, error: unknown | null, url: string, queryState: LinkPickerState | null, items: LinkSearchListItemData[] | null) => boolean;
|
|
@@ -18,5 +18,6 @@ export interface LinkSearchListItemProps {
|
|
|
18
18
|
onFocus: () => void;
|
|
19
19
|
id?: string;
|
|
20
20
|
role?: string;
|
|
21
|
+
nameMaxLines?: number;
|
|
21
22
|
}
|
|
22
23
|
export declare const LinkSearchListItem: import("react").ForwardRefExoticComponent<LinkSearchListItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare const relativeFontSizeToBase16: (px: number | string) => string;
|
|
2
2
|
export declare const composeListItemStyles: (selected?: boolean) => import("@emotion/react").SerializedStyles;
|
|
3
3
|
export declare const itemNameStyles: import("@emotion/react").SerializedStyles;
|
|
4
|
-
export declare const listItemNameStyles: import("@emotion/react").SerializedStyles;
|
|
5
4
|
export declare const listItemContextStyles: import("@emotion/react").SerializedStyles;
|
|
6
5
|
export declare const listItemContainerStyles: import("@emotion/react").SerializedStyles;
|
|
7
6
|
export declare const listItemContainerInnerStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -28,6 +28,14 @@ export interface LinkSearchListItemData {
|
|
|
28
28
|
/** The data source that provided the result */
|
|
29
29
|
source?: string;
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Optionally override the strings shown in the link result's subtitle
|
|
33
|
+
* (by default, the subtitle is the container and date). Provide translated strings.
|
|
34
|
+
*/
|
|
35
|
+
subtitleItems?: Readonly<[
|
|
36
|
+
string,
|
|
37
|
+
string?
|
|
38
|
+
]>;
|
|
31
39
|
}
|
|
32
40
|
export interface LinkPickerState {
|
|
33
41
|
/** Current query string / URL input field value */
|
|
@@ -36,6 +44,10 @@ export interface LinkPickerState {
|
|
|
36
44
|
export interface ResolveResult {
|
|
37
45
|
data: LinkSearchListItemData[];
|
|
38
46
|
}
|
|
47
|
+
export interface LinkPickerUiOptions {
|
|
48
|
+
/** Maximum number of lines to display for the item name */
|
|
49
|
+
listItemNameMaxLines?: number;
|
|
50
|
+
}
|
|
39
51
|
export interface LinkPickerPlugin {
|
|
40
52
|
resolve: (state: LinkPickerState) => Promise<ResolveResult> | AsyncGenerator<ResolveResult, ResolveResult>;
|
|
41
53
|
/** Uniquely identify the tab */
|
|
@@ -55,6 +67,8 @@ export interface LinkPickerPlugin {
|
|
|
55
67
|
UNSAFE_onActivation?: () => void;
|
|
56
68
|
/** Register Plugin Actions */
|
|
57
69
|
action?: LinkPickerPluginAction;
|
|
70
|
+
/** Options to override certain configurable styles in the link picker */
|
|
71
|
+
uiOptions?: LinkPickerUiOptions;
|
|
58
72
|
}
|
|
59
73
|
export interface LinkPickerPluginAction {
|
|
60
74
|
label: MessageDescriptor | string;
|
|
@@ -137,6 +151,12 @@ export interface LinkPickerProps {
|
|
|
137
151
|
featureFlags?: Record<string, unknown>;
|
|
138
152
|
/** Controls showing a "submission in-progres" UX */
|
|
139
153
|
isSubmitting?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Do not utilize this! This is a temporary prop that is being used for a specific experiment.
|
|
156
|
+
* This prop controls where the submit button appears. When true the submit button will move below the input field and be full width
|
|
157
|
+
* @internal
|
|
158
|
+
* */
|
|
159
|
+
UNSAFE_moveSubmitButton?: boolean;
|
|
140
160
|
}
|
|
141
161
|
type CustomLinkPickerMessages = {
|
|
142
162
|
/** Label for the link input field */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default } from './ui';
|
|
2
2
|
export { DeprecatedLazyLinkPickerExport as LinkPicker } from './ui';
|
|
3
3
|
export type { LinkPickerProps } from './common/types';
|
|
4
|
-
export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, } from './common/types';
|
|
4
|
+
export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, LinkPickerUiOptions, } from './common/types';
|
|
5
5
|
export { UnauthenticatedError } from './common/utils/errors';
|
|
6
6
|
export { LoaderFallback } from './ui/loader-fallback';
|
|
@@ -8,16 +8,6 @@ export declare const messages: {
|
|
|
8
8
|
defaultMessage: string;
|
|
9
9
|
description: string;
|
|
10
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
11
|
submittingStatusMessage: {
|
|
22
12
|
id: string;
|
|
23
13
|
defaultMessage: string;
|
|
@@ -46,6 +36,8 @@ interface FormFooterProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
46
36
|
action?: LinkPickerPluginAction;
|
|
47
37
|
createFeatureDiscovery?: boolean;
|
|
48
38
|
customSubmitButtonLabel?: MessageDescriptor;
|
|
39
|
+
submitMessageId?: string;
|
|
40
|
+
hideSubmitButton?: boolean;
|
|
49
41
|
}
|
|
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>;
|
|
42
|
+
export declare const FormFooter: import("react").MemoExoticComponent<({ isLoading, isSubmitting, error, url, queryState, items, isEditing, onCancel, action, createFeatureDiscovery, customSubmitButtonLabel, submitMessageId, hideSubmitButton, ...restProps }: FormFooterProps) => jsx.JSX.Element | null>;
|
|
51
43
|
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
6
|
+
import { type MessageDescriptor } from 'react-intl-next';
|
|
7
|
+
import type { LinkPickerState, LinkSearchListItemData } from '../../../../common/types';
|
|
8
|
+
type LinkPickerButtonGroupProps = {
|
|
9
|
+
isEditing?: boolean;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
isSubmitting: boolean;
|
|
12
|
+
customSubmitButtonLabel?: MessageDescriptor;
|
|
13
|
+
error: unknown | null;
|
|
14
|
+
items: LinkSearchListItemData[] | null;
|
|
15
|
+
queryState: LinkPickerState | null;
|
|
16
|
+
submitMessageId?: string;
|
|
17
|
+
testId?: string;
|
|
18
|
+
url: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const messages: {
|
|
21
|
+
saveButton: {
|
|
22
|
+
id: string;
|
|
23
|
+
defaultMessage: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
insertButton: {
|
|
27
|
+
id: string;
|
|
28
|
+
defaultMessage: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export declare const LinkPickerSubmitButton: ({ isEditing, isLoading, isSubmitting, customSubmitButtonLabel, error, items, queryState, submitMessageId, testId, url, }: LinkPickerButtonGroupProps) => jsx.JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type LinkPickerState, type LinkSearchListItemData } from '
|
|
1
|
+
import { type LinkPickerState, type LinkSearchListItemData } from '../../../../common/types';
|
|
2
2
|
export declare const checkSubmitDisabled: (isLoading: boolean, isSubmitting: boolean, error: unknown | null, url: string, queryState: LinkPickerState | null, items: LinkSearchListItemData[] | null) => boolean;
|
package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/list-item/index.d.ts
CHANGED
|
@@ -18,5 +18,6 @@ export interface LinkSearchListItemProps {
|
|
|
18
18
|
onFocus: () => void;
|
|
19
19
|
id?: string;
|
|
20
20
|
role?: string;
|
|
21
|
+
nameMaxLines?: number;
|
|
21
22
|
}
|
|
22
23
|
export declare const LinkSearchListItem: import("react").ForwardRefExoticComponent<LinkSearchListItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/list-item/styled.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare const relativeFontSizeToBase16: (px: number | string) => string;
|
|
2
2
|
export declare const composeListItemStyles: (selected?: boolean) => import("@emotion/react").SerializedStyles;
|
|
3
3
|
export declare const itemNameStyles: import("@emotion/react").SerializedStyles;
|
|
4
|
-
export declare const listItemNameStyles: import("@emotion/react").SerializedStyles;
|
|
5
4
|
export declare const listItemContextStyles: import("@emotion/react").SerializedStyles;
|
|
6
5
|
export declare const listItemContainerStyles: import("@emotion/react").SerializedStyles;
|
|
7
6
|
export declare const listItemContainerInnerStyles: import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-picker",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.44.0",
|
|
4
4
|
"description": "Standalone link picker",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@af/visual-regression": "*",
|
|
93
93
|
"@atlaskit/dropdown-menu": "^12.17.0",
|
|
94
94
|
"@atlaskit/link-provider": "^1.14.0",
|
|
95
|
-
"@atlaskit/link-test-helpers": "^7.
|
|
95
|
+
"@atlaskit/link-test-helpers": "^7.5.0",
|
|
96
96
|
"@atlaskit/visual-regression": "*",
|
|
97
97
|
"@atlassian/feature-flags-test-utils": "*",
|
|
98
98
|
"@testing-library/dom": "^10.1.0",
|
/package/dist/cjs/ui/link-picker/form-footer/{utils.js → link-picker-submit-button/utils.js}
RENAMED
|
File without changes
|
/package/dist/es2019/ui/link-picker/form-footer/{utils.js → link-picker-submit-button/utils.js}
RENAMED
|
File without changes
|
/package/dist/esm/ui/link-picker/form-footer/{utils.js → link-picker-submit-button/utils.js}
RENAMED
|
File without changes
|