@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,123 @@
1
+ import { Article } from '@sinequa/atomic';
2
+ import * as i0 from "@angular/core";
3
+ export declare class SelectionService {
4
+ private readonly route;
5
+ private readonly router;
6
+ private readonly location;
7
+ private readonly selectionStore;
8
+ queryParamsStore: {
9
+ name?: import("@angular/core").Signal<string | undefined> | undefined;
10
+ text?: import("@angular/core").Signal<string | undefined> | undefined;
11
+ aggregations?: import("@angular/core").Signal<string[] | Record<string, import("@sinequa/atomic").AggregationOptions> | undefined> | undefined;
12
+ sort?: import("@angular/core").Signal<string | undefined> | undefined;
13
+ action?: import("@angular/core").Signal<"" | "open" | "search" | "aggregate" | undefined> | undefined;
14
+ select?: import("@angular/core").Signal<import("@sinequa/atomic").Select[] | undefined> | undefined;
15
+ open?: import("@angular/core").Signal<import("@sinequa/atomic").Open[] | undefined> | undefined;
16
+ page?: import("@angular/core").Signal<number | undefined> | undefined;
17
+ pageSize?: import("@angular/core").Signal<number | undefined> | undefined;
18
+ tab?: import("@angular/core").Signal<string | undefined> | undefined;
19
+ scope?: import("@angular/core").Signal<string | undefined> | undefined;
20
+ basket?: import("@angular/core").Signal<string | undefined> | undefined;
21
+ isFirstPage?: import("@angular/core").Signal<boolean | undefined> | undefined;
22
+ strictRefine?: import("@angular/core").Signal<boolean | undefined> | undefined;
23
+ globalRelevance?: import("@angular/core").Signal<number | undefined> | undefined;
24
+ questionLanguage?: import("@angular/core").Signal<string | undefined> | undefined;
25
+ questionDefaultLanguage?: import("@angular/core").Signal<string | undefined> | undefined;
26
+ spellingCorrectionMode?: import("@angular/core").Signal<import("@sinequa/atomic").SpellingCorrectionMode | undefined> | undefined;
27
+ spellingCorrectionFilter?: import("@angular/core").Signal<string | undefined> | undefined;
28
+ documentWeight?: import("@angular/core").Signal<string | undefined> | undefined;
29
+ textPartWeights?: import("@angular/core").Signal<string | undefined> | undefined;
30
+ relevanceTransforms?: import("@angular/core").Signal<string | undefined> | undefined;
31
+ removeDuplicates?: import("@angular/core").Signal<boolean | undefined> | undefined;
32
+ queryId?: import("@angular/core").Signal<string | undefined> | undefined;
33
+ orderBy?: import("@angular/core").Signal<string | undefined> | undefined;
34
+ groupBy?: import("@angular/core").Signal<string | undefined> | undefined;
35
+ neuralSearch?: import("@angular/core").Signal<boolean | undefined> | undefined;
36
+ path?: import("@angular/core").Signal<string | undefined> | undefined;
37
+ filters?: import("@angular/core").Signal<import("@sinequa/atomic").LegacyFilter[] | undefined> | undefined;
38
+ id?: import("@angular/core").Signal<string | undefined> | undefined;
39
+ setFromUrl: (url: string) => void;
40
+ addFilter: (filter: import("@sinequa/atomic").LegacyFilter) => void;
41
+ updateFilter: (filter: import("@sinequa/atomic").LegacyFilter) => void;
42
+ removeFilter: (field?: string) => void;
43
+ removeFilterByName: (name?: string) => void;
44
+ clearFilters: () => void;
45
+ patch: (params: Partial<import("../stores/query-params.store").QueryParamsState>) => void;
46
+ getFilter: (fieldOrName?: string) => Partial<import("@sinequa/atomic").LegacyFilter & {
47
+ count: number;
48
+ }> | null;
49
+ getQuery: () => import("@sinequa/atomic").Query;
50
+ } & import("@ngrx/signals").StateSource<{
51
+ name?: string | undefined;
52
+ text?: string | undefined;
53
+ aggregations?: (Record<string, import("@sinequa/atomic").AggregationOptions> | string[]) | undefined;
54
+ sort?: string | undefined;
55
+ action?: ("" | "search" | "open" | "aggregate") | undefined;
56
+ select?: import("@sinequa/atomic").Select[] | undefined;
57
+ open?: import("@sinequa/atomic").Open[] | undefined;
58
+ page?: number | undefined;
59
+ pageSize?: number | undefined;
60
+ tab?: string | undefined;
61
+ scope?: string | undefined;
62
+ basket?: string | undefined;
63
+ isFirstPage?: boolean | undefined;
64
+ strictRefine?: boolean | undefined;
65
+ globalRelevance?: number | undefined;
66
+ questionLanguage?: string | undefined;
67
+ questionDefaultLanguage?: string | undefined;
68
+ spellingCorrectionMode?: import("@sinequa/atomic").SpellingCorrectionMode | undefined;
69
+ spellingCorrectionFilter?: string | undefined;
70
+ documentWeight?: string | undefined;
71
+ textPartWeights?: string | undefined;
72
+ relevanceTransforms?: string | undefined;
73
+ removeDuplicates?: boolean | undefined;
74
+ queryId?: string | undefined;
75
+ orderBy?: string | undefined;
76
+ groupBy?: string | undefined;
77
+ neuralSearch?: boolean | undefined;
78
+ path?: string | undefined;
79
+ filters?: import("@sinequa/atomic").LegacyFilter[] | undefined;
80
+ id?: string | undefined;
81
+ }>;
82
+ /**
83
+ * Sets the current article in the selection store and optionally updates the query text.
84
+ * If the provided article is undefined, it clears the current article.
85
+ *
86
+ * @param article - The article to set as the current article. If undefined, the current article is cleared.
87
+ * @param withQueryText - A boolean indicating whether to update the query text in the selection store. Defaults to true.
88
+ *
89
+ * @returns void
90
+ */
91
+ setCurrentArticle(article?: Article, withQueryText?: boolean): void;
92
+ /**
93
+ * Clears the current article selection from the selection store and
94
+ * removes the article ID from the query parameters.
95
+ *
96
+ * @remarks
97
+ * This method performs two main actions:
98
+ * 1. Clears the current selection from the `selectionStore`.
99
+ * 2. Removes the article ID from the query parameters to ensure
100
+ * the URL does not reference the cleared article.
101
+ *
102
+ * @public
103
+ */
104
+ clearCurrentArticle(): void;
105
+ /**
106
+ * Updates the article ID in the query parameters of the current route.
107
+ * If the provided ID is undefined, it will remove the ID from the query parameters.
108
+ *
109
+ * @param id - The article ID to be set in the query parameters. If undefined, the ID will be removed.
110
+ */
111
+ private updateArticleIdInQueryParams;
112
+ /**
113
+ * Clears the 'id' parameter from the current route's query parameters.
114
+ *
115
+ * This method creates a copy of the current query parameters, removes the 'id' parameter,
116
+ * and then updates the browser's URL to reflect the change without reloading the page.
117
+ *
118
+ * @private
119
+ */
120
+ private clearArticleIdFromQueryParams;
121
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectionService, never>;
122
+ static ɵprov: i0.ɵɵInjectableDeclaration<SelectionService>;
123
+ }
@@ -0,0 +1,25 @@
1
+ import { Aggregation } from "@sinequa/atomic";
2
+ export type AggregationsState = {
3
+ aggregations: Aggregation[];
4
+ };
5
+ export declare const AggregationsStore: import("@angular/core").Type<{
6
+ aggregations: import("@angular/core").Signal<Aggregation[]>;
7
+ update: (aggregations: Aggregation[]) => void;
8
+ updateAggregation: (aggregation: Aggregation) => void;
9
+ clear: () => void;
10
+ getAggregation: (name: string, kind?: "column" | "name") => Aggregation | undefined;
11
+ } & import("@ngrx/signals").StateSource<{
12
+ aggregations: Aggregation[];
13
+ }>>;
14
+ export declare function withAggregationsFeatures(): import("@ngrx/signals").SignalStoreFeature<import("@ngrx/signals").EmptyFeatureResult, {
15
+ state: {
16
+ aggregations: Aggregation[];
17
+ };
18
+ computed: {};
19
+ methods: {
20
+ update: (aggregations: Aggregation[]) => void;
21
+ updateAggregation: (aggregation: Aggregation) => void;
22
+ clear: () => void;
23
+ getAggregation: (name: string, kind?: "column" | "name") => Aggregation | undefined;
24
+ };
25
+ }>;
@@ -0,0 +1,110 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { ActivatedRoute } from '@angular/router';
3
+ import { Aggregation, CCApp, CCQuery, CCWebService } from '@sinequa/atomic';
4
+ import { CFilter, CFilterItem, CJsonMint, SideCJson } from '../models/custom-json';
5
+ /**
6
+ * Injection token for a list of facet names to display in the application.
7
+ *
8
+ * This token provides a default list of facet names including:
9
+ * - Geo
10
+ * - Company
11
+ * - Person
12
+ * - DocFormat
13
+ * - Modified
14
+ * - Size
15
+ * - DocumentLanguages
16
+ * - Concepts
17
+ *
18
+ * @constant
19
+ * @type {InjectionToken<string[]>}
20
+ */
21
+ export declare const AGGREGATIONS_NAMES_PRESET_DEFAULT: string[];
22
+ export declare const AGGREGATIONS_NAMES: InjectionToken<string[]>;
23
+ export type CCWebServiceLabels = CCWebService & {
24
+ privateLabelsField: string;
25
+ publicLabelsField: string;
26
+ };
27
+ export type CCAppState = {
28
+ data: CJsonMint;
29
+ customJSONs: SideCJson[];
30
+ webServices: Record<string, CCWebService>;
31
+ queries: Record<string, CCQuery>;
32
+ };
33
+ export declare const AppStore: import("@angular/core").Type<{
34
+ webServices: import("@ngrx/signals").DeepSignal<{}>;
35
+ queries: import("@ngrx/signals").DeepSignal<{}>;
36
+ customJSONs: import("@angular/core").Signal<SideCJson[]>;
37
+ data: import("@ngrx/signals").DeepSignal<{}>;
38
+ customizationJson: import("@angular/core").Signal<CJsonMint>;
39
+ sources: import("@angular/core").Signal<any>;
40
+ filters: import("@angular/core").Signal<any>;
41
+ initialize: () => Promise<void>;
42
+ initializeWithAppName: (appName: string) => Promise<void>;
43
+ update: (app: CCApp) => void;
44
+ getWebServiceByType: (type: CCWebService["webServiceType"]) => CCWebService | undefined;
45
+ getLabels: () => {
46
+ private: string;
47
+ public: string;
48
+ };
49
+ getQueryByName: (name: string) => CCQuery | undefined;
50
+ getQueryByIndex: (index: number) => CCQuery | undefined;
51
+ getDefaultQuery: () => CCQuery | undefined;
52
+ allowEmptySearch: (queryName: string) => boolean;
53
+ getColumnAlias: (column: string) => string;
54
+ getAuthorizedFilters: (route: ActivatedRoute) => Aggregation[];
55
+ getNamedCustomizationJson: (name: string) => any | undefined;
56
+ getAggregationIcon: (column: string) => string | undefined;
57
+ getAggregationItemsCustomization: (column: string) => CFilterItem[] | undefined;
58
+ getAggregationCustomization: (column: string) => CFilter | undefined;
59
+ } & import("@ngrx/signals").StateSource<{
60
+ webServices: {};
61
+ queries: {};
62
+ customJSONs: SideCJson[];
63
+ data: {};
64
+ }>>;
65
+ /**
66
+ * Basic app management features
67
+ */
68
+ export declare function withAppFeatures(): import("@ngrx/signals").SignalStoreFeature<import("@ngrx/signals").EmptyFeatureResult, {
69
+ state: {
70
+ webServices: {};
71
+ queries: {};
72
+ };
73
+ computed: {};
74
+ methods: {
75
+ initialize: () => Promise<void>;
76
+ initializeWithAppName: (appName: string) => Promise<void>;
77
+ update: (app: CCApp) => void;
78
+ getWebServiceByType: (type: CCWebService["webServiceType"]) => CCWebService | undefined;
79
+ getLabels: () => {
80
+ private: string;
81
+ public: string;
82
+ };
83
+ getQueryByName: (name: string) => CCQuery | undefined;
84
+ getQueryByIndex: (index: number) => CCQuery | undefined;
85
+ getDefaultQuery: () => CCQuery | undefined;
86
+ allowEmptySearch: (queryName: string) => boolean;
87
+ getColumnAlias: (column: string) => string;
88
+ getAuthorizedFilters: (route: ActivatedRoute) => Aggregation[];
89
+ };
90
+ }>;
91
+ /**
92
+ * Management of customization JSONs features for the app
93
+ */
94
+ export declare function withAppCustomizationFeatures(): import("@ngrx/signals").SignalStoreFeature<import("@ngrx/signals").EmptyFeatureResult, {
95
+ state: {
96
+ customJSONs: SideCJson[];
97
+ data: {};
98
+ };
99
+ computed: {
100
+ customizationJson: import("@angular/core").Signal<CJsonMint>;
101
+ sources: import("@angular/core").Signal<any>;
102
+ filters: import("@angular/core").Signal<any>;
103
+ };
104
+ methods: {
105
+ getNamedCustomizationJson: (name: string) => any | undefined;
106
+ getAggregationIcon: (column: string) => string | undefined;
107
+ getAggregationItemsCustomization: (column: string) => CFilterItem[] | undefined;
108
+ getAggregationCustomization: (column: string) => CFilter | undefined;
109
+ };
110
+ }>;
@@ -0,0 +1,83 @@
1
+ import { SafeHtml } from '@angular/platform-browser';
2
+ export type Extract = {
3
+ id: string;
4
+ text: SafeHtml;
5
+ startIndex: number;
6
+ relevanceIndex: number;
7
+ textIndex: number;
8
+ };
9
+ export type ApplicationState = {
10
+ assistantReady: boolean;
11
+ ready: boolean;
12
+ extracts: Map<string, Extract[]>;
13
+ hasLabelsAccess: boolean;
14
+ };
15
+ export declare const ApplicationStore: import("@angular/core").Type<{
16
+ assistantReady: import("@angular/core").Signal<boolean>;
17
+ ready: import("@angular/core").Signal<boolean>;
18
+ hasLabelsAccess: import("@angular/core").Signal<boolean>;
19
+ extracts: import("@angular/core").Signal<Map<string, Extract[]>>;
20
+ extractsCount: import("@angular/core").Signal<number>;
21
+ updateAssistantReady: () => void;
22
+ updateReadyState: (value?: boolean) => void;
23
+ updateHasLabelsAccess: (value?: boolean) => void;
24
+ updateExtracts: (id: string, extracts: Extract[]) => void;
25
+ getExtracts: (id: string) => Extract[] | undefined;
26
+ } & import("@ngrx/signals").WritableStateSource<{
27
+ assistantReady: boolean;
28
+ ready: boolean;
29
+ hasLabelsAccess: boolean;
30
+ extracts: Map<string, Extract[]>;
31
+ }>>;
32
+ /**
33
+ * Enhances the application store with additional features.
34
+ *
35
+ * This function integrates several features into the application store, including state management,
36
+ * computed properties, and various methods for updating and retrieving application state.
37
+ *
38
+ * Features included:
39
+ * - State initialization with `intialState`.
40
+ * - Methods for updating the application state:
41
+ * - `updateAssistantReady`: Marks the assistant as ready.
42
+ * - `updateReadyState`: Sets the application store's ready state to true.
43
+ *
44
+ * @returns A configured signal store feature with state, computed properties, and methods.
45
+ */
46
+ export declare function withApplicationFeatures(): import("@ngrx/signals").SignalStoreFeature<import("@ngrx/signals").EmptyFeatureResult, {
47
+ state: {
48
+ assistantReady: boolean;
49
+ ready: boolean;
50
+ hasLabelsAccess: boolean;
51
+ };
52
+ computed: {};
53
+ methods: {
54
+ updateAssistantReady: () => void;
55
+ updateReadyState: (value?: boolean) => void;
56
+ updateHasLabelsAccess: (value?: boolean) => void;
57
+ };
58
+ }>;
59
+ /**
60
+ * Provides features related to extracts within the application store.
61
+ *
62
+ * This function integrates state management, computed properties, and methods
63
+ * for handling extracts in the application store.
64
+ *
65
+ * Features:
66
+ * - State management for extracts.
67
+ * - Computed property to get the count of extracts.
68
+ * - Methods to update and retrieve extracts.
69
+ *
70
+ * @returns A configured signal store feature with state, computed properties, and methods for extracts.
71
+ */
72
+ export declare function withExtractsFeatures(): import("@ngrx/signals").SignalStoreFeature<import("@ngrx/signals").EmptyFeatureResult, {
73
+ state: {
74
+ extracts: Map<string, Extract[]>;
75
+ };
76
+ computed: {
77
+ extractsCount: import("@angular/core").Signal<number>;
78
+ };
79
+ methods: {
80
+ updateExtracts: (id: string, extracts: Extract[]) => void;
81
+ getExtracts: (id: string) => Extract[] | undefined;
82
+ };
83
+ }>;
@@ -0,0 +1,8 @@
1
+ export * from "./aggregations.store";
2
+ export * from "./app.store";
3
+ export * from "./application.store";
4
+ export * from "./principal.store";
5
+ export * from "./query-params.store";
6
+ export * from "./selection.store";
7
+ export * from "./theme.store";
8
+ export * from "./user-settings.store";
@@ -0,0 +1,47 @@
1
+ import { Principal } from "@sinequa/atomic";
2
+ export type PrincipalState = {
3
+ principal: Principal;
4
+ userOverrideActive: boolean;
5
+ };
6
+ export declare const PrincipalStore: import("@angular/core").Type<{
7
+ principal: import("@ngrx/signals").DeepSignal<Principal>;
8
+ userOverrideActive: import("@angular/core").Signal<boolean>;
9
+ allowUserOverride: import("@angular/core").Signal<boolean>;
10
+ isOverridingUser: import("@angular/core").Signal<boolean>;
11
+ initialize: () => Promise<void>;
12
+ } & import("@ngrx/signals").StateSource<{
13
+ principal: Principal;
14
+ userOverrideActive: boolean;
15
+ }>>;
16
+ /**
17
+ * Enhances the store with principal-related features.
18
+ *
19
+ * This function integrates state, methods, and computed properties related to the principal.
20
+ *
21
+ * @returns A feature that can be added to a signal store.
22
+ *
23
+ * @feature
24
+ * - State:
25
+ * - `principal`: An object representing the principal.
26
+ * - `userOverrideActive`: A boolean indicating if user override is active.
27
+ *
28
+ * - Methods:
29
+ * - `initialize()`: Initializes the principal state by fetching the principal data from the `PrincipalService`.
30
+ *
31
+ * - Computed Properties:
32
+ * - `allowUserOverride`: A computed boolean indicating if user override is allowed based on the principal's administrator status and the `userOverrideActive` state.
33
+ * - `isOverridingUser`: A computed boolean indicating if the user override is currently active.
34
+ */
35
+ export declare function withPrincipalFeatures(): import("@ngrx/signals").SignalStoreFeature<import("@ngrx/signals").EmptyFeatureResult, {
36
+ state: {};
37
+ computed: {};
38
+ methods: {
39
+ /**
40
+ * Initializes the principal store by fetching the principal data from the principal service.
41
+ * It patches the store with the fetched principal data and a user override active flag from the global configuration.
42
+ *
43
+ * @returns A promise that resolves when the principal data has been fetched and the store has been patched.
44
+ */
45
+ initialize(): Promise<void>;
46
+ };
47
+ }>;
@@ -0,0 +1,128 @@
1
+ import { LegacyFilter, Query, SpellingCorrectionMode } from '@sinequa/atomic';
2
+ export type QueryParamsState = Partial<Omit<Query, "filters">> & {
3
+ path?: string;
4
+ filters?: LegacyFilter[];
5
+ id?: string;
6
+ };
7
+ export declare const QueryParamsStore: import("@angular/core").Type<{
8
+ name?: import("@angular/core").Signal<string | undefined> | undefined;
9
+ text?: import("@angular/core").Signal<string | undefined> | undefined;
10
+ aggregations?: import("@angular/core").Signal<string[] | Record<string, import("@sinequa/atomic").AggregationOptions> | undefined> | undefined;
11
+ sort?: import("@angular/core").Signal<string | undefined> | undefined;
12
+ action?: import("@angular/core").Signal<"" | "open" | "search" | "aggregate" | undefined> | undefined;
13
+ select?: import("@angular/core").Signal<import("@sinequa/atomic").Select[] | undefined> | undefined;
14
+ open?: import("@angular/core").Signal<import("@sinequa/atomic").Open[] | undefined> | undefined;
15
+ page?: import("@angular/core").Signal<number | undefined> | undefined;
16
+ pageSize?: import("@angular/core").Signal<number | undefined> | undefined;
17
+ tab?: import("@angular/core").Signal<string | undefined> | undefined;
18
+ scope?: import("@angular/core").Signal<string | undefined> | undefined;
19
+ basket?: import("@angular/core").Signal<string | undefined> | undefined;
20
+ isFirstPage?: import("@angular/core").Signal<boolean | undefined> | undefined;
21
+ strictRefine?: import("@angular/core").Signal<boolean | undefined> | undefined;
22
+ globalRelevance?: import("@angular/core").Signal<number | undefined> | undefined;
23
+ questionLanguage?: import("@angular/core").Signal<string | undefined> | undefined;
24
+ questionDefaultLanguage?: import("@angular/core").Signal<string | undefined> | undefined;
25
+ spellingCorrectionMode?: import("@angular/core").Signal<SpellingCorrectionMode | undefined> | undefined;
26
+ spellingCorrectionFilter?: import("@angular/core").Signal<string | undefined> | undefined;
27
+ documentWeight?: import("@angular/core").Signal<string | undefined> | undefined;
28
+ textPartWeights?: import("@angular/core").Signal<string | undefined> | undefined;
29
+ relevanceTransforms?: import("@angular/core").Signal<string | undefined> | undefined;
30
+ removeDuplicates?: import("@angular/core").Signal<boolean | undefined> | undefined;
31
+ queryId?: import("@angular/core").Signal<string | undefined> | undefined;
32
+ orderBy?: import("@angular/core").Signal<string | undefined> | undefined;
33
+ groupBy?: import("@angular/core").Signal<string | undefined> | undefined;
34
+ neuralSearch?: import("@angular/core").Signal<boolean | undefined> | undefined;
35
+ path?: import("@angular/core").Signal<string | undefined> | undefined;
36
+ filters?: import("@angular/core").Signal<LegacyFilter[] | undefined> | undefined;
37
+ id?: import("@angular/core").Signal<string | undefined> | undefined;
38
+ setFromUrl: (url: string) => void;
39
+ addFilter: (filter: LegacyFilter) => void;
40
+ updateFilter: (filter: LegacyFilter) => void;
41
+ removeFilter: (field?: string) => void;
42
+ removeFilterByName: (name?: string) => void;
43
+ clearFilters: () => void;
44
+ patch: (params: Partial<QueryParamsState>) => void;
45
+ getFilter: (fieldOrName?: string) => Partial<LegacyFilter & {
46
+ count: number;
47
+ }> | null;
48
+ getQuery: () => Query;
49
+ } & import("@ngrx/signals").StateSource<{
50
+ name?: string | undefined;
51
+ text?: string | undefined;
52
+ aggregations?: (Record<string, import("@sinequa/atomic").AggregationOptions> | string[]) | undefined;
53
+ sort?: string | undefined;
54
+ action?: ("" | "search" | "open" | "aggregate") | undefined;
55
+ select?: import("@sinequa/atomic").Select[] | undefined;
56
+ open?: import("@sinequa/atomic").Open[] | undefined;
57
+ page?: number | undefined;
58
+ pageSize?: number | undefined;
59
+ tab?: string | undefined;
60
+ scope?: string | undefined;
61
+ basket?: string | undefined;
62
+ isFirstPage?: boolean | undefined;
63
+ strictRefine?: boolean | undefined;
64
+ globalRelevance?: number | undefined;
65
+ questionLanguage?: string | undefined;
66
+ questionDefaultLanguage?: string | undefined;
67
+ spellingCorrectionMode?: SpellingCorrectionMode | undefined;
68
+ spellingCorrectionFilter?: string | undefined;
69
+ documentWeight?: string | undefined;
70
+ textPartWeights?: string | undefined;
71
+ relevanceTransforms?: string | undefined;
72
+ removeDuplicates?: boolean | undefined;
73
+ queryId?: string | undefined;
74
+ orderBy?: string | undefined;
75
+ groupBy?: string | undefined;
76
+ neuralSearch?: boolean | undefined;
77
+ path?: string | undefined;
78
+ filters?: LegacyFilter[] | undefined;
79
+ id?: string | undefined;
80
+ }>>;
81
+ export declare function withQueryParamsFeatures(): import("@ngrx/signals").SignalStoreFeature<import("@ngrx/signals").EmptyFeatureResult, {
82
+ state: {
83
+ name?: string | undefined;
84
+ text?: string | undefined;
85
+ aggregations?: (Record<string, import("@sinequa/atomic").AggregationOptions> | string[]) | undefined;
86
+ sort?: string | undefined;
87
+ action?: ("" | "search" | "open" | "aggregate") | undefined;
88
+ select?: import("@sinequa/atomic").Select[] | undefined;
89
+ open?: import("@sinequa/atomic").Open[] | undefined;
90
+ page?: number | undefined;
91
+ pageSize?: number | undefined;
92
+ tab?: string | undefined;
93
+ scope?: string | undefined;
94
+ basket?: string | undefined;
95
+ isFirstPage?: boolean | undefined;
96
+ strictRefine?: boolean | undefined;
97
+ globalRelevance?: number | undefined;
98
+ questionLanguage?: string | undefined;
99
+ questionDefaultLanguage?: string | undefined;
100
+ spellingCorrectionMode?: SpellingCorrectionMode | undefined;
101
+ spellingCorrectionFilter?: string | undefined;
102
+ documentWeight?: string | undefined;
103
+ textPartWeights?: string | undefined;
104
+ relevanceTransforms?: string | undefined;
105
+ removeDuplicates?: boolean | undefined;
106
+ queryId?: string | undefined;
107
+ orderBy?: string | undefined;
108
+ groupBy?: string | undefined;
109
+ neuralSearch?: boolean | undefined;
110
+ path?: string | undefined;
111
+ filters?: LegacyFilter[] | undefined;
112
+ id?: string | undefined;
113
+ };
114
+ computed: {};
115
+ methods: {
116
+ setFromUrl: (url: string) => void;
117
+ addFilter: (filter: LegacyFilter) => void;
118
+ updateFilter: (filter: LegacyFilter) => void;
119
+ removeFilter: (field?: string) => void;
120
+ removeFilterByName: (name?: string) => void;
121
+ clearFilters: () => void;
122
+ patch: (params: Partial<QueryParamsState>) => void;
123
+ getFilter: (fieldOrName?: string) => Partial<LegacyFilter & {
124
+ count: number;
125
+ }> | null;
126
+ getQuery: () => Query;
127
+ };
128
+ }>;
@@ -0,0 +1,52 @@
1
+ import { Article, CustomHighlights } from "@sinequa/atomic";
2
+ export type PreviewHighlights = {
3
+ highlights: CustomHighlights[];
4
+ snippetId?: number;
5
+ };
6
+ export type SelectionState = {
7
+ article: Article;
8
+ id: string;
9
+ queryText: string;
10
+ previewHighlights: PreviewHighlights;
11
+ };
12
+ /**
13
+ * @constant
14
+ * @name SelectionStore
15
+ * @description
16
+ * A store that manages the selection state of articles. It is provided in the root of the application and includes
17
+ * development tools for easier debugging. The store maintains the state with the following properties:
18
+ * - `article`: The selected article.
19
+ * - `id`: The ID of the selected article.
20
+ * - `queryText`: The query text associated with the selection.
21
+ *
22
+ * @methods
23
+ * - `update(article: Article, queryText?: string)`: Updates the store with a new article and optional query text.
24
+ * - `updateQueryText(queryText: string)`: Updates the query text in the store.
25
+ * - `clear()`: Clears the selection state, setting `article`, `id`, and `queryText` to `undefined`.
26
+ */
27
+ export declare const SelectionStore: import("@angular/core").Type<{
28
+ article: import("@ngrx/signals").DeepSignal<Article>;
29
+ id: import("@angular/core").Signal<string>;
30
+ queryText: import("@angular/core").Signal<string>;
31
+ previewHighlights: import("@ngrx/signals").DeepSignal<PreviewHighlights>;
32
+ update: (newState: Partial<SelectionState>) => void;
33
+ clear: () => void;
34
+ } & import("@ngrx/signals").StateSource<{
35
+ article: Article;
36
+ id: string;
37
+ queryText: string;
38
+ previewHighlights: PreviewHighlights;
39
+ }>>;
40
+ export declare function withSelectionFeatures(): import("@ngrx/signals").SignalStoreFeature<import("@ngrx/signals").EmptyFeatureResult, {
41
+ state: {
42
+ article: Article;
43
+ id: string;
44
+ queryText: string;
45
+ previewHighlights: PreviewHighlights;
46
+ };
47
+ computed: {};
48
+ methods: {
49
+ update: (newState: Partial<SelectionState>) => void;
50
+ clear: () => void;
51
+ };
52
+ }>;
@@ -0,0 +1,66 @@
1
+ export type CssVars = {
2
+ light?: Record<string, string>;
3
+ dark?: Record<string, string>;
4
+ };
5
+ export type ThemeScope = {
6
+ [key: string]: {
7
+ cssVars: CssVars;
8
+ darkMode?: boolean;
9
+ themeName: string;
10
+ };
11
+ };
12
+ export type ThemeStoreState = {
13
+ scopes: ThemeScope;
14
+ };
15
+ export declare const ThemeStore: import("@angular/core").Type<{
16
+ scopes: import("@angular/core").Signal<ThemeScope>;
17
+ loadDefaultTheme: (scope: string, darkMode?: boolean) => void;
18
+ setCurrentTheme: (scope: string, themeName: string, darkMode?: boolean) => void;
19
+ setDarkMode: (scope: string, darkMode: boolean) => void;
20
+ } & import("@ngrx/signals").StateSource<{
21
+ scopes: ThemeScope;
22
+ }>>;
23
+ export declare function withThemesFeatures(): import("@ngrx/signals").SignalStoreFeature<import("@ngrx/signals").EmptyFeatureResult, {
24
+ state: {
25
+ scopes: ThemeScope;
26
+ };
27
+ computed: {};
28
+ methods: {
29
+ loadDefaultTheme: (scope: string, darkMode?: boolean) => void;
30
+ setCurrentTheme: (scope: string, themeName: string, darkMode?: boolean) => void;
31
+ setDarkMode: (scope: string, darkMode: boolean) => void;
32
+ };
33
+ }>;
34
+ /**
35
+ * Processes the CSS variables for a given theme name.
36
+ *
37
+ * @param themeName - The name of the theme to process.
38
+ * @returns An object containing the CSS variables for both light and dark themes.
39
+ * @throws Will throw an error if the theme with the specified name is not found.
40
+ */
41
+ export declare function processCssVars(themeName: string): CssVars;
42
+ /**
43
+ * Converts an object of theme colors to CSS variables.
44
+ *
45
+ * @param colors - An object where keys are theme color names and values are the corresponding color values.
46
+ * @returns An object where keys are CSS variable names and values are the corresponding color values.
47
+ */
48
+ export declare function themeColorsToCssVariables(colors: any): any;
49
+ /**
50
+ * Converts a camelCase theme color name to a CSS variable format.
51
+ *
52
+ * This function takes a camelCase string and transforms it into a CSS variable
53
+ * name by inserting hyphens between lowercase and uppercase letters and converting
54
+ * the entire string to lowercase.
55
+ *
56
+ * @param name - The camelCase theme color name to be converted.
57
+ * @returns The corresponding CSS variable name in kebab-case.
58
+ */
59
+ export declare function themeColorNameToCssVariable(name: string): string;
60
+ /**
61
+ * Applies a set of CSS variables to a given HTML element.
62
+ *
63
+ * @param element - The HTML element to which the CSS variables will be applied.
64
+ * @param cssVars - An optional record of CSS variable names and their corresponding values.
65
+ */
66
+ export declare function applyThemeToNativeElement(element: HTMLElement, cssVars?: Record<string, string>): void;