5htp-core 0.4.3-3 → 0.4.3-5
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 +1 -1
- package/src/client/app/component.tsx +0 -0
- package/src/client/assets/css/components/button.less +2 -3
- package/src/client/assets/css/components/table.less +1 -0
- package/src/client/assets/css/components.less +0 -6
- package/src/client/assets/css/core.less +0 -42
- package/src/client/assets/css/theme.less +21 -5
- package/src/client/assets/css/utils/layouts.less +1 -1
- package/src/client/components/Video/index.less +1 -0
- package/src/client/components/button.tsx +2 -0
- package/src/server/services/router/index.ts +39 -28
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "5htp-core",
|
|
3
3
|
"description": "Convenient TypeScript framework designed for Performance and Productivity.",
|
|
4
|
-
"version": "0.4.3-
|
|
4
|
+
"version": "0.4.3-5",
|
|
5
5
|
"author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
|
|
6
6
|
"repository": "git://github.com/gaetanlegac/5htp-core.git",
|
|
7
7
|
"license": "MIT",
|
|
File without changes
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
font-weight: 500;
|
|
29
29
|
|
|
30
30
|
// Colors
|
|
31
|
-
|
|
31
|
+
// NOTE: transparent by default (menu items, etc..)
|
|
32
|
+
background: transparent;
|
|
32
33
|
color: var(--cTxtAccent);
|
|
33
34
|
|
|
34
35
|
// Hover
|
|
@@ -222,9 +223,7 @@
|
|
|
222
223
|
// Give less imortance to buttons which are in lists
|
|
223
224
|
color: var(--cTxtBase);
|
|
224
225
|
box-shadow: none;
|
|
225
|
-
border: none;
|
|
226
226
|
//width: 100%;
|
|
227
|
-
background: transparent;
|
|
228
227
|
|
|
229
228
|
&.active,
|
|
230
229
|
&:hover {
|
|
@@ -14,48 +14,6 @@
|
|
|
14
14
|
background-size: cover;
|
|
15
15
|
background-repeat: no-repeat;
|
|
16
16
|
background-position: center;
|
|
17
|
-
|
|
18
|
-
text-shadow: 0 0 10px fade(#000, 20%);
|
|
19
|
-
|
|
20
|
-
.apply-theme({
|
|
21
|
-
background: #000;
|
|
22
|
-
foreground: #fff;
|
|
23
|
-
accent1: #fff;
|
|
24
|
-
accent2: #fff;
|
|
25
|
-
}, {
|
|
26
|
-
background: #111;
|
|
27
|
-
foreground: #fff;
|
|
28
|
-
accent1: #fff;
|
|
29
|
-
accent2: #fff;
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
--cTxtDiscret: fade(#fff, 40%)
|
|
33
|
-
--cTxtDesc: fade(#fff, 60%);
|
|
34
|
-
--cTxtBase: fade(#fff, 80%);
|
|
35
|
-
--cTxtImportant: fade(#fff, 100%);
|
|
36
|
-
--cTxtAccent: #FFF;
|
|
37
|
-
|
|
38
|
-
&.light {
|
|
39
|
-
.apply-theme({
|
|
40
|
-
background: #fff;
|
|
41
|
-
foreground: #000;
|
|
42
|
-
accent1: #000;
|
|
43
|
-
accent2: #000;
|
|
44
|
-
},{
|
|
45
|
-
background: #fff;
|
|
46
|
-
foreground: #000;
|
|
47
|
-
accent1: #000;
|
|
48
|
-
accent2: #000;
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
text-shadow: none;
|
|
52
|
-
|
|
53
|
-
--cTxtDiscret: fade(#000, 40%)
|
|
54
|
-
--cTxtDesc: fade(#000, 60%);
|
|
55
|
-
--cTxtBase: fade(#000, 80%);
|
|
56
|
-
--cTxtImportant: fade(#000, 100%);
|
|
57
|
-
--cTxtAccent: fade(#000, 20%);
|
|
58
|
-
}
|
|
59
17
|
|
|
60
18
|
&.colorize {
|
|
61
19
|
position: relative;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
foreground: COLOR;
|
|
8
8
|
accent1: COLOR;
|
|
9
9
|
accent2: COLOR;
|
|
10
|
+
alpha: BOOLEAN
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
.apply-theme( @theme, @componentsTheme: false, @apply: true ) {
|
|
@@ -31,9 +32,12 @@
|
|
|
31
32
|
|
|
32
33
|
// Flags
|
|
33
34
|
@bg: @theme[background];
|
|
34
|
-
@bgActive: if( @
|
|
35
|
-
@bg
|
|
36
|
-
@
|
|
35
|
+
@bgActive: if( (@theme[alpha]) or (alpha(@bg) < 1),
|
|
36
|
+
fadeout( @bg, 90%),
|
|
37
|
+
if( @isLight,
|
|
38
|
+
@bg - #040404,
|
|
39
|
+
@bg + #111,
|
|
40
|
+
)
|
|
37
41
|
);
|
|
38
42
|
@fg: @theme[foreground];
|
|
39
43
|
|
|
@@ -79,11 +83,23 @@
|
|
|
79
83
|
--cTxtBase: @cTxtBase;
|
|
80
84
|
|
|
81
85
|
// Discret
|
|
82
|
-
@cTxtDiscret: if( @
|
|
86
|
+
@cTxtDiscret: if( alpha(@cTxtBase) < 1,
|
|
87
|
+
fadeout( @cTxtBase, 50%),
|
|
88
|
+
if( @isLight,
|
|
89
|
+
@bg - #444,
|
|
90
|
+
@bg + #444
|
|
91
|
+
)
|
|
92
|
+
);
|
|
83
93
|
--cTxtDiscret: @cTxtDiscret;
|
|
84
94
|
|
|
85
95
|
// Desc
|
|
86
|
-
@cTxtDesc: if( @
|
|
96
|
+
@cTxtDesc: if( alpha(@cTxtBase) < 1,
|
|
97
|
+
fadeout( @cTxtBase, 30%),
|
|
98
|
+
if( @isLight,
|
|
99
|
+
@cTxtBase + #222,
|
|
100
|
+
@cTxtBase - #222
|
|
101
|
+
)
|
|
102
|
+
);
|
|
87
103
|
--cTxtDesc: @cTxtDesc;
|
|
88
104
|
|
|
89
105
|
// Important
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
|
|
115
115
|
&.inline { display: inline-flex; }
|
|
116
116
|
|
|
117
|
-
&.wrap, &.al-left { justify-content: flex-start; }
|
|
117
|
+
&.wrap, &.al-left, &.scrollable { justify-content: flex-start; }
|
|
118
118
|
&,
|
|
119
119
|
&.al-center { justify-content: center; }
|
|
120
120
|
&.al-right { justify-content: flex-end; }
|
|
@@ -507,45 +507,56 @@ declare type Routes = {
|
|
|
507
507
|
console.log(LogPrefix, `Waiting for servert to be resdy before resolving request`);
|
|
508
508
|
await this.started;
|
|
509
509
|
}
|
|
510
|
+
try {
|
|
510
511
|
|
|
511
|
-
|
|
512
|
+
const response = new ServerResponse<this>(request);
|
|
512
513
|
|
|
513
|
-
|
|
514
|
+
await this.runHook('resolve', request);
|
|
514
515
|
|
|
515
|
-
|
|
516
|
+
for (const route of this.routes) {
|
|
516
517
|
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
518
|
+
// Match Method
|
|
519
|
+
if (request.method !== route.method && route.method !== '*')
|
|
520
|
+
continue;
|
|
520
521
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
522
|
+
// Match Response format
|
|
523
|
+
if (!request.accepts(route.options.accept))
|
|
524
|
+
continue;
|
|
524
525
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
526
|
+
// Match Path
|
|
527
|
+
const match = route.regex.exec(request.path);
|
|
528
|
+
if (!match)
|
|
529
|
+
continue;
|
|
530
|
+
|
|
531
|
+
// Extract URL params
|
|
532
|
+
for (let iKey = 0; iKey < route.keys.length; iKey++) {
|
|
533
|
+
const key = route.keys[iKey];
|
|
534
|
+
const value = match[iKey + 1];
|
|
535
|
+
if (typeof key === 'string' && value) // number = sans nom
|
|
536
|
+
request.data[key] = decodeURIComponent(value);
|
|
537
|
+
}
|
|
529
538
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
539
|
+
// Run on resolution hooks. Ex: authentication check
|
|
540
|
+
await this.runHook('resolved', route);
|
|
541
|
+
|
|
542
|
+
// Create response
|
|
543
|
+
await response.runController(route);
|
|
544
|
+
if (response.wasProvided)
|
|
545
|
+
// On continue l'itération des routes, sauf si des données ont été fournie dans la réponse (.json(), .html(), ...)
|
|
546
|
+
return response;
|
|
536
547
|
}
|
|
537
548
|
|
|
538
|
-
|
|
539
|
-
await this.runHook('resolved', route);
|
|
549
|
+
throw new NotFound();
|
|
540
550
|
|
|
541
|
-
|
|
542
|
-
await response.runController(route);
|
|
543
|
-
if (response.wasProvided)
|
|
544
|
-
// On continue l'itération des routes, sauf si des données ont été fournie dans la réponse (.json(), .html(), ...)
|
|
545
|
-
return response;
|
|
546
|
-
}
|
|
551
|
+
} catch (error) {
|
|
547
552
|
|
|
548
|
-
|
|
553
|
+
if (this.app.env.profile === 'dev') {
|
|
554
|
+
console.log('API batch error:', request.method, request.path, error);
|
|
555
|
+
error.message = request.method + ' ' + request.path + ': ' + error.message;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
throw error;
|
|
559
|
+
}
|
|
549
560
|
}
|
|
550
561
|
|
|
551
562
|
private async resolveApiBatch( fetchers: TFetcherList, request: ServerRequest<this> ) {
|