@posiwise/shared-components 0.0.228 → 0.0.230

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.228",
3
+ "version": "0.0.230",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.2.0",
6
6
  "@angular/core": "^22.2.0",
@@ -1,43 +1,41 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import { AfterContentInit, AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, InjectionToken, Injector, OnChanges, OnDestroy, OnInit, PipeTransform, SimpleChanges, TemplateRef, Type, ViewContainerRef } from "@angular/core";
3
- import { AuthService, BaseHttpService, BrainSocketService, BrainVoiceService, CustomToastService, DashboardService, DataService, DirectUploadService, FeatureFlagService, GroupService, KnowledgeFile, KnowledgeFilesService, KnowledgeScope, LocalStorage, MCPFieldDiff, MCPOrchestratorService, MCPUploadCapability, MainApiHttpService, NavEntry, NavigationIndexService, NumberPickerService, PermissionService, RecentPagesService, SubscriptionService, UserService, VoiceChatService } from "@posiwise/common-services";
4
- import * as i44 from "primeng/table";
3
+ import { AuthService, BaseHttpService, BrainSocketService, BrainVoiceService, CustomToastService, DashboardService, DataService, DirectUploadService, FeatureFlagService, GroupService, KnowledgeFile, KnowledgeFilesService, KnowledgeScope, LegalPagesService, LegalTab, LocalStorage, MCPFieldDiff, MCPOrchestratorService, MCPUploadCapability, MainApiHttpService, NavEntry, NavigationIndexService, NumberPickerService, PermissionService, RecentPagesService, SubscriptionService, UserService, VoiceChatService } from "@posiwise/common-services";
4
+ import * as i42 from "primeng/table";
5
5
  import { Table } from "primeng/table";
6
6
  import { TranslocoService } from "@jsverse/transloco";
7
7
  import * as i14 from "@ng-bootstrap/ng-bootstrap";
8
8
  import { NgbActiveModal, NgbModal } from "@ng-bootstrap/ng-bootstrap";
9
9
  import * as i8 from "@angular/router";
10
- import { Router } from "@angular/router";
10
+ import { Route, Router, Routes } from "@angular/router";
11
11
  import { AppConfigService } from "@posiwise/app-config-service";
12
12
  import { Observable, Subject } from "rxjs";
13
13
  import { AppBaseComponent } from "@posiwise/app-base-component";
14
14
  import { MenuItem } from "primeng/api";
15
15
  import moment from "moment";
16
- import * as i53 from "ngx-daterangepicker-material";
16
+ import * as i51 from "ngx-daterangepicker-material";
17
17
  import { DaterangepickerDirective } from "ngx-daterangepicker-material";
18
- import { DomSanitizer, SafeHtml } from "@angular/platform-browser";
19
- import { AdminService } from "@posiwise/admin-module-utils";
20
- import { Subscription, User } from "@posiwise/common-utilities";
21
18
  import { AppState } from "@posiwise/app-store";
22
19
  import { Store } from "@ngrx/store";
20
+ import { Subscription, User } from "@posiwise/common-utilities";
23
21
  import * as i7 from "@angular/forms";
24
22
  import { AbstractControl, ControlContainer, UntypedFormBuilder, UntypedFormGroup } from "@angular/forms";
25
- import * as i35 from "primeng/iconfield";
26
- import * as i36 from "primeng/inputicon";
27
- import * as i37 from "primeng/inputtext";
23
+ import * as i33 from "primeng/iconfield";
24
+ import * as i34 from "primeng/inputicon";
25
+ import * as i35 from "primeng/inputtext";
28
26
  import * as i10 from "@posiwise/app-loader";
29
27
  import * as i12 from "@posiwise/directives";
30
28
  import * as i11 from "@posiwise/core-transloco";
31
29
  import * as i15 from "primeng/tooltip";
32
- import * as i45 from "primeng/tabs";
30
+ import * as i43 from "primeng/tabs";
33
31
  import * as i13 from "primeng/button";
34
- import * as i47 from "primeng/select";
35
- import * as i48 from "primeng/multiselect";
32
+ import * as i45 from "primeng/select";
33
+ import * as i46 from "primeng/multiselect";
36
34
  import * as i16 from "primeng/progressspinner";
37
35
  import * as i17 from "primeng/autocomplete";
