chrome-devtools-frontend 1.0.1549484 → 1.0.1550444
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/styleguide/ux/components.md +53 -12
- package/docs/styleguide/ux/images/cards.png +0 -0
- package/docs/ui_engineering.md +2 -2
- package/front_end/core/sdk/NetworkManager.ts +12 -10
- package/front_end/core/sdk/PageResourceLoader.ts +8 -1
- package/front_end/core/sdk/SourceMapManager.ts +12 -6
- package/front_end/entrypoints/main/MainImpl.ts +0 -9
- package/front_end/foundation/Universe.ts +7 -0
- package/front_end/generated/InspectorBackendCommands.ts +5 -2
- package/front_end/generated/protocol-mapping.d.ts +8 -0
- package/front_end/generated/protocol-proxy-api.d.ts +6 -0
- package/front_end/generated/protocol.ts +76 -0
- package/front_end/models/ai_assistance/BuiltInAi.ts +79 -5
- package/front_end/models/issues_manager/AttributionReportingIssue.ts +6 -8
- package/front_end/models/issues_manager/BounceTrackingIssue.ts +4 -14
- package/front_end/models/issues_manager/ClientHintIssue.ts +5 -12
- package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +5 -12
- package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +7 -14
- package/front_end/models/issues_manager/CookieIssue.ts +27 -30
- package/front_end/models/issues_manager/CorsIssue.ts +8 -17
- package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +5 -8
- package/front_end/models/issues_manager/DeprecationIssue.ts +7 -14
- package/front_end/models/issues_manager/ElementAccessibilityIssue.ts +7 -14
- package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +4 -11
- package/front_end/models/issues_manager/FederatedAuthUserInfoRequestIssue.ts +4 -11
- package/front_end/models/issues_manager/GenericIssue.ts +11 -16
- package/front_end/models/issues_manager/HeavyAdIssue.ts +4 -11
- package/front_end/models/issues_manager/Issue.ts +12 -4
- package/front_end/models/issues_manager/IssueAggregator.ts +8 -2
- package/front_end/models/issues_manager/LowTextContrastIssue.ts +3 -10
- package/front_end/models/issues_manager/MixedContentIssue.ts +7 -13
- package/front_end/models/issues_manager/PartitioningBlobURLIssue.ts +4 -11
- package/front_end/models/issues_manager/PropertyRuleIssue.ts +6 -12
- package/front_end/models/issues_manager/QuirksModeIssue.ts +3 -10
- package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +7 -13
- package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +4 -11
- package/front_end/models/issues_manager/SharedDictionaryIssue.ts +6 -13
- package/front_end/models/issues_manager/StylesheetLoadingIssue.ts +8 -13
- package/front_end/models/issues_manager/UnencodedDigestIssue.ts +2 -9
- package/front_end/models/javascript_metadata/NativeFunctions.js +0 -13
- package/front_end/panels/application/AppManifestView.ts +4 -4
- package/front_end/panels/application/ApplicationPanelSidebar.ts +21 -21
- package/front_end/panels/application/BackForwardCacheTreeElement.ts +2 -2
- package/front_end/panels/application/BounceTrackingMitigationsTreeElement.ts +2 -2
- package/front_end/panels/application/InterestGroupTreeElement.ts +2 -2
- package/front_end/panels/application/OpenedWindowDetailsView.ts +2 -2
- package/front_end/panels/application/OriginTrialTreeView.ts +1 -1
- package/front_end/panels/application/PreloadingTreeElement.ts +3 -3
- package/front_end/panels/application/ReportingApiTreeElement.ts +2 -2
- package/front_end/panels/application/ServiceWorkerCacheTreeElement.ts +3 -3
- package/front_end/panels/application/SharedStorageListTreeElement.ts +2 -2
- package/front_end/panels/application/StorageBucketsTreeElement.ts +3 -3
- package/front_end/panels/application/StorageView.ts +2 -2
- package/front_end/panels/application/TrustTokensTreeElement.ts +2 -2
- package/front_end/panels/application/components/PermissionsPolicySection.ts +1 -1
- package/front_end/panels/application/components/ProtocolHandlersView.ts +1 -1
- package/front_end/panels/application/components/SharedStorageMetadataView.ts +1 -1
- package/front_end/panels/application/components/TrustTokensView.ts +1 -1
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +1 -1
- package/front_end/panels/application/preloading/components/RuleSetGrid.ts +1 -1
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +1 -1
- package/front_end/panels/changes/ChangesSidebar.ts +2 -0
- package/front_end/panels/changes/CombinedDiffView.ts +2 -0
- package/front_end/panels/common/AnnotationManager.ts +71 -0
- package/front_end/panels/common/PersistenceUtils.ts +6 -7
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/console/ConsolePrompt.ts +4 -4
- package/front_end/panels/console/ConsoleView.ts +2 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +10 -11
- package/front_end/panels/console_counters/WarningErrorCounter.ts +2 -0
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +1 -1
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +3 -3
- package/front_end/panels/elements/ElementsPanel.ts +49 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +156 -108
- package/front_end/panels/elements/ElementsTreeOutline.ts +9 -2
- package/front_end/panels/elements/ShortcutTreeElement.ts +2 -2
- package/front_end/panels/elements/StyleEditorWidget.ts +2 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -6
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -5
- package/front_end/panels/elements/TopLayerContainer.ts +2 -2
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
- package/front_end/panels/elements/components/ElementsTreeExpandButton.ts +1 -1
- package/front_end/panels/elements/components/QueryContainer.ts +1 -1
- package/front_end/panels/elements/components/StylePropertyEditor.ts +1 -1
- package/front_end/panels/emulation/DeviceModeWrapper.ts +48 -3
- package/front_end/panels/explain/components/ConsoleInsight.ts +6 -4
- package/front_end/panels/issues/AffectedResourcesView.ts +2 -2
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +2 -2
- package/front_end/panels/issues/IssueKindView.ts +2 -2
- package/front_end/panels/issues/IssueView.ts +4 -4
- package/front_end/panels/js_timeline/js_timeline-meta.ts +4 -2
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +1 -1
- package/front_end/panels/media/PlayerListView.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +2 -2
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +2 -3
- package/front_end/panels/network/NetworkDataGridNode.ts +3 -3
- package/front_end/panels/network/NetworkFrameGrouper.ts +2 -2
- package/front_end/panels/network/NetworkItemView.ts +4 -4
- package/front_end/panels/network/NetworkLogViewColumns.ts +3 -3
- package/front_end/panels/network/RequestCookiesView.ts +2 -2
- package/front_end/panels/network/SignedExchangeInfoView.ts +2 -2
- package/front_end/panels/network/components/RequestTrustTokensView.ts +5 -6
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +3 -3
- package/front_end/panels/profiler/ProfileDataGrid.ts +2 -2
- package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
- package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
- package/front_end/panels/recorder/components/CreateRecordingView.ts +1 -1
- package/front_end/panels/recorder/components/ExtensionView.ts +1 -1
- package/front_end/panels/recorder/components/RecordingListView.ts +1 -1
- package/front_end/panels/recorder/components/RecordingView.ts +1 -1
- package/front_end/panels/recorder/components/StepView.ts +1 -1
- package/front_end/panels/screencast/ScreencastView.ts +8 -8
- package/front_end/panels/search/SearchView.ts +1 -1
- package/front_end/panels/security/CookieControlsTreeElement.ts +2 -2
- package/front_end/panels/security/CookieReportTreeElement.ts +2 -2
- package/front_end/panels/security/SecurityPanel.ts +5 -5
- package/front_end/panels/security/SecurityPanelSidebar.ts +3 -4
- package/front_end/panels/settings/KeybindsSettingsTab.ts +4 -4
- package/front_end/panels/settings/SettingsScreen.ts +2 -3
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +16 -8
- package/front_end/panels/sources/BreakpointEditDialog.ts +3 -3
- package/front_end/panels/sources/BreakpointsView.ts +1 -1
- package/front_end/panels/sources/CSSPlugin.ts +3 -3
- package/front_end/panels/sources/CallStackSidebarPane.ts +4 -4
- package/front_end/panels/sources/DebuggerPausedMessage.ts +3 -3
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +39 -30
- package/front_end/panels/sources/GoToLineQuickOpen.ts +11 -7
- package/front_end/panels/sources/NavigatorView.ts +2 -2
- package/front_end/panels/sources/OpenFileQuickOpen.ts +11 -15
- package/front_end/panels/sources/OutlineQuickOpen.ts +23 -26
- package/front_end/panels/sources/SourcesView.ts +2 -2
- package/front_end/panels/sources/TabbedEditorContainer.ts +4 -5
- package/front_end/panels/sources/ThreadsSidebarPane.ts +2 -2
- package/front_end/panels/sources/UISourceCodeFrame.ts +5 -5
- package/front_end/panels/timeline/TimelineHistoryManager.ts +2 -2
- package/front_end/panels/timeline/TimelinePanel.ts +14 -9
- package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +1 -1
- package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -1
- package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +1 -1
- package/front_end/panels/timeline/components/NetworkThrottlingSelector.ts +1 -1
- package/front_end/panels/timeline/components/OriginMap.ts +1 -1
- package/front_end/panels/timeline/components/insights/Checklist.ts +1 -1
- package/front_end/panels/timeline/components/insights/DOMSize.ts +1 -1
- package/front_end/panels/timeline/components/insights/ImageDelivery.ts +1 -1
- package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +1 -1
- package/front_end/panels/timeline/overlays/components/EntriesLinkOverlay.ts +1 -1
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +1 -1
- package/front_end/panels/timeline/timeline-meta.ts +3 -2
- package/front_end/panels/utils/utils.ts +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/adorners/Adorner.ts +20 -0
- package/front_end/ui/components/annotations/AnnotationRepository.ts +1 -1
- package/front_end/ui/components/buttons/Button.ts +1 -1
- package/front_end/ui/components/buttons/FloatingButton.ts +1 -1
- package/front_end/ui/components/highlighting/HighlightElement.ts +15 -2
- package/front_end/ui/components/icon_button/FileSourceIcon.ts +1 -1
- package/front_end/ui/components/icon_button/IconButton.ts +1 -1
- package/front_end/ui/components/icon_button/icon_button.ts +0 -2
- package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +3 -3
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
- package/front_end/ui/components/settings/SettingDeprecationWarning.ts +1 -1
- package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
- package/front_end/ui/components/text_editor/config.ts +2 -2
- package/front_end/ui/kit/cards/Card.docs.ts +43 -0
- package/front_end/ui/{components/icon_button → kit/icons}/Icon.docs.ts +3 -4
- package/front_end/ui/{components/icon_button → kit/icons}/Icon.ts +4 -4
- package/front_end/ui/kit/kit.ts +1 -0
- package/front_end/ui/legacy/Infobar.ts +3 -3
- package/front_end/ui/legacy/InspectorView.ts +3 -3
- package/front_end/ui/legacy/SearchableView.ts +2 -2
- package/front_end/ui/legacy/SoftContextMenu.ts +5 -5
- package/front_end/ui/legacy/SoftDropDown.ts +2 -2
- package/front_end/ui/legacy/TabbedPane.ts +9 -9
- package/front_end/ui/legacy/Toolbar.ts +3 -3
- package/front_end/ui/legacy/Treeoutline.ts +2 -2
- package/front_end/ui/legacy/UIUtils.ts +4 -4
- package/front_end/ui/legacy/ViewManager.ts +4 -4
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +8 -8
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +4 -4
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +4 -4
- package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +2 -2
- package/front_end/ui/legacy/components/inline_editor/Swatches.ts +5 -5
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +3 -3
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +3 -3
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +22 -29
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +8 -15
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +11 -14
- package/front_end/ui/legacy/components/utils/Linkifier.ts +3 -3
- package/mcp/mcp.ts +1 -0
- package/package.json +1 -1
- /package/front_end/ui/{components/icon_button → kit/icons}/icon.css +0 -0
|
@@ -50,8 +50,8 @@ import * as Adorners from '../../ui/components/adorners/adorners.js';
|
|
|
50
50
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
51
51
|
import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
|
|
52
52
|
import * as Highlighting from '../../ui/components/highlighting/highlighting.js';
|
|
53
|
-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
54
53
|
import * as TextEditor from '../../ui/components/text_editor/text_editor.js';
|
|
54
|
+
import {createIcon, Icon} from '../../ui/kit/kit.js';
|
|
55
55
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
56
56
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
57
57
|
import * as Lit from '../../ui/lit/lit.js';
|
|
@@ -229,6 +229,16 @@ const UIStrings = {
|
|
|
229
229
|
* the overlay showing CSS scroll snapping for the current element.
|
|
230
230
|
*/
|
|
231
231
|
disableScrollSnap: 'Disable scroll-snap overlay',
|
|
232
|
+
/**
|
|
233
|
+
* @description Label of an adorner in the Elements panel. When clicked, it enables
|
|
234
|
+
* the overlay showing the container overlay for the current element.
|
|
235
|
+
*/
|
|
236
|
+
enableContainer: 'Enable container overlay',
|
|
237
|
+
/**
|
|
238
|
+
* @description Label of an adorner in the Elements panel. When clicked, it disables
|
|
239
|
+
* the overlay showing container for the current element.
|
|
240
|
+
*/
|
|
241
|
+
disableContainer: 'Disable container overlay',
|
|
232
242
|
/**
|
|
233
243
|
* @description Label of an adorner in the Elements panel. When clicked, it forces
|
|
234
244
|
* the element into applying its starting-style rules.
|
|
@@ -357,13 +367,21 @@ export function isOpeningTag(context: TagTypeContext): context is OpeningTagCont
|
|
|
357
367
|
}
|
|
358
368
|
|
|
359
369
|
export interface ViewInput {
|
|
370
|
+
containerAdornerActive: boolean;
|
|
371
|
+
flexAdornerActive: boolean;
|
|
372
|
+
|
|
360
373
|
showAdAdorner: boolean;
|
|
374
|
+
showContainerAdorner: boolean;
|
|
375
|
+
showFlexAdorner: boolean;
|
|
376
|
+
|
|
361
377
|
adorners?: Set<Adorners.Adorner.Adorner>;
|
|
362
378
|
nodeInfo?: DocumentFragment;
|
|
363
379
|
|
|
364
380
|
onGutterClick: (e: Event) => void;
|
|
365
381
|
onAdornerAdded: (adorner: Adorners.Adorner.Adorner) => void;
|
|
366
382
|
onAdornerRemoved: (adorner: Adorners.Adorner.Adorner) => void;
|
|
383
|
+
onContainerAdornerClick: (e: Event) => void;
|
|
384
|
+
onFlexAdornerClick: (e: Event) => void;
|
|
367
385
|
}
|
|
368
386
|
|
|
369
387
|
export interface ViewOutput {
|
|
@@ -388,7 +406,12 @@ function adornerRef(input: ViewInput): DirectiveResult<typeof Lit.Directives.Ref
|
|
|
388
406
|
export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLElement): void => {
|
|
389
407
|
const adAdornerConfig =
|
|
390
408
|
ElementsComponents.AdornerManager.getRegisteredAdorner(ElementsComponents.AdornerManager.RegisteredAdorners.AD);
|
|
391
|
-
const
|
|
409
|
+
const containerAdornerConfig = ElementsComponents.AdornerManager.getRegisteredAdorner(
|
|
410
|
+
ElementsComponents.AdornerManager.RegisteredAdorners.CONTAINER);
|
|
411
|
+
const flexAdornerConfig =
|
|
412
|
+
ElementsComponents.AdornerManager.getRegisteredAdorner(ElementsComponents.AdornerManager.RegisteredAdorners.FLEX);
|
|
413
|
+
const hasAdorners =
|
|
414
|
+
input.adorners?.size || input.showAdAdorner || input.showContainerAdorner || input.showFlexAdorner;
|
|
392
415
|
// clang-format off
|
|
393
416
|
render(html`
|
|
394
417
|
<div ${ref(el => { output.contentElement = el as HTMLElement; })}>
|
|
@@ -397,13 +420,51 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
|
|
|
397
420
|
<devtools-icon name="dots-horizontal"></devtools-icon>
|
|
398
421
|
<div class="hidden" ${ref(el => { output.decorationsElement = el as HTMLElement; })}></div>
|
|
399
422
|
</div>
|
|
400
|
-
${hasAdorners? html`<div class="adorner-container ${!hasAdorners ? 'hidden': ''}">
|
|
423
|
+
${hasAdorners ? html`<div class="adorner-container ${!hasAdorners ? 'hidden' : ''}">
|
|
401
424
|
${input.showAdAdorner ? html`<devtools-adorner
|
|
402
|
-
.data=${{name: adAdornerConfig.name, jslogContext: adAdornerConfig.name}}
|
|
403
425
|
aria-label=${i18nString(UIStrings.thisFrameWasIdentifiedAsAnAd)}
|
|
426
|
+
.data=${{name: adAdornerConfig.name, jslogContext: adAdornerConfig.name}}
|
|
404
427
|
${adornerRef(input)}>
|
|
405
428
|
<span>${adAdornerConfig.name}</span>
|
|
406
429
|
</devtools-adorner>` : nothing}
|
|
430
|
+
${input.showContainerAdorner ? html`<devtools-adorner
|
|
431
|
+
class=clickable
|
|
432
|
+
role=button
|
|
433
|
+
toggleable=true
|
|
434
|
+
tabindex=0
|
|
435
|
+
.data=${{name: containerAdornerConfig.name, jslogContext: containerAdornerConfig.name}}
|
|
436
|
+
jslog=${VisualLogging.adorner(containerAdornerConfig.name).track({click: true})}
|
|
437
|
+
active=${input.containerAdornerActive}
|
|
438
|
+
aria-label=${input.containerAdornerActive ? i18nString(UIStrings.enableContainer) : i18nString(UIStrings.disableContainer)}
|
|
439
|
+
@click=${input.onContainerAdornerClick}
|
|
440
|
+
@keydown=${(event: KeyboardEvent) => {
|
|
441
|
+
if (event.code === 'Enter' || event.code === 'Space') {
|
|
442
|
+
input.onContainerAdornerClick(event);
|
|
443
|
+
event.stopPropagation();
|
|
444
|
+
}
|
|
445
|
+
}}
|
|
446
|
+
${adornerRef(input)}>
|
|
447
|
+
<span>${containerAdornerConfig.name}</span>
|
|
448
|
+
</devtools-adorner>`: nothing}
|
|
449
|
+
${input.showFlexAdorner ? html`<devtools-adorner
|
|
450
|
+
class=clickable
|
|
451
|
+
role=button
|
|
452
|
+
toggleable=true
|
|
453
|
+
tabindex=0
|
|
454
|
+
.data=${{name: flexAdornerConfig.name, jslogContext: flexAdornerConfig.name}}
|
|
455
|
+
jslog=${VisualLogging.adorner(flexAdornerConfig.name).track({click: true})}
|
|
456
|
+
active=${input.flexAdornerActive}
|
|
457
|
+
aria-label=${input.flexAdornerActive ? i18nString(UIStrings.enableFlexMode) : i18nString(UIStrings.disableFlexMode)}
|
|
458
|
+
@click=${input.onFlexAdornerClick}
|
|
459
|
+
@keydown=${(event: KeyboardEvent) => {
|
|
460
|
+
if (event.code === 'Enter' || event.code === 'Space') {
|
|
461
|
+
input.onFlexAdornerClick(event);
|
|
462
|
+
event.stopPropagation();
|
|
463
|
+
}
|
|
464
|
+
}}
|
|
465
|
+
${adornerRef(input)}>
|
|
466
|
+
<span>${flexAdornerConfig.name}</span>
|
|
467
|
+
</devtools-adorner>`: nothing}
|
|
407
468
|
${repeat(Array.from((input.adorners ?? new Set()).values()).sort(adornerComparator), adorner => {
|
|
408
469
|
return adorner;
|
|
409
470
|
})}
|
|
@@ -442,6 +503,9 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
442
503
|
#adornersThrottler = new Common.Throttler.Throttler(100);
|
|
443
504
|
#adorners = new Set<Adorners.Adorner.Adorner>();
|
|
444
505
|
#nodeInfo?: DocumentFragment;
|
|
506
|
+
#containerAdornerActive = false;
|
|
507
|
+
#flexAdornerActive = false;
|
|
508
|
+
#layout: SDK.CSSModel.LayoutProperties|null = null;
|
|
445
509
|
|
|
446
510
|
constructor(node: SDK.DOMModel.DOMNode, isClosingTag?: boolean) {
|
|
447
511
|
// The title will be updated in onattach.
|
|
@@ -474,13 +538,14 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
474
538
|
void this.updateStyleAdorners();
|
|
475
539
|
|
|
476
540
|
void this.updateScrollAdorner();
|
|
541
|
+
|
|
542
|
+
void this.#updateAdorners();
|
|
477
543
|
}
|
|
478
544
|
this.expandAllButtonElement = null;
|
|
479
|
-
|
|
480
545
|
this.performUpdate();
|
|
481
546
|
|
|
482
547
|
if (this.nodeInternal.retained && !this.isClosingTag()) {
|
|
483
|
-
const icon = new
|
|
548
|
+
const icon = new Icon();
|
|
484
549
|
icon.name = 'small-status-dot';
|
|
485
550
|
icon.style.color = 'var(--icon-error)';
|
|
486
551
|
icon.classList.add('extra-small');
|
|
@@ -494,6 +559,25 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
494
559
|
if (this.nodeInternal.detached && !this.isClosingTag()) {
|
|
495
560
|
this.listItemNode.setAttribute('title', 'Detached Tree Node');
|
|
496
561
|
}
|
|
562
|
+
|
|
563
|
+
node.domModel().overlayModel().addEventListener(
|
|
564
|
+
SDK.OverlayModel.Events.PERSISTENT_CONTAINER_QUERY_OVERLAY_STATE_CHANGED, event => {
|
|
565
|
+
const {nodeId: eventNodeId, enabled} = event.data;
|
|
566
|
+
if (eventNodeId !== node.id) {
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
this.#containerAdornerActive = enabled;
|
|
570
|
+
this.performUpdate();
|
|
571
|
+
});
|
|
572
|
+
node.domModel().overlayModel().addEventListener(
|
|
573
|
+
SDK.OverlayModel.Events.PERSISTENT_FLEX_CONTAINER_OVERLAY_STATE_CHANGED, event => {
|
|
574
|
+
const {nodeId: eventNodeId, enabled} = event.data;
|
|
575
|
+
if (eventNodeId !== node.id) {
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
this.#flexAdornerActive = enabled;
|
|
579
|
+
this.performUpdate();
|
|
580
|
+
});
|
|
497
581
|
}
|
|
498
582
|
|
|
499
583
|
static animateOnDOMUpdate(treeElement: ElementsTreeElement): void {
|
|
@@ -556,10 +640,18 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
556
640
|
performUpdate(): void {
|
|
557
641
|
DEFAULT_VIEW(
|
|
558
642
|
{
|
|
643
|
+
containerAdornerActive: this.#containerAdornerActive,
|
|
559
644
|
adorners: !this.isClosingTag() ? this.#adorners : undefined,
|
|
560
645
|
showAdAdorner:
|
|
561
646
|
ElementsPanel.instance().isAdornerEnabled(ElementsComponents.AdornerManager.RegisteredAdorners.AD) &&
|
|
562
647
|
this.nodeInternal.isAdFrameNode(),
|
|
648
|
+
showContainerAdorner: ElementsPanel.instance().isAdornerEnabled(
|
|
649
|
+
ElementsComponents.AdornerManager.RegisteredAdorners.CONTAINER) &&
|
|
650
|
+
Boolean(this.#layout?.isContainer) && !this.isClosingTag(),
|
|
651
|
+
showFlexAdorner:
|
|
652
|
+
ElementsPanel.instance().isAdornerEnabled(ElementsComponents.AdornerManager.RegisteredAdorners.FLEX) &&
|
|
653
|
+
Boolean(this.#layout?.isFlex) && !this.isClosingTag(),
|
|
654
|
+
flexAdornerActive: this.#flexAdornerActive,
|
|
563
655
|
nodeInfo: this.#nodeInfo,
|
|
564
656
|
onGutterClick: this.showContextMenu.bind(this),
|
|
565
657
|
onAdornerAdded: adorner => {
|
|
@@ -568,10 +660,50 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
568
660
|
onAdornerRemoved: adorner => {
|
|
569
661
|
ElementsPanel.instance().deregisterAdorner(adorner);
|
|
570
662
|
},
|
|
663
|
+
onContainerAdornerClick: (event: Event) => this.#onContainerAdornerClick(event),
|
|
664
|
+
onFlexAdornerClick: (event: Event) => this.#onFlexAdornerClick(event),
|
|
571
665
|
},
|
|
572
666
|
this, this.listItemElement);
|
|
573
667
|
}
|
|
574
668
|
|
|
669
|
+
#onContainerAdornerClick(event: Event): void {
|
|
670
|
+
event.stopPropagation();
|
|
671
|
+
const node = this.node();
|
|
672
|
+
const nodeId = node.id;
|
|
673
|
+
if (!nodeId) {
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
const model = node.domModel().overlayModel();
|
|
677
|
+
if (model.isHighlightedContainerQueryInPersistentOverlay(nodeId)) {
|
|
678
|
+
model.hideContainerQueryInPersistentOverlay(nodeId);
|
|
679
|
+
this.#containerAdornerActive = false;
|
|
680
|
+
} else {
|
|
681
|
+
model.highlightContainerQueryInPersistentOverlay(nodeId);
|
|
682
|
+
this.#containerAdornerActive = true;
|
|
683
|
+
Badges.UserBadges.instance().recordAction(Badges.BadgeAction.MODERN_DOM_BADGE_CLICKED);
|
|
684
|
+
}
|
|
685
|
+
void this.updateAdorners();
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
#onFlexAdornerClick(event: Event): void {
|
|
689
|
+
event.stopPropagation();
|
|
690
|
+
const node = this.node();
|
|
691
|
+
const nodeId = node.id;
|
|
692
|
+
if (!nodeId) {
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
const model = node.domModel().overlayModel();
|
|
696
|
+
if (model.isHighlightedFlexContainerInPersistentOverlay(nodeId)) {
|
|
697
|
+
model.hideFlexContainerInPersistentOverlay(nodeId);
|
|
698
|
+
this.#flexAdornerActive = false;
|
|
699
|
+
} else {
|
|
700
|
+
model.highlightFlexContainerInPersistentOverlay(nodeId);
|
|
701
|
+
this.#flexAdornerActive = true;
|
|
702
|
+
Badges.UserBadges.instance().recordAction(Badges.BadgeAction.MODERN_DOM_BADGE_CLICKED);
|
|
703
|
+
}
|
|
704
|
+
void this.updateAdorners();
|
|
705
|
+
}
|
|
706
|
+
|
|
575
707
|
highlightAttribute(attributeName: string): void {
|
|
576
708
|
// If the attribute is not found, we highlight the tag name instead.
|
|
577
709
|
let animationElement = this.listItemElement.querySelector('.webkit-html-tag-name') ?? this.listItemElement;
|
|
@@ -1018,7 +1150,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1018
1150
|
const isEditable = this.hasEditableNode();
|
|
1019
1151
|
// clang-format off
|
|
1020
1152
|
if (isEditable && !this.editing) {
|
|
1021
|
-
contextMenu.editSection().appendItem(i18nString(UIStrings.editAsHtml), this.editAsHTML.bind(this), {jslogContext: 'elements.edit-as-html'});
|
|
1153
|
+
contextMenu.editSection().appendItem(i18nString(UIStrings.editAsHtml), this.editAsHTML.bind(this), { jslogContext: 'elements.edit-as-html' });
|
|
1022
1154
|
}
|
|
1023
1155
|
// clang-format on
|
|
1024
1156
|
const isShadowRoot = this.nodeInternal.isShadowRoot();
|
|
@@ -2537,7 +2669,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2537
2669
|
}
|
|
2538
2670
|
|
|
2539
2671
|
adornSlot({name}: {name: string}): Adorners.Adorner.Adorner {
|
|
2540
|
-
const linkIcon =
|
|
2672
|
+
const linkIcon = createIcon('select-element');
|
|
2541
2673
|
const slotText = document.createElement('span');
|
|
2542
2674
|
slotText.textContent = name;
|
|
2543
2675
|
const adornerContent = document.createElement('span');
|
|
@@ -2562,7 +2694,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2562
2694
|
adornerContent.textContent = name;
|
|
2563
2695
|
adornerContent.classList.add('adorner-with-icon');
|
|
2564
2696
|
|
|
2565
|
-
const linkIcon =
|
|
2697
|
+
const linkIcon = createIcon('select-element');
|
|
2566
2698
|
adornerContent.append(linkIcon);
|
|
2567
2699
|
|
|
2568
2700
|
const adorner = new Adorners.Adorner.Adorner();
|
|
@@ -2601,17 +2733,28 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2601
2733
|
}
|
|
2602
2734
|
}
|
|
2603
2735
|
|
|
2604
|
-
|
|
2736
|
+
updateAdorners(): void {
|
|
2605
2737
|
// TODO: remove adornersThrottler in favour of throttled updated (requestUpdate/performUpdate).
|
|
2606
2738
|
void this.#adornersThrottler.schedule(this.#updateAdorners.bind(this));
|
|
2607
2739
|
}
|
|
2608
2740
|
|
|
2609
|
-
#updateAdorners(): Promise<void> {
|
|
2610
|
-
|
|
2741
|
+
async #updateAdorners(): Promise<void> {
|
|
2742
|
+
if (this.isClosingTag()) {
|
|
2743
|
+
this.performUpdate();
|
|
2744
|
+
return;
|
|
2745
|
+
}
|
|
2746
|
+
const node = this.node();
|
|
2747
|
+
const nodeId = node.id;
|
|
2748
|
+
if (node.nodeType() !== Node.COMMENT_NODE && node.nodeType() !== Node.DOCUMENT_FRAGMENT_NODE &&
|
|
2749
|
+
node.nodeType() !== Node.TEXT_NODE && nodeId !== undefined) {
|
|
2750
|
+
this.#layout = await node.domModel().cssModel().getLayoutPropertiesFromComputedStyle(nodeId);
|
|
2751
|
+
} else {
|
|
2752
|
+
this.#layout = null;
|
|
2753
|
+
}
|
|
2611
2754
|
this.performUpdate();
|
|
2612
|
-
return Promise.resolve();
|
|
2613
2755
|
}
|
|
2614
2756
|
|
|
2757
|
+
// TODO: remove in favour of updateAdorners.
|
|
2615
2758
|
async updateStyleAdorners(): Promise<void> {
|
|
2616
2759
|
if (!isOpeningTag(this.tagTypeContext)) {
|
|
2617
2760
|
return;
|
|
@@ -2623,7 +2766,6 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2623
2766
|
node.nodeType() === Node.TEXT_NODE || nodeId === undefined) {
|
|
2624
2767
|
return;
|
|
2625
2768
|
}
|
|
2626
|
-
|
|
2627
2769
|
const layout = await node.domModel().cssModel().getLayoutPropertiesFromComputedStyle(nodeId);
|
|
2628
2770
|
// TODO: move this to the template.
|
|
2629
2771
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.SUBGRID);
|
|
@@ -2631,7 +2773,6 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2631
2773
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.GRID_LANES);
|
|
2632
2774
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.FLEX);
|
|
2633
2775
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.SCROLL_SNAP);
|
|
2634
|
-
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.CONTAINER);
|
|
2635
2776
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.MEDIA);
|
|
2636
2777
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.STARTING_STYLE);
|
|
2637
2778
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.POPOVER);
|
|
@@ -2642,15 +2783,9 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2642
2783
|
if (layout.isGridLanes) {
|
|
2643
2784
|
this.pushGridLanesAdorner();
|
|
2644
2785
|
}
|
|
2645
|
-
if (layout.isFlex) {
|
|
2646
|
-
this.pushFlexAdorner();
|
|
2647
|
-
}
|
|
2648
2786
|
if (layout.hasScroll) {
|
|
2649
2787
|
this.pushScrollSnapAdorner();
|
|
2650
2788
|
}
|
|
2651
|
-
if (layout.isContainer) {
|
|
2652
|
-
this.pushContainerAdorner();
|
|
2653
|
-
}
|
|
2654
2789
|
}
|
|
2655
2790
|
|
|
2656
2791
|
if (node.isMediaNode()) {
|
|
@@ -2864,93 +2999,6 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2864
2999
|
this.#adorners.add(adorner);
|
|
2865
3000
|
}
|
|
2866
3001
|
|
|
2867
|
-
pushFlexAdorner(): void {
|
|
2868
|
-
const node = this.node();
|
|
2869
|
-
const nodeId = node.id;
|
|
2870
|
-
if (!nodeId) {
|
|
2871
|
-
return;
|
|
2872
|
-
}
|
|
2873
|
-
const config = ElementsComponents.AdornerManager.getRegisteredAdorner(
|
|
2874
|
-
ElementsComponents.AdornerManager.RegisteredAdorners.FLEX);
|
|
2875
|
-
const adorner = this.adorn(config);
|
|
2876
|
-
adorner.classList.add('flex');
|
|
2877
|
-
|
|
2878
|
-
const onClick = ((() => {
|
|
2879
|
-
const model = node.domModel().overlayModel();
|
|
2880
|
-
if (adorner.isActive()) {
|
|
2881
|
-
model.highlightFlexContainerInPersistentOverlay(nodeId);
|
|
2882
|
-
} else {
|
|
2883
|
-
model.hideFlexContainerInPersistentOverlay(nodeId);
|
|
2884
|
-
}
|
|
2885
|
-
}) as EventListener);
|
|
2886
|
-
|
|
2887
|
-
adorner.addInteraction(onClick, {
|
|
2888
|
-
isToggle: true,
|
|
2889
|
-
shouldPropagateOnKeydown: false,
|
|
2890
|
-
ariaLabelDefault: i18nString(UIStrings.enableFlexMode),
|
|
2891
|
-
ariaLabelActive: i18nString(UIStrings.disableFlexMode),
|
|
2892
|
-
});
|
|
2893
|
-
|
|
2894
|
-
node.domModel().overlayModel().addEventListener(
|
|
2895
|
-
SDK.OverlayModel.Events.PERSISTENT_FLEX_CONTAINER_OVERLAY_STATE_CHANGED, event => {
|
|
2896
|
-
const {nodeId: eventNodeId, enabled} = event.data;
|
|
2897
|
-
if (eventNodeId !== nodeId) {
|
|
2898
|
-
return;
|
|
2899
|
-
}
|
|
2900
|
-
|
|
2901
|
-
adorner.toggle(enabled);
|
|
2902
|
-
});
|
|
2903
|
-
|
|
2904
|
-
this.#adorners.add(adorner);
|
|
2905
|
-
|
|
2906
|
-
if (node.domModel().overlayModel().isHighlightedFlexContainerInPersistentOverlay(nodeId)) {
|
|
2907
|
-
adorner.toggle(true);
|
|
2908
|
-
}
|
|
2909
|
-
}
|
|
2910
|
-
|
|
2911
|
-
pushContainerAdorner(): void {
|
|
2912
|
-
const node = this.node();
|
|
2913
|
-
const nodeId = node.id;
|
|
2914
|
-
if (!nodeId) {
|
|
2915
|
-
return;
|
|
2916
|
-
}
|
|
2917
|
-
const config = ElementsComponents.AdornerManager.getRegisteredAdorner(
|
|
2918
|
-
ElementsComponents.AdornerManager.RegisteredAdorners.CONTAINER);
|
|
2919
|
-
const adorner = this.adorn(config);
|
|
2920
|
-
adorner.classList.add('container');
|
|
2921
|
-
|
|
2922
|
-
const onClick = ((() => {
|
|
2923
|
-
const model = node.domModel().overlayModel();
|
|
2924
|
-
if (adorner.isActive()) {
|
|
2925
|
-
model.highlightContainerQueryInPersistentOverlay(nodeId);
|
|
2926
|
-
Badges.UserBadges.instance().recordAction(Badges.BadgeAction.MODERN_DOM_BADGE_CLICKED);
|
|
2927
|
-
} else {
|
|
2928
|
-
model.hideContainerQueryInPersistentOverlay(nodeId);
|
|
2929
|
-
}
|
|
2930
|
-
}) as EventListener);
|
|
2931
|
-
|
|
2932
|
-
adorner.addInteraction(onClick, {
|
|
2933
|
-
isToggle: true,
|
|
2934
|
-
shouldPropagateOnKeydown: false,
|
|
2935
|
-
ariaLabelDefault: i18nString(UIStrings.enableScrollSnap),
|
|
2936
|
-
ariaLabelActive: i18nString(UIStrings.disableScrollSnap),
|
|
2937
|
-
});
|
|
2938
|
-
|
|
2939
|
-
node.domModel().overlayModel().addEventListener(
|
|
2940
|
-
SDK.OverlayModel.Events.PERSISTENT_CONTAINER_QUERY_OVERLAY_STATE_CHANGED, event => {
|
|
2941
|
-
const {nodeId: eventNodeId, enabled} = event.data;
|
|
2942
|
-
if (eventNodeId !== nodeId) {
|
|
2943
|
-
return;
|
|
2944
|
-
}
|
|
2945
|
-
adorner.toggle(enabled);
|
|
2946
|
-
});
|
|
2947
|
-
|
|
2948
|
-
this.#adorners.add(adorner);
|
|
2949
|
-
if (node.domModel().overlayModel().isHighlightedContainerQueryInPersistentOverlay(nodeId)) {
|
|
2950
|
-
adorner.toggle(true);
|
|
2951
|
-
}
|
|
2952
|
-
}
|
|
2953
|
-
|
|
2954
3002
|
pushMediaAdorner(): void {
|
|
2955
3003
|
const node = this.node();
|
|
2956
3004
|
const nodeId = node.id;
|
|
@@ -263,7 +263,7 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
263
263
|
return;
|
|
264
264
|
}
|
|
265
265
|
this.#currentHighlightedNode = null;
|
|
266
|
-
this.
|
|
266
|
+
this.performUpdate();
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
selectDOMNode(node: SDK.DOMModel.DOMNode|null, focus?: boolean): void {
|
|
@@ -299,6 +299,10 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
299
299
|
return this.#viewOutput.elementsTreeOutline;
|
|
300
300
|
}
|
|
301
301
|
|
|
302
|
+
treeElementForNode(node: SDK.DOMModel.DOMNode): ElementsTreeElement|null {
|
|
303
|
+
return this.#viewOutput.elementsTreeOutline?.findTreeElement(node) || null;
|
|
304
|
+
}
|
|
305
|
+
|
|
302
306
|
override performUpdate(): void {
|
|
303
307
|
this.#view(
|
|
304
308
|
{
|
|
@@ -358,7 +362,9 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
358
362
|
* FIXME: adorners should be part of the view input.
|
|
359
363
|
*/
|
|
360
364
|
updateNodeAdorners(node: SDK.DOMModel.DOMNode): void {
|
|
361
|
-
|
|
365
|
+
const element = this.#viewOutput.elementsTreeOutline?.findTreeElement(node);
|
|
366
|
+
void element?.updateStyleAdorners();
|
|
367
|
+
void element?.updateAdorners();
|
|
362
368
|
}
|
|
363
369
|
|
|
364
370
|
highlightMatch(node: SDK.DOMModel.DOMNode, query?: string): void {
|
|
@@ -2007,6 +2013,7 @@ export class ElementsTreeOutline extends
|
|
|
2007
2013
|
const treeElement = this.treeElementByNode.get(node);
|
|
2008
2014
|
if (treeElement && isOpeningTag(treeElement.tagTypeContext)) {
|
|
2009
2015
|
void treeElement.updateStyleAdorners();
|
|
2016
|
+
void treeElement.updateAdorners();
|
|
2010
2017
|
}
|
|
2011
2018
|
}
|
|
2012
2019
|
}
|
|
@@ -37,7 +37,7 @@ import * as Common from '../../core/common/common.js';
|
|
|
37
37
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
38
38
|
import type * as SDK from '../../core/sdk/sdk.js';
|
|
39
39
|
import * as Adorners from '../../ui/components/adorners/adorners.js';
|
|
40
|
-
import
|
|
40
|
+
import {createIcon} from '../../ui/kit/kit.js';
|
|
41
41
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
42
42
|
|
|
43
43
|
import * as ElementsComponents from './components/components.js';
|
|
@@ -77,7 +77,7 @@ export class ShortcutTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
77
77
|
ElementsComponents.AdornerManager.RegisteredAdorners.REVEAL);
|
|
78
78
|
const name = config.name;
|
|
79
79
|
const adornerContent = document.createElement('span');
|
|
80
|
-
const linkIcon =
|
|
80
|
+
const linkIcon = createIcon('select-element');
|
|
81
81
|
const slotText = document.createElement('span');
|
|
82
82
|
slotText.textContent = name;
|
|
83
83
|
adornerContent.append(linkIcon);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import {createIcon} from '../../ui/kit/kit.js';
|
|
7
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
8
|
|
|
9
9
|
import type * as ElementsComponents from './components/components.js';
|
|
@@ -120,7 +120,7 @@ export class StyleEditorWidget extends UI.Widget.VBox {
|
|
|
120
120
|
static createTriggerButton(
|
|
121
121
|
pane: StylesSidebarPane, section: StylePropertiesSection, editorClass: {new(): Editor}, buttonTitle: string,
|
|
122
122
|
triggerKey: string): HTMLElement {
|
|
123
|
-
const triggerButton =
|
|
123
|
+
const triggerButton = createIcon('flex-wrap', 'styles-pane-button');
|
|
124
124
|
triggerButton.title = buttonTitle;
|
|
125
125
|
triggerButton.role = 'button';
|
|
126
126
|
|
|
@@ -14,8 +14,8 @@ import * as Badges from '../../models/badges/badges.js';
|
|
|
14
14
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
15
15
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
16
16
|
import type * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
|
17
|
-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
18
17
|
import * as Tooltips from '../../ui/components/tooltips/tooltips.js';
|
|
18
|
+
import {createIcon, Icon} from '../../ui/kit/kit.js';
|
|
19
19
|
import * as ColorPicker from '../../ui/legacy/components/color_picker/color_picker.js';
|
|
20
20
|
import * as InlineEditor from '../../ui/legacy/components/inline_editor/inline_editor.js';
|
|
21
21
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
@@ -1134,7 +1134,7 @@ export class LinkableNameRenderer extends rendererBase(SDK.CSSPropertyParserMatc
|
|
|
1134
1134
|
return;
|
|
1135
1135
|
}
|
|
1136
1136
|
|
|
1137
|
-
const icon =
|
|
1137
|
+
const icon = createIcon('animation', 'open-in-animations-panel');
|
|
1138
1138
|
icon.setAttribute('jslog', `${VisualLogging.link('open-in-animations-panel').track({click: true})}`);
|
|
1139
1139
|
icon.setAttribute('role', 'button');
|
|
1140
1140
|
icon.setAttribute('title', i18nString(UIStrings.jumpToAnimationsPanel));
|
|
@@ -1170,7 +1170,7 @@ export class BezierRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.B
|
|
|
1170
1170
|
return nodes;
|
|
1171
1171
|
}
|
|
1172
1172
|
const swatchPopoverHelper = this.#treeElement.parentPane().swatchPopoverHelper();
|
|
1173
|
-
const icon =
|
|
1173
|
+
const icon = createIcon('bezier-curve-filled', 'bezier-swatch-icon');
|
|
1174
1174
|
icon.setAttribute('jslog', `${VisualLogging.showStyleEditor('bezier')}`);
|
|
1175
1175
|
icon.tabIndex = -1;
|
|
1176
1176
|
icon.addEventListener('click', () => {
|
|
@@ -1954,7 +1954,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1954
1954
|
private expandedDueToFilter = false;
|
|
1955
1955
|
valueElement: HTMLElement|null = null;
|
|
1956
1956
|
nameElement: HTMLElement|null = null;
|
|
1957
|
-
private expandElement:
|
|
1957
|
+
private expandElement: Icon|null = null;
|
|
1958
1958
|
private originalPropertyText = '';
|
|
1959
1959
|
private hasBeenEditedIncrementally = false;
|
|
1960
1960
|
private prompt: CSSPropertyPrompt|null = null;
|
|
@@ -2338,7 +2338,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2338
2338
|
this.#tooltipKeyCounts.clear();
|
|
2339
2339
|
this.updateState();
|
|
2340
2340
|
if (this.isExpandable()) {
|
|
2341
|
-
this.expandElement =
|
|
2341
|
+
this.expandElement = createIcon('triangle-right', 'expand-icon');
|
|
2342
2342
|
this.expandElement.setAttribute('jslog', `${VisualLogging.expand().track({click: true})}`);
|
|
2343
2343
|
}
|
|
2344
2344
|
|
|
@@ -2641,7 +2641,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2641
2641
|
if (hint) {
|
|
2642
2642
|
const wrapper = document.createElement('span');
|
|
2643
2643
|
wrapper.classList.add('hint-wrapper');
|
|
2644
|
-
const hintIcon = new
|
|
2644
|
+
const hintIcon = new Icon();
|
|
2645
2645
|
hintIcon.name = 'info';
|
|
2646
2646
|
hintIcon.classList.add('hint', 'small');
|
|
2647
2647
|
hintIcon.tabIndex = -1;
|
|
@@ -44,7 +44,7 @@ import * as SDK from '../../core/sdk/sdk.js';
|
|
|
44
44
|
import * as Protocol from '../../generated/protocol.js';
|
|
45
45
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
46
46
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
47
|
-
import
|
|
47
|
+
import {createIcon, Icon} from '../../ui/kit/kit.js';
|
|
48
48
|
import * as InlineEditor from '../../ui/legacy/components/inline_editor/inline_editor.js';
|
|
49
49
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
50
50
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
@@ -1504,15 +1504,14 @@ export class SectionBlock {
|
|
|
1504
1504
|
readonly #titleElement: Element|null;
|
|
1505
1505
|
sections: StylePropertiesSection[];
|
|
1506
1506
|
#expanded = false;
|
|
1507
|
-
#icon:
|
|
1507
|
+
#icon: Icon|undefined;
|
|
1508
1508
|
constructor(titleElement: Element|null, expandable?: boolean, expandedByDefault?: boolean) {
|
|
1509
1509
|
this.#titleElement = titleElement;
|
|
1510
1510
|
this.sections = [];
|
|
1511
1511
|
this.#expanded = expandedByDefault ?? false;
|
|
1512
1512
|
|
|
1513
1513
|
if (expandable && titleElement instanceof HTMLElement) {
|
|
1514
|
-
this.#icon =
|
|
1515
|
-
IconButton.Icon.create(this.#expanded ? 'triangle-down' : 'triangle-right', 'section-block-expand-icon');
|
|
1514
|
+
this.#icon = createIcon(this.#expanded ? 'triangle-down' : 'triangle-right', 'section-block-expand-icon');
|
|
1516
1515
|
titleElement.classList.toggle('empty-section', !this.#expanded);
|
|
1517
1516
|
UI.ARIAUtils.setExpanded(titleElement, this.#expanded);
|
|
1518
1517
|
titleElement.appendChild(this.#icon);
|
|
@@ -1964,7 +1963,7 @@ export class CSSPropertyPrompt extends UI.TextPrompt.TextPrompt {
|
|
|
1964
1963
|
if (!iconInfo) {
|
|
1965
1964
|
continue;
|
|
1966
1965
|
}
|
|
1967
|
-
const icon = new
|
|
1966
|
+
const icon = new Icon();
|
|
1968
1967
|
icon.name = iconInfo.iconName;
|
|
1969
1968
|
icon.classList.add('extra-small');
|
|
1970
1969
|
icon.style.transform = `rotate(${iconInfo.rotate}deg) scale(${iconInfo.scaleX * 1.1}, ${iconInfo.scaleY * 1.1})`;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import * as Common from '../../core/common/common.js';
|
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
8
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
9
|
-
import
|
|
9
|
+
import {createIcon} from '../../ui/kit/kit.js';
|
|
10
10
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
11
11
|
|
|
12
12
|
import * as ElementsComponents from './components/components.js';
|
|
@@ -97,7 +97,7 @@ export class TopLayerContainer extends UI.TreeOutline.TreeElement {
|
|
|
97
97
|
ElementsComponents.AdornerManager.RegisteredAdorners.TOP_LAYER);
|
|
98
98
|
const adornerContent = document.createElement('span');
|
|
99
99
|
adornerContent.classList.add('adorner-with-icon');
|
|
100
|
-
const linkIcon =
|
|
100
|
+
const linkIcon = createIcon('select-element');
|
|
101
101
|
const adornerText = document.createElement('span');
|
|
102
102
|
adornerText.textContent = `top-layer (${topLayerElementIndex})`;
|
|
103
103
|
adornerContent.append(linkIcon);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
5
5
|
|
|
6
|
-
import '../../../ui/
|
|
6
|
+
import '../../../ui/kit/kit.js';
|
|
7
7
|
import '../../../ui/components/node_text/node_text.js';
|
|
8
8
|
|
|
9
9
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
5
5
|
|
|
6
|
-
import '../../../ui/
|
|
6
|
+
import '../../../ui/kit/kit.js';
|
|
7
7
|
|
|
8
8
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
9
9
|
import {html, render} from '../../../ui/lit/lit.js';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
5
5
|
|
|
6
|
-
import '../../../ui/
|
|
6
|
+
import '../../../ui/kit/kit.js';
|
|
7
7
|
import '../../../ui/components/node_text/node_text.js';
|
|
8
8
|
|
|
9
9
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
5
5
|
|
|
6
|
-
import '../../../ui/
|
|
6
|
+
import '../../../ui/kit/kit.js';
|
|
7
7
|
|
|
8
8
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
9
9
|
import * as Lit from '../../../ui/lit/lit.js';
|