@scm-manager/ui-components 3.7.5 → 3.8.1-20250315-094507
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 +14 -13
- package/src/Breadcrumb.tsx +30 -11
- package/src/Duration.stories.tsx +18 -0
- package/src/__snapshots__/storyshots.test.ts.snap +484 -363
- package/src/buttons/Button.tsx +1 -1
- package/src/forms/InputField.tsx +4 -0
- package/src/layout/SecondaryNavigationColumn.tsx +10 -1
- package/src/navigation/ExternalNavLink.tsx +2 -4
- package/src/navigation/NavLink.tsx +5 -11
- package/src/navigation/SecondaryNavigation.stories.tsx +7 -4
- package/src/navigation/SecondaryNavigation.tsx +3 -12
- package/src/navigation/SecondaryNavigationContext.tsx +37 -0
- package/src/repos/LayoutRadioButtons.tsx +2 -2
- package/src/repos/LoadingDiff.tsx +17 -16
- package/src/repos/RepositoryEntry.tsx +4 -3
- package/src/repos/changesets/ChangesetButtonGroup.test.tsx +72 -0
- package/src/repos/changesets/ChangesetButtonGroup.tsx +19 -22
- package/src/repos/changesets/ChangesetList.tsx +6 -3
- package/src/repos/changesets/ChangesetRow.tsx +5 -3
- package/src/repos/changesets/changesets.test.ts +62 -2
- package/src/repos/changesets/changesets.ts +12 -2
- package/src/repos/diff/DiffFileTree.tsx +82 -40
- package/src/repos/diff/styledElements.tsx +47 -14
- package/src/useSecondaryNavigation.tsx +11 -17
- package/src/navigation/SecondaryNavigationContext.ts +0 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scm-manager/ui-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.1-20250315-094507",
|
|
4
4
|
"description": "UI Components for SCM-Manager and its plugins",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"react-query": "^3.39.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@scm-manager/ui-tests": "3.
|
|
36
|
-
"@scm-manager/ui-types": "3.
|
|
35
|
+
"@scm-manager/ui-tests": "3.8.1-20250315-094507",
|
|
36
|
+
"@scm-manager/ui-types": "3.8.1-20250315-094507",
|
|
37
37
|
"@types/fetch-mock": "^7.3.1",
|
|
38
38
|
"@types/react-select": "^2.0.19",
|
|
39
39
|
"@types/unist": "^2.0.3",
|
|
40
40
|
"gitdiff-parser": "^0.2.2",
|
|
41
41
|
"i18next-fetch-backend": "4",
|
|
42
|
-
"webpack": "^5.
|
|
42
|
+
"webpack": "^5.76.0",
|
|
43
43
|
"@storybook/addon-actions": "^6.5.10",
|
|
44
44
|
"@storybook/addon-essentials": "^6.5.10",
|
|
45
45
|
"@storybook/addon-interactions": "^6.5.10",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"@storybook/builder-webpack5": "^6.5.10",
|
|
48
48
|
"@storybook/manager-webpack5": "^6.5.10",
|
|
49
49
|
"@storybook/react": "^6.5.10",
|
|
50
|
+
"@testing-library/react": "^12.1.5",
|
|
50
51
|
"storybook-addon-i18next": "^1.3.0",
|
|
51
52
|
"storybook-addon-themes": "^6.1.0",
|
|
52
53
|
"@types/classnames": "^2.3.1",
|
|
@@ -67,17 +68,17 @@
|
|
|
67
68
|
"@scm-manager/jest-preset": "^2.14.1",
|
|
68
69
|
"@scm-manager/prettier-config": "^2.12.0",
|
|
69
70
|
"@scm-manager/tsconfig": "^2.13.0",
|
|
70
|
-
"@scm-manager/ui-syntaxhighlighting": "3.
|
|
71
|
-
"@scm-manager/ui-shortcuts": "3.
|
|
72
|
-
"@scm-manager/ui-text": "3.
|
|
71
|
+
"@scm-manager/ui-syntaxhighlighting": "3.8.1-20250315-094507",
|
|
72
|
+
"@scm-manager/ui-shortcuts": "3.8.1-20250315-094507",
|
|
73
|
+
"@scm-manager/ui-text": "3.8.1-20250315-094507"
|
|
73
74
|
},
|
|
74
75
|
"dependencies": {
|
|
75
|
-
"@scm-manager/ui-core": "3.
|
|
76
|
-
"@scm-manager/ui-overlays": "3.
|
|
77
|
-
"@scm-manager/ui-layout": "3.
|
|
78
|
-
"@scm-manager/ui-buttons": "3.
|
|
79
|
-
"@scm-manager/ui-api": "3.
|
|
80
|
-
"@scm-manager/ui-extensions": "3.
|
|
76
|
+
"@scm-manager/ui-core": "3.8.1-20250315-094507",
|
|
77
|
+
"@scm-manager/ui-overlays": "3.8.1-20250315-094507",
|
|
78
|
+
"@scm-manager/ui-layout": "3.8.1-20250315-094507",
|
|
79
|
+
"@scm-manager/ui-buttons": "3.8.1-20250315-094507",
|
|
80
|
+
"@scm-manager/ui-api": "3.8.1-20250315-094507",
|
|
81
|
+
"@scm-manager/ui-extensions": "3.8.1-20250315-094507",
|
|
81
82
|
"deepmerge": "^4.2.2",
|
|
82
83
|
"hast-util-sanitize": "^3.0.2",
|
|
83
84
|
"react-diff-view": "^2.4.10",
|
package/src/Breadcrumb.tsx
CHANGED
|
@@ -22,10 +22,9 @@ import styled from "styled-components";
|
|
|
22
22
|
import { urls } from "@scm-manager/ui-api";
|
|
23
23
|
import { Branch, File, Repository } from "@scm-manager/ui-types";
|
|
24
24
|
import { binder, ExtensionPoint, extensionPoints } from "@scm-manager/ui-extensions";
|
|
25
|
-
import Icon from "./Icon";
|
|
26
|
-
import Tooltip from "./Tooltip";
|
|
27
25
|
import copyToClipboard from "./CopyToClipboard";
|
|
28
26
|
import { devices } from "./devices";
|
|
27
|
+
import { Icon, Tooltip } from "@scm-manager/ui-core";
|
|
29
28
|
|
|
30
29
|
type Props = {
|
|
31
30
|
repository: Repository;
|
|
@@ -110,7 +109,7 @@ const BreadcrumbNode: FC<{ clickable: boolean; text: string; url: string; curren
|
|
|
110
109
|
clickable,
|
|
111
110
|
text,
|
|
112
111
|
url,
|
|
113
|
-
current
|
|
112
|
+
current,
|
|
114
113
|
}) => {
|
|
115
114
|
if (clickable) {
|
|
116
115
|
return (
|
|
@@ -137,7 +136,7 @@ const Breadcrumb: FC<Props> = ({
|
|
|
137
136
|
sources,
|
|
138
137
|
permalink,
|
|
139
138
|
preButtons,
|
|
140
|
-
clickable = true
|
|
139
|
+
clickable = true,
|
|
141
140
|
}) => {
|
|
142
141
|
const location = useLocation();
|
|
143
142
|
const history = useHistory();
|
|
@@ -212,24 +211,44 @@ const Breadcrumb: FC<Props> = ({
|
|
|
212
211
|
aria-label="breadcrumbs"
|
|
213
212
|
>
|
|
214
213
|
{prefixButtons}
|
|
215
|
-
<ul>
|
|
214
|
+
<ul aria-label={t("breadcrumb.currentPath")}>
|
|
216
215
|
<li>
|
|
217
216
|
{clickable ? (
|
|
218
217
|
<Link to={homeUrl} aria-label={t("breadcrumb.home")}>
|
|
219
|
-
<HomeIcon
|
|
218
|
+
<HomeIcon type="has-text-inherit fas">home</HomeIcon>
|
|
220
219
|
</Link>
|
|
221
220
|
) : (
|
|
222
|
-
<Icon
|
|
221
|
+
<Icon className="mr-3">home</Icon>
|
|
223
222
|
)}
|
|
224
223
|
</li>
|
|
225
224
|
{pathSection()}
|
|
226
225
|
</ul>
|
|
227
|
-
<PermaLinkWrapper
|
|
226
|
+
<PermaLinkWrapper className="icon">
|
|
228
227
|
{copying ? (
|
|
229
|
-
<Icon
|
|
228
|
+
<Icon
|
|
229
|
+
className="icon focus-zone has-cursor-pointer"
|
|
230
|
+
type="has-text-inherit fas"
|
|
231
|
+
tabIndex={0}
|
|
232
|
+
aria-hidden="false"
|
|
233
|
+
aria-label={t("breadcrumb.loading")}
|
|
234
|
+
alt={t("breadcrumb.loading")}
|
|
235
|
+
>
|
|
236
|
+
spinner fa-spin
|
|
237
|
+
</Icon>
|
|
230
238
|
) : (
|
|
231
239
|
<Tooltip message={t("breadcrumb.copyPermalink")}>
|
|
232
|
-
<Icon
|
|
240
|
+
<Icon
|
|
241
|
+
className="focus-zone has-cursor-pointer"
|
|
242
|
+
type="has-text-inherit fas"
|
|
243
|
+
tabIndex={0}
|
|
244
|
+
aria-hidden="false"
|
|
245
|
+
aria-label={t("breadcrumb.copyPermalink")}
|
|
246
|
+
alt={t("breadcrumb.copyPermalink")}
|
|
247
|
+
onClick={() => copySource()}
|
|
248
|
+
onKeyDown={(e) => e.key === "Enter" && copySource()}
|
|
249
|
+
>
|
|
250
|
+
link
|
|
251
|
+
</Icon>
|
|
233
252
|
</Tooltip>
|
|
234
253
|
)}
|
|
235
254
|
</PermaLinkWrapper>
|
|
@@ -243,7 +262,7 @@ const Breadcrumb: FC<Props> = ({
|
|
|
243
262
|
branch: branch ? branch : defaultBranch,
|
|
244
263
|
path,
|
|
245
264
|
sources,
|
|
246
|
-
repository
|
|
265
|
+
repository,
|
|
247
266
|
};
|
|
248
267
|
|
|
249
268
|
const renderExtensionPoints = () => {
|
package/src/Duration.stories.tsx
CHANGED
|
@@ -20,21 +20,39 @@ import React from "react";
|
|
|
20
20
|
|
|
21
21
|
storiesOf("Duration", module).add("Duration", () => (
|
|
22
22
|
<div className="m-5 p-5">
|
|
23
|
+
<p>
|
|
24
|
+
<Duration duration={1} />
|
|
25
|
+
</p>
|
|
23
26
|
<p>
|
|
24
27
|
<Duration duration={500} />
|
|
25
28
|
</p>
|
|
29
|
+
<p>
|
|
30
|
+
<Duration duration={1000 + 1} />
|
|
31
|
+
</p>
|
|
26
32
|
<p>
|
|
27
33
|
<Duration duration={2000} />
|
|
28
34
|
</p>
|
|
35
|
+
<p>
|
|
36
|
+
<Duration duration={1000 * 60 + 1} />
|
|
37
|
+
</p>
|
|
29
38
|
<p>
|
|
30
39
|
<Duration duration={42 * 1000 * 60} />
|
|
31
40
|
</p>
|
|
41
|
+
<p>
|
|
42
|
+
<Duration duration={1000 * 60 * 60 + 1} />
|
|
43
|
+
</p>
|
|
32
44
|
<p>
|
|
33
45
|
<Duration duration={21 * 1000 * 60 * 60} />
|
|
34
46
|
</p>
|
|
47
|
+
<p>
|
|
48
|
+
<Duration duration={1000 * 60 * 60 * 24 + 1} />
|
|
49
|
+
</p>
|
|
35
50
|
<p>
|
|
36
51
|
<Duration duration={5 * 1000 * 60 * 60 * 24} />
|
|
37
52
|
</p>
|
|
53
|
+
<p>
|
|
54
|
+
<Duration duration={1000 * 60 * 60 * 24 * 7 + 1} />
|
|
55
|
+
</p>
|
|
38
56
|
<p>
|
|
39
57
|
<Duration duration={3 * 1000 * 60 * 60 * 24 * 7} />
|
|
40
58
|
</p>
|