@posiwise/shared-components 0.0.212 → 0.0.213

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.212",
3
+ "version": "0.0.213",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.2.0",
6
6
  "@angular/core": "^22.2.0",
@@ -1,17 +1,19 @@
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 * as i36 from "@angular/router";
4
- import { Router } from "@angular/router";
5
- import { AppConfigService } from "@posiwise/app-config-service";
6
- import { AuthService, BaseHttpService, BrainSocketService, BrainVoiceService, CustomToastService, DashboardService, DataService, DirectUploadService, FeatureFlagService, GroupService, LocalStorage, MCPFieldDiff, MCPOrchestratorService, MCPUploadCapability, MainApiHttpService, NavEntry, NavigationIndexService, NumberPickerService, PermissionService, RecentPagesService, SubscriptionService, UserService, VoiceChatService } from "@posiwise/common-services";
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 i43 from "primeng/table";
5
+ import { Table } from "primeng/table";
7
6
  import { TranslocoService } from "@jsverse/transloco";
8
- import { Observable, Subject } from "rxjs";
9
7
  import * as i11 from "@ng-bootstrap/ng-bootstrap";
10
8
  import { NgbActiveModal, NgbModal } from "@ng-bootstrap/ng-bootstrap";
9
+ import * as i40 from "@angular/router";
10
+ import { Router } from "@angular/router";
11
+ import { AppConfigService } from "@posiwise/app-config-service";
12
+ import { Observable, Subject } from "rxjs";
11
13
  import { AppBaseComponent } from "@posiwise/app-base-component";
12
14
  import { MenuItem } from "primeng/api";
13
15
  import moment from "moment";
14
- import * as i48 from "ngx-daterangepicker-material";
16
+ import * as i52 from "ngx-daterangepicker-material";
15
17
  import { DaterangepickerDirective } from "ngx-daterangepicker-material";
16
18
  import { DomSanitizer, SafeHtml } from "@angular/platform-browser";
17
19
  import { AdminService } from "@posiwise/admin-module-utils";
@@ -20,23 +22,148 @@ import { AppState } from "@posiwise/app-store";
20
22
  import { Store } from "@ngrx/store";
21
23
  import * as i6 from "@angular/forms";
22
24
  import { AbstractControl, ControlContainer, UntypedFormBuilder, UntypedFormGroup } from "@angular/forms";
25
+ import * as i34 from "primeng/iconfield";
26
+ import * as i35 from "primeng/inputicon";
27
+ import * as i36 from "primeng/inputtext";
23
28
  import * as i7 from "@posiwise/app-loader";
24
29
  import * as i9 from "@posiwise/directives";
25
30
  import * as i8 from "@posiwise/core-transloco";
26
31
  import * as i12 from "primeng/tooltip";
27
- import * as i39 from "primeng/table";
28
- import * as i40 from "primeng/tabs";
32
+ import * as i44 from "primeng/tabs";
29
33
  import * as i10 from "primeng/button";
30
- import * as i42 from "primeng/select";
31
- import * as i43 from "primeng/multiselect";
34
+ import * as i46 from "primeng/select";
35
+ import * as i47 from "primeng/multiselect";
32
36
  import * as i13 from "primeng/progressspinner";
33
37
  import * as i14 from "primeng/autocomplete";
34
- import * as i46 from "ngx-image-cropper";
35
- import * as i47 from "ngx-ui-switch";
36
- import * as i49 from "@posiwise/pipes";
38
+ import * as i50 from "ngx-image-cropper";
39
+ import * as i51 from "ngx-ui-switch";
40
+ import * as i53 from "@posiwise/pipes";
37
41
  import * as i5 from "@angular/common";
38
42
  import * as i16 from "@posiwise/utils";
39
43
  import * as i15 from "@angular/cdk/drag-drop";
