@@ -42,7 +42,6 @@ import { ITelemetryService } from '../../../../platform/telemetry/common/telemet
4242import { defaultCheckboxStyles } from '../../../../platform/theme/browser/defaultStyles.js' ;
4343import { buttonForeground , buttonHoverBackground , editorBackground , textLinkActiveForeground , textLinkForeground } from '../../../../platform/theme/common/colorRegistry.js' ;
4444import { IColorTheme , ICssStyleCollector , IThemeService , registerThemingParticipant } from '../../../../platform/theme/common/themeService.js' ;
45- import { IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.js' ;
4645import { EditorPane } from '../../../browser/parts/editor/editorPane.js' ;
4746import { IEditorOpenContext } from '../../../common/editor.js' ;
4847import { ExtensionFeaturesTab } from './extensionFeaturesTab.js' ;
@@ -73,18 +72,15 @@ import {
7372} from './extensionsActions.js' ;
7473import { Delegate } from './extensionsList.js' ;
7574import { ExtensionData , ExtensionsGridView , ExtensionsTree , getExtensions } from './extensionsViewer.js' ;
76- import { ExtensionRecommendationWidget , ExtensionStatusWidget , ExtensionWidget , InstallCountWidget , RatingsWidget , RemoteBadgeWidget , SponsorWidget , VerifiedPublisherWidget , onClick } from './extensionsWidgets.js' ;
75+ import { ExtensionRecommendationWidget , ExtensionStatusWidget , ExtensionWidget , InstallCountWidget , RatingsWidget , RemoteBadgeWidget , SponsorWidget , PublisherWidget , onClick , ExtensionKindIndicatorWidget } from './extensionsWidgets.js' ;
7776import { ExtensionContainers , ExtensionEditorTab , ExtensionState , IExtension , IExtensionContainer , IExtensionsWorkbenchService } from '../common/extensions.js' ;
7877import { ExtensionsInput , IExtensionEditorOptions } from '../common/extensionsInput.js' ;
79- import { IExplorerService } from '../../files/browser/files.js' ;
8078import { DEFAULT_MARKDOWN_STYLES , renderMarkdownDocument } from '../../markdown/browser/markdownDocumentRenderer.js' ;
8179import { IWebview , IWebviewService , KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED } from '../../webview/browser/webview.js' ;
8280import { IEditorGroup } from '../../../services/editor/common/editorGroupsService.js' ;
8381import { IEditorService } from '../../../services/editor/common/editorService.js' ;
8482import { IExtensionRecommendationsService } from '../../../services/extensionRecommendations/common/extensionRecommendations.js' ;
8583import { IExtensionService } from '../../../services/extensions/common/extensions.js' ;
86- import { IViewsService } from '../../../services/views/common/viewsService.js' ;
87- import { VIEW_ID as EXPLORER_VIEW_ID } from '../../files/common/files.js' ;
8884import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js' ;
8985import { IHoverService } from '../../../../platform/hover/browser/hover.js' ;
9086import { ByteSize , IFileService } from '../../../../platform/files/common/files.js' ;
@@ -161,11 +157,6 @@ interface IExtensionEditorTemplate {
161157 name : HTMLElement ;
162158 preview : HTMLElement ;
163159 builtin : HTMLElement ;
164- publisher : HTMLElement ;
165- publisherDisplayName : HTMLElement ;
166- resource : HTMLElement ;
167- installCount : HTMLElement ;
168- rating : HTMLElement ;
169160 description : HTMLElement ;
170161 actionsAndStatusContainer : HTMLElement ;
171162 extensionActionBar : ActionBar ;
@@ -257,10 +248,6 @@ export class ExtensionEditor extends EditorPane {
257248 @ILanguageService private readonly languageService : ILanguageService ,
258249 @IContextMenuService private readonly contextMenuService : IContextMenuService ,
259250 @IContextKeyService private readonly contextKeyService : IContextKeyService ,
260- @IWorkspaceContextService private readonly contextService : IWorkspaceContextService ,
261- @IExplorerService private readonly explorerService : IExplorerService ,
262- @IViewsService private readonly viewsService : IViewsService ,
263- @IUriIdentityService private readonly uriIdentityService : IUriIdentityService ,
264251 @IHoverService private readonly hoverService : IHoverService ,
265252 ) {
266253 super ( ExtensionEditor . ID , group , telemetryService , themeService , storageService ) ;
@@ -302,29 +289,33 @@ export class ExtensionEditor extends EditorPane {
302289 builtin . textContent = localize ( 'builtin' , "Built-in" ) ;
303290
304291 const subtitle = append ( details , $ ( '.subtitle' ) ) ;
305- const publisher = append ( append ( subtitle , $ ( '.subtitle-entry' ) ) , $ ( '.publisher.clickable' , { tabIndex : 0 } ) ) ;
306- publisher . setAttribute ( 'role' , 'button' ) ;
307- const publisherDisplayName = append ( publisher , $ ( '.publisher-name' ) ) ;
308- const verifiedPublisherWidget = this . instantiationService . createInstance ( VerifiedPublisherWidget , append ( publisher , $ ( '.verified-publisher' ) ) , false ) ;
292+ const subTitleEntryContainers : HTMLElement [ ] = [ ] ;
293+
294+ const publisherContainer = append ( subtitle , $ ( '.subtitle-entry' ) ) ;
295+ subTitleEntryContainers . push ( publisherContainer ) ;
296+ const publisherWidget = this . instantiationService . createInstance ( PublisherWidget , publisherContainer , false ) ;
309297
310- const resource = append ( append ( subtitle , $ ( '.subtitle-entry.resource' ) ) , $ ( '' , { tabIndex : 0 } ) ) ;
311- resource . setAttribute ( 'role' , 'button' ) ;
298+ const extensionKindContainer = append ( subtitle , $ ( '.subtitle-entry' ) ) ;
299+ subTitleEntryContainers . push ( extensionKindContainer ) ;
300+ const extensionKindWidget = this . instantiationService . createInstance ( ExtensionKindIndicatorWidget , extensionKindContainer , false ) ;
312301
313- const installCount = append ( append ( subtitle , $ ( '.subtitle-entry' ) ) , $ ( 'span.install' , { tabIndex : 0 } ) ) ;
314- this . _register ( this . hoverService . setupManagedHover ( getDefaultHoverDelegate ( 'mouse' ) , installCount , localize ( 'install count' , "Install count" ) ) ) ;
315- const installCountWidget = this . instantiationService . createInstance ( InstallCountWidget , installCount , false ) ;
302+ const installCountContainer = append ( subtitle , $ ( '.subtitle-entry' ) ) ;
303+ subTitleEntryContainers . push ( installCountContainer ) ;
304+ const installCountWidget = this . instantiationService . createInstance ( InstallCountWidget , installCountContainer , false ) ;
316305
317- const rating = append ( append ( subtitle , $ ( '.subtitle-entry' ) ) , $ ( 'span.rating.clickable' , { tabIndex : 0 } ) ) ;
318- this . _register ( this . hoverService . setupManagedHover ( getDefaultHoverDelegate ( 'mouse' ) , rating , localize ( 'rating' , "Rating" ) ) ) ;
319- rating . setAttribute ( 'role' , 'link' ) ; // #132645
320- const ratingsWidget = this . instantiationService . createInstance ( RatingsWidget , rating , false ) ;
306+ const ratingsContainer = append ( subtitle , $ ( '.subtitle-entry' ) ) ;
307+ subTitleEntryContainers . push ( ratingsContainer ) ;
308+ const ratingsWidget = this . instantiationService . createInstance ( RatingsWidget , ratingsContainer , false ) ;
321309
322- const sponsorWidget = this . instantiationService . createInstance ( SponsorWidget , append ( subtitle , $ ( '.subtitle-entry' ) ) ) ;
310+ const sponsorContainer = append ( subtitle , $ ( '.subtitle-entry' ) ) ;
311+ subTitleEntryContainers . push ( sponsorContainer ) ;
312+ const sponsorWidget = this . instantiationService . createInstance ( SponsorWidget , sponsorContainer ) ;
323313
324314 const widgets : ExtensionWidget [ ] = [
325315 remoteBadge ,
326316 versionWidget ,
327- verifiedPublisherWidget ,
317+ publisherWidget ,
318+ extensionKindWidget ,
328319 installCountWidget ,
329320 ratingsWidget ,
330321 sponsorWidget ,
@@ -440,18 +431,23 @@ export class ExtensionEditor extends EditorPane {
440431 header,
441432 icon,
442433 iconContainer,
443- installCount,
444434 name,
445435 navbar,
446436 preview,
447- publisher,
448- publisherDisplayName,
449- resource,
450- rating,
451437 actionsAndStatusContainer,
452438 extensionActionBar,
453439 set extension ( extension : IExtension ) {
454440 extensionContainers . extension = extension ;
441+ let lastNonEmptySubtitleEntryContainer ;
442+ for ( const subTitleEntryElement of subTitleEntryContainers ) {
443+ subTitleEntryElement . classList . remove ( 'last-non-empty' ) ;
444+ if ( subTitleEntryElement . children . length > 0 ) {
445+ lastNonEmptySubtitleEntryContainer = subTitleEntryElement ;
446+ }
447+ }
448+ if ( lastNonEmptySubtitleEntryContainer ) {
449+ lastNonEmptySubtitleEntryContainer . classList . add ( 'last-non-empty' ) ;
450+ }
455451 } ,
456452 set gallery ( gallery : IGalleryExtension | null ) {
457453 versionWidget . gallery = gallery ;
@@ -559,41 +555,8 @@ export class ExtensionEditor extends EditorPane {
559555
560556 template . description . textContent = extension . description ;
561557
562- // subtitle
563- template . publisher . classList . toggle ( 'clickable' , ! ! extension . url ) ;
564- template . publisherDisplayName . textContent = extension . publisherDisplayName ;
565- template . publisher . parentElement ?. classList . toggle ( 'hide' , ! ! extension . resourceExtension || extension . local ?. source === 'resource' ) ;
566- this . transientDisposables . add ( this . hoverService . setupManagedHover ( getDefaultHoverDelegate ( 'mouse' ) , template . publisher , localize ( 'publisher' , "Publisher ({0})" , extension . publisher ) ) ) ;
567-
568- const location = extension . resourceExtension ?. location ?? ( extension . local ?. source === 'resource' ? extension . local ?. location : undefined ) ;
569- template . resource . parentElement ?. classList . toggle ( 'hide' , ! location ) ;
570- if ( location ) {
571- const workspaceFolder = this . contextService . getWorkspaceFolder ( location ) ;
572- if ( workspaceFolder && extension . isWorkspaceScoped ) {
573- template . resource . parentElement ?. classList . add ( 'clickable' ) ;
574- this . transientDisposables . add ( this . hoverService . setupManagedHover ( getDefaultHoverDelegate ( 'mouse' ) , template . resource , this . uriIdentityService . extUri . relativePath ( workspaceFolder . uri , location ) ) ) ;
575- template . resource . textContent = localize ( 'workspace extension' , "Workspace Extension" ) ;
576- this . transientDisposables . add ( onClick ( template . resource , ( ) => {
577- this . viewsService . openView ( EXPLORER_VIEW_ID , true ) . then ( ( ) => this . explorerService . select ( location , true ) ) ;
578- } ) ) ;
579- } else {
580- template . resource . parentElement ?. classList . remove ( 'clickable' ) ;
581- this . transientDisposables . add ( this . hoverService . setupManagedHover ( getDefaultHoverDelegate ( 'mouse' ) , template . resource , location . path ) ) ;
582- template . resource . textContent = localize ( 'local extension' , "Local Extension" ) ;
583- }
584- }
585-
586- template . installCount . parentElement ?. classList . toggle ( 'hide' , ! extension . url ) ;
587- template . rating . parentElement ?. classList . toggle ( 'hide' , ! extension . url ) ;
588- template . rating . classList . toggle ( 'clickable' , ! ! extension . url ) ;
589-
590558 if ( extension . url ) {
591559 this . transientDisposables . add ( onClick ( template . name , ( ) => this . openerService . open ( URI . parse ( extension . url ! ) ) ) ) ;
592- this . transientDisposables . add ( onClick ( template . publisher , ( ) => this . extensionsWorkbenchService . openSearch ( `publisher:"${ extension . publisherDisplayName } "` ) ) ) ;
593- }
594-
595- if ( extension . ratingUrl ) {
596- this . transientDisposables . add ( onClick ( template . rating , ( ) => this . openerService . open ( URI . parse ( extension . ratingUrl ! ) ) ) ) ;
597560 }
598561
599562 const manifest = await this . extensionManifest . get ( ) . promise ;
0 commit comments