@sinequa/atomic-angular 0.0.146

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.
Files changed (174) hide show
  1. package/assets/tailwind.css +334 -0
  2. package/esm2022/lib/assistant/index.mjs +2 -0
  3. package/esm2022/lib/assistant/signalR.web.service.mjs +81 -0
  4. package/esm2022/lib/components/dropdown-input.mjs +97 -0
  5. package/esm2022/lib/components/dropdown-list.mjs +35 -0
  6. package/esm2022/lib/components/dropdown.mjs +127 -0
  7. package/esm2022/lib/components/index.mjs +7 -0
  8. package/esm2022/lib/components/menu/index.mjs +3 -0
  9. package/esm2022/lib/components/menu/menu-item.mjs +22 -0
  10. package/esm2022/lib/components/menu/menu.mjs +99 -0
  11. package/esm2022/lib/components/metadata/index.mjs +2 -0
  12. package/esm2022/lib/components/metadata/metadata.component.mjs +65 -0
  13. package/esm2022/lib/components/theme/index.mjs +3 -0
  14. package/esm2022/lib/components/theme/theme-selector.component.mjs +67 -0
  15. package/esm2022/lib/components/theme/theme-toggle.component.mjs +67 -0
  16. package/esm2022/lib/directives/index.mjs +5 -0
  17. package/esm2022/lib/directives/infinite-scroll.directive.mjs +47 -0
  18. package/esm2022/lib/directives/select-article-on-click.directive.mjs +39 -0
  19. package/esm2022/lib/directives/show-bookmark.directive.mjs +55 -0
  20. package/esm2022/lib/directives/theme-provider.directive.mjs +31 -0
  21. package/esm2022/lib/guards/auth.guard.mjs +27 -0
  22. package/esm2022/lib/guards/index.mjs +3 -0
  23. package/esm2022/lib/guards/initialization.guard.mjs +41 -0
  24. package/esm2022/lib/interceptors/audit.interceptor.mjs +23 -0
  25. package/esm2022/lib/interceptors/auth.interceptor.mjs +49 -0
  26. package/esm2022/lib/interceptors/body.interceptor.mjs +24 -0
  27. package/esm2022/lib/interceptors/error.interceptor.mjs +35 -0
  28. package/esm2022/lib/interceptors/index.mjs +7 -0
  29. package/esm2022/lib/interceptors/toast.interceptor.mjs +27 -0
  30. package/esm2022/lib/models/aggregation.mjs +2 -0
  31. package/esm2022/lib/models/article-metadata.mjs +2 -0
  32. package/esm2022/lib/models/autocomplete.mjs +2 -0
  33. package/esm2022/lib/models/custom-json.mjs +2 -0
  34. package/esm2022/lib/models/filter-dropdown.mjs +2 -0
  35. package/esm2022/lib/models/index.mjs +7 -0
  36. package/esm2022/lib/models/user-settings.mjs +2 -0
  37. package/esm2022/lib/pipes/highlight-word.pipe.mjs +33 -0
  38. package/esm2022/lib/pipes/index.mjs +3 -0
  39. package/esm2022/lib/pipes/source-icon.pipe.mjs +43 -0
  40. package/esm2022/lib/public-api.mjs +18 -0
  41. package/esm2022/lib/resolvers/index.mjs +2 -0
  42. package/esm2022/lib/resolvers/query-name-resolver.mjs +14 -0
  43. package/esm2022/lib/resources/index.mjs +2 -0
  44. package/esm2022/lib/resources/themes.mjs +53 -0
  45. package/esm2022/lib/services/application.service.mjs +245 -0
  46. package/esm2022/lib/services/autocomplete.service.mjs +85 -0
  47. package/esm2022/lib/services/drawer/backdrop.service.mjs +23 -0
  48. package/esm2022/lib/services/drawer/drawer-stack.service.mjs +152 -0
  49. package/esm2022/lib/services/drawer/drawer.service.mjs +38 -0
  50. package/esm2022/lib/services/index.mjs +12 -0
  51. package/esm2022/lib/services/label.service.mjs +161 -0
  52. package/esm2022/lib/services/navigation.service.mjs +59 -0
  53. package/esm2022/lib/services/saved-searches.service.mjs +75 -0
  54. package/esm2022/lib/services/search.service.mjs +89 -0
  55. package/esm2022/lib/services/selection-history.service.mjs +92 -0
  56. package/esm2022/lib/services/selection.service.mjs +87 -0
  57. package/esm2022/lib/stores/aggregations.store.mjs +59 -0
  58. package/esm2022/lib/stores/app.store.mjs +270 -0
  59. package/esm2022/lib/stores/application.store.mjs +87 -0
  60. package/esm2022/lib/stores/index.mjs +9 -0
  61. package/esm2022/lib/stores/principal.store.mjs +47 -0
  62. package/esm2022/lib/stores/query-params.store.mjs +207 -0
  63. package/esm2022/lib/stores/selection.store.mjs +45 -0
  64. package/esm2022/lib/stores/theme.store.mjs +116 -0
  65. package/esm2022/lib/stores/user-settings.store.mjs +391 -0
  66. package/esm2022/lib/tokens/highlights.mjs +32 -0
  67. package/esm2022/lib/tokens/index.mjs +2 -0
  68. package/esm2022/lib/utils/debounced-signal.mjs +38 -0
  69. package/esm2022/lib/utils/index.mjs +8 -0
  70. package/esm2022/lib/utils/inline-worker.mjs +40 -0
  71. package/esm2022/lib/utils/query.mjs +58 -0
  72. package/esm2022/lib/utils/routes.mjs +28 -0
  73. package/esm2022/lib/utils/tailwind-utils.mjs +6 -0
  74. package/esm2022/lib/utils/theme-body-hook.mjs +18 -0
  75. package/esm2022/lib/utils/theme-registry.mjs +6 -0
  76. package/esm2022/lib/web-services/aggregations.service.mjs +104 -0
  77. package/esm2022/lib/web-services/app.service.mjs +48 -0
  78. package/esm2022/lib/web-services/audit.service.mjs +122 -0
  79. package/esm2022/lib/web-services/index.mjs +10 -0
  80. package/esm2022/lib/web-services/json-method-plugin.service.mjs +54 -0
  81. package/esm2022/lib/web-services/preview.service.mjs +327 -0
  82. package/esm2022/lib/web-services/principal.service.mjs +46 -0
  83. package/esm2022/lib/web-services/query.service.mjs +123 -0
  84. package/esm2022/lib/web-services/text-chunck.service.mjs +46 -0
  85. package/esm2022/public-api.mjs +5 -0
  86. package/esm2022/sinequa-atomic-angular.mjs +5 -0
  87. package/fesm2022/sinequa-atomic-angular.mjs +4420 -0
  88. package/fesm2022/sinequa-atomic-angular.mjs.map +1 -0
  89. package/index.d.ts +5 -0
  90. package/lib/assistant/index.d.ts +1 -0
  91. package/lib/assistant/signalR.web.service.d.ts +46 -0
  92. package/lib/components/dropdown-input.d.ts +18 -0
  93. package/lib/components/dropdown-list.d.ts +8 -0
  94. package/lib/components/dropdown.d.ts +50 -0
  95. package/lib/components/index.d.ts +6 -0
  96. package/lib/components/menu/index.d.ts +2 -0
  97. package/lib/components/menu/menu-item.d.ts +8 -0
  98. package/lib/components/menu/menu.d.ts +24 -0
  99. package/lib/components/metadata/index.d.ts +1 -0
  100. package/lib/components/metadata/metadata.component.d.ts +24 -0
  101. package/lib/components/theme/index.d.ts +2 -0
  102. package/lib/components/theme/theme-selector.component.d.ts +70 -0
  103. package/lib/components/theme/theme-toggle.component.d.ts +10 -0
  104. package/lib/directives/index.d.ts +4 -0
  105. package/lib/directives/infinite-scroll.directive.d.ts +30 -0
  106. package/lib/directives/select-article-on-click.directive.d.ts +14 -0
  107. package/lib/directives/show-bookmark.directive.d.ts +60 -0
  108. package/lib/directives/theme-provider.directive.d.ts +20 -0
  109. package/lib/guards/auth.guard.d.ts +7 -0
  110. package/lib/guards/index.d.ts +2 -0
  111. package/lib/guards/initialization.guard.d.ts +20 -0
  112. package/lib/interceptors/audit.interceptor.d.ts +13 -0
  113. package/lib/interceptors/auth.interceptor.d.ts +14 -0
  114. package/lib/interceptors/body.interceptor.d.ts +11 -0
  115. package/lib/interceptors/error.interceptor.d.ts +9 -0
  116. package/lib/interceptors/index.d.ts +5 -0
  117. package/lib/interceptors/toast.interceptor.d.ts +13 -0
  118. package/lib/models/aggregation.d.ts +12 -0
  119. package/lib/models/article-metadata.d.ts +5 -0
  120. package/lib/models/autocomplete.d.ts +5 -0
  121. package/lib/models/custom-json.d.ts +69 -0
  122. package/lib/models/filter-dropdown.d.ts +10 -0
  123. package/lib/models/index.d.ts +6 -0
  124. package/lib/models/user-settings.d.ts +38 -0
  125. package/lib/pipes/highlight-word.pipe.d.ts +22 -0
  126. package/lib/pipes/index.d.ts +2 -0
  127. package/lib/pipes/source-icon.pipe.d.ts +51 -0
  128. package/lib/public-api.d.ts +14 -0
  129. package/lib/resolvers/index.d.ts +1 -0
  130. package/lib/resolvers/query-name-resolver.d.ts +9 -0
  131. package/lib/resources/index.d.ts +1 -0
  132. package/lib/resources/themes.d.ts +51 -0
  133. package/lib/services/application.service.d.ts +183 -0
  134. package/lib/services/autocomplete.service.d.ts +96 -0
  135. package/lib/services/drawer/backdrop.service.d.ts +9 -0
  136. package/lib/services/drawer/drawer-stack.service.d.ts +70 -0
  137. package/lib/services/drawer/drawer.service.d.ts +15 -0
  138. package/lib/services/index.d.ts +11 -0
  139. package/lib/services/label.service.d.ts +114 -0
  140. package/lib/services/navigation.service.d.ts +33 -0
  141. package/lib/services/saved-searches.service.d.ts +149 -0
  142. package/lib/services/search.service.d.ts +159 -0
  143. package/lib/services/selection-history.service.d.ts +50 -0
  144. package/lib/services/selection.service.d.ts +123 -0
  145. package/lib/stores/aggregations.store.d.ts +25 -0
  146. package/lib/stores/app.store.d.ts +110 -0
  147. package/lib/stores/application.store.d.ts +83 -0
  148. package/lib/stores/index.d.ts +8 -0
  149. package/lib/stores/principal.store.d.ts +47 -0
  150. package/lib/stores/query-params.store.d.ts +128 -0
  151. package/lib/stores/selection.store.d.ts +52 -0
  152. package/lib/stores/theme.store.d.ts +66 -0
  153. package/lib/stores/user-settings.store.d.ts +111 -0
  154. package/lib/tokens/highlights.d.ts +8 -0
  155. package/lib/tokens/index.d.ts +1 -0
  156. package/lib/utils/debounced-signal.d.ts +25 -0
  157. package/lib/utils/index.d.ts +7 -0
  158. package/lib/utils/inline-worker.d.ts +11 -0
  159. package/lib/utils/query.d.ts +26 -0
  160. package/lib/utils/routes.d.ts +16 -0
  161. package/lib/utils/tailwind-utils.d.ts +2 -0
  162. package/lib/utils/theme-body-hook.d.ts +6 -0
  163. package/lib/utils/theme-registry.d.ts +3 -0
  164. package/lib/web-services/aggregations.service.d.ts +57 -0
  165. package/lib/web-services/app.service.d.ts +30 -0
  166. package/lib/web-services/audit.service.d.ts +72 -0
  167. package/lib/web-services/index.d.ts +9 -0
  168. package/lib/web-services/json-method-plugin.service.d.ts +41 -0
  169. package/lib/web-services/preview.service.d.ts +283 -0
  170. package/lib/web-services/principal.service.d.ts +28 -0
  171. package/lib/web-services/query.service.d.ts +29 -0
  172. package/lib/web-services/text-chunck.service.d.ts +22 -0
  173. package/package.json +28 -0
  174. package/public-api.d.ts +1 -0
