chrome-devtools-frontend 1.0.1675430 → 1.0.1678416
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/AUTHORS +1 -0
- package/WATCHLISTS +0 -4
- package/front_end/core/common/EventTarget.ts +0 -5
- package/front_end/core/common/Settings.ts +0 -66
- package/front_end/core/host/InspectorFrontendHostAPI.ts +1 -0
- package/front_end/core/host/UserMetrics.ts +5 -0
- package/front_end/core/root/Runtime.ts +5 -5
- package/front_end/core/sdk/CSSMetadata.ts +5 -9
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +16 -34
- package/front_end/core/sdk/DebuggerModel.ts +92 -57
- package/front_end/core/sdk/EmulationModel.ts +2 -1
- package/front_end/core/sdk/NetworkManager.ts +16 -2
- package/front_end/core/sdk/OverlayModel.ts +19 -9
- package/front_end/core/sdk/OverlayPersistentHighlighter.ts +10 -4
- package/front_end/core/sdk/ResourceTreeModel.ts +20 -1
- package/front_end/core/sdk/SDKSettings.ts +117 -0
- package/front_end/core/sdk/Script.ts +9 -53
- package/front_end/core/sdk/sdk-meta.ts +0 -431
- package/front_end/devtools_compatibility.js +1 -0
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +213 -23
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +6 -5
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +14 -15
- package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +157 -0
- package/front_end/entrypoints/main/MainImpl.ts +32 -0
- package/front_end/entrypoints/shell/shell.ts +0 -1
- package/front_end/foundation/Universe.ts +8 -0
- package/front_end/generated/InspectorBackendCommands.ts +8 -8
- package/front_end/generated/SupportedCSSProperties.ts +53 -4
- package/front_end/generated/protocol-mapping.d.ts +27 -21
- package/front_end/generated/protocol-proxy-api.d.ts +22 -17
- package/front_end/generated/protocol.ts +43 -18
- package/front_end/models/ai_assistance/AiAgent2.ts +47 -2
- package/front_end/models/ai_assistance/AiConversation.ts +22 -5
- package/front_end/models/ai_assistance/README.md +52 -26
- package/front_end/models/ai_assistance/agents/AiAgent.ts +54 -8
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +7 -194
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +21 -87
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +24 -0
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +124 -0
- package/front_end/models/ai_assistance/contexts/StorageContext.ts +100 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +69 -1
- package/front_end/models/ai_assistance/skills/README.md +63 -1
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +4 -0
- package/front_end/models/ai_assistance/skills/accessibility.md +7 -0
- package/front_end/models/ai_assistance/skills/performance.md +15 -1
- package/front_end/models/ai_assistance/skills/sources.md +16 -0
- package/front_end/models/ai_assistance/skills/storage.md +31 -0
- package/front_end/models/ai_assistance/tools/GetDetailedCallTree.ts +107 -0
- package/front_end/models/ai_assistance/tools/GetFunctionCode.ts +122 -0
- package/front_end/models/ai_assistance/tools/GetResourceContent.ts +127 -0
- package/front_end/models/ai_assistance/tools/GetSourceContent.ts +101 -0
- package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +83 -0
- package/front_end/models/ai_assistance/tools/GetTraceMainThreadSummary.ts +106 -0
- package/front_end/models/ai_assistance/tools/GetTraceNetworkSummary.ts +104 -0
- package/front_end/models/ai_assistance/tools/ListPageOrigins.ts +95 -0
- package/front_end/models/ai_assistance/tools/ListSources.ts +116 -0
- package/front_end/models/ai_assistance/tools/RunLighthouse.ts +89 -0
- package/front_end/models/ai_assistance/tools/SelectTraceEventByKey.ts +90 -0
- package/front_end/models/ai_assistance/tools/Tool.ts +26 -1
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +22 -0
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +4 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +4 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +8 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +3 -201
- package/front_end/models/bindings/SASSSourceMapping.ts +6 -0
- package/front_end/models/breakpoints/BreakpointManager.ts +2 -49
- package/front_end/models/comment_manager/CommentManager.ts +141 -0
- package/front_end/models/comment_manager/comment_manager.ts +9 -0
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +27 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +10 -2
- package/front_end/models/issues_manager/descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +6 -6
- package/front_end/models/persistence/IsolatedFileSystem.ts +7 -8
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +2 -2
- package/front_end/models/persistence/PlatformFileSystem.ts +1 -1
- package/front_end/models/persistence/persistence-meta.ts +9 -9
- package/front_end/models/trace/types/TraceEvents.ts +36 -0
- package/front_end/panels/accessibility/ARIAAttributesView.ts +3 -3
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +25 -0
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +36 -36
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +9 -0
- package/front_end/panels/accessibility/AccessibilityStrings.ts +168 -168
- package/front_end/panels/accessibility/SourceOrderView.ts +7 -7
- package/front_end/panels/accessibility/accessibility-meta.ts +2 -2
- package/front_end/panels/accessibility/accessibility.ts +2 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -5
- package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +2 -3
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +92 -12
- package/front_end/panels/ai_assistance/components/chatMessage.css +6 -0
- package/front_end/panels/application/ApplicationPanelSidebar.ts +10 -4
- package/front_end/panels/application/IndexedDBViews.ts +65 -63
- package/front_end/panels/application/StorageView.ts +116 -45
- package/front_end/panels/application/WebMCPView.ts +16 -7
- package/front_end/panels/application/application-meta.ts +11 -0
- package/front_end/panels/application/components/AdsView.ts +1 -1
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +5 -5
- package/front_end/panels/common/BadgeNotification.ts +8 -8
- package/front_end/panels/common/ExtensionPanel.ts +9 -8
- package/front_end/panels/common/ExtensionServer.ts +21 -1
- package/front_end/panels/common/GdpSignUpDialog.ts +16 -16
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +5 -6
- package/front_end/panels/common/PersistenceUtils.ts +2 -2
- package/front_end/panels/common/common.ts +0 -97
- package/front_end/panels/console/ConsoleInsightTeaser.ts +2 -2
- package/front_end/panels/console/ConsolePanel.ts +4 -0
- package/front_end/panels/console/ConsolePinPane.ts +2 -2
- package/front_end/panels/console/ConsolePrompt.ts +12 -0
- package/front_end/panels/console/ConsoleView.ts +31 -20
- package/front_end/panels/console/ConsoleViewMessage.ts +37 -13
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewModel.ts +1 -1
- package/front_end/panels/elements/ElementStatePaneWidget.ts +2 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +455 -372
- package/front_end/panels/elements/LayoutPane.ts +2 -8
- package/front_end/panels/elements/StylePropertyTreeElement.ts +16 -15
- package/front_end/panels/elements/elements-meta.ts +152 -10
- package/front_end/panels/elements/elements.ts +0 -2
- package/front_end/panels/emulation/DeviceModeView.ts +9 -1
- package/front_end/panels/event_listeners/EventListenersView.ts +8 -4
- package/front_end/panels/issues/AffectedTrackingSitesView.ts +25 -14
- package/front_end/panels/lighthouse/LighthouseController.ts +3 -2
- package/front_end/panels/media/PlayerMessagesView.ts +149 -68
- package/front_end/panels/network/BinaryResourceView.ts +134 -81
- package/front_end/panels/network/EventSourceMessagesView.ts +10 -10
- package/front_end/panels/network/FetchHeaderCommenting.ts +291 -0
- package/front_end/panels/network/NetworkConfigView.ts +10 -10
- package/front_end/panels/network/NetworkDataGridNode.ts +14 -14
- package/front_end/panels/network/NetworkItemView.ts +27 -28
- package/front_end/panels/network/NetworkLogView.ts +137 -38
- package/front_end/panels/network/NetworkLogViewColumns.ts +35 -35
- package/front_end/panels/network/NetworkManageCustomHeadersView.ts +1 -1
- package/front_end/panels/network/NetworkPanel.ts +2 -2
- package/front_end/panels/network/RequestConditionsDrawer.ts +5 -5
- package/front_end/panels/network/RequestCookiesView.ts +4 -4
- package/front_end/panels/network/RequestHeadersView.ts +5 -5
- package/front_end/panels/network/RequestPayloadView.ts +4 -3
- package/front_end/panels/network/RequestTimingView.ts +8 -8
- package/front_end/panels/network/ResourceChunkView.ts +1 -1
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +1 -1
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +16 -16
- package/front_end/panels/network/binaryResourceView.css +14 -12
- package/front_end/panels/network/components/DirectSocketConnectionView.ts +2 -2
- package/front_end/panels/network/components/HeaderSectionRow.ts +1 -1
- package/front_end/panels/network/components/RequestTrustTokensView.ts +2 -2
- package/front_end/panels/network/network-meta.ts +1 -1
- package/front_end/panels/network/network.ts +2 -0
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +0 -1
- package/front_end/panels/profiler/HeapSnapshotView.ts +0 -2
- package/front_end/panels/profiler/heapProfiler.css +0 -9
- package/front_end/panels/recorder/RecorderPanel.ts +2 -3
- package/front_end/panels/screencast/ScreencastView.ts +148 -138
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +2 -2
- package/front_end/panels/sources/BreakpointsView.ts +2 -2
- package/front_end/panels/sources/DebuggerPlugin.ts +10 -59
- package/front_end/panels/sources/NavigatorView.ts +2 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +1 -1
- package/front_end/panels/sources/SourcesPanel.ts +23 -73
- package/front_end/panels/sources/SourcesView.ts +248 -157
- package/front_end/panels/sources/TabbedEditorContainer.ts +118 -23
- package/front_end/panels/sources/UISourceCodeFrame.ts +5 -9
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +4 -2
- package/front_end/panels/sources/sources-meta.ts +52 -0
- package/front_end/panels/timeline/TimelineController.ts +36 -64
- package/front_end/panels/timeline/TimelinePanel.ts +11 -8
- package/front_end/panels/timeline/TimelineUIUtils.ts +5 -2
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -2
- package/front_end/panels/timeline/timelinePanel.css +0 -10
- package/front_end/panels/utils/utils.ts +7 -7
- package/front_end/services/tracing/PerformanceTracing.ts +5 -17
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/package.json +2 -2
- package/front_end/third_party/codemirror.next/rebuild.sh +4 -1
- package/front_end/ui/comments/CommentAnchorResolver.ts +430 -35
- package/front_end/ui/comments/CommentOverlayManager.ts +635 -0
- package/front_end/ui/comments/CommentsOverlayWidget.ts +134 -0
- package/front_end/ui/comments/comments.ts +4 -0
- package/front_end/ui/comments/commentsOverlay.css +49 -0
- package/front_end/{panels/common → ui/components/dialogs}/FreDialog.ts +6 -6
- package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +96 -0
- package/front_end/ui/components/dialogs/dialogs.ts +4 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +3 -3
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionDisclaimer.ts +13 -13
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +7 -6
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionTeaser.ts +43 -46
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +22 -26
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationTeaser.ts +10 -10
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationUpgradeDialog.ts +5 -5
- package/front_end/ui/components/text_editor/text_editor.ts +4 -0
- package/front_end/ui/legacy/Toolbar.ts +1 -1
- package/front_end/ui/legacy/UIUtils.ts +0 -56
- package/front_end/ui/legacy/View.ts +10 -4
- package/front_end/ui/legacy/Widget.ts +10 -1
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +2 -1
- package/front_end/ui/legacy/components/color_picker/ContrastOverlay.ts +5 -4
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +11 -3
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +507 -209
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +5 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +11 -16
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +5 -12
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +38 -20
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +12 -2
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +3 -3
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +37 -6
- package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +22 -4
- package/front_end/ui/settings/SettingUIRegistration.ts +55 -6
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/mcp/mcp.ts +6 -1
- package/package.json +6 -6
- package/front_end/Images/toolbarResizerVertical.png +0 -0
- package/front_end/emulated_devices/MotoG4-landscape.svg +0 -155
- package/front_end/emulated_devices/MotoG4-portrait.svg +0 -155
- package/front_end/emulated_devices/Nexus5X-landscape.svg +0 -19
- package/front_end/emulated_devices/Nexus5X-portrait.svg +0 -19
- package/front_end/emulated_devices/Nexus6P-landscape.svg +0 -50
- package/front_end/emulated_devices/Nexus6P-portrait.svg +0 -54
- package/front_end/emulated_devices/google-nest-hub-horizontal.png +0 -0
- package/front_end/emulated_devices/google-nest-hub-max-horizontal.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-2x.png +0 -0
- package/front_end/emulated_devices/iPad-landscape.svg +0 -73
- package/front_end/emulated_devices/iPad-portrait.svg +0 -76
- package/front_end/emulated_devices/iPhone5-landscape.svg +0 -99
- package/front_end/emulated_devices/iPhone5-portrait.svg +0 -83
- package/front_end/emulated_devices/iPhone6-landscape.svg +0 -111
- package/front_end/emulated_devices/iPhone6-portrait.svg +0 -116
- package/front_end/emulated_devices/iPhone6Plus-landscape.svg +0 -118
- package/front_end/emulated_devices/iPhone6Plus-portrait.svg +0 -116
- package/front_end/emulated_devices/optimized/MotoG4-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/MotoG4-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus5X-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus5X-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus6P-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus6P-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/README.md +0 -9
- package/front_end/emulated_devices/optimized/google-nest-hub-horizontal.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nest-hub-max-horizontal.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/iPad-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPad-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone5-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone5-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6Plus-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6Plus-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/optimized_images.gni +0 -53
- package/front_end/models/ai_assistance/agents/README.md +0 -136
- package/front_end/panels/elements/ElementsTreeOutlineRenderer.ts +0 -89
- package/front_end/ui/legacy/components/object_ui/object_ui-meta.ts +0 -27
- /package/front_end/{panels/common → ui/components/dialogs}/freDialog.css +0 -0
- /package/front_end/{panels/common/common.css → ui/components/dialogs/typeToAllowDialog.css} +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionDisclaimer.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionTeaser.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationTeaser.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationUpgradeDialog.css +0 -0
|
@@ -10,11 +10,13 @@ import type * as Common from '../../core/common/common.js';
|
|
|
10
10
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
11
11
|
import type * as Protocol from '../../generated/protocol.js';
|
|
12
12
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
13
|
-
import {html, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
|
|
13
|
+
import {Directives, html, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
|
|
14
14
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
15
15
|
|
|
16
16
|
import playerMessagesViewStyles from './playerMessagesView.css.js';
|
|
17
17
|
|
|
18
|
+
const {classMap} = Directives;
|
|
19
|
+
|
|
18
20
|
const UIStrings = {
|
|
19
21
|
/**
|
|
20
22
|
* @description A context menu item in the Console view of the Console panel.
|
|
@@ -104,7 +106,7 @@ class MessageLevelSelector implements UI.SoftDropDown.Delegate<SelectableLevel>
|
|
|
104
106
|
readonly #defaultTitle: Common.UIString.LocalizedString;
|
|
105
107
|
private readonly customTitle: Common.UIString.LocalizedString;
|
|
106
108
|
private readonly allTitle: Common.UIString.LocalizedString;
|
|
107
|
-
elementsForItems: WeakMap<SelectableLevel,
|
|
109
|
+
elementsForItems: WeakMap<SelectableLevel, ShadowRoot>;
|
|
108
110
|
|
|
109
111
|
constructor(items: UI.ListModel.ListModel<SelectableLevel>, view: PlayerMessagesView) {
|
|
110
112
|
this.items = items;
|
|
@@ -131,66 +133,86 @@ class MessageLevelSelector implements UI.SoftDropDown.Delegate<SelectableLevel>
|
|
|
131
133
|
}
|
|
132
134
|
|
|
133
135
|
populate(): void {
|
|
134
|
-
|
|
136
|
+
const defaultLevel = {
|
|
135
137
|
title: this.#defaultTitle,
|
|
136
138
|
overwrite: true,
|
|
137
139
|
stringValue: '',
|
|
138
140
|
value: MessageLevelBitfield.DEFAULT,
|
|
141
|
+
};
|
|
142
|
+
this.items.insert(this.items.length, defaultLevel);
|
|
143
|
+
this.itemMap.set(defaultLevel.value, defaultLevel);
|
|
139
144
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
this.items.insert(this.items.length, {
|
|
145
|
+
const allLevel = {
|
|
143
146
|
title: this.allTitle,
|
|
144
147
|
overwrite: true,
|
|
145
148
|
stringValue: '',
|
|
146
149
|
value: MessageLevelBitfield.ALL,
|
|
150
|
+
};
|
|
151
|
+
this.items.insert(this.items.length, allLevel);
|
|
152
|
+
this.itemMap.set(allLevel.value, allLevel);
|
|
147
153
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
this.items.insert(this.items.length, {
|
|
154
|
+
const errorLevel = {
|
|
151
155
|
title: i18nString(UIStrings.error),
|
|
152
156
|
overwrite: false,
|
|
153
157
|
stringValue: 'error',
|
|
154
158
|
value: MessageLevelBitfield.ERROR,
|
|
159
|
+
};
|
|
160
|
+
this.items.insert(this.items.length, errorLevel);
|
|
161
|
+
this.itemMap.set(errorLevel.value, errorLevel);
|
|
155
162
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
this.items.insert(this.items.length, {
|
|
163
|
+
const warningLevel = {
|
|
159
164
|
title: i18nString(UIStrings.warning),
|
|
160
165
|
overwrite: false,
|
|
161
166
|
stringValue: 'warning',
|
|
162
167
|
value: MessageLevelBitfield.WARNING,
|
|
163
|
-
}
|
|
168
|
+
};
|
|
169
|
+
this.items.insert(this.items.length, warningLevel);
|
|
170
|
+
this.itemMap.set(warningLevel.value, warningLevel);
|
|
164
171
|
|
|
165
|
-
|
|
172
|
+
const infoLevel = {
|
|
166
173
|
title: i18nString(UIStrings.info),
|
|
167
174
|
overwrite: false,
|
|
168
175
|
stringValue: 'info',
|
|
169
176
|
value: MessageLevelBitfield.INFO,
|
|
170
|
-
}
|
|
177
|
+
};
|
|
178
|
+
this.items.insert(this.items.length, infoLevel);
|
|
179
|
+
this.itemMap.set(infoLevel.value, infoLevel);
|
|
171
180
|
|
|
172
|
-
|
|
181
|
+
const debugLevel = {
|
|
173
182
|
title: i18nString(UIStrings.debug),
|
|
174
183
|
overwrite: false,
|
|
175
184
|
stringValue: 'debug',
|
|
176
185
|
value: MessageLevelBitfield.DEBUG,
|
|
186
|
+
};
|
|
187
|
+
this.items.insert(this.items.length, debugLevel);
|
|
188
|
+
this.itemMap.set(debugLevel.value, debugLevel);
|
|
189
|
+
}
|
|
177
190
|
|
|
178
|
-
|
|
191
|
+
#renderItem(item: SelectableLevel, target: ShadowRoot|HTMLElement): void {
|
|
192
|
+
const checked = Boolean(item.value & this.bitFieldValue);
|
|
193
|
+
// clang-format off
|
|
194
|
+
render(html`
|
|
195
|
+
<div class="media-messages-level-dropdown-element">
|
|
196
|
+
<div class="media-messages-level-dropdown-checkbox">
|
|
197
|
+
${!item.overwrite && checked ? html`<div>✓</div>` : nothing}
|
|
198
|
+
</div>
|
|
199
|
+
<span class="media-messages-level-dropdown-text">${item.title}</span>
|
|
200
|
+
</div>
|
|
201
|
+
`, target, {host: this});
|
|
202
|
+
// clang-format on
|
|
179
203
|
}
|
|
180
204
|
|
|
181
205
|
private updateCheckMarks(): void {
|
|
182
206
|
this.hiddenLevels = [];
|
|
183
207
|
for (const [key, item] of this.itemMap) {
|
|
184
208
|
if (!item.overwrite) {
|
|
185
|
-
|
|
186
|
-
if (elementForItem?.firstChild) {
|
|
187
|
-
elementForItem.firstChild.remove();
|
|
188
|
-
}
|
|
189
|
-
if (elementForItem && key & this.bitFieldValue) {
|
|
190
|
-
UI.UIUtils.createTextChild(elementForItem.createChild('div'), '✓');
|
|
191
|
-
} else {
|
|
209
|
+
if (!(key & this.bitFieldValue)) {
|
|
192
210
|
this.hiddenLevels.push(item.stringValue);
|
|
193
211
|
}
|
|
212
|
+
const target = this.elementsForItems.get(item);
|
|
213
|
+
if (target) {
|
|
214
|
+
this.#renderItem(item, target);
|
|
215
|
+
}
|
|
194
216
|
}
|
|
195
217
|
}
|
|
196
218
|
}
|
|
@@ -223,12 +245,9 @@ class MessageLevelSelector implements UI.SoftDropDown.Delegate<SelectableLevel>
|
|
|
223
245
|
createElementForItem(item: SelectableLevel): Element {
|
|
224
246
|
const element = document.createElement('div');
|
|
225
247
|
const shadowRoot = UI.UIUtils.createShadowRootWithCoreStyles(element, {cssFile: playerMessagesViewStyles});
|
|
226
|
-
|
|
227
|
-
const checkBox = container.createChild('div', 'media-messages-level-dropdown-checkbox');
|
|
228
|
-
const text = container.createChild('span', 'media-messages-level-dropdown-text');
|
|
229
|
-
UI.UIUtils.createTextChild(text, item.title);
|
|
230
|
-
this.elementsForItems.set(item, checkBox);
|
|
248
|
+
this.elementsForItems.set(item, shadowRoot);
|
|
231
249
|
this.itemMap.set(item.value, item);
|
|
250
|
+
this.#renderItem(item, shadowRoot);
|
|
232
251
|
this.updateCheckMarks();
|
|
233
252
|
this.view.regenerateMessageDisplayCss(this.hiddenLevels);
|
|
234
253
|
return element;
|
|
@@ -249,10 +268,29 @@ class MessageLevelSelector implements UI.SoftDropDown.Delegate<SelectableLevel>
|
|
|
249
268
|
}
|
|
250
269
|
}
|
|
251
270
|
|
|
271
|
+
interface MessageItem {
|
|
272
|
+
type: 'message';
|
|
273
|
+
level: string;
|
|
274
|
+
message: Protocol.Media.PlayerMessage;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
interface ErrorItem {
|
|
278
|
+
type: 'error';
|
|
279
|
+
level: 'error';
|
|
280
|
+
error: Protocol.Media.PlayerError;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
type MessageOrErrorItem = MessageItem|ErrorItem;
|
|
284
|
+
|
|
252
285
|
export class PlayerMessagesView extends UI.Widget.VBox {
|
|
253
286
|
private readonly headerPanel: HTMLElement;
|
|
254
287
|
private readonly bodyPanel: HTMLElement;
|
|
255
288
|
private messageLevelSelector?: MessageLevelSelector;
|
|
289
|
+
#items: MessageOrErrorItem[] = [];
|
|
290
|
+
#hiddenLevels: string[] = [];
|
|
291
|
+
#filterString = '';
|
|
292
|
+
#dropDownItem?: UI.Toolbar.ToolbarItem;
|
|
293
|
+
#filterInput?: UI.Toolbar.ToolbarInput;
|
|
256
294
|
|
|
257
295
|
constructor() {
|
|
258
296
|
super({jslog: `${VisualLogging.pane('messages')}`});
|
|
@@ -261,15 +299,9 @@ export class PlayerMessagesView extends UI.Widget.VBox {
|
|
|
261
299
|
this.headerPanel = this.contentElement.createChild('div', 'media-messages-header');
|
|
262
300
|
this.bodyPanel = this.contentElement.createChild('div', 'media-messages-body');
|
|
263
301
|
|
|
264
|
-
this.
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
private buildToolbar(): void {
|
|
268
|
-
const toolbar = this.headerPanel.createChild('devtools-toolbar', 'media-messages-toolbar');
|
|
269
|
-
toolbar.appendText(i18nString(UIStrings.logLevel));
|
|
270
|
-
toolbar.appendToolbarItem(this.createDropdown());
|
|
271
|
-
toolbar.appendSeparator();
|
|
272
|
-
toolbar.appendToolbarItem(this.createFilterInput());
|
|
302
|
+
this.#dropDownItem = this.createDropdown();
|
|
303
|
+
this.#filterInput = this.createFilterInput();
|
|
304
|
+
this.performUpdate();
|
|
273
305
|
}
|
|
274
306
|
|
|
275
307
|
private createDropdown(): UI.Toolbar.ToolbarItem {
|
|
@@ -300,45 +332,92 @@ export class PlayerMessagesView extends UI.Widget.VBox {
|
|
|
300
332
|
return filterInput;
|
|
301
333
|
}
|
|
302
334
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
335
|
+
override performUpdate(): void {
|
|
336
|
+
this.#renderToolbar();
|
|
337
|
+
this.#renderMessages();
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
#renderToolbar(): void {
|
|
341
|
+
// clang-format off
|
|
342
|
+
render(html`
|
|
343
|
+
<devtools-toolbar class="media-messages-toolbar">
|
|
344
|
+
<div class="toolbar-text">${i18nString(UIStrings.logLevel)}</div>
|
|
345
|
+
${this.#dropDownItem?.element}
|
|
346
|
+
<div class="toolbar-divider"></div>
|
|
347
|
+
${this.#filterInput?.element}
|
|
348
|
+
</devtools-toolbar>
|
|
349
|
+
`, this.headerPanel, {host: this});
|
|
350
|
+
// clang-format on
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
#renderMessages(): void {
|
|
354
|
+
// clang-format off
|
|
355
|
+
render(html`
|
|
356
|
+
${this.#items.map(item => {
|
|
357
|
+
const isUnselected = this.#isLevelHidden(item.level);
|
|
358
|
+
let isFiltered = false;
|
|
359
|
+
if (this.#filterString !== '') {
|
|
360
|
+
if (item.type === 'message') {
|
|
361
|
+
isFiltered = !item.message.message.includes(this.#filterString);
|
|
362
|
+
} else {
|
|
363
|
+
isFiltered = !this.#errorMatchesFilter(item.error, this.#filterString);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
const classes = {
|
|
367
|
+
'media-messages-message-container': true,
|
|
368
|
+
[`media-message-${item.level}`]: true,
|
|
369
|
+
'media-messages-message-unselected': isUnselected,
|
|
370
|
+
'media-messages-message-filtered': isFiltered,
|
|
371
|
+
};
|
|
372
|
+
return html`
|
|
373
|
+
<div class=${classMap(classes)}>
|
|
374
|
+
${item.type === 'message' ? item.message.message : this.renderError(item.error)}
|
|
375
|
+
</div>
|
|
376
|
+
`;
|
|
377
|
+
})}
|
|
378
|
+
`, this.bodyPanel, {host: this});
|
|
379
|
+
// clang-format on
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
#isLevelHidden(level: string): boolean {
|
|
383
|
+
return this.#hiddenLevels.includes(level);
|
|
312
384
|
}
|
|
313
385
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
386
|
+
#errorMatchesFilter(error: Protocol.Media.PlayerError, filter: string): boolean {
|
|
387
|
+
if (error.errorType.includes(filter) || error.code.toString().includes(filter)) {
|
|
388
|
+
return true;
|
|
389
|
+
}
|
|
390
|
+
for (const [key, value] of Object.entries(error.data)) {
|
|
391
|
+
if (`${key}: ${value}`.includes(filter)) {
|
|
392
|
+
return true;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
for (const stackEntry of error.stack) {
|
|
396
|
+
if (`${stackEntry.file}:${stackEntry.line}`.includes(filter)) {
|
|
397
|
+
return true;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
for (const cause of error.cause) {
|
|
401
|
+
if (this.#errorMatchesFilter(cause, filter)) {
|
|
317
402
|
return true;
|
|
318
403
|
}
|
|
319
404
|
}
|
|
320
405
|
return false;
|
|
321
406
|
}
|
|
322
407
|
|
|
408
|
+
regenerateMessageDisplayCss(hiddenLevels: string[]): void {
|
|
409
|
+
this.#hiddenLevels = hiddenLevels;
|
|
410
|
+
this.performUpdate();
|
|
411
|
+
}
|
|
412
|
+
|
|
323
413
|
private filterByString(userStringData: {data: string}): void {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
for (const message of messages) {
|
|
328
|
-
if (userString === '') {
|
|
329
|
-
message.classList.remove('media-messages-message-filtered');
|
|
330
|
-
} else if (message.textContent?.includes(userString)) {
|
|
331
|
-
message.classList.remove('media-messages-message-filtered');
|
|
332
|
-
} else {
|
|
333
|
-
message.classList.add('media-messages-message-filtered');
|
|
334
|
-
}
|
|
335
|
-
}
|
|
414
|
+
this.#filterString = userStringData.data;
|
|
415
|
+
this.performUpdate();
|
|
336
416
|
}
|
|
337
417
|
|
|
338
418
|
addMessage(message: Protocol.Media.PlayerMessage): void {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
UI.UIUtils.createTextChild(container, message.message);
|
|
419
|
+
this.#items.push({type: 'message', level: message.level, message});
|
|
420
|
+
this.performUpdate();
|
|
342
421
|
}
|
|
343
422
|
|
|
344
423
|
private renderError(error: Protocol.Media.PlayerError): LitTemplate {
|
|
@@ -393,7 +472,9 @@ export class PlayerMessagesView extends UI.Widget.VBox {
|
|
|
393
472
|
<span class="status-error-field-label"
|
|
394
473
|
>${i18nString(UIStrings.errorCauseLabel)}</span
|
|
395
474
|
>
|
|
396
|
-
|
|
475
|
+
<div>
|
|
476
|
+
${error.cause.map(cause => this.renderError(cause))}
|
|
477
|
+
</div>
|
|
397
478
|
`
|
|
398
479
|
: nothing
|
|
399
480
|
}
|
|
@@ -404,7 +485,7 @@ export class PlayerMessagesView extends UI.Widget.VBox {
|
|
|
404
485
|
}
|
|
405
486
|
|
|
406
487
|
addError(error: Protocol.Media.PlayerError): void {
|
|
407
|
-
|
|
408
|
-
|
|
488
|
+
this.#items.push({type: 'error', level: 'error', error});
|
|
489
|
+
this.performUpdate();
|
|
409
490
|
}
|
|
410
491
|
}
|
|
@@ -10,68 +10,147 @@ import * as Host from '../../core/host/host.js';
|
|
|
10
10
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
11
11
|
import type * as Platform from '../../core/platform/platform.js';
|
|
12
12
|
import type * as TextUtils from '../../core/text_utils/text_utils.js';
|
|
13
|
+
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
13
14
|
import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
14
15
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
16
|
+
import {html, nothing, render} from '../../ui/lit/lit.js';
|
|
17
|
+
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
15
18
|
|
|
16
19
|
import binaryResourceViewStyles from './binaryResourceView.css.js';
|
|
17
20
|
|
|
21
|
+
const {widget} = UI.Widget;
|
|
22
|
+
|
|
18
23
|
const UIStrings = {
|
|
19
24
|
/**
|
|
20
|
-
* @description Text in
|
|
25
|
+
* @description Text in binary resource view of the Network panel. Shown to the user as a status
|
|
21
26
|
* message after the current text has been copied to the clipboard. Base64 is a format for encoding
|
|
22
27
|
* data.
|
|
23
28
|
*/
|
|
24
29
|
copiedAsBase: 'Copied as `Base64`',
|
|
25
30
|
/**
|
|
26
|
-
* @description
|
|
31
|
+
* @description Option label in binary resource view of the Network panel to view data in hexadecimal (Hex) format.
|
|
27
32
|
*/
|
|
28
|
-
hexViewer: '`Hex`
|
|
33
|
+
hexViewer: '`Hex` viewer',
|
|
29
34
|
/**
|
|
30
|
-
* @description
|
|
31
|
-
* message after the current text has been copied to the clipboard. Hex is short for hexadecimal,
|
|
32
|
-
* and is a format for encoding data.
|
|
35
|
+
* @description Status message in binary resource view of the Network panel after copying text in hexadecimal (Hex) format. Hex is short for hexadecimal.
|
|
33
36
|
*/
|
|
34
37
|
copiedAsHex: 'Copied as `Hex`',
|
|
35
38
|
/**
|
|
36
|
-
* @description Text in
|
|
39
|
+
* @description Text in binary resource view of the Network panel. Shown to the user as a status
|
|
37
40
|
* message after the current text has been copied to the clipboard. UTF-8 is a format for encoding data.
|
|
38
41
|
*/
|
|
39
42
|
copiedAsUtf: 'Copied as `UTF-8`',
|
|
40
43
|
/**
|
|
41
|
-
* @description Screen reader label for a select box that chooses how to display binary data in the Network panel
|
|
44
|
+
* @description Screen reader label for a select box that chooses how to display binary data in the Network panel.
|
|
42
45
|
*/
|
|
43
46
|
binaryViewType: 'Binary view type',
|
|
44
47
|
/**
|
|
45
|
-
* @description Tooltip text that appears when hovering over the largeicon copy button in the
|
|
48
|
+
* @description Tooltip text that appears when hovering over the largeicon copy button in the binary resource view of the Network panel.
|
|
46
49
|
*/
|
|
47
50
|
copyToClipboard: 'Copy to clipboard',
|
|
48
51
|
/**
|
|
49
|
-
* @description A context menu command in the
|
|
52
|
+
* @description A context menu command in the binary resource view of the Network panel, for
|
|
50
53
|
* copying to the clipboard. Base64 is a format for encoding data.
|
|
51
54
|
*/
|
|
52
55
|
copyAsBase: 'Copy as `Base64`',
|
|
53
56
|
/**
|
|
54
|
-
* @description A context menu command in the
|
|
55
|
-
* to the clipboard. Hex is short for hexadecimal
|
|
57
|
+
* @description A context menu command in the binary resource view of the Network panel, for copying
|
|
58
|
+
* to the clipboard in hexadecimal (Hex) format. Hex is short for hexadecimal.
|
|
56
59
|
*/
|
|
57
60
|
copyAsHex: 'Copy as `Hex`',
|
|
58
61
|
/**
|
|
59
|
-
* @description A context menu command in the
|
|
60
|
-
*to the clipboard. UTF-8 is a format for encoding data.
|
|
62
|
+
* @description A context menu command in the binary resource view of the Network panel, for copying
|
|
63
|
+
* to the clipboard. UTF-8 is a format for encoding data.
|
|
61
64
|
*/
|
|
62
65
|
copyAsUtf: 'Copy as `UTF-8`',
|
|
63
66
|
} as const;
|
|
64
67
|
const str_ = i18n.i18n.registerUIStrings('panels/network/BinaryResourceView.ts', UIStrings);
|
|
65
68
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
69
|
+
export interface ViewInput {
|
|
70
|
+
binaryViewObjects: BinaryViewObject[];
|
|
71
|
+
content: TextUtils.StreamingContentData.StreamingContentData;
|
|
72
|
+
contentUrl: Platform.DevToolsPath.UrlString;
|
|
73
|
+
resourceType: Common.ResourceType.ResourceType;
|
|
74
|
+
activePositionPercentage: number;
|
|
75
|
+
binaryViewTypeSetting: Common.Settings.Setting<string>;
|
|
76
|
+
binaryViewTypeChanged: (event: Event) => void;
|
|
77
|
+
copySelectedViewToClipboard: () => void;
|
|
78
|
+
copiedText: UI.Toolbar.ToolbarText;
|
|
79
|
+
}
|
|
80
|
+
export type ViewOutput = undefined;
|
|
81
|
+
export type View = (input: ViewInput, output: ViewOutput, target: HTMLElement) => void;
|
|
82
|
+
|
|
83
|
+
const defaultView: View = (input, _output, target) => {
|
|
84
|
+
// clang-format off
|
|
85
|
+
render(html`
|
|
86
|
+
<style>${binaryResourceViewStyles}</style>
|
|
87
|
+
<div class="vbox flex-auto">
|
|
88
|
+
${input.binaryViewObjects.map(
|
|
89
|
+
obj => obj.type === input.binaryViewTypeSetting.get() ? html`
|
|
90
|
+
<devtools-widget
|
|
91
|
+
class="widget vbox flex-auto"
|
|
92
|
+
${widget((e: HTMLElement) => {
|
|
93
|
+
const factory = new SourceFrame.BinaryResourceViewFactory.BinaryResourceViewFactory(
|
|
94
|
+
input.content, input.contentUrl, input.resourceType);
|
|
95
|
+
let view: SourceFrame.ResourceSourceFrame.ResourceSourceFrame|
|
|
96
|
+
SourceFrame.StreamingContentHexView.StreamingContentHexView;
|
|
97
|
+
switch (obj.type) {
|
|
98
|
+
case 'base64':
|
|
99
|
+
view = factory.createBase64View(e);
|
|
100
|
+
break;
|
|
101
|
+
case 'hex':
|
|
102
|
+
view = factory.createHexView(e);
|
|
103
|
+
break;
|
|
104
|
+
case 'utf8':
|
|
105
|
+
view = factory.createUtf8View(e);
|
|
106
|
+
break;
|
|
107
|
+
default:
|
|
108
|
+
throw new Error('Unsupported view type');
|
|
109
|
+
}
|
|
110
|
+
if ('setPositionPercentage' in view) {
|
|
111
|
+
view.setPositionPercentage(input.activePositionPercentage);
|
|
112
|
+
}
|
|
113
|
+
return view;
|
|
114
|
+
})}>
|
|
115
|
+
</devtools-widget>
|
|
116
|
+
` : nothing,
|
|
117
|
+
)}
|
|
118
|
+
<devtools-toolbar class="binary-view-toolbar">
|
|
119
|
+
<select class="toolbar-item" title=${i18nString(UIStrings.binaryViewType)}
|
|
120
|
+
aria-label=${i18nString(UIStrings.binaryViewType)}
|
|
121
|
+
@change=${input.binaryViewTypeChanged}>
|
|
122
|
+
${input.binaryViewObjects.map(viewObject => html`
|
|
123
|
+
<option value=${viewObject.type}
|
|
124
|
+
?selected=${viewObject.type === input.binaryViewTypeSetting.get()}
|
|
125
|
+
jslog=${VisualLogging.item(viewObject.type).track({click: true})}>${viewObject.label}</option>
|
|
126
|
+
`)}
|
|
127
|
+
</select>
|
|
128
|
+
<devtools-button class="toolbar-button toolbar-item" title=${i18nString(UIStrings.copyToClipboard)}
|
|
129
|
+
@click=${input.copySelectedViewToClipboard}
|
|
130
|
+
.data=${{
|
|
131
|
+
variant: Buttons.Button.Variant.ICON,
|
|
132
|
+
iconName: 'copy',
|
|
133
|
+
jslogContext: 'copy',
|
|
134
|
+
} as Buttons.Button.ButtonData}></devtools-button>
|
|
135
|
+
${input.copiedText.element}
|
|
136
|
+
</devtools-toolbar>
|
|
137
|
+
</div>
|
|
138
|
+
`, target);
|
|
139
|
+
// clang-format on
|
|
140
|
+
};
|
|
141
|
+
|
|
66
142
|
export class BinaryResourceView extends UI.Widget.VBox {
|
|
143
|
+
private activePositionPercentage = 0;
|
|
67
144
|
private readonly binaryResourceViewFactory: SourceFrame.BinaryResourceViewFactory.BinaryResourceViewFactory;
|
|
68
|
-
private readonly
|
|
145
|
+
private readonly streamingContent: TextUtils.StreamingContentData.StreamingContentData;
|
|
146
|
+
private readonly contentUrl: Platform.DevToolsPath.UrlString;
|
|
147
|
+
private readonly resourceType: Common.ResourceType.ResourceType;
|
|
69
148
|
private readonly binaryViewObjects: BinaryViewObject[];
|
|
70
149
|
private binaryViewTypeSetting: Common.Settings.Setting<string>;
|
|
71
|
-
|
|
72
|
-
private readonly copiedText: UI.Toolbar.ToolbarText;
|
|
150
|
+
readonly copiedText: UI.Toolbar.ToolbarText;
|
|
73
151
|
private addFadeoutSettimeoutId: number|null;
|
|
74
|
-
private
|
|
152
|
+
private litContainer: HTMLElement;
|
|
153
|
+
#view = defaultView;
|
|
75
154
|
|
|
76
155
|
constructor(
|
|
77
156
|
content: TextUtils.StreamingContentData.StreamingContentData, contentUrl: Platform.DevToolsPath.UrlString,
|
|
@@ -79,48 +158,34 @@ export class BinaryResourceView extends UI.Widget.VBox {
|
|
|
79
158
|
super(element);
|
|
80
159
|
this.registerRequiredCSS(binaryResourceViewStyles);
|
|
81
160
|
|
|
161
|
+
this.streamingContent = content;
|
|
162
|
+
this.contentUrl = contentUrl;
|
|
163
|
+
this.resourceType = resourceType;
|
|
164
|
+
|
|
82
165
|
this.binaryResourceViewFactory =
|
|
83
166
|
new SourceFrame.BinaryResourceViewFactory.BinaryResourceViewFactory(content, contentUrl, resourceType);
|
|
84
167
|
|
|
85
|
-
this.toolbar = this.element.createChild('devtools-toolbar', 'binary-view-toolbar');
|
|
86
|
-
|
|
87
168
|
this.binaryViewObjects = [
|
|
88
169
|
new BinaryViewObject(
|
|
89
170
|
'base64', i18n.i18n.lockedString('Base64'), i18nString(UIStrings.copiedAsBase),
|
|
90
|
-
this.binaryResourceViewFactory.createBase64View.bind(this.binaryResourceViewFactory),
|
|
91
171
|
this.binaryResourceViewFactory.base64.bind(this.binaryResourceViewFactory)),
|
|
92
172
|
new BinaryViewObject(
|
|
93
173
|
'hex', i18nString(UIStrings.hexViewer), i18nString(UIStrings.copiedAsHex),
|
|
94
|
-
this.binaryResourceViewFactory.createHexView.bind(this.binaryResourceViewFactory),
|
|
95
174
|
this.binaryResourceViewFactory.hex.bind(this.binaryResourceViewFactory)),
|
|
96
175
|
new BinaryViewObject(
|
|
97
176
|
'utf8', i18n.i18n.lockedString('UTF-8'), i18nString(UIStrings.copiedAsUtf),
|
|
98
|
-
this.binaryResourceViewFactory.createUtf8View.bind(this.binaryResourceViewFactory),
|
|
99
177
|
this.binaryResourceViewFactory.utf8.bind(this.binaryResourceViewFactory)),
|
|
100
178
|
];
|
|
101
179
|
this.binaryViewTypeSetting = Common.Settings.Settings.instance().createSetting('binary-view-type', 'hex');
|
|
102
|
-
this.binaryViewTypeCombobox =
|
|
103
|
-
new UI.Toolbar.ToolbarComboBox(this.binaryViewTypeChanged.bind(this), i18nString(UIStrings.binaryViewType));
|
|
104
|
-
for (const viewObject of this.binaryViewObjects) {
|
|
105
|
-
this.binaryViewTypeCombobox.addOption(
|
|
106
|
-
this.binaryViewTypeCombobox.createOption(viewObject.label, viewObject.type));
|
|
107
|
-
}
|
|
108
|
-
this.toolbar.appendToolbarItem(this.binaryViewTypeCombobox);
|
|
109
|
-
|
|
110
|
-
const copyButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.copyToClipboard), 'copy');
|
|
111
|
-
copyButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, _event => {
|
|
112
|
-
this.copySelectedViewToClipboard();
|
|
113
|
-
}, this);
|
|
114
|
-
this.toolbar.appendToolbarItem(copyButton);
|
|
115
180
|
|
|
116
181
|
this.copiedText = new UI.Toolbar.ToolbarText();
|
|
117
182
|
this.copiedText.element.classList.add('binary-view-copied-text');
|
|
118
|
-
this.toolbar.appendChild(this.copiedText.element);
|
|
119
183
|
|
|
120
184
|
this.addFadeoutSettimeoutId = null;
|
|
121
185
|
|
|
122
|
-
this.
|
|
123
|
-
|
|
186
|
+
this.litContainer = this.element.createChild('div', 'vbox flex-auto');
|
|
187
|
+
|
|
188
|
+
this.performUpdate();
|
|
124
189
|
}
|
|
125
190
|
|
|
126
191
|
private getCurrentViewObject(): BinaryViewObject|null {
|
|
@@ -133,7 +198,7 @@ export class BinaryResourceView extends UI.Widget.VBox {
|
|
|
133
198
|
return binaryViewObject || null;
|
|
134
199
|
}
|
|
135
200
|
|
|
136
|
-
|
|
201
|
+
copySelectedViewToClipboard(): void {
|
|
137
202
|
const viewObject = this.getCurrentViewObject();
|
|
138
203
|
if (!viewObject) {
|
|
139
204
|
return;
|
|
@@ -141,47 +206,48 @@ export class BinaryResourceView extends UI.Widget.VBox {
|
|
|
141
206
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(viewObject.content());
|
|
142
207
|
this.copiedText.setText(viewObject.copiedMessage);
|
|
143
208
|
this.copiedText.element.classList.remove('fadeout');
|
|
144
|
-
|
|
209
|
+
const addFadeoutClass = (): void => {
|
|
145
210
|
this.copiedText.element.classList.add('fadeout');
|
|
146
|
-
}
|
|
211
|
+
};
|
|
147
212
|
if (this.addFadeoutSettimeoutId) {
|
|
148
213
|
clearTimeout(this.addFadeoutSettimeoutId);
|
|
149
214
|
this.addFadeoutSettimeoutId = null;
|
|
150
215
|
}
|
|
151
|
-
this.addFadeoutSettimeoutId = window.setTimeout(addFadeoutClass
|
|
216
|
+
this.addFadeoutSettimeoutId = window.setTimeout(addFadeoutClass, 2000);
|
|
152
217
|
}
|
|
153
218
|
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
219
|
+
override performUpdate(): void {
|
|
220
|
+
const viewInput: ViewInput = {
|
|
221
|
+
activePositionPercentage: this.activePositionPercentage,
|
|
222
|
+
content: this.streamingContent,
|
|
223
|
+
contentUrl: this.contentUrl,
|
|
224
|
+
resourceType: this.resourceType,
|
|
225
|
+
binaryViewObjects: this.binaryViewObjects,
|
|
226
|
+
binaryViewTypeSetting: this.binaryViewTypeSetting,
|
|
227
|
+
binaryViewTypeChanged: this.binaryViewTypeChanged.bind(this),
|
|
228
|
+
copySelectedViewToClipboard: this.copySelectedViewToClipboard.bind(this),
|
|
229
|
+
copiedText: this.copiedText,
|
|
230
|
+
};
|
|
231
|
+
this.#view(viewInput, undefined, this.litContainer);
|
|
232
|
+
}
|
|
159
233
|
|
|
160
|
-
|
|
161
|
-
|
|
234
|
+
binaryViewTypeChanged(event: Event): void {
|
|
235
|
+
const newViewType = (event.target as HTMLSelectElement).value;
|
|
236
|
+
if (this.binaryViewTypeSetting.get() === newViewType) {
|
|
162
237
|
return;
|
|
163
238
|
}
|
|
164
239
|
|
|
165
|
-
|
|
166
|
-
|
|
240
|
+
const currentViewWidget = this.litContainer.querySelector('devtools-widget');
|
|
241
|
+
if (currentViewWidget) {
|
|
242
|
+
const view = UI.Widget.Widget.get(currentViewWidget) as SourceFrame.ResourceSourceFrame.ResourceSourceFrame |
|
|
243
|
+
SourceFrame.StreamingContentHexView.StreamingContentHexView;
|
|
244
|
+
if (view && 'getPositionPercentage' in view) {
|
|
245
|
+
this.activePositionPercentage = view.getPositionPercentage();
|
|
246
|
+
}
|
|
167
247
|
}
|
|
168
|
-
this.lastView = newView;
|
|
169
|
-
|
|
170
|
-
newView.show(this.element, this.toolbar);
|
|
171
|
-
this.binaryViewTypeCombobox.element.value = this.binaryViewTypeSetting.get();
|
|
172
|
-
}
|
|
173
248
|
|
|
174
|
-
private binaryViewTypeChanged(): void {
|
|
175
|
-
const selectedOption = (this.binaryViewTypeCombobox.selectedOption());
|
|
176
|
-
if (!selectedOption) {
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
const newViewType = selectedOption.value;
|
|
180
|
-
if (this.binaryViewTypeSetting.get() === newViewType) {
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
249
|
this.binaryViewTypeSetting.set(newViewType);
|
|
184
|
-
this.
|
|
250
|
+
this.performUpdate();
|
|
185
251
|
}
|
|
186
252
|
|
|
187
253
|
addCopyToContextMenu(contextMenu: UI.ContextMenu.ContextMenu, submenuItemText: string): void {
|
|
@@ -208,24 +274,11 @@ export class BinaryViewObject {
|
|
|
208
274
|
label: string;
|
|
209
275
|
copiedMessage: string;
|
|
210
276
|
content: () => string;
|
|
211
|
-
private createViewFn: () => UI.Widget.Widget;
|
|
212
|
-
private view: UI.Widget.Widget|null;
|
|
213
277
|
|
|
214
|
-
constructor(
|
|
215
|
-
type: string, label: string, copiedMessage: string, createViewFn: () => UI.Widget.Widget, content: () => string) {
|
|
278
|
+
constructor(type: string, label: string, copiedMessage: string, content: () => string) {
|
|
216
279
|
this.type = type;
|
|
217
280
|
this.label = label;
|
|
218
281
|
this.copiedMessage = copiedMessage;
|
|
219
282
|
this.content = content;
|
|
220
|
-
this.createViewFn = createViewFn;
|
|
221
|
-
|
|
222
|
-
this.view = null;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
getView(): UI.Widget.Widget {
|
|
226
|
-
if (!this.view) {
|
|
227
|
-
this.view = this.createViewFn();
|
|
228
|
-
}
|
|
229
|
-
return this.view;
|
|
230
283
|
}
|
|
231
284
|
}
|