import './iconPickerModal.component.scss'; import { AfterViewChecked } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { ConfigService, PartialProfile, PartialProfileGroup, Profile, ProfileGroup, ProfilesService } from 'tabby-core'; import { PickerIcon } from '../icons'; import { SidebarPlusNoticesService } from '../notices.service'; import { SidebarWorkspace } from '../configProvider'; import { SidebarPlusI18nService } from '../i18n'; /** * The icon picker — favorites, recents, search across the vendored icon sets * (including dashboard-icons' light/dark variants), a custom-SVG import, and * the per-tile favorite toggle — opened on a profile, a folder, or a * workspace, always exactly one of the three. * * A modal rather than the popup this started as, for the same reason as the * snippets and note editors: a search field, several scrolling grids and a * multi-line SVG field are a poor fit for a 260px box anchored to the cursor. * It used to carry its own positioning, screen-edge clamp and click-outside * handling for its per-tile favorite menu; the first two are moot once * NgbModal owns the box, and the favorite menu keeps only what a *nested* * floating element still needs — see iconMenuPositionDirty below. * * Deliberately loads nothing on open: `loadIconEntries()` is only awaited * from `onIconQueryChange()`, exactly as it was in the popup, so the 5MB * icon-set chunk still loads on the first search rather than on every open. */ export declare class IconPickerModalComponent implements AfterViewChecked { private config; private profilesService; private modalInstance; private i18n; private notices; /** Exactly one of the three is set, matching whichever menu opened the picker. */ profile: PartialProfile | null; group: PartialProfileGroup | null; workspace: SidebarWorkspace | null; iconQuery: string; iconMatches: PickerIcon[]; showCustomSvgInput: boolean; customSvgText: string; customSvgError: string | null; /** The icon a right-click opened the pin/unpin menu on, or null. */ iconMenuIcon: string | null; iconMenuX: number; iconMenuY: number; /** Set on open/move — checked once in ngAfterViewChecked(), same pattern as the tree's own popups (the DOM must have rendered the menu at its real size first). */ private iconMenuPositionDirty; private static readonly MAX_RECENT_ICONS; constructor(config: ConfigService, profilesService: ProfilesService, modalInstance: NgbActiveModal, i18n: SidebarPlusI18nService, notices: SidebarPlusNoticesService); ngAfterViewChecked(): void; private tMsg; get recentIcons(): string[]; get favoriteIcons(): string[]; isFavoriteIcon(icon: string): boolean; /** * Right-click on an icon tile. Its own open-state and its own * coordinates, kept apart from the modal's dismiss/close flow — closing * the picker itself must not be tangled with pinning a favorite. */ onIconContextMenu(event: MouseEvent, icon: string): void; closeIconMenu(): void; /** * Closes the favorite-toggle menu on any click outside it — including a * click elsewhere in the picker itself, which must survive (it is what * the menu acts upon). Checked on the click's target rather than a * descendant `(click)='$event.stopPropagation()'` binding, same reason * as the tree's own popups: those bindings don't reliably stop a * `document:click` listener from firing regardless (piège #15). */ onDocumentClick(event: MouseEvent): void; toggleFavoriteIconFromMenu(event: Event): void; toggleFavoriteIcon(icon: string, event: Event): void; onIconQueryChange(): Promise; toggleCustomSvgInput(): void; selectIconClass(iconClass: string): Promise; /** * A tile's small variant dots (dashboard-icons' light/dark palettes, see * icons.ts) — deliberately its own handler rather than reusing * selectIconClass() with a different argument, so the click can be * stopped from also bubbling into the tile's own (click), which would * immediately re-apply the tile's *default* variant right after this * one. */ selectIconVariant(value: string, event: Event): Promise; applyCustomSvg(): Promise; private applyIcon; /** Offered only for a workspace — folders/profiles have no equivalent "back to no icon" entry to mirror (see the *ngIf gating it in the template). */ clearWorkspaceIcon(): Promise; private recordRecentIcon; close(): void; }