@@ -0,0 +1,69 @@
1
+ import { Aggregation } from "@sinequa/atomic";
2
+ import { AggregationListItem } from "./aggregation";
3
+ import { Autocomplete } from "./autocomplete";
4
+ export type CJson = Record<string, any>;
5
+ export type SideCJson = {
6
+ name: string;
7
+ data: CJson;
8
+ _itemId?: number;
9
+ preLogin?: boolean;
10
+ };
11
+ export type AppCJson = {
12
+ data: CJson;
13
+ customJSONs: SideCJson[];
14
+ };
15
+ export type CSources = {
16
+ collection?: Record<string, {
17
+ iconClass?: string;
18
+ iconPath?: string;
19
+ }>;
20
+ source?: Record<string, {
21
+ iconClass?: string;
22
+ iconPath?: string;
23
+ }>;
24
+ connector?: Record<string, {
25
+ iconClass?: string;
26
+ iconPath?: string;
27
+ }>;
28
+ };
29
+ export type CFilterItem = {
30
+ value: string;
31
+ icon?: string;
32
+ };
33
+ export type CFilter = {
34
+ column: string;
35
+ icon?: string;
36
+ display?: string;
37
+ hidden?: boolean;
38
+ items?: CFilterItem[];
39
+ };
40
+ export type CAggregationItem = AggregationListItem & {
41
+ icon?: string;
42
+ };
43
+ export type CAggregation = Aggregation & {
44
+ display?: string;
45
+ icon?: string;
46
+ items?: CAggregationItem[];
47
+ };
48
+ export type CJ = {
49
+ name: string;
50
+ data: {
51
+ routes?: [];
52
+ filters?: CFilter[];
53
+ };
54
+ };
55
+ export type CJsonMint = CJson & {
56
+ filters?: CAggregation[];
57
+ autocomplete?: Autocomplete;
58
+ tabs?: Record<string, {
59
+ filters: string[];
60
+ overviews?: Record<string, {
61
+ minRelevance: number;
62
+ }>;
63
+ }>;
64
+ sources?: CSources;
65
+ features?: {
66
+ [key: string]: boolean;
67
+ allowChatDrawer: boolean;
68
+ };
69
+ };
@@ -0,0 +1,10 @@
1
+ import { LegacyFilter } from "@sinequa/atomic";
2
+ import { AggregationEx } from "./aggregation";
3
+ export type FilterDropdown = {
4
+ label: string;
5
+ aggregation: AggregationEx;
6
+ icon?: string;
7
+ firstFilter?: LegacyFilter;
8
+ moreFiltersCount?: number;
9
+ hidden?: boolean;
10
+ };
@@ -0,0 +1,6 @@
1
+ export * from './user-settings';
2
+ export * from './article-metadata';
3
+ export * from './custom-json';
4
+ export * from './filter-dropdown';
5
+ export * from './autocomplete';
6
+ export * from './aggregation';
@@ -0,0 +1,38 @@
1
+ import { QueryParams } from "@sinequa/atomic";
2
+ export type Bookmark = {
3
+ id: string;
4
+ queryName?: string;
5
+ label?: string;
6
+ source?: string;
7
+ sourceIconClass?: string;
8
+ author?: string;
9
+ parentFolder?: string;
10
+ parentFolderIconClass?: string;
11
+ };
12
+ export type RecentSearch = {
13
+ url: string;
14
+ path: string;
15
+ display: string;
16
+ label?: string;
17
+ filterCount?: number;
18
+ date: string;
19
+ queryParams?: QueryParams;
20
+ };
21
+ export type SavedSearch = {
22
+ url: string;
23
+ date: string;
24
+ display: string;
25
+ };
26
+ export type Basket = {
27
+ name: string;
28
+ description?: string;
29
+ ids?: string[];
30
+ };
31
+ export type UserSettings = {
32
+ bookmarks: Bookmark[];
33
+ recentSearches: RecentSearch[];
34
+ savedSearches: SavedSearch[];
35
+ baskets: Basket[];
36
+ assistants: Record<string, unknown>;
37
+ language?: string;
38
+ };
@@ -0,0 +1,22 @@
1
+ import { PipeTransform } from "@angular/core";
2
+ import { HighlightWords } from "highlight-words";
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * The HighlightWordPipe class is a custom pipe in the Atomic Angular library.
6
+ * It is used to highlight a specific word within a given text.
7
+ *
8
+ * @remarks
9
+ * This pipe takes in a `value` string, a `word` string to highlight, and an optional `clipBy` number to limit the length of the highlighted text.
10
+ * It returns an array of `HighlightWords.Chunk` objects representing the highlighted portions of the text.
11
+ *
12
+ * @example
13
+ * ```html
14
+ * <div [innerHTML]="text | highlightWord:'search':10"></div>
15
+ * ```
16
+ *
17
+ */
18
+ export declare class HighlightWordPipe implements PipeTransform {
19
+ transform(value: string, word: string, clipBy?: number): HighlightWords.Chunk[];
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<HighlightWordPipe, never>;
21
+ static ɵpipe: i0.ɵɵPipeDeclaration<HighlightWordPipe, "highlightWord", true>;
22
+ }
@@ -0,0 +1,2 @@
1
+ export * from './highlight-word.pipe';
2
+ export * from './source-icon.pipe';
@@ -0,0 +1,51 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Pipe that transforms a collection of strings into a corresponding icon class.
5
+ *
6
+ * This pipe uses the first element of the collection to determine the icon class
7
+ * based on the source name. If the collection is empty or undefined, it returns
8
+ * a default icon class.
9
+ *
10
+ * @deprecated This pipe is deprecated and will be removed in the future.
11
+ *
12
+ * @param collection - An array of strings representing the collection.
13
+ * @returns A string representing the icon class.
14
+ */
15
+ export declare class SourceIconPipe implements PipeTransform {
16
+ appStore: {
17
+ webServices: import("@ngrx/signals").DeepSignal<{}>;
18
+ queries: import("@ngrx/signals").DeepSignal<{}>;
19
+ customJSONs: import("@angular/core").Signal<import("@sinequa/atomic-angular").SideCJson[]>;
20
+ data: import("@ngrx/signals").DeepSignal<{}>;
21
+ customizationJson: import("@angular/core").Signal<import("@sinequa/atomic-angular").CJsonMint>;
22
+ sources: import("@angular/core").Signal<any>;
23
+ filters: import("@angular/core").Signal<any>;
24
+ initialize: () => Promise<void>;
25
+ initializeWithAppName: (appName: string) => Promise<void>;
26
+ update: (app: import("@sinequa/atomic").CCApp) => void;
27
+ getWebServiceByType: (type: import("@sinequa/atomic").CCWebService["webServiceType"]) => import("@sinequa/atomic").CCWebService | undefined;
28
+ getLabels: () => {
29
+ private: string;
30
+ public: string;
31
+ };
32
+ getQueryByName: (name: string) => import("@sinequa/atomic").CCQuery | undefined;
33
+ getQueryByIndex: (index: number) => import("@sinequa/atomic").CCQuery | undefined;
34
+ getDefaultQuery: () => import("@sinequa/atomic").CCQuery | undefined;
35
+ allowEmptySearch: (queryName: string) => boolean;
36
+ getColumnAlias: (column: string) => string;
37
+ getAuthorizedFilters: (route: import("@angular/router").ActivatedRoute) => import("@sinequa/atomic").Aggregation[];
38
+ getNamedCustomizationJson: (name: string) => any | undefined;
39
+ getAggregationIcon: (column: string) => string | undefined;
40
+ getAggregationItemsCustomization: (column: string) => import("@sinequa/atomic-angular").CFilterItem[] | undefined;
41
+ getAggregationCustomization: (column: string) => import("@sinequa/atomic-angular").CFilter | undefined;
42
+ } & import("@ngrx/signals").StateSource<{
43
+ webServices: {};
44
+ queries: {};
45
+ customJSONs: import("@sinequa/atomic-angular").SideCJson[];
46
+ data: {};
47
+ }>;
48
+ transform(collection: string[]): string;
49
+ static ɵfac: i0.ɵɵFactoryDeclaration<SourceIconPipe, never>;
50
+ static ɵpipe: i0.ɵɵPipeDeclaration<SourceIconPipe, "sourceIcon", true>;
51
+ }
@@ -0,0 +1,14 @@
1
+ export * from "./assistant";
2
+ export * from "./components";
3
+ export * from "./directives";
4
+ export * from "./guards";
5
+ export * from "./interceptors";
6
+ export * from "./models";
7
+ export * from "./pipes";
8
+ export * from "./resolvers";
9
+ export * from "./resources";
10
+ export * from "./services";
11
+ export * from "./stores";
12
+ export * from "./tokens";
13
+ export * from "./utils";
14
+ export * from "./web-services";
@@ -0,0 +1 @@
1
+ export * from "./query-name-resolver";
@@ -0,0 +1,9 @@
1
+ import { ResolveFn } from '@angular/router';
2
+ /**
3
+ * Resolves the name of the default query from the application store.
4
+ *
5
+ * @param route - The current route snapshot.
6
+ * @param state - The current router state snapshot.
7
+ * @returns The name of the default query or an empty string if not available.
8
+ */
9
+ export declare const queryNameResolver: ResolveFn<string>;
@@ -0,0 +1 @@
1
+ export * from "./themes";
@@ -0,0 +1,51 @@
1
+ export declare const THEMES: {
2
+ name: string;
3
+ id: string;
4
+ private: boolean;
5
+ colors: {
6
+ "button-primary-background": string;
7
+ background: string;
8
+ foreground: string;
9
+ card: string;
10
+ "card-foreground": string;
11
+ active: string;
12
+ "active-foreground": string;
13
+ "active-background": string;
14
+ primary: string;
15
+ "primary-foreground": string;
16
+ secondary: string;
17
+ "secondary-foreground": string;
18
+ muted: string;
19
+ "muted-foreground": string;
20
+ accent: string;
21
+ "accent-foreground": string;
22
+ destructive: string;
23
+ "destructive-foreground": string;
24
+ border: string;
25
+ input: string;
26
+ ring: string;
27
+ };
28
+ colorsDark: {
29
+ background: string;
30
+ foreground: string;
31
+ card: string;
32
+ "card-foreground": string;
33
+ active: string;
34
+ "active-foreground": string;
35
+ "active-background": string;
36
+ primary: string;
37
+ "primary-foreground": string;
38
+ secondary: string;
39
+ "secondary-foreground": string;
40
+ muted: string;
41
+ "muted-foreground": string;
42
+ accent: string;
43
+ "accent-foreground": string;
44
+ destructive: string;
45
+ "destructive-foreground": string;
46
+ border: string;
47
+ input: string;
48
+ ring: string;
49
+ };
50
+ }[];
51
+ export type Theme = (typeof THEMES)[number];
@@ -0,0 +1,183 @@
1
+ import { InjectionToken, Type } from '@angular/core';
2
+ import { ActivatedRoute, Router } from '@angular/router';
3
+ import { CCApp, Credentials } from '@sinequa/atomic';
4
+ import { AppService } from '../web-services/app.service';
5
+ import { AuditService } from '../web-services/audit.service';
6
+ import * as i0 from "@angular/core";
7
+ export declare const ROUTE_COMPONENTS: InjectionToken<ComponentMapping[]>;
8
+ export type ComponentMapping = {
9
+ path: string;
10
+ component: Type<unknown>;
11
+ isRoot?: boolean;
12
+ };
13
+ export declare class ApplicationService {
14
+ userSettingsStore: {
15
+ bookmarks: import("@angular/core").Signal<import("@sinequa/atomic-angular").Bookmark[]>;
16
+ recentSearches: import("@angular/core").Signal<import("@sinequa/atomic-angular").RecentSearch[]>;
17
+ savedSearches: import("@angular/core").Signal<import("@sinequa/atomic-angular").SavedSearch[]>;
18
+ baskets: import("@angular/core").Signal<import("@sinequa/atomic-angular").Basket[]>;
19
+ assistants: import("@angular/core").Signal<Record<string, unknown>>;
20
+ language?: import("@angular/core").Signal<string | undefined> | undefined;
21
+ updateBookmarks: (bookmarks: import("@sinequa/atomic-angular").UserSettings["bookmarks"], auditEvents?: import("@sinequa/atomic").AuditEvents) => Promise<void>;
22
+ bookmark: (article: import("@sinequa/atomic").Article, queryName?: string) => Promise<void>;
23
+ unbookmark: (id: string) => Promise<void>;
24
+ isBookmarked: (article: Partial<import("@sinequa/atomic").Article>) => boolean;
25
+ toggleBookmark: (article: import("@sinequa/atomic").Article) => Promise<void>;
26
+ deleteRecentSearch: (index: number) => Promise<void>;
27
+ updateRecentSearches: (recentSearches: import("@sinequa/atomic-angular").UserSettings["recentSearches"], auditEvents?: import("@sinequa/atomic").AuditEvents) => Promise<void>;
28
+ addCurrentSearch: (queryParams: import("@sinequa/atomic").QueryParams) => Promise<void>;
29
+ deleteSavedSearch: (index: number) => Promise<void>;
30
+ updateSavedSearches: (savedSearches: import("@sinequa/atomic-angular").UserSettings["savedSearches"]) => Promise<void>;
31
+ deleteBasket: (index: number) => Promise<void>;
32
+ createBasket: (basket: import("@sinequa/atomic-angular").Basket) => Promise<void>;
33
+ updateBaskets: (baskets: import("@sinequa/atomic-angular").UserSettings["baskets"]) => Promise<void>;
34
+ updateBasket: (basket: import("@sinequa/atomic-angular").Basket, index: number) => Promise<void>;
35
+ addToBasket: (name: string, ids: string | string[]) => Promise<void>;
36
+ removeFromBasket: (name: string, ids: string | string[]) => Promise<void>;
37
+ updateAssistantSettings: (assistantSettings: import("@sinequa/atomic-angular").UserSettings["assistants"]) => Promise<void>;
38
+ updateLanguage: (language: import("@sinequa/atomic-angular").UserSettings["language"], auditEvents?: import("@sinequa/atomic").AuditEvents) => Promise<void>;
39
+ initialize: () => Promise<void>;
40
+ reset: () => Promise<void>;
41
+ } & import("@ngrx/signals").StateSource<{
42
+ bookmarks: import("@sinequa/atomic-angular").Bookmark[];
43
+ recentSearches: import("@sinequa/atomic-angular").RecentSearch[];
44
+ savedSearches: import("@sinequa/atomic-angular").SavedSearch[];
45
+ baskets: import("@sinequa/atomic-angular").Basket[];
46
+ assistants: Record<string, unknown>;
47
+ language?: string | undefined;
48
+ }>;
49
+ principalStore: {
50
+ principal: import("@ngrx/signals").DeepSignal<import("@sinequa/atomic").Principal>;
51
+ userOverrideActive: import("@angular/core").Signal<boolean>;
52
+ allowUserOverride: import("@angular/core").Signal<boolean>;
53
+ isOverridingUser: import("@angular/core").Signal<boolean>;
54
+ initialize: () => Promise<void>;
55
+ } & import("@ngrx/signals").StateSource<{
56
+ principal: import("@sinequa/atomic").Principal;
57
+ userOverrideActive: boolean;
58
+ }>;
59
+ appService: AppService;
60
+ appStore: {
61
+ webServices: import("@ngrx/signals").DeepSignal<{}>;
62
+ queries: import("@ngrx/signals").DeepSignal<{}>;
63
+ customJSONs: import("@angular/core").Signal<import("@sinequa/atomic-angular").SideCJson[]>;
64
+ data: import("@ngrx/signals").DeepSignal<{}>;
65
+ customizationJson: import("@angular/core").Signal<import("@sinequa/atomic-angular").CJsonMint>;
66
+ sources: import("@angular/core").Signal<any>;
67
+ filters: import("@angular/core").Signal<any>;
68
+ initialize: () => Promise<void>;
69
+ initializeWithAppName: (appName: string) => Promise<void>;
70
+ update: (app: CCApp) => void;
71
+ getWebServiceByType: (type: import("@sinequa/atomic").CCWebService["webServiceType"]) => import("@sinequa/atomic").CCWebService | undefined;
72
+ getLabels: () => {
73
+ private: string;
74
+ public: string;
75
+ };
76
+ getQueryByName: (name: string) => import("@sinequa/atomic").CCQuery | undefined;
77
+ getQueryByIndex: (index: number) => import("@sinequa/atomic").CCQuery | undefined;
78
+ getDefaultQuery: () => import("@sinequa/atomic").CCQuery | undefined;
79
+ allowEmptySearch: (queryName: string) => boolean;
80
+ getColumnAlias: (column: string) => string;
81
+ getAuthorizedFilters: (route: ActivatedRoute) => import("@sinequa/atomic").Aggregation[];
82
+ getNamedCustomizationJson: (name: string) => any | undefined;
83
+ getAggregationIcon: (column: string) => string | undefined;
84
+ getAggregationItemsCustomization: (column: string) => import("@sinequa/atomic-angular").CFilterItem[] | undefined;
85
+ getAggregationCustomization: (column: string) => import("@sinequa/atomic-angular").CFilter | undefined;
86
+ } & import("@ngrx/signals").StateSource<{
87
+ webServices: {};
88
+ queries: {};
89
+ customJSONs: import("@sinequa/atomic-angular").SideCJson[];
90
+ data: {};
91
+ }>;
92
+ applicationStore: {
93
+ assistantReady: import("@angular/core").Signal<boolean>;
94
+ ready: import("@angular/core").Signal<boolean>;
95
+ hasLabelsAccess: import("@angular/core").Signal<boolean>;
96
+ extracts: import("@angular/core").Signal<Map<string, import("../stores/application.store").Extract[]>>;
97
+ extractsCount: import("@angular/core").Signal<number>;
98
+ updateAssistantReady: () => void;
99
+ updateReadyState: (value?: boolean) => void;
100
+ updateHasLabelsAccess: (value?: boolean) => void;
101
+ updateExtracts: (id: string, extracts: import("../stores/application.store").Extract[]) => void;
102
+ getExtracts: (id: string) => import("../stores/application.store").Extract[] | undefined;
103
+ } & import("@ngrx/signals").WritableStateSource<{
104
+ assistantReady: boolean;
105
+ ready: boolean;
106
+ hasLabelsAccess: boolean;
107
+ extracts: Map<string, import("../stores/application.store").Extract[]>;
108
+ }>;
109
+ route: ActivatedRoute;
110
+ router: Router;
111
+ auditService: AuditService;
112
+ components: ComponentMapping[];
113
+ defaultComponent: import("@angular/core").Signal<Type<unknown> | undefined>;
114
+ defaultLayoutComponent: import("@angular/core").Signal<Type<unknown> | undefined>;
115
+ /**
116
+ * Registers a list of components.
117
+ *
118
+ * * For each path, the corresponding component is registered.
119
+ * * The default component is the component registered with the path 'all'.
120
+ * * The default layout component is the component registered with the isLayout flag set to true.
121
+ * * If no layout component is registered, the default layout component is the default component.
122
+ * * If no default component is registered, the default component is the first component in the list.
123
+ *
124
+ * Those components will be used to create the routes.
125
+ *
126
+ * @deprecated use the ROUTE_COMPONENTS injection token instead
127
+ *
128
+ * @param components - An array of ComponentMapping objects to be registered.
129
+ */
130
+ register(components: ComponentMapping[]): void;
131
+ /**
132
+ * Authenticates the user with the provided credentials, initializes and creates routes.&nbsp;&nbsp;
133
+ * * in case of failure, it rejects with an error message.
134
+ * * in case of success, it resolves with `true`, shows a toast notification to welcome the user,
135
+ * and updates the application state to ready.
136
+ *
137
+ * @param {Credentials} [credentials] - The user's login credentials.
138
+ * @returns {Promise<boolean>} - A promise that resolves to `true` if login is successful,
139
+ * or rejects with an error message if login fails.
140
+ * @throws {Error} - Throws an error if the login process fails.
141
+ */
142
+ autoLogin({ credentials, withCreateRoutes }?: {
143
+ credentials?: Credentials;
144
+ withCreateRoutes?: boolean;
145
+ }): Promise<boolean>;
146
+ /**
147
+ * Initializes the application.
148
+ * - Fetches the application configuration.
149
+ * - Sets the fetched application configuration in the app store.
150
+ * - Loads the user settings and logs the state of the user settings store.
151
+ */
152
+ init(): Promise<void>;
153
+ /**
154
+ * Initializes the application and creates routes.
155
+ *
156
+ * This method performs the following actions:
157
+ * 1. Calls the `init` method to initialize the application.
158
+ * 2. Calls the `createRoutes` method to set up the application routes.
159
+ * 3. Notifies the audit service of a login event.
160
+ *
161
+ * @returns {Promise<void>} A promise that resolves when the initialization and route creation are complete.
162
+ */
163
+ initAndCreateRoutes(withCreateRoutes?: boolean): Promise<void>;
164
+ /**
165
+ * Creates dynamic routes based on the application's queries and custom JSON configurations.
166
+ *
167
+ * This method performs the following steps:
168
+ * 1. Retrieves the queries and custom JSON data from the application state.
169
+ * 2. Maps the queries to an array of objects containing query names and tabs.
170
+ * 3. Throws an error if no queries are found.
171
+ * 4. Retrieves route data from custom JSONs or falls back to default data.
172
+ * 5. Creates routes for each tab in each query, or uses the query name if no tabs are found.
173
+ * 6. Removes the current search route from the router configuration.
174
+ * 7. Creates child routes based on the provided routes data or the first query's tabs.
175
+ * 8. Updates the search route with the new child routes.
176
+ * 9. Resets the router configuration with the new routes.
177
+ *
178
+ * @throws {Error} If no queries are found.
179
+ */
180
+ private createRoutes;
181
+ static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationService, never>;
182
+ static ɵprov: i0.ɵɵInjectableDeclaration<ApplicationService>;
183
+ }
@@ -0,0 +1,96 @@
1
+ import { Injector } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import { CCWebService, Suggestion } from '@sinequa/atomic';
4
+ import { Autocomplete } from '../models/autocomplete';
5
+ import * as i0 from "@angular/core";
6
+ export declare class AutocompleteService {
7
+ readonly opened: import("@angular/core").WritableSignal<boolean>;
8
+ readonly injector: Injector;
9
+ userSettingsStore: {
10
+ bookmarks: import("@angular/core").Signal<import("@sinequa/atomic-angular").Bookmark[]>;
11
+ recentSearches: import("@angular/core").Signal<import("@sinequa/atomic-angular").RecentSearch[]>;
12
+ savedSearches: import("@angular/core").Signal<import("@sinequa/atomic-angular").SavedSearch[]>;
13
+ baskets: import("@angular/core").Signal<import("@sinequa/atomic-angular").Basket[]>;
14
+ assistants: import("@angular/core").Signal<Record<string, unknown>>;
15
+ language?: import("@angular/core").Signal<string | undefined> | undefined;
16
+ updateBookmarks: (bookmarks: import("@sinequa/atomic-angular").UserSettings["bookmarks"], auditEvents?: import("@sinequa/atomic").AuditEvents) => Promise<void>;
17
+ bookmark: (article: import("@sinequa/atomic").Article, queryName?: string) => Promise<void>;
18
+ unbookmark: (id: string) => Promise<void>;
19
+ isBookmarked: (article: Partial<import("@sinequa/atomic").Article>) => boolean;
20
+ toggleBookmark: (article: import("@sinequa/atomic").Article) => Promise<void>;
21
+ deleteRecentSearch: (index: number) => Promise<void>;
22
+ updateRecentSearches: (recentSearches: import("@sinequa/atomic-angular").UserSettings["recentSearches"], auditEvents?: import("@sinequa/atomic").AuditEvents) => Promise<void>;
23
+ addCurrentSearch: (queryParams: import("@sinequa/atomic").QueryParams) => Promise<void>;
24
+ deleteSavedSearch: (index: number) => Promise<void>;
25
+ updateSavedSearches: (savedSearches: import("@sinequa/atomic-angular").UserSettings["savedSearches"]) => Promise<void>;
26
+ deleteBasket: (index: number) => Promise<void>;
27
+ createBasket: (basket: import("@sinequa/atomic-angular").Basket) => Promise<void>;
28
+ updateBaskets: (baskets: import("@sinequa/atomic-angular").UserSettings["baskets"]) => Promise<void>;
29
+ updateBasket: (basket: import("@sinequa/atomic-angular").Basket, index: number) => Promise<void>;
30
+ addToBasket: (name: string, ids: string | string[]) => Promise<void>;
31
+ removeFromBasket: (name: string, ids: string | string[]) => Promise<void>;
32
+ updateAssistantSettings: (assistantSettings: import("@sinequa/atomic-angular").UserSettings["assistants"]) => Promise<void>;
33
+ updateLanguage: (language: import("@sinequa/atomic-angular").UserSettings["language"], auditEvents?: import("@sinequa/atomic").AuditEvents) => Promise<void>;
34
+ initialize: () => Promise<void>;
35
+ reset: () => Promise<void>;
36
+ } & import("@ngrx/signals").StateSource<{
37
+ bookmarks: import("@sinequa/atomic-angular").Bookmark[];
38
+ recentSearches: import("@sinequa/atomic-angular").RecentSearch[];
39
+ savedSearches: import("@sinequa/atomic-angular").SavedSearch[];
40
+ baskets: import("@sinequa/atomic-angular").Basket[];
41
+ assistants: Record<string, unknown>;
42
+ language?: string | undefined;
43
+ }>;
44
+ appStore: {
45
+ webServices: import("@ngrx/signals").DeepSignal<{}>;
46
+ queries: import("@ngrx/signals").DeepSignal<{}>;
47
+ customJSONs: import("@angular/core").Signal<import("@sinequa/atomic-angular").SideCJson[]>;
48
+ data: import("@ngrx/signals").DeepSignal<{}>;
49
+ customizationJson: import("@angular/core").Signal<import("@sinequa/atomic-angular").CJsonMint>;
50
+ sources: import("@angular/core").Signal<any>;
51
+ filters: import("@angular/core").Signal<any>;
52
+ initialize: () => Promise<void>;
53
+ initializeWithAppName: (appName: string) => Promise<void>;
54
+ update: (app: import("@sinequa/atomic").CCApp) => void;
55
+ getWebServiceByType: (type: CCWebService["webServiceType"]) => CCWebService | undefined;
56
+ getLabels: () => {
57
+ private: string;
58
+ public: string;
59
+ };
60
+ getQueryByName: (name: string) => import("@sinequa/atomic").CCQuery | undefined;
61
+ getQueryByIndex: (index: number) => import("@sinequa/atomic").CCQuery | undefined;
62
+ getDefaultQuery: () => import("@sinequa/atomic").CCQuery | undefined;
63
+ allowEmptySearch: (queryName: string) => boolean;
64
+ getColumnAlias: (column: string) => string;
65
+ getAuthorizedFilters: (route: import("@angular/router").ActivatedRoute) => import("@sinequa/atomic").Aggregation[];
66
+ getNamedCustomizationJson: (name: string) => any | undefined;
67
+ getAggregationIcon: (column: string) => string | undefined;
68
+ getAggregationItemsCustomization: (column: string) => import("@sinequa/atomic-angular").CFilterItem[] | undefined;
69
+ getAggregationCustomization: (column: string) => import("@sinequa/atomic-angular").CFilter | undefined;
70
+ } & import("@ngrx/signals").StateSource<{
71
+ webServices: {};
72
+ queries: {};
73
+ customJSONs: import("@sinequa/atomic-angular").SideCJson[];
74
+ data: {};
75
+ }>;
76
+ /**
77
+ * Retrieves autocomplete items for the given text, max count for each
78
+ * category handled by the service can be specified in the admin
79
+ *
80
+ * @param text Text to retrieve autocomplete items for
81
+ * @returns An observable of an array of {@link Suggestion} arrays grouped by
82
+ * suggestion queries configured in the admin
83
+ */
84
+ getFromSuggestQueriesForText(text: string): Observable<Suggestion[][]>;
85
+ /**
86
+ * Retrieves autocomplete items for the given text from the user settings
87
+ *
88
+ * @param text Text to retrieve autocomplete items for
89
+ * @param maxCount Maximum number of items to retrieve
90
+ * @returns An observable of an array of {@link Suggestion} arrays grouped by
91
+ * `recent-searches`, `saved-searches`, `bookmarks` from the user settings
92
+ */
93
+ getFromUserSettingsForText(text: string, maxCount?: number | Autocomplete): Suggestion[];
94
+ static ɵfac: i0.ɵɵFactoryDeclaration<AutocompleteService, never>;
95
+ static ɵprov: i0.ɵɵInjectableDeclaration<AutocompleteService>;
96
+ }
@@ -0,0 +1,9 @@
1
+ import { BehaviorSubject } from 'rxjs';
2
+ import * as i0 from "@angular/core";
3
+ export declare class BackdropService {
4
+ isVisible: BehaviorSubject<boolean>;
5
+ show(): void;
6
+ hide(): void;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<BackdropService, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<BackdropService>;
9
+ }
@@ -0,0 +1,70 @@
1
+ import { EventEmitter, OnDestroy, Type } from '@angular/core';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import { Article } from '@sinequa/atomic';
4
+ import * as i0 from "@angular/core";
5
+ export declare class DrawerStackService implements OnDestroy {
6
+ readonly isOpened: BehaviorSubject<boolean>;
7
+ readonly toggleTopDrawerExtension$: EventEmitter<void>;
8
+ readonly forceTopDrawerCollapse$: EventEmitter<void>;
9
+ readonly closeTopDrawer$: EventEmitter<void>;
10
+ readonly closeAllDrawers$: EventEmitter<void>;
11
+ readonly isChatOpened: BehaviorSubject<boolean>;
12
+ readonly openChatDrawer$: EventEmitter<void>;
13
+ readonly closeChatDrawer$: EventEmitter<void>;
14
+ readonly askAI$: EventEmitter<string>;
15
+ private readonly selection;
16
+ private readonly selectionHistory;
17
+ private readonly selectionStore;
18
+ private readonly navigationService;
19
+ private readonly backdropService;
20
+ private readonly subscriptions;
21
+ componentType?: Type<any>;
22
+ constructor();
23
+ ngOnDestroy(): void;
24
+ /**
25
+ * Sets current drawer stack status to open
26
+ */
27
+ open(componentType?: Type<any>): void;
28
+ /**
29
+ * Emits event to extend the top drawer
30
+ */
31
+ extend(): void;
32
+ /**
33
+ * Emits event to close the top drawer, checks if history is empty, if so,
34
+ * sets current drawer stack status to closed and clears history and current
35
+ * selection
36
+ */
37
+ close(): void;
38
+ /**
39
+ * Emits event to close the top drawer
40
+ */
41
+ closeTop(): void;
42
+ /**
43
+ * Sets current drawer stack status to closed, clears history and emits event
44
+ * to close all drawers
45
+ *
46
+ * @param keepDrawerOpen if true, do not trigger layout animation
47
+ */
48
+ closeAll(keepDrawerOpen?: boolean): void;
49
+ /**
50
+ * Replace the current selection with the given article by closing all
51
+ * drawers and opening the drawer with the new selection without triggering
52
+ * layout animation
53
+ *
54
+ * @param article the article to replace the current selection with
55
+ */
56
+ replace(article: Article | undefined): void;
57
+ /**
58
+ * Stack the given article by setting the current selection and opening the
59
+ * drawer
60
+ *
61
+ * @param article the article to stack
62
+ */
63
+ stack(article: Article | undefined, withQueryText?: boolean): void;
64
+ toggleAssistant(): void;
65
+ openAssistant(): void;
66
+ closeAssistant(keepDrawerOpen?: boolean): void;
67
+ askAI(text: string): void;
68
+ static ɵfac: i0.ɵɵFactoryDeclaration<DrawerStackService, never>;
69
+ static ɵprov: i0.ɵɵInjectableDeclaration<DrawerStackService>;
70
+ }