@epam/statgpt-conversation-view 0.7.0-dev.3 → 0.7.0-dev.31

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 (27) hide show
  1. package/components/AdvancedView/Filters/FiltersModal/filter-settings-controller.d.ts +47 -0
  2. package/components/AdvancedView/Filters/hooks/use-filter-apply.d.ts +36 -0
  3. package/components/AdvancedView/Filters/hooks/use-filter-constraints.d.ts +59 -0
  4. package/components/AdvancedView/Filters/hooks/use-filter-initialization.d.ts +40 -0
  5. package/components/AdvancedView/Filters/hooks/use-filter-modal-state.d.ts +49 -0
  6. package/components/AdvancedView/Filters/hooks/use-filter-system-message.d.ts +35 -0
  7. package/components/AdvancedView/Filters/hooks/use-filter-values-loading.d.ts +5 -0
  8. package/components/AdvancedView/Filters/hooks/use-filters.d.ts +49 -0
  9. package/components/AdvancedView/Filters/hooks/use-single-dataset-filters.d.ts +7 -0
  10. package/components/AdvancedView/Filters/hooks/use-single-filter-strategy.d.ts +22 -0
  11. package/components/AdvancedView/MultiDatasetFilters/hooks/use-multi-dataset-display-data-queries.d.ts +3 -0
  12. package/components/AdvancedView/MultiDatasetFilters/hooks/use-multi-dataset-filters.d.ts +7 -0
  13. package/components/AdvancedView/MultiDatasetFilters/hooks/use-multi-filter-strategy.d.ts +27 -0
  14. package/components/Attachments/GridCellRenderers/helpers/get-observation-metadata-content.d.ts +2 -2
  15. package/constants/grid.d.ts +3 -0
  16. package/index.d.ts +6 -0
  17. package/index.js +9 -11
  18. package/index.mjs +10477 -19282
  19. package/models/attachments-styles.d.ts +1 -1
  20. package/models/filters.d.ts +1 -0
  21. package/package.json +19 -20
  22. package/utils/attachments/attachment-parser.d.ts +3 -2
  23. package/utils/attachments/python-attachment.d.ts +11 -1
  24. package/utils/attachments/replace-python-attachment.d.ts +4 -1
  25. package/utils/query-filters.d.ts +11 -1
  26. package/utils/single-dataset-filters.d.ts +24 -0
  27. package/LICENSE +0 -21