44
+ export type ConfirmDialogTone = 'destructive' | 'neutral' | 'info';
45
+ export interface ConfirmDialogConfig {
46
+ titleKey?: string;
47
+ title?: string;
48
+ titleParams?: Record<string, unknown>;
49
+ textKey?: string;
50
+ text?: string;
51
+ textParams?: Record<string, unknown>;
52
+ destructive?: boolean;
53
+ confirmOnly?: boolean;
54
+ confirmLabelKey?: string;
55
+ confirmLabel?: string;
56
+ cancelLabelKey?: string;
57
+ cancelLabel?: string;
58
+ icon?: string;
59
+ tone?: ConfirmDialogTone;
60
+ }
61
+ /**
62
+ * Convenience overrides for `confirmDelete`. Any field of `ConfirmDialogConfig`
63
+ * may be passed; the defaults are `{ title: 'Delete', text: 'Are you sure you
64
+ * want to delete?', destructive: true }`.
65
+ */
66
+ export type ConfirmDeleteOptions = Partial<ConfirmDialogConfig>;
67
+ export declare class ConfirmDialogService {
68
+ private readonly modal;
69
+ constructor(modal: NgbModal);
70
+ open(config?: ConfirmDialogConfig): Promise<boolean>;
71
+ /**
72
+ * Opens a generic destructive "Delete — Are you sure you want to delete?"
73
+ * confirmation dialog. Pass overrides for any field (e.g. `text` with a
74
+ * bold entity name, or `textKey` for an i18n key).
75
+ */
76
+ confirmDelete(overrides?: ConfirmDeleteOptions): Promise<boolean>;
77
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmDialogService, never>;
78
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
79
+ }
80
+ /** `docmost/Onboarding/a.md` → `docmost/Onboarding`; a top-level file → ''. */
81
+ declare function folderOf(file: KnowledgeFile): string;
82
+ /** Colour key for the folder badge: `docmost/Onboarding` shares `docmost`'s tint. */
83
+ declare function topFolderOf(file: KnowledgeFile): string;
84
+ declare function formatSize(bytes: number): string;
85
+ /**
86
+ * One distinct soft tint per top-level folder, from core-styles' 24-hue ramp
87
+ * (`.badge.bg-cyan-1` … `-24`). Folders are sorted so the same set always gets
88
+ * the same colours, and successive folders step 7 places round the ramp (105°;
89
+ * 7 is coprime with 24, so all 24 hues are used before any repeats).
90
+ * `appDynamicBadge`'s 9-bucket hash collided here and kept to a narrow green
91
+ * band, so two folders could not be told apart.
92
+ */
93
+ declare function folderBadgeClasses(files: KnowledgeFile[]): Map<string, string>;
94
+ /** i18n key for why `file` can't be uploaded, or null. brain-api re-checks all of it. */
95
+ declare function uploadProblem(file: File): string | null;
96
+ /**
97
+ * Footer counts. This table pages and searches in the browser, so unlike a lazy
98
+ * table `dt.value` is every file: count the current page of the current search,
99
+ * or the footer reads "Showing 60 of 60" on a 50-row page.
100
+ */
101
+ declare function matchingCount(filtered: unknown[] | null | undefined, files: KnowledgeFile[]): number;
102
+ declare function shownOnPage(first: number, pageSize: number, matching: number): number;
103
+ declare namespace ai_knowledge_component_d_exports {
104
+ export { AiKnowledgeComponent };
105
+ }
106
+ /**
107
+ * Documents the Brain reads for one subscription — the tenant's folder
108
+ * (`scope="subscription"`, admins) or the caller's own (`scope="personal"`).
109
+ * brain-api validates every upload; the checks here only spare a round trip.
110
+ */
111
+ export declare class AiKnowledgeComponent implements OnChanges {
112
+ private readonly knowledge;
113
+ private readonly confirmDialog;
114
+ private readonly toast;
115
+ private readonly translation;
116
+ private readonly cdr;
117
+ scope: KnowledgeScope;
118
+ subscriptionId: number | null;
119
+ subscriptionName: string;
120
+ fileInput: ElementRef<HTMLInputElement>;
121
+ readonly accept: string;
122
+ readonly pageSize = 50;
123
+ files: KnowledgeFile[];
124
+ searchText: string;
125
+ /** More files exist than one load fetches (see `KnowledgeFilesService.listAllFiles`). */
126
+ truncated: boolean;
127
+ loading: boolean;
128
+ loadFailed: boolean;
129
+ /** brain-api's own reason when storage isn't set up (`storage_unavailable`) — "try again" won't help. */
130
+ unavailableReason: string | null;
131
+ uploading: boolean;
132
+ private folderClasses;
133
+ constructor(knowledge: KnowledgeFilesService, confirmDialog: ConfirmDialogService, toast: CustomToastService, translation: TranslocoService, cdr: ChangeDetectorRef);
134
+ ngOnChanges(changes: SimpleChanges): void;
135
+ load(): void;
136
+ chooseFile(): void;
137
+ onFileSelected(event: Event): void;
138
+ download(file: KnowledgeFile): void;
139
+ remove(file: KnowledgeFile): void;
140
+ /** Personal files always sit at the top of the member's own folder. */
141
+ get showFolder(): boolean;
142
+ folderOf: typeof folderOf;
143
+ sizeOf: typeof formatSize;
144
+ /** First row of the current page; PrimeNG returns to page 1 on a search. */
145
+ pageFirst: number;
146
+ matchingCount: (dt: Table) => number;
147
+ shownOnPage: (dt: Table) => number;
148
+ folderBadgeClass(file: KnowledgeFile): string;
149
+ private recolourFolders;
150
+ private done;
151
+ static ɵfac: i0.ɵɵFactoryDeclaration<AiKnowledgeComponent, never>;
152
+ static ɵcmp: i0.ɵɵComponentDeclaration<AiKnowledgeComponent, "pw-ai-knowledge", never, {
153
+ "scope": {
154
+ "alias": "scope";
155
+ "required": true;
156
+ };
157
+ "subscriptionId": {
158
+ "alias": "subscriptionId";
159
+ "required": false;
160
+ };
161
+ "subscriptionName": {
162
+ "alias": "subscriptionName";
163
+ "required": false;
164
+ };
165
+ }, {}, never, never, false, never>;
166
+ }
40
167
  /**
41
168
  * A compact icon action rendered in the sidebar header row (before the close
42
169
  * button). `id` MUST match a public method name on the mounted panel component
@@ -313,23 +440,6 @@ export declare class CommandPaletteComponent implements OnInit, AfterViewInit, O
313
440
  }]>;
314
441
  static ɵcmp: i0.ɵɵComponentDeclaration<CommandPaletteComponent, "pw-command-palette", never, {}, {}, never, never, false, never>;
315
442
  }
316
- export type ConfirmDialogTone = 'destructive' | 'neutral' | 'info';
317
- export interface ConfirmDialogConfig {
318
- titleKey?: string;
319
- title?: string;
320
- titleParams?: Record<string, unknown>;
321
- textKey?: string;
322
- text?: string;
323
- textParams?: Record<string, unknown>;
324
- destructive?: boolean;
325
- confirmOnly?: boolean;
326
- confirmLabelKey?: string;
327
- confirmLabel?: string;
328
- cancelLabelKey?: string;
329
- cancelLabel?: string;
330
- icon?: string;
331
- tone?: ConfirmDialogTone;
332
- }
333
443
  declare namespace confirm_dialog_component_d_exports {
334
444
  export { ConfirmDialogComponent };
335
445
  }
@@ -1319,25 +1429,6 @@ export declare class EntityGroupComponent extends AppBaseComponent implements On
1319
1429
  static ɵfac: i0.ɵɵFactoryDeclaration<EntityGroupComponent, never>;
1320
1430
  static ɵcmp: i0.ɵɵComponentDeclaration<EntityGroupComponent, "pw-entity-group", never, {}, {}, never, never, false, never>;
1321
1431
  }
1322
- /**
1323
- * Convenience overrides for `confirmDelete`. Any field of `ConfirmDialogConfig`
1324
- * may be passed; the defaults are `{ title: 'Delete', text: 'Are you sure you
1325
- * want to delete?', destructive: true }`.
1326
- */
1327
- export type ConfirmDeleteOptions = Partial<ConfirmDialogConfig>;
1328
- export declare class ConfirmDialogService {
1329
- private readonly modal;
1330
- constructor(modal: NgbModal);
1331
- open(config?: ConfirmDialogConfig): Promise<boolean>;
1332
- /**
1333
- * Opens a generic destructive "Delete — Are you sure you want to delete?"
1334
- * confirmation dialog. Pass overrides for any field (e.g. `text` with a
1335
- * bold entity name, or `textKey` for an i18n key).
1336
- */
1337
- confirmDelete(overrides?: ConfirmDeleteOptions): Promise<boolean>;
1338
- static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmDialogService, never>;
1339
- static ɵprov: i0.ɵɵInjectableDeclaration<any>;
1340
- }
1341
1432
  declare namespace groups_component_d_exports {
1342
1433
  export { GroupsComponent };
1343
1434
  }
