@atlaskit/link-picker 2.0.0 → 3.0.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 +17 -0
- package/dist/cjs/common/generic-error-svg/index.js +2 -10
- package/dist/cjs/common/ui/empty-state/index.js +2 -10
- package/dist/cjs/common/ui/min-height-container/index.js +2 -14
- package/dist/cjs/ui/error-boundary/error-boundary-fallback/index.js +2 -9
- package/dist/cjs/ui/link-picker/form-footer/index.js +3 -11
- package/dist/cjs/ui/link-picker/index.js +3 -10
- package/dist/cjs/ui/link-picker/search-results/index.js +2 -10
- package/dist/cjs/ui/link-picker/search-results/link-search-list/index.js +2 -13
- package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +2 -10
- package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/index.js +2 -15
- package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/index.js +2 -10
- package/dist/cjs/ui/link-picker/search-results/search-results-container/index.js +2 -10
- package/dist/cjs/ui/link-picker/text-input/index.js +2 -9
- package/dist/cjs/ui/loader-fallback/index.js +2 -10
- package/dist/cjs/ui/main.js +3 -11
- package/dist/es2019/common/generic-error-svg/index.js +1 -9
- package/dist/es2019/common/ui/empty-state/index.js +1 -9
- package/dist/es2019/common/ui/min-height-container/index.js +1 -13
- package/dist/es2019/ui/error-boundary/error-boundary-fallback/index.js +1 -8
- package/dist/es2019/ui/link-picker/form-footer/index.js +2 -10
- package/dist/es2019/ui/link-picker/index.js +2 -9
- package/dist/es2019/ui/link-picker/search-results/index.js +1 -9
- package/dist/es2019/ui/link-picker/search-results/link-search-list/index.js +1 -12
- package/dist/es2019/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +1 -9
- package/dist/es2019/ui/link-picker/search-results/link-search-list/list-item/index.js +1 -14
- package/dist/es2019/ui/link-picker/search-results/scrolling-tabs/index.js +1 -9
- package/dist/es2019/ui/link-picker/search-results/search-results-container/index.js +1 -9
- package/dist/es2019/ui/link-picker/text-input/index.js +1 -8
- package/dist/es2019/ui/loader-fallback/index.js +1 -9
- package/dist/es2019/ui/main.js +2 -10
- package/dist/esm/common/generic-error-svg/index.js +1 -9
- package/dist/esm/common/ui/empty-state/index.js +1 -9
- package/dist/esm/common/ui/min-height-container/index.js +1 -13
- package/dist/esm/ui/error-boundary/error-boundary-fallback/index.js +1 -8
- package/dist/esm/ui/link-picker/form-footer/index.js +2 -10
- package/dist/esm/ui/link-picker/index.js +2 -9
- package/dist/esm/ui/link-picker/search-results/index.js +1 -9
- package/dist/esm/ui/link-picker/search-results/link-search-list/index.js +1 -12
- package/dist/esm/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +1 -9
- package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/index.js +1 -14
- package/dist/esm/ui/link-picker/search-results/scrolling-tabs/index.js +1 -9
- package/dist/esm/ui/link-picker/search-results/search-results-container/index.js +1 -9
- package/dist/esm/ui/link-picker/text-input/index.js +1 -8
- package/dist/esm/ui/loader-fallback/index.js +1 -9
- package/dist/esm/ui/main.js +2 -10
- package/dist/types/common/generic-error-svg/index.d.ts +0 -1
- package/dist/types/common/ui/empty-state/index.d.ts +1 -2
- package/dist/types/common/ui/min-height-container/index.d.ts +0 -3
- package/dist/types/ui/error-boundary/error-boundary-fallback/index.d.ts +0 -1
- package/dist/types/ui/index.d.ts +2 -2
- package/dist/types/ui/lazy.d.ts +1 -1
- package/dist/types/ui/link-picker/form-footer/index.d.ts +1 -2
- package/dist/types/ui/link-picker/index.d.ts +1 -2
- package/dist/types/ui/link-picker/search-results/index.d.ts +1 -2
- package/dist/types/ui/link-picker/search-results/link-search-list/index.d.ts +0 -1
- package/dist/types/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.d.ts +1 -2
- package/dist/types/ui/link-picker/search-results/link-search-list/list-item/index.d.ts +0 -1
- package/dist/types/ui/link-picker/search-results/scrolling-tabs/index.d.ts +0 -1
- package/dist/types/ui/link-picker/search-results/search-results-container/index.d.ts +1 -2
- package/dist/types/ui/link-picker/text-input/index.d.ts +1 -2
- package/dist/types/ui/loader-fallback/index.d.ts +0 -1
- package/dist/types/ui/main.d.ts +1 -2
- package/dist/types-ts4.5/common/generic-error-svg/index.d.ts +0 -1
- package/dist/types-ts4.5/common/ui/empty-state/index.d.ts +1 -2
- package/dist/types-ts4.5/common/ui/min-height-container/index.d.ts +0 -3
- package/dist/types-ts4.5/ui/error-boundary/error-boundary-fallback/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/lazy.d.ts +1 -1
- package/dist/types-ts4.5/ui/link-picker/form-footer/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/search-results/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/list-item/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/link-picker/search-results/scrolling-tabs/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/link-picker/search-results/search-results-container/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/text-input/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/loader-fallback/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/main.d.ts +1 -2
- package/package.json +6 -10
- package/report.api.md +1 -1
- package/dist/cjs/common/generic-error-svg/old/index.js +0 -66
- package/dist/cjs/common/ui/empty-state/old/index.js +0 -38
- package/dist/cjs/common/ui/min-height-container/old/index.js +0 -34
- package/dist/cjs/common/ui/min-height-container/old/styled.js +0 -16
- package/dist/cjs/ui/error-boundary/error-boundary-fallback/old/index.js +0 -50
- package/dist/cjs/ui/link-picker/form-footer/old/index.js +0 -116
- package/dist/cjs/ui/link-picker/old/index.js +0 -435
- package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/old/index.js +0 -70
- package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/old/index.js +0 -145
- package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/old/styled.js +0 -91
- package/dist/cjs/ui/link-picker/search-results/link-search-list/old/index.js +0 -188
- package/dist/cjs/ui/link-picker/search-results/link-search-list/old/styled.js +0 -45
- package/dist/cjs/ui/link-picker/search-results/old/index.js +0 -105
- package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/old/index.js +0 -163
- package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/old/styles.js +0 -74
- package/dist/cjs/ui/link-picker/search-results/search-results-container/old/index.js +0 -43
- package/dist/cjs/ui/link-picker/text-input/old/index.js +0 -125
- package/dist/cjs/ui/loader-fallback/old/index.js +0 -67
- package/dist/cjs/ui/old/main.js +0 -75
- package/dist/es2019/common/generic-error-svg/old/index.js +0 -58
- package/dist/es2019/common/ui/empty-state/old/index.js +0 -32
- package/dist/es2019/common/ui/min-height-container/old/index.js +0 -25
- package/dist/es2019/common/ui/min-height-container/old/styled.js +0 -10
- package/dist/es2019/ui/error-boundary/error-boundary-fallback/old/index.js +0 -41
- package/dist/es2019/ui/link-picker/form-footer/old/index.js +0 -104
- package/dist/es2019/ui/link-picker/old/index.js +0 -436
- package/dist/es2019/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/old/index.js +0 -63
- package/dist/es2019/ui/link-picker/search-results/link-search-list/list-item/old/index.js +0 -132
- package/dist/es2019/ui/link-picker/search-results/link-search-list/list-item/old/styled.js +0 -83
- package/dist/es2019/ui/link-picker/search-results/link-search-list/old/index.js +0 -178
- package/dist/es2019/ui/link-picker/search-results/link-search-list/old/styled.js +0 -38
- package/dist/es2019/ui/link-picker/search-results/old/index.js +0 -98
- package/dist/es2019/ui/link-picker/search-results/scrolling-tabs/old/index.js +0 -130
- package/dist/es2019/ui/link-picker/search-results/scrolling-tabs/old/styles.js +0 -67
- package/dist/es2019/ui/link-picker/search-results/search-results-container/old/index.js +0 -37
- package/dist/es2019/ui/link-picker/text-input/old/index.js +0 -121
- package/dist/es2019/ui/loader-fallback/old/index.js +0 -60
- package/dist/es2019/ui/old/main.js +0 -73
- package/dist/esm/common/generic-error-svg/old/index.js +0 -58
- package/dist/esm/common/ui/empty-state/old/index.js +0 -31
- package/dist/esm/common/ui/min-height-container/old/index.js +0 -25
- package/dist/esm/common/ui/min-height-container/old/styled.js +0 -10
- package/dist/esm/ui/error-boundary/error-boundary-fallback/old/index.js +0 -43
- package/dist/esm/ui/link-picker/form-footer/old/index.js +0 -108
- package/dist/esm/ui/link-picker/old/index.js +0 -432
- package/dist/esm/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/old/index.js +0 -63
- package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/old/index.js +0 -136
- package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/old/styled.js +0 -84
- package/dist/esm/ui/link-picker/search-results/link-search-list/old/index.js +0 -186
- package/dist/esm/ui/link-picker/search-results/link-search-list/old/styled.js +0 -38
- package/dist/esm/ui/link-picker/search-results/old/index.js +0 -100
- package/dist/esm/ui/link-picker/search-results/scrolling-tabs/old/index.js +0 -158
- package/dist/esm/ui/link-picker/search-results/scrolling-tabs/old/styles.js +0 -67
- package/dist/esm/ui/link-picker/search-results/search-results-container/old/index.js +0 -36
- package/dist/esm/ui/link-picker/text-input/old/index.js +0 -121
- package/dist/esm/ui/loader-fallback/old/index.js +0 -59
- package/dist/esm/ui/old/main.js +0 -64
- package/dist/types/common/generic-error-svg/old/index.d.ts +0 -6
- package/dist/types/common/ui/empty-state/old/index.d.ts +0 -9
- package/dist/types/common/ui/min-height-container/old/index.d.ts +0 -8
- package/dist/types/common/ui/min-height-container/old/styled.d.ts +0 -1
- package/dist/types/ui/error-boundary/error-boundary-fallback/old/index.d.ts +0 -6
- package/dist/types/ui/link-picker/form-footer/old/index.d.ts +0 -42
- package/dist/types/ui/link-picker/old/index.d.ts +0 -25
- package/dist/types/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/old/index.d.ts +0 -6
- package/dist/types/ui/link-picker/search-results/link-search-list/list-item/old/index.d.ts +0 -23
- package/dist/types/ui/link-picker/search-results/link-search-list/list-item/old/styled.d.ts +0 -7
- package/dist/types/ui/link-picker/search-results/link-search-list/old/index.d.ts +0 -52
- package/dist/types/ui/link-picker/search-results/link-search-list/old/styled.d.ts +0 -4
- package/dist/types/ui/link-picker/search-results/old/index.d.ts +0 -45
- package/dist/types/ui/link-picker/search-results/scrolling-tabs/old/index.d.ts +0 -7
- package/dist/types/ui/link-picker/search-results/scrolling-tabs/old/styles.d.ts +0 -6
- package/dist/types/ui/link-picker/search-results/search-results-container/old/index.d.ts +0 -10
- package/dist/types/ui/link-picker/text-input/old/index.d.ts +0 -18
- package/dist/types/ui/loader-fallback/old/index.d.ts +0 -17
- package/dist/types/ui/old/main.d.ts +0 -13
- package/dist/types-ts4.5/common/generic-error-svg/old/index.d.ts +0 -6
- package/dist/types-ts4.5/common/ui/empty-state/old/index.d.ts +0 -9
- package/dist/types-ts4.5/common/ui/min-height-container/old/index.d.ts +0 -8
- package/dist/types-ts4.5/common/ui/min-height-container/old/styled.d.ts +0 -1
- package/dist/types-ts4.5/ui/error-boundary/error-boundary-fallback/old/index.d.ts +0 -6
- package/dist/types-ts4.5/ui/link-picker/form-footer/old/index.d.ts +0 -42
- package/dist/types-ts4.5/ui/link-picker/old/index.d.ts +0 -25
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/old/index.d.ts +0 -6
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/list-item/old/index.d.ts +0 -23
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/list-item/old/styled.d.ts +0 -7
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/old/index.d.ts +0 -52
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/old/styled.d.ts +0 -4
- package/dist/types-ts4.5/ui/link-picker/search-results/old/index.d.ts +0 -45
- package/dist/types-ts4.5/ui/link-picker/search-results/scrolling-tabs/old/index.d.ts +0 -7
- package/dist/types-ts4.5/ui/link-picker/search-results/scrolling-tabs/old/styles.d.ts +0 -6
- package/dist/types-ts4.5/ui/link-picker/search-results/search-results-container/old/index.d.ts +0 -10
- package/dist/types-ts4.5/ui/link-picker/text-input/old/index.d.ts +0 -18
- package/dist/types-ts4.5/ui/loader-fallback/old/index.d.ts +0 -17
- package/dist/types-ts4.5/ui/old/main.d.ts +0 -13
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
/* eslint-disable @atlassian/tangerine/import/no-parent-imports */
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @jsxRuntime classic
|
|
6
|
-
* @jsx jsx
|
|
7
|
-
*/
|
|
8
|
-
import { Fragment, useCallback, useRef } from 'react';
|
|
9
|
-
|
|
10
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
|
-
import { css, jsx } from '@emotion/react';
|
|
12
|
-
import { ErrorMessage, Field } from '@atlaskit/form';
|
|
13
|
-
import Selectclear from '@atlaskit/icon/core/migration/cross-circle--select-clear';
|
|
14
|
-
import { Pressable, xcss } from '@atlaskit/primitives';
|
|
15
|
-
import Textfield from '@atlaskit/textfield';
|
|
16
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
17
|
-
import { ConditionalSpotlightTargetWrapper } from '../conditional-spotlight-target-wrapper';
|
|
18
|
-
import { isRedoEvent, isUndoEvent } from '../utils';
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Overidding text input margin top which design system provides as a default spacer
|
|
22
|
-
* but it gets in the way of our layout
|
|
23
|
-
*/
|
|
24
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
25
|
-
const fieldStyles = css({
|
|
26
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
27
|
-
'> div': {
|
|
28
|
-
marginTop: 0
|
|
29
|
-
},
|
|
30
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
31
|
-
'& + &': {
|
|
32
|
-
marginTop: "var(--ds-space-200, 16px)"
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
export const testIds = {
|
|
36
|
-
urlError: 'link-error',
|
|
37
|
-
clearUrlButton: 'clear-text'
|
|
38
|
-
};
|
|
39
|
-
const clearTextButtonStyles = xcss({
|
|
40
|
-
padding: 'space.0',
|
|
41
|
-
marginRight: 'space.050',
|
|
42
|
-
backgroundColor: 'color.background.neutral.subtle',
|
|
43
|
-
border: 'none',
|
|
44
|
-
verticalAlign: 'middle'
|
|
45
|
-
});
|
|
46
|
-
export const TextInputOld = ({
|
|
47
|
-
name,
|
|
48
|
-
label,
|
|
49
|
-
autoFocus,
|
|
50
|
-
onRedo,
|
|
51
|
-
onUndo,
|
|
52
|
-
onKeyDown,
|
|
53
|
-
onClear,
|
|
54
|
-
clearLabel,
|
|
55
|
-
error,
|
|
56
|
-
spotlightTargetName,
|
|
57
|
-
...restProps
|
|
58
|
-
}) => {
|
|
59
|
-
const inputRef = useRef(null);
|
|
60
|
-
const handleRef = useCallback(input => {
|
|
61
|
-
if (input) {
|
|
62
|
-
inputRef.current = input;
|
|
63
|
-
if (autoFocus) {
|
|
64
|
-
// Need this to prevent jumping when we render TextInput inside Portal @see ED-2992
|
|
65
|
-
input.focus({
|
|
66
|
-
preventScroll: true
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}, [autoFocus]);
|
|
71
|
-
const handleKeydown = useCallback(e => {
|
|
72
|
-
if (typeof onUndo === 'function' && isUndoEvent(e)) {
|
|
73
|
-
e.preventDefault();
|
|
74
|
-
onUndo();
|
|
75
|
-
} else if (typeof onRedo === 'function' && isRedoEvent(e)) {
|
|
76
|
-
e.preventDefault();
|
|
77
|
-
onRedo();
|
|
78
|
-
}
|
|
79
|
-
if (onKeyDown) {
|
|
80
|
-
onKeyDown(e);
|
|
81
|
-
}
|
|
82
|
-
}, [onUndo, onRedo, onKeyDown]);
|
|
83
|
-
const handleClear = useCallback(e => {
|
|
84
|
-
var _inputRef$current;
|
|
85
|
-
e.preventDefault();
|
|
86
|
-
e.stopPropagation();
|
|
87
|
-
onClear === null || onClear === void 0 ? void 0 : onClear(name);
|
|
88
|
-
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
89
|
-
}, [name, onClear]);
|
|
90
|
-
const clearText = restProps.value !== '' && jsx(Tooltip, {
|
|
91
|
-
content: clearLabel
|
|
92
|
-
}, jsx(Pressable, {
|
|
93
|
-
xcss: clearTextButtonStyles,
|
|
94
|
-
onClick: handleClear,
|
|
95
|
-
testId: testIds.clearUrlButton
|
|
96
|
-
}, jsx(Selectclear, {
|
|
97
|
-
LEGACY_size: "medium",
|
|
98
|
-
label: clearLabel || '',
|
|
99
|
-
color: "var(--ds-icon-subtle, #626F86)",
|
|
100
|
-
spacing: "spacious"
|
|
101
|
-
})));
|
|
102
|
-
return jsx("div", {
|
|
103
|
-
css: fieldStyles
|
|
104
|
-
}, jsx(Field, {
|
|
105
|
-
label: label,
|
|
106
|
-
name: name
|
|
107
|
-
}, ({
|
|
108
|
-
fieldProps
|
|
109
|
-
}) => {
|
|
110
|
-
return jsx(ConditionalSpotlightTargetWrapper, {
|
|
111
|
-
spotlightTargetName: spotlightTargetName
|
|
112
|
-
}, jsx(Fragment, null, jsx(Textfield, _extends({}, fieldProps, restProps, {
|
|
113
|
-
onKeyDown: handleKeydown,
|
|
114
|
-
ref: handleRef,
|
|
115
|
-
elemAfterInput: clearText,
|
|
116
|
-
isInvalid: !!error
|
|
117
|
-
})), error && jsx(ErrorMessage, {
|
|
118
|
-
testId: testIds.urlError
|
|
119
|
-
}, error)));
|
|
120
|
-
}));
|
|
121
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
-
import { css, jsx } from '@emotion/react';
|
|
7
|
-
import Spinner from '@atlaskit/spinner';
|
|
8
|
-
import { MinHeightContainer } from '../../../common/ui/min-height-container';
|
|
9
|
-
const styles = css({
|
|
10
|
-
alignItems: 'center'
|
|
11
|
-
});
|
|
12
|
-
const LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT = '472px';
|
|
13
|
-
const LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT = '550px';
|
|
14
|
-
const LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT = '505px';
|
|
15
|
-
const LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITHOUT_DISPLAYTEXT = '429px';
|
|
16
|
-
const LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_DISPLAYTEXT = '218px';
|
|
17
|
-
const LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITHOUT_DISPLAYTEXT = '141px';
|
|
18
|
-
const getEstimatedMinHeight = ({
|
|
19
|
-
hideDisplayText,
|
|
20
|
-
isLoadingPlugins,
|
|
21
|
-
plugins,
|
|
22
|
-
url
|
|
23
|
-
}) => {
|
|
24
|
-
/**
|
|
25
|
-
* "Insert mode" (search results shown initially)
|
|
26
|
-
*/
|
|
27
|
-
if (!url) {
|
|
28
|
-
/**
|
|
29
|
-
* With tabs
|
|
30
|
-
*/
|
|
31
|
-
if (plugins && plugins.length > 1 || isLoadingPlugins) {
|
|
32
|
-
return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Without tabs
|
|
37
|
-
*/
|
|
38
|
-
if ((plugins === null || plugins === void 0 ? void 0 : plugins.length) === 1) {
|
|
39
|
-
return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_DISPLAYTEXT;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Loader / skeleton for the Link Picker. Takes LoaderFallbackProps (hideDisplayText, isLoadingPlugins, plugins)
|
|
47
|
-
* to determine the height to prevent jumps in height when loading
|
|
48
|
-
*/
|
|
49
|
-
export const LoaderFallbackOld = props => {
|
|
50
|
-
const minHeight = getEstimatedMinHeight(props);
|
|
51
|
-
return jsx(MinHeightContainer, {
|
|
52
|
-
minHeight: minHeight,
|
|
53
|
-
"data-testid": "link-picker-root-loader-boundary-ui",
|
|
54
|
-
css: styles
|
|
55
|
-
}, jsx(Spinner, {
|
|
56
|
-
testId: "link-picker.component-loading-indicator",
|
|
57
|
-
interactionName: props.name || 'link-picker-loading',
|
|
58
|
-
size: "medium"
|
|
59
|
-
}));
|
|
60
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
/* eslint-disable @atlassian/tangerine/import/no-parent-imports */
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @jsxRuntime classic
|
|
6
|
-
* @jsx jsx
|
|
7
|
-
*/
|
|
8
|
-
import React, { memo } from 'react';
|
|
9
|
-
|
|
10
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
|
-
import { css, jsx } from '@emotion/react';
|
|
12
|
-
import { LazySuspense } from 'react-loosely-lazy';
|
|
13
|
-
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
14
|
-
import { COMPONENT_NAME, LINK_PICKER_WIDTH_IN_PX } from '../../common/constants';
|
|
15
|
-
import { LinkPickerSessionProvider } from '../../controllers/session-provider';
|
|
16
|
-
import { ErrorBoundary } from '../error-boundary';
|
|
17
|
-
import { LoaderFallback } from '../loader-fallback';
|
|
18
|
-
import { MessagesProvider } from '../messages-provider';
|
|
19
|
-
export const testIds = {
|
|
20
|
-
linkPickerRoot: 'link-picker-root'
|
|
21
|
-
};
|
|
22
|
-
export const PACKAGE_DATA = {
|
|
23
|
-
packageName: "@atlaskit/link-picker" || '',
|
|
24
|
-
packageVersion: "2.0.0" || '',
|
|
25
|
-
componentName: COMPONENT_NAME,
|
|
26
|
-
source: COMPONENT_NAME
|
|
27
|
-
};
|
|
28
|
-
const DefaultRootComponent = ({
|
|
29
|
-
children
|
|
30
|
-
}) => {
|
|
31
|
-
return jsx("div", {
|
|
32
|
-
"data-testid": testIds.linkPickerRoot
|
|
33
|
-
}, children);
|
|
34
|
-
};
|
|
35
|
-
const fixedWidthContainerStyles = css({
|
|
36
|
-
width: 'var(--link-picker-width)'
|
|
37
|
-
});
|
|
38
|
-
const FixedWidthContainer = props => {
|
|
39
|
-
return jsx("div", _extends({
|
|
40
|
-
css: fixedWidthContainerStyles
|
|
41
|
-
}, props));
|
|
42
|
-
};
|
|
43
|
-
export const composeLinkPickerOld = Component => {
|
|
44
|
-
return /*#__PURE__*/memo(props => {
|
|
45
|
-
var _props$paddingLeft, _props$paddingRight, _props$paddingTop, _props$paddingBottom;
|
|
46
|
-
const {
|
|
47
|
-
component
|
|
48
|
-
} = props;
|
|
49
|
-
const RootComponent = component !== null && component !== void 0 ? component : DefaultRootComponent;
|
|
50
|
-
return jsx(AnalyticsContext, {
|
|
51
|
-
data: PACKAGE_DATA
|
|
52
|
-
}, jsx(LinkPickerSessionProvider, null, jsx(MessagesProvider, null, jsx("div", {
|
|
53
|
-
style: {
|
|
54
|
-
['--link-picker-width']: props.disableWidth ? '100%' :
|
|
55
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
56
|
-
`${LINK_PICKER_WIDTH_IN_PX}px`,
|
|
57
|
-
['--link-picker-padding-left']: (_props$paddingLeft = props.paddingLeft) !== null && _props$paddingLeft !== void 0 ? _props$paddingLeft : "var(--ds-space-200, 16px)",
|
|
58
|
-
['--link-picker-padding-right']: (_props$paddingRight = props.paddingRight) !== null && _props$paddingRight !== void 0 ? _props$paddingRight : "var(--ds-space-200, 16px)",
|
|
59
|
-
['--link-picker-padding-top']: (_props$paddingTop = props.paddingTop) !== null && _props$paddingTop !== void 0 ? _props$paddingTop : "var(--ds-space-200, 16px)",
|
|
60
|
-
['--link-picker-padding-bottom']: (_props$paddingBottom = props.paddingBottom) !== null && _props$paddingBottom !== void 0 ? _props$paddingBottom : "var(--ds-space-200, 16px)"
|
|
61
|
-
}
|
|
62
|
-
}, jsx(FixedWidthContainer, null, jsx(ErrorBoundary, null, jsx(LazySuspense, {
|
|
63
|
-
fallback: jsx(LoaderFallback, {
|
|
64
|
-
url: props.url,
|
|
65
|
-
hideDisplayText: props.hideDisplayText,
|
|
66
|
-
isLoadingPlugins: props.isLoadingPlugins,
|
|
67
|
-
plugins: props.plugins
|
|
68
|
-
})
|
|
69
|
-
}, jsx(RootComponent, _extends({}, props, {
|
|
70
|
-
"data-testid": testIds.linkPickerRoot
|
|
71
|
-
}), jsx(Component, props)))))))));
|
|
72
|
-
});
|
|
73
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
/**
|
|
3
|
-
* @jsxRuntime classic
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
6
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
-
import { css, jsx } from '@emotion/react';
|
|
8
|
-
var HEIGHT = 90;
|
|
9
|
-
var genericErrorStyles = css({
|
|
10
|
-
height: "".concat(HEIGHT, "px"),
|
|
11
|
-
display: 'block'
|
|
12
|
-
});
|
|
13
|
-
export var GenericErrorSVGOld = function GenericErrorSVGOld(props) {
|
|
14
|
-
var id = 'link-picker-ui-generic-error-svg';
|
|
15
|
-
return jsx("svg", _extends({
|
|
16
|
-
height: "90",
|
|
17
|
-
viewBox: "0 0 164 212",
|
|
18
|
-
fill: "none",
|
|
19
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
20
|
-
css: genericErrorStyles
|
|
21
|
-
}, props), jsx("path", {
|
|
22
|
-
d: "m95.43 74.16 66.44 115.08c5.84 10.12-1.46 22.76-13.14 22.76H15.85c-11.68 0-18.98-12.65-13.14-22.76L69.15 74.16c5.84-10.12 20.44-10.12 26.28 0Zm-7.56 83.55 2.88-44.35c.34-5.29-3.86-9.78-9.16-9.78-5.31 0-9.51 4.48-9.16 9.78l2.88 44.35a6.3 6.3 0 0 0 6.28 5.89c3.31 0 6.06-2.58 6.28-5.89Zm-15.84 23.54c0 5.66 4.76 10.1 10.39 9.58 4.85-.45 8.73-4.5 8.83-9.37.11-5.45-4.31-9.94-9.73-9.94-5.23-.01-9.49 4.37-9.49 9.73Z",
|
|
23
|
-
fill: "url(#".concat(id, ")")
|
|
24
|
-
}), jsx("path", {
|
|
25
|
-
opacity: ".6",
|
|
26
|
-
d: "M93.35 27.17 85.94.45c-.17-.62-1.07-.58-1.19.05l-4.66 25.1-5.8-1.08a.612.612 0 0 0-.7.76L81 52c.17.62 1.07.58 1.19-.05l4.66-25.1 5.8 1.08c.45.08.82-.33.7-.76ZM66.77 41.81 55.9 33.26c-.22-.18-.53.07-.41.33l5.53 11.43-2.66 1.29c-.18.09-.2.33-.05.45l10.87 8.55c.22.18.53-.07.41-.33l-5.53-11.43 2.66-1.29c.17-.08.2-.33.05-.45Z",
|
|
27
|
-
fill: "#C1C7D0"
|
|
28
|
-
}), jsx("path", {
|
|
29
|
-
opacity: ".6",
|
|
30
|
-
d: "M102.78 56.75a.993.993 0 0 1-.92-1.38c-.24-.77-2.29-2.85-3.54-4.11-2.97-3.01-4.93-5-3.84-6.49 1.09-1.48 3.58-.22 7.35 1.7 1.32.67 3.35 1.7 4.45 2.03-.64-.95-2.24-2.58-3.28-3.63-2.97-3.01-4.93-5-3.84-6.49 1.08-1.48 3.58-.22 7.34 1.7 1.32.67 3.34 1.7 4.45 2.03-.64-.95-2.24-2.57-3.28-3.62-2.97-3.01-4.93-5-3.84-6.49 1.08-1.48 3.57-.22 7.34 1.7 1.58.8 4.18 2.13 4.98 2.13a1.005 1.005 0 0 1 1.46 1.36c-1.09 1.48-3.57.22-7.34-1.7-1.32-.67-3.34-1.7-4.44-2.03.64.95 2.24 2.57 3.28 3.62 2.97 3.01 4.93 5 3.84 6.49-1.08 1.48-3.57.22-7.34-1.7-1.32-.67-3.35-1.7-4.45-2.03.64.95 2.24 2.57 3.28 3.63 2.97 3.01 4.93 5 3.84 6.49-1.09 1.48-3.58.22-7.35-1.7-1.32-.67-3.35-1.71-4.45-2.03.64.95 2.24 2.58 3.28 3.63 2.97 3.01 4.93 5 3.84 6.49-.21.26-.51.4-.82.4Zm5.56 14.32c-.35 0-.69-.19-.88-.52-1.04-1.88-2.22-4.02-.91-5.21 1.31-1.2 3.34.18 5.49 1.63.87.59 2.26 1.53 2.93 1.71-.12-.68-.93-2.15-1.45-3.07-1.26-2.27-2.45-4.41-1.14-5.61 1.31-1.2 3.34.18 5.49 1.63.96.65 2.54 1.72 3.1 1.74a1 1 0 0 1 1.27 1.54c-1.31 1.2-3.34-.17-5.49-1.63-.87-.59-2.26-1.53-2.93-1.71.12.68.93 2.15 1.45 3.07 1.26 2.27 2.45 4.41 1.14 5.61-1.31 1.2-3.34-.18-5.49-1.63-.87-.59-2.26-1.53-2.93-1.71.12.68.93 2.14 1.22 2.67.27.48.09 1.09-.39 1.36-.15.09-.32.13-.48.13Zm-54.32-2.89c-.22 0-.44-.04-.67-.14-1.64-.69-1.24-3.11-.81-5.67.17-1.04.45-2.7.33-3.38-.57.39-1.56 1.75-2.18 2.6-1.53 2.09-2.99 4.07-4.62 3.38a.991.991 0 0 1-.53-1.31c.2-.48.73-.72 1.21-.57.52-.21 1.65-1.75 2.34-2.68 1.53-2.09 2.98-4.08 4.62-3.38 1.64.69 1.24 3.11.81 5.67-.17 1.04-.45 2.7-.33 3.38.57-.39 1.56-1.75 2.18-2.6 1.53-2.09 2.98-4.08 4.62-3.38 1.63.69 1.24 3.09.89 5.21-.09.54-.6.91-1.15.83-.54-.09-.92-.6-.83-1.15.1-.59.37-2.24.26-2.92-.57.39-1.56 1.75-2.18 2.6-1.33 1.79-2.59 3.51-3.96 3.51Z",
|
|
31
|
-
fill: "#B3BAC5"
|
|
32
|
-
}), jsx("defs", null, jsx("linearGradient", {
|
|
33
|
-
id: id,
|
|
34
|
-
x1: "26.169",
|
|
35
|
-
y1: "228.621",
|
|
36
|
-
x2: "138.408",
|
|
37
|
-
y2: "116.382",
|
|
38
|
-
gradientUnits: "userSpaceOnUse"
|
|
39
|
-
}, jsx("stop", {
|
|
40
|
-
stopColor: "#C1C7D0"
|
|
41
|
-
}), jsx("stop", {
|
|
42
|
-
offset: ".297",
|
|
43
|
-
stopColor: "#C6CBD4",
|
|
44
|
-
stopOpacity: ".881"
|
|
45
|
-
}), jsx("stop", {
|
|
46
|
-
offset: ".63",
|
|
47
|
-
stopColor: "#D3D7DE",
|
|
48
|
-
stopOpacity: ".748"
|
|
49
|
-
}), jsx("stop", {
|
|
50
|
-
offset: ".98",
|
|
51
|
-
stopColor: "#E9EBEF",
|
|
52
|
-
stopOpacity: ".608"
|
|
53
|
-
}), jsx("stop", {
|
|
54
|
-
offset: "1",
|
|
55
|
-
stopColor: "#EBECF0",
|
|
56
|
-
stopOpacity: ".6"
|
|
57
|
-
}))));
|
|
58
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Heading from '@atlaskit/heading';
|
|
3
|
-
import { Flex, Text, xcss } from '@atlaskit/primitives';
|
|
4
|
-
var containerStyles = xcss({
|
|
5
|
-
marginBlockStart: 'space.600',
|
|
6
|
-
marginBlockEnd: 'space.600',
|
|
7
|
-
textAlign: 'center'
|
|
8
|
-
});
|
|
9
|
-
export var EmptyStateOld = function EmptyStateOld(_ref) {
|
|
10
|
-
var testId = _ref.testId,
|
|
11
|
-
header = _ref.header,
|
|
12
|
-
description = _ref.description,
|
|
13
|
-
renderImage = _ref.renderImage;
|
|
14
|
-
return /*#__PURE__*/React.createElement(Flex, {
|
|
15
|
-
xcss: containerStyles,
|
|
16
|
-
testId: testId,
|
|
17
|
-
direction: "column",
|
|
18
|
-
alignItems: "center",
|
|
19
|
-
gap: "space.300"
|
|
20
|
-
}, renderImage === null || renderImage === void 0 ? void 0 : renderImage(), /*#__PURE__*/React.createElement(Flex, {
|
|
21
|
-
direction: "column",
|
|
22
|
-
alignItems: "center",
|
|
23
|
-
gap: "space.200"
|
|
24
|
-
}, /*#__PURE__*/React.createElement(Heading, {
|
|
25
|
-
size: "medium",
|
|
26
|
-
as: "h2"
|
|
27
|
-
}, header), description && /*#__PURE__*/React.createElement(Text, {
|
|
28
|
-
as: "p",
|
|
29
|
-
color: "color.text"
|
|
30
|
-
}, description)));
|
|
31
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["minHeight"];
|
|
5
|
-
/**
|
|
6
|
-
* @jsxRuntime classic
|
|
7
|
-
* @jsx jsx
|
|
8
|
-
*/
|
|
9
|
-
import React, { forwardRef } from 'react';
|
|
10
|
-
|
|
11
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
|
-
import { jsx } from '@emotion/react';
|
|
13
|
-
import { minHeightComponentStyles } from './styled';
|
|
14
|
-
export var MinHeightContainerOld = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
15
|
-
var minHeight = _ref.minHeight,
|
|
16
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
-
return jsx("div", _extends({
|
|
18
|
-
ref: ref
|
|
19
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
20
|
-
,
|
|
21
|
-
css: minHeightComponentStyles
|
|
22
|
-
}, props, {
|
|
23
|
-
style: _defineProperty({}, '--link-picker-min-height', minHeight)
|
|
24
|
-
}));
|
|
25
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
-
|
|
4
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
5
|
-
export var minHeightComponentStyles = css({
|
|
6
|
-
display: 'flex',
|
|
7
|
-
alignItems: 'stretch',
|
|
8
|
-
justifyContent: 'center',
|
|
9
|
-
minHeight: 'var(--link-picker-min-height)'
|
|
10
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
-
import { css, jsx } from '@emotion/react';
|
|
7
|
-
import { defineMessages, useIntl } from 'react-intl-next';
|
|
8
|
-
import { LINK_PICKER_MIN_HEIGHT_IN_PX_FALLBACK } from '../../../../common/constants';
|
|
9
|
-
import { GenericErrorSVG } from '../../../../common/generic-error-svg';
|
|
10
|
-
import { EmptyState } from '../../../../common/ui/empty-state';
|
|
11
|
-
import { MinHeightContainer } from '../../../../common/ui/min-height-container';
|
|
12
|
-
var errorBoundaryFallbackStyles = css({
|
|
13
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
14
|
-
lineHeight: 'initial'
|
|
15
|
-
});
|
|
16
|
-
var messages = defineMessages({
|
|
17
|
-
heading: {
|
|
18
|
-
defaultMessage: 'Something went wrong!',
|
|
19
|
-
description: 'Heading displayed when an unhandled error occurs.',
|
|
20
|
-
id: 'fabric.linkPicker.unhandledError.heading'
|
|
21
|
-
},
|
|
22
|
-
description: {
|
|
23
|
-
defaultMessage: 'Try reloading the page.',
|
|
24
|
-
description: 'Body message shown underneath the heading when an unhandled error occurs.',
|
|
25
|
-
id: 'fabric.linkPicker.unhandledError.description'
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
export var ErrorBoundaryFallbackOld = function ErrorBoundaryFallbackOld() {
|
|
29
|
-
var intl = useIntl();
|
|
30
|
-
var header = intl.formatMessage(messages.heading);
|
|
31
|
-
var description = intl.formatMessage(messages.description);
|
|
32
|
-
return jsx(MinHeightContainer, {
|
|
33
|
-
css: errorBoundaryFallbackStyles,
|
|
34
|
-
minHeight: LINK_PICKER_MIN_HEIGHT_IN_PX_FALLBACK,
|
|
35
|
-
"data-testid": "link-picker-root-error-boundary-ui"
|
|
36
|
-
}, jsx(EmptyState, {
|
|
37
|
-
header: header,
|
|
38
|
-
renderImage: function renderImage() {
|
|
39
|
-
return jsx(GenericErrorSVG, null);
|
|
40
|
-
},
|
|
41
|
-
description: description
|
|
42
|
-
}));
|
|
43
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["isLoading", "isSubmitting", "error", "url", "queryState", "items", "isEditing", "onCancel", "action", "customSubmitButtonLabel", "submitMessageId", "hideSubmitButton"];
|
|
4
|
-
/* eslint-disable @atlassian/tangerine/import/no-parent-imports */
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @jsxRuntime classic
|
|
8
|
-
* @jsx jsx
|
|
9
|
-
*/
|
|
10
|
-
import { memo } from 'react';
|
|
11
|
-
|
|
12
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
|
-
import { css, jsx } from '@emotion/react';
|
|
14
|
-
import { defineMessages, useIntl } from 'react-intl-next';
|
|
15
|
-
import Button, { ButtonGroup } from '@atlaskit/button';
|
|
16
|
-
import EditorAddIconLegacy from '@atlaskit/icon/glyph/editor/add';
|
|
17
|
-
import EditorAddIcon from '@atlaskit/icon/utility/add';
|
|
18
|
-
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
19
|
-
import { UnauthenticatedError } from '../../../../common/utils/errors';
|
|
20
|
-
import { LinkPickerSubmitButton } from '../link-picker-submit-button';
|
|
21
|
-
var formFooterStyles = css({
|
|
22
|
-
display: 'flex',
|
|
23
|
-
justifyContent: 'flex-end'
|
|
24
|
-
});
|
|
25
|
-
var formFooterActionStyles = css({
|
|
26
|
-
marginRight: 'auto'
|
|
27
|
-
});
|
|
28
|
-
export var messages = defineMessages({
|
|
29
|
-
cancelButton: {
|
|
30
|
-
id: 'fabric.linkPicker.button.cancel',
|
|
31
|
-
defaultMessage: 'Cancel',
|
|
32
|
-
description: 'Button to cancel and dismiss the link picker'
|
|
33
|
-
},
|
|
34
|
-
submittingStatusMessage: {
|
|
35
|
-
id: 'fabric.linkPicker.status.submitting',
|
|
36
|
-
defaultMessage: 'Submitting',
|
|
37
|
-
description: 'Accessibility text to indicate the form has been submitted, and submission is in-progress'
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
export var testIds = {
|
|
41
|
-
insertButton: 'link-picker-insert-button',
|
|
42
|
-
cancelButton: 'link-picker-cancel-button',
|
|
43
|
-
actionButton: 'link-picker-action-button',
|
|
44
|
-
submitStatusA11yIndicator: 'link-picker-submit-status-a11y-indicator',
|
|
45
|
-
/** Feature discovery for action button (css pulse) */
|
|
46
|
-
actionButtonDiscovery: 'link-picker-action-button-discovery'
|
|
47
|
-
};
|
|
48
|
-
export var FormFooterOld = /*#__PURE__*/memo(function (_ref) {
|
|
49
|
-
var isLoading = _ref.isLoading,
|
|
50
|
-
_ref$isSubmitting = _ref.isSubmitting,
|
|
51
|
-
isSubmitting = _ref$isSubmitting === void 0 ? false : _ref$isSubmitting,
|
|
52
|
-
error = _ref.error,
|
|
53
|
-
url = _ref.url,
|
|
54
|
-
queryState = _ref.queryState,
|
|
55
|
-
items = _ref.items,
|
|
56
|
-
isEditing = _ref.isEditing,
|
|
57
|
-
onCancel = _ref.onCancel,
|
|
58
|
-
action = _ref.action,
|
|
59
|
-
customSubmitButtonLabel = _ref.customSubmitButtonLabel,
|
|
60
|
-
submitMessageId = _ref.submitMessageId,
|
|
61
|
-
hideSubmitButton = _ref.hideSubmitButton,
|
|
62
|
-
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
63
|
-
var intl = useIntl();
|
|
64
|
-
if (error && error instanceof UnauthenticatedError) {
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
var createButton = function createButton(pluginAction) {
|
|
68
|
-
return jsx(Button, {
|
|
69
|
-
testId: testIds.actionButton,
|
|
70
|
-
onClick: pluginAction.callback,
|
|
71
|
-
appearance: "default",
|
|
72
|
-
iconBefore: jsx(EditorAddIcon, {
|
|
73
|
-
label: "",
|
|
74
|
-
LEGACY_size: "medium",
|
|
75
|
-
LEGACY_fallbackIcon: EditorAddIconLegacy,
|
|
76
|
-
color: "currentColor"
|
|
77
|
-
}),
|
|
78
|
-
isDisabled: isSubmitting,
|
|
79
|
-
"aria-labelledby": isSubmitting ? submitMessageId : undefined
|
|
80
|
-
}, typeof pluginAction.label === 'string' ? pluginAction.label : intl.formatMessage(pluginAction.label));
|
|
81
|
-
};
|
|
82
|
-
return jsx("footer", _extends({
|
|
83
|
-
css: formFooterStyles
|
|
84
|
-
}, restProps), isSubmitting && jsx(VisuallyHidden, {
|
|
85
|
-
role: "status",
|
|
86
|
-
id: submitMessageId,
|
|
87
|
-
testId: testIds.submitStatusA11yIndicator
|
|
88
|
-
}, intl.formatMessage(messages.submittingStatusMessage)), action && jsx("div", {
|
|
89
|
-
css: formFooterActionStyles
|
|
90
|
-
}, createButton(action)), jsx(ButtonGroup, null, onCancel && jsx(Button, {
|
|
91
|
-
appearance: "subtle",
|
|
92
|
-
onClick: onCancel,
|
|
93
|
-
testId: testIds.cancelButton,
|
|
94
|
-
isDisabled: isSubmitting,
|
|
95
|
-
"aria-labelledby": isSubmitting ? submitMessageId : undefined
|
|
96
|
-
}, intl.formatMessage(messages.cancelButton)), !hideSubmitButton && jsx(LinkPickerSubmitButton, {
|
|
97
|
-
isEditing: isEditing,
|
|
98
|
-
isLoading: isLoading,
|
|
99
|
-
isSubmitting: isSubmitting,
|
|
100
|
-
customSubmitButtonLabel: customSubmitButtonLabel,
|
|
101
|
-
error: error,
|
|
102
|
-
items: items,
|
|
103
|
-
queryState: queryState,
|
|
104
|
-
submitMessageId: submitMessageId,
|
|
105
|
-
testId: testIds.insertButton,
|
|
106
|
-
url: url
|
|
107
|
-
})));
|
|
108
|
-
});
|