chrome-devtools-frontend 1.0.1539728 → 1.0.1541169
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/eslint.config.mjs +167 -151
- package/front_end/core/common/Debouncer.ts +2 -2
- package/front_end/core/common/Gzip.ts +1 -1
- package/front_end/core/common/Revealer.ts +5 -0
- package/front_end/core/common/Throttler.ts +3 -3
- package/front_end/core/host/GdpClient.ts +4 -0
- package/front_end/core/host/InspectorFrontendHost.ts +10 -10
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +181 -0
- package/front_end/core/protocol_client/InspectorBackend.ts +36 -203
- package/front_end/core/protocol_client/protocol_client.ts +2 -2
- package/front_end/core/sdk/DebuggerModel.ts +3 -16
- package/front_end/core/sdk/NetworkManager.ts +16 -11
- package/front_end/core/sdk/RemoteObject.ts +4 -0
- package/front_end/core/sdk/Target.ts +3 -6
- package/front_end/core/sdk/TargetManager.ts +1 -2
- package/front_end/core/sdk/sdk-meta.ts +0 -35
- package/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts +1 -3
- package/front_end/entrypoints/node_app/app/NodeMain.ts +3 -2
- package/front_end/entrypoints/shell/shell.ts +1 -0
- package/front_end/entrypoints/trace_app/trace_app.ts +1 -0
- package/front_end/generated/Deprecation.ts +8 -0
- package/front_end/generated/InspectorBackendCommands.ts +8 -5
- package/front_end/generated/SupportedCSSProperties.js +58 -4
- package/front_end/generated/protocol.ts +60 -4
- package/front_end/models/ai_assistance/EvaluateAction.ts +88 -5
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +121 -56
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +104 -62
- package/front_end/models/ai_assistance/injected.ts +15 -2
- package/front_end/models/ai_assistance/performance/AIQueries.ts +56 -2
- package/front_end/{panels/issues → models/issues_manager}/IssueAggregator.ts +83 -65
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/live-metrics/web-vitals-injected/README.md +1 -1
- package/front_end/models/trace/Processor.ts +5 -4
- package/front_end/models/trace/Styles.ts +1 -1
- package/front_end/models/trace/insights/types.ts +1 -1
- package/front_end/models/trace/types/TraceEvents.ts +1 -1
- package/front_end/models/workspace/IgnoreListManager.ts +41 -47
- package/front_end/models/workspace/workspace-meta.ts +40 -0
- package/front_end/panels/ai_assistance/PatchWidget.ts +22 -12
- package/front_end/panels/ai_assistance/components/ChatView.ts +1 -1
- package/front_end/panels/animation/AnimationTimeline.ts +4 -4
- package/front_end/panels/animation/AnimationUI.ts +28 -34
- package/front_end/panels/common/AiCodeCompletionDisclaimer.ts +4 -4
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +2 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +37 -9
- package/front_end/panels/elements/LayoutPane.ts +2 -2
- package/front_end/panels/elements/PropertiesWidget.ts +3 -2
- package/front_end/panels/elements/components/AdornerManager.ts +9 -9
- package/front_end/panels/elements/layoutPane.css +5 -9
- package/front_end/panels/event_listeners/EventListenersView.ts +10 -6
- package/front_end/panels/explain/components/ConsoleInsight.ts +498 -449
- package/front_end/panels/issues/AffectedResourcesView.ts +3 -4
- package/front_end/panels/issues/CorsIssueDetailsView.ts +1 -2
- package/front_end/panels/issues/IssueView.ts +1 -1
- package/front_end/panels/issues/IssuesPane.ts +12 -15
- package/front_end/panels/issues/issues.ts +0 -2
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +3 -3
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +2 -2
- package/front_end/panels/network/NetworkDataGridNode.ts +2 -1
- package/front_end/panels/network/RequestConditionsDrawer.ts +149 -46
- package/front_end/panels/network/RequestPayloadView.ts +2 -1
- package/front_end/panels/network/RequestTimingView.ts +17 -10
- package/front_end/panels/network/components/RequestHeadersView.ts +24 -17
- package/front_end/panels/network/network-meta.ts +11 -0
- package/front_end/panels/protocol_monitor/JSONEditor.ts +2 -2
- package/front_end/panels/recorder/RecorderController.ts +6 -7
- package/front_end/panels/recorder/models/RecordingPlayer.ts +3 -3
- package/front_end/panels/settings/components/SyncSection.ts +1 -1
- package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +1 -1
- package/front_end/panels/sources/BreakpointsView.ts +3 -3
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +4 -3
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +4 -3
- package/front_end/panels/sources/breakpointsView.css +1 -1
- package/front_end/panels/sources/sourcesPanel.css +2 -2
- package/front_end/panels/timeline/TimelineFlameChartView.ts +3 -3
- package/front_end/panels/timeline/TimelinePanel.ts +3 -3
- package/front_end/panels/timeline/components/FieldSettingsDialog.ts +9 -5
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +16 -10
- package/front_end/panels/timeline/components/LiveMetricsView.ts +20 -9
- package/front_end/panels/timeline/components/MetricCard.ts +4 -2
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +2 -0
- package/front_end/services/puppeteer/PuppeteerConnection.ts +2 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +5 -0
- 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/Page.d.ts +1 -0
- 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 -0
- 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/cdp/Browser.d.ts +1 -0
- 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 +21 -0
- 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/ExtensionTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExtensionTransport.js +5 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExtensionTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +1 -0
- 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 +6 -0
- 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/cdp/TargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js +29 -27
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.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/util/Mutex.d.ts +2 -2
- 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 +5 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +61 -26
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +5 -0
- 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/Page.d.ts +1 -0
- 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 -0
- 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/cdp/Browser.d.ts +1 -0
- 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 +21 -0
- 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/ExtensionTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExtensionTransport.js +5 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExtensionTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +1 -0
- 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 +6 -0
- 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/cdp/TargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js +30 -28
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.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 +5 -0
- package/front_end/third_party/puppeteer/package/package.json +1 -1
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +6 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +32 -0
- package/front_end/third_party/puppeteer/package/src/cdp/ExtensionTransport.ts +5 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +8 -0
- package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +36 -43
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/dialogs/ButtonDialog.ts +15 -5
- package/front_end/ui/components/expandable_list/ExpandableList.ts +1 -1
- package/front_end/ui/components/helpers/helpers.ts +0 -2
- package/front_end/ui/components/markdown_view/MarkdownView.ts +1 -0
- package/front_end/ui/components/menus/Menu.ts +5 -3
- package/front_end/ui/components/snackbars/Snackbars.docs.ts +46 -0
- package/front_end/ui/components/survey_link/SurveyLink.docs.ts +22 -0
- package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -2
- package/front_end/ui/{components/docs/context_menu/basic.ts → legacy/ContextMenu.docs.ts} +58 -25
- package/front_end/ui/legacy/SelectMenu.docs.ts +14 -0
- package/front_end/ui/legacy/UIUtils.ts +2 -1
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +3 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +558 -439
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +3 -3
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +1 -1
- package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +3 -2
- package/mcp/mcp.ts +15 -1
- package/package.json +2 -1
- package/front_end/core/protocol_client/NodeURL.ts +0 -40
- package/front_end/ui/components/docs/combo_box/basic.html +0 -20
- package/front_end/ui/components/docs/combo_box/basic.ts +0 -49
- package/front_end/ui/components/docs/context_menu/basic.html +0 -45
- package/front_end/ui/components/docs/legacy_color_invert/basic.html +0 -77
- package/front_end/ui/components/docs/legacy_color_invert/basic.ts +0 -98
- package/front_end/ui/components/docs/linkifier/simple-url.html +0 -25
- package/front_end/ui/components/docs/linkifier/simple-url.ts +0 -25
- package/front_end/ui/components/docs/panel_feedback/basic.html +0 -25
- package/front_end/ui/components/docs/panel_feedback/basic.ts +0 -21
- package/front_end/ui/components/docs/panel_feedback/button.html +0 -25
- package/front_end/ui/components/docs/panel_feedback/button.ts +0 -19
- package/front_end/ui/components/docs/panel_introduction_steps/basic.html +0 -25
- package/front_end/ui/components/docs/panel_introduction_steps/basic.ts +0 -28
- package/front_end/ui/components/docs/perf_piechart/basic-with-legend.html +0 -20
- package/front_end/ui/components/docs/perf_piechart/basic-with-legend.ts +0 -20
- package/front_end/ui/components/docs/perf_piechart/basic-without-legend.html +0 -20
- package/front_end/ui/components/docs/perf_piechart/basic-without-legend.ts +0 -18
- package/front_end/ui/components/docs/snackbars/basic.html +0 -17
- package/front_end/ui/components/docs/snackbars/basic.ts +0 -50
- package/front_end/ui/components/docs/survey_link/basic.html +0 -20
- package/front_end/ui/components/docs/survey_link/basic.ts +0 -28
- package/front_end/ui/components/docs/tree_outline/basic.html +0 -33
- package/front_end/ui/components/docs/tree_outline/basic.ts +0 -38
- package/front_end/ui/components/docs/tree_outline/custom-renderers.html +0 -32
- package/front_end/ui/components/docs/tree_outline/custom-renderers.ts +0 -61
- package/front_end/ui/components/docs/tree_outline/lazy-children.html +0 -32
- package/front_end/ui/components/docs/tree_outline/lazy-children.ts +0 -91
- package/front_end/ui/components/docs/tree_outline/sample-data.ts +0 -67
- package/front_end/ui/components/helpers/directives.ts +0 -38
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 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 FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
|
|
6
|
-
import * as PerfUI from '../../../legacy/components/perf_ui/perf_ui.js';
|
|
7
|
-
|
|
8
|
-
await FrontendHelpers.initializeGlobalVars();
|
|
9
|
-
|
|
10
|
-
const chart = new PerfUI.PieChart.PieChart();
|
|
11
|
-
document.getElementById('container')?.appendChild(chart);
|
|
12
|
-
|
|
13
|
-
chart.data = {
|
|
14
|
-
chartName: 'Nice Chart',
|
|
15
|
-
size: 110,
|
|
16
|
-
formatter: value => String(value) + ' %',
|
|
17
|
-
showLegend: true,
|
|
18
|
-
total: 100,
|
|
19
|
-
slices: [{value: 75, color: 'crimson', title: 'Filling'}, {value: 25, color: 'burlywood', title: 'Crust'}],
|
|
20
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright 2020 The Chromium Authors
|
|
3
|
-
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
found in the LICENSE file.
|
|
5
|
-
-->
|
|
6
|
-
<!DOCTYPE html>
|
|
7
|
-
<html>
|
|
8
|
-
<head>
|
|
9
|
-
<meta charset="UTF-8" />
|
|
10
|
-
<meta name="viewport" content="width=device-width" />
|
|
11
|
-
<title>PieChart example without a legend</title>
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
|
|
15
|
-
<div id="container">
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<script type="module" src="./basic-without-legend.js"></script>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// Copyright 2020 The Chromium Authors
|
|
3
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
// found in the LICENSE file.
|
|
5
|
-
|
|
6
|
-
import * as PerfUI from '../../../legacy/components/perf_ui/perf_ui.js';
|
|
7
|
-
|
|
8
|
-
const chart = new PerfUI.PieChart.PieChart();
|
|
9
|
-
document.getElementById('container')?.appendChild(chart);
|
|
10
|
-
|
|
11
|
-
chart.data = {
|
|
12
|
-
chartName: 'Nice Chart',
|
|
13
|
-
size: 110,
|
|
14
|
-
formatter: value => String(value) + ' %',
|
|
15
|
-
showLegend: false,
|
|
16
|
-
total: 100,
|
|
17
|
-
slices: [{value: 75, color: 'crimson', title: 'Filling'}, {value: 25, color: 'burlywood', title: 'Crust'}],
|
|
18
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright 2025 The Chromium Authors
|
|
3
|
-
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
found in the LICENSE file.
|
|
5
|
-
-->
|
|
6
|
-
<!DOCTYPE html>
|
|
7
|
-
<html>
|
|
8
|
-
<head>
|
|
9
|
-
<meta charset="UTF-8" />
|
|
10
|
-
<meta name="viewport" content="width=device-width" />
|
|
11
|
-
<title>Toast example</title>
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
<div id="container"></div>
|
|
15
|
-
<script type="module" src="./basic.js"></script>
|
|
16
|
-
</body>
|
|
17
|
-
</html>
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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 FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
|
|
6
|
-
import * as ComponentHelpers from '../../helpers/helpers.js';
|
|
7
|
-
import * as Snackbars from '../../snackbars/snackbars.js';
|
|
8
|
-
|
|
9
|
-
await FrontendHelpers.initializeGlobalVars();
|
|
10
|
-
await ComponentHelpers.ComponentServerSetup.setup();
|
|
11
|
-
const container = document.getElementById('container');
|
|
12
|
-
|
|
13
|
-
if (!container) {
|
|
14
|
-
throw new Error('No component container found.');
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const onActionClick = (): void => {
|
|
18
|
-
// eslint-disable-next-line no-console
|
|
19
|
-
console.log('Action button clicked!');
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const showButton1 = document.createElement('button');
|
|
23
|
-
showButton1.textContent = 'Show Long Action Snackbar';
|
|
24
|
-
showButton1.addEventListener('click', () => {
|
|
25
|
-
Snackbars.Snackbar.Snackbar.show({
|
|
26
|
-
message: 'This is a snackbar demonstrating a long action and closable state.',
|
|
27
|
-
closable: true,
|
|
28
|
-
actionProperties: {
|
|
29
|
-
label: 'This is a long action button',
|
|
30
|
-
title: 'Click here to perform the designated action',
|
|
31
|
-
onClick: onActionClick,
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
container.appendChild(showButton1);
|
|
36
|
-
|
|
37
|
-
const showButton2 = document.createElement('button');
|
|
38
|
-
showButton2.textContent = 'Show Action Snackbar';
|
|
39
|
-
showButton2.addEventListener('click', () => {
|
|
40
|
-
Snackbars.Snackbar.Snackbar.show({
|
|
41
|
-
message: 'This is a snackbar demonstrating an action and closable state.',
|
|
42
|
-
closable: true,
|
|
43
|
-
actionProperties: {
|
|
44
|
-
label: 'Action',
|
|
45
|
-
title: 'Click here to perform the designated action',
|
|
46
|
-
onClick: onActionClick,
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
container.appendChild(showButton2);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright 2020 The Chromium Authors
|
|
3
|
-
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
found in the LICENSE file.
|
|
5
|
-
-->
|
|
6
|
-
<!DOCTYPE html>
|
|
7
|
-
<html>
|
|
8
|
-
<head>
|
|
9
|
-
<meta charset="UTF-8" />
|
|
10
|
-
<meta name="viewport" content="width=device-width" />
|
|
11
|
-
<title>Basic SurveyLink example</title>
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
|
|
15
|
-
<div id="container">
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<script type="module" src="./basic.js"></script>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 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 Common from '../../../../core/common/common.js';
|
|
6
|
-
import * as FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
|
|
7
|
-
import * as ComponentHelpers from '../../helpers/helpers.js';
|
|
8
|
-
import * as SurveyLink from '../../survey_link/survey_link.js';
|
|
9
|
-
|
|
10
|
-
await ComponentHelpers.ComponentServerSetup.setup();
|
|
11
|
-
await FrontendHelpers.initializeGlobalVars();
|
|
12
|
-
|
|
13
|
-
const link = new SurveyLink.SurveyLink.SurveyLink();
|
|
14
|
-
document.getElementById('container')?.appendChild(link);
|
|
15
|
-
|
|
16
|
-
// TODO(petermarshall): The icon doesn't render because importing sub-components cross-module
|
|
17
|
-
// is tricky. Add some more interesting examples once it does.
|
|
18
|
-
|
|
19
|
-
link.data = {
|
|
20
|
-
trigger: 'test trigger',
|
|
21
|
-
promptText: Common.UIString.LocalizedEmptyString,
|
|
22
|
-
canShowSurvey: (_trigger, callback) => {
|
|
23
|
-
setTimeout(callback.bind(undefined, {canShowSurvey: true}), 500);
|
|
24
|
-
},
|
|
25
|
-
showSurvey: (_trigger, callback) => {
|
|
26
|
-
setTimeout(callback.bind(undefined, {surveyShown: true}), 1500);
|
|
27
|
-
},
|
|
28
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright 2020 The Chromium Authors
|
|
3
|
-
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
found in the LICENSE file.
|
|
5
|
-
-->
|
|
6
|
-
<!DOCTYPE html>
|
|
7
|
-
<html>
|
|
8
|
-
<head>
|
|
9
|
-
<meta charset="UTF-8" />
|
|
10
|
-
<meta name="viewport" content="width=device-width" />
|
|
11
|
-
<title>Basic TreeOutline example</title>
|
|
12
|
-
<style>
|
|
13
|
-
#container {
|
|
14
|
-
width: 80%;
|
|
15
|
-
border: 1px solid black;
|
|
16
|
-
padding: 20px;
|
|
17
|
-
height: 300px;
|
|
18
|
-
}
|
|
19
|
-
</style>
|
|
20
|
-
</head>
|
|
21
|
-
|
|
22
|
-
<body>
|
|
23
|
-
|
|
24
|
-
<div id="container">
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<button id="recursively-expand">Recursively expand</button>
|
|
28
|
-
<button id="expand-to-belgrave-house">Expand to show BEL node</button>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<script type="module" src="./basic.js"></script>
|
|
32
|
-
</body>
|
|
33
|
-
</html>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 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 FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
|
|
6
|
-
import * as ComponentHelpers from '../../helpers/helpers.js';
|
|
7
|
-
import * as TreeOutline from '../../tree_outline/tree_outline.js';
|
|
8
|
-
|
|
9
|
-
import {belgraveHouse, officesAndProductsData} from './sample-data.js';
|
|
10
|
-
|
|
11
|
-
await ComponentHelpers.ComponentServerSetup.setup();
|
|
12
|
-
await FrontendHelpers.initializeGlobalVars();
|
|
13
|
-
|
|
14
|
-
const component = new TreeOutline.TreeOutline.TreeOutline<string>();
|
|
15
|
-
component.data = {
|
|
16
|
-
defaultRenderer: TreeOutline.TreeOutline.defaultRenderer,
|
|
17
|
-
tree: officesAndProductsData,
|
|
18
|
-
};
|
|
19
|
-
component.setAttribute('animated', 'animated');
|
|
20
|
-
|
|
21
|
-
component.addEventListener('treenodemouseover', (event: Event) => {
|
|
22
|
-
const evt = event as TreeOutline.TreeOutline.ItemMouseOverEvent<string>;
|
|
23
|
-
// eslint-disable-next-line no-console
|
|
24
|
-
console.log('Node', evt.data.node, 'mouseover');
|
|
25
|
-
});
|
|
26
|
-
component.addEventListener('treenodemouseout', (event: Event) => {
|
|
27
|
-
const evt = event as TreeOutline.TreeOutline.ItemMouseOutEvent<string>;
|
|
28
|
-
// eslint-disable-next-line no-console
|
|
29
|
-
console.log('Node', evt.data.node, 'mouseout');
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
document.getElementById('container')?.appendChild(component);
|
|
33
|
-
document.getElementById('recursively-expand')?.addEventListener('click', () => {
|
|
34
|
-
void component.expandRecursively();
|
|
35
|
-
});
|
|
36
|
-
document.getElementById('expand-to-belgrave-house')?.addEventListener('click', () => {
|
|
37
|
-
void component.expandToAndSelectTreeNode(belgraveHouse);
|
|
38
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright 2020 The Chromium Authors
|
|
3
|
-
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
found in the LICENSE file.
|
|
5
|
-
-->
|
|
6
|
-
<!DOCTYPE html>
|
|
7
|
-
<html>
|
|
8
|
-
<head>
|
|
9
|
-
<meta charset="UTF-8" />
|
|
10
|
-
<meta name="viewport" content="width=device-width" />
|
|
11
|
-
<title>TreeOutline with custom renderers</title>
|
|
12
|
-
<style>
|
|
13
|
-
#container {
|
|
14
|
-
width: 80%;
|
|
15
|
-
border: 1px solid black;
|
|
16
|
-
padding: 20px;
|
|
17
|
-
height: 300px;
|
|
18
|
-
}
|
|
19
|
-
</style>
|
|
20
|
-
</head>
|
|
21
|
-
|
|
22
|
-
<body>
|
|
23
|
-
|
|
24
|
-
<div id="container">
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<button id="recursively-expand">Recursively expand</button>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<script type="module" src="./custom-renderers.js"></script>
|
|
31
|
-
</body>
|
|
32
|
-
</html>
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 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 FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
|
|
6
|
-
import * as Lit from '../../../lit/lit.js';
|
|
7
|
-
import * as ComponentHelpers from '../../helpers/helpers.js';
|
|
8
|
-
import * as TreeOutline from '../../tree_outline/tree_outline.js';
|
|
9
|
-
|
|
10
|
-
const {html} = Lit;
|
|
11
|
-
|
|
12
|
-
await ComponentHelpers.ComponentServerSetup.setup();
|
|
13
|
-
await FrontendHelpers.initializeGlobalVars();
|
|
14
|
-
|
|
15
|
-
interface TreeNodeData {
|
|
16
|
-
cssProperty: string;
|
|
17
|
-
cssValue: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const data: TreeOutline.TreeOutline.TreeOutlineData<TreeNodeData> = {
|
|
21
|
-
defaultRenderer: (node, state) => {
|
|
22
|
-
const {cssProperty, cssValue} = node.treeNodeData;
|
|
23
|
-
const valueStyles = Lit.Directives.styleMap({
|
|
24
|
-
paddingLeft: '10px',
|
|
25
|
-
fontStyle: 'italic',
|
|
26
|
-
color: 'var(--sys-color-token-property-special)',
|
|
27
|
-
});
|
|
28
|
-
return html`<code>${cssProperty}</code>:${
|
|
29
|
-
state.isExpanded ? Lit.nothing : html`<code style=${valueStyles}>${cssValue}</code>`}`;
|
|
30
|
-
},
|
|
31
|
-
tree: [
|
|
32
|
-
{
|
|
33
|
-
treeNodeData: {cssProperty: 'border', cssValue: '1px solid red'},
|
|
34
|
-
id: '1',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
treeNodeData: {cssProperty: 'font-size', cssValue: '20px'},
|
|
38
|
-
id: '2',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
treeNodeData: {cssProperty: 'margin', cssValue: '10px 5px'},
|
|
42
|
-
id: '3',
|
|
43
|
-
async children(): Promise<Array<TreeOutline.TreeOutlineUtils.TreeNode<TreeNodeData>>> {
|
|
44
|
-
return [
|
|
45
|
-
{treeNodeData: {cssProperty: 'margin-left', cssValue: '5px'}, id: '4'},
|
|
46
|
-
{treeNodeData: {cssProperty: 'margin-right', cssValue: '5px'}, id: '5'},
|
|
47
|
-
{treeNodeData: {cssProperty: 'margin-top', cssValue: '10px'}, id: '6'},
|
|
48
|
-
{treeNodeData: {cssProperty: 'margin-bottom', cssValue: '10px'}, id: '7'},
|
|
49
|
-
];
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const component = new TreeOutline.TreeOutline.TreeOutline<TreeNodeData>();
|
|
56
|
-
component.data = data;
|
|
57
|
-
|
|
58
|
-
document.getElementById('container')?.appendChild(component);
|
|
59
|
-
document.getElementById('recursively-expand')?.addEventListener('click', () => {
|
|
60
|
-
void component.expandRecursively();
|
|
61
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright 2020 The Chromium Authors
|
|
3
|
-
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
found in the LICENSE file.
|
|
5
|
-
-->
|
|
6
|
-
<!DOCTYPE html>
|
|
7
|
-
<html>
|
|
8
|
-
<head>
|
|
9
|
-
<meta charset="UTF-8" />
|
|
10
|
-
<meta name="viewport" content="width=device-width" />
|
|
11
|
-
<title>Tree Outline with Lazy Children</title>
|
|
12
|
-
<style>
|
|
13
|
-
#container {
|
|
14
|
-
width: 80%;
|
|
15
|
-
border: 1px solid black;
|
|
16
|
-
padding: 20px;
|
|
17
|
-
height: 300px;
|
|
18
|
-
}
|
|
19
|
-
</style>
|
|
20
|
-
</head>
|
|
21
|
-
|
|
22
|
-
<body>
|
|
23
|
-
|
|
24
|
-
<div id="container">
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<button id="recursively-expand">Recursively expand</button>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<script type="module" src="./lazy-children.js"></script>
|
|
31
|
-
</body>
|
|
32
|
-
</html>
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 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 FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
|
|
6
|
-
import * as ComponentHelpers from '../../helpers/helpers.js';
|
|
7
|
-
import * as TreeOutline from '../../tree_outline/tree_outline.js';
|
|
8
|
-
|
|
9
|
-
await ComponentHelpers.ComponentServerSetup.setup();
|
|
10
|
-
await FrontendHelpers.initializeGlobalVars();
|
|
11
|
-
|
|
12
|
-
async function loadInSomeNodes(): Promise<Array<TreeOutline.TreeOutlineUtils.TreeNode<string>>> {
|
|
13
|
-
const europeanOffices: Array<TreeOutline.TreeOutlineUtils.TreeNode<string>> = [
|
|
14
|
-
{
|
|
15
|
-
treeNodeData: 'UK',
|
|
16
|
-
id: 'UK',
|
|
17
|
-
children: () => Promise.resolve([
|
|
18
|
-
{
|
|
19
|
-
treeNodeData: 'LON',
|
|
20
|
-
id: 'LON',
|
|
21
|
-
children: () => Promise.resolve(
|
|
22
|
-
[{treeNodeData: '6PS', id: '6PS'}, {treeNodeData: 'CSG', id: 'CSG'}, {treeNodeData: 'BEL', id: 'BEL'}]),
|
|
23
|
-
},
|
|
24
|
-
]),
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
treeNodeData: 'Germany',
|
|
28
|
-
id: 'Germany',
|
|
29
|
-
children: () => Promise.resolve([
|
|
30
|
-
{treeNodeData: 'MUC', id: 'MUC'},
|
|
31
|
-
{treeNodeData: 'BER', id: 'MUC'},
|
|
32
|
-
]),
|
|
33
|
-
},
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
return await new Promise(resolve => {
|
|
37
|
-
setTimeout(() => resolve(europeanOffices), 250);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const data: TreeOutline.TreeOutline.TreeOutlineData<string> = {
|
|
42
|
-
defaultRenderer: TreeOutline.TreeOutline.defaultRenderer,
|
|
43
|
-
tree: [
|
|
44
|
-
{
|
|
45
|
-
treeNodeData: 'Offices',
|
|
46
|
-
id: 'Offices',
|
|
47
|
-
children: () => Promise.resolve([
|
|
48
|
-
{
|
|
49
|
-
treeNodeData: 'Europe',
|
|
50
|
-
id: 'Europe',
|
|
51
|
-
async children() {
|
|
52
|
-
const children = await loadInSomeNodes();
|
|
53
|
-
return children;
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
]),
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
treeNodeData: 'Products',
|
|
60
|
-
id: 'Products',
|
|
61
|
-
children: () => Promise.resolve([
|
|
62
|
-
{
|
|
63
|
-
treeNodeData: 'Chrome',
|
|
64
|
-
id: 'Chrome',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
treeNodeData: 'YouTube',
|
|
68
|
-
id: 'YouTube',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
treeNodeData: 'Drive',
|
|
72
|
-
id: 'Drive',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
treeNodeData: 'Calendar',
|
|
76
|
-
id: 'Calendar',
|
|
77
|
-
},
|
|
78
|
-
]),
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
|
|
83
|
-
};
|
|
84
|
-
const component = new TreeOutline.TreeOutline.TreeOutline<string>();
|
|
85
|
-
component.setAttribute('toplevelbordercolor', 'var(--sys-color-token-property-special)');
|
|
86
|
-
component.data = data;
|
|
87
|
-
|
|
88
|
-
document.getElementById('container')?.appendChild(component);
|
|
89
|
-
document.getElementById('recursively-expand')?.addEventListener('click', () => {
|
|
90
|
-
void component.expandRecursively();
|
|
91
|
-
});
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 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 '../../tree_outline/tree_outline.js';
|
|
6
|
-
import type * as TreeOutline from '../../tree_outline/tree_outline.js';
|
|
7
|
-
|
|
8
|
-
export const belgraveHouse = {
|
|
9
|
-
treeNodeData: 'BEL',
|
|
10
|
-
id: 'BEL',
|
|
11
|
-
};
|
|
12
|
-
export const officesAndProductsData: Array<TreeOutline.TreeOutlineUtils.TreeNode<string>> = [
|
|
13
|
-
{
|
|
14
|
-
treeNodeData: 'Offices',
|
|
15
|
-
id: 'Offices',
|
|
16
|
-
children: () => Promise.resolve([
|
|
17
|
-
{
|
|
18
|
-
treeNodeData: 'Europe',
|
|
19
|
-
id: 'Europe',
|
|
20
|
-
children: () => Promise.resolve([
|
|
21
|
-
{
|
|
22
|
-
treeNodeData: 'UK',
|
|
23
|
-
id: 'UK',
|
|
24
|
-
children: () => Promise.resolve([
|
|
25
|
-
{
|
|
26
|
-
treeNodeData: 'LON',
|
|
27
|
-
id: 'LON',
|
|
28
|
-
children: () => Promise.resolve(
|
|
29
|
-
[{treeNodeData: '6PS', id: '6PS'}, {treeNodeData: 'CSG', id: 'CSG'}, belgraveHouse]),
|
|
30
|
-
},
|
|
31
|
-
]),
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
treeNodeData: 'Germany',
|
|
35
|
-
id: 'Germany',
|
|
36
|
-
children: () => Promise.resolve([
|
|
37
|
-
{treeNodeData: 'MUC', id: 'MUC'},
|
|
38
|
-
{treeNodeData: 'BER', id: 'BER'},
|
|
39
|
-
]),
|
|
40
|
-
},
|
|
41
|
-
]),
|
|
42
|
-
},
|
|
43
|
-
]),
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
treeNodeData: 'Products',
|
|
47
|
-
id: 'Products',
|
|
48
|
-
children: () => Promise.resolve([
|
|
49
|
-
{
|
|
50
|
-
treeNodeData: 'Chrome',
|
|
51
|
-
id: 'Chrome',
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
treeNodeData: 'YouTube',
|
|
55
|
-
id: 'YouTube',
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
treeNodeData: 'Drive',
|
|
59
|
-
id: 'Drive',
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
treeNodeData: 'Calendar',
|
|
63
|
-
id: 'Calendar',
|
|
64
|
-
},
|
|
65
|
-
]),
|
|
66
|
-
},
|
|
67
|
-
];
|
|
@@ -1,38 +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 Lit from '../../lit/lit.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Provides a hook to get a callback when a Lit node is rendered into the DOM:
|
|
9
|
-
* @example
|
|
10
|
-
*
|
|
11
|
-
* ```
|
|
12
|
-
* <p on-render=${nodeRenderedCallback(node => ...)}>
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
class NodeRenderedCallback extends Lit.Directive.Directive {
|
|
16
|
-
constructor(partInfo: Lit.Directive.PartInfo) {
|
|
17
|
-
super(partInfo);
|
|
18
|
-
|
|
19
|
-
if (partInfo.type !== Lit.Directive.PartType.ATTRIBUTE) {
|
|
20
|
-
throw new Error('Node rendered callback directive must be used as an attribute.');
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
override update(part: Lit.Directive.ElementPart, [callback]: Lit.Directive.DirectiveParameters<this>): void {
|
|
25
|
-
callback(part.element);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/*
|
|
29
|
-
* Because this directive doesn't render anything, there's no implementation
|
|
30
|
-
* here for the render method. But we need it to state that it takes in a
|
|
31
|
-
* callback function at the callsite. Without this definition, the types in
|
|
32
|
-
* the update() method above don't get correctly picked up.
|
|
33
|
-
*/
|
|
34
|
-
render(_callback: (domNode: Element) => void): void {
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export const nodeRenderedCallback = Lit.Directive.directive(NodeRenderedCallback);
|