@@ -2284,7 +2375,7 @@ declare class PwBrainChatThreadDirective {
2284
2375
  }
2285
2376
  export declare class SharedComponentsModule {
2286
2377
  static ɵfac: i0.ɵɵFactoryDeclaration<SharedComponentsModule, never>;
2287
- static ɵmod: i0.ɵɵNgModuleDeclaration<SharedComponentsModule, [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 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 i6.FormsModule, typeof i7.AppLoaderModule, typeof i6.ReactiveFormsModule, typeof i9.DirectivesModule, typeof i8.CoreTranslocoModule, typeof i36.RouterModule, typeof i11.NgbTooltipModule, typeof i12.TooltipModule, typeof i11.NgbNavModule, typeof i11.NgbModalModule, typeof i39.TableModule, typeof i40.TabsModule, typeof i10.ButtonModule, typeof i42.SelectModule, typeof i43.MultiSelectModule, typeof i13.ProgressSpinnerModule, typeof i14.AutoCompleteModule, typeof i46.ImageCropperComponent, typeof i47.UiSwitchModule, typeof i48.NgxDaterangepickerMd, typeof i49.PipesModule, typeof i5.CommonModule, typeof i5.NgIf, typeof i16.FieldErrorDisplayModule, typeof ResourceSharedComponentsModule, typeof CollapsibleSidebarTriggerDirective, typeof PwCookieBannerComponent, typeof SafeMarkdownPipe, typeof PwBrainChatThreadDirective], [typeof CommandPaletteComponent, typeof ConfirmDialogComponent, typeof PwCookieBannerComponent, typeof PasswordValidationComponent, typeof PwTabsComponent, typeof DateRangePickerComponent, typeof i11.NgbTooltipModule, typeof i12.TooltipModule, typeof i11.NgbNavModule, typeof i11.NgbModalModule, typeof i39.TableModule, typeof i40.TabsModule, typeof i10.ButtonModule, typeof i42.SelectModule, typeof i43.MultiSelectModule, typeof i13.ProgressSpinnerModule, typeof i14.AutoCompleteModule, typeof i46.ImageCropperComponent, typeof i47.UiSwitchModule, typeof i48.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 i16.FieldErrorDisplayModule, typeof ResourceSharedComponentsModule]>;
2378
+ 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 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 i6.FormsModule, typeof i34.IconFieldModule, typeof i35.InputIconModule, typeof i36.InputTextModule, typeof i7.AppLoaderModule, typeof i6.ReactiveFormsModule, typeof i9.DirectivesModule, typeof i8.CoreTranslocoModule, typeof i40.RouterModule, typeof i11.NgbTooltipModule, typeof i12.TooltipModule, typeof i11.NgbNavModule, typeof i11.NgbModalModule, typeof i43.TableModule, typeof i44.TabsModule, typeof i10.ButtonModule, typeof i46.SelectModule, typeof i47.MultiSelectModule, typeof i13.ProgressSpinnerModule, typeof i14.AutoCompleteModule, typeof i50.ImageCropperComponent, typeof i51.UiSwitchModule, typeof i52.NgxDaterangepickerMd, typeof i53.PipesModule, typeof i5.CommonModule, typeof i5.NgIf, typeof i16.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 i11.NgbTooltipModule, typeof i12.TooltipModule, typeof i11.NgbNavModule, typeof i11.NgbModalModule, typeof i43.TableModule, typeof i44.TabsModule, typeof i10.ButtonModule, typeof i46.SelectModule, typeof i47.MultiSelectModule, typeof i13.ProgressSpinnerModule, typeof i14.AutoCompleteModule, typeof i50.ImageCropperComponent, typeof i51.UiSwitchModule, typeof i52.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 i16.FieldErrorDisplayModule, typeof ResourceSharedComponentsModule]>;
2288
2379
  static ɵinj: i0.ɵɵInjectorDeclaration<SharedComponentsModule>;
2289
2380
  }
2290
2381
  /**