lighthouse 9.5.0-dev.20230121 → 9.5.0-dev.20230123
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/core/audits/bf-cache.js +1 -1
- package/core/audits/screenshot-thumbnails.d.ts +2 -1
- package/core/audits/screenshot-thumbnails.js +14 -9
- package/core/computed/processed-navigation.d.ts +12 -6
- package/core/computed/processed-navigation.js +19 -6
- package/core/util.cjs +42 -9
- package/core/util.d.cts +114 -2
- package/dist/report/bundle.esm.js +199 -261
- package/dist/report/flow.js +23 -23
- package/dist/report/standalone.js +17 -17
- package/flow-report/assets/standalone-flow-template.html +1 -1
- package/flow-report/src/i18n/i18n.d.ts +103 -100
- package/flow-report/src/i18n/i18n.tsx +12 -8
- package/flow-report/src/sidebar/sidebar.tsx +1 -1
- package/flow-report/src/summary/category.tsx +1 -1
- package/flow-report/src/topbar.tsx +4 -28
- package/package.json +2 -2
- package/readme.md +1 -1
- package/report/assets/standalone-template.html +1 -1
- package/report/assets/styles.css +3 -3
- package/report/assets/templates.html +4 -28
- package/report/renderer/category-renderer.js +9 -9
- package/report/renderer/components.js +119 -202
- package/report/renderer/crc-details-renderer.js +4 -3
- package/report/renderer/{i18n.d.ts → i18n-formatter.d.ts} +3 -9
- package/report/renderer/{i18n.js → i18n-formatter.js} +2 -11
- package/report/renderer/performance-category-renderer.js +4 -4
- package/report/renderer/report-renderer.js +14 -18
- package/report/renderer/report-ui-features.js +6 -6
- package/report/renderer/snippet-renderer.js +1 -1
- package/report/renderer/util.d.ts +115 -3
- package/report/renderer/util.js +42 -9
- package/report/test/renderer/category-renderer-test.js +2 -2
- package/report/test/renderer/crc-details-renderer-test.js +2 -2
- package/report/test/renderer/details-renderer-test.js +2 -2
- package/report/test/renderer/dom-test.js +2 -2
- package/report/test/renderer/element-screenshot-renderer-test.js +2 -2
- package/report/test/renderer/{i18n-test.js → i18n-formatter-test.js} +15 -21
- package/report/test/renderer/performance-category-renderer-test.js +2 -2
- package/report/test/renderer/pwa-category-renderer-test.js +2 -2
- package/report/test/renderer/snippet-renderer-test.js +2 -2
- package/report/test/renderer/util-test.js +2 -2
- package/report/test-assets/lhr-3.0.0.json +2332 -0
- package/report/test-assets/lhr-4.3.0.json +4754 -0
- package/report/test-assets/lhr-5.0.0.json +5994 -0
- package/report/test-assets/lhr-6.0.0.json +7222 -0
- package/report/test-assets/lhr-8.5.0.json +8679 -0
- package/shared/localization/locales/en-US.json +1 -1
- package/shared/localization/locales/en-XL.json +1 -1
|
@@ -19,7 +19,7 @@ limitations under the License.
|
|
|
19
19
|
<head>
|
|
20
20
|
<meta charset="utf-8">
|
|
21
21
|
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
|
22
|
-
<link rel="icon" href=
|
|
22
|
+
<link rel="icon" href='data:image/svg+xml;utf8,<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="m14 7 10-7 10 7v10h5v7h-5l5 24H9l5-24H9v-7h5V7Z" fill="%23F63"/><path d="M31.561 24H14l-1.689 8.105L31.561 24ZM18.983 48H9l1.022-4.907L35.723 32.27l1.663 7.98L18.983 48Z" fill="%23FFA385"/><path fill="%23FF3" d="M20.5 10h7v7h-7z"/></svg>'>
|
|
23
23
|
<title>Lighthouse Flow Report</title>
|
|
24
24
|
<style>/*%%LIGHTHOUSE_FLOW_CSS%%*/</style>
|
|
25
25
|
<style>body {margin: 0}</style>
|
|
@@ -4,106 +4,109 @@
|
|
|
4
4
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
5
5
|
*/
|
|
6
6
|
import { FunctionComponent } from 'preact';
|
|
7
|
-
import {
|
|
8
|
-
declare function useI18n():
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
7
|
+
import { I18nFormatter } from '../../../report/renderer/i18n-formatter';
|
|
8
|
+
declare function useI18n(): {
|
|
9
|
+
formatter: I18nFormatter;
|
|
10
|
+
strings: {
|
|
11
|
+
navigationDescription: string;
|
|
12
|
+
timespanDescription: string;
|
|
13
|
+
snapshotDescription: string;
|
|
14
|
+
navigationLongDescription: string;
|
|
15
|
+
timespanLongDescription: string;
|
|
16
|
+
snapshotLongDescription: string;
|
|
17
|
+
navigationReport: string;
|
|
18
|
+
timespanReport: string;
|
|
19
|
+
snapshotReport: string;
|
|
20
|
+
summary: string;
|
|
21
|
+
allReports: string;
|
|
22
|
+
title: string;
|
|
23
|
+
categories: string;
|
|
24
|
+
categoryPerformance: string;
|
|
25
|
+
categoryAccessibility: string;
|
|
26
|
+
categoryBestPractices: string;
|
|
27
|
+
categorySeo: string;
|
|
28
|
+
categoryProgressiveWebApp: string;
|
|
29
|
+
desktop: string;
|
|
30
|
+
mobile: string;
|
|
31
|
+
ratingPass: string;
|
|
32
|
+
ratingAverage: string;
|
|
33
|
+
ratingFail: string;
|
|
34
|
+
ratingError: string;
|
|
35
|
+
navigationReportCount: string;
|
|
36
|
+
timespanReportCount: string;
|
|
37
|
+
snapshotReportCount: string;
|
|
38
|
+
save: string;
|
|
39
|
+
helpLabel: string;
|
|
40
|
+
helpDialogTitle: string;
|
|
41
|
+
helpUseCaseInstructionNavigation: string;
|
|
42
|
+
helpUseCaseInstructionTimespan: string;
|
|
43
|
+
helpUseCaseInstructionSnapshot: string;
|
|
44
|
+
helpUseCaseNavigation1: string;
|
|
45
|
+
helpUseCaseNavigation2: string;
|
|
46
|
+
helpUseCaseNavigation3: string;
|
|
47
|
+
helpUseCaseTimespan1: string;
|
|
48
|
+
helpUseCaseTimespan2: string;
|
|
49
|
+
helpUseCaseSnapshot1: string;
|
|
50
|
+
helpUseCaseSnapshot2: string;
|
|
51
|
+
passedAuditCount: string;
|
|
52
|
+
passableAuditCount: string;
|
|
53
|
+
informativeAuditCount: string;
|
|
54
|
+
highestImpact: string;
|
|
55
|
+
varianceDisclaimer: string;
|
|
56
|
+
calculatorLink: string;
|
|
57
|
+
showRelevantAudits: string;
|
|
58
|
+
opportunityResourceColumnLabel: string;
|
|
59
|
+
opportunitySavingsColumnLabel: string;
|
|
60
|
+
errorMissingAuditInfo: string;
|
|
61
|
+
errorLabel: string;
|
|
62
|
+
warningHeader: string;
|
|
63
|
+
warningAuditsGroupTitle: string;
|
|
64
|
+
passedAuditsGroupTitle: string;
|
|
65
|
+
notApplicableAuditsGroupTitle: string;
|
|
66
|
+
manualAuditsGroupTitle: string;
|
|
67
|
+
toplevelWarningsMessage: string;
|
|
68
|
+
crcInitialNavigation: string;
|
|
69
|
+
crcLongestDurationLabel: string;
|
|
70
|
+
snippetExpandButtonLabel: string;
|
|
71
|
+
snippetCollapseButtonLabel: string;
|
|
72
|
+
lsPerformanceCategoryDescription: string;
|
|
73
|
+
labDataTitle: string;
|
|
74
|
+
thirdPartyResourcesLabel: string;
|
|
75
|
+
viewTreemapLabel: string;
|
|
76
|
+
viewTraceLabel: string;
|
|
77
|
+
viewOriginalTraceLabel: string;
|
|
78
|
+
dropdownPrintSummary: string;
|
|
79
|
+
dropdownPrintExpanded: string;
|
|
80
|
+
dropdownCopyJSON: string;
|
|
81
|
+
dropdownSaveHTML: string;
|
|
82
|
+
dropdownSaveJSON: string;
|
|
83
|
+
dropdownViewer: string;
|
|
84
|
+
dropdownSaveGist: string;
|
|
85
|
+
dropdownDarkTheme: string;
|
|
86
|
+
runtimeSettingsDevice: string;
|
|
87
|
+
runtimeSettingsNetworkThrottling: string;
|
|
88
|
+
runtimeSettingsCPUThrottling: string;
|
|
89
|
+
runtimeSettingsUANetwork: string;
|
|
90
|
+
runtimeSettingsBenchmark: string;
|
|
91
|
+
runtimeSettingsAxeVersion: string;
|
|
92
|
+
runtimeSettingsScreenEmulation: string;
|
|
93
|
+
footerIssue: string;
|
|
94
|
+
runtimeNoEmulation: string;
|
|
95
|
+
runtimeMobileEmulation: string;
|
|
96
|
+
runtimeDesktopEmulation: string;
|
|
97
|
+
runtimeUnknown: string;
|
|
98
|
+
runtimeSingleLoad: string;
|
|
99
|
+
runtimeAnalysisWindow: string;
|
|
100
|
+
runtimeSingleLoadTooltip: string;
|
|
101
|
+
throttlingProvided: string;
|
|
102
|
+
show: string;
|
|
103
|
+
hide: string;
|
|
104
|
+
expandView: string;
|
|
105
|
+
collapseView: string;
|
|
106
|
+
runtimeSlow4g: string;
|
|
107
|
+
runtimeCustom: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
107
110
|
declare function useLocalizedStrings(): {
|
|
108
111
|
navigationDescription: string;
|
|
109
112
|
timespanDescription: string;
|
|
@@ -8,13 +8,16 @@ import {createContext, FunctionComponent} from 'preact';
|
|
|
8
8
|
import {useContext, useMemo} from 'preact/hooks';
|
|
9
9
|
|
|
10
10
|
import {formatMessage} from '../../../shared/localization/format';
|
|
11
|
-
import {
|
|
11
|
+
import {I18nFormatter} from '../../../report/renderer/i18n-formatter';
|
|
12
12
|
import {UIStrings} from './ui-strings';
|
|
13
13
|
import {useFlowResult} from '../util';
|
|
14
14
|
import strings from './localized-strings.js';
|
|
15
15
|
import {Util} from '../../../report/renderer/util';
|
|
16
16
|
|
|
17
|
-
const I18nContext = createContext(
|
|
17
|
+
const I18nContext = createContext({
|
|
18
|
+
formatter: new I18nFormatter('en-US'),
|
|
19
|
+
strings: {...Util.UIStrings, ...UIStrings},
|
|
20
|
+
});
|
|
18
21
|
|
|
19
22
|
function useLhrLocale() {
|
|
20
23
|
const flowResult = useFlowResult();
|
|
@@ -51,9 +54,7 @@ const I18nProvider: FunctionComponent = ({children}) => {
|
|
|
51
54
|
const {locale, lhrStrings} = useLhrLocale();
|
|
52
55
|
|
|
53
56
|
const i18n = useMemo(() => {
|
|
54
|
-
|
|
55
|
-
// Set any missing lhr strings to default (english) values.
|
|
56
|
-
...Util.UIStrings,
|
|
57
|
+
Util.applyStrings({
|
|
57
58
|
// Preload with strings from the first lhr.
|
|
58
59
|
// Used for legacy report components imported into the flow report.
|
|
59
60
|
...lhrStrings,
|
|
@@ -64,10 +65,13 @@ const I18nProvider: FunctionComponent = ({children}) => {
|
|
|
64
65
|
});
|
|
65
66
|
|
|
66
67
|
// Initialize renderer util i18n for strings rendered in wrapped components.
|
|
67
|
-
// TODO: Don't attach global
|
|
68
|
-
Util.i18n =
|
|
68
|
+
// TODO: Don't attach global formatter to `Util`.
|
|
69
|
+
Util.i18n = new I18nFormatter(locale);
|
|
69
70
|
|
|
70
|
-
return
|
|
71
|
+
return {
|
|
72
|
+
formatter: Util.i18n,
|
|
73
|
+
strings: Util.strings as typeof UIStrings & typeof Util.UIStrings,
|
|
74
|
+
};
|
|
71
75
|
}, [locale, lhrStrings]);
|
|
72
76
|
|
|
73
77
|
return (
|
|
@@ -77,7 +77,7 @@ const SidebarHeader: FunctionComponent<{title: string, date: string}> = ({title,
|
|
|
77
77
|
return (
|
|
78
78
|
<div className="SidebarHeader">
|
|
79
79
|
<div className="SidebarHeader__title">{title}</div>
|
|
80
|
-
<div className="SidebarHeader__date">{i18n.formatDateTime(date)}</div>
|
|
80
|
+
<div className="SidebarHeader__date">{i18n.formatter.formatDateTime(date)}</div>
|
|
81
81
|
</div>
|
|
82
82
|
);
|
|
83
83
|
};
|
|
@@ -132,7 +132,7 @@ const SummaryTooltip: FunctionComponent<{
|
|
|
132
132
|
{
|
|
133
133
|
!displayAsFraction && category.score !== null && <>
|
|
134
134
|
<span> · </span>
|
|
135
|
-
<span>{i18n.formatInteger(category.score * 100)}</span>
|
|
135
|
+
<span>{i18n.formatter.formatInteger(category.score * 100)}</span>
|
|
136
136
|
</>
|
|
137
137
|
}
|
|
138
138
|
</div>
|
|
@@ -26,34 +26,10 @@ saveHtml.saveFile = saveFile;
|
|
|
26
26
|
/* eslint-disable max-len */
|
|
27
27
|
const Logo: FunctionComponent = () => {
|
|
28
28
|
return (
|
|
29
|
-
<svg
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<stop stop-color="#262626" stop-opacity="0" offset="100%"/>
|
|
34
|
-
</linearGradient>
|
|
35
|
-
<linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="Topbar__logo--b">
|
|
36
|
-
<stop stop-color="#262626" stop-opacity=".1" offset="0%"/>
|
|
37
|
-
<stop stop-color="#262626" stop-opacity="0" offset="100%"/>
|
|
38
|
-
</linearGradient>
|
|
39
|
-
<linearGradient x1="58.764%" y1="65.756%" x2="36.939%" y2="50.14%" id="Topbar__logo--c">
|
|
40
|
-
<stop stop-color="#262626" stop-opacity=".1" offset="0%"/>
|
|
41
|
-
<stop stop-color="#262626" stop-opacity="0" offset="100%"/>
|
|
42
|
-
</linearGradient>
|
|
43
|
-
<linearGradient x1="41.635%" y1="20.358%" x2="72.863%" y2="85.424%" id="Topbar__logo--d">
|
|
44
|
-
<stop stop-color="#FFF" stop-opacity=".1" offset="0%"/>
|
|
45
|
-
<stop stop-color="#FFF" stop-opacity="0" offset="100%"/>
|
|
46
|
-
</linearGradient>
|
|
47
|
-
</defs>
|
|
48
|
-
<g fill="none" fill-rule="evenodd">
|
|
49
|
-
<path d="M12 3l4.125 2.625v3.75H18v2.25h-1.688l1.5 9.375H6.188l1.5-9.375H6v-2.25h1.875V5.648L12 3zm2.201 9.938L9.54 14.633 9 18.028l5.625-2.062-.424-3.028zM12.005 5.67l-1.88 1.207v2.498h3.75V6.86l-1.87-1.19z" fill="#F44B21"/>
|
|
50
|
-
<path fill="#FFF" d="M14.201 12.938L9.54 14.633 9 18.028l5.625-2.062z"/>
|
|
51
|
-
<path d="M6 18c-2.042 0-3.95-.01-5.813 0l1.5-9.375h4.326L6 18z" fill="url(#Topbar__logo--a)" fill-rule="nonzero" transform="translate(6 3)"/>
|
|
52
|
-
<path fill="#FFF176" fill-rule="nonzero" d="M13.875 9.375v-2.56l-1.87-1.19-1.88 1.207v2.543z"/>
|
|
53
|
-
<path fill="url(#Topbar__logo--b)" fill-rule="nonzero" d="M0 6.375h6v2.25H0z" transform="translate(6 3)"/>
|
|
54
|
-
<path fill="url(#Topbar__logo--c)" fill-rule="nonzero" d="M6 6.375H1.875v-3.75L6 0z" transform="translate(6 3)"/>
|
|
55
|
-
<path fill="url(#Topbar__logo--d)" fill-rule="nonzero" d="M6 0l4.125 2.625v3.75H12v2.25h-1.688l1.5 9.375H.188l1.5-9.375H0v-2.25h1.875V2.648z" transform="translate(6 3)"/>
|
|
56
|
-
</g>
|
|
29
|
+
<svg role="img" class="lh-topbar__logo" title="Lighthouse logo" width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
|
|
30
|
+
<path d="m14 7 10-7 10 7v10h5v7h-5l5 24H9l5-24H9v-7h5V7Z" fill="#F63"/>
|
|
31
|
+
<path d="M31.561 24H14l-1.689 8.105L31.561 24ZM18.983 48H9l1.022-4.907L35.723 32.27l1.663 7.98L18.983 48Z" fill="#FFA385"/>
|
|
32
|
+
<path fill="#FF3" d="M20.5 10h7v7h-7z"/>
|
|
57
33
|
</svg>
|
|
58
34
|
);
|
|
59
35
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lighthouse",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "9.5.0-dev.
|
|
4
|
+
"version": "9.5.0-dev.20230123",
|
|
5
5
|
"description": "Automated auditing, performance metrics, and best practices for the web.",
|
|
6
6
|
"main": "./core/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
"lighthouse-stack-packs": "1.8.2",
|
|
201
201
|
"lodash": "^4.17.21",
|
|
202
202
|
"lookup-closest-locale": "6.2.0",
|
|
203
|
-
"metaviewport-parser": "0.
|
|
203
|
+
"metaviewport-parser": "0.3.0",
|
|
204
204
|
"open": "^8.4.0",
|
|
205
205
|
"parse-cache-control": "1.0.1",
|
|
206
206
|
"ps-list": "^8.0.0",
|
package/readme.md
CHANGED
|
@@ -461,7 +461,7 @@ See [Contributing](./CONTRIBUTING.md) to get started.
|
|
|
461
461
|
|
|
462
462
|
---
|
|
463
463
|
<p align="center">
|
|
464
|
-
<img src="
|
|
464
|
+
<img src="./assets/lighthouse-logo_512px.png" alt="Lighthouse logo" height="150">
|
|
465
465
|
<br>
|
|
466
466
|
<b>Lighthouse</b>, ˈlītˌhous (n): a <s>tower or other structure</s> tool containing a beacon light
|
|
467
467
|
to warn or guide <s>ships at sea</s> developers.
|
|
@@ -19,7 +19,7 @@ limitations under the License.
|
|
|
19
19
|
<head>
|
|
20
20
|
<meta charset="utf-8">
|
|
21
21
|
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
|
22
|
-
<link rel="icon" href=
|
|
22
|
+
<link rel="icon" href='data:image/svg+xml;utf8,<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="m14 7 10-7 10 7v10h5v7h-5l5 24H9l5-24H9v-7h5V7Z" fill="%23F63"/><path d="M31.561 24H14l-1.689 8.105L31.561 24ZM18.983 48H9l1.022-4.907L35.723 32.27l1.663 7.98L18.983 48Z" fill="%23FFA385"/><path fill="%23FF3" d="M20.5 10h7v7h-7z"/></svg>'>
|
|
23
23
|
<title>Lighthouse Report</title>
|
|
24
24
|
<style>body {margin: 0}</style>
|
|
25
25
|
</head>
|
package/report/assets/styles.css
CHANGED
|
@@ -918,7 +918,7 @@
|
|
|
918
918
|
justify-content: space-between;
|
|
919
919
|
padding-bottom: var(--default-padding);
|
|
920
920
|
width: 100%;
|
|
921
|
-
grid-template-columns: repeat(auto-fit,
|
|
921
|
+
grid-template-columns: repeat(auto-fit, 90px);
|
|
922
922
|
}
|
|
923
923
|
|
|
924
924
|
.lh-filmstrip__frame {
|
|
@@ -928,8 +928,8 @@
|
|
|
928
928
|
|
|
929
929
|
.lh-filmstrip__thumbnail {
|
|
930
930
|
border: 1px solid var(--report-border-color-secondary);
|
|
931
|
-
max-height:
|
|
932
|
-
max-width:
|
|
931
|
+
max-height: 150px;
|
|
932
|
+
max-width: 120px;
|
|
933
933
|
}
|
|
934
934
|
|
|
935
935
|
/* Audit */
|
|
@@ -366,34 +366,10 @@ limitations under the License.
|
|
|
366
366
|
|
|
367
367
|
<div class="lh-topbar">
|
|
368
368
|
<!-- Lighthouse logo. -->
|
|
369
|
-
<svg class="lh-topbar__logo" viewBox="0 0
|
|
370
|
-
<
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
<stop stop-color="#262626" stop-opacity="0" offset="100%"/>
|
|
374
|
-
</linearGradient>
|
|
375
|
-
<linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="lh-topbar__logo--b">
|
|
376
|
-
<stop stop-color="#262626" stop-opacity=".1" offset="0%"/>
|
|
377
|
-
<stop stop-color="#262626" stop-opacity="0" offset="100%"/>
|
|
378
|
-
</linearGradient>
|
|
379
|
-
<linearGradient x1="58.764%" y1="65.756%" x2="36.939%" y2="50.14%" id="lh-topbar__logo--c">
|
|
380
|
-
<stop stop-color="#262626" stop-opacity=".1" offset="0%"/>
|
|
381
|
-
<stop stop-color="#262626" stop-opacity="0" offset="100%"/>
|
|
382
|
-
</linearGradient>
|
|
383
|
-
<linearGradient x1="41.635%" y1="20.358%" x2="72.863%" y2="85.424%" id="lh-topbar__logo--d">
|
|
384
|
-
<stop stop-color="#FFF" stop-opacity=".1" offset="0%"/>
|
|
385
|
-
<stop stop-color="#FFF" stop-opacity="0" offset="100%"/>
|
|
386
|
-
</linearGradient>
|
|
387
|
-
</defs>
|
|
388
|
-
<g fill="none" fill-rule="evenodd">
|
|
389
|
-
<path d="M12 3l4.125 2.625v3.75H18v2.25h-1.688l1.5 9.375H6.188l1.5-9.375H6v-2.25h1.875V5.648L12 3zm2.201 9.938L9.54 14.633 9 18.028l5.625-2.062-.424-3.028zM12.005 5.67l-1.88 1.207v2.498h3.75V6.86l-1.87-1.19z" fill="#F44B21"/>
|
|
390
|
-
<path fill="#FFF" d="M14.201 12.938L9.54 14.633 9 18.028l5.625-2.062z"/>
|
|
391
|
-
<path d="M6 18c-2.042 0-3.95-.01-5.813 0l1.5-9.375h4.326L6 18z" fill="url(#lh-topbar__logo--a)" fill-rule="nonzero" transform="translate(6 3)"/>
|
|
392
|
-
<path fill="#FFF176" fill-rule="nonzero" d="M13.875 9.375v-2.56l-1.87-1.19-1.88 1.207v2.543z"/>
|
|
393
|
-
<path fill="url(#lh-topbar__logo--b)" fill-rule="nonzero" d="M0 6.375h6v2.25H0z" transform="translate(6 3)"/>
|
|
394
|
-
<path fill="url(#lh-topbar__logo--c)" fill-rule="nonzero" d="M6 6.375H1.875v-3.75L6 0z" transform="translate(6 3)"/>
|
|
395
|
-
<path fill="url(#lh-topbar__logo--d)" fill-rule="nonzero" d="M6 0l4.125 2.625v3.75H12v2.25h-1.688l1.5 9.375H.188l1.5-9.375H0v-2.25h1.875V2.648z" transform="translate(6 3)"/>
|
|
396
|
-
</g>
|
|
369
|
+
<svg role="img" class="lh-topbar__logo" title="Lighthouse logo" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
|
|
370
|
+
<path d="m14 7 10-7 10 7v10h5v7h-5l5 24H9l5-24H9v-7h5V7Z" fill="#F63"/>
|
|
371
|
+
<path d="M31.561 24H14l-1.689 8.105L31.561 24ZM18.983 48H9l1.022-4.907L35.723 32.27l1.663 7.98L18.983 48Z" fill="#FFA385"/>
|
|
372
|
+
<path fill="#FF3" d="M20.5 10h7v7h-7z"/>
|
|
397
373
|
</svg>
|
|
398
374
|
|
|
399
375
|
<a href="" class="lh-topbar__url" target="_blank" rel="noopener"></a>
|
|
@@ -39,10 +39,10 @@ export class CategoryRenderer {
|
|
|
39
39
|
*/
|
|
40
40
|
get _clumpTitles() {
|
|
41
41
|
return {
|
|
42
|
-
warning: Util.
|
|
43
|
-
manual: Util.
|
|
44
|
-
passed: Util.
|
|
45
|
-
notApplicable: Util.
|
|
42
|
+
warning: Util.strings.warningAuditsGroupTitle,
|
|
43
|
+
manual: Util.strings.manualAuditsGroupTitle,
|
|
44
|
+
passed: Util.strings.passedAuditsGroupTitle,
|
|
45
|
+
notApplicable: Util.strings.notApplicableAuditsGroupTitle,
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -62,7 +62,7 @@ export class CategoryRenderer {
|
|
|
62
62
|
* @return {!Element}
|
|
63
63
|
*/
|
|
64
64
|
populateAuditValues(audit, component) {
|
|
65
|
-
const strings = Util.
|
|
65
|
+
const strings = Util.strings;
|
|
66
66
|
const auditEl = this.dom.find('.lh-audit', component);
|
|
67
67
|
auditEl.id = audit.result.id;
|
|
68
68
|
const scoreDisplayMode = audit.result.scoreDisplayMode;
|
|
@@ -334,8 +334,8 @@ export class CategoryRenderer {
|
|
|
334
334
|
el.append(descriptionEl);
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
this.dom.find('.lh-clump-toggletext--show', el).textContent = Util.
|
|
338
|
-
this.dom.find('.lh-clump-toggletext--hide', el).textContent = Util.
|
|
337
|
+
this.dom.find('.lh-clump-toggletext--show', el).textContent = Util.strings.show;
|
|
338
|
+
this.dom.find('.lh-clump-toggletext--hide', el).textContent = Util.strings.hide;
|
|
339
339
|
|
|
340
340
|
clumpElement.classList.add(`lh-clump--${clumpId.toLowerCase()}`);
|
|
341
341
|
return el;
|
|
@@ -393,7 +393,7 @@ export class CategoryRenderer {
|
|
|
393
393
|
percentageEl.textContent = scoreOutOf100.toString();
|
|
394
394
|
if (category.score === null) {
|
|
395
395
|
percentageEl.textContent = '?';
|
|
396
|
-
percentageEl.title = Util.
|
|
396
|
+
percentageEl.title = Util.strings.errorLabel;
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
// Render a numerical score if the category has applicable audits, or no audits whatsoever.
|
|
@@ -402,7 +402,7 @@ export class CategoryRenderer {
|
|
|
402
402
|
} else {
|
|
403
403
|
wrapper.classList.add(`lh-gauge__wrapper--not-applicable`);
|
|
404
404
|
percentageEl.textContent = '-';
|
|
405
|
-
percentageEl.title = Util.
|
|
405
|
+
percentageEl.title = Util.strings.notApplicableAuditsGroupTitle;
|
|
406
406
|
}
|
|
407
407
|
|
|
408
408
|
this.dom.find('.lh-gauge__label', tmpl).textContent = category.title;
|