@pareto-engineering/design-system 4.0.0-alpha.70 → 4.0.0-alpha.73
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/dist/cjs/{c/ContentSlides/common/Slide/Slide.js → a/LexicalPreview/LexicalPreview.js} +43 -28
- package/dist/cjs/{c/ContentSlides/common/Sidebar → a/LexicalPreview}/index.js +3 -3
- package/dist/cjs/a/LexicalPreview/styles.scss +46 -0
- package/dist/cjs/a/People/common/Person/Person.js +7 -2
- package/dist/cjs/a/ProgressBar/ProgressBar.js +3 -2
- package/dist/cjs/a/ProgressBar/styles.scss +11 -1
- package/dist/cjs/a/XMLEditor/XMLEditor.js +14 -6
- package/dist/cjs/a/index.js +8 -1
- package/dist/cjs/b/ExpandableLexicalPreview/ExpandableLexicalPreview.js +125 -0
- package/dist/cjs/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +112 -0
- package/dist/cjs/{c/ContentSlides/common/Navigator → b/ExpandableLexicalPreview/common/ExpandButton}/index.js +3 -3
- package/dist/cjs/b/ExpandableLexicalPreview/common/index.js +12 -0
- package/dist/cjs/b/ExpandableLexicalPreview/index.js +13 -0
- package/dist/cjs/b/ExpandableLexicalPreview/styles.scss +84 -0
- package/dist/cjs/b/index.js +8 -1
- package/dist/cjs/c/index.js +0 -13
- package/dist/cjs/f/fields/EditorInput/EditorInput.js +14 -3
- package/dist/cjs/f/fields/EditorInput/common/StopPropagationPlugin.js +30 -0
- package/dist/cjs/f/fields/EditorInput/common/index.js +7 -0
- package/dist/cjs/index.js +0 -11
- package/dist/es/a/LexicalPreview/LexicalPreview.js +80 -0
- package/dist/es/a/LexicalPreview/index.js +2 -0
- package/dist/es/a/LexicalPreview/styles.scss +46 -0
- package/dist/es/a/People/common/Person/Person.js +22 -15
- package/dist/es/a/ProgressBar/ProgressBar.js +3 -2
- package/dist/es/a/ProgressBar/styles.scss +11 -1
- package/dist/es/a/XMLEditor/XMLEditor.js +16 -10
- package/dist/es/a/index.js +2 -1
- package/dist/es/b/ExpandableLexicalPreview/ExpandableLexicalPreview.js +115 -0
- package/dist/es/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +102 -0
- package/dist/es/b/ExpandableLexicalPreview/common/ExpandButton/index.js +1 -0
- package/dist/es/b/ExpandableLexicalPreview/common/index.js +1 -0
- package/dist/es/b/ExpandableLexicalPreview/index.js +2 -0
- package/dist/es/b/ExpandableLexicalPreview/styles.scss +84 -0
- package/dist/es/b/index.js +2 -1
- package/dist/es/c/index.js +0 -1
- package/dist/es/f/fields/EditorInput/EditorInput.js +15 -4
- package/dist/es/f/fields/EditorInput/common/StopPropagationPlugin.js +23 -0
- package/dist/es/f/fields/EditorInput/common/index.js +2 -1
- package/dist/es/index.js +0 -1
- package/package.json +5 -5
- package/src/stories/a/LexicalPreview.stories.jsx +28 -0
- package/src/stories/a/ProgressBar.stories.jsx +1 -1
- package/src/stories/b/ExpandableLexicalPreview.stories.jsx +29 -0
- package/src/stories/colors.js +4 -0
- package/src/ui/a/LexicalPreview/LexicalPreview.jsx +109 -0
- package/src/ui/a/LexicalPreview/index.js +2 -0
- package/src/ui/a/LexicalPreview/styles.scss +46 -0
- package/src/ui/a/People/common/Person/Person.jsx +31 -19
- package/src/ui/a/ProgressBar/ProgressBar.jsx +2 -0
- package/src/ui/a/ProgressBar/styles.scss +11 -1
- package/src/ui/a/XMLEditor/XMLEditor.jsx +16 -5
- package/src/ui/a/index.js +1 -0
- package/src/ui/b/ExpandableLexicalPreview/ExpandableLexicalPreview.jsx +157 -0
- package/src/ui/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.jsx +123 -0
- package/src/ui/b/ExpandableLexicalPreview/common/ExpandButton/index.js +1 -0
- package/src/ui/b/ExpandableLexicalPreview/common/index.js +1 -0
- package/src/ui/b/ExpandableLexicalPreview/index.js +2 -0
- package/src/ui/b/ExpandableLexicalPreview/styles.scss +84 -0
- package/src/ui/b/index.js +1 -0
- package/src/ui/c/index.js +0 -1
- package/src/ui/f/fields/EditorInput/EditorInput.jsx +16 -2
- package/src/ui/f/fields/EditorInput/common/StopPropagationPlugin.jsx +29 -0
- package/src/ui/f/fields/EditorInput/common/index.jsx +1 -0
- package/src/ui/index.js +0 -1
- package/tests/__snapshots__/Storyshots.test.js.snap +1249 -641
- package/dist/cjs/c/ContentSlides/ContentSlides.js +0 -172
- package/dist/cjs/c/ContentSlides/Context.js +0 -10
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +0 -126
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/index.js +0 -13
- package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +0 -128
- package/dist/cjs/c/ContentSlides/common/Sidebar/Sidebar.js +0 -94
- package/dist/cjs/c/ContentSlides/common/Slide/index.js +0 -13
- package/dist/cjs/c/ContentSlides/common/index.js +0 -33
- package/dist/cjs/c/ContentSlides/index.js +0 -27
- package/dist/cjs/c/ContentSlides/styles.scss +0 -312
- package/dist/cjs/c/ContentSlides/useContentSlides.js +0 -11
- package/dist/cjs/r/SwitchRouteMap/SwitchRouteMap.js +0 -58
- package/dist/cjs/r/SwitchRouteMap/index.js +0 -13
- package/dist/cjs/r/common/PrivateRoute/PrivateRoute.js +0 -74
- package/dist/cjs/r/common/PrivateRoute/index.js +0 -13
- package/dist/cjs/r/common/index.js +0 -12
- package/dist/cjs/r/index.js +0 -27
- package/dist/es/c/ContentSlides/ContentSlides.js +0 -160
- package/dist/es/c/ContentSlides/Context.js +0 -2
- package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +0 -116
- package/dist/es/c/ContentSlides/common/HorizontalMenu/index.js +0 -2
- package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +0 -118
- package/dist/es/c/ContentSlides/common/Navigator/index.js +0 -2
- package/dist/es/c/ContentSlides/common/Sidebar/Sidebar.js +0 -84
- package/dist/es/c/ContentSlides/common/Sidebar/index.js +0 -2
- package/dist/es/c/ContentSlides/common/Slide/Slide.js +0 -65
- package/dist/es/c/ContentSlides/common/Slide/index.js +0 -2
- package/dist/es/c/ContentSlides/common/index.js +0 -4
- package/dist/es/c/ContentSlides/index.js +0 -4
- package/dist/es/c/ContentSlides/styles.scss +0 -312
- package/dist/es/c/ContentSlides/useContentSlides.js +0 -3
- package/dist/es/r/SwitchRouteMap/SwitchRouteMap.js +0 -45
- package/dist/es/r/SwitchRouteMap/index.js +0 -2
- package/dist/es/r/common/PrivateRoute/PrivateRoute.js +0 -66
- package/dist/es/r/common/PrivateRoute/index.js +0 -2
- package/dist/es/r/common/index.js +0 -1
- package/dist/es/r/index.js +0 -2
- package/src/stories/c/ContentSlides.stories.jsx +0 -214
- package/src/ui/c/ContentSlides/ContentSlides.jsx +0 -214
- package/src/ui/c/ContentSlides/Context.js +0 -3
- package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +0 -145
- package/src/ui/c/ContentSlides/common/HorizontalMenu/index.js +0 -2
- package/src/ui/c/ContentSlides/common/Navigator/Navigator.jsx +0 -150
- package/src/ui/c/ContentSlides/common/Navigator/index.js +0 -2
- package/src/ui/c/ContentSlides/common/Sidebar/Sidebar.jsx +0 -135
- package/src/ui/c/ContentSlides/common/Sidebar/index.js +0 -2
- package/src/ui/c/ContentSlides/common/Slide/Slide.jsx +0 -87
- package/src/ui/c/ContentSlides/common/Slide/index.js +0 -2
- package/src/ui/c/ContentSlides/common/index.js +0 -4
- package/src/ui/c/ContentSlides/index.js +0 -4
- package/src/ui/c/ContentSlides/styles.scss +0 -312
- package/src/ui/c/ContentSlides/useContentSlides.js +0 -4
- package/src/ui/r/SwitchRouteMap/SwitchRouteMap.jsx +0 -64
- package/src/ui/r/SwitchRouteMap/index.js +0 -2
- package/src/ui/r/common/PrivateRoute/PrivateRoute.jsx +0 -73
- package/src/ui/r/common/PrivateRoute/index.js +0 -2
- package/src/ui/r/common/index.js +0 -1
- package/src/ui/r/index.js +0 -2
- /package/src/stories/a/{CodeEditor.stories.jsx → XMLEditor.stories.jsx} +0 -0
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
|
|
4
|
-
import PropTypes from 'prop-types'
|
|
5
|
-
|
|
6
|
-
import styleNames from '@pareto-engineering/bem/exports'
|
|
7
|
-
|
|
8
|
-
// Local Definitions
|
|
9
|
-
import useContentSlides from '../../useContentSlides'
|
|
10
|
-
|
|
11
|
-
// const baseClassName = styleNames.base
|
|
12
|
-
|
|
13
|
-
const componentClassName = 'slide'
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* This is the component description.
|
|
17
|
-
*/
|
|
18
|
-
const Slide = ({
|
|
19
|
-
id,
|
|
20
|
-
className:userClassName,
|
|
21
|
-
style,
|
|
22
|
-
children,
|
|
23
|
-
|
|
24
|
-
index,
|
|
25
|
-
// ...otherProps
|
|
26
|
-
}) => {
|
|
27
|
-
const {
|
|
28
|
-
currentStepIndex,
|
|
29
|
-
} = useContentSlides()
|
|
30
|
-
|
|
31
|
-
const isActive = currentStepIndex === index
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<div
|
|
35
|
-
id={id}
|
|
36
|
-
className={[
|
|
37
|
-
|
|
38
|
-
// baseClassName,
|
|
39
|
-
isActive && styleNames.modifierActive,
|
|
40
|
-
componentClassName,
|
|
41
|
-
userClassName,
|
|
42
|
-
]
|
|
43
|
-
.filter((e) => e)
|
|
44
|
-
.join(' ')}
|
|
45
|
-
style={style}
|
|
46
|
-
>
|
|
47
|
-
<div className="wrapper">
|
|
48
|
-
<div className="content">
|
|
49
|
-
{children}
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
Slide.propTypes = {
|
|
57
|
-
/**
|
|
58
|
-
* The HTML id for this element
|
|
59
|
-
*/
|
|
60
|
-
id:PropTypes.string,
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* The HTML class names for this element
|
|
64
|
-
*/
|
|
65
|
-
className:PropTypes.string,
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* The React-written, css properties for this element.
|
|
69
|
-
*/
|
|
70
|
-
style:PropTypes.objectOf(PropTypes.string),
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* The children JSX
|
|
74
|
-
*/
|
|
75
|
-
children:PropTypes.node,
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* The index of this slide
|
|
79
|
-
*/
|
|
80
|
-
index:PropTypes.number,
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
Slide.defaultProps = {
|
|
84
|
-
// someProp:false
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export default Slide
|
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
/* stylelint-disable selector-max-compound-selectors -- Required here */
|
|
3
|
-
/* stylelint-disable max-nesting-depth -- Required here */
|
|
4
|
-
|
|
5
|
-
@use "@pareto-engineering/bem";
|
|
6
|
-
@use "@pareto-engineering/styles/src/mixins";
|
|
7
|
-
@use "@pareto-engineering/styles/src/globals" as *;
|
|
8
|
-
|
|
9
|
-
$class-sidebar:sidebar;
|
|
10
|
-
$class-horizontal-menu:horizontal-menu;
|
|
11
|
-
$class-slide:slide;
|
|
12
|
-
$class-navigator:navigator;
|
|
13
|
-
|
|
14
|
-
//$class-main-container:main;
|
|
15
|
-
|
|
16
|
-
$default-sidebar-width:minmax(250px, 330px);
|
|
17
|
-
$default-border:none;//2px solid var(--grid);
|
|
18
|
-
$default-border-radius:var(--theme-border-radius);
|
|
19
|
-
$default-content-background: var(--background-far);
|
|
20
|
-
$default-padding:var(--theme-default-padding);
|
|
21
|
-
|
|
22
|
-
$mobile-content-margin:6em;
|
|
23
|
-
|
|
24
|
-
.#{bem.$base}.content-slides {
|
|
25
|
-
height: 100%;
|
|
26
|
-
|
|
27
|
-
.#{$class-sidebar} {
|
|
28
|
-
background: $default-content-background;
|
|
29
|
-
border-right: $default-border;
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
height: 100%;
|
|
33
|
-
justify-content: space-between;
|
|
34
|
-
overflow: auto;
|
|
35
|
-
|
|
36
|
-
header,
|
|
37
|
-
.#{bem.$element-content},
|
|
38
|
-
footer {
|
|
39
|
-
padding: $default-padding;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
header {
|
|
43
|
-
border-bottom: $default-border;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
footer {
|
|
47
|
-
border-top: $default-border;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.#{bem.$element-content} {
|
|
51
|
-
.icon-list {
|
|
52
|
-
.#{bem.$element-item} {
|
|
53
|
-
&:not(:last-child) {
|
|
54
|
-
margin-bottom: 1em;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
//.#{$class-main-container} {
|
|
63
|
-
main {
|
|
64
|
-
overflow: hidden;
|
|
65
|
-
position: relative;
|
|
66
|
-
|
|
67
|
-
.#{$class-slide} {
|
|
68
|
-
height: 100%;
|
|
69
|
-
left: 0;
|
|
70
|
-
position: absolute;
|
|
71
|
-
right: 0;
|
|
72
|
-
top: 0;
|
|
73
|
-
transition: opacity .3s;
|
|
74
|
-
|
|
75
|
-
.wrapper {
|
|
76
|
-
padding: var(--u);
|
|
77
|
-
|
|
78
|
-
.#{bem.$element-content} {
|
|
79
|
-
background: $default-content-background;
|
|
80
|
-
|
|
81
|
-
border: var(--theme-border);
|
|
82
|
-
border-radius: $default-border-radius;
|
|
83
|
-
max-width: 600px;
|
|
84
|
-
padding: $default-padding;
|
|
85
|
-
position: relative;
|
|
86
|
-
width: 90%;
|
|
87
|
-
//z-index: 1;
|
|
88
|
-
|
|
89
|
-
.#{$class-navigator} {
|
|
90
|
-
display: flex;
|
|
91
|
-
margin-top: $default-padding;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
&:not(.#{bem.$modifier-active}) {
|
|
98
|
-
opacity: .5;
|
|
99
|
-
z-index: -1;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
&.#{bem.$modifier-active} {
|
|
103
|
-
opacity: 1;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.#{$class-horizontal-menu} {
|
|
109
|
-
background: $default-content-background;
|
|
110
|
-
border-bottom: var(--theme-border);
|
|
111
|
-
color: var(--heading);
|
|
112
|
-
z-index: 1;
|
|
113
|
-
|
|
114
|
-
.#{bem.$element-content} {
|
|
115
|
-
display: grid;
|
|
116
|
-
grid-template-columns: 1fr [title] 6fr 1fr;
|
|
117
|
-
padding: $default-padding;
|
|
118
|
-
|
|
119
|
-
.title {
|
|
120
|
-
grid-column: title/span 1;
|
|
121
|
-
text-align: center;
|
|
122
|
-
//font-weight:600;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.left {
|
|
126
|
-
text-align: left;
|
|
127
|
-
|
|
128
|
-
.prev-button {
|
|
129
|
-
font-family: var(--theme-default-paragraph);
|
|
130
|
-
font-size: calc(var(--s2) * 1em);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.right {
|
|
135
|
-
text-align: right;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
//
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
@include mixins.media($to:$sm-md) {
|
|
142
|
-
display: flex;
|
|
143
|
-
flex-direction: column;
|
|
144
|
-
|
|
145
|
-
.#{$class-sidebar} {
|
|
146
|
-
display: none;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
//.#{$class-main-container} {
|
|
150
|
-
|
|
151
|
-
main {
|
|
152
|
-
flex-grow: 1;
|
|
153
|
-
|
|
154
|
-
.#{$class-slide} {
|
|
155
|
-
display: flex;
|
|
156
|
-
flex-direction: column;
|
|
157
|
-
justify-content: safe center;
|
|
158
|
-
overflow: auto;
|
|
159
|
-
|
|
160
|
-
/*
|
|
161
|
-
> img {
|
|
162
|
-
height: 100%;
|
|
163
|
-
object-fit: cover;
|
|
164
|
-
position: absolute;
|
|
165
|
-
top: 0;
|
|
166
|
-
transition: opacity .3s;
|
|
167
|
-
width: 100%;
|
|
168
|
-
} */
|
|
169
|
-
|
|
170
|
-
/* stylelint-disable scss/media-feature-value-dollar-variable -- For orientation mq */
|
|
171
|
-
.wrapper {
|
|
172
|
-
display: flex;
|
|
173
|
-
flex-direction: column;
|
|
174
|
-
height: 100%;
|
|
175
|
-
//justify-content: safe center;
|
|
176
|
-
overflow: auto;
|
|
177
|
-
|
|
178
|
-
-ms-overflow-style: none;
|
|
179
|
-
padding-bottom: 0;
|
|
180
|
-
padding-top: 0;
|
|
181
|
-
//padding-bottom: $mobile-content-margin;
|
|
182
|
-
//padding-top: $mobile-content-margin;
|
|
183
|
-
scrollbar-width: none;
|
|
184
|
-
|
|
185
|
-
&::-webkit-scrollbar {
|
|
186
|
-
display: none;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
&::after,
|
|
190
|
-
&::before {
|
|
191
|
-
//background: red;
|
|
192
|
-
content: " ";
|
|
193
|
-
flex-grow: 1;
|
|
194
|
-
white-space: pre;
|
|
195
|
-
//z-index: 20;
|
|
196
|
-
@media (orientation: portrait) {
|
|
197
|
-
min-height: calc(#{$mobile-content-margin} + var(--u));
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
@media (orientation: landscape) {
|
|
201
|
-
&::before {
|
|
202
|
-
min-height: var(--u);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.#{bem.$element-content} {
|
|
207
|
-
margin: 0 auto;
|
|
208
|
-
|
|
209
|
-
.#{$class-navigator} {
|
|
210
|
-
.prev {
|
|
211
|
-
display: none;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.next {
|
|
215
|
-
flex-grow: 1;
|
|
216
|
-
justify-content: flex-end;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
/* stylelint-enable */
|
|
222
|
-
|
|
223
|
-
/*
|
|
224
|
-
&:not(.#{bem.$modifier-active}) {
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
&.#{bem.$modifier-active} {
|
|
228
|
-
} */
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
@include mixins.media($from:$sm-md) {
|
|
234
|
-
display: grid;
|
|
235
|
-
grid-template-columns: $default-sidebar-width 1fr;
|
|
236
|
-
|
|
237
|
-
.#{$class-horizontal-menu} {
|
|
238
|
-
display: none;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
&.simple {
|
|
242
|
-
grid-template-columns: 1fr;
|
|
243
|
-
grid-template-rows: auto 1fr;
|
|
244
|
-
|
|
245
|
-
.#{$class-horizontal-menu} {
|
|
246
|
-
display: block;
|
|
247
|
-
|
|
248
|
-
.#{bem.$element-content} {
|
|
249
|
-
padding: .5em;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.left,
|
|
253
|
-
.right {
|
|
254
|
-
display: none;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
main {
|
|
262
|
-
.#{$class-slide} {
|
|
263
|
-
//display: flex;
|
|
264
|
-
//flex-direction: column;
|
|
265
|
-
overflow: auto;
|
|
266
|
-
-ms-overflow-style: none;
|
|
267
|
-
scrollbar-width: none;
|
|
268
|
-
|
|
269
|
-
&::-webkit-scrollbar {
|
|
270
|
-
background: transparent; /* Optional: just make scrollbar invisible */
|
|
271
|
-
width: 0; /* Remove scrollbar space */
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/*
|
|
275
|
-
> img {
|
|
276
|
-
height: 100%;
|
|
277
|
-
object-fit: cover;
|
|
278
|
-
position: absolute;
|
|
279
|
-
top: 0;
|
|
280
|
-
transition: opacity .3s;
|
|
281
|
-
width: 100%;
|
|
282
|
-
} */
|
|
283
|
-
|
|
284
|
-
.wrapper {
|
|
285
|
-
display: flex;
|
|
286
|
-
//flex-direction: column;
|
|
287
|
-
height: 100%;
|
|
288
|
-
justify-content: center;
|
|
289
|
-
//overflow: auto;
|
|
290
|
-
.#{bem.$element-content} {
|
|
291
|
-
height: min-content;
|
|
292
|
-
margin: auto 0;
|
|
293
|
-
|
|
294
|
-
.#{$class-navigator} {
|
|
295
|
-
justify-content: space-between;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
/*
|
|
302
|
-
&:not(.#{bem.$modifier-active}) {
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
&.#{bem.$modifier-active} {
|
|
306
|
-
} */
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 0.2.2 */
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
import PropTypes from 'prop-types'
|
|
4
|
-
|
|
5
|
-
import { Switch, Route } from 'react-router-dom'
|
|
6
|
-
import { PrivateRoute } from '../common'
|
|
7
|
-
|
|
8
|
-
/* eslint-disable react/no-children-prop */
|
|
9
|
-
/**
|
|
10
|
-
* **Dependencies : `react-router-dom.Router`,**
|
|
11
|
-
* **`SessionContextProvider` in case you're using PrivateRoutes. **
|
|
12
|
-
* `SwitchRouteMap` generates a routing `Switch` from an array of route Props
|
|
13
|
-
*/
|
|
14
|
-
const SwitchRouteMap = ({
|
|
15
|
-
routes,
|
|
16
|
-
NotFound,
|
|
17
|
-
}) => (
|
|
18
|
-
<Switch
|
|
19
|
-
children={
|
|
20
|
-
[
|
|
21
|
-
...routes.map(({ isPrivate, ...routeProps }) => (isPrivate
|
|
22
|
-
? (
|
|
23
|
-
<PrivateRoute
|
|
24
|
-
key={routeProps.path}
|
|
25
|
-
{...routeProps}
|
|
26
|
-
/>
|
|
27
|
-
)
|
|
28
|
-
: (
|
|
29
|
-
<Route
|
|
30
|
-
key={routeProps.path}
|
|
31
|
-
{...routeProps}
|
|
32
|
-
/>
|
|
33
|
-
))),
|
|
34
|
-
...(NotFound
|
|
35
|
-
? [
|
|
36
|
-
<Route component={NotFound} />,
|
|
37
|
-
]
|
|
38
|
-
: []),
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
/>
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
SwitchRouteMap.propTypes = {
|
|
45
|
-
/**
|
|
46
|
-
* The routes to render
|
|
47
|
-
*/
|
|
48
|
-
routes:PropTypes.arrayOf(
|
|
49
|
-
PropTypes.shape({
|
|
50
|
-
path:PropTypes.string.isRequired,
|
|
51
|
-
// title:PropTypes.string.isRequired,
|
|
52
|
-
// state:PropTypes.string.isRequired,
|
|
53
|
-
}),
|
|
54
|
-
).isRequired,
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* A component to display in case no route was found.
|
|
58
|
-
* In case you're doing SSR, you might want to use
|
|
59
|
-
* a component that returns a 404 code.
|
|
60
|
-
*/
|
|
61
|
-
NotFound:PropTypes.node,
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export default SwitchRouteMap
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 0.2.1 */
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
import { useContext } from 'react'
|
|
4
|
-
import PropTypes from 'prop-types'
|
|
5
|
-
import { Route, Redirect, useLocation } from 'react-router-dom'
|
|
6
|
-
|
|
7
|
-
// import { SessionContext } from '..'
|
|
8
|
-
const SessionContext = React.createContext({})
|
|
9
|
-
|
|
10
|
-
// Package-level Imports
|
|
11
|
-
// import styleNames from 'style_names.scss'
|
|
12
|
-
|
|
13
|
-
// Component-level imports
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* **Dependencies : `SessionContext.loginPath` **
|
|
17
|
-
* `PrivateRoute` subclasses `react-router-dom` `Route`.
|
|
18
|
-
* `PrivateRoute` checks whether a user matches a specified test before allowing him to the resource
|
|
19
|
-
* In case the user is not allowed, he is redirected to `SessionContext.loginPath`.
|
|
20
|
-
* Please remember this is a front-end test, and is not equivalent to back-end permission checks.
|
|
21
|
-
* This component is meant to be used alongside back-end checks.
|
|
22
|
-
*/
|
|
23
|
-
const PrivateRoute = ({
|
|
24
|
-
component: Component, render, test, ...rest
|
|
25
|
-
}) => {
|
|
26
|
-
const { currentUserData: currentUser, loginPath } = useContext(
|
|
27
|
-
SessionContext,
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
const location = useLocation()
|
|
31
|
-
// console.log(me)
|
|
32
|
-
|
|
33
|
-
const isUserAllowed = currentUser && test(currentUser)
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<Route
|
|
37
|
-
{...rest}
|
|
38
|
-
render={(props) => (isUserAllowed ? (
|
|
39
|
-
render?.(props) || <Component {...props} />
|
|
40
|
-
) : (
|
|
41
|
-
<Redirect
|
|
42
|
-
to={{
|
|
43
|
-
pathname:loginPath,
|
|
44
|
-
state :{ from: location }, // TODO to implement
|
|
45
|
-
}}
|
|
46
|
-
/>
|
|
47
|
-
))}
|
|
48
|
-
/>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
PrivateRoute.propTypes = {
|
|
53
|
-
/**
|
|
54
|
-
* A function that takes the user and returns a boolean.
|
|
55
|
-
*/
|
|
56
|
-
test:PropTypes.func,
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Provide a custom rendering function in the "Render Props" pattern
|
|
60
|
-
*/
|
|
61
|
-
render:PropTypes.func,
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Which javascript component to render
|
|
65
|
-
*/
|
|
66
|
-
component:PropTypes.node,
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
PrivateRoute.defaultProps = {
|
|
70
|
-
test:(user) => user.id,
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export default PrivateRoute
|
package/src/ui/r/common/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { PrivateRoute } from './PrivateRoute'
|
package/src/ui/r/index.js
DELETED
|
File without changes
|