chrome-devtools-frontend 1.0.1622369 → 1.0.1624409

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.
Files changed (33) hide show
  1. package/front_end/Images/src/expand.svg +1 -0
  2. package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +72 -8
  3. package/front_end/entrypoints/greendev_floaty/floaty.html +1 -1
  4. package/front_end/generated/Deprecation.ts +7 -0
  5. package/front_end/generated/InspectorBackendCommands.ts +1 -1
  6. package/front_end/generated/SupportedCSSProperties.js +6 -6
  7. package/front_end/generated/protocol.ts +1 -0
  8. package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +373 -112
  9. package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +57 -0
  10. package/front_end/models/ai_assistance/agents/NetworkAgent.ts +2 -1
  11. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +3 -10
  12. package/front_end/models/javascript_metadata/NativeFunctions.js +9 -4
  13. package/front_end/panels/ai_assistance/components/ChatMessage.ts +212 -3
  14. package/front_end/panels/console/ConsoleView.ts +86 -7
  15. package/front_end/panels/console/ConsoleViewMessage.ts +23 -1
  16. package/front_end/panels/elements/StylePropertiesSection.ts +1 -2
  17. package/front_end/panels/elements/StylePropertyTreeElement.ts +1 -1
  18. package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +6 -2
  19. package/front_end/panels/elements/StylesSidebarPane.ts +17 -4
  20. package/front_end/panels/emulation/DeviceModeToolbar.ts +37 -13
  21. package/front_end/panels/emulation/deviceModeView.css +25 -0
  22. package/front_end/panels/greendev/GreenDevPanel.ts +30 -3
  23. package/front_end/panels/media/EventDisplayTable.ts +1 -1
  24. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +48 -27
  25. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +67 -38
  26. package/front_end/panels/network/NetworkConfigView.ts +1 -1
  27. package/front_end/panels/profiler/HeapSnapshotView.ts +1 -22
  28. package/front_end/third_party/chromium/README.chromium +1 -1
  29. package/front_end/ui/legacy/UIUtils.ts +26 -4
  30. package/front_end/ui/visual_logging/KnownContextValues.ts +17 -0
  31. package/package.json +1 -1
  32. package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +0 -134
  33. package/front_end/panels/emulation/components/components.ts +0 -9
@@ -1,134 +0,0 @@
1
- // Copyright 2021 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
- /* eslint-disable @devtools/no-lit-render-outside-of-view */
5
-
6
- import type * as Platform from '../../../core/platform/platform.js';
7
- import * as EmulationModel from '../../../models/emulation/emulation.js';
8
- import * as UILegacy from '../../../ui/legacy/legacy.js';
9
- import {html, render} from '../../../ui/lit/lit.js';
10
- import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
11
-
12
- class SizeChangedEvent extends Event {
13
- static readonly eventName = 'sizechanged';
14
- constructor(public size: number) {
15
- super(SizeChangedEvent.eventName);
16
- }
17
- }
18
-
19
- function getInputValue(event: Event): number {
20
- return Number((event.target as HTMLInputElement).value);
21
- }
22
-
23
- export class SizeInputElement extends HTMLElement {
24
- #root = this.attachShadow({mode: 'open'});
25
- #disabled = false;
26
- #size = '0';
27
- #placeholder = '';
28
- #title: Platform.UIString.LocalizedString;
29
- #jslogContext: string;
30
-
31
- constructor(title: Platform.UIString.LocalizedString, {jslogContext}: {jslogContext: string}) {
32
- super();
33
- this.#title = title;
34
- this.#jslogContext = jslogContext;
35
- }
36
-
37
- connectedCallback(): void {
38
- this.render();
39
- }
40
-
41
- set disabled(disabled: boolean) {
42
- this.#disabled = disabled;
43
- this.render();
44
- }
45
-
46
- set size(size: string) {
47
- this.#size = size;
48
- this.render();
49
- }
50
-
51
- set placeholder(placeholder: string) {
52
- this.#placeholder = placeholder;
53
- this.render();
54
- }
55
-
56
- render(): void {
57
- render(
58
- // Since the emulation code runs in a different frame, we can't
59
- // use constructed stylesheets (they are disallowed cross-frame).
60
- // For now, use an inline style tag and later we can refactor this
61
- // to use proper constructed stylesheets, when the code runs
62
- // in the correct frame context.
63
- html`
64
- <style>
65
- input {
66
- /*
67
- * 4 characters for the maximum size of the value,
68
- * 2 characters for the width of the step-buttons,
69
- * 2 pixels padding between the characters and the
70
- * step-buttons.
71
- */
72
- width: calc(4ch + 2ch + 2px);
73
- max-height: 18px;
74
- border: var(--sys-color-neutral-outline);
75
- border-radius: 4px;
76
- margin: 0 2px;
77
- text-align: center;
78
- font-size: inherit;
79
- font-family: inherit;
80
- }
81
-
82
- input:disabled {
83
- user-select: none;
84
- }
85
-
86
- input:focus::-webkit-input-placeholder {
87
- color: transparent;
88
- }
89
- </style>
90
- <input type="number"
91
- max=${EmulationModel.DeviceModeModel.MaxDeviceSize}
92
- min=${EmulationModel.DeviceModeModel.MinDeviceSize}
93
- jslog=${VisualLogging.textField().track({change: true}).context(this.#jslogContext)}
94
- maxlength="4"
95
- title=${this.#title}
96
- placeholder=${this.#placeholder}
97
- ?disabled=${this.#disabled}
98
- .value=${this.#size}
99
- @change=${this.#fireSizeChange}
100
- @keydown=${this.#handleModifierKeys} />
101
- `,
102
- this.#root, {host: this});
103
- }
104
-
105
- #fireSizeChange(event: Event): void {
106
- this.dispatchEvent(new SizeChangedEvent(getInputValue(event)));
107
- }
108
-
109
- #handleModifierKeys(event: Event): void {
110
- let modifiedValue = UILegacy.UIUtils.modifiedFloatNumber(getInputValue(event), event);
111
- if (modifiedValue === null) {
112
- return;
113
- }
114
-
115
- modifiedValue = Math.min(modifiedValue, EmulationModel.DeviceModeModel.MaxDeviceSize);
116
- modifiedValue = Math.max(modifiedValue, EmulationModel.DeviceModeModel.MinDeviceSize);
117
-
118
- event.preventDefault();
119
- (event.target as HTMLInputElement).value = String(modifiedValue);
120
- this.dispatchEvent(new SizeChangedEvent(modifiedValue));
121
- }
122
- }
123
-
124
- // eslint-disable-next-line @devtools/enforce-custom-element-prefix
125
- customElements.define('device-mode-emulation-size-input', SizeInputElement);
126
-
127
- declare global {
128
- interface HTMLElementTagNameMap {
129
- 'device-mode-emulation-size-input': SizeInputElement;
130
- }
131
- interface HTMLElementEventMap {
132
- sizechanged: SizeChangedEvent;
133
- }
134
- }
@@ -1,9 +0,0 @@
1
- // Copyright 2021 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import * as DeviceSizeInputElement from './DeviceSizeInputElement.js';
6
-
7
- export {
8
- DeviceSizeInputElement,
9
- };