@olenbetong/synergi-react 2.5.7 → 2.7.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/es/components/AppMenu/AppMenu.css +455 -92
- package/es/components/AppMenu/AppMenu.d.ts +47 -0
- package/es/components/AppMenu/AppMenu.js +223 -0
- package/es/components/AppMenu/AppMenuToggle.d.ts +15 -0
- package/es/components/AppMenu/AppMenuToggle.js +14 -0
- package/es/components/AppMenu/AppMenuUserMenu.d.ts +32 -0
- package/es/components/AppMenu/AppMenuUserMenu.js +110 -0
- package/es/components/AppMenu/developerCategories.d.ts +24 -0
- package/es/components/AppMenu/developerCategories.js +116 -0
- package/es/components/AppMenu/index.d.ts +6 -12
- package/es/components/AppMenu/index.js +5 -85
- package/es/components/AppMenu/types.d.ts +33 -0
- package/es/components/AppMenu/types.js +1 -0
- package/es/components/AppMenu/useRovingTabIndex.d.ts +24 -0
- package/es/components/AppMenu/useRovingTabIndex.js +103 -0
- package/es/components/AppMenu/useServiceWorkerUpdate.d.ts +16 -0
- package/es/components/AppMenu/useServiceWorkerUpdate.js +62 -0
- package/es/components/AppShell/index.js +107 -13
- package/es/components/ImageEditor/ImageEditor.css +22 -11
- package/es/components/ImageEditor/ImageEditor.js +12 -12
- package/es/components/ImageEditor/ResponsiveButton.d.ts +1 -1
- package/es/components/ImageEditor/ResponsiveButton.js +5 -5
- package/es/components/ImageEditor/plugins/cropPlugin/CropOverlay.js +2 -2
- package/es/components/ImageEditor/plugins/cropPlugin/CropToolbar.js +3 -4
- package/es/components/ImageEditor/plugins/cropPlugin/index.js +2 -2
- package/es/components/ImageEditor/plugins/redactPlugin/RedactToolbar.js +3 -5
- package/es/components/ImageEditor/plugins/redactPlugin/index.js +2 -2
- package/es/components/ImageEditor/plugins/rotatePlugin.js +1 -2
- package/es/components/ImageEditor/plugins/zoomPlugin/ZoomControls.js +2 -4
- package/es/components/ImageEditor/useIsSmall.d.ts +5 -0
- package/es/components/ImageEditor/useIsSmall.js +21 -0
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/package.json +5 -1
- package/src/colorScheme.ts +81 -0
- package/src/components/AppMenu/AppMenu.css +648 -158
- package/src/components/AppMenu/AppMenu.tsx +285 -0
- package/src/components/AppMenu/AppMenuColorScheme.tsx +41 -0
- package/src/components/AppMenu/AppMenuFavoriteButton.tsx +47 -0
- package/src/components/AppMenu/AppMenuHeader.tsx +79 -0
- package/src/components/AppMenu/AppMenuList.tsx +89 -0
- package/src/components/AppMenu/AppMenuRail.tsx +117 -0
- package/src/components/AppMenu/AppMenuToggle.tsx +51 -0
- package/src/components/AppMenu/AppMenuUserMenu.tsx +190 -0
- package/src/components/AppMenu/developerCategories.ts +142 -0
- package/src/components/AppMenu/icons.tsx +76 -0
- package/src/components/AppMenu/index.ts +17 -0
- package/src/components/AppMenu/menuEntries.ts +128 -0
- package/src/components/AppMenu/types.ts +45 -0
- package/src/components/AppMenu/useFavorites.ts +40 -0
- package/src/components/AppMenu/useRovingTabIndex.ts +130 -0
- package/src/components/AppMenu/useServiceWorkerUpdate.ts +68 -0
- package/src/components/AppShell/index.tsx +287 -133
- package/src/components/ImageEditor/ImageEditor.css +22 -11
- package/src/components/ImageEditor/ImageEditor.tsx +38 -40
- package/src/components/ImageEditor/ResponsiveButton.tsx +8 -10
- package/src/components/ImageEditor/plugins/cropPlugin/CropOverlay.tsx +6 -6
- package/src/components/ImageEditor/plugins/cropPlugin/CropToolbar.tsx +6 -10
- package/src/components/ImageEditor/plugins/cropPlugin/index.ts +2 -2
- package/src/components/ImageEditor/plugins/redactPlugin/RedactToolbar.tsx +8 -17
- package/src/components/ImageEditor/plugins/redactPlugin/index.ts +2 -2
- package/src/components/ImageEditor/plugins/rotatePlugin.ts +1 -2
- package/src/components/ImageEditor/plugins/zoomPlugin/ZoomControls.tsx +4 -6
- package/src/components/ImageEditor/useIsSmall.ts +27 -0
- package/src/components/LinkedCardList/index.scss +93 -93
- package/src/components/ProgressBar/index.scss +94 -94
- package/src/index.ts +61 -37
- package/src/components/AppMenu/index.tsx +0 -179
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
@use "../../styles/variables";
|
|
2
|
-
|
|
3
|
-
$bullet-size: 0.7em;
|
|
4
|
-
$line-width: 0.2em;
|
|
5
|
-
|
|
6
|
-
:root {
|
|
7
|
-
--ob-linked-list-bullet-size: 0.7em;
|
|
8
|
-
--ob-linked-list-line-width: 0.2em;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.ObLinkedList-root {
|
|
12
|
-
|
|
13
|
-
list-style-type: none;
|
|
14
|
-
margin-left: 0;
|
|
15
|
-
padding-left: 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.ObLinkedList-item {
|
|
19
|
-
display: flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
flex-direction: row;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.ObLinkedList-leftColumn {
|
|
25
|
-
flex: 1 1 4em;
|
|
26
|
-
font-size: 0.75em;
|
|
27
|
-
padding: 0 1em;
|
|
28
|
-
text-align: center;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.ObLinkedList-rightColumn {
|
|
32
|
-
flex: 1 1 100%;
|
|
33
|
-
padding: 1em 1em 1em 1.5em;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.ObLinkedList-line {
|
|
37
|
-
display: flex;
|
|
38
|
-
align-self: stretch;
|
|
39
|
-
flex: 0 0 $line-width;
|
|
40
|
-
background: white;
|
|
41
|
-
position: relative;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.ObLinkedList-bullet {
|
|
45
|
-
background: white;
|
|
46
|
-
|
|
47
|
-
border: 1px solid rgba(50, 50, 50, 0.25);
|
|
48
|
-
border-radius: 0.55em;
|
|
49
|
-
height: $bullet-size;
|
|
50
|
-
width: $bullet-size;
|
|
51
|
-
|
|
52
|
-
position: absolute;
|
|
53
|
-
left: 0;
|
|
54
|
-
top: 50%;
|
|
55
|
-
|
|
56
|
-
transform: translate(calc(-1 * (var(--ob-linked-list-bullet-size) / 2) + (var(--ob-linked-list-line-width) / 2)), -50%);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.ObLinkedList-card {
|
|
60
|
-
display: block;
|
|
61
|
-
background: white;
|
|
62
|
-
border: 1px solid;
|
|
63
|
-
border-color: variables.$color-border-top variables.$color-border-side variables.$color-border-bottom;
|
|
64
|
-
border-radius: 0.1875em;
|
|
65
|
-
color: inherit;
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
flex: 100% 1 1;
|
|
68
|
-
position: relative;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.ObLinkedList-card::before {
|
|
72
|
-
border-bottom: 0.5em solid transparent;
|
|
73
|
-
border-right: 1em solid white;
|
|
74
|
-
border-top: 0.5em solid transparent;
|
|
75
|
-
content: " ";
|
|
76
|
-
filter: drop-shadow(-1px 0px 1px rgba(50, 50, 50, 0.2));
|
|
77
|
-
height: 1em;
|
|
78
|
-
left: -1em;
|
|
79
|
-
margin-top: -0.5em;
|
|
80
|
-
position: absolute;
|
|
81
|
-
top: 50%;
|
|
82
|
-
width: 1em;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.ObLinkedList-card:hover {
|
|
86
|
-
background-color: variables.$block-color-bg-hover !important;
|
|
87
|
-
color: inherit;
|
|
88
|
-
text-decoration: inherit;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.ObLinkedList-card:hover::before {
|
|
92
|
-
border-right-color: variables.$block-color-bg-hover !important;
|
|
93
|
-
}
|
|
1
|
+
@use "../../styles/variables";
|
|
2
|
+
|
|
3
|
+
$bullet-size: 0.7em;
|
|
4
|
+
$line-width: 0.2em;
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
--ob-linked-list-bullet-size: 0.7em;
|
|
8
|
+
--ob-linked-list-line-width: 0.2em;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ObLinkedList-root {
|
|
12
|
+
|
|
13
|
+
list-style-type: none;
|
|
14
|
+
margin-left: 0;
|
|
15
|
+
padding-left: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ObLinkedList-item {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
flex-direction: row;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ObLinkedList-leftColumn {
|
|
25
|
+
flex: 1 1 4em;
|
|
26
|
+
font-size: 0.75em;
|
|
27
|
+
padding: 0 1em;
|
|
28
|
+
text-align: center;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ObLinkedList-rightColumn {
|
|
32
|
+
flex: 1 1 100%;
|
|
33
|
+
padding: 1em 1em 1em 1.5em;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ObLinkedList-line {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-self: stretch;
|
|
39
|
+
flex: 0 0 $line-width;
|
|
40
|
+
background: white;
|
|
41
|
+
position: relative;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ObLinkedList-bullet {
|
|
45
|
+
background: white;
|
|
46
|
+
|
|
47
|
+
border: 1px solid rgba(50, 50, 50, 0.25);
|
|
48
|
+
border-radius: 0.55em;
|
|
49
|
+
height: $bullet-size;
|
|
50
|
+
width: $bullet-size;
|
|
51
|
+
|
|
52
|
+
position: absolute;
|
|
53
|
+
left: 0;
|
|
54
|
+
top: 50%;
|
|
55
|
+
|
|
56
|
+
transform: translate(calc(-1 * (var(--ob-linked-list-bullet-size) / 2) + (var(--ob-linked-list-line-width) / 2)), -50%);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ObLinkedList-card {
|
|
60
|
+
display: block;
|
|
61
|
+
background: white;
|
|
62
|
+
border: 1px solid;
|
|
63
|
+
border-color: variables.$color-border-top variables.$color-border-side variables.$color-border-bottom;
|
|
64
|
+
border-radius: 0.1875em;
|
|
65
|
+
color: inherit;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
flex: 100% 1 1;
|
|
68
|
+
position: relative;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ObLinkedList-card::before {
|
|
72
|
+
border-bottom: 0.5em solid transparent;
|
|
73
|
+
border-right: 1em solid white;
|
|
74
|
+
border-top: 0.5em solid transparent;
|
|
75
|
+
content: " ";
|
|
76
|
+
filter: drop-shadow(-1px 0px 1px rgba(50, 50, 50, 0.2));
|
|
77
|
+
height: 1em;
|
|
78
|
+
left: -1em;
|
|
79
|
+
margin-top: -0.5em;
|
|
80
|
+
position: absolute;
|
|
81
|
+
top: 50%;
|
|
82
|
+
width: 1em;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ObLinkedList-card:hover {
|
|
86
|
+
background-color: variables.$block-color-bg-hover !important;
|
|
87
|
+
color: inherit;
|
|
88
|
+
text-decoration: inherit;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.ObLinkedList-card:hover::before {
|
|
92
|
+
border-right-color: variables.$block-color-bg-hover !important;
|
|
93
|
+
}
|
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
@use "../../styles/variables";
|
|
2
|
-
|
|
3
|
-
.ObProgressBar-root {
|
|
4
|
-
height: 1.5em;
|
|
5
|
-
width: 100%;
|
|
6
|
-
appearance: none;
|
|
7
|
-
-webkit-appearance: none;
|
|
8
|
-
background-color: whiteSmoke;
|
|
9
|
-
border: none;
|
|
10
|
-
border-radius: 3px;
|
|
11
|
-
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2) inset;
|
|
12
|
-
color: royalblue;
|
|
13
|
-
position: relative;
|
|
14
|
-
|
|
15
|
-
&::-webkit-progress-bar {
|
|
16
|
-
background-color: whiteSmoke;
|
|
17
|
-
border-radius: 3px;
|
|
18
|
-
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2) inset;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&::-webkit-progress-value {
|
|
22
|
-
background-image: linear-gradient(
|
|
23
|
-
135deg,
|
|
24
|
-
transparent,
|
|
25
|
-
transparent 33%,
|
|
26
|
-
rgba(0, 0, 0, 0.1) 33%,
|
|
27
|
-
rgba(0, 0, 0, 0.1) 66%,
|
|
28
|
-
transparent 66%
|
|
29
|
-
),
|
|
30
|
-
linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
31
|
-
linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
32
|
-
background-image:
|
|
33
|
-
-webkit-linear-gradient(
|
|
34
|
-
135deg,
|
|
35
|
-
transparent,
|
|
36
|
-
transparent 33%,
|
|
37
|
-
rgba(0, 0, 0, 0.1) 33%,
|
|
38
|
-
rgba(0, 0, 0, 0.1) 66%,
|
|
39
|
-
transparent 66%
|
|
40
|
-
),
|
|
41
|
-
-webkit-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
42
|
-
-webkit-linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
43
|
-
background-size:
|
|
44
|
-
35px 20px,
|
|
45
|
-
100% 100%,
|
|
46
|
-
100% 100%;
|
|
47
|
-
border-radius: 3px;
|
|
48
|
-
position: relative;
|
|
49
|
-
transition: width 0.5s ease-out;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&::-webkit-progress-value:after {
|
|
53
|
-
background-color: white;
|
|
54
|
-
content: "";
|
|
55
|
-
|
|
56
|
-
border-radius: 100%;
|
|
57
|
-
height: 5px;
|
|
58
|
-
|
|
59
|
-
position: absolute;
|
|
60
|
-
right: 7px;
|
|
61
|
-
top: 7px;
|
|
62
|
-
width: 5px;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&::-moz-progress-bar {
|
|
66
|
-
background-image: linear-gradient(
|
|
67
|
-
135deg,
|
|
68
|
-
transparent,
|
|
69
|
-
transparent 33%,
|
|
70
|
-
rgba(0, 0, 0, 0.1) 33%,
|
|
71
|
-
rgba(0, 0, 0, 0.1) 66%,
|
|
72
|
-
transparent 66%
|
|
73
|
-
),
|
|
74
|
-
linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
75
|
-
linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
76
|
-
background-image:
|
|
77
|
-
-moz-linear-gradient(
|
|
78
|
-
135deg,
|
|
79
|
-
transparent,
|
|
80
|
-
transparent 33%,
|
|
81
|
-
rgba(0, 0, 0, 0.1) 33%,
|
|
82
|
-
rgba(0, 0, 0, 0.1) 66%,
|
|
83
|
-
transparent 66%
|
|
84
|
-
),
|
|
85
|
-
-moz-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
86
|
-
-moz-linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
87
|
-
background-size:
|
|
88
|
-
35px 20px,
|
|
89
|
-
100% 100%,
|
|
90
|
-
100% 100%;
|
|
91
|
-
border-radius: 3px;
|
|
92
|
-
transition: width 0.5s ease-out;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
1
|
+
@use "../../styles/variables";
|
|
2
|
+
|
|
3
|
+
.ObProgressBar-root {
|
|
4
|
+
height: 1.5em;
|
|
5
|
+
width: 100%;
|
|
6
|
+
appearance: none;
|
|
7
|
+
-webkit-appearance: none;
|
|
8
|
+
background-color: whiteSmoke;
|
|
9
|
+
border: none;
|
|
10
|
+
border-radius: 3px;
|
|
11
|
+
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2) inset;
|
|
12
|
+
color: royalblue;
|
|
13
|
+
position: relative;
|
|
14
|
+
|
|
15
|
+
&::-webkit-progress-bar {
|
|
16
|
+
background-color: whiteSmoke;
|
|
17
|
+
border-radius: 3px;
|
|
18
|
+
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2) inset;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&::-webkit-progress-value {
|
|
22
|
+
background-image: linear-gradient(
|
|
23
|
+
135deg,
|
|
24
|
+
transparent,
|
|
25
|
+
transparent 33%,
|
|
26
|
+
rgba(0, 0, 0, 0.1) 33%,
|
|
27
|
+
rgba(0, 0, 0, 0.1) 66%,
|
|
28
|
+
transparent 66%
|
|
29
|
+
),
|
|
30
|
+
linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
31
|
+
linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
32
|
+
background-image:
|
|
33
|
+
-webkit-linear-gradient(
|
|
34
|
+
135deg,
|
|
35
|
+
transparent,
|
|
36
|
+
transparent 33%,
|
|
37
|
+
rgba(0, 0, 0, 0.1) 33%,
|
|
38
|
+
rgba(0, 0, 0, 0.1) 66%,
|
|
39
|
+
transparent 66%
|
|
40
|
+
),
|
|
41
|
+
-webkit-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
42
|
+
-webkit-linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
43
|
+
background-size:
|
|
44
|
+
35px 20px,
|
|
45
|
+
100% 100%,
|
|
46
|
+
100% 100%;
|
|
47
|
+
border-radius: 3px;
|
|
48
|
+
position: relative;
|
|
49
|
+
transition: width 0.5s ease-out;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&::-webkit-progress-value:after {
|
|
53
|
+
background-color: white;
|
|
54
|
+
content: "";
|
|
55
|
+
|
|
56
|
+
border-radius: 100%;
|
|
57
|
+
height: 5px;
|
|
58
|
+
|
|
59
|
+
position: absolute;
|
|
60
|
+
right: 7px;
|
|
61
|
+
top: 7px;
|
|
62
|
+
width: 5px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&::-moz-progress-bar {
|
|
66
|
+
background-image: linear-gradient(
|
|
67
|
+
135deg,
|
|
68
|
+
transparent,
|
|
69
|
+
transparent 33%,
|
|
70
|
+
rgba(0, 0, 0, 0.1) 33%,
|
|
71
|
+
rgba(0, 0, 0, 0.1) 66%,
|
|
72
|
+
transparent 66%
|
|
73
|
+
),
|
|
74
|
+
linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
75
|
+
linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
76
|
+
background-image:
|
|
77
|
+
-moz-linear-gradient(
|
|
78
|
+
135deg,
|
|
79
|
+
transparent,
|
|
80
|
+
transparent 33%,
|
|
81
|
+
rgba(0, 0, 0, 0.1) 33%,
|
|
82
|
+
rgba(0, 0, 0, 0.1) 66%,
|
|
83
|
+
transparent 66%
|
|
84
|
+
),
|
|
85
|
+
-moz-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
86
|
+
-moz-linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
87
|
+
background-size:
|
|
88
|
+
35px 20px,
|
|
89
|
+
100% 100%,
|
|
90
|
+
100% 100%;
|
|
91
|
+
border-radius: 3px;
|
|
92
|
+
transition: width 0.5s ease-out;
|
|
93
|
+
}
|
|
94
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,37 +1,61 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
export {
|
|
2
|
+
AppMenu,
|
|
3
|
+
type AppMenuArticle,
|
|
4
|
+
type AppMenuCategory,
|
|
5
|
+
AppMenuColorScheme,
|
|
6
|
+
type AppMenuLink,
|
|
7
|
+
type AppMenuLinkGroup,
|
|
8
|
+
type AppMenuProps,
|
|
9
|
+
AppMenuToggle,
|
|
10
|
+
type AppMenuToggleProps,
|
|
11
|
+
type AppMenuUser,
|
|
12
|
+
AppMenuUserMenu,
|
|
13
|
+
type AppMenuUserMenuProps,
|
|
14
|
+
createDeveloperCategories,
|
|
15
|
+
defaultUserMenuItems,
|
|
16
|
+
type DeveloperCategoryOptions,
|
|
17
|
+
useServiceWorkerUpdate,
|
|
18
|
+
} from "./components/AppMenu/index.js";
|
|
19
|
+
export { AppShell, type AppShellProps } from "./components/AppShell/index.js";
|
|
20
|
+
export { Checkbox, type CheckboxProps } from "./components/Checkbox/index.js";
|
|
21
|
+
export {
|
|
22
|
+
COLOR_SCHEME_CHANGE_EVENT,
|
|
23
|
+
type ColorSchemePreference,
|
|
24
|
+
getColorSchemePreference,
|
|
25
|
+
setColorSchemePreference,
|
|
26
|
+
useColorSchemePreference,
|
|
27
|
+
} from "./colorScheme.js";
|
|
28
|
+
export { CardColumn, CardDetail, CardLabel, CardStep, CardStepList, ColorCard } from "./components/ColorCard/index.js";
|
|
29
|
+
export { DateNavigator } from "./components/DateNavigator/index.js";
|
|
30
|
+
export * from "./components/FilePond.js";
|
|
31
|
+
export * from "./components/ImageEditor/index.js";
|
|
32
|
+
export { Card, LinkedList, LinkedListItem } from "./components/LinkedCardList/index.js";
|
|
33
|
+
export { MergeProgressDialog, type MergeProgressDialogProps } from "./components/MergeProgressDialog/index.js";
|
|
34
|
+
export {
|
|
35
|
+
BannerImage as PageBannerImage,
|
|
36
|
+
type BannerImageProps,
|
|
37
|
+
PageBanner,
|
|
38
|
+
type PageBannerProps,
|
|
39
|
+
Tab as PageBannerTab,
|
|
40
|
+
TabList as PageBannerTabList,
|
|
41
|
+
type TabListProps as PageBannerTabListProps,
|
|
42
|
+
type TabProps as PageBannerTabProps,
|
|
43
|
+
Title as PageBannerTitle,
|
|
44
|
+
type TitleProps as PageBannerTitleProps,
|
|
45
|
+
} from "./components/PageBanner/index.js";
|
|
46
|
+
export * from "./components/PdfViewer/index.js";
|
|
47
|
+
export { Portal } from "./components/Portal/index.js";
|
|
48
|
+
export {
|
|
49
|
+
ToolbarBreadcrumbs,
|
|
50
|
+
ToolbarPortal,
|
|
51
|
+
type BreadcrumbItem,
|
|
52
|
+
type ToolbarBreadcrumbsProps,
|
|
53
|
+
type ToolbarPortalProps,
|
|
54
|
+
type ToolbarPortalSlot,
|
|
55
|
+
} from "./components/Toolbar/index.js";
|
|
56
|
+
export { ProgressBar } from "./components/ProgressBar/index.js";
|
|
57
|
+
export { Sidebar, type SidebarProps } from "./components/Sidebar/index.js";
|
|
58
|
+
export { Spinner, type SpinnerProps } from "./components/Spinner/index.js";
|
|
59
|
+
export { SplitContainer, type SplitContainerProps } from "./components/SplitContainer/index.js";
|
|
60
|
+
export { ValueToggleGroup, type ValueToggleGroupProps } from "./components/ValueToggleGroup/index.js";
|
|
61
|
+
export { useTranslation } from "./useTranslation/index.js";
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import "./AppMenu.css";
|
|
2
|
-
|
|
3
|
-
import type { DataObject } from "@olenbetong/appframe-data";
|
|
4
|
-
import { useData, useLoading } from "@olenbetong/appframe-react";
|
|
5
|
-
import { useEffect, useMemo, useRef, useState } from "react";
|
|
6
|
-
|
|
7
|
-
export type AppMenuArticle = {
|
|
8
|
-
ArticleId: string;
|
|
9
|
-
Title: string | null;
|
|
10
|
-
MenuGroup: string | null;
|
|
11
|
-
Path: string | null;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/** Strip version suffixes from ArticleId for building hrefs. */
|
|
15
|
-
function stripVersionSuffix(articleId: string): string {
|
|
16
|
-
if (articleId.length > 9 && articleId[articleId.length - 8] === ".") {
|
|
17
|
-
return articleId.slice(0, -8);
|
|
18
|
-
}
|
|
19
|
-
if (articleId.length > 5 && articleId[articleId.length - 4] === ".") {
|
|
20
|
-
return articleId.slice(0, -4);
|
|
21
|
-
}
|
|
22
|
-
return articleId;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** Group records by MenuGroup, returning an ordered list of [group, items] pairs. */
|
|
26
|
-
function groupByMenuGroup<T extends { MenuGroup: string | null; Title: string | null }>(
|
|
27
|
-
items: readonly T[],
|
|
28
|
-
): [string, T[]][] {
|
|
29
|
-
let map = new Map<string, T[]>();
|
|
30
|
-
for (let item of items) {
|
|
31
|
-
let key = item.MenuGroup ?? "";
|
|
32
|
-
let list = map.get(key);
|
|
33
|
-
if (!list) {
|
|
34
|
-
list = [];
|
|
35
|
-
map.set(key, list);
|
|
36
|
-
}
|
|
37
|
-
list.push(item);
|
|
38
|
-
}
|
|
39
|
-
return [...map.entries()];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export type AppMenuProps = {
|
|
43
|
-
dataObject: DataObject<AppMenuArticle>;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export function AppMenu({ dataObject }: AppMenuProps) {
|
|
47
|
-
let dialogRef = useRef<HTMLDialogElement>(null);
|
|
48
|
-
let searchRef = useRef<HTMLInputElement>(null);
|
|
49
|
-
let [search, setSearch] = useState("");
|
|
50
|
-
let [isOpen, setIsOpen] = useState(false);
|
|
51
|
-
|
|
52
|
-
let isLoading = useLoading(dataObject);
|
|
53
|
-
let allArticles = useData<AppMenuArticle>(dataObject);
|
|
54
|
-
|
|
55
|
-
// Refresh data when opened for the first time
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
if (isOpen && allArticles.length === 0 && !isLoading) {
|
|
58
|
-
dataObject.refreshDataSource();
|
|
59
|
-
}
|
|
60
|
-
}, [isOpen, allArticles.length, isLoading, dataObject]);
|
|
61
|
-
|
|
62
|
-
let filtered = useMemo(() => {
|
|
63
|
-
if (!search.trim()) return allArticles;
|
|
64
|
-
let lower = search.toLowerCase();
|
|
65
|
-
return allArticles.filter((a) => (a.Title ?? "").toLowerCase().includes(lower));
|
|
66
|
-
}, [allArticles, search]);
|
|
67
|
-
|
|
68
|
-
let groups = useMemo(() => groupByMenuGroup(filtered), [filtered]);
|
|
69
|
-
|
|
70
|
-
function openDialog() {
|
|
71
|
-
let dialog = dialogRef.current;
|
|
72
|
-
if (!dialog) return;
|
|
73
|
-
setIsOpen(true);
|
|
74
|
-
dialog.showModal();
|
|
75
|
-
// Focus search after dialog opens
|
|
76
|
-
requestAnimationFrame(() => searchRef.current?.focus());
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function closeDialog() {
|
|
80
|
-
let dialog = dialogRef.current;
|
|
81
|
-
if (!dialog) return;
|
|
82
|
-
setSearch("");
|
|
83
|
-
setIsOpen(false);
|
|
84
|
-
dialog.close();
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function handleBackdropClick(e: React.MouseEvent<HTMLDialogElement>) {
|
|
88
|
-
// Close when clicking outside the dialog content (on the backdrop)
|
|
89
|
-
let rect = dialogRef.current?.getBoundingClientRect();
|
|
90
|
-
if (!rect) return;
|
|
91
|
-
let { clientX, clientY } = e;
|
|
92
|
-
if (clientX < rect.left || clientX > rect.right || clientY < rect.top || clientY > rect.bottom) {
|
|
93
|
-
closeDialog();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Native <dialog> handles Escape automatically — just sync state
|
|
98
|
-
function handleCancel() {
|
|
99
|
-
setSearch("");
|
|
100
|
-
setIsOpen(false);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return (
|
|
104
|
-
<>
|
|
105
|
-
<button
|
|
106
|
-
type="button"
|
|
107
|
-
className="app-menu-trigger"
|
|
108
|
-
aria-label="Open app menu"
|
|
109
|
-
aria-haspopup="dialog"
|
|
110
|
-
aria-expanded={isOpen}
|
|
111
|
-
onClick={openDialog}
|
|
112
|
-
>
|
|
113
|
-
<svg
|
|
114
|
-
className="app-menu-icon"
|
|
115
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
116
|
-
viewBox="0 0 24 24"
|
|
117
|
-
fill="currentColor"
|
|
118
|
-
aria-hidden="true"
|
|
119
|
-
focusable="false"
|
|
120
|
-
width="24"
|
|
121
|
-
height="24"
|
|
122
|
-
>
|
|
123
|
-
<path d="M4 6h4V4H4v2zm0 5h4V9H4v2zm0 5h4v-2H4v2zM10 4v2h10V4H10zm0 7h10V9H10v2zm0 5h10v-2H10v2z" />
|
|
124
|
-
</svg>
|
|
125
|
-
</button>
|
|
126
|
-
|
|
127
|
-
{/* oxlint-disable-next-line jsx-a11y/click-events-have-key-events -- backdrop click handled via mouse coords */}
|
|
128
|
-
<dialog
|
|
129
|
-
ref={dialogRef}
|
|
130
|
-
className="app-menu-dialog"
|
|
131
|
-
aria-label="App menu"
|
|
132
|
-
onClick={handleBackdropClick}
|
|
133
|
-
onCancel={handleCancel}
|
|
134
|
-
>
|
|
135
|
-
<div className="app-menu-dialog-inner">
|
|
136
|
-
<div className="app-menu-search-row">
|
|
137
|
-
<label htmlFor="app-menu-search" className="visually-hidden">
|
|
138
|
-
Search apps
|
|
139
|
-
</label>
|
|
140
|
-
<input
|
|
141
|
-
ref={searchRef}
|
|
142
|
-
id="app-menu-search"
|
|
143
|
-
type="search"
|
|
144
|
-
className="app-menu-search"
|
|
145
|
-
placeholder="Search apps…"
|
|
146
|
-
value={search}
|
|
147
|
-
onChange={(e) => setSearch(e.target.value)}
|
|
148
|
-
autoComplete="off"
|
|
149
|
-
/>
|
|
150
|
-
</div>
|
|
151
|
-
|
|
152
|
-
{isLoading && <p className="app-menu-loading">Loading…</p>}
|
|
153
|
-
|
|
154
|
-
{!isLoading && groups.length === 0 && <p className="app-menu-empty">No apps found.</p>}
|
|
155
|
-
|
|
156
|
-
<div className="app-menu-groups">
|
|
157
|
-
{groups.map(([group, items]) => (
|
|
158
|
-
<section key={group} className="app-menu-group">
|
|
159
|
-
{group && <h2 className="app-menu-group-title">{group}</h2>}
|
|
160
|
-
<ul className="app-menu-list">
|
|
161
|
-
{items.map((article) => {
|
|
162
|
-
let href = `/${stripVersionSuffix(article.ArticleId)}`;
|
|
163
|
-
return (
|
|
164
|
-
<li key={article.ArticleId} className="app-menu-item">
|
|
165
|
-
<a href={href} className="app-menu-link" onClick={closeDialog}>
|
|
166
|
-
{article.Title ?? article.ArticleId}
|
|
167
|
-
</a>
|
|
168
|
-
</li>
|
|
169
|
-
);
|
|
170
|
-
})}
|
|
171
|
-
</ul>
|
|
172
|
-
</section>
|
|
173
|
-
))}
|
|
174
|
-
</div>
|
|
175
|
-
</div>
|
|
176
|
-
</dialog>
|
|
177
|
-
</>
|
|
178
|
-
);
|
|
179
|
-
}
|