38
- import * as i51 from "ngx-image-cropper";
39
- import * as i52 from "ngx-ui-switch";
40
- import * as i54 from "@posiwise/pipes";
36
+ import * as i49 from "ngx-image-cropper";
37
+ import * as i50 from "ngx-ui-switch";
38
+ import * as i52 from "@posiwise/pipes";
41
39
  import * as i6 from "@angular/common";
42
40
  import * as i19 from "@posiwise/utils";
43
41
  import { IconDefinition } from "@fortawesome/free-solid-svg-icons";
@@ -346,10 +344,12 @@ export interface PaletteItem {
346
344
  /** Stable within a render pass; used for trackBy and active-row identity. */
347
345
  id: string;
348
346
  kind: PaletteItemKind;
349
- /** Already-resolved display text (menu titles and names are not i18n'd). */
347
+ /** Raw display text, used for ranking; rendered unless `labelKey` is set. */
350
348
  label: string;
351
349
  /** Secondary context line — breadcrumb section, or a person's email. */
352
350
  detail: string;
351
+ /** i18n key for `detail` when the section is chrome (account entries). */
352
+ detailKey?: string;
353
353
  icon: string;
354
354
  /** Present for `page` and `person`; absent for `ask-ai`. */
355
355
  path?: string;
@@ -359,7 +359,8 @@ export interface PaletteItem {
359
359
  */
360
360
  entry?: NavEntry;
361
361
  /**
362
- * i18n key for rows whose label is chrome rather than data (actions).
362
+ * i18n key for rows whose label is chrome rather than data (actions, and
363
+ * page rows whose menu item or account entry carries a key).
363
364
  *
364
365
  * `label` still holds the resolved text so ranking can match what the user
365
366
  * reads; the key is kept so the template renders the translation rather than
@@ -647,27 +648,21 @@ export declare class PermissionTreeComponent implements AfterViewInit, OnChanges
647
648
  declare namespace privacy_and_tos_component_d_exports {
648
649
  export { PrivacyAndTosComponent };
649
650
  }
651
+ /**
652
+ * Public routes (`data.public`) show the policy at `/privacy-policy[/:slug]`; without a slug, the
653
+ * visitor's domain default. Signed-in pages and the embedded `[productId]` use show the policy of
654
+ * that product, resolved to a slug so the id never reaches a URL; with no signed-in user they fall
655
+ * back to the domain default rather than waiting forever.
656
+ */
650
657
  export declare class PrivacyAndTosComponent extends AppBaseComponent implements OnInit {
651
- private readonly adminService;
652
- private readonly document;
653
- private readonly sanitizer;
658
+ private readonly legalPages;
654
659
  private readonly cdr;
655
660
  productId: number;
656
- private privacyAndTos;
657
- id: string;
658
661
  data: {
659
- privacy?: SafeHtml;
660
- tos?: SafeHtml;
662
+ privacy?: string;
663
+ tos?: string;
661
664
  tos_updated_at?: string;
662
665
  };
663
- user: User;
664
- subscribedSubscriptions: {
665
- products: {
666
- id: number;
667
- }[];
668
- }[];
669
- product: string;
670
- productName: string;
671
666
  privacyServiceId: number;
672
667
  readonly routers: {
673
668
  globalConfigDetails: string;
@@ -707,7 +702,7 @@ export declare class PrivacyAndTosComponent extends AppBaseComponent implements
707
702
  posts: string;
708
703
  resourcesList: string;
709
704
  };
710
- tabId: string;
705
+ tabId: LegalTab;
711
706
  isPublic: boolean;
712
707
  isLoaded: boolean;
713
708
  tocPrivacy: {
@@ -718,17 +713,18 @@ export declare class PrivacyAndTosComponent extends AppBaseComponent implements
718
713
  id: string;
719
714
  text: string;
720
715
  }[];
716
+ private readonly destroyRef;
721
717
  get companyName(): string;
722
718
  get companyEmail(): string;
723
- constructor(adminService: AdminService, injector: Injector, document: Document, sanitizer: DomSanitizer, cdr: ChangeDetectorRef);
719
+ constructor(legalPages: LegalPagesService, injector: Injector, cdr: ChangeDetectorRef);
724
720
  /** Edit affordance is restricted to (Master) Subscription Admins who can reach /admin/tos. */
725
721
  get canEditPolicy(): boolean;
726
722
  ngOnInit(): void;
727
- private getSubscribedProduct;
728
- fetchUserSubscriptions(userId: any, id?: any): void;
723
+ private productSlug;
724
+ private policyIdOf;
725
+ private show;
726
+ private parse;
729
727
  private buildToc;
730
- private findRequiredProducts;
731
- private getTosDetails;
732
728
  static ɵfac: i0.ɵɵFactoryDeclaration<PrivacyAndTosComponent, never>;
733
729
  static ɵcmp: i0.ɵɵComponentDeclaration<PrivacyAndTosComponent, "pw-privacy-and-tos", never, {
734
730
  "productId": {
@@ -737,28 +733,6 @@ export declare class PrivacyAndTosComponent extends AppBaseComponent implements
737
733
  };
738
734
  }, {}, never, never, false, never>;
739
735
  }
740
- declare namespace privacy_policy_component_d_exports {
741
- export { PrivacyPolicyComponent };
742
- }
743
- export declare class PrivacyPolicyComponent implements OnInit {
744
- private readonly appConfigService;
745
- private readonly router;
746
- constructor(appConfigService: AppConfigService, router: Router);
747
- ngOnInit(): void;
748
- static ɵfac: i0.ɵɵFactoryDeclaration<PrivacyPolicyComponent, never>;
749
- static ɵcmp: i0.ɵɵComponentDeclaration<PrivacyPolicyComponent, "pw-privacy-policy", never, {}, {}, never, never, false, never>;
750
- }
751
- declare namespace terms_conditions_component_d_exports {
752
- export { TermsConditionsComponent };
753
- }
754
- export declare class TermsConditionsComponent implements OnInit {
755
- private readonly appConfigService;
756
- private readonly router;
757
- constructor(appConfigService: AppConfigService, router: Router);
758
- ngOnInit(): void;
759
- static ɵfac: i0.ɵɵFactoryDeclaration<TermsConditionsComponent, never>;
760
- static ɵcmp: i0.ɵɵComponentDeclaration<TermsConditionsComponent, "pw-terms-conditions", never, {}, {}, never, never, false, never>;
761
- }
762
736
  declare namespace splash_component_d_exports {
763
737
  export { SplashComponent };
764
738
  }
@@ -2468,20 +2442,20 @@ declare namespace pw_cookie_banner_component_d_exports {
2468
2442
  }
2469
2443
  export declare class PwCookieBannerComponent implements OnInit {
2470
2444
  private readonly document;
2471
- title: string;
2472
- message: string;
2473
- acceptLabel: string;
2474
- privacyLinkLabel: string;
2445
+ private readonly translation;
2446
+ title: string | null;
2447
+ message: string | null;
2448
+ acceptLabel: string | null;
2449
+ privacyLinkLabel: string | null;
2475
2450
  privacyLinkUrl: string | null;
2476
- tosId: number | string | null;
2477
2451
  privacyFallbackUrl: string;
2478
2452
  cookieKey: string;
2479
2453
  cookieTtlDays: number;
2480
- visible: boolean;
2481
- leaving: boolean;
2454
+ readonly visible: import("@angular/core").WritableSignal<boolean>;
2455
+ readonly leaving: import("@angular/core").WritableSignal<boolean>;
2482
2456
  readonly role = "region";
2483
- readonly ariaLabel = "Cookie preferences";
2484
- constructor(document: Document);
2457
+ get ariaLabel(): string;
2458
+ constructor(document: Document, translation: TranslocoService);
2485
2459
  ngOnInit(): void;
2486
2460
  get resolvedPrivacyUrl(): string;
2487
2461
  accept(): void;
@@ -2510,10 +2484,6 @@ export declare class PwCookieBannerComponent implements OnInit {
2510
2484
  "alias": "privacyLinkUrl";
2511
2485
  "required": false;
2512
2486
  };
2513
- "tosId": {
2514
- "alias": "tosId";
2515
- "required": false;
2516
- };
2517
2487
  "privacyFallbackUrl": {
2518
2488
  "alias": "privacyFallbackUrl";
2519
2489
  "required": false;
@@ -2598,9 +2568,19 @@ declare class PwBrainChatThreadDirective {
2598
2568
  }
2599
2569
  export declare class SharedComponentsModule {
2600
2570
  static ɵfac: i0.ɵɵFactoryDeclaration<SharedComponentsModule, never>;
2601
- static ɵmod: i0.ɵɵNgModuleDeclaration<SharedComponentsModule, [typeof AiKnowledgeComponent, typeof CommandPaletteComponent, typeof ConfirmDialogComponent, typeof PasswordValidationComponent, typeof PwTabsComponent, typeof DateRangePickerComponent, typeof PermissionTreeComponent, typeof PrivacyAndTosComponent, typeof PrivacyPolicyComponent, typeof TermsConditionsComponent, typeof SplashComponent, typeof AuthenticatorComponent, typeof ClearBitIconComponent, typeof ComingSoonComponent, typeof CollapsibleSidebarComponent, typeof PwBrainChatComponent, typeof PwBrainChatConfirmComponent, typeof PwBrainChatQuickComponent, typeof PwBrainChatWelcomeComponent, typeof PwBrainChatVoiceOverlayComponent, typeof EntityGroupComponent, typeof GroupsComponent, typeof GroupDefinitionComponent, typeof NumberPickerComponent, typeof OnlineIndicatorComponent, typeof HeaderComponent, typeof LandingPageFooterBComponent, typeof PwDynamicPageComponent, typeof SectionHeadingBlockComponent, typeof DividerBlockComponent, typeof StatCardBlockComponent, typeof DataTableBlockComponent, typeof ChartBlockComponent], [typeof i7.FormsModule, typeof i35.IconFieldModule, typeof i36.InputIconModule, typeof i37.InputTextModule, typeof i10.AppLoaderModule, typeof i7.ReactiveFormsModule, typeof i12.DirectivesModule, typeof i11.CoreTranslocoModule, typeof i8.RouterModule, typeof i14.NgbTooltipModule, typeof i15.TooltipModule, typeof i14.NgbNavModule, typeof i14.NgbModalModule, typeof i44.TableModule, typeof i45.TabsModule, typeof i13.ButtonModule, typeof i47.SelectModule, typeof i48.MultiSelectModule, typeof i16.ProgressSpinnerModule, typeof i17.AutoCompleteModule, typeof i51.ImageCropperComponent, typeof i52.UiSwitchModule, typeof i53.NgxDaterangepickerMd, typeof i54.PipesModule, typeof i6.CommonModule, typeof i6.NgIf, typeof i19.FieldErrorDisplayModule, typeof ResourceSharedComponentsModule, typeof CollapsibleSidebarTriggerDirective, typeof PwCookieBannerComponent, typeof SafeMarkdownPipe, typeof PwBrainChatThreadDirective], [typeof AiKnowledgeComponent, typeof CommandPaletteComponent, typeof ConfirmDialogComponent, typeof PwCookieBannerComponent, typeof PasswordValidationComponent, typeof PwTabsComponent, typeof DateRangePickerComponent, typeof i14.NgbTooltipModule, typeof i15.TooltipModule, typeof i14.NgbNavModule, typeof i14.NgbModalModule, typeof i44.TableModule, typeof i45.TabsModule, typeof i13.ButtonModule, typeof i47.SelectModule, typeof i48.MultiSelectModule, typeof i16.ProgressSpinnerModule, typeof i17.AutoCompleteModule, typeof i51.ImageCropperComponent, typeof i52.UiSwitchModule, typeof i53.NgxDaterangepickerMd, typeof PermissionTreeComponent, typeof PrivacyAndTosComponent, typeof PrivacyPolicyComponent, typeof TermsConditionsComponent, typeof SplashComponent, typeof AuthenticatorComponent, typeof ClearBitIconComponent, typeof ComingSoonComponent, typeof CollapsibleSidebarComponent, typeof CollapsibleSidebarTriggerDirective, typeof PwBrainChatComponent, typeof EntityGroupComponent, typeof GroupsComponent, typeof GroupDefinitionComponent, typeof NumberPickerComponent, typeof OnlineIndicatorComponent, typeof HeaderComponent, typeof LandingPageFooterBComponent, typeof PwDynamicPageComponent, typeof i19.FieldErrorDisplayModule, typeof ResourceSharedComponentsModule]>;
2571
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SharedComponentsModule, [typeof AiKnowledgeComponent, typeof CommandPaletteComponent, typeof ConfirmDialogComponent, typeof PasswordValidationComponent, typeof PwTabsComponent, typeof DateRangePickerComponent, typeof PermissionTreeComponent, typeof PrivacyAndTosComponent, typeof SplashComponent, typeof AuthenticatorComponent, typeof ClearBitIconComponent, typeof ComingSoonComponent, typeof CollapsibleSidebarComponent, typeof PwBrainChatComponent, typeof PwBrainChatConfirmComponent, typeof PwBrainChatQuickComponent, typeof PwBrainChatWelcomeComponent, typeof PwBrainChatVoiceOverlayComponent, typeof EntityGroupComponent, typeof GroupsComponent, typeof GroupDefinitionComponent, typeof NumberPickerComponent, typeof OnlineIndicatorComponent, typeof HeaderComponent, typeof LandingPageFooterBComponent, typeof PwDynamicPageComponent, typeof SectionHeadingBlockComponent, typeof DividerBlockComponent, typeof StatCardBlockComponent, typeof DataTableBlockComponent, typeof ChartBlockComponent], [typeof i7.FormsModule, typeof i33.IconFieldModule, typeof i34.InputIconModule, typeof i35.InputTextModule, typeof i10.AppLoaderModule, typeof i7.ReactiveFormsModule, typeof i12.DirectivesModule, typeof i11.CoreTranslocoModule, typeof i8.RouterModule, typeof i14.NgbTooltipModule, typeof i15.TooltipModule, typeof i14.NgbNavModule, typeof i14.NgbModalModule, typeof i42.TableModule, typeof i43.TabsModule, typeof i13.ButtonModule, typeof i45.SelectModule, typeof i46.MultiSelectModule, typeof i16.ProgressSpinnerModule, typeof i17.AutoCompleteModule, typeof i49.ImageCropperComponent, typeof i50.UiSwitchModule, typeof i51.NgxDaterangepickerMd, typeof i52.PipesModule, typeof i6.CommonModule, typeof i6.NgIf, typeof i19.FieldErrorDisplayModule, typeof ResourceSharedComponentsModule, typeof CollapsibleSidebarTriggerDirective, typeof PwCookieBannerComponent, typeof SafeMarkdownPipe, typeof PwBrainChatThreadDirective], [typeof AiKnowledgeComponent, typeof CommandPaletteComponent, typeof ConfirmDialogComponent, typeof PwCookieBannerComponent, typeof PasswordValidationComponent, typeof PwTabsComponent, typeof DateRangePickerComponent, typeof i14.NgbTooltipModule, typeof i15.TooltipModule, typeof i14.NgbNavModule, typeof i14.NgbModalModule, typeof i42.TableModule, typeof i43.TabsModule, typeof i13.ButtonModule, typeof i45.SelectModule, typeof i46.MultiSelectModule, typeof i16.ProgressSpinnerModule, typeof i17.AutoCompleteModule, typeof i49.ImageCropperComponent, typeof i50.UiSwitchModule, typeof i51.NgxDaterangepickerMd, typeof PermissionTreeComponent, typeof PrivacyAndTosComponent, typeof SplashComponent, typeof AuthenticatorComponent, typeof ClearBitIconComponent, typeof ComingSoonComponent, typeof CollapsibleSidebarComponent, typeof CollapsibleSidebarTriggerDirective, typeof PwBrainChatComponent, typeof EntityGroupComponent, typeof GroupsComponent, typeof GroupDefinitionComponent, typeof NumberPickerComponent, typeof OnlineIndicatorComponent, typeof HeaderComponent, typeof LandingPageFooterBComponent, typeof PwDynamicPageComponent, typeof i19.FieldErrorDisplayModule, typeof ResourceSharedComponentsModule]>;
2602
2572
  static ɵinj: i0.ɵɵInjectorDeclaration<SharedComponentsModule>;
2603
2573
  }
2574
+ export interface LegalPageRouteOptions {
2575
+ /** Overrides the per-tab page title, e.g. for a product's SEO title. */
2576
+ title?: string;
2577
+ description?: string;
2578
+ canActivate?: Route['canActivate'];
2579
+ }
2580
+ /** `/privacy-policy[/:slug]` and `/terms-conditions[/:slug]`, readable without signing in. */
2581
+ export declare function publicLegalPageRoutes(options?: LegalPageRouteOptions): Routes;
2582
+ /** Inside the signed-in app: the policy of the selected product. */
2583
+ export declare function dashboardLegalPageRoutes(): Routes;
2604
2584
  /**
2605
2585
  * CollapsibleSidebarSuperAdminGuard
2606
2586
  *