chrome-devtools-frontend 1.0.1550444 → 1.0.1553956
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 +34 -8
- package/eslint.config.mjs +7 -0
- package/front_end/Images/generate-css-vars.js +8 -4
- package/front_end/core/common/Settings.ts +20 -8
- package/front_end/core/host/UserMetrics.ts +3 -1
- package/front_end/core/i18n/collect-ui-strings.js +19 -10
- package/front_end/core/i18n/generate-locales-js.js +4 -4
- package/front_end/core/protocol_client/CDPConnection.ts +1 -0
- package/front_end/core/protocol_client/InspectorBackend.ts +5 -1
- package/front_end/core/root/Runtime.ts +0 -12
- package/front_end/core/sdk/DOMModel.ts +38 -3
- package/front_end/core/sdk/DebuggerModel.ts +9 -4
- package/front_end/core/sdk/IsolateManager.ts +7 -0
- package/front_end/core/sdk/PageResourceLoader.ts +3 -3
- package/front_end/core/sdk/RehydratingConnection.ts +5 -2
- package/front_end/entrypoints/main/MainImpl.ts +28 -10
- package/front_end/generated/SupportedCSSProperties.js +14 -0
- package/front_end/models/ai_assistance/AiConversation.ts +94 -4
- package/front_end/models/ai_assistance/agents/AiAgent.ts +30 -15
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +179 -41
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +5 -0
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +62 -0
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +2 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +1 -7
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +124 -12
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +125 -30
- package/front_end/models/ai_assistance/performance/AICallTree.ts +42 -0
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +12 -0
- package/front_end/models/issues_manager/Issue.ts +1 -0
- package/front_end/models/issues_manager/IssueAggregator.ts +9 -0
- package/front_end/models/issues_manager/IssuesManager.ts +5 -0
- package/front_end/models/issues_manager/PermissionElementIssue.ts +262 -0
- package/front_end/models/issues_manager/descriptions/permissionElementActivationDisabled.md +7 -0
- package/front_end/models/issues_manager/descriptions/permissionElementActivationDisabledWithOccluder.md +9 -0
- package/front_end/models/issues_manager/descriptions/permissionElementActivationDisabledWithOccluderParent.md +9 -0
- package/front_end/models/issues_manager/descriptions/permissionElementCspFrameAncestorsMissing.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementFencedFrameDisallowed.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementFontSizeTooLarge.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementFontSizeTooSmall.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementGeolocationDeprecated.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementInsetBoxShadowUnsupported.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementInvalidDisplayStyle.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementInvalidSizeValue.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementInvalidType.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementInvalidTypeActivation.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementLowContrast.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementNonOpaqueColor.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementPaddingBottomUnsupported.md +6 -0
- package/front_end/models/issues_manager/descriptions/permissionElementPaddingRightUnsupported.md +6 -0
- package/front_end/models/issues_manager/descriptions/permissionElementPermissionsPolicyBlocked.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementRegistrationFailed.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementRequestInProgress.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementSecurityChecksFailed.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementTypeNotSupported.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementUntrustedEvent.md +7 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +8 -0
- package/front_end/models/stack_trace/StackTraceModel.ts +37 -18
- package/front_end/models/trace/Processor.ts +14 -15
- package/front_end/models/trace/insights/Common.ts +2 -8
- package/front_end/models/trace/insights/types.ts +12 -2
- package/front_end/models/trace/types/TraceEvents.ts +4 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +28 -6
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +9 -23
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +78 -2
- package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +71 -0
- package/front_end/panels/ai_assistance/components/PerformanceAgentFlameChart.ts +126 -0
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +131 -2
- package/front_end/panels/ai_assistance/components/chatView.css +28 -0
- package/front_end/panels/ai_assistance/components/collapsibleAssistanceContentWidget.css +33 -0
- package/front_end/panels/application/AppManifestView.ts +1007 -521
- package/front_end/panels/application/ApplicationPanelSidebar.ts +1 -17
- package/front_end/panels/application/ExtensionStorageItemsView.ts +3 -5
- package/front_end/panels/application/KeyValueStorageItemsView.ts +3 -2
- package/front_end/panels/application/components/BackForwardCacheView.ts +2 -2
- package/front_end/panels/application/preloading/PreloadingView.ts +46 -45
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +80 -75
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +169 -133
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +74 -93
- package/front_end/panels/application/preloading/components/RuleSetGrid.ts +142 -117
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +51 -11
- package/front_end/panels/application/preloading/components/components.ts +0 -2
- package/front_end/panels/common/Annotation.ts +184 -0
- package/front_end/panels/common/AnnotationManager.ts +148 -11
- package/front_end/panels/common/ExtensionView.ts +47 -0
- package/front_end/panels/common/PersistenceUtils.ts +22 -25
- package/front_end/panels/common/annotation.css +40 -0
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/console/ConsoleInsightTeaser.ts +187 -5
- package/front_end/panels/console/ConsolePinPane.ts +437 -217
- package/front_end/panels/console/ConsolePrompt.ts +32 -223
- package/front_end/panels/console/ConsoleView.ts +67 -66
- package/front_end/panels/console/ConsoleViewMessage.ts +8 -3
- package/front_end/panels/console/consoleInsightTeaser.css +23 -0
- package/front_end/panels/console/consoleView.css +1 -1
- package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +89 -0
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +2 -2
- package/front_end/panels/elements/ComputedStyleWidget.ts +16 -5
- package/front_end/panels/elements/ElementsPanel.ts +38 -12
- package/front_end/panels/elements/ElementsSidebarPane.ts +1 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +313 -353
- package/front_end/panels/elements/ElementsTreeOutline.ts +39 -13
- package/front_end/panels/elements/StylePropertyTreeElement.ts +15 -14
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
- package/front_end/panels/emulation/MediaQueryInspector.ts +171 -125
- package/front_end/panels/explain/components/ConsoleInsight.ts +175 -150
- package/front_end/panels/explain/components/consoleInsight.css +348 -347
- package/front_end/panels/issues/AffectedPermissionElementsView.ts +46 -0
- package/front_end/panels/issues/IssueView.ts +2 -0
- package/front_end/panels/issues/IssuesPane.ts +6 -0
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +165 -149
- package/front_end/panels/layer_viewer/Layers3DView.ts +131 -78
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +149 -100
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +90 -64
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +25 -34
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +60 -44
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +170 -151
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +50 -51
- package/front_end/panels/linear_memory_inspector/components/valueInterpreterDisplay.css +0 -13
- package/front_end/panels/linear_memory_inspector/components/valueInterpreterSettings.css +20 -18
- package/front_end/panels/mobile_throttling/CalibrationController.ts +3 -1
- package/front_end/panels/network/NetworkDataGridNode.ts +14 -6
- package/front_end/panels/network/NetworkItemView.ts +42 -3
- package/front_end/panels/network/NetworkLogView.ts +10 -11
- package/front_end/panels/network/NetworkPanel.ts +63 -1
- package/front_end/panels/network/RequestInitiatorView.ts +146 -113
- package/front_end/panels/network/components/RequestHeaderSection.css +51 -50
- package/front_end/panels/network/components/RequestHeaderSection.ts +81 -71
- package/front_end/panels/network/components/RequestHeadersView.css +1 -1
- package/front_end/panels/network/components/RequestHeadersView.ts +26 -11
- package/front_end/panels/network/components/RequestTrustTokensView.css +24 -14
- package/front_end/panels/network/components/RequestTrustTokensView.ts +144 -140
- package/front_end/panels/profiler/IsolateSelector.ts +2 -1
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +49 -33
- package/front_end/panels/recorder/RecorderController.ts +2 -3
- package/front_end/panels/recorder/components/ControlButton.ts +68 -34
- package/front_end/panels/recorder/components/CreateRecordingView.ts +9 -6
- package/front_end/panels/recorder/components/RecordingView.ts +81 -88
- package/front_end/panels/recorder/components/ReplaySection.ts +226 -145
- package/front_end/panels/recorder/{controllers → components}/SelectorPicker.ts +129 -52
- package/front_end/panels/recorder/components/StepEditor.ts +21 -67
- package/front_end/panels/recorder/components/StepView.ts +222 -180
- package/front_end/panels/recorder/components/TimelineSection.ts +69 -48
- package/front_end/panels/recorder/components/components.ts +2 -2
- package/front_end/panels/recorder/components/selectorPicker.css +14 -0
- package/front_end/panels/recorder/components/stepEditor.css +0 -5
- package/front_end/panels/recorder/components/stepView.css +196 -198
- package/front_end/panels/recorder/extensions/ExtensionManager.ts +4 -48
- package/front_end/panels/recorder/models/ScreenshotUtils.ts +17 -11
- package/front_end/panels/security/CookieControlsView.ts +9 -16
- package/front_end/panels/settings/components/SyncSection.ts +0 -1
- package/front_end/panels/sources/CSSPlugin.ts +3 -3
- package/front_end/panels/sources/CallStackSidebarPane.ts +60 -75
- package/front_end/panels/sources/SourcesPanel.ts +1 -11
- package/front_end/panels/sources/TabbedEditorContainer.ts +11 -8
- package/front_end/panels/sources/ThreadsSidebarPane.ts +96 -101
- package/front_end/panels/sources/threadsSidebarPane.css +6 -5
- package/front_end/panels/timeline/InteractionsTrackAppender.ts +2 -3
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +23 -33
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +4 -3
- package/front_end/panels/timeline/TimelineFlameChartView.ts +12 -0
- package/front_end/panels/timeline/TimelinePanel.ts +3 -5
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +164 -142
- package/front_end/panels/timeline/components/InteractionBreakdown.ts +48 -28
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +18 -23
- package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +98 -73
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +9 -12
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +262 -291
- package/front_end/panels/timeline/components/Utils.ts +25 -0
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +210 -146
- package/front_end/panels/timeline/components/insights/CLSCulprits.ts +8 -20
- package/front_end/panels/timeline/components/insights/Cache.ts +0 -9
- package/front_end/panels/timeline/components/insights/DOMSize.ts +11 -33
- package/front_end/panels/timeline/components/insights/DocumentLatency.ts +0 -9
- package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +0 -9
- package/front_end/panels/timeline/components/insights/EventRef.ts +47 -109
- package/front_end/panels/timeline/components/insights/FontDisplay.ts +0 -9
- package/front_end/panels/timeline/components/insights/ForcedReflow.ts +0 -9
- package/front_end/panels/timeline/components/insights/INPBreakdown.ts +0 -9
- package/front_end/panels/timeline/components/insights/ImageDelivery.ts +1 -10
- package/front_end/panels/timeline/components/insights/ImageRef.ts +112 -0
- package/front_end/panels/timeline/components/insights/InsightRenderer.ts +91 -0
- package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +0 -9
- package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +4 -11
- package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +0 -9
- package/front_end/panels/timeline/components/insights/ModernHTTP.ts +0 -9
- package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +6 -21
- package/front_end/panels/timeline/components/insights/NodeLink.ts +68 -43
- package/front_end/panels/timeline/components/insights/README.md +2 -3
- package/front_end/panels/timeline/components/insights/RenderBlocking.ts +0 -9
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +0 -9
- package/front_end/panels/timeline/components/insights/ThirdParties.ts +0 -9
- package/front_end/panels/timeline/components/insights/Viewport.ts +7 -19
- package/front_end/panels/timeline/components/insights/baseInsightComponent.css +5 -0
- package/front_end/panels/timeline/components/insights/insights.ts +2 -0
- package/front_end/panels/timeline/components/interactionBreakdown.css +15 -13
- package/front_end/panels/timeline/enable-easter-egg.js +7 -3
- 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/BluetoothEmulation.d.ts +96 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BluetoothEmulation.js +8 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +87 -0
- 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/DeviceRequestPrompt.d.ts +2 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js +5 -24
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js.map +1 -1
- 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/api/api.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.d.ts +18 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.js +42 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +4 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +10 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.d.ts +27 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.js +90 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +4 -1
- 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 +5 -2
- 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/BrowsingContext.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +14 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +1 -1
- 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/BluetoothEmulation.d.ts +18 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BluetoothEmulation.js +30 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +5 -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 +22 -3
- 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/CdpSession.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts +2 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js +4 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +2 -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 +8 -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/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js +8 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js +30 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +15 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.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/node/ChromeLauncher.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +2 -13
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts +5 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.js +17 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.js.map +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/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 +221 -4
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +182 -95
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.d.ts +96 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +87 -0
- 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/DeviceRequestPrompt.d.ts +2 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js +4 -22
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js.map +1 -1
- 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/api/api.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.d.ts +18 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.js +38 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +4 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +10 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.d.ts +27 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.js +85 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +4 -1
- 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 +5 -2
- 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/BrowsingContext.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +14 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +1 -1
- 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/BluetoothEmulation.d.ts +18 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BluetoothEmulation.js +26 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +5 -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 +22 -3
- 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/CdpSession.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts +2 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js +2 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +2 -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 +8 -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/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js +8 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +31 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts +15 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +2 -13
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +5 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.js +16 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.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/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 +221 -4
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/BluetoothEmulation.ts +103 -0
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +96 -1
- package/front_end/third_party/puppeteer/package/src/api/DeviceRequestPrompt.ts +2 -10
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +6 -0
- package/front_end/third_party/puppeteer/package/src/api/api.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/BluetoothEmulation.ts +52 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +15 -0
- package/front_end/third_party/puppeteer/package/src/bidi/DeviceRequestPrompt.ts +138 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +7 -3
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +10 -2
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +30 -2
- package/front_end/third_party/puppeteer/package/src/bidi/util.ts +8 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/BluetoothEmulation.ts +47 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +33 -3
- package/front_end/third_party/puppeteer/package/src/cdp/CdpSession.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/DeviceRequestPrompt.ts +3 -8
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +9 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +13 -0
- package/front_end/third_party/puppeteer/package/src/cdp/WebWorker.ts +8 -3
- package/front_end/third_party/puppeteer/package/src/cdp/cdp.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +45 -1
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +20 -0
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +5 -17
- package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +23 -7
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +4 -0
- package/front_end/ui/components/annotations/AnnotationRepository.ts +153 -13
- package/front_end/ui/components/snackbars/Snackbars.docs.ts +0 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionTeaserPlaceholder.ts +12 -3
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +182 -0
- package/front_end/ui/components/text_editor/text_editor.ts +1 -0
- package/front_end/ui/helpers/OpenInNewTab.ts +5 -1
- package/front_end/ui/i18n/i18n.ts +9 -9
- package/front_end/ui/kit/icons/Icon.docs.ts +22 -65
- package/front_end/ui/kit/kit.ts +1 -0
- package/front_end/ui/kit/link/Link.docs.ts +15 -0
- package/front_end/ui/kit/link/Link.ts +151 -0
- package/front_end/ui/kit/link/link.css +27 -0
- package/front_end/ui/legacy/EmptyWidget.ts +6 -0
- package/front_end/ui/legacy/Floaty.ts +442 -0
- package/front_end/ui/legacy/InspectorView.ts +12 -0
- package/front_end/ui/legacy/ReportView.ts +1 -1
- package/front_end/ui/legacy/SelectMenu.docs.ts +0 -1
- package/front_end/ui/legacy/TabbedPane.ts +131 -53
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +36 -36
- package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +22 -37
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +31 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +2 -2
- package/front_end/ui/legacy/components/utils/Linkifier.ts +7 -11
- package/front_end/ui/legacy/floaty.css +77 -0
- package/front_end/ui/legacy/legacy.ts +2 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +6 -0
- package/inspector_overlay/loadCSS.rollup.js +5 -4
- package/package.json +2 -2
- package/front_end/panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts +0 -99
- package/front_end/panels/recorder/components/SelectButton.ts +0 -304
- package/front_end/panels/recorder/controllers/controllers.ts +0 -7
- package/front_end/ui/components/chrome_link/ChromeLink.ts +0 -76
- package/front_end/ui/components/chrome_link/chromeLink.css +0 -12
- package/front_end/ui/components/chrome_link/chrome_link.ts +0 -9
- /package/front_end/panels/recorder/components/{selectButton.css → replaySection.css} +0 -0
|
@@ -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
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
|
+
/* eslint-disable @devtools/no-imperative-dom-api, @devtools/no-lit-render-outside-of-view */
|
|
6
6
|
|
|
7
7
|
import './Toolbar.js';
|
|
8
8
|
|
|
@@ -12,6 +12,7 @@ import * as Platform from '../../core/platform/platform.js';
|
|
|
12
12
|
import * as Geometry from '../../models/geometry/geometry.js';
|
|
13
13
|
import * as Annotations from '../../ui/components/annotations/annotations.js';
|
|
14
14
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
15
|
+
import {type LitTemplate, render} from '../../ui/lit/lit.js';
|
|
15
16
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
16
17
|
import {createIcon, Icon} from '../kit/kit.js';
|
|
17
18
|
|
|
@@ -67,15 +68,30 @@ const UIStrings = {
|
|
|
67
68
|
*/
|
|
68
69
|
moveTabLeft: 'Move left',
|
|
69
70
|
} as const;
|
|
71
|
+
|
|
70
72
|
const str_ = i18n.i18n.registerUIStrings('ui/legacy/TabbedPane.ts', UIStrings);
|
|
71
73
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
74
|
+
|
|
75
|
+
export interface TabInfo {
|
|
76
|
+
id: string;
|
|
77
|
+
title: string;
|
|
78
|
+
view: Widget;
|
|
79
|
+
tabTooltip?: string;
|
|
80
|
+
isCloseable?: boolean;
|
|
81
|
+
previewFeature?: boolean;
|
|
82
|
+
index?: number;
|
|
83
|
+
jslogContext?: string;
|
|
84
|
+
enabled?: boolean;
|
|
85
|
+
selected?: boolean;
|
|
86
|
+
}
|
|
87
|
+
|
|
72
88
|
export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, typeof VBox>(VBox) {
|
|
73
89
|
readonly #headerElement: HTMLElement;
|
|
74
90
|
private readonly headerContentsElement: HTMLElement;
|
|
75
91
|
tabSlider: HTMLDivElement;
|
|
76
92
|
readonly tabsElement: HTMLElement;
|
|
77
93
|
readonly #contentElement: HTMLElement;
|
|
78
|
-
|
|
94
|
+
#tabs: TabbedPaneTab[];
|
|
79
95
|
private readonly tabsHistory: TabbedPaneTab[];
|
|
80
96
|
tabsById: Map<string, TabbedPaneTab>;
|
|
81
97
|
private currentTabLocked: boolean;
|
|
@@ -115,7 +131,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
115
131
|
this.tabsElement.addEventListener('keydown', this.keyDown.bind(this), false);
|
|
116
132
|
this.#contentElement = this.contentElement.createChild('div', 'tabbed-pane-content');
|
|
117
133
|
this.#contentElement.createChild('slot');
|
|
118
|
-
this
|
|
134
|
+
this.#tabs = [];
|
|
119
135
|
this.tabsHistory = [];
|
|
120
136
|
this.tabsById = new Map();
|
|
121
137
|
this.currentTabLocked = false;
|
|
@@ -129,7 +145,11 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
129
145
|
|
|
130
146
|
if (Annotations.AnnotationRepository.annotationsEnabled()) {
|
|
131
147
|
Annotations.AnnotationRepository.instance().addEventListener(
|
|
132
|
-
Annotations.Events.ANNOTATION_ADDED, this.#
|
|
148
|
+
Annotations.Events.ANNOTATION_ADDED, this.#onUpdateAnnotations, this);
|
|
149
|
+
Annotations.AnnotationRepository.instance().addEventListener(
|
|
150
|
+
Annotations.Events.ANNOTATION_DELETED, this.#onUpdateAnnotations, this);
|
|
151
|
+
Annotations.AnnotationRepository.instance().addEventListener(
|
|
152
|
+
Annotations.Events.ALL_ANNOTATIONS_DELETED, this.#onUpdateAnnotations, this);
|
|
133
153
|
}
|
|
134
154
|
}
|
|
135
155
|
|
|
@@ -151,15 +171,15 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
151
171
|
}
|
|
152
172
|
|
|
153
173
|
tabIds(): string[] {
|
|
154
|
-
return this
|
|
174
|
+
return this.#tabs.map(tab => tab.id);
|
|
155
175
|
}
|
|
156
176
|
|
|
157
177
|
tabIndex(tabId: string): number {
|
|
158
|
-
return this
|
|
178
|
+
return this.#tabs.findIndex(tab => tab.id === tabId);
|
|
159
179
|
}
|
|
160
180
|
|
|
161
181
|
tabViews(): Widget[] {
|
|
162
|
-
return this
|
|
182
|
+
return this.#tabs.map(tab => tab.view);
|
|
163
183
|
}
|
|
164
184
|
|
|
165
185
|
tabView(tabId: string): Widget|null {
|
|
@@ -210,7 +230,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
210
230
|
}
|
|
211
231
|
|
|
212
232
|
setTabDelegate(delegate: TabbedPaneTabDelegate): void {
|
|
213
|
-
const tabs = this
|
|
233
|
+
const tabs = this.#tabs.slice();
|
|
214
234
|
for (let i = 0; i < tabs.length; ++i) {
|
|
215
235
|
tabs[i].setDelegate(delegate);
|
|
216
236
|
}
|
|
@@ -230,9 +250,9 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
230
250
|
tab.tabElement.setAttribute(
|
|
231
251
|
'jslog', `${VisualLogging.panelTabHeader().track({click: true, drag: true}).context(tab.jslogContext)}`);
|
|
232
252
|
if (index !== undefined) {
|
|
233
|
-
this
|
|
253
|
+
this.#tabs.splice(index, 0, tab);
|
|
234
254
|
} else {
|
|
235
|
-
this
|
|
255
|
+
this.#tabs.push(tab);
|
|
236
256
|
}
|
|
237
257
|
this.tabsHistory.push(tab);
|
|
238
258
|
if (this.tabsHistory[0] === tab && this.isShowing()) {
|
|
@@ -278,7 +298,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
278
298
|
this.tabsById.delete(id);
|
|
279
299
|
|
|
280
300
|
this.tabsHistory.splice(this.tabsHistory.indexOf(tab), 1);
|
|
281
|
-
this
|
|
301
|
+
this.#tabs.splice(this.#tabs.indexOf(tab), 1);
|
|
282
302
|
if (tab.shown) {
|
|
283
303
|
this.hideTabElement(tab);
|
|
284
304
|
}
|
|
@@ -294,9 +314,9 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
294
314
|
|
|
295
315
|
otherTabs(id: string): string[] {
|
|
296
316
|
const result = [];
|
|
297
|
-
for (let i = 0; i < this
|
|
298
|
-
if (this
|
|
299
|
-
result.push(this
|
|
317
|
+
for (let i = 0; i < this.#tabs.length; ++i) {
|
|
318
|
+
if (this.#tabs[i].id !== id) {
|
|
319
|
+
result.push(this.#tabs[i].id);
|
|
300
320
|
}
|
|
301
321
|
}
|
|
302
322
|
return result;
|
|
@@ -304,7 +324,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
304
324
|
|
|
305
325
|
tabsToTheRight(id: string): string[] {
|
|
306
326
|
let index = -1;
|
|
307
|
-
for (let i = 0; i < this
|
|
327
|
+
for (let i = 0; i < this.#tabs.length; ++i) {
|
|
308
328
|
if (this.tabs[i].id === id) {
|
|
309
329
|
index = i;
|
|
310
330
|
break;
|
|
@@ -313,7 +333,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
313
333
|
if (index === -1) {
|
|
314
334
|
return [];
|
|
315
335
|
}
|
|
316
|
-
return this
|
|
336
|
+
return this.#tabs.slice(index + 1).map(function(tab) {
|
|
317
337
|
return tab.id;
|
|
318
338
|
});
|
|
319
339
|
}
|
|
@@ -368,19 +388,19 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
368
388
|
}
|
|
369
389
|
|
|
370
390
|
selectNextTab(): void {
|
|
371
|
-
const index = this
|
|
372
|
-
const nextIndex = Platform.NumberUtilities.mod(index + 1, this
|
|
373
|
-
this.selectTab(this
|
|
391
|
+
const index = this.#tabs.indexOf((this.currentTab as TabbedPaneTab));
|
|
392
|
+
const nextIndex = Platform.NumberUtilities.mod(index + 1, this.#tabs.length);
|
|
393
|
+
this.selectTab(this.#tabs[nextIndex].id, true);
|
|
374
394
|
}
|
|
375
395
|
|
|
376
396
|
selectPrevTab(): void {
|
|
377
|
-
const index = this
|
|
378
|
-
const nextIndex = Platform.NumberUtilities.mod(index - 1, this
|
|
379
|
-
this.selectTab(this
|
|
397
|
+
const index = this.#tabs.indexOf((this.currentTab as TabbedPaneTab));
|
|
398
|
+
const nextIndex = Platform.NumberUtilities.mod(index - 1, this.#tabs.length);
|
|
399
|
+
this.selectTab(this.#tabs[nextIndex].id, true);
|
|
380
400
|
}
|
|
381
401
|
|
|
382
402
|
getTabIndex(id: string): number {
|
|
383
|
-
const index = this
|
|
403
|
+
const index = this.#tabs.indexOf((this.tabsById.get(id) as TabbedPaneTab));
|
|
384
404
|
return index;
|
|
385
405
|
}
|
|
386
406
|
|
|
@@ -411,7 +431,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
411
431
|
this.requestUpdate();
|
|
412
432
|
}
|
|
413
433
|
|
|
414
|
-
setTrailingTabIcon(id: string, icon: Icon|null): void {
|
|
434
|
+
setTrailingTabIcon(id: string, icon: Icon|LitTemplate|null): void {
|
|
415
435
|
const tab = this.tabsById.get(id);
|
|
416
436
|
if (!tab) {
|
|
417
437
|
return;
|
|
@@ -419,7 +439,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
419
439
|
tab.setSuffixElement(icon);
|
|
420
440
|
}
|
|
421
441
|
|
|
422
|
-
setSuffixElement(id: string, suffixElement: HTMLElement|null): void {
|
|
442
|
+
setSuffixElement(id: string, suffixElement: HTMLElement|LitTemplate|null): void {
|
|
423
443
|
const tab = this.tabsById.get(id);
|
|
424
444
|
if (!tab) {
|
|
425
445
|
return;
|
|
@@ -460,8 +480,8 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
460
480
|
}
|
|
461
481
|
|
|
462
482
|
private clearMeasuredWidths(): void {
|
|
463
|
-
for (let i = 0; i < this
|
|
464
|
-
delete this
|
|
483
|
+
for (let i = 0; i < this.#tabs.length; ++i) {
|
|
484
|
+
delete this.#tabs[i].measuredWidth;
|
|
465
485
|
}
|
|
466
486
|
}
|
|
467
487
|
|
|
@@ -499,6 +519,59 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
499
519
|
this.resumeInvalidations();
|
|
500
520
|
}
|
|
501
521
|
|
|
522
|
+
get tabs(): TabInfo[] {
|
|
523
|
+
return this.#tabs.map(tab => ({
|
|
524
|
+
id: tab.id,
|
|
525
|
+
title: tab.title,
|
|
526
|
+
view: tab.view,
|
|
527
|
+
tabTooltip: tab.tooltip,
|
|
528
|
+
isCloseable: tab.closeable,
|
|
529
|
+
previewFeature: tab.previewFeature,
|
|
530
|
+
index: this.#tabs.indexOf(tab),
|
|
531
|
+
jslogContext: tab.jslogContext,
|
|
532
|
+
enabled: this.tabIsEnabled(tab.id),
|
|
533
|
+
selected: this.currentTab?.id === tab.id,
|
|
534
|
+
}));
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
set tabs(tabs: TabInfo[]) {
|
|
538
|
+
const newIds = new Set(tabs.map(tab => tab.id));
|
|
539
|
+
for (const id of this.tabsById.keys()) {
|
|
540
|
+
if (!newIds.has(id)) {
|
|
541
|
+
this.#closeTab(id);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
let index = 0;
|
|
545
|
+
for (const tab of tabs) {
|
|
546
|
+
const existingTab = this.tabsById.get(tab.id);
|
|
547
|
+
if (existingTab) {
|
|
548
|
+
this.changeTabView(tab.id, tab.view);
|
|
549
|
+
this.changeTabTitle(tab.id, tab.title, tab.tabTooltip);
|
|
550
|
+
if (tab.isCloseable !== undefined) {
|
|
551
|
+
existingTab.closeable = tab.isCloseable;
|
|
552
|
+
}
|
|
553
|
+
if (tab.previewFeature !== undefined) {
|
|
554
|
+
existingTab.previewFeature = tab.previewFeature;
|
|
555
|
+
}
|
|
556
|
+
const currentIndex = this.#tabs.indexOf(existingTab);
|
|
557
|
+
if (currentIndex !== index) {
|
|
558
|
+
this.insertBefore(existingTab, index);
|
|
559
|
+
}
|
|
560
|
+
} else {
|
|
561
|
+
this.appendTab(
|
|
562
|
+
tab.id, tab.title, tab.view, tab.tabTooltip, /* userGesture=*/ false, tab.isCloseable, tab.previewFeature,
|
|
563
|
+
index, tab.jslogContext);
|
|
564
|
+
}
|
|
565
|
+
if (tab.enabled !== undefined) {
|
|
566
|
+
this.setTabEnabled(tab.id, tab.enabled);
|
|
567
|
+
}
|
|
568
|
+
if (tab.selected) {
|
|
569
|
+
this.selectTab(tab.id);
|
|
570
|
+
}
|
|
571
|
+
++index;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
502
575
|
override onResize(): void {
|
|
503
576
|
if (this.currentDevicePixelRatio !== window.devicePixelRatio) {
|
|
504
577
|
// Force recalculation of all tab widths on a DPI change
|
|
@@ -589,8 +662,8 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
589
662
|
break;
|
|
590
663
|
}
|
|
591
664
|
|
|
592
|
-
const showTabAnnotationIcon = annotations.
|
|
593
|
-
annotations.
|
|
665
|
+
const showTabAnnotationIcon = annotations.getAnnotationDataByType(primaryType).length > 0 ||
|
|
666
|
+
annotations.getAnnotationDataByType(secondaryType).length > 0;
|
|
594
667
|
this.setTabAnnotationIcon(tab.id, showTabAnnotationIcon);
|
|
595
668
|
}
|
|
596
669
|
}
|
|
@@ -600,7 +673,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
600
673
|
return;
|
|
601
674
|
}
|
|
602
675
|
|
|
603
|
-
if (!this
|
|
676
|
+
if (!this.#tabs.length) {
|
|
604
677
|
this.#contentElement.classList.add('has-no-tabs');
|
|
605
678
|
if (this.placeholderElement && !this.placeholderContainerElement) {
|
|
606
679
|
this.placeholderContainerElement = this.#contentElement.createChild('div', 'tabbed-pane-placeholder fill');
|
|
@@ -697,7 +770,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
697
770
|
ARIAUtils.setExpanded(this.dropDownButton, false);
|
|
698
771
|
},
|
|
699
772
|
});
|
|
700
|
-
for (const tab of this
|
|
773
|
+
for (const tab of this.#tabs) {
|
|
701
774
|
if (tab.shown) {
|
|
702
775
|
continue;
|
|
703
776
|
}
|
|
@@ -729,7 +802,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
729
802
|
|
|
730
803
|
private numberOfTabsShown(): number {
|
|
731
804
|
let numTabsShown = 0;
|
|
732
|
-
for (const tab of this
|
|
805
|
+
for (const tab of this.#tabs) {
|
|
733
806
|
if (tab.shown) {
|
|
734
807
|
numTabsShown++;
|
|
735
808
|
}
|
|
@@ -739,26 +812,26 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
739
812
|
|
|
740
813
|
private updateTabsDropDown(): void {
|
|
741
814
|
const tabsToShowIndexes =
|
|
742
|
-
this.tabsToShowIndexes(this
|
|
815
|
+
this.tabsToShowIndexes(this.#tabs, this.tabsHistory, this.totalWidth(), this.measuredDropDownButtonWidth || 0);
|
|
743
816
|
if (this.lastSelectedOverflowTab && this.numberOfTabsShown() !== tabsToShowIndexes.length) {
|
|
744
817
|
delete this.lastSelectedOverflowTab;
|
|
745
818
|
this.updateTabsDropDown();
|
|
746
819
|
return;
|
|
747
820
|
}
|
|
748
821
|
|
|
749
|
-
for (let i = 0; i < this
|
|
750
|
-
if (this
|
|
751
|
-
this.hideTabElement(this
|
|
822
|
+
for (let i = 0; i < this.#tabs.length; ++i) {
|
|
823
|
+
if (this.#tabs[i].shown && tabsToShowIndexes.indexOf(i) === -1) {
|
|
824
|
+
this.hideTabElement(this.#tabs[i]);
|
|
752
825
|
}
|
|
753
826
|
}
|
|
754
827
|
for (let i = 0; i < tabsToShowIndexes.length; ++i) {
|
|
755
|
-
const tab = this
|
|
828
|
+
const tab = this.#tabs[tabsToShowIndexes[i]];
|
|
756
829
|
if (!tab.shown) {
|
|
757
830
|
this.showTabElement(i, tab);
|
|
758
831
|
}
|
|
759
832
|
}
|
|
760
833
|
|
|
761
|
-
this.maybeShowDropDown(tabsToShowIndexes.length !== this
|
|
834
|
+
this.maybeShowDropDown(tabsToShowIndexes.length !== this.#tabs.length);
|
|
762
835
|
}
|
|
763
836
|
|
|
764
837
|
private maybeShowDropDown(hasMoreTabs: boolean): void {
|
|
@@ -786,7 +859,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
786
859
|
this.shrinkableTabs ? this.calculateMaxWidth(measuredWidths.slice(), this.totalWidth()) : Number.MAX_VALUE;
|
|
787
860
|
|
|
788
861
|
let i = 0;
|
|
789
|
-
for (const tab of this
|
|
862
|
+
for (const tab of this.#tabs) {
|
|
790
863
|
tab.setWidth(this.verticalTabLayout ? -1 : Math.min(maxWidth, measuredWidths[i++]));
|
|
791
864
|
}
|
|
792
865
|
}
|
|
@@ -795,7 +868,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
795
868
|
// Add all elements to measure into this.tabsElement
|
|
796
869
|
this.tabsElement.style.setProperty('width', '2000px');
|
|
797
870
|
const measuringTabElements = new Map<HTMLElement, TabbedPaneTab>();
|
|
798
|
-
for (const tab of this
|
|
871
|
+
for (const tab of this.#tabs) {
|
|
799
872
|
if (typeof tab.measuredWidth === 'number') {
|
|
800
873
|
continue;
|
|
801
874
|
}
|
|
@@ -817,7 +890,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
817
890
|
|
|
818
891
|
// Combine the results.
|
|
819
892
|
const measuredWidths = [];
|
|
820
|
-
for (const tab of this
|
|
893
|
+
for (const tab of this.#tabs) {
|
|
821
894
|
measuredWidths.push(tab.measuredWidth || 0);
|
|
822
895
|
}
|
|
823
896
|
this.tabsElement.style.removeProperty('width');
|
|
@@ -917,9 +990,9 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
917
990
|
return;
|
|
918
991
|
}
|
|
919
992
|
let left = 0;
|
|
920
|
-
for (let i = 0; i < this
|
|
921
|
-
if (this
|
|
922
|
-
left += this
|
|
993
|
+
for (let i = 0; i < this.#tabs.length && this.currentTab !== this.#tabs[i]; i++) {
|
|
994
|
+
if (this.#tabs[i].shown) {
|
|
995
|
+
left += this.#tabs[i].measuredWidth || 0;
|
|
923
996
|
}
|
|
924
997
|
}
|
|
925
998
|
const sliderWidth = this.currentTab.shown ? this.currentTab.measuredWidth : this.dropDownButton.offsetWidth;
|
|
@@ -946,12 +1019,12 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
946
1019
|
|
|
947
1020
|
insertBefore(tab: TabbedPaneTab, index: number): void {
|
|
948
1021
|
this.tabsElement.insertBefore(tab.tabElement, this.tabsElement.childNodes[index]);
|
|
949
|
-
const oldIndex = this
|
|
950
|
-
this
|
|
1022
|
+
const oldIndex = this.#tabs.indexOf(tab);
|
|
1023
|
+
this.#tabs.splice(oldIndex, 1);
|
|
951
1024
|
if (oldIndex < index) {
|
|
952
1025
|
--index;
|
|
953
1026
|
}
|
|
954
|
-
this
|
|
1027
|
+
this.#tabs.splice(index, 0, tab);
|
|
955
1028
|
|
|
956
1029
|
const eventData: EventData = {prevTabId: undefined, tabId: tab.id, view: tab.view, isUserGesture: undefined};
|
|
957
1030
|
this.dispatchEventToListeners(Events.TabOrderChanged, eventData);
|
|
@@ -987,7 +1060,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
987
1060
|
}
|
|
988
1061
|
}
|
|
989
1062
|
|
|
990
|
-
#
|
|
1063
|
+
#onUpdateAnnotations(): void {
|
|
991
1064
|
this.updateTabAnnotationIcons();
|
|
992
1065
|
}
|
|
993
1066
|
|
|
@@ -1026,7 +1099,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
1026
1099
|
this.dropDownButton.click();
|
|
1027
1100
|
return;
|
|
1028
1101
|
}
|
|
1029
|
-
const tab = this
|
|
1102
|
+
const tab = this.#tabs.find(tab => tab.tabElement === nextTabElement);
|
|
1030
1103
|
if (tab) {
|
|
1031
1104
|
this.selectTab(tab.id, true);
|
|
1032
1105
|
}
|
|
@@ -1071,7 +1144,8 @@ export class TabbedPaneTab {
|
|
|
1071
1144
|
measuredWidth!: number|undefined;
|
|
1072
1145
|
#tabElement!: HTMLElement|undefined;
|
|
1073
1146
|
private icon: Icon|null = null;
|
|
1074
|
-
private suffixElement: HTMLElement|null = null;
|
|
1147
|
+
private suffixElement: HTMLElement|LitTemplate|null = null;
|
|
1148
|
+
|
|
1075
1149
|
#width?: number;
|
|
1076
1150
|
private delegate?: TabbedPaneTabDelegate;
|
|
1077
1151
|
private titleElement?: HTMLElement;
|
|
@@ -1155,7 +1229,7 @@ export class TabbedPaneTab {
|
|
|
1155
1229
|
delete this.measuredWidth;
|
|
1156
1230
|
}
|
|
1157
1231
|
|
|
1158
|
-
setSuffixElement(suffixElement: HTMLElement|null): void {
|
|
1232
|
+
setSuffixElement(suffixElement: HTMLElement|LitTemplate|null): void {
|
|
1159
1233
|
this.suffixElement = suffixElement;
|
|
1160
1234
|
if (this.#tabElement && this.titleElement) {
|
|
1161
1235
|
this.createSuffixElement(this.#tabElement, this.titleElement, false);
|
|
@@ -1244,8 +1318,12 @@ export class TabbedPaneTab {
|
|
|
1244
1318
|
|
|
1245
1319
|
const suffixElementContainer = document.createElement('span');
|
|
1246
1320
|
suffixElementContainer.classList.add('tabbed-pane-header-tab-suffix-element');
|
|
1247
|
-
|
|
1248
|
-
|
|
1321
|
+
if (this.suffixElement instanceof HTMLElement) {
|
|
1322
|
+
const suffixElement = measuring ? this.suffixElement.cloneNode() : this.suffixElement;
|
|
1323
|
+
suffixElementContainer.appendChild(suffixElement);
|
|
1324
|
+
} else {
|
|
1325
|
+
render(this.suffixElement, suffixElementContainer);
|
|
1326
|
+
}
|
|
1249
1327
|
titleElement.insertAdjacentElement('afterend', suffixElementContainer);
|
|
1250
1328
|
tabSuffixElements.set(tabElement, suffixElementContainer);
|
|
1251
1329
|
}
|
|
@@ -208,7 +208,7 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
208
208
|
id="cookies-table"
|
|
209
209
|
striped
|
|
210
210
|
?inline=${input.renderInline}
|
|
211
|
-
@create=${input.onCreate}
|
|
211
|
+
@create=${(e: CustomEvent<CookieData>) => input.onCreate(e.detail)}
|
|
212
212
|
@refresh=${input.onRefresh}
|
|
213
213
|
@deselect=${() => input.onSelect(undefined)}
|
|
214
214
|
>
|
|
@@ -53,58 +53,62 @@ export class ClickEvent extends Event {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export class ColorSwatch extends HTMLElement {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
57
|
+
#tooltip: string = i18nString(UIStrings.shiftclickToChangeColorFormat);
|
|
58
|
+
#color: Common.Color.Color|null = null;
|
|
59
|
+
#readonly = false;
|
|
60
60
|
|
|
61
61
|
constructor(tooltip?: string) {
|
|
62
62
|
super();
|
|
63
63
|
if (tooltip) {
|
|
64
|
-
this
|
|
64
|
+
this.#tooltip = tooltip;
|
|
65
65
|
}
|
|
66
66
|
this.tabIndex = -1;
|
|
67
|
-
this.addEventListener('keydown', e => this
|
|
67
|
+
this.addEventListener('keydown', e => this.#onActivate(e));
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
static isColorSwatch(element: Element): element is ColorSwatch {
|
|
71
71
|
return element.localName === 'devtools-color-swatch';
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
get readonly(): boolean {
|
|
75
|
+
return this.#readonly;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
set readonly(readonly: boolean) {
|
|
79
|
+
if (this.#readonly === readonly) {
|
|
76
80
|
return;
|
|
77
81
|
}
|
|
78
82
|
|
|
79
|
-
this
|
|
80
|
-
if (this
|
|
81
|
-
this.
|
|
83
|
+
this.#readonly = readonly;
|
|
84
|
+
if (this.#color) {
|
|
85
|
+
this.color = this.#color;
|
|
82
86
|
}
|
|
83
87
|
}
|
|
84
88
|
|
|
85
|
-
|
|
86
|
-
return this
|
|
89
|
+
get color(): Common.Color.Color|null {
|
|
90
|
+
return this.#color;
|
|
87
91
|
}
|
|
88
92
|
|
|
89
93
|
get anchorBox(): AnchorBox|null {
|
|
90
|
-
const swatch = this
|
|
94
|
+
const swatch = this.#shadow.querySelector('.color-swatch');
|
|
91
95
|
return swatch ? swatch.boxInWindow() : null;
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
getText(): string|undefined {
|
|
95
|
-
return this
|
|
99
|
+
return this.#color?.getAuthoredText() ?? this.#color?.asString();
|
|
96
100
|
}
|
|
97
101
|
|
|
98
102
|
/**
|
|
99
103
|
* Render this swatch given a color object or text to be parsed as a color.
|
|
100
104
|
* @param color The color object or string to use for this swatch.
|
|
101
105
|
*/
|
|
102
|
-
|
|
103
|
-
this
|
|
106
|
+
set color(color: Common.Color.Color) {
|
|
107
|
+
this.#color = color;
|
|
104
108
|
|
|
105
109
|
const colorSwatchClasses = Lit.Directives.classMap({
|
|
106
110
|
'color-swatch': true,
|
|
107
|
-
readonly: this
|
|
111
|
+
readonly: this.#readonly,
|
|
108
112
|
});
|
|
109
113
|
|
|
110
114
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
@@ -116,19 +120,20 @@ export class ColorSwatch extends HTMLElement {
|
|
|
116
120
|
Lit.render(
|
|
117
121
|
html`<style>${colorSwatchStyles}</style><span
|
|
118
122
|
class=${colorSwatchClasses}
|
|
119
|
-
title=${this
|
|
123
|
+
title=${this.#tooltip}><span
|
|
120
124
|
class="color-swatch-inner"
|
|
121
125
|
style="background-color: ${color.asString()};"
|
|
122
126
|
jslog=${VisualLogging.showStyleEditor('color').track({click: true})}
|
|
123
|
-
@click=${this
|
|
124
|
-
@mousedown=${this
|
|
125
|
-
@dblclick=${this
|
|
126
|
-
this
|
|
127
|
+
@click=${this.#onActivate}
|
|
128
|
+
@mousedown=${this.#consume}
|
|
129
|
+
@dblclick=${this.#consume}></span></span>`,
|
|
130
|
+
this.#shadow, {host: this});
|
|
127
131
|
// clang-format on
|
|
132
|
+
this.dispatchEvent(new ColorChangedEvent(color));
|
|
128
133
|
}
|
|
129
134
|
|
|
130
|
-
|
|
131
|
-
if (this
|
|
135
|
+
#onActivate(e: KeyboardEvent|MouseEvent): void {
|
|
136
|
+
if (this.#readonly) {
|
|
132
137
|
return;
|
|
133
138
|
}
|
|
134
139
|
|
|
@@ -139,29 +144,24 @@ export class ColorSwatch extends HTMLElement {
|
|
|
139
144
|
|
|
140
145
|
if (e.shiftKey) {
|
|
141
146
|
e.stopPropagation();
|
|
142
|
-
this
|
|
147
|
+
this.#showFormatPicker(e);
|
|
143
148
|
return;
|
|
144
149
|
}
|
|
145
150
|
|
|
146
151
|
this.dispatchEvent(new ClickEvent());
|
|
147
|
-
this
|
|
152
|
+
this.#consume(e);
|
|
148
153
|
}
|
|
149
154
|
|
|
150
|
-
|
|
155
|
+
#consume(e: Event): void {
|
|
151
156
|
e.stopPropagation();
|
|
152
157
|
}
|
|
153
158
|
|
|
154
|
-
|
|
155
|
-
this
|
|
156
|
-
this.dispatchEvent(new ColorChangedEvent(color));
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
private showFormatPicker(e: Event): void {
|
|
160
|
-
if (!this.color) {
|
|
159
|
+
#showFormatPicker(e: Event): void {
|
|
160
|
+
if (!this.#color) {
|
|
161
161
|
return;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
const contextMenu = new ColorPicker.FormatPickerContextMenu.FormatPickerContextMenu(this
|
|
164
|
+
const contextMenu = new ColorPicker.FormatPickerContextMenu.FormatPickerContextMenu(this.#color);
|
|
165
165
|
void contextMenu.show(e, color => {
|
|
166
166
|
this.dispatchEvent(new ColorFormatChangedEvent(color));
|
|
167
167
|
});
|