5htp-core 0.5.0-6 → 0.5.0-7
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.5.0-
|
|
4
|
+
"version": "0.5.0-7",
|
|
5
5
|
"author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
|
|
6
6
|
"repository": "git://github.com/gaetanlegac/5htp-core.git",
|
|
7
7
|
"license": "MIT",
|
|
@@ -23,7 +23,6 @@ export type Props = {
|
|
|
23
23
|
iconR?: ComponentChild,
|
|
24
24
|
|
|
25
25
|
prefix?: ComponentChild,
|
|
26
|
-
children?: ComponentChild | ComponentChild[],
|
|
27
26
|
suffix?: ComponentChild,
|
|
28
27
|
|
|
29
28
|
tag?: "a" | "button",
|
|
@@ -31,7 +30,6 @@ export type Props = {
|
|
|
31
30
|
shape?: 'default' | 'icon' | 'tile' | 'pill',
|
|
32
31
|
size?: TComponentSize,
|
|
33
32
|
class?: string,
|
|
34
|
-
title?: string,
|
|
35
33
|
|
|
36
34
|
state?: [string, React.StateUpdater<string>],
|
|
37
35
|
active?: boolean,
|
|
@@ -45,7 +43,14 @@ export type Props = {
|
|
|
45
43
|
submenu?: ComponentChild,
|
|
46
44
|
nav?: boolean | 'exact'
|
|
47
45
|
|
|
48
|
-
|
|
46
|
+
// SEO: if icon only, should provinde a hint (aria-label)
|
|
47
|
+
} & ({
|
|
48
|
+
hint: string,
|
|
49
|
+
children?: ComponentChild | ComponentChild[],
|
|
50
|
+
} | {
|
|
51
|
+
children: ComponentChild | ComponentChild[],
|
|
52
|
+
hint?: string,
|
|
53
|
+
}) & (TButtonProps | TLinkProps)
|
|
49
54
|
|
|
50
55
|
export type TButtonProps = {
|
|
51
56
|
|
|
@@ -84,6 +89,7 @@ export default ({
|
|
|
84
89
|
iconR, suffix,
|
|
85
90
|
submenu,
|
|
86
91
|
nav,
|
|
92
|
+
hint,
|
|
87
93
|
|
|
88
94
|
// Style
|
|
89
95
|
class: className,
|
|
@@ -125,6 +131,12 @@ export default ({
|
|
|
125
131
|
props.onClick = () => setActive(id);
|
|
126
132
|
}
|
|
127
133
|
|
|
134
|
+
// Hint
|
|
135
|
+
if (hint !== undefined) {
|
|
136
|
+
props['aria-label'] = hint;
|
|
137
|
+
props.title = hint;
|
|
138
|
+
}
|
|
139
|
+
|
|
128
140
|
// Shape classes
|
|
129
141
|
const classNames: string[] = ['btn'];
|
|
130
142
|
if (className)
|
|
@@ -58,7 +58,7 @@ export default class DocumentRenderer<TRouter extends Router> {
|
|
|
58
58
|
public async page( html: string, page: Page, response: ServerResponse<TRouter> ) {
|
|
59
59
|
|
|
60
60
|
// TODO: can be customized via page / route config
|
|
61
|
-
const canonicalUrl = response.request.
|
|
61
|
+
const canonicalUrl = response.request.url;
|
|
62
62
|
|
|
63
63
|
let attrsBody = {
|
|
64
64
|
className: [...page.bodyClass].join(' '),
|