chrome-devtools-frontend 1.0.1536371 → 1.0.1537860
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/.env.template +9 -0
- package/docs/get_the_code.md +27 -0
- package/front_end/core/common/SettingRegistration.ts +10 -7
- package/front_end/core/common/Settings.ts +3 -0
- package/front_end/core/host/AidaClient.ts +64 -5
- package/front_end/core/host/DispatchHttpRequestClient.ts +62 -0
- package/front_end/core/host/GdpClient.ts +8 -57
- package/front_end/core/host/host.ts +2 -0
- package/front_end/core/protocol_client/CDPConnection.ts +10 -8
- package/front_end/core/protocol_client/InspectorBackend.ts +36 -42
- package/front_end/core/sdk/EnhancedTracesParser.ts +20 -5
- package/front_end/core/sdk/RehydratingConnection.ts +112 -4
- package/front_end/core/sdk/RehydratingObject.ts +8 -0
- package/front_end/core/sdk/TraceObject.ts +5 -1
- package/front_end/core/sdk/sdk-meta.ts +8 -2
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +4 -3
- package/front_end/generated/SupportedCSSProperties.js +1 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +23 -7
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +110 -5
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +50 -45
- package/front_end/models/cpu_profile/ProfileTreeModel.ts +7 -7
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
- package/front_end/models/trace/types/File.ts +9 -0
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -9
- package/front_end/panels/ai_assistance/components/ChatView.ts +58 -70
- package/front_end/panels/application/BackForwardCacheTreeElement.ts +2 -6
- package/front_end/panels/application/StorageView.ts +3 -2
- package/front_end/panels/application/components/BackForwardCacheView.ts +96 -108
- package/front_end/panels/application/components/FrameDetailsView.ts +8 -11
- package/front_end/panels/application/components/OriginTrialTreeView.ts +136 -137
- package/front_end/panels/application/components/backForwardCacheView.css +8 -0
- package/front_end/panels/application/components/badge.css +9 -1
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingString.ts +27 -0
- package/front_end/panels/autofill/AutofillView.ts +1 -1
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +44 -53
- package/front_end/panels/console/ConsoleView.ts +11 -9
- package/front_end/panels/coverage/CoverageView.ts +1 -2
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +1 -1
- package/front_end/panels/elements/ElementStatePaneWidget.ts +1 -1
- package/front_end/panels/elements/EventListenersWidget.ts +1 -2
- package/front_end/panels/elements/PropertiesWidget.ts +1 -1
- package/front_end/panels/network/NetworkConfigView.ts +2 -1
- package/front_end/panels/network/NetworkPanel.ts +5 -4
- package/front_end/panels/network/RequestCookiesView.ts +2 -1
- package/front_end/panels/profiler/HeapSnapshotView.ts +3 -2
- package/front_end/panels/recorder/RecorderController.ts +1 -2
- package/front_end/panels/recorder/components/CreateRecordingView.ts +153 -129
- package/front_end/panels/sensors/SensorsView.ts +4 -3
- package/front_end/panels/settings/AISettingsTab.ts +162 -171
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +8 -6
- package/front_end/panels/settings/KeybindsSettingsTab.ts +3 -2
- package/front_end/panels/settings/SettingsScreen.ts +5 -8
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/settings/aiSettingsTab.css +151 -148
- package/front_end/panels/settings/settings-meta.ts +1 -2
- package/front_end/panels/sources/AddSourceMapURLDialog.ts +23 -26
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +2 -1
- package/front_end/panels/sources/SourcesPanel.ts +2 -1
- package/front_end/panels/sources/sources-meta.ts +8 -1
- package/front_end/panels/timeline/TimelinePanel.ts +64 -14
- package/front_end/panels/timeline/TimelineUIUtils.ts +4 -20
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +33 -34
- package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -0
- package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +2 -0
- package/front_end/third_party/chromium/README.chromium +2 -2
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +9 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +13 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +1 -12
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts +6 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +6 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/disposable.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/disposable.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/disposable.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/disposable.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/util.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/util.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +28 -3
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +21 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +9 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +13 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Realm.d.ts +1 -12
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts +6 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +6 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/disposable.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/disposable.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/disposable.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/disposable.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/util.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/util.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +28 -3
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +13 -1
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +7 -2
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +14 -1
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +8 -5
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +5 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +8 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +11 -2
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserContext.ts +3 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +5 -5
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/disposable.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/util.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/adorners/Adorner.ts +2 -1
- package/front_end/ui/components/buttons/Button.docs.ts +195 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +49 -14
- package/front_end/ui/components/settings/settingCheckbox.css +6 -1
- package/front_end/ui/components/spinners/Spinners.docs.ts +13 -0
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +280 -0
- package/front_end/ui/components/text_editor/text_editor.ts +1 -0
- package/front_end/ui/components/tooltips/Tooltip.docs.ts +76 -0
- package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
- package/front_end/ui/legacy/Dialog.ts +0 -1
- package/front_end/ui/legacy/FilterBar.ts +1 -2
- package/front_end/ui/legacy/RadioButton.docs.ts +41 -0
- package/front_end/ui/legacy/SelectMenu.docs.ts +98 -0
- package/front_end/ui/legacy/Toolbar.ts +4 -6
- package/front_end/ui/legacy/UIUtils.ts +114 -1
- package/front_end/ui/legacy/Widget.ts +62 -34
- package/front_end/ui/legacy/XLink.ts +0 -3
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +9 -0
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +125 -0
- package/front_end/ui/legacy/components/settings_ui/settings_ui.ts +8 -0
- package/front_end/ui/legacy/components/utils/Linkifier.ts +9 -3
- package/front_end/ui/legacy/legacy.ts +0 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +4 -1
- package/mcp/mcp.ts +5 -0
- package/package.json +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatterBounds.snapshot.txt +0 -4
- package/front_end/models/trace/lantern/testing/MetricTestUtils.ts +0 -62
- package/front_end/models/trace/lantern/testing/testing.ts +0 -5
- package/front_end/ui/components/docs/breadcrumbs_perf/initial-breadcrumb-perf.html +0 -20
- package/front_end/ui/components/docs/breadcrumbs_perf/initial-breadcrumb-perf.ts +0 -25
- package/front_end/ui/components/docs/breadcrumbs_perf/nested-breadcrumbs-perf.html +0 -20
- package/front_end/ui/components/docs/breadcrumbs_perf/nested-breadcrumbs-perf.ts +0 -36
- package/front_end/ui/components/docs/button/basic.html +0 -44
- package/front_end/ui/components/docs/button/basic.ts +0 -175
- package/front_end/ui/components/docs/radio_button/basic.html +0 -23
- package/front_end/ui/components/docs/radio_button/basic.ts +0 -50
- package/front_end/ui/components/docs/select_menu/basic.html +0 -19
- package/front_end/ui/components/docs/select_menu/basic.ts +0 -95
- package/front_end/ui/components/docs/select_menu/wide-option.html +0 -38
- package/front_end/ui/components/docs/select_menu/wide-option.ts +0 -43
- package/front_end/ui/components/docs/spinners/basic.html +0 -17
- package/front_end/ui/components/docs/spinners/basic.ts +0 -22
- package/front_end/ui/components/docs/tooltip/basic.html +0 -20
- package/front_end/ui/components/docs/tooltip/basic.ts +0 -82
- package/front_end/ui/legacy/SettingsUI.ts +0 -254
|
@@ -1,7 +1,6 @@
|
|
|
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
|
-
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
5
4
|
|
|
6
5
|
import * as Common from '../../core/common/common.js';
|
|
7
6
|
import * as Host from '../../core/host/host.js';
|
|
@@ -11,7 +10,6 @@ import * as Root from '../../core/root/root.js';
|
|
|
11
10
|
import * as AiAssistanceModel from '../../models/ai_assistance/ai_assistance.js';
|
|
12
11
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
13
12
|
import * as Input from '../../ui/components/input/input.js';
|
|
14
|
-
import * as LegacyWrapper from '../../ui/components/legacy_wrapper/legacy_wrapper.js';
|
|
15
13
|
import * as Switch from '../../ui/components/switch/switch.js';
|
|
16
14
|
import * as uiI18n from '../../ui/i18n/i18n.js';
|
|
17
15
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
@@ -20,7 +18,7 @@ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
|
20
18
|
|
|
21
19
|
import aiSettingsTabStyles from './aiSettingsTab.css.js';
|
|
22
20
|
|
|
23
|
-
const {html, Directives: {ifDefined, classMap}} = Lit;
|
|
21
|
+
const {html, nothing, render, Directives: {ifDefined, classMap}} = Lit;
|
|
24
22
|
|
|
25
23
|
const UIStrings = {
|
|
26
24
|
/**
|
|
@@ -231,8 +229,143 @@ interface AiSettingParams {
|
|
|
231
229
|
};
|
|
232
230
|
}
|
|
233
231
|
|
|
234
|
-
|
|
235
|
-
|
|
232
|
+
interface ViewInput {
|
|
233
|
+
disabledReasons: string[];
|
|
234
|
+
sharedDisclaimerBulletPoints: Array<{icon: string, text: Common.UIString.LocalizedString|Lit.TemplateResult}>;
|
|
235
|
+
settingToParams: Map<Common.Settings.Setting<boolean>, AiSettingParams>;
|
|
236
|
+
expandSetting(setting: Common.Settings.Setting<boolean>): void;
|
|
237
|
+
toggleSetting(setting: Common.Settings.Setting<boolean>, ev: Event): void;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
|
|
241
|
+
|
|
242
|
+
export const AI_SETTINGS_TAB_DEFAULT_VIEW: View = (input, _output, target): void => {
|
|
243
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
|
244
|
+
// clang-format off
|
|
245
|
+
const disabledReasonsExplainer = input.disabledReasons.length ? html`
|
|
246
|
+
<div class="disabled-explainer">
|
|
247
|
+
${input.disabledReasons.map(reason => html`
|
|
248
|
+
<div class="disabled-explainer-row">
|
|
249
|
+
<devtools-icon name="warning" class="medium" style="color: var(--icon-warning);">
|
|
250
|
+
</devtools-icon>
|
|
251
|
+
${reason}
|
|
252
|
+
</div>
|
|
253
|
+
`)}
|
|
254
|
+
</div>
|
|
255
|
+
` : nothing;
|
|
256
|
+
|
|
257
|
+
const sharedDisclaimer = html`
|
|
258
|
+
<div class="shared-disclaimer">
|
|
259
|
+
<h2>${i18nString(UIStrings.boostYourProductivity)}</h2>
|
|
260
|
+
<h3 class="disclaimer-list-header">${i18nString(UIStrings.thingsToConsider)}</h3>
|
|
261
|
+
<div class="disclaimer-list">
|
|
262
|
+
${input.sharedDisclaimerBulletPoints.map(item =>
|
|
263
|
+
html`<div><devtools-icon .name=${item.icon} class="medium"></devtools-icon>
|
|
264
|
+
</div><div>${item.text}</div>`
|
|
265
|
+
)}
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
`;
|
|
269
|
+
|
|
270
|
+
const renderSettingItem = (settingItem: SettingItem): Lit.TemplateResult => {
|
|
271
|
+
return html`
|
|
272
|
+
<div>
|
|
273
|
+
<devtools-icon class="extra-large" .name=${settingItem.iconName}>
|
|
274
|
+
</devtools-icon>
|
|
275
|
+
</div>
|
|
276
|
+
<div class="padded">${settingItem.text}</div>
|
|
277
|
+
`;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
const isDisabled = input.disabledReasons.length > 0;
|
|
281
|
+
const disabledReasonsJoined = input.disabledReasons.join('\n') || undefined;
|
|
282
|
+
const settings = Array.from(input.settingToParams.keys()).map(setting => {
|
|
283
|
+
const settingData = input.settingToParams.get(setting);
|
|
284
|
+
if (!settingData) {
|
|
285
|
+
return nothing;
|
|
286
|
+
}
|
|
287
|
+
const detailsClasses = {
|
|
288
|
+
'whole-row': true,
|
|
289
|
+
open: settingData.settingExpandState.isSettingExpanded,
|
|
290
|
+
};
|
|
291
|
+
const tabindex = settingData.settingExpandState.isSettingExpanded ? '0' : '-1';
|
|
292
|
+
return html`
|
|
293
|
+
<div class="accordion-header" @click=${input.expandSetting.bind(this, setting)}>
|
|
294
|
+
<div class="icon-container centered">
|
|
295
|
+
<devtools-icon name=${settingData.iconName}></devtools-icon>
|
|
296
|
+
</div>
|
|
297
|
+
<div class="setting-card">
|
|
298
|
+
<h2>${settingData.settingName}</h2>
|
|
299
|
+
<div class="setting-description">${settingData.settingDescription}</div>
|
|
300
|
+
</div>
|
|
301
|
+
<div class="dropdown centered">
|
|
302
|
+
<devtools-button
|
|
303
|
+
.data=${{
|
|
304
|
+
title: settingData.settingExpandState.isSettingExpanded ? i18nString(UIStrings.showLess) : i18nString(UIStrings.showMore),
|
|
305
|
+
size: Buttons.Button.Size.SMALL,
|
|
306
|
+
iconName: settingData.settingExpandState.isSettingExpanded ? 'chevron-up' : 'chevron-down',
|
|
307
|
+
variant: Buttons.Button.Variant.ICON,
|
|
308
|
+
jslogContext: settingData.settingExpandState.expandSettingJSLogContext,
|
|
309
|
+
} as Buttons.Button.ButtonData}
|
|
310
|
+
></devtools-button>
|
|
311
|
+
</div>
|
|
312
|
+
</div>
|
|
313
|
+
<div class="divider"></div>
|
|
314
|
+
<div class="toggle-container centered"
|
|
315
|
+
title=${ifDefined(disabledReasonsJoined)}
|
|
316
|
+
@click=${input.toggleSetting.bind(this, setting)}
|
|
317
|
+
>
|
|
318
|
+
<devtools-switch
|
|
319
|
+
.checked=${Boolean(setting.get()) && !isDisabled}
|
|
320
|
+
.jslogContext=${setting.name || ''}
|
|
321
|
+
.disabled=${isDisabled}
|
|
322
|
+
.label=${disabledReasonsJoined || settingData.enableSettingText}
|
|
323
|
+
data-testid=${settingData.enableSettingText}
|
|
324
|
+
@switchchange=${input.toggleSetting.bind(this, setting)}
|
|
325
|
+
></devtools-switch>
|
|
326
|
+
</div>
|
|
327
|
+
<div class=${classMap(detailsClasses)}>
|
|
328
|
+
<div class="overflow-hidden">
|
|
329
|
+
<div class="expansion-grid">
|
|
330
|
+
<h3 class="expansion-grid-whole-row">${i18nString(UIStrings.whenOn)}</h3>
|
|
331
|
+
${settingData.settingItems.map(item => renderSettingItem(item))}
|
|
332
|
+
<h3 class="expansion-grid-whole-row">${i18nString(UIStrings.thingsToConsider)}</h3>
|
|
333
|
+
${settingData.toConsiderSettingItems.map(item => renderSettingItem(item))}
|
|
334
|
+
<div class="expansion-grid-whole-row">
|
|
335
|
+
<x-link
|
|
336
|
+
href=${settingData.learnMoreLink.url}
|
|
337
|
+
class="link"
|
|
338
|
+
tabindex=${tabindex}
|
|
339
|
+
jslog=${VisualLogging.link(settingData.learnMoreLink.linkJSLogContext).track({
|
|
340
|
+
click: true,
|
|
341
|
+
})}
|
|
342
|
+
>${i18nString(UIStrings.learnMore)}</x-link>
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
</div>
|
|
346
|
+
</div>
|
|
347
|
+
`;
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
render(html`
|
|
351
|
+
<style>${Input.checkboxStyles}</style>
|
|
352
|
+
<style>${aiSettingsTabStyles}</style>
|
|
353
|
+
<div class="ai-settings-container">
|
|
354
|
+
<div class="settings-container-wrapper" jslog=${VisualLogging.pane('chrome-ai')}>
|
|
355
|
+
${sharedDisclaimer}
|
|
356
|
+
${input.settingToParams.size ? html`
|
|
357
|
+
${disabledReasonsExplainer}
|
|
358
|
+
<div class="settings-container">
|
|
359
|
+
${settings}
|
|
360
|
+
</div>
|
|
361
|
+
` : nothing}
|
|
362
|
+
</div></div>
|
|
363
|
+
`, target);
|
|
364
|
+
// clang-format on
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
export class AISettingsTab extends UI.Widget.VBox {
|
|
368
|
+
#view: View;
|
|
236
369
|
#consoleInsightsSetting?: Common.Settings.Setting<boolean>;
|
|
237
370
|
#aiAnnotationsSetting?: Common.Settings.Setting<boolean>;
|
|
238
371
|
#aiAssistanceSetting?: Common.Settings.Setting<boolean>;
|
|
@@ -243,7 +376,7 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
|
|
|
243
376
|
// To display a a setting, it needs to be added to this map.
|
|
244
377
|
#settingToParams = new Map<Common.Settings.Setting<boolean>, AiSettingParams>();
|
|
245
378
|
|
|
246
|
-
constructor() {
|
|
379
|
+
constructor(view?: View) {
|
|
247
380
|
super();
|
|
248
381
|
try {
|
|
249
382
|
this.#consoleInsightsSetting = Common.Settings.Settings.instance().moduleSetting('console-insights-enabled');
|
|
@@ -269,15 +402,31 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
|
|
|
269
402
|
|
|
270
403
|
this.#boundOnAidaAvailabilityChange = this.#onAidaAvailabilityChange.bind(this);
|
|
271
404
|
this.#initSettings();
|
|
405
|
+
this.#view = view ?? AI_SETTINGS_TAB_DEFAULT_VIEW;
|
|
272
406
|
}
|
|
273
407
|
|
|
274
|
-
|
|
408
|
+
override performUpdate(): void {
|
|
409
|
+
const disabledReasons = AiAssistanceModel.AiUtils.getDisabledReasons(this.#aidaAvailability);
|
|
410
|
+
const viewInput: ViewInput = {
|
|
411
|
+
disabledReasons,
|
|
412
|
+
sharedDisclaimerBulletPoints: this.#getSharedDisclaimerBulletPoints(),
|
|
413
|
+
settingToParams: this.#settingToParams,
|
|
414
|
+
expandSetting: this.#expandSetting.bind(this),
|
|
415
|
+
toggleSetting: this.#toggleSetting.bind(this),
|
|
416
|
+
};
|
|
417
|
+
this.#view(viewInput, undefined, this.contentElement);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
override wasShown(): void {
|
|
421
|
+
super.wasShown();
|
|
275
422
|
Host.AidaClient.HostConfigTracker.instance().addEventListener(
|
|
276
423
|
Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED, this.#boundOnAidaAvailabilityChange);
|
|
277
424
|
void this.#onAidaAvailabilityChange();
|
|
425
|
+
this.requestUpdate();
|
|
278
426
|
}
|
|
279
427
|
|
|
280
|
-
|
|
428
|
+
override willHide(): void {
|
|
429
|
+
super.willHide();
|
|
281
430
|
Host.AidaClient.HostConfigTracker.instance().removeEventListener(
|
|
282
431
|
Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED, this.#boundOnAidaAvailabilityChange);
|
|
283
432
|
}
|
|
@@ -400,7 +549,7 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
|
|
|
400
549
|
const currentAidaAvailability = await Host.AidaClient.AidaClient.checkAccessPreconditions();
|
|
401
550
|
if (currentAidaAvailability !== this.#aidaAvailability) {
|
|
402
551
|
this.#aidaAvailability = currentAidaAvailability;
|
|
403
|
-
|
|
552
|
+
this.requestUpdate();
|
|
404
553
|
}
|
|
405
554
|
}
|
|
406
555
|
|
|
@@ -438,7 +587,7 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
|
|
|
438
587
|
return;
|
|
439
588
|
}
|
|
440
589
|
settingData.settingExpandState.isSettingExpanded = !settingData.settingExpandState.isSettingExpanded;
|
|
441
|
-
|
|
590
|
+
this.requestUpdate();
|
|
442
591
|
}
|
|
443
592
|
|
|
444
593
|
#toggleSetting(setting: Common.Settings.Setting<boolean>, ev: Event): void {
|
|
@@ -477,24 +626,10 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
|
|
|
477
626
|
// If the "AI Assistance" is toggled off, we remove all the history entries related to the feature.
|
|
478
627
|
void AiAssistanceModel.AiHistoryStorage.AiHistoryStorage.instance().deleteAll();
|
|
479
628
|
}
|
|
480
|
-
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
#renderSharedDisclaimerItem(icon: string, text: Common.UIString.LocalizedString|Lit.TemplateResult):
|
|
484
|
-
Lit.TemplateResult {
|
|
485
|
-
// Disabled until https://crbug.com/1079231 is fixed.
|
|
486
|
-
// clang-format off
|
|
487
|
-
return html`
|
|
488
|
-
<div>
|
|
489
|
-
<devtools-icon .name=${icon} class="medium">
|
|
490
|
-
</devtools-icon>
|
|
491
|
-
</div>
|
|
492
|
-
<div>${text}</div>
|
|
493
|
-
`;
|
|
494
|
-
// clang-format on
|
|
629
|
+
this.requestUpdate();
|
|
495
630
|
}
|
|
496
631
|
|
|
497
|
-
#
|
|
632
|
+
#getSharedDisclaimerBulletPoints(): Array<{icon: string, text: Common.UIString.LocalizedString|Lit.TemplateResult}> {
|
|
498
633
|
const tosLink = UI.XLink.XLink.create(
|
|
499
634
|
'https://policies.google.com/terms', i18nString(UIStrings.termsOfService), undefined, undefined,
|
|
500
635
|
'terms-of-service');
|
|
@@ -504,7 +639,7 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
|
|
|
504
639
|
const noLogging = Root.Runtime.hostConfig.aidaAvailability?.enterprisePolicyValue ===
|
|
505
640
|
Root.Runtime.GenAiEnterprisePolicyValue.ALLOW_WITHOUT_LOGGING;
|
|
506
641
|
|
|
507
|
-
|
|
642
|
+
return [
|
|
508
643
|
{icon: 'psychiatry', text: i18nString(UIStrings.experimentalFeatures)},
|
|
509
644
|
{
|
|
510
645
|
icon: 'google',
|
|
@@ -522,149 +657,5 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
|
|
|
522
657
|
})}`,
|
|
523
658
|
},
|
|
524
659
|
];
|
|
525
|
-
|
|
526
|
-
return html`
|
|
527
|
-
<div class="shared-disclaimer">
|
|
528
|
-
<h2>${i18nString(UIStrings.boostYourProductivity)}</h2>
|
|
529
|
-
<h3 class="disclaimer-list-header">${i18nString(UIStrings.thingsToConsider)}</h3>
|
|
530
|
-
<div class="disclaimer-list">
|
|
531
|
-
${bulletPoints.map(item => this.#renderSharedDisclaimerItem(item.icon, item.text))}
|
|
532
|
-
</div>
|
|
533
|
-
</div>
|
|
534
|
-
`;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
#renderSettingItem(settingItem: SettingItem): Lit.TemplateResult {
|
|
538
|
-
// Disabled until https://crbug.com/1079231 is fixed.
|
|
539
|
-
// clang-format off
|
|
540
|
-
return html`
|
|
541
|
-
<div>
|
|
542
|
-
<devtools-icon class="extra-large" .name=${settingItem.iconName}>
|
|
543
|
-
</devtools-icon>
|
|
544
|
-
</div>
|
|
545
|
-
<div class="padded">${settingItem.text}</div>
|
|
546
|
-
`;
|
|
547
|
-
// clang-format on
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
#renderSetting(setting: Common.Settings.Setting<boolean>): Lit.LitTemplate {
|
|
551
|
-
const settingData = this.#settingToParams.get(setting);
|
|
552
|
-
if (!settingData) {
|
|
553
|
-
return Lit.nothing;
|
|
554
|
-
}
|
|
555
|
-
const disabledReasons = AiAssistanceModel.AiUtils.getDisabledReasons(this.#aidaAvailability);
|
|
556
|
-
const isDisabled = disabledReasons.length > 0;
|
|
557
|
-
const disabledReasonsJoined = disabledReasons.join('\n') || undefined;
|
|
558
|
-
const detailsClasses = {
|
|
559
|
-
'whole-row': true,
|
|
560
|
-
open: settingData.settingExpandState.isSettingExpanded,
|
|
561
|
-
};
|
|
562
|
-
const tabindex = settingData.settingExpandState.isSettingExpanded ? '0' : '-1';
|
|
563
|
-
|
|
564
|
-
// Disabled until https://crbug.com/1079231 is fixed.
|
|
565
|
-
// clang-format off
|
|
566
|
-
return html`
|
|
567
|
-
<div class="accordion-header" @click=${this.#expandSetting.bind(this, setting)}>
|
|
568
|
-
<div class="icon-container centered">
|
|
569
|
-
<devtools-icon name=${settingData.iconName}></devtools-icon>
|
|
570
|
-
</div>
|
|
571
|
-
<div class="setting-card">
|
|
572
|
-
<h2>${settingData.settingName}</h2>
|
|
573
|
-
<div class="setting-description">${settingData.settingDescription}</div>
|
|
574
|
-
</div>
|
|
575
|
-
<div class="dropdown centered">
|
|
576
|
-
<devtools-button
|
|
577
|
-
.data=${{
|
|
578
|
-
title: settingData.settingExpandState.isSettingExpanded ? i18nString(UIStrings.showLess) : i18nString(UIStrings.showMore),
|
|
579
|
-
size: Buttons.Button.Size.SMALL,
|
|
580
|
-
iconName: settingData.settingExpandState.isSettingExpanded ? 'chevron-up' : 'chevron-down',
|
|
581
|
-
variant: Buttons.Button.Variant.ICON,
|
|
582
|
-
jslogContext: settingData.settingExpandState.expandSettingJSLogContext,
|
|
583
|
-
} as Buttons.Button.ButtonData}
|
|
584
|
-
></devtools-button>
|
|
585
|
-
</div>
|
|
586
|
-
</div>
|
|
587
|
-
<div class="divider"></div>
|
|
588
|
-
<div class="toggle-container centered"
|
|
589
|
-
title=${ifDefined(disabledReasonsJoined)}
|
|
590
|
-
@click=${this.#toggleSetting.bind(this, setting)}
|
|
591
|
-
>
|
|
592
|
-
<devtools-switch
|
|
593
|
-
.checked=${Boolean(setting.get()) && !isDisabled}
|
|
594
|
-
.jslogContext=${setting.name || ''}
|
|
595
|
-
.disabled=${isDisabled}
|
|
596
|
-
.label=${disabledReasonsJoined || settingData.enableSettingText}
|
|
597
|
-
data-testid=${settingData.enableSettingText}
|
|
598
|
-
@switchchange=${this.#toggleSetting.bind(this, setting)}
|
|
599
|
-
></devtools-switch>
|
|
600
|
-
</div>
|
|
601
|
-
<div class=${classMap(detailsClasses)}>
|
|
602
|
-
<div class="overflow-hidden">
|
|
603
|
-
<div class="expansion-grid">
|
|
604
|
-
<h3 class="expansion-grid-whole-row">${i18nString(UIStrings.whenOn)}</h3>
|
|
605
|
-
${settingData.settingItems.map(item => this.#renderSettingItem(item))}
|
|
606
|
-
<h3 class="expansion-grid-whole-row">${i18nString(UIStrings.thingsToConsider)}</h3>
|
|
607
|
-
${settingData.toConsiderSettingItems.map(item => this.#renderSettingItem(item))}
|
|
608
|
-
<div class="expansion-grid-whole-row">
|
|
609
|
-
<x-link
|
|
610
|
-
href=${settingData.learnMoreLink.url}
|
|
611
|
-
class="link"
|
|
612
|
-
tabindex=${tabindex}
|
|
613
|
-
jslog=${VisualLogging.link(settingData.learnMoreLink.linkJSLogContext).track({
|
|
614
|
-
click: true,
|
|
615
|
-
})}
|
|
616
|
-
>${i18nString(UIStrings.learnMore)}</x-link>
|
|
617
|
-
</div>
|
|
618
|
-
</div>
|
|
619
|
-
</div>
|
|
620
|
-
</div>
|
|
621
|
-
`;
|
|
622
|
-
// clang-format on
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
#renderDisabledExplainer(disabledReasons: string[]): Lit.LitTemplate {
|
|
626
|
-
// Disabled until https://crbug.com/1079231 is fixed.
|
|
627
|
-
// clang-format off
|
|
628
|
-
return html`
|
|
629
|
-
<div class="disabled-explainer">
|
|
630
|
-
${disabledReasons.map(reason => html`
|
|
631
|
-
<div class="disabled-explainer-row">
|
|
632
|
-
<devtools-icon name="warning" class="medium" style="color: var(--icon-warning);">
|
|
633
|
-
</devtools-icon>
|
|
634
|
-
${reason}
|
|
635
|
-
</div>
|
|
636
|
-
`)}
|
|
637
|
-
</div>
|
|
638
|
-
`;
|
|
639
|
-
// clang-format on
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
override async render(): Promise<void> {
|
|
643
|
-
const disabledReasons = AiAssistanceModel.AiUtils.getDisabledReasons(this.#aidaAvailability);
|
|
644
|
-
|
|
645
|
-
// Disabled until https://crbug.com/1079231 is fixed.
|
|
646
|
-
// clang-format off
|
|
647
|
-
Lit.render(html`
|
|
648
|
-
<style>${Input.checkboxStyles}</style>
|
|
649
|
-
<style>${aiSettingsTabStyles}</style>
|
|
650
|
-
<div class="settings-container-wrapper" jslog=${VisualLogging.pane('chrome-ai')}>
|
|
651
|
-
${this.#renderSharedDisclaimer()}
|
|
652
|
-
${this.#settingToParams.size > 0 ? html`
|
|
653
|
-
${disabledReasons.length ? this.#renderDisabledExplainer(disabledReasons) : Lit.nothing}
|
|
654
|
-
<div class="settings-container">
|
|
655
|
-
${this.#settingToParams.keys().map(setting => this.#renderSetting(setting))}
|
|
656
|
-
</div>
|
|
657
|
-
` : Lit.nothing}
|
|
658
|
-
</div>
|
|
659
|
-
`, this.#shadow, {host: this});
|
|
660
|
-
// clang-format on
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
customElements.define('devtools-settings-ai-settings-tab', AISettingsTab);
|
|
665
|
-
|
|
666
|
-
declare global {
|
|
667
|
-
interface HTMLElementTagNameMap {
|
|
668
|
-
'devtools-settings-ai-settings-tab': AISettingsTab;
|
|
669
660
|
}
|
|
670
661
|
}
|
|
@@ -8,6 +8,7 @@ import '../../ui/components/cards/cards.js';
|
|
|
8
8
|
import * as Common from '../../core/common/common.js';
|
|
9
9
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
10
10
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
11
|
+
import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
|
|
11
12
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
12
13
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
13
14
|
|
|
@@ -112,7 +113,7 @@ export class FrameworkIgnoreListSettingsTab extends UI.Widget.VBox implements
|
|
|
112
113
|
const enabledSetting = Common.Settings.Settings.instance().moduleSetting('enable-ignore-listing');
|
|
113
114
|
const enableIgnoreListing = this.contentElement.createChild('div', 'enable-ignore-listing');
|
|
114
115
|
enableIgnoreListing.appendChild(
|
|
115
|
-
|
|
116
|
+
SettingsUI.SettingsUI.createSettingCheckbox(i18nString(UIStrings.enableIgnoreListing), enabledSetting));
|
|
116
117
|
UI.Tooltip.Tooltip.install(enableIgnoreListing, i18nString(UIStrings.enableIgnoreListingTooltip));
|
|
117
118
|
|
|
118
119
|
const enableIgnoreListingCard = settingsContent.createChild('devtools-card');
|
|
@@ -123,14 +124,15 @@ export class FrameworkIgnoreListSettingsTab extends UI.Widget.VBox implements
|
|
|
123
124
|
generalExclusionGroup.classList.add('general-exclusion-group');
|
|
124
125
|
const ignoreListContentScripts =
|
|
125
126
|
generalExclusionGroup.createChild('div', 'ignore-list-option')
|
|
126
|
-
.appendChild(
|
|
127
|
+
.appendChild(SettingsUI.SettingsUI.createSettingCheckbox(
|
|
127
128
|
i18nString(UIStrings.ignoreListContentScripts),
|
|
128
129
|
Common.Settings.Settings.instance().moduleSetting('skip-content-scripts')));
|
|
129
130
|
|
|
130
131
|
const automaticallyIgnoreListContainer = generalExclusionGroup.createChild('div', 'ignore-list-option');
|
|
131
|
-
const automaticallyIgnoreList =
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
const automaticallyIgnoreList =
|
|
133
|
+
automaticallyIgnoreListContainer.appendChild(SettingsUI.SettingsUI.createSettingCheckbox(
|
|
134
|
+
i18nString(UIStrings.automaticallyIgnoreListKnownThirdPartyScripts),
|
|
135
|
+
Common.Settings.Settings.instance().moduleSetting('automatically-ignore-list-known-third-party-scripts')));
|
|
134
136
|
|
|
135
137
|
const automaticallyIgnoreLinkButton = new Buttons.Button.Button();
|
|
136
138
|
automaticallyIgnoreLinkButton.data = {
|
|
@@ -148,7 +150,7 @@ export class FrameworkIgnoreListSettingsTab extends UI.Widget.VBox implements
|
|
|
148
150
|
|
|
149
151
|
const ignoreListAnonymousScripts =
|
|
150
152
|
generalExclusionGroup.createChild('div', 'ignore-list-option')
|
|
151
|
-
.appendChild(
|
|
153
|
+
.appendChild(SettingsUI.SettingsUI.createSettingCheckbox(
|
|
152
154
|
i18nString(UIStrings.ignoreListAnonymousScripts),
|
|
153
155
|
Common.Settings.Settings.instance().moduleSetting('skip-anonymous-scripts')));
|
|
154
156
|
|
|
@@ -11,6 +11,7 @@ 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
13
|
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
14
|
+
import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
|
|
14
15
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
15
16
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
16
17
|
|
|
@@ -126,8 +127,8 @@ export class KeybindsSettingsTab extends UI.Widget.VBox implements UI.ListContro
|
|
|
126
127
|
const keybindsSetSetting = Common.Settings.Settings.instance().moduleSetting('active-keybind-set');
|
|
127
128
|
const userShortcutsSetting = Common.Settings.Settings.instance().moduleSetting('user-shortcuts');
|
|
128
129
|
keybindsSetSetting.addChangeListener(this.update, this);
|
|
129
|
-
const keybindsSetSelect =
|
|
130
|
-
|
|
130
|
+
const keybindsSetSelect = SettingsUI.SettingsUI.createControlForSetting(
|
|
131
|
+
keybindsSetSetting, i18nString(UIStrings.matchShortcutsFromPreset));
|
|
131
132
|
|
|
132
133
|
const card = settingsContent.createChild('devtools-card');
|
|
133
134
|
card.heading = i18nString(UIStrings.shortcuts);
|
|
@@ -14,6 +14,7 @@ import * as Root from '../../core/root/root.js';
|
|
|
14
14
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
15
15
|
import type * as Cards from '../../ui/components/cards/cards.js';
|
|
16
16
|
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
17
|
+
import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
|
|
17
18
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
18
19
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
19
20
|
import {html, render} from '../../ui/lit/lit.js';
|
|
@@ -328,11 +329,9 @@ export class GenericSettingsTab extends UI.Widget.VBox implements SettingsTab {
|
|
|
328
329
|
|
|
329
330
|
private createExtensionSection(settings: Common.Settings.SettingRegistration[]): void {
|
|
330
331
|
const sectionName = Common.Settings.SettingCategory.EXTENSIONS;
|
|
331
|
-
const settingUI = Components.Linkifier.LinkHandlerSettingUI.instance()
|
|
332
|
+
const settingUI = Components.Linkifier.LinkHandlerSettingUI.instance();
|
|
332
333
|
const element = settingUI.settingElement();
|
|
333
|
-
|
|
334
|
-
this.createStandardSectionElement(sectionName, settings, element);
|
|
335
|
-
}
|
|
334
|
+
this.createStandardSectionElement(sectionName, settings, element);
|
|
336
335
|
}
|
|
337
336
|
|
|
338
337
|
private createSectionElement(
|
|
@@ -357,7 +356,7 @@ export class GenericSettingsTab extends UI.Widget.VBox implements SettingsTab {
|
|
|
357
356
|
const sectionElement = document.createElement('div');
|
|
358
357
|
for (const settingRegistration of settings) {
|
|
359
358
|
const setting = Common.Settings.Settings.instance().moduleSetting(settingRegistration.settingName);
|
|
360
|
-
const settingControl =
|
|
359
|
+
const settingControl = SettingsUI.SettingsUI.createControlForSetting(setting);
|
|
361
360
|
if (settingControl) {
|
|
362
361
|
this.settingToControl.set(setting, settingControl);
|
|
363
362
|
sectionElement.appendChild(settingControl);
|
|
@@ -403,15 +402,13 @@ export class ExperimentsSettingsTab extends UI.Widget.VBox implements SettingsTa
|
|
|
403
402
|
render(
|
|
404
403
|
html`
|
|
405
404
|
<devtools-toolbar>
|
|
406
|
-
<devtools-toolbar-input type="filter" placeholder=${
|
|
405
|
+
<devtools-toolbar-input autofocus type="filter" placeholder=${
|
|
407
406
|
i18nString(UIStrings.searchExperiments)} style="flex-grow:1" @change=${
|
|
408
407
|
this.#onFilterChanged.bind(this)}></devtools-toolbar-input>
|
|
409
408
|
</devtools-toolbar>
|
|
410
409
|
`,
|
|
411
410
|
filterSection);
|
|
412
411
|
this.renderExperiments('');
|
|
413
|
-
const filter = filterSection.querySelector('devtools-toolbar-input') as HTMLElement;
|
|
414
|
-
this.setDefaultFocusedElement(filter);
|
|
415
412
|
}
|
|
416
413
|
|
|
417
414
|
#onFilterChanged(e: CustomEvent<string>): void {
|
|
@@ -61,7 +61,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
61
61
|
<input
|
|
62
62
|
class="harmony-input"
|
|
63
63
|
jslog=${VisualLogging.textField().track({keydown: 'Enter', change: true}).context(input.excludePatternSetting.name)}
|
|
64
|
-
${UI.
|
|
64
|
+
${UI.UIUtils.bindToSetting(input.excludePatternSetting)}
|
|
65
65
|
id="workspace-setting-folder-exclude-pattern"></input>
|
|
66
66
|
</div>
|
|
67
67
|
<div class="mappings-info">${i18nString(UIStrings.mappingsAreInferredAutomatically)}</div>
|