chrome-devtools-frontend 1.0.953446 → 1.0.953776
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/config/gni/devtools_grd_files.gni +3 -0
- package/front_end/core/i18n/i18nImpl.ts +8 -30
- package/front_end/core/i18n/locales/en-US.json +3 -0
- package/front_end/core/i18n/locales/en-XL.json +3 -0
- package/front_end/panels/application/components/EndpointsGrid.ts +1 -1
- package/front_end/panels/network/NetworkDataGridNode.ts +0 -2
- package/front_end/panels/network/components/WebBundleInfoView.ts +1 -1
- package/front_end/third_party/puppeteer/package/README.md +11 -11
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js +20 -11
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js +13 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js +20 -11
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +13 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/package.json +1 -1
- package/front_end/ui/components/input/checkbox.css +11 -0
- package/front_end/ui/components/input/input.ts +3 -3
- package/front_end/ui/components/markdown_view/MarkdownView.ts +1 -1
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +2 -1
- package/front_end/ui/components/settings/SettingCheckbox.ts +2 -1
- package/front_end/ui/components/settings/settingCheckbox.css +0 -5
- package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +10 -3
- package/front_end/ui/legacy/UIUtils.ts +0 -12
- package/front_end/ui/legacy/themeColors.css +1 -0
- package/package.json +1 -1
- package/scripts/eslint_rules/lib/lit_html_host_this.js +1 -10
- package/scripts/eslint_rules/lib/utils.js +20 -1
- package/scripts/eslint_rules/tests/utils_test.js +30 -0
|
@@ -6,6 +6,7 @@ import type * as Common from '../../../core/common/common.js';
|
|
|
6
6
|
import * as ComponentHelpers from '../../components/helpers/helpers.js';
|
|
7
7
|
import * as LitHtml from '../../lit-html/lit-html.js';
|
|
8
8
|
|
|
9
|
+
import * as Input from '../input/input.js';
|
|
9
10
|
import settingCheckboxStyles from './settingCheckbox.css.js';
|
|
10
11
|
|
|
11
12
|
export interface SettingCheckboxData {
|
|
@@ -29,7 +30,7 @@ export class SettingCheckbox extends HTMLElement {
|
|
|
29
30
|
#changeListenerDescriptor?: Common.EventTarget.EventDescriptor;
|
|
30
31
|
|
|
31
32
|
connectedCallback(): void {
|
|
32
|
-
this.#shadow.adoptedStyleSheets = [settingCheckboxStyles];
|
|
33
|
+
this.#shadow.adoptedStyleSheets = [Input.checkboxStyles, settingCheckboxStyles];
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
set data(data: SettingCheckboxData) {
|
|
@@ -7,10 +7,16 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
7
7
|
import {Dialog} from './Dialog.js';
|
|
8
8
|
import {SizeBehavior} from './GlassPane.js';
|
|
9
9
|
import remoteDebuggingTerminatedScreenStyles from './remoteDebuggingTerminatedScreen.css.legacy.js';
|
|
10
|
-
import {createTextButton
|
|
10
|
+
import {createTextButton} from './UIUtils.js';
|
|
11
11
|
import {VBox} from './Widget.js';
|
|
12
12
|
|
|
13
13
|
const UIStrings = {
|
|
14
|
+
/**
|
|
15
|
+
* @description Text in a dialog box in DevTools stating why remote debugging has been terminated.
|
|
16
|
+
* "Remote debugging" here means that DevTools on a PC is inspecting a website running on an actual mobile device
|
|
17
|
+
* (see https://developer.chrome.com/docs/devtools/remote-debugging/).
|
|
18
|
+
*/
|
|
19
|
+
debuggingConnectionWasClosed: 'Debugging connection was closed. Reason: ',
|
|
14
20
|
/**
|
|
15
21
|
* @description Text in a dialog box showing how to reconnect to DevTools when remote debugging has been terminated.
|
|
16
22
|
* "Remote debugging" here means that DevTools on a PC is inspecting a website running on an actual mobile device
|
|
@@ -33,9 +39,10 @@ export class RemoteDebuggingTerminatedScreen extends VBox {
|
|
|
33
39
|
super(true);
|
|
34
40
|
this.registerRequiredCSS(remoteDebuggingTerminatedScreenStyles);
|
|
35
41
|
const message = this.contentElement.createChild('div', 'message');
|
|
36
|
-
const
|
|
42
|
+
const span = message.createChild('span');
|
|
43
|
+
span.append(i18nString(UIStrings.debuggingConnectionWasClosed));
|
|
44
|
+
const reasonElement = span.createChild('span', 'reason');
|
|
37
45
|
reasonElement.textContent = reason;
|
|
38
|
-
message.appendChild(formatLocalized('Debugging connection was closed. Reason: %s', [reasonElement]));
|
|
39
46
|
this.contentElement.createChild('div', 'message').textContent = i18nString(UIStrings.reconnectWhenReadyByReopening);
|
|
40
47
|
const button = createTextButton(i18nString(UIStrings.reconnectDevtools), () => window.location.reload());
|
|
41
48
|
this.contentElement.createChild('div', 'button').appendChild(button);
|
|
@@ -583,18 +583,6 @@ export function handleElementValueModifications(
|
|
|
583
583
|
return false;
|
|
584
584
|
}
|
|
585
585
|
|
|
586
|
-
export function formatLocalized<U>(format: string, substitutions: ArrayLike<U>|null): Element {
|
|
587
|
-
const formatters = {
|
|
588
|
-
s: (substitution: unknown): unknown => substitution,
|
|
589
|
-
};
|
|
590
|
-
function append(a: Element, b: string|Element): Element {
|
|
591
|
-
a.appendChild(typeof b === 'string' ? document.createTextNode(b) : b as Element);
|
|
592
|
-
return a;
|
|
593
|
-
}
|
|
594
|
-
return Platform.StringUtilities.format(format, substitutions, formatters, document.createElement('span'), append)
|
|
595
|
-
.formattedResult;
|
|
596
|
-
}
|
|
597
|
-
|
|
598
586
|
export function openLinkExternallyLabel(): string {
|
|
599
587
|
return i18nString(UIStrings.openInNewTab);
|
|
600
588
|
}
|
|
@@ -108,6 +108,7 @@
|
|
|
108
108
|
--color-error-text: #f00;
|
|
109
109
|
--color-error-border: hsl(0deg 100% 92%);
|
|
110
110
|
--color-error-background: hsl(0deg 100% 97%);
|
|
111
|
+
--color-checkbox-accent-color: var(--color-primary);
|
|
111
112
|
--color-image-preview-background: rgb(255 255 255);
|
|
112
113
|
|
|
113
114
|
/* Colors for styling inputs */
|
package/package.json
CHANGED
|
@@ -3,16 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
if (callExpressionNode.callee.type !== 'MemberExpression') {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// TODO: would miss cases where the render function is destructured. Should
|
|
12
|
-
// we support that case, or enforce that it's not done?
|
|
13
|
-
const {callee} = callExpressionNode;
|
|
14
|
-
return callee.object?.name === 'LitHtml' && callee.property?.name === 'render';
|
|
15
|
-
}
|
|
6
|
+
const {isLitHtmlRenderCall} = require('./utils.js');
|
|
16
7
|
|
|
17
8
|
module.exports = {
|
|
18
9
|
meta: {
|
|
@@ -26,4 +26,23 @@ function isLitHtmlTemplateCall(taggedTemplateExpressionNode) {
|
|
|
26
26
|
return isLitHtmlDotHtmlCall || isDestructuredHtmlCall;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* @param callExpressionNode - a CallExpression node from the AST of the parsed code.
|
|
31
|
+
* @returns {boolean} - `true` if the code matches LitHtml.render() or render(), and false otherwise.
|
|
32
|
+
*/
|
|
33
|
+
function isLitHtmlRenderCall(callExpressionNode) {
|
|
34
|
+
if (callExpressionNode.type !== 'CallExpression') {
|
|
35
|
+
throw new Error('Node of type other than CallExpresson passed to isLitHtmlRenderCall.');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const {callee} = callExpressionNode;
|
|
39
|
+
const isDestructuredRenderCall = callee.type === 'Identifier' && callee.name === 'render';
|
|
40
|
+
const isLitHtmlDotRenderCall = callee.object?.name === 'LitHtml' && callee.property?.name === 'render';
|
|
41
|
+
|
|
42
|
+
return isDestructuredRenderCall || isLitHtmlDotRenderCall;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
module.exports = {
|
|
46
|
+
isLitHtmlTemplateCall,
|
|
47
|
+
isLitHtmlRenderCall
|
|
48
|
+
};
|
|
@@ -37,4 +37,34 @@ describe('eslint utils', () => {
|
|
|
37
37
|
assert.strictEqual(result, false);
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
|
+
|
|
41
|
+
describe('isLitHtmlRenderCall', () => {
|
|
42
|
+
it('returns true if the code is LitHtml.render()', () => {
|
|
43
|
+
const code = 'LitHtml.render(LitHtml.html``, this.#shadow)';
|
|
44
|
+
const parsed = parser.parse(code);
|
|
45
|
+
const result = utils.isLitHtmlRenderCall(parsed.body[0].expression);
|
|
46
|
+
assert.strictEqual(result, true);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('returns true if the code is render()', () => {
|
|
50
|
+
const code = 'render(html``, this.#shadow)';
|
|
51
|
+
const parsed = parser.parse(code);
|
|
52
|
+
const result = utils.isLitHtmlRenderCall(parsed.body[0].expression);
|
|
53
|
+
assert.strictEqual(result, true);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('returns false if the code is not render()', () => {
|
|
57
|
+
const code = 'notRender(html``, this.#shadow)';
|
|
58
|
+
const parsed = parser.parse(code);
|
|
59
|
+
const result = utils.isLitHtmlRenderCall(parsed.body[0].expression);
|
|
60
|
+
assert.strictEqual(result, false);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('returns false if the code is LitHtml.notRender()', () => {
|
|
64
|
+
const code = 'LitHtml.notRender(html``, this.#shadow)';
|
|
65
|
+
const parsed = parser.parse(code);
|
|
66
|
+
const result = utils.isLitHtmlRenderCall(parsed.body[0].expression);
|
|
67
|
+
assert.strictEqual(result, false);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
40
70
|
});
|