@@ -7,7 +7,7 @@ export interface AttachmentsStyles {
7
7
  openAdvancedViewIcon?: ReactNode;
8
8
  advancedViewTitle?: string;
9
9
  chartingStyles?: ChartingStyles;
10
- chartingIcons: Record<ChartingIcon, ReactNode>;
10
+ chartingIcons?: Record<ChartingIcon, ReactNode>;
11
11
  downloadIcon?: ReactNode;
12
12
  downloadChevronIcon?: ReactNode;
13
13
  openLinkTitle?: string;
@@ -29,6 +29,7 @@ export interface SharedFilter extends FilterBase {
29
29
  sourceFilterIdsByDataset?: Record<string, string>;
30
30
  }
31
31
  export type Filter = DatasetFilter | SharedFilter;
32
+ export type FilterMode = 'single' | 'multi';
32
33
  export interface FilterValueSource {
33
34
  datasetUrn?: string;
34
35
  id: string;
package/package.json CHANGED
@@ -1,35 +1,34 @@
1
1
  {
2
2
  "name": "@epam/statgpt-conversation-view",
3
- "version": "0.7.0-dev.3",
3
+ "version": "0.7.0-dev.31",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
- "classnames": "^2.5.1",
6
+ "@epam/statgpt-conversation-list": "0.7.0-dev.31",
7
+ "@epam/statgpt-dial-toolkit": "0.7.0-dev.31",
8
+ "@epam/statgpt-sdmx-toolkit": "0.7.0-dev.31",
9
+ "@epam/statgpt-shared-toolkit": "0.7.0-dev.31",
10
+ "@epam/statgpt-ui-components": "0.7.0-dev.31"
11
+ },
12
+ "peerDependencies": {
7
13
  "@epam/ai-dial-shared": "^0.43.3",
14
+ "@floating-ui/react": "^0.27.14",
15
+ "@monaco-editor/react": "^4.7.0",
8
16
  "@tabler/icons-react": "^3.34.1",
9
- "@epam/statgpt-shared-toolkit": "0.7.0-dev.3",
10
- "@epam/statgpt-ui-components": "0.7.0-dev.3",
11
- "@epam/statgpt-sdmx-toolkit": "0.7.0-dev.3",
12
- "react-window": "^1.8.11",
13
- "react-virtualized-auto-sizer": "^1.0.26",
14
17
  "ag-grid-community": "33.3.2",
15
18
  "ag-grid-react": "^33.3.2",
16
- "@floating-ui/react": "^0.27.14",
19
+ "classnames": "^2.5.1",
20
+ "date-fns": "^4.1.0",
17
21
  "echarts": "^5.6.0",
18
22
  "echarts-for-react": "^3.0.2",
19
- "@epam/statgpt-dial-toolkit": "0.7.0-dev.3",
20
- "react-markdown": "^10.1.0",
21
- "remark-gfm": "^4.0.1",
22
- "@epam/statgpt-conversation-list": "0.7.0-dev.3",
23
23
  "flatpickr": "4.6.13",
24
- "react-flatpickr": "^4.0.11",
25
- "date-fns": "^4.1.0",
26
24
  "lodash": "^4.17.23",
27
- "tailwind-merge": "^3.4.0",
28
- "@monaco-editor/react": "^4.7.0",
29
- "@testing-library/jest-dom": "^6.6.3"
30
- },
31
- "peerDependencies": {
32
- "react": "^19.2.1"
25
+ "react": "^19.2.1",
26
+ "react-flatpickr": "^4.0.11",
27
+ "react-markdown": "^10.1.0",
28
+ "react-virtualized-auto-sizer": "^1.0.26",
29
+ "react-window": "^1.8.11",
30
+ "remark-gfm": "^4.0.1",
31
+ "tailwind-merge": "^3.4.0"
33
32
  },
34
33
  "exports": {
35
34
  ".": {
@@ -1,15 +1,16 @@
1
1
  import { Attachment } from '@epam/ai-dial-shared';
2
2
  import { Message } from '../../../../dial-toolkit/src/index';
3
+ import { CrossDatasetGridAttachmentType, CustomGridAttachment } from '../../models/attachments';
3
4
  export declare const parseMessageAttachments: (message: Message) => Attachment[];
4
5
  export declare function isUrlAttachment(attachment: Attachment): boolean;
5
6
  export declare function isJsonAttachment(attachment: Attachment): boolean;
6
7
  export declare function isMarkdownAttachment(attachment: Attachment): boolean;
7
8
  export declare function isFileAttachment(attachment: Attachment): boolean;
8
9
  export declare function isGridAttachment(attachment: Attachment): boolean;
9
- export declare function isCustomGridAttachment(attachment: Attachment): boolean;
10
+ export declare function isCustomGridAttachment(attachment: Attachment): attachment is CustomGridAttachment;
10
11
  export declare function isCustomChartAttachment(attachment: Attachment): boolean;
11
12
  export declare function isChartAttachment(attachment: Attachment): boolean;
12
13
  export declare function isCustomCodeSampleAttachment(attachment: Attachment): boolean;
13
- export declare function isCrossDatasetGrid(attachment: Attachment): boolean;
14
+ export declare function isCrossDatasetGrid(attachment: Attachment): attachment is CrossDatasetGridAttachmentType;
14
15
  export declare function isAnyGridAttachment(attachment: Attachment): boolean;
15
16
  export declare function hasPythonCodeAttachment(attachments?: Attachment[]): boolean;
@@ -3,6 +3,14 @@ import { Attachment } from '@epam/ai-dial-shared';
3
3
  import { DataQuery } from '../../../../shared-toolkit/src/index';
4
4
  import { CustomCodeAttachment } from '../../models/attachments';
5
5
  import { GetPythonAttachment } from '../../types/actions';
6
+ /**
7
+ * Resolves the title for a single dataset's persisted python markdown attachment.
8
+ *
9
+ * Reuses the dataset's existing python attachment title — matched by the dataset
10
+ * urn appearing in the title — so the regenerated sample stays scoped to that
11
+ * dataset; falls back to the dataset urn when no matching sample exists.
12
+ */
13
+ export declare function resolveSingleDatasetPythonTitle(rawAttachments: Attachment[] | undefined, dataQuery: DataQuery): string;
6
14
  /**
7
15
  * Calls the python attachment API with stale-request protection and applies
8
16
  * the result to local state and the persisted conversation.
@@ -14,6 +22,7 @@ import { GetPythonAttachment } from '../../types/actions';
14
22
  * @param options.markdownTitle - Title for the raw markdown attachment written back to the conversation.
15
23
  * @param options.setCodeAttachments - State setter that replaces the current code attachment list.
16
24
  * @param options.onCodeAttachmentUpdated - Optional callback to persist the updated markdown attachment.
25
+ * @param options.datasetUrn - Optional dataset URN forwarded to onCodeAttachmentUpdated to scope persistence to one dataset.
17
26
  */
18
27
  export declare function invokePythonAttachment(options: {
19
28
  getPythonAttachment: GetPythonAttachment;
@@ -21,6 +30,7 @@ export declare function invokePythonAttachment(options: {
21
30
  requestIdRef: RefObject<number>;
22
31
  codeTitle: string;
23
32
  markdownTitle: string;
33
+ datasetUrn?: string;
24
34
  setCodeAttachments: (attachments: CustomCodeAttachment[]) => void;
25
- onCodeAttachmentUpdated?: (attachment: Attachment) => void;
35
+ onCodeAttachmentUpdated?: (attachment: Attachment, datasetUrn?: string) => void;
26
36
  }): void;
@@ -4,7 +4,10 @@ import { Message } from '../../../../dial-toolkit/src/index';
4
4
  * Replaces the python code-sample attachment in a message's attachment list.
5
5
  * When messageId is provided the matching message is targeted; otherwise the
6
6
  * latest system message is used (AdvancedView path, which has no id).
7
+ * When datasetUrn is provided, only the python attachment whose title includes
8
+ * that URN is replaced and other python attachments are preserved; otherwise
9
+ * all python attachments are replaced by the single new one.
7
10
  * Returns the updated messages array, or null when the target message is not
8
11
  * found or is not a System message.
9
12
  */
10
- export declare function replacePythonAttachment(messages: Message[], newAttachment: Attachment, messageId?: string): Message[] | null;
13
+ export declare function replacePythonAttachment(messages: Message[], newAttachment: Attachment, messageId?: string, datasetUrn?: string): Message[] | null;
@@ -4,6 +4,16 @@ import { Filter } from '../models/filters';
4
4
  export declare const getQueryTimeSeriesFilters: (filters: Filter[]) => QueryFilter[];
5
5
  export declare const getTimeQueryFilterFromAttachment: (dataQuery: DataQuery, dimensions?: DimensionList) => string | null;
6
6
  export declare const getQueryFilters: (filters: Filter[], dimensions?: Dimension[], datasetUrn?: string) => DatasetQueryFilters;
7
- export declare const buildDataQueryWithMergedFilters: (dataQuery: DataQuery, uiFilters: Filter[]) => DataQuery;
7
+ /**
8
+ * Merges the UI filter selection into a DataQuery for the python attachment.
9
+ *
10
+ * `scopeToDatasetUrn` selects how UI filters are resolved to this dataset:
11
+ * - cross-dataset mode keeps the default `true`, so filters are resolved per
12
+ * dataset by URN (shared filters expanded, picked via `buildFiltersMap`);
13
+ * - single-dataset mode passes `false`, so the filters are used as-is
14
+ * (mirroring the grid's `getQueryFilters(filters, dimensions)` call). Single-
15
+ * dataset filters carry no `datasetUrn`, so URN scoping would drop them.
16
+ */
17
+ export declare const buildDataQueryWithMergedFilters: (dataQuery: DataQuery, uiFilters: Filter[], scopeToDatasetUrn?: boolean) => DataQuery;
8
18
  export declare const setDataQueryFilters: (filters: Filter[], datasetUrn?: string) => QueryFilter[];
9
19
  export declare const buildQueryFiltersForPythonAttachment: (filters: Filter[], datasetUrn?: string) => QueryFilter[];
@@ -0,0 +1,24 @@
1
+ import { DataConstraints, Dimension, SeriesFilterDto, StructuralData, StructuralMetaData, StructureItemBase } from '../../../sdmx-toolkit/src/index';
2
+ import { DataQuery } from '../../../shared-toolkit/src/index';
3
+ import { Filter, FiltersProps } from '../models/filters';
4
+ export declare const getCodelistUrnForDatasetFilter: (filter: Filter, dimensions?: Dimension[], structures?: StructuralData) => string | undefined;
5
+ export declare const getSingleDatasetConstraintFilters: (filters: Filter[]) => SeriesFilterDto[];
6
+ export declare const getSingleDatasetConstraintsRequest: (actions: FiltersProps["actions"] | undefined, attachmentUrn: string, filters: Filter[]) => {
7
+ request: Promise<StructuralMetaData | undefined>;
8
+ shouldTrackLoading: boolean;
9
+ };
10
+ export declare const getSingleDatasetFiltersFilledByConstraints: ({ dimensions, structures, structureDimensions, locale, constraints, }: {
11
+ dimensions?: Dimension[];
12
+ structures?: StructuralData;
13
+ structureDimensions?: StructureItemBase[];
14
+ locale?: string;
15
+ constraints?: DataConstraints[];
16
+ }) => Filter[];
17
+ export declare const getSingleDatasetFiltersPreselectedByDataQuery: ({ dimensions, structures, structureDimensions, locale, constraints, dataQuery, }: {
18
+ dimensions?: Dimension[];
19
+ structures?: StructuralData;
20
+ structureDimensions?: StructureItemBase[];
21
+ locale?: string;
22
+ constraints?: DataConstraints[];
23
+ dataQuery?: DataQuery;
24
+ }) => Filter[];
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 EPAM Systems
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.