@posiwise/shared-components 0.0.199 → 0.0.200

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posiwise/shared-components",
3
- "version": "0.0.199",
3
+ "version": "0.0.200",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.2.19",
6
6
  "@angular/core": "^21.2.19",
@@ -1,10 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Type, OnInit, OnDestroy, ChangeDetectorRef, TemplateRef, ElementRef, EventEmitter, Injector, AfterViewInit, OnChanges, SimpleChanges, ViewContainerRef, AfterContentInit, PipeTransform } from '@angular/core';
2
+ import { Type, OnInit, AfterViewInit, OnDestroy, ChangeDetectorRef, TemplateRef, ElementRef, EventEmitter, Injector, OnChanges, SimpleChanges, ViewContainerRef, AfterContentInit, PipeTransform } from '@angular/core';
3
3
  import * as i35 from '@angular/router';
4
4
  import { Router } from '@angular/router';
5
5
  import { AppConfigService } from '@posiwise/app-config-service';
6
- import { NavEntry, NavigationIndexService, DashboardService, AuthService, MCPFieldDiff, BrainVoiceService, VoiceChatService, MCPOrchestratorService, LocalStorage, BrainSocketService, GroupService, SubscriptionService, DataService, NumberPickerService, FeatureFlagService, UserService, PermissionService, MainApiHttpService } from '@posiwise/common-services';
6
+ import { NavEntry, NavigationIndexService, DashboardService, RecentPagesService, CustomToastService, AuthService, MCPFieldDiff, BrainVoiceService, VoiceChatService, MCPOrchestratorService, LocalStorage, BrainSocketService, GroupService, SubscriptionService, DataService, NumberPickerService, FeatureFlagService, UserService, PermissionService, MainApiHttpService } from '@posiwise/common-services';
7
7
  export { NavEntry } from '@posiwise/common-services';
8
+ import { TranslocoService } from '@jsverse/transloco';
8
9
  import * as rxjs from 'rxjs';
9
10
  import { Observable } from 'rxjs';
10
11
  import * as i36 from '@ng-bootstrap/ng-bootstrap';
@@ -187,9 +188,16 @@ declare class CollapsibleSidebarService {
187
188
  * What activating a palette row does:
188
189
  * - `page` → router navigation to `path`
189
190
  * - `person` → router navigation to a user's profile
191
+ * - `action` → run a named command (see `PaletteActionId`)
190
192
  * - `ask-ai` → hand the typed query to the PosiWise Brain panel
191
193
  */
192
- type PaletteItemKind = 'page' | 'person' | 'ask-ai';
194
+ type PaletteItemKind = 'page' | 'person' | 'action' | 'ask-ai';
195
+ /**
196
+ * Commands the palette can run itself, for the things a user repeats that are not
197
+ * a destination. Kept to a closed union so a row can never carry an arbitrary
198
+ * callback across the source boundary.
199
+ */
200
+ type PaletteActionId = 'copy-link' | 'log-out';
193
201
  interface PaletteItem {
194
202
  /** Stable within a render pass; used for trackBy and active-row identity. */
195
203
  id: string;
@@ -206,6 +214,16 @@ interface PaletteItem {
206
214
  * the index whether opening it needs a subscription-context switch first.
207
215
  */
208
216
  entry?: NavEntry;
217
+ /**
218
+ * i18n key for rows whose label is chrome rather than data (actions).
219
+ *
220
+ * `label` still holds the resolved text so ranking can match what the user
221
+ * reads; the key is kept so the template renders the translation rather than
222
+ * a string frozen at build time.
223
+ */
224
+ labelKey?: string;
225
+ /** Present for `action` rows only. */
226
+ action?: PaletteActionId;
209
227
  }
210
228
  interface PaletteGroup {
211
229
  /** i18n key for the group heading — the chrome IS translated (C17). */
@@ -239,44 +257,51 @@ declare class CommandPaletteService {
239
257
  static ɵprov: i0.ɵɵInjectableDeclaration<CommandPaletteService>;
240
258
  }
241
259
 
242
- declare class CommandPaletteComponent implements OnInit, OnDestroy {
260
+ declare class CommandPaletteComponent implements OnInit, AfterViewInit, OnDestroy {
243
261
  readonly palette: CommandPaletteService;
244
262
  private readonly navIndex;
245
263
  private readonly dashboard;
264
+ private readonly recents;
246
265
  private readonly sidebar;
247
266
  private readonly router;
267
+ private readonly transloco;
248
268
  private readonly cdr;
249
269
  private readonly appConfigService?;
270
+ private readonly toast?;
250
271
  queryInput?: {
251
272
  nativeElement: HTMLInputElement;
252
273
  };
274
+ /** The native <dialog>; always in the DOM, so this handle stays valid. */
275
+ paletteDialog?: {
276
+ nativeElement: HTMLDialogElement;
277
+ };
253
278
  isOpen: boolean;
254
279
  query: string;
255
280
  groups: PaletteGroup[];
256
- activeIndex: number;
257
- /** White-label brand for the Ask row; reuses the Brain panel's resolver. */
258
281
  brandName: string;
259
- /** Rendered in the trigger chip — the real key differs per platform. */
260
282
  readonly shortcutHint: string;
283
+ private readonly cursor;
284
+ private flat;
261
285
  private readonly queryChanges;
262
286
  private readonly destroy$;
263
287
  private people;
264
- constructor(palette: CommandPaletteService, navIndex: NavigationIndexService, dashboard: DashboardService, sidebar: CollapsibleSidebarService, router: Router, cdr: ChangeDetectorRef, appConfigService?: AppConfigService);
288
+ private releaseBackdrop;
289
+ constructor(palette: CommandPaletteService, navIndex: NavigationIndexService, dashboard: DashboardService, recents: RecentPagesService, sidebar: CollapsibleSidebarService, router: Router, transloco: TranslocoService, cdr: ChangeDetectorRef, appConfigService?: AppConfigService, toast?: CustomToastService);
265
290
  ngOnInit(): void;
291
+ ngAfterViewInit(): void;
266
292
  ngOnDestroy(): void;
293
+ /** A native close (Escape, or our own close()) mirrored back onto the service. */
294
+ onDialogClose(): void;
267
295
  /** ⌘K / Ctrl-K opens from anywhere; Escape closes. */
268
296
  onDocumentKeydown(event: KeyboardEvent): void;
269
297
  onQueryInput(value: string): void;
270
298
  onKeydown(event: KeyboardEvent): void;
271
299
  activate(item?: PaletteItem): void;
272
- close(): void;
273
300
  isActive(item: PaletteItem): boolean;
274
- trackById(_index: number, item: PaletteItem): string;
275
- private move;
276
- private fetchPeople;
301
+ private activateDeps;
277
302
  private rebuild;
278
303
  private reset;
279
- static ɵfac: i0.ɵɵFactoryDeclaration<CommandPaletteComponent, [null, null, null, null, null, null, { optional: true; }]>;
304
+ static ɵfac: i0.ɵɵFactoryDeclaration<CommandPaletteComponent, [null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }]>;
280
305
  static ɵcmp: i0.ɵɵComponentDeclaration<CommandPaletteComponent, "pw-command-palette", never, {}, {}, never, never, false, never>;
281
306
  }
282
307
 
@@ -1501,11 +1526,20 @@ declare class PwCookieBannerComponent implements OnInit {
1501
1526
 
1502
1527
  /**
1503
1528
  * Converts a Brain assistant message string (containing a safe subset of
1504
- * Markdown) into a `SafeHtml` value suitable for `[innerHTML]` binding.
1529
+ * Markdown) into an HTML string suitable for `[innerHTML]` binding.
1530
+ *
1531
+ * Deliberately returns a plain `string`, NOT a `SafeHtml`: Angular sanitizes any
1532
+ * string bound to `[innerHTML]`, so the output passes through DomSanitizer on
1533
+ * the way to the DOM. `renderMarkdown` already HTML-escapes every user-sourced
1534
+ * fragment and allow-lists hrefs, which makes this defence in depth rather than
1535
+ * a substitute — two independent passes, neither trusting the other.
1505
1536
  *
1506
- * All user-sourced text is HTML-escaped by `renderMarkdown` before reaching
1507
- * DomSanitizer, so `bypassSecurityTrustHtml` is safe here — we are trusting
1508
- * our own sanitized output, not arbitrary user input.
1537
+ * Nothing is lost by it. The renderer only emits `<a href target rel>`,
1538
+ * `<strong>`, `<em>` and `<br>`; Angular's own allow-lists carry `href`
1539
+ * (URI_ATTRS) and `rel`/`target` (HTML_ATTRS), so sanitized output is
1540
+ * byte-identical to the rendered input. An earlier revision reached for
1541
+ * `bypassSecurityTrustHtml` here, which bought nothing and disabled the
1542
+ * platform's last line of defence if the renderer ever regressed.
1509
1543
  *
1510
1544
  * Applied only to assistant bubbles; user bubbles keep plain-text rendering.
1511
1545
  *
@@ -1517,12 +1551,17 @@ declare class PwCookieBannerComponent implements OnInit {
1517
1551
  * config resolves at app boot, long before a chat bubble renders.
1518
1552
  */
1519
1553
  declare class SafeMarkdownPipe implements PipeTransform, OnDestroy {
1520
- private readonly sanitizer;
1554
+ private readonly navigationIndex;
1521
1555
  private baseUrl;
1522
1556
  private readonly configSub;
1523
- constructor(sanitizer: DomSanitizer, appConfigService: AppConfigService);
1557
+ constructor(navigationIndex: NavigationIndexService, appConfigService: AppConfigService);
1524
1558
  ngOnDestroy(): void;
1525
- transform(text: string): SafeHtml;
1559
+ transform(text: string): string;
1560
+ /**
1561
+ * Every page the palette can reach, used to correct a path the model got
1562
+ * nearly right. An unknown path is left alone, never suppressed.
1563
+ */
1564
+ private knownPaths;
1526
1565
  /**
1527
1566
  * Slug the router scopes dashboard pages under (`:slug/faq/:id`). Read per
1528
1567
  * call rather than cached: the user can switch subscription mid-session.
@@ -1607,4 +1646,4 @@ declare function registeredType(type: string): Type<unknown> | null;
1607
1646
  declare function registeredTypeNames(): string[];
1608
1647
 
1609
1648
  export { AuthenticatorComponent, COMPONENT_REGISTRY, ClearBitIconComponent, CollapsibleSidebarComponent, CollapsibleSidebarKeyboardShortcutDirective, CollapsibleSidebarService, CollapsibleSidebarSuperAdminGuard, CollapsibleSidebarTriggerDirective, ComingSoonComponent, CommandPaletteComponent, CommandPaletteService, CompletionBarComponent, ConfirmDialogComponent, ConfirmDialogService, DateRangePickerComponent, DynamicPageContextService, EntityGroupComponent, GroupDefinitionComponent, GroupsComponent, HeaderComponent, InputContainerComponent, LandingPageFooterBComponent, NoDataComponent, NumberPickerComponent, PasswordValidationComponent, PermissionTreeComponent, PrivacyAndTosComponent, PrivacyPolicyComponent, PwBrainChatComponent, PwCookieBannerComponent, PwDynamicPageComponent, PwTabsComponent, RecordsSummaryComponent, ResourceSharedComponentsModule, SharedComponentsModule, SplashComponent, TermsConditionsComponent, UI_BUILDER_FLAG, UiLayoutService, registeredType, registeredTypeNames };
1610
- export type { ChatMessage, ChatMessageRole, CompletionTier, ConfirmDeleteOptions, ConfirmDialogConfig, ConfirmDialogTone, DynamicPageContext, PaletteGroup, PaletteItem, PaletteItemKind, PalettePerson, PendingConfirmation, ResolvedBinding, SidebarContent, SidebarHeaderAction, UiBinding, UiBlock, UiGrid, UiLayoutConfig, UiLayoutResponse };
1649
+ export type { ChatMessage, ChatMessageRole, CompletionTier, ConfirmDeleteOptions, ConfirmDialogConfig, ConfirmDialogTone, DynamicPageContext, PaletteActionId, PaletteGroup, PaletteItem, PaletteItemKind, PalettePerson, PendingConfirmation, ResolvedBinding, SidebarContent, SidebarHeaderAction, UiBinding, UiBlock, UiGrid, UiLayoutConfig, UiLayoutResponse };