chrome-devtools-frontend 1.0.1549484 → 1.0.1550444
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/docs/styleguide/ux/components.md +53 -12
- package/docs/styleguide/ux/images/cards.png +0 -0
- package/docs/ui_engineering.md +2 -2
- package/front_end/core/sdk/NetworkManager.ts +12 -10
- package/front_end/core/sdk/PageResourceLoader.ts +8 -1
- package/front_end/core/sdk/SourceMapManager.ts +12 -6
- package/front_end/entrypoints/main/MainImpl.ts +0 -9
- package/front_end/foundation/Universe.ts +7 -0
- package/front_end/generated/InspectorBackendCommands.ts +5 -2
- package/front_end/generated/protocol-mapping.d.ts +8 -0
- package/front_end/generated/protocol-proxy-api.d.ts +6 -0
- package/front_end/generated/protocol.ts +76 -0
- package/front_end/models/ai_assistance/BuiltInAi.ts +79 -5
- package/front_end/models/issues_manager/AttributionReportingIssue.ts +6 -8
- package/front_end/models/issues_manager/BounceTrackingIssue.ts +4 -14
- package/front_end/models/issues_manager/ClientHintIssue.ts +5 -12
- package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +5 -12
- package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +7 -14
- package/front_end/models/issues_manager/CookieIssue.ts +27 -30
- package/front_end/models/issues_manager/CorsIssue.ts +8 -17
- package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +5 -8
- package/front_end/models/issues_manager/DeprecationIssue.ts +7 -14
- package/front_end/models/issues_manager/ElementAccessibilityIssue.ts +7 -14
- package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +4 -11
- package/front_end/models/issues_manager/FederatedAuthUserInfoRequestIssue.ts +4 -11
- package/front_end/models/issues_manager/GenericIssue.ts +11 -16
- package/front_end/models/issues_manager/HeavyAdIssue.ts +4 -11
- package/front_end/models/issues_manager/Issue.ts +12 -4
- package/front_end/models/issues_manager/IssueAggregator.ts +8 -2
- package/front_end/models/issues_manager/LowTextContrastIssue.ts +3 -10
- package/front_end/models/issues_manager/MixedContentIssue.ts +7 -13
- package/front_end/models/issues_manager/PartitioningBlobURLIssue.ts +4 -11
- package/front_end/models/issues_manager/PropertyRuleIssue.ts +6 -12
- package/front_end/models/issues_manager/QuirksModeIssue.ts +3 -10
- package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +7 -13
- package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +4 -11
- package/front_end/models/issues_manager/SharedDictionaryIssue.ts +6 -13
- package/front_end/models/issues_manager/StylesheetLoadingIssue.ts +8 -13
- package/front_end/models/issues_manager/UnencodedDigestIssue.ts +2 -9
- package/front_end/models/javascript_metadata/NativeFunctions.js +0 -13
- package/front_end/panels/application/AppManifestView.ts +4 -4
- package/front_end/panels/application/ApplicationPanelSidebar.ts +21 -21
- package/front_end/panels/application/BackForwardCacheTreeElement.ts +2 -2
- package/front_end/panels/application/BounceTrackingMitigationsTreeElement.ts +2 -2
- package/front_end/panels/application/InterestGroupTreeElement.ts +2 -2
- package/front_end/panels/application/OpenedWindowDetailsView.ts +2 -2
- package/front_end/panels/application/OriginTrialTreeView.ts +1 -1
- package/front_end/panels/application/PreloadingTreeElement.ts +3 -3
- package/front_end/panels/application/ReportingApiTreeElement.ts +2 -2
- package/front_end/panels/application/ServiceWorkerCacheTreeElement.ts +3 -3
- package/front_end/panels/application/SharedStorageListTreeElement.ts +2 -2
- package/front_end/panels/application/StorageBucketsTreeElement.ts +3 -3
- package/front_end/panels/application/StorageView.ts +2 -2
- package/front_end/panels/application/TrustTokensTreeElement.ts +2 -2
- package/front_end/panels/application/components/PermissionsPolicySection.ts +1 -1
- package/front_end/panels/application/components/ProtocolHandlersView.ts +1 -1
- package/front_end/panels/application/components/SharedStorageMetadataView.ts +1 -1
- package/front_end/panels/application/components/TrustTokensView.ts +1 -1
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +1 -1
- package/front_end/panels/application/preloading/components/RuleSetGrid.ts +1 -1
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +1 -1
- package/front_end/panels/changes/ChangesSidebar.ts +2 -0
- package/front_end/panels/changes/CombinedDiffView.ts +2 -0
- package/front_end/panels/common/AnnotationManager.ts +71 -0
- package/front_end/panels/common/PersistenceUtils.ts +6 -7
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/console/ConsolePrompt.ts +4 -4
- package/front_end/panels/console/ConsoleView.ts +2 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +10 -11
- package/front_end/panels/console_counters/WarningErrorCounter.ts +2 -0
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +1 -1
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +3 -3
- package/front_end/panels/elements/ElementsPanel.ts +49 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +156 -108
- package/front_end/panels/elements/ElementsTreeOutline.ts +9 -2
- package/front_end/panels/elements/ShortcutTreeElement.ts +2 -2
- package/front_end/panels/elements/StyleEditorWidget.ts +2 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -6
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -5
- package/front_end/panels/elements/TopLayerContainer.ts +2 -2
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
- package/front_end/panels/elements/components/ElementsTreeExpandButton.ts +1 -1
- package/front_end/panels/elements/components/QueryContainer.ts +1 -1
- package/front_end/panels/elements/components/StylePropertyEditor.ts +1 -1
- package/front_end/panels/emulation/DeviceModeWrapper.ts +48 -3
- package/front_end/panels/explain/components/ConsoleInsight.ts +6 -4
- package/front_end/panels/issues/AffectedResourcesView.ts +2 -2
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +2 -2
- package/front_end/panels/issues/IssueKindView.ts +2 -2
- package/front_end/panels/issues/IssueView.ts +4 -4
- package/front_end/panels/js_timeline/js_timeline-meta.ts +4 -2
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +1 -1
- package/front_end/panels/media/PlayerListView.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +2 -2
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +2 -3
- package/front_end/panels/network/NetworkDataGridNode.ts +3 -3
- package/front_end/panels/network/NetworkFrameGrouper.ts +2 -2
- package/front_end/panels/network/NetworkItemView.ts +4 -4
- package/front_end/panels/network/NetworkLogViewColumns.ts +3 -3
- package/front_end/panels/network/RequestCookiesView.ts +2 -2
- package/front_end/panels/network/SignedExchangeInfoView.ts +2 -2
- package/front_end/panels/network/components/RequestTrustTokensView.ts +5 -6
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +3 -3
- package/front_end/panels/profiler/ProfileDataGrid.ts +2 -2
- package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
- package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
- package/front_end/panels/recorder/components/CreateRecordingView.ts +1 -1
- package/front_end/panels/recorder/components/ExtensionView.ts +1 -1
- package/front_end/panels/recorder/components/RecordingListView.ts +1 -1
- package/front_end/panels/recorder/components/RecordingView.ts +1 -1
- package/front_end/panels/recorder/components/StepView.ts +1 -1
- package/front_end/panels/screencast/ScreencastView.ts +8 -8
- package/front_end/panels/search/SearchView.ts +1 -1
- package/front_end/panels/security/CookieControlsTreeElement.ts +2 -2
- package/front_end/panels/security/CookieReportTreeElement.ts +2 -2
- package/front_end/panels/security/SecurityPanel.ts +5 -5
- package/front_end/panels/security/SecurityPanelSidebar.ts +3 -4
- package/front_end/panels/settings/KeybindsSettingsTab.ts +4 -4
- package/front_end/panels/settings/SettingsScreen.ts +2 -3
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +16 -8
- package/front_end/panels/sources/BreakpointEditDialog.ts +3 -3
- package/front_end/panels/sources/BreakpointsView.ts +1 -1
- package/front_end/panels/sources/CSSPlugin.ts +3 -3
- package/front_end/panels/sources/CallStackSidebarPane.ts +4 -4
- package/front_end/panels/sources/DebuggerPausedMessage.ts +3 -3
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +39 -30
- package/front_end/panels/sources/GoToLineQuickOpen.ts +11 -7
- package/front_end/panels/sources/NavigatorView.ts +2 -2
- package/front_end/panels/sources/OpenFileQuickOpen.ts +11 -15
- package/front_end/panels/sources/OutlineQuickOpen.ts +23 -26
- package/front_end/panels/sources/SourcesView.ts +2 -2
- package/front_end/panels/sources/TabbedEditorContainer.ts +4 -5
- package/front_end/panels/sources/ThreadsSidebarPane.ts +2 -2
- package/front_end/panels/sources/UISourceCodeFrame.ts +5 -5
- package/front_end/panels/timeline/TimelineHistoryManager.ts +2 -2
- package/front_end/panels/timeline/TimelinePanel.ts +14 -9
- package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +1 -1
- package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -1
- package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +1 -1
- package/front_end/panels/timeline/components/NetworkThrottlingSelector.ts +1 -1
- package/front_end/panels/timeline/components/OriginMap.ts +1 -1
- package/front_end/panels/timeline/components/insights/Checklist.ts +1 -1
- package/front_end/panels/timeline/components/insights/DOMSize.ts +1 -1
- package/front_end/panels/timeline/components/insights/ImageDelivery.ts +1 -1
- package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +1 -1
- package/front_end/panels/timeline/overlays/components/EntriesLinkOverlay.ts +1 -1
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +1 -1
- package/front_end/panels/timeline/timeline-meta.ts +3 -2
- package/front_end/panels/utils/utils.ts +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/adorners/Adorner.ts +20 -0
- package/front_end/ui/components/annotations/AnnotationRepository.ts +1 -1
- package/front_end/ui/components/buttons/Button.ts +1 -1
- package/front_end/ui/components/buttons/FloatingButton.ts +1 -1
- package/front_end/ui/components/highlighting/HighlightElement.ts +15 -2
- package/front_end/ui/components/icon_button/FileSourceIcon.ts +1 -1
- package/front_end/ui/components/icon_button/IconButton.ts +1 -1
- package/front_end/ui/components/icon_button/icon_button.ts +0 -2
- package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +3 -3
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
- package/front_end/ui/components/settings/SettingDeprecationWarning.ts +1 -1
- package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
- package/front_end/ui/components/text_editor/config.ts +2 -2
- package/front_end/ui/kit/cards/Card.docs.ts +43 -0
- package/front_end/ui/{components/icon_button → kit/icons}/Icon.docs.ts +3 -4
- package/front_end/ui/{components/icon_button → kit/icons}/Icon.ts +4 -4
- package/front_end/ui/kit/kit.ts +1 -0
- package/front_end/ui/legacy/Infobar.ts +3 -3
- package/front_end/ui/legacy/InspectorView.ts +3 -3
- package/front_end/ui/legacy/SearchableView.ts +2 -2
- package/front_end/ui/legacy/SoftContextMenu.ts +5 -5
- package/front_end/ui/legacy/SoftDropDown.ts +2 -2
- package/front_end/ui/legacy/TabbedPane.ts +9 -9
- package/front_end/ui/legacy/Toolbar.ts +3 -3
- package/front_end/ui/legacy/Treeoutline.ts +2 -2
- package/front_end/ui/legacy/UIUtils.ts +4 -4
- package/front_end/ui/legacy/ViewManager.ts +4 -4
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +8 -8
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +4 -4
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +4 -4
- package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +2 -2
- package/front_end/ui/legacy/components/inline_editor/Swatches.ts +5 -5
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +3 -3
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +3 -3
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +22 -29
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +8 -15
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +11 -14
- package/front_end/ui/legacy/components/utils/Linkifier.ts +3 -3
- package/mcp/mcp.ts +1 -0
- package/package.json +1 -1
- /package/front_end/ui/{components/icon_button → kit/icons}/icon.css +0 -0
|
@@ -10,7 +10,7 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
10
10
|
import type * as Platform from '../../core/platform/platform.js';
|
|
11
11
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
12
12
|
import * as Protocol from '../../generated/protocol.js';
|
|
13
|
-
import
|
|
13
|
+
import {createIcon, Icon} from '../../ui/kit/kit.js';
|
|
14
14
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
15
15
|
|
|
16
16
|
import {InputModel} from './InputModel.js';
|
|
@@ -104,8 +104,8 @@ export class ScreencastView extends UI.Widget.VBox implements SDK.OverlayModel.H
|
|
|
104
104
|
private navigationProgressBar?: ProgressTracker;
|
|
105
105
|
private touchInputToggle?: HTMLButtonElement;
|
|
106
106
|
private mouseInputToggle?: HTMLButtonElement;
|
|
107
|
-
private touchInputToggleIcon?:
|
|
108
|
-
private mouseInputToggleIcon?:
|
|
107
|
+
private touchInputToggleIcon?: Icon;
|
|
108
|
+
private mouseInputToggleIcon?: Icon;
|
|
109
109
|
private historyIndex?: number;
|
|
110
110
|
private historyEntries?: Protocol.Page.NavigationEntry[];
|
|
111
111
|
private isCasting = false;
|
|
@@ -648,17 +648,17 @@ export class ScreencastView extends UI.Widget.VBox implements SDK.OverlayModel.H
|
|
|
648
648
|
this.navigationBar = this.element.createChild('div', 'screencast-navigation');
|
|
649
649
|
|
|
650
650
|
this.navigationBack = this.navigationBar.createChild('button', 'navigation');
|
|
651
|
-
this.navigationBack.appendChild(
|
|
651
|
+
this.navigationBack.appendChild(createIcon('arrow-back'));
|
|
652
652
|
this.navigationBack.disabled = true;
|
|
653
653
|
UI.ARIAUtils.setLabel(this.navigationBack, i18nString(UIStrings.back));
|
|
654
654
|
|
|
655
655
|
this.navigationForward = this.navigationBar.createChild('button', 'navigation');
|
|
656
|
-
this.navigationForward.appendChild(
|
|
656
|
+
this.navigationForward.appendChild(createIcon('arrow-forward'));
|
|
657
657
|
this.navigationForward.disabled = true;
|
|
658
658
|
UI.ARIAUtils.setLabel(this.navigationForward, i18nString(UIStrings.forward));
|
|
659
659
|
|
|
660
660
|
this.navigationReload = this.navigationBar.createChild('button', 'navigation');
|
|
661
|
-
this.navigationReload.appendChild(
|
|
661
|
+
this.navigationReload.appendChild(createIcon('refresh'));
|
|
662
662
|
UI.ARIAUtils.setLabel(this.navigationReload, i18nString(UIStrings.reload));
|
|
663
663
|
|
|
664
664
|
this.navigationUrl = this.navigationBar.appendChild(UI.UIUtils.createInput());
|
|
@@ -668,14 +668,14 @@ export class ScreencastView extends UI.Widget.VBox implements SDK.OverlayModel.H
|
|
|
668
668
|
this.mouseInputToggle = this.navigationBar.createChild('button');
|
|
669
669
|
this.mouseInputToggle.disabled = true;
|
|
670
670
|
{
|
|
671
|
-
this.mouseInputToggleIcon = this.mouseInputToggle.appendChild(new
|
|
671
|
+
this.mouseInputToggleIcon = this.mouseInputToggle.appendChild(new Icon());
|
|
672
672
|
this.mouseInputToggleIcon.name = 'mouse';
|
|
673
673
|
this.mouseInputToggleIcon.classList.toggle('toggled', true);
|
|
674
674
|
}
|
|
675
675
|
UI.ARIAUtils.setLabel(this.mouseInputToggle, i18nString(UIStrings.mouseInput));
|
|
676
676
|
|
|
677
677
|
this.touchInputToggle = this.navigationBar.createChild('button');
|
|
678
|
-
this.touchInputToggleIcon = this.touchInputToggle.appendChild(
|
|
678
|
+
this.touchInputToggleIcon = this.touchInputToggle.appendChild(createIcon('touch-app'));
|
|
679
679
|
UI.ARIAUtils.setLabel(this.touchInputToggle, i18nString(UIStrings.touchInput));
|
|
680
680
|
|
|
681
681
|
this.navigationProgressBar = new ProgressTracker(
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import '../../ui/legacy/legacy.js';
|
|
6
|
-
import '../../ui/
|
|
6
|
+
import '../../ui/kit/kit.js';
|
|
7
7
|
|
|
8
8
|
import * as Common from '../../core/common/common.js';
|
|
9
9
|
import * as Host from '../../core/host/host.js';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// Copyright 2024 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
import
|
|
4
|
+
import {createIcon} from '../../ui/kit/kit.js';
|
|
5
5
|
|
|
6
6
|
import {SecurityPanelSidebarTreeElement} from './SecurityPanelSidebarTreeElement.js';
|
|
7
7
|
|
|
8
8
|
export class CookieControlsTreeElement extends SecurityPanelSidebarTreeElement {
|
|
9
9
|
constructor(title: string, jslogContext: string|number) {
|
|
10
10
|
super(title, false, jslogContext);
|
|
11
|
-
this.setLeadingIcons([
|
|
11
|
+
this.setLeadingIcons([createIcon('gear', 'cookie-icon')]);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
override get elemId(): string {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// Copyright 2024 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
import
|
|
4
|
+
import {createIcon} from '../../ui/kit/kit.js';
|
|
5
5
|
|
|
6
6
|
import {SecurityPanelSidebarTreeElement} from './SecurityPanelSidebarTreeElement.js';
|
|
7
7
|
|
|
8
8
|
export class CookieReportTreeElement extends SecurityPanelSidebarTreeElement {
|
|
9
9
|
constructor(title: string, jslogContext: string|number) {
|
|
10
10
|
super(title, false, jslogContext);
|
|
11
|
-
this.setLeadingIcons([
|
|
11
|
+
this.setLeadingIcons([createIcon('cookie', 'cookie-icon')]);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
override get elemId(): string {
|
|
@@ -10,7 +10,7 @@ import type * as Platform from '../../core/platform/platform.js';
|
|
|
10
10
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
11
11
|
import * as Protocol from '../../generated/protocol.js';
|
|
12
12
|
import * as NetworkForward from '../../panels/network/forward/forward.js';
|
|
13
|
-
import
|
|
13
|
+
import {createIcon, type Icon} from '../../ui/kit/kit.js';
|
|
14
14
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
15
15
|
import {html, render} from '../../ui/lit/lit.js';
|
|
16
16
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
@@ -470,7 +470,7 @@ const WARNING_ICON_NAME = 'warning';
|
|
|
470
470
|
const UNKNOWN_ICON_NAME = 'indeterminate-question-box';
|
|
471
471
|
|
|
472
472
|
export function getSecurityStateIconForDetailedView(
|
|
473
|
-
securityState: Protocol.Security.SecurityState, className: string):
|
|
473
|
+
securityState: Protocol.Security.SecurityState, className: string): Icon {
|
|
474
474
|
let iconName: string;
|
|
475
475
|
|
|
476
476
|
switch (securityState) {
|
|
@@ -488,11 +488,11 @@ export function getSecurityStateIconForDetailedView(
|
|
|
488
488
|
break;
|
|
489
489
|
}
|
|
490
490
|
|
|
491
|
-
return
|
|
491
|
+
return createIcon(iconName, className);
|
|
492
492
|
}
|
|
493
493
|
|
|
494
494
|
export function getSecurityStateIconForOverview(
|
|
495
|
-
securityState: Protocol.Security.SecurityState, className: string):
|
|
495
|
+
securityState: Protocol.Security.SecurityState, className: string): Icon {
|
|
496
496
|
let iconName: string;
|
|
497
497
|
switch (securityState) {
|
|
498
498
|
case Protocol.Security.SecurityState.Unknown: // fallthrough
|
|
@@ -509,7 +509,7 @@ export function getSecurityStateIconForOverview(
|
|
|
509
509
|
case Protocol.Security.SecurityState.Info:
|
|
510
510
|
throw new Error(`Unexpected security state ${securityState}`);
|
|
511
511
|
}
|
|
512
|
-
return
|
|
512
|
+
return createIcon(iconName, className);
|
|
513
513
|
}
|
|
514
514
|
|
|
515
515
|
export function createHighlightedUrl(url: Platform.DevToolsPath.UrlString, securityState: string): Element {
|
|
@@ -8,7 +8,7 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
8
8
|
import * as Platform from '../../core/platform/platform.js';
|
|
9
9
|
import * as Root from '../../core/root/root.js';
|
|
10
10
|
import * as Protocol from '../../generated/protocol.js';
|
|
11
|
-
import type
|
|
11
|
+
import type {Icon} from '../../ui/kit/kit.js';
|
|
12
12
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
13
13
|
|
|
14
14
|
import {CookieControlsTreeElement} from './CookieControlsTreeElement.js';
|
|
@@ -73,7 +73,7 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
|
73
73
|
export class SecurityPanelSidebar extends UI.Widget.VBox {
|
|
74
74
|
readonly #securitySidebarLastItemSetting: Common.Settings.Setting<string>;
|
|
75
75
|
readonly sidebarTree: UI.TreeOutline.TreeOutlineInShadow;
|
|
76
|
-
readonly #originGroupTitles: Map<OriginGroup, {title: string, icon?:
|
|
76
|
+
readonly #originGroupTitles: Map<OriginGroup, {title: string, icon?: Icon}>;
|
|
77
77
|
#originGroups: Map<OriginGroup, UI.TreeOutline.TreeElement>;
|
|
78
78
|
securityOverviewElement: OriginTreeElement;
|
|
79
79
|
readonly #cookieControlsTreeElement: CookieControlsTreeElement|undefined;
|
|
@@ -204,8 +204,7 @@ export class SecurityPanelSidebar extends UI.Widget.VBox {
|
|
|
204
204
|
return this.#originGroups.get(originGroup) as UI.TreeOutline.TreeElement;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
#createOriginGroupElement(originGroupTitle: string, originGroupIcon?:
|
|
208
|
-
UI.TreeOutline.TreeElement {
|
|
207
|
+
#createOriginGroupElement(originGroupTitle: string, originGroupIcon?: Icon): UI.TreeOutline.TreeElement {
|
|
209
208
|
const originGroup = new UI.TreeOutline.TreeElement(originGroupTitle, true);
|
|
210
209
|
originGroup.selectable = false;
|
|
211
210
|
originGroup.expand();
|
|
@@ -10,7 +10,7 @@ import * as Host from '../../core/host/host.js';
|
|
|
10
10
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
11
11
|
import * as Platform from '../../core/platform/platform.js';
|
|
12
12
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
13
|
-
import
|
|
13
|
+
import {createIcon, type Icon} from '../../ui/kit/kit.js';
|
|
14
14
|
import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
|
|
15
15
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
16
16
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
@@ -383,7 +383,7 @@ export class ShortcutListItem {
|
|
|
383
383
|
|
|
384
384
|
private createEmptyInfo(): void {
|
|
385
385
|
if (UI.ShortcutRegistry.ShortcutRegistry.instance().actionHasDefaultShortcut(this.item.id())) {
|
|
386
|
-
const icon =
|
|
386
|
+
const icon = createIcon('keyboard-pen', 'keybinds-modified');
|
|
387
387
|
UI.ARIAUtils.setLabel(icon, i18nString(UIStrings.shortcutModified));
|
|
388
388
|
this.element.appendChild(icon);
|
|
389
389
|
}
|
|
@@ -441,9 +441,9 @@ export class ShortcutListItem {
|
|
|
441
441
|
if (this.editedShortcuts.has(shortcut) && !this.editedShortcuts.get(shortcut)) {
|
|
442
442
|
return;
|
|
443
443
|
}
|
|
444
|
-
let icon:
|
|
444
|
+
let icon: Icon;
|
|
445
445
|
if (shortcut.type !== UI.KeyboardShortcut.Type.UNSET_SHORTCUT && !shortcut.isDefault()) {
|
|
446
|
-
icon =
|
|
446
|
+
icon = createIcon('keyboard-pen', 'keybinds-modified');
|
|
447
447
|
UI.ARIAUtils.setLabel(icon, i18nString(UIStrings.shortcutModified));
|
|
448
448
|
this.element.appendChild(icon);
|
|
449
449
|
}
|
|
@@ -12,9 +12,8 @@ import * as Host from '../../core/host/host.js';
|
|
|
12
12
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
13
13
|
import * as Root from '../../core/root/root.js';
|
|
14
14
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
15
|
-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
16
15
|
import * as UIHelpers from '../../ui/helpers/helpers.js';
|
|
17
|
-
import type
|
|
16
|
+
import {type Card, createIcon} from '../../ui/kit/kit.js';
|
|
18
17
|
import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
|
|
19
18
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
20
19
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
@@ -460,7 +459,7 @@ export class ExperimentsSettingsTab extends UI.Widget.VBox implements SettingsTa
|
|
|
460
459
|
private createExperimentsWarningSubsection(warningMessage: string): HTMLElement {
|
|
461
460
|
const subsection = document.createElement('div');
|
|
462
461
|
subsection.classList.add('experiments-warning-subsection');
|
|
463
|
-
const warningIcon =
|
|
462
|
+
const warningIcon = createIcon('warning');
|
|
464
463
|
subsection.appendChild(warningIcon);
|
|
465
464
|
const warning = subsection.createChild('span');
|
|
466
465
|
warning.textContent = warningMessage;
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
import '../../ui/kit/kit.js';
|
|
6
|
+
import '../../ui/components/highlighting/highlighting.js';
|
|
7
|
+
|
|
5
8
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
9
|
import type * as Workspace from '../../models/workspace/workspace.js';
|
|
7
|
-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
8
10
|
import * as QuickOpen from '../../ui/legacy/components/quick_open/quick_open.js';
|
|
11
|
+
import {html, type TemplateResult} from '../../ui/lit/lit.js';
|
|
9
12
|
|
|
10
13
|
import {evaluateScriptSnippet, findSnippetsProject} from './ScriptSnippetFileSystem.js';
|
|
11
14
|
|
|
@@ -81,13 +84,18 @@ export class SnippetsQuickOpen extends QuickOpen.FilteredListWidget.Provider {
|
|
|
81
84
|
return this.snippets[itemIndex].name();
|
|
82
85
|
}
|
|
83
86
|
|
|
84
|
-
override renderItem(itemIndex: number, query: string
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
override renderItem(itemIndex: number, query: string): TemplateResult {
|
|
88
|
+
// clang-format off
|
|
89
|
+
const snippet = this.snippets[itemIndex].name();
|
|
90
|
+
const highlightRanges = QuickOpen.FilteredListWidget.FilteredListWidget.getHighlightRanges(snippet, query, true);
|
|
91
|
+
return html`
|
|
92
|
+
<devtools-icon class="snippet" name="snippet"></devtools-icon>
|
|
93
|
+
<div>
|
|
94
|
+
<devtools-highlight type="markup" ranges=${highlightRanges}>
|
|
95
|
+
${snippet}
|
|
96
|
+
</devtools-highlight>
|
|
97
|
+
</div>`;
|
|
98
|
+
// clang-format on
|
|
91
99
|
}
|
|
92
100
|
}
|
|
93
101
|
|
|
@@ -10,8 +10,8 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
10
10
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
11
11
|
import type * as BreakpointManager from '../../models/breakpoints/breakpoints.js';
|
|
12
12
|
import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
|
13
|
-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
14
13
|
import * as TextEditor from '../../ui/components/text_editor/text_editor.js';
|
|
14
|
+
import {createIcon} from '../../ui/kit/kit.js';
|
|
15
15
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
16
16
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
17
17
|
|
|
@@ -181,7 +181,7 @@ export class BreakpointEditDialog extends UI.Widget.Widget {
|
|
|
181
181
|
}));
|
|
182
182
|
editorWrapper.appendChild(this.editor);
|
|
183
183
|
|
|
184
|
-
const closeIcon =
|
|
184
|
+
const closeIcon = createIcon('cross');
|
|
185
185
|
closeIcon.title = i18nString(UIStrings.closeDialog);
|
|
186
186
|
closeIcon.setAttribute('jslog', `${VisualLogging.close().track({click: true})}`);
|
|
187
187
|
closeIcon.onclick = () => this.finishEditing(true, this.editor.state.doc.toString());
|
|
@@ -196,7 +196,7 @@ export class BreakpointEditDialog extends UI.Widget.Widget {
|
|
|
196
196
|
const link = UI.Fragment.html`<x-link class="link devtools-link" tabindex="0" href="https://goo.gle/devtools-loc"
|
|
197
197
|
jslog="${VisualLogging.link('learn-more')}">${
|
|
198
198
|
i18nString(UIStrings.learnMoreOnBreakpointTypes)}</x-link>` as UI.XLink.XLink;
|
|
199
|
-
const linkIcon =
|
|
199
|
+
const linkIcon = createIcon('open-externally', 'link-icon');
|
|
200
200
|
link.prepend(linkIcon);
|
|
201
201
|
linkWrapper.appendChild(link);
|
|
202
202
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import '../../ui/
|
|
5
|
+
import '../../ui/kit/kit.js';
|
|
6
6
|
|
|
7
7
|
import * as Common from '../../core/common/common.js';
|
|
8
8
|
import * as Host from '../../core/host/host.js';
|
|
@@ -13,7 +13,7 @@ import * as Bindings from '../../models/bindings/bindings.js';
|
|
|
13
13
|
import * as Geometry from '../../models/geometry/geometry.js';
|
|
14
14
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
15
15
|
import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
|
16
|
-
import
|
|
16
|
+
import {createIcon, type Icon} from '../../ui/kit/kit.js';
|
|
17
17
|
import * as ColorPicker from '../../ui/legacy/components/color_picker/color_picker.js';
|
|
18
18
|
import * as InlineEditor from '../../ui/legacy/components/inline_editor/inline_editor.js';
|
|
19
19
|
import type * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
@@ -211,7 +211,7 @@ class CurveSwatchWidget extends CodeMirror.WidgetType {
|
|
|
211
211
|
toDOM(view: CodeMirror.EditorView): HTMLElement {
|
|
212
212
|
const container = document.createElement('span');
|
|
213
213
|
const bezierText = container.createChild('span');
|
|
214
|
-
const icon =
|
|
214
|
+
const icon = createIcon('bezier-curve-filled', 'bezier-swatch-icon');
|
|
215
215
|
icon.setAttribute('jslog', `${VisualLogging.showStyleEditor('bezier')}`);
|
|
216
216
|
bezierText.append(this.text);
|
|
217
217
|
UI.Tooltip.Tooltip.install(icon, i18nString(UIStrings.openCubicBezierEditor));
|
|
@@ -251,7 +251,7 @@ type ActiveTooltip = {
|
|
|
251
251
|
pos: number,
|
|
252
252
|
text: string,
|
|
253
253
|
curve: Geometry.CubicBezier,
|
|
254
|
-
swatch:
|
|
254
|
+
swatch: Icon,
|
|
255
255
|
};
|
|
256
256
|
|
|
257
257
|
function createCSSTooltip(active: ActiveTooltip): CodeMirror.Tooltip {
|
|
@@ -38,7 +38,7 @@ import * as Bindings from '../../models/bindings/bindings.js';
|
|
|
38
38
|
import * as Persistence from '../../models/persistence/persistence.js';
|
|
39
39
|
import * as SourceMapScopes from '../../models/source_map_scopes/source_map_scopes.js';
|
|
40
40
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
41
|
-
import
|
|
41
|
+
import {Icon} from '../../ui/kit/kit.js';
|
|
42
42
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
43
43
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
44
44
|
|
|
@@ -126,7 +126,7 @@ export class CallStackSidebarPane extends UI.View.SimpleView implements UI.Conte
|
|
|
126
126
|
this.notPausedMessageElement.tabIndex = -1;
|
|
127
127
|
|
|
128
128
|
this.callFrameWarningsElement = this.contentElement.createChild('div', 'call-frame-warnings-message');
|
|
129
|
-
const icon = new
|
|
129
|
+
const icon = new Icon();
|
|
130
130
|
icon.name = 'warning-filled';
|
|
131
131
|
icon.classList.add('call-frame-warning-icon', 'small');
|
|
132
132
|
this.callFrameWarningsElement.appendChild(icon);
|
|
@@ -330,14 +330,14 @@ export class CallStackSidebarPane extends UI.View.SimpleView implements UI.Conte
|
|
|
330
330
|
element.classList.toggle('selected', isSelected);
|
|
331
331
|
UI.ARIAUtils.setSelected(element, isSelected);
|
|
332
332
|
element.classList.toggle('hidden', !this.showIgnoreListed && item.isIgnoreListed);
|
|
333
|
-
const icon = new
|
|
333
|
+
const icon = new Icon();
|
|
334
334
|
icon.name = 'large-arrow-right-filled';
|
|
335
335
|
icon.classList.add('selected-call-frame-icon', 'small');
|
|
336
336
|
element.appendChild(icon);
|
|
337
337
|
element.tabIndex = item === this.list.selectedItem() ? 0 : -1;
|
|
338
338
|
|
|
339
339
|
if (callframe?.missingDebugInfoDetails) {
|
|
340
|
-
const icon = new
|
|
340
|
+
const icon = new Icon();
|
|
341
341
|
icon.name = 'warning-filled';
|
|
342
342
|
icon.classList.add('call-frame-warning-icon', 'small');
|
|
343
343
|
const messages = callframe.missingDebugInfoDetails.resources.map(
|
|
@@ -9,8 +9,8 @@ import * as SDK from '../../core/sdk/sdk.js';
|
|
|
9
9
|
import * as Protocol from '../../generated/protocol.js';
|
|
10
10
|
import type * as Bindings from '../../models/bindings/bindings.js';
|
|
11
11
|
import type * as BreakpointManager from '../../models/breakpoints/breakpoints.js';
|
|
12
|
-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
13
12
|
import * as uiI18n from '../../ui/i18n/i18n.js';
|
|
13
|
+
import {Icon} from '../../ui/kit/kit.js';
|
|
14
14
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
15
15
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
16
16
|
import * as PanelsCommon from '../common/common.js';
|
|
@@ -158,7 +158,7 @@ export class DebuggerPausedMessage {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
const mainElement = messageWrapper.createChild('div', 'status-main');
|
|
161
|
-
const mainIcon = new
|
|
161
|
+
const mainIcon = new Icon();
|
|
162
162
|
mainIcon.name = 'info';
|
|
163
163
|
mainIcon.style.color = 'var(--sys-color-on-yellow-container)';
|
|
164
164
|
mainIcon.classList.add('medium');
|
|
@@ -290,7 +290,7 @@ export class DebuggerPausedMessage {
|
|
|
290
290
|
function buildWrapper(mainText: string, subText?: string, title?: string): Element {
|
|
291
291
|
const messageWrapper = document.createElement('span');
|
|
292
292
|
const mainElement = messageWrapper.createChild('div', 'status-main');
|
|
293
|
-
const mainIcon = new
|
|
293
|
+
const mainIcon = new Icon();
|
|
294
294
|
mainIcon.name = errorLike ? 'cross-circle-filled' : 'info';
|
|
295
295
|
mainIcon.style.color = errorLike ? 'var(--icon-error)' : 'var(--sys-color-on-yellow-container)';
|
|
296
296
|
mainIcon.classList.add('medium');
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
import '../../ui/components/highlighting/highlighting.js';
|
|
6
|
+
|
|
5
7
|
import type * as Common from '../../core/common/common.js';
|
|
6
8
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
9
|
import * as Root from '../../core/root/root.js';
|
|
8
10
|
import * as Persistence from '../../models/persistence/persistence.js';
|
|
9
11
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
10
|
-
import * as Highlighting from '../../ui/components/highlighting/highlighting.js';
|
|
11
12
|
import * as QuickOpen from '../../ui/legacy/components/quick_open/quick_open.js';
|
|
12
|
-
import
|
|
13
|
+
import {Directives, html, type TemplateResult} from '../../ui/lit/lit.js';
|
|
13
14
|
|
|
14
15
|
import {FilePathScoreFunction} from './FilePathScoreFunction.js';
|
|
15
16
|
import filteredUISourceCodeListProviderStyles from './filteredUISourceCodeListProvider.css.js';
|
|
@@ -25,8 +26,11 @@ const UIStrings = {
|
|
|
25
26
|
*/
|
|
26
27
|
sIgnoreListed: '{PH1} (ignore listed)',
|
|
27
28
|
} as const;
|
|
29
|
+
|
|
28
30
|
const str_ = i18n.i18n.registerUIStrings('panels/sources/FilteredUISourceCodeListProvider.ts', UIStrings);
|
|
29
31
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
32
|
+
const {classMap} = Directives;
|
|
33
|
+
|
|
30
34
|
export class FilteredUISourceCodeListProvider extends QuickOpen.FilteredListWidget.Provider {
|
|
31
35
|
private queryLineNumberAndColumnNumber: string;
|
|
32
36
|
private defaultScores: Map<Workspace.UISourceCode.UISourceCode, number>|null;
|
|
@@ -145,13 +149,7 @@ export class FilteredUISourceCodeListProvider extends QuickOpen.FilteredListWidg
|
|
|
145
149
|
return score + multiplier * (contentTypeBonus + this.scorer.calculateScore(fullDisplayName, null));
|
|
146
150
|
}
|
|
147
151
|
|
|
148
|
-
override renderItem(itemIndex: number, query: string
|
|
149
|
-
wrapperElement.createChild('style').textContent = filteredUISourceCodeListProviderStyles;
|
|
150
|
-
const itemElement = wrapperElement.createChild('div', 'filtered-ui-source-code-list-item');
|
|
151
|
-
|
|
152
|
-
const titleElement = itemElement.createChild('div', 'filtered-ui-source-code-title');
|
|
153
|
-
|
|
154
|
-
titleElement.classList.toggle('search-mode', Boolean(query));
|
|
152
|
+
override renderItem(itemIndex: number, query: string): TemplateResult {
|
|
155
153
|
query = this.rewriteQuery(query);
|
|
156
154
|
const uiSourceCode = this.uiSourceCodes[itemIndex];
|
|
157
155
|
const fullDisplayName = uiSourceCode.fullDisplayName();
|
|
@@ -164,42 +162,53 @@ export class FilteredUISourceCodeListProvider extends QuickOpen.FilteredListWidg
|
|
|
164
162
|
let tooltipText = fullDisplayName;
|
|
165
163
|
|
|
166
164
|
if (isIgnoreListed) {
|
|
167
|
-
itemElement.classList.add('is-ignore-listed');
|
|
168
165
|
tooltipText = i18nString(UIStrings.sIgnoreListed, {PH1: tooltipText});
|
|
169
166
|
}
|
|
170
167
|
|
|
171
|
-
|
|
172
|
-
const
|
|
173
|
-
this.renderSubtitleElement(subtitleElement, fullDisplayName.substring(0, fileNameIndex + 1));
|
|
174
|
-
UI.Tooltip.Tooltip.install((subtitleElement as HTMLElement), tooltipText);
|
|
175
|
-
|
|
176
|
-
const ranges = [];
|
|
177
|
-
for (let i = 0; i < indexes.length; ++i) {
|
|
178
|
-
ranges.push({offset: indexes[i], length: 1});
|
|
179
|
-
}
|
|
168
|
+
const titleRanges = [];
|
|
169
|
+
const subtitleRanges = [];
|
|
180
170
|
|
|
181
171
|
if (indexes[0] > fileNameIndex) {
|
|
182
|
-
for (let i = 0; i <
|
|
183
|
-
|
|
172
|
+
for (let i = 0; i < indexes.length; ++i) {
|
|
173
|
+
titleRanges.push({offset: indexes[i] - (fileNameIndex + 1), length: 1});
|
|
184
174
|
}
|
|
185
|
-
Highlighting.highlightRangesWithStyleClass(titleElement, ranges, 'highlight');
|
|
186
175
|
} else {
|
|
187
|
-
|
|
176
|
+
for (let i = 0; i < indexes.length; ++i) {
|
|
177
|
+
subtitleRanges.push({offset: indexes[i], length: 1});
|
|
178
|
+
}
|
|
188
179
|
}
|
|
180
|
+
// clang-format off
|
|
181
|
+
return html`
|
|
182
|
+
<style>${filteredUISourceCodeListProviderStyles}</style>
|
|
183
|
+
<div class="filtered-ui-source-code-list-item
|
|
184
|
+
${classMap({'is-ignore-listed': isIgnoreListed})}">
|
|
185
|
+
<devtools-highlight
|
|
186
|
+
type="markup"
|
|
187
|
+
ranges=${titleRanges.map(r => `${r.offset},${r.length}`).join(' ')}
|
|
188
|
+
class="filtered-ui-source-code-title ${classMap({'search-mode': Boolean(query)})}">
|
|
189
|
+
${uiSourceCode.displayName() + (this.queryLineNumberAndColumnNumber || '')}
|
|
190
|
+
</devtools-highlight>
|
|
191
|
+
<devtools-highlight
|
|
192
|
+
type="markup"
|
|
193
|
+
ranges=${subtitleRanges.map(r => `${r.offset},${r.length}`).join(' ')}
|
|
194
|
+
class="filtered-ui-source-code-subtitle" title=${tooltipText}>
|
|
195
|
+
${this.renderSubtitleElement(fullDisplayName.substring(0, fileNameIndex + 1))}
|
|
196
|
+
</devtools-highlight>
|
|
197
|
+
</div>`;
|
|
198
|
+
// clang-format on
|
|
189
199
|
}
|
|
190
200
|
|
|
191
|
-
private renderSubtitleElement(
|
|
192
|
-
element.removeChildren();
|
|
201
|
+
private renderSubtitleElement(text: string): TemplateResult {
|
|
193
202
|
let splitPosition = text.lastIndexOf('/');
|
|
194
203
|
const maxTextLength = 43;
|
|
195
204
|
if (text.length > maxTextLength) {
|
|
196
205
|
splitPosition = text.length - maxTextLength;
|
|
197
206
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
207
|
+
// clang-format off
|
|
208
|
+
return html`
|
|
209
|
+
<div class="first-part">${text.substring(0, splitPosition)}</div>
|
|
210
|
+
<div class="second-part">${text.substring(splitPosition)}</div>`;
|
|
211
|
+
// clang-format on
|
|
203
212
|
}
|
|
204
213
|
|
|
205
214
|
override selectItem(itemIndex: number|null, promptValue: string): void {
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
import '../../ui/kit/kit.js';
|
|
6
|
+
|
|
5
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
|
-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
7
8
|
import * as QuickOpen from '../../ui/legacy/components/quick_open/quick_open.js';
|
|
8
9
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
10
|
+
import {html, type TemplateResult} from '../../ui/lit/lit.js';
|
|
9
11
|
|
|
10
12
|
import {SourcesView} from './SourcesView.js';
|
|
11
13
|
import type {UISourceCodeFrame} from './UISourceCodeFrame.js';
|
|
@@ -77,12 +79,14 @@ export class GoToLineQuickOpen extends QuickOpen.FilteredListWidget.Provider {
|
|
|
77
79
|
return this.#goToLineStrings.length;
|
|
78
80
|
}
|
|
79
81
|
|
|
80
|
-
override renderItem(itemIndex: number, _query: string
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
override renderItem(itemIndex: number, _query: string): TemplateResult {
|
|
83
|
+
// clang-format off
|
|
84
|
+
return html`
|
|
85
|
+
<devtools-icon name="colon"></devtools-icon>
|
|
86
|
+
<div>
|
|
87
|
+
<div>${this.#goToLineStrings[itemIndex]}</div>
|
|
88
|
+
</div>`;
|
|
89
|
+
// clang-format on
|
|
86
90
|
}
|
|
87
91
|
|
|
88
92
|
override rewriteQuery(_query: string): string {
|
|
@@ -15,8 +15,8 @@ import * as Persistence from '../../models/persistence/persistence.js';
|
|
|
15
15
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
16
16
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
17
17
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
18
|
-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
19
18
|
import * as Spinners from '../../ui/components/spinners/spinners.js';
|
|
19
|
+
import {createIcon} from '../../ui/kit/kit.js';
|
|
20
20
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
21
21
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
22
22
|
import * as Snippets from '../snippets/snippets.js';
|
|
@@ -1287,7 +1287,7 @@ export class NavigatorFolderTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1287
1287
|
iconType = 'folder-asterisk';
|
|
1288
1288
|
}
|
|
1289
1289
|
|
|
1290
|
-
const icon =
|
|
1290
|
+
const icon = createIcon(iconType);
|
|
1291
1291
|
this.setLeadingIcons([icon]);
|
|
1292
1292
|
}
|
|
1293
1293
|
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
// Copyright 2012 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
import '../../ui/kit/kit.js';
|
|
5
6
|
|
|
6
7
|
import * as Common from '../../core/common/common.js';
|
|
7
8
|
import * as Host from '../../core/host/host.js';
|
|
8
9
|
import type * as Workspace from '../../models/workspace/workspace.js';
|
|
9
10
|
import {PanelUtils} from '../../panels/utils/utils.js';
|
|
10
|
-
import
|
|
11
|
+
import {Directives, html, type TemplateResult} from '../../ui/lit/lit.js';
|
|
11
12
|
|
|
12
13
|
import {FilteredUISourceCodeListProvider} from './FilteredUISourceCodeListProvider.js';
|
|
13
14
|
import {SourcesView} from './SourcesView.js';
|
|
14
15
|
|
|
16
|
+
const {styleMap} = Directives;
|
|
17
|
+
|
|
15
18
|
export class OpenFileQuickOpen extends FilteredUISourceCodeListProvider {
|
|
16
19
|
constructor() {
|
|
17
20
|
super('source-file');
|
|
@@ -40,19 +43,12 @@ export class OpenFileQuickOpen extends FilteredUISourceCodeListProvider {
|
|
|
40
43
|
return !project.isServiceProject();
|
|
41
44
|
}
|
|
42
45
|
|
|
43
|
-
override renderItem(itemIndex: number, query: string
|
|
44
|
-
super.renderItem(itemIndex, query, wrapperElement);
|
|
45
|
-
const itemElement = wrapperElement.firstChild;
|
|
46
|
-
if (!itemElement) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const iconElement = new IconButton.Icon.Icon();
|
|
46
|
+
override renderItem(itemIndex: number, query: string): TemplateResult {
|
|
50
47
|
const {iconName, color} = PanelUtils.iconDataForResourceType(this.itemContentTypeAt(itemIndex));
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
wrapperElement.insertBefore(iconElement, itemElement);
|
|
48
|
+
// clang-format off
|
|
49
|
+
return html`
|
|
50
|
+
<devtools-icon class="large" name=${iconName} style=${styleMap({color})}></devtools-icon>
|
|
51
|
+
${super.renderItem(itemIndex, query)}`;
|
|
52
|
+
// clang-format on
|
|
57
53
|
}
|
|
58
54
|
}
|