@scm-manager/ui-components 2.27.3-20211114-175217 → 2.27.3
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/BranchSelector.tsx +2 -2
- package/src/CardColumnGroup.tsx +2 -2
- package/src/DateFromNow.tsx +1 -2
- package/src/DateShort.tsx +1 -2
- package/src/ErrorBoundary.tsx +2 -2
- package/src/Icon.tsx +3 -3
- 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 +1623 -613
- package/src/buttons/Button.tsx +34 -33
- package/src/forms/FilterInput.tsx +0 -1
- package/src/forms/InputField.tsx +2 -2
- package/src/forms/Select.tsx +4 -4
- 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/Modal.tsx +1 -1
- package/src/navigation/RoutingProps.ts +1 -3
- package/src/navigation/SecondaryNavigation.stories.tsx +3 -3
- package/src/navigation/SecondaryNavigation.tsx +1 -1
- package/src/repos/DiffFile.tsx +15 -21
- 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/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/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 -67
- 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
|
|
3
|
+
"version": "2.27.3",
|
|
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.3
|
|
28
|
+
"@scm-manager/ui-tests": "^2.27.3",
|
|
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.3
|
|
69
|
-
"@scm-manager/ui-extensions": "^2.27.3
|
|
70
|
-
"@scm-manager/ui-types": "^2.27.3
|
|
70
|
+
"@scm-manager/ui-api": "^2.27.3",
|
|
71
|
+
"@scm-manager/ui-extensions": "^2.27.3",
|
|
72
|
+
"@scm-manager/ui-types": "^2.27.3",
|
|
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/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/CardColumnGroup.tsx
CHANGED
|
@@ -84,7 +84,7 @@ 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>{" "}
|
|
@@ -95,7 +95,7 @@ class CardColumnGroup extends React.Component<Props, State> {
|
|
|
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/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
|
@@ -46,14 +46,14 @@ const Icon: FC<Props> = ({
|
|
|
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}
|
|
@@ -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]}</>;
|