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 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-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
- background: var(--cBg);
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 {
@@ -5,6 +5,7 @@
5
5
  border-collapse: collapse;
6
6
  table-layout: auto;
7
7
  width: auto;
8
+ min-width: 100%;
8
9
 
9
10
  th, td {
10
11
  white-space: nowrap;
@@ -27,10 +27,4 @@
27
27
  &.error {
28
28
  border-color: @cError;
29
29
  }
30
- }
31
-
32
- //.card.clickable:hover,
33
- .btn:hover,
34
- .input.text.focus {
35
-
36
30
  }
@@ -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( @isLight,
35
- @bg - #040404,
36
- @bg + #111,
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( @isLight, @bg - #444, @bg + #444);
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( @isLight, @cTxtBase + #222, @cTxtBase - #222);
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; }
@@ -1,5 +1,6 @@
1
1
  .video {
2
2
  .apply-theme({
3
+ alpha: false;
3
4
  background: #000;
4
5
  foreground: #fff;
5
6
  accent1: #fff;
@@ -134,6 +134,8 @@ export default ({
134
134
  if (size !== undefined)
135
135
  className += ' ' + size;
136
136
 
137
+ if (type === 'secondary')
138
+ className += ' bg white';
137
139
  if (type !== undefined)
138
140
  className += type === 'link' ? type : (' bg ' + type);
139
141
 
@@ -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
- const response = new ServerResponse<this>(request);
512
+ const response = new ServerResponse<this>(request);
512
513
 
513
- await this.runHook('resolve', request);
514
+ await this.runHook('resolve', request);
514
515
 
515
- for (const route of this.routes) {
516
+ for (const route of this.routes) {
516
517
 
517
- // Match Method
518
- if (request.method !== route.method && route.method !== '*')
519
- continue;
518
+ // Match Method
519
+ if (request.method !== route.method && route.method !== '*')
520
+ continue;
520
521
 
521
- // Match Response format
522
- if (!request.accepts(route.options.accept))
523
- continue;
522
+ // Match Response format
523
+ if (!request.accepts(route.options.accept))
524
+ continue;
524
525
 
525
- // Match Path
526
- const match = route.regex.exec(request.path);
527
- if (!match)
528
- continue;
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
- // Extract URL params
531
- for (let iKey = 0; iKey < route.keys.length; iKey++) {
532
- const key = route.keys[iKey];
533
- const value = match[iKey + 1];
534
- if (typeof key === 'string' && value) // number = sans nom
535
- request.data[key] = decodeURIComponent(value);
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
- // Run on resolution hooks. Ex: authentication check
539
- await this.runHook('resolved', route);
549
+ throw new NotFound();
540
550
 
541
- // Create response
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
- throw new NotFound();
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> ) {