@scm-manager/ui-components 2.27.3-20211117-144126 → 2.27.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -7
- package/src/Autocomplete.tsx +6 -7
- package/src/BranchSelector.tsx +2 -2
- package/src/Breadcrumb.tsx +0 -1
- package/src/CardColumnGroup.tsx +6 -6
- package/src/DangerZone.tsx +0 -1
- package/src/DateFromNow.tsx +1 -2
- package/src/DateShort.tsx +1 -2
- package/src/ErrorBoundary.tsx +2 -2
- package/src/Icon.tsx +4 -4
- package/src/Logo.stories.tsx +0 -1
- package/src/OverviewPageActions.tsx +2 -2
- package/src/SplitAndReplace.tsx +2 -3
- package/src/SyntaxHighlighter.stories.tsx +1 -1
- package/src/Tooltip.tsx +1 -1
- package/src/__snapshots__/storyshots.test.ts.snap +2086 -1068
- package/src/buttons/Button.tsx +34 -33
- package/src/forms/FileInput.tsx +1 -1
- package/src/forms/FileUpload.tsx +1 -1
- package/src/forms/FilterInput.tsx +0 -1
- package/src/forms/InputField.tsx +2 -2
- package/src/forms/Select.tsx +4 -4
- package/src/forms/TriStateCheckbox.tsx +2 -2
- package/src/index.ts +3 -4
- package/src/languages.test.ts +5 -1
- package/src/languages.ts +10 -1
- package/src/layout/Footer.tsx +1 -1
- package/src/layout/Header.tsx +2 -2
- package/src/layout/index.ts +1 -2
- package/src/modals/FullscreenModal.tsx +1 -1
- package/src/modals/Modal.tsx +6 -6
- package/src/navigation/RoutingProps.ts +1 -3
- package/src/navigation/SecondaryNavigation.stories.tsx +3 -3
- package/src/navigation/SecondaryNavigation.tsx +1 -1
- package/src/popover/Popover.tsx +7 -7
- package/src/repos/DiffFile.tsx +15 -21
- package/src/repos/HealthCheckFailureDetail.tsx +2 -2
- package/src/repos/RepositoryEntry.tsx +6 -9
- package/src/repos/RepositoryFlags.tsx +2 -2
- package/src/repos/TokenizedDiffView.tsx +2 -20
- package/src/repos/annotate/Annotate.stories.tsx +1 -1
- package/src/repos/annotate/AnnotateLine.tsx +0 -1
- package/src/repos/index.ts +0 -2
- package/src/repos/refractorAdapter.ts +6 -11
- package/src/search/HighlightedFragment.tsx +4 -7
- package/src/search/TextHitField.tsx +18 -34
- package/src/styleConstants.ts +1 -2
- package/src/syntax-highlighting.module.css +1 -1
- package/src/SmallLoadingSpinner.stories.tsx +0 -32
- package/src/SmallLoadingSpinner.tsx +0 -34
- package/src/__resources__/ContentSearchHit.ts +0 -73
- package/src/layout/SubSubtitle.tsx +0 -41
- package/src/search/SyntaxHighlightedFragment.tsx +0 -130
- package/src/search/TextHitField.stories.tsx +0 -54
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scm-manager/ui-components",
|
|
3
|
-
"version": "2.27.
|
|
3
|
+
"version": "2.27.4",
|
|
4
4
|
"description": "UI Components for SCM-Manager and its plugins",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@scm-manager/jest-preset": "^2.13.0",
|
|
26
26
|
"@scm-manager/prettier-config": "^2.10.1",
|
|
27
27
|
"@scm-manager/tsconfig": "^2.12.0",
|
|
28
|
-
"@scm-manager/ui-tests": "^2.27.
|
|
28
|
+
"@scm-manager/ui-tests": "^2.27.4",
|
|
29
29
|
"@storybook/addon-actions": "^6.3.12",
|
|
30
30
|
"@storybook/addon-storyshots": "^6.3.12",
|
|
31
31
|
"@storybook/builder-webpack5": "^6.3.12",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@types/fetch-mock": "^7.3.1",
|
|
38
38
|
"@types/jest": "^24.0.19",
|
|
39
39
|
"@types/lowlight": "^0.0.0",
|
|
40
|
+
"@types/query-string": "5",
|
|
40
41
|
"@types/react": "^17.0.1",
|
|
41
42
|
"@types/react-dom": "^17.0.1",
|
|
42
43
|
"@types/react-router-dom": "^5.1.0",
|
|
@@ -60,21 +61,22 @@
|
|
|
60
61
|
"sass-loader": "^12.3.0",
|
|
61
62
|
"storybook-addon-i18next": "^1.3.0",
|
|
62
63
|
"storybook-addon-themes": "^6.1.0",
|
|
64
|
+
"tabbable": "^5.2.1",
|
|
63
65
|
"to-camel-case": "^1.0.0",
|
|
64
66
|
"webpack": "^5.61.0",
|
|
65
67
|
"worker-plugin": "^3.2.0"
|
|
66
68
|
},
|
|
67
69
|
"dependencies": {
|
|
68
|
-
"@scm-manager/ui-api": "^2.27.
|
|
69
|
-
"@scm-manager/ui-extensions": "^2.27.
|
|
70
|
-
"@scm-manager/ui-types": "^2.27.
|
|
70
|
+
"@scm-manager/ui-api": "^2.27.4",
|
|
71
|
+
"@scm-manager/ui-extensions": "^2.27.4",
|
|
72
|
+
"@scm-manager/ui-types": "^2.27.4",
|
|
71
73
|
"classnames": "^2.2.6",
|
|
72
74
|
"date-fns": "^2.4.1",
|
|
73
75
|
"deepmerge": "^4.2.2",
|
|
74
76
|
"hast-util-sanitize": "^3.0.2",
|
|
75
77
|
"lowlight": "^1.13.0",
|
|
76
78
|
"prism-themes": "^1.4.0",
|
|
77
|
-
"query-string": "
|
|
79
|
+
"query-string": "5",
|
|
78
80
|
"react": "^17.0.1",
|
|
79
81
|
"react-diff-view": "^2.4.1",
|
|
80
82
|
"react-dom": "^17.0.1",
|
|
@@ -91,7 +93,6 @@
|
|
|
91
93
|
"remark-gfm": "^1.0.0",
|
|
92
94
|
"remark-parse": "^9.0.0",
|
|
93
95
|
"remark-rehype": "^8.0.0",
|
|
94
|
-
"tabbable": "^5.2.1",
|
|
95
96
|
"unified": "^9.2.1"
|
|
96
97
|
},
|
|
97
98
|
"babel": {
|
package/src/Autocomplete.tsx
CHANGED
|
@@ -47,7 +47,7 @@ class Autocomplete extends React.Component<Props, State> {
|
|
|
47
47
|
static defaultProps = {
|
|
48
48
|
placeholder: "Type here",
|
|
49
49
|
loadingMessage: "Loading...",
|
|
50
|
-
noOptionsMessage: "No suggestion available"
|
|
50
|
+
noOptionsMessage: "No suggestion available",
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
handleInputChange = (newValue: ValueType<SelectValue>, action: ActionMeta) => {
|
|
@@ -64,7 +64,7 @@ class Autocomplete extends React.Component<Props, State> {
|
|
|
64
64
|
selectValue: ValueType<SelectValue>,
|
|
65
65
|
selectOptions: readonly SelectValue[]
|
|
66
66
|
): boolean => {
|
|
67
|
-
const isNotDuplicated = !selectOptions.map(option => option.label).includes(inputValue);
|
|
67
|
+
const isNotDuplicated = !selectOptions.map((option) => option.label).includes(inputValue);
|
|
68
68
|
const isNotEmpty = inputValue !== "";
|
|
69
69
|
return isNotEmpty && isNotDuplicated;
|
|
70
70
|
};
|
|
@@ -79,7 +79,7 @@ class Autocomplete extends React.Component<Props, State> {
|
|
|
79
79
|
noOptionsMessage,
|
|
80
80
|
loadSuggestions,
|
|
81
81
|
creatable,
|
|
82
|
-
className
|
|
82
|
+
className,
|
|
83
83
|
} = this.props;
|
|
84
84
|
|
|
85
85
|
return (
|
|
@@ -88,7 +88,6 @@ class Autocomplete extends React.Component<Props, State> {
|
|
|
88
88
|
<div className="control">
|
|
89
89
|
{creatable ? (
|
|
90
90
|
<AsyncCreatable
|
|
91
|
-
className="autocomplete-entry"
|
|
92
91
|
cacheOptions
|
|
93
92
|
loadOptions={loadSuggestions}
|
|
94
93
|
onChange={this.handleInputChange}
|
|
@@ -97,13 +96,13 @@ class Autocomplete extends React.Component<Props, State> {
|
|
|
97
96
|
loadingMessage={() => loadingMessage}
|
|
98
97
|
noOptionsMessage={() => noOptionsMessage}
|
|
99
98
|
isValidNewOption={this.isValidNewOption}
|
|
100
|
-
onCreateOption={value => {
|
|
99
|
+
onCreateOption={(value) => {
|
|
101
100
|
this.selectValue({
|
|
102
101
|
label: value,
|
|
103
102
|
value: {
|
|
104
103
|
id: value,
|
|
105
|
-
displayName: value
|
|
106
|
-
}
|
|
104
|
+
displayName: value,
|
|
105
|
+
},
|
|
107
106
|
});
|
|
108
107
|
}}
|
|
109
108
|
aria-label={helpText || label}
|
package/src/BranchSelector.tsx
CHANGED
|
@@ -61,8 +61,8 @@ const BranchSelector: FC<Props> = ({ branches, onSelectBranch, selectedBranch, l
|
|
|
61
61
|
<MinWidthControl className="control">
|
|
62
62
|
<Select
|
|
63
63
|
className="is-fullwidth"
|
|
64
|
-
options={branches.map(b => ({ label: b.name, value: b.name }))}
|
|
65
|
-
onChange={branch => onSelectBranch(branches.filter(b => b.name === branch)[0])}
|
|
64
|
+
options={branches.map((b) => ({ label: b.name, value: b.name }))}
|
|
65
|
+
onChange={(branch) => onSelectBranch(branches.filter((b) => b.name === branch)[0])}
|
|
66
66
|
disabled={!!disabled}
|
|
67
67
|
value={selectedBranch}
|
|
68
68
|
addValueToOptions={true}
|
package/src/Breadcrumb.tsx
CHANGED
package/src/CardColumnGroup.tsx
CHANGED
|
@@ -41,13 +41,13 @@ class CardColumnGroup extends React.Component<Props, State> {
|
|
|
41
41
|
constructor(props: Props) {
|
|
42
42
|
super(props);
|
|
43
43
|
this.state = {
|
|
44
|
-
collapsed: false
|
|
44
|
+
collapsed: false,
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
toggleCollapse = () => {
|
|
49
|
-
this.setState(prevState => ({
|
|
50
|
-
collapsed: !prevState.collapsed
|
|
49
|
+
this.setState((prevState) => ({
|
|
50
|
+
collapsed: !prevState.collapsed,
|
|
51
51
|
}));
|
|
52
52
|
};
|
|
53
53
|
|
|
@@ -84,18 +84,18 @@ class CardColumnGroup extends React.Component<Props, State> {
|
|
|
84
84
|
|
|
85
85
|
return (
|
|
86
86
|
<div className="mb-4">
|
|
87
|
-
<
|
|
87
|
+
<h2>
|
|
88
88
|
<span className={classNames("is-size-4", "is-clickable")} onClick={this.toggleCollapse}>
|
|
89
89
|
{icon}
|
|
90
90
|
</span>{" "}
|
|
91
91
|
{url ? (
|
|
92
|
-
<Link to={url} className="has-text-
|
|
92
|
+
<Link to={url} className="has-text-dark">
|
|
93
93
|
{name}
|
|
94
94
|
</Link>
|
|
95
95
|
) : (
|
|
96
96
|
name
|
|
97
97
|
)}
|
|
98
|
-
</
|
|
98
|
+
</h2>
|
|
99
99
|
<hr />
|
|
100
100
|
<div className={classNames("columns", "card-columns", "is-multiline", "mx-3", "my-0")}>{content}</div>
|
|
101
101
|
<div className="is-clearfix" />
|
package/src/DangerZone.tsx
CHANGED
package/src/DateFromNow.tsx
CHANGED
|
@@ -36,9 +36,8 @@ const DateFromNow: FC<Props> = ({ className, ...dateProps }) => {
|
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const dateTime = formatter.formatFull();
|
|
40
39
|
return (
|
|
41
|
-
<DateElement className={className}
|
|
40
|
+
<DateElement className={className} title={formatter.formatFull()}>
|
|
42
41
|
{formatter.formatDistance()}
|
|
43
42
|
</DateElement>
|
|
44
43
|
);
|
package/src/DateShort.tsx
CHANGED
|
@@ -36,9 +36,8 @@ const DateShort: FC<Props> = ({ className, ...dateProps }) => {
|
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const dateTime = formatter.formatFull();
|
|
40
39
|
return (
|
|
41
|
-
<DateElement className={className}
|
|
40
|
+
<DateElement className={className} title={formatter.formatFull()}>
|
|
42
41
|
{formatter.formatShort()}
|
|
43
42
|
</DateElement>
|
|
44
43
|
);
|
package/src/ErrorBoundary.tsx
CHANGED
|
@@ -113,7 +113,7 @@ const ErrorDisplay: FC<ErrorDisplayProps> = ({ error, errorInfo, fallback: Fallb
|
|
|
113
113
|
|
|
114
114
|
const fallbackProps = {
|
|
115
115
|
error,
|
|
116
|
-
errorInfo
|
|
116
|
+
errorInfo,
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
return <FallbackComponent {...fallbackProps} />;
|
|
@@ -135,7 +135,7 @@ class ErrorBoundary extends React.Component<Props, State> {
|
|
|
135
135
|
componentDidCatch(error: Error, errorInfo: ErrorInfo) {
|
|
136
136
|
this.setState({
|
|
137
137
|
error,
|
|
138
|
-
errorInfo
|
|
138
|
+
errorInfo,
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
|
package/src/Icon.tsx
CHANGED
|
@@ -40,20 +40,20 @@ type Props = {
|
|
|
40
40
|
|
|
41
41
|
const Icon: FC<Props> = ({
|
|
42
42
|
iconStyle = "fas",
|
|
43
|
-
color = "
|
|
43
|
+
color = "grey-light",
|
|
44
44
|
title,
|
|
45
45
|
name,
|
|
46
46
|
className,
|
|
47
47
|
onClick,
|
|
48
48
|
testId,
|
|
49
|
-
tabIndex,
|
|
49
|
+
tabIndex = -1,
|
|
50
50
|
onEnter,
|
|
51
|
-
alt = title
|
|
51
|
+
alt = title,
|
|
52
52
|
}) => {
|
|
53
53
|
return (
|
|
54
54
|
<i
|
|
55
55
|
onClick={onClick}
|
|
56
|
-
onKeyPress={event => event.key === "Enter" && onEnter && onEnter(event)}
|
|
56
|
+
onKeyPress={(event) => event.key === "Enter" && onEnter && onEnter(event)}
|
|
57
57
|
title={title}
|
|
58
58
|
className={classNames(iconStyle, "fa-fw", "fa-" + name, `has-text-${color}`, className)}
|
|
59
59
|
tabIndex={tabIndex}
|
package/src/Logo.stories.tsx
CHANGED
|
@@ -52,7 +52,7 @@ const OverviewPageActions: FC<Props> = ({
|
|
|
52
52
|
groupSelected,
|
|
53
53
|
label,
|
|
54
54
|
testId,
|
|
55
|
-
searchPlaceholder
|
|
55
|
+
searchPlaceholder,
|
|
56
56
|
}) => {
|
|
57
57
|
const history = useHistory();
|
|
58
58
|
const location = useLocation();
|
|
@@ -63,7 +63,7 @@ const OverviewPageActions: FC<Props> = ({
|
|
|
63
63
|
<div className="column is-flex">
|
|
64
64
|
<Select
|
|
65
65
|
className="is-fullwidth"
|
|
66
|
-
options={groups.map(g => ({ value: g, label: g }))}
|
|
66
|
+
options={groups.map((g) => ({ value: g, label: g }))}
|
|
67
67
|
value={currentGroup}
|
|
68
68
|
onChange={groupSelected}
|
|
69
69
|
/>
|
package/src/SplitAndReplace.tsx
CHANGED
|
@@ -33,10 +33,9 @@ export type Replacement = {
|
|
|
33
33
|
type Props = {
|
|
34
34
|
text: string;
|
|
35
35
|
replacements: Replacement[];
|
|
36
|
-
textWrapper?: (s: string) => ReactNode;
|
|
37
36
|
};
|
|
38
37
|
|
|
39
|
-
const
|
|
38
|
+
const textWrapper = (s: string) => {
|
|
40
39
|
const first = s.startsWith(" ") ? <> </> : "";
|
|
41
40
|
const last = s.endsWith(" ") ? <> </> : "";
|
|
42
41
|
return (
|
|
@@ -48,7 +47,7 @@ const defaultTextWrapper = (s: string) => {
|
|
|
48
47
|
);
|
|
49
48
|
};
|
|
50
49
|
|
|
51
|
-
const SplitAndReplace: FC<Props> = ({ text, replacements
|
|
50
|
+
const SplitAndReplace: FC<Props> = ({ text, replacements }) => {
|
|
52
51
|
const parts = textSplitAndReplace<ReactNode>(text, replacements, textWrapper);
|
|
53
52
|
if (parts.length === 0) {
|
|
54
53
|
return <>{parts[0]}</>;
|