@sisense/sdk-ui 2.28.0 → 2.29.0

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 (98) hide show
  1. package/dist/ai.cjs +1 -1
  2. package/dist/ai.js +5 -5
  3. package/dist/analytics-composer/node.cjs +1 -1
  4. package/dist/analytics-composer/node.js +1256 -1203
  5. package/dist/analytics-composer.cjs +7 -7
  6. package/dist/analytics-composer.js +19 -18
  7. package/dist/apply-styled-options-to-query-CaP4IMrQ.js +6379 -0
  8. package/dist/apply-styled-options-to-query-D5D8pRl2.cjs +1 -0
  9. package/dist/index.cjs +398 -398
  10. package/dist/index.js +22490 -21772
  11. package/dist/index.umd.js +700 -700
  12. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/get-dashboard-model.d.ts +7 -0
  13. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +2 -2
  14. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/persist-dashboard-model-middleware.d.ts +10 -1
  15. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/types.d.ts +29 -1
  16. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-updates-persistence.d.ts +27 -0
  17. package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/deep-merge.d.ts +17 -0
  18. package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/types.d.ts +15 -0
  19. package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/update-types.d.ts +51 -0
  20. package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/data.d.ts +0 -1
  21. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/filter-and-aggregate-chart-data.d.ts +2 -2
  22. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/types.d.ts +27 -23
  23. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/utils.d.ts +4 -4
  24. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/filter-to-readable-label.d.ts +14 -0
  25. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/index.d.ts +1 -0
  26. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition.d.ts +5 -0
  27. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill.d.ts +5 -0
  28. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/truncate-pill-label.d.ts +10 -0
  29. package/dist/packages/sdk-ui/src/domains/widgets/change-events.d.ts +6 -0
  30. package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/types.d.ts +11 -0
  31. package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/pivot-table-widget.d.ts +15 -0
  32. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +41 -2
  33. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +6 -0
  34. package/dist/packages/sdk-ui/src/domains/widgets/hooks/use-track-widget-init.d.ts +44 -0
  35. package/dist/packages/sdk-ui/src/domains/widgets/hooks/widget-entity-id.d.ts +30 -0
  36. package/dist/packages/sdk-ui/src/domains/widgets/hooks/widget-tracking-adapters.d.ts +41 -0
  37. package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-style-utils.d.ts +29 -0
  38. package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/to-widget-dto-panels.d.ts +29 -1
  39. package/dist/packages/sdk-ui/src/infra/api/rest-api.d.ts +2 -1
  40. package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +1 -7
  41. package/dist/packages/sdk-ui/src/infra/app/settings/types/features.d.ts +1 -9
  42. package/dist/packages/sdk-ui/src/infra/app/types.d.ts +14 -0
  43. package/dist/packages/sdk-ui/src/infra/contexts/sisense-context/sisense-context-provider.d.ts +1 -1
  44. package/dist/packages/sdk-ui/src/infra/formatting/format-data-set.d.ts +21 -0
  45. package/dist/packages/sdk-ui/src/infra/formatting/format-date.d.ts +67 -0
  46. package/dist/packages/sdk-ui/src/infra/formatting/format-number.d.ts +24 -0
  47. package/dist/packages/sdk-ui/src/infra/formatting/index.d.ts +5 -0
  48. package/dist/packages/sdk-ui/src/infra/modules/build-module-graph.d.ts +31 -0
  49. package/dist/packages/sdk-ui/src/infra/modules/build-module-registry.d.ts +31 -0
  50. package/dist/packages/sdk-ui/src/infra/modules/core-module-providers-tree.d.ts +11 -0
  51. package/dist/packages/sdk-ui/src/infra/modules/core-module.d.ts +26 -0
  52. package/dist/packages/sdk-ui/src/infra/modules/index.d.ts +3 -0
  53. package/dist/packages/sdk-ui/src/infra/modules/module-provider.d.ts +17 -0
  54. package/dist/packages/sdk-ui/src/infra/modules/modules-context.d.ts +20 -0
  55. package/dist/packages/sdk-ui/src/infra/modules/types.d.ts +79 -0
  56. package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +52 -2
  57. package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/widget-plugin-registry.d.ts +3 -3
  58. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/dimensions/get-dimension-name.d.ts +9 -0
  59. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/dimensions/translate-dimensions-to-json.d.ts +4 -3
  60. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/filters/get-filter-name.d.ts +10 -0
  61. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/filters/translate-filters-to-json.d.ts +3 -3
  62. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/get-query-element-summary.d.ts +23 -0
  63. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/measures/get-measure-name.d.ts +10 -0
  64. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/measures/translate-measures-to-json.d.ts +4 -3
  65. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/index.d.ts +3 -1
  66. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/translate-query-from-json.d.ts +1 -1
  67. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/translate-query-to-json.d.ts +4 -3
  68. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/data-options/adapters.d.ts +3 -2
  69. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/data-options/index.d.ts +1 -1
  70. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/types.d.ts +70 -9
  71. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/to-widget-props.d.ts +3 -3
  72. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/translate-envelope-widget-from-json.d.ts +2 -3
  73. package/dist/packages/sdk-ui/src/modules/analytics-composer/types.d.ts +1 -18
  74. package/dist/packages/sdk-ui/src/props.d.ts +9 -0
  75. package/dist/packages/sdk-ui/src/public-api/alpha.d.ts +3 -0
  76. package/dist/packages/sdk-ui/src/public-api/public.d.ts +3 -1
  77. package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +1 -1
  78. package/dist/packages/sdk-ui/src/shared/components/loading-overlay.d.ts +1 -0
  79. package/dist/packages/sdk-ui/src/shared/hooks/use-element-height.d.ts +19 -0
  80. package/dist/packages/sdk-ui/src/shared/hooks/use-synced-state.d.ts +23 -2
  81. package/dist/packages/sdk-ui/src/shared/utils/filter-relations.d.ts +8 -0
  82. package/dist/packages/sdk-ui/src/shared/utils/gradient.d.ts +5 -0
  83. package/dist/types-7YG0uOzO.js +74 -0
  84. package/dist/{types-CzgBH2kL.cjs → types-DlYJ_DZ0.cjs} +1 -1
  85. package/dist/{use-hover-CaSOzp0i.cjs → use-hover-CANskYrn.cjs} +127 -127
  86. package/dist/{use-hover-B6VmMb06.js → use-hover-Dju4Dcv3.js} +11021 -10942
  87. package/dist/{utils-CsV-iYtb.js → utils-BKRpWUGm.js} +1061 -1058
  88. package/dist/{utils-BwGnDoB0.cjs → utils-C4PIba42.cjs} +10 -10
  89. package/dist/{widget-composer-C72Io-3c.cjs → widget-composer-BXEyx308.cjs} +1 -1
  90. package/dist/{widget-composer-Bv_OVu1o.js → widget-composer-DRDw1oBF.js} +3 -3
  91. package/package.json +9 -8
  92. package/dist/apply-styled-options-to-query-23D9br-S.cjs +0 -1
  93. package/dist/apply-styled-options-to-query-BagjzMqm.js +0 -5992
  94. package/dist/dimensions-Bn1EaWiP.js +0 -204
  95. package/dist/dimensions-D8r34WRI.cjs +0 -1
  96. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-scroll-persistence.d.ts +0 -16
  97. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/with-navigator-scroll-save.d.ts +0 -10
  98. package/dist/types-D3fPN43o.js +0 -74
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Producer-side declaration of a single API field on a module.
3
+ */
4
+ export interface ApiField<TValue, TRegistry> {
5
+ /** Creates the per-registration registry holding contributions for this field. */
6
+ createRegistry: () => TRegistry;
7
+ /** Writes a contribution into the registry. Invoked once per contributor. */
8
+ register: (value: TValue, registry: TRegistry, fromModule: Module) => void;
9
+ }
10
+ /**
11
+ * The shape of a producer module's `api` property — a record of `ApiField` declarations.
12
+ * Each module declares its own concrete schema (e.g. `CoreModuleApiDefinition`);
13
+ */
14
+ export type ApiSchema = Record<string, ApiField<any, any>>;
15
+ /**
16
+ * Module definition
17
+ *
18
+ * @alpha
19
+ */
20
+ export interface Module<TSchema = any> {
21
+ /** Unique module identifier, e.g. `'dashboard'`. */
22
+ name: string;
23
+ /** Module version */
24
+ version: string;
25
+ /**
26
+ * Modules this module integrates with.
27
+ * - `'name'` → hard requirement.
28
+ * - `{ name }` → hard requirement.
29
+ * - `{ name, optional: true }` → soft; contributions to it are dropped if absent.
30
+ * - `{ ..., requiredVersion: '^2.0.0' }` → optional semver range constraint.
31
+ */
32
+ requires?: ReadonlyArray<ModuleRequirement>;
33
+ /** Modules this one ships as part of its own feature */
34
+ includes?: ReadonlyArray<Module>;
35
+ /**
36
+ * Declarative contributions to other modules, keyed by target module name.
37
+ */
38
+ integrations?: Record<string, unknown>;
39
+ /** Producer-side API declaration; defines registries other modules contribute to. */
40
+ api?: TSchema;
41
+ }
42
+ /**
43
+ * Hard or soft requirement on another module, optionally version-constrained.
44
+ *
45
+ * @alpha
46
+ */
47
+ export type ModuleRequirement = string | {
48
+ name: string;
49
+ /** If true, the requirement may be missing and contributions to it are dropped. */
50
+ optional?: boolean;
51
+ /**
52
+ * Semver range the registered target's `version` must satisfy
53
+ * (e.g. `'^2.0.0'`). Mismatches throw at boot unless `optional`.
54
+ */
55
+ requiredVersion?: string;
56
+ };
57
+ /**
58
+ * Resolves the registry type owned by a producer module's API field — the
59
+ * value `useModuleApiRegistry(module, field)` returns.
60
+ */
61
+ export type RegistryOf<TSchema, K extends keyof TSchema> = TSchema[K] extends ApiField<any, infer R> ? R : never;
62
+ /**
63
+ * Resolves the contribution value type a consumer must supply for a producer's API field.
64
+ */
65
+ export type ValueOf<TSchema, K extends keyof TSchema> = TSchema[K] extends ApiField<infer V, any> ? V : never;
66
+ /**
67
+ * Derives the consumer-facing `*ModuleApi` contract from a producer schema.
68
+ * Each field becomes optional and typed as its contribution value.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * export type CoreModuleApi = ApiContract<CoreModuleApiDefinition>;
73
+ * // → { providers?: ComponentType<{ children: ReactNode }>[] }
74
+ * ```
75
+ * @alpha
76
+ */
77
+ export type ApiContract<TSchema> = {
78
+ [K in keyof TSchema]?: ValueOf<TSchema, K>;
79
+ };
@@ -1,5 +1,6 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
2
  import type { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
3
+ import type { DeepPartial } from 'ts-essentials';
3
4
  import { AnyObject } from '../../../shared/utils/utility-types';
4
5
  import type { AbstractDataPointWithEntries, GenericDataOptions } from '../../../types';
5
6
  import type { BasePluginInfo } from '../types';
@@ -8,7 +9,7 @@ import type { BasePluginInfo } from '../types';
8
9
  *
9
10
  * @sisenseInternal
10
11
  */
11
- export interface WidgetPlugin<Props extends CustomVisualizationProps = CustomVisualizationProps> extends BasePluginInfo {
12
+ export interface WidgetPlugin<Props extends CustomVisualizationProps<any, any, any, any> = CustomVisualizationProps> extends BasePluginInfo {
12
13
  /**
13
14
  * The type of plugin
14
15
  */
@@ -179,7 +180,7 @@ export type AnyWidgetPlugin = WidgetPlugin<any>;
179
180
  *
180
181
  * @sisenseInternal
181
182
  */
182
- export interface CustomVisualizationProps<DataOptions = GenericDataOptions, StyleOptions = CustomVisualizationStyleOptions, DataPoint extends AbstractDataPointWithEntries = AbstractDataPointWithEntries> extends CustomVisualizationEventProps<DataPoint> {
183
+ export interface CustomVisualizationProps<DataOptions = GenericDataOptions, StyleOptions = CustomVisualizationStyleOptions, DataPoint extends AbstractDataPointWithEntries = AbstractDataPointWithEntries, CustomOptions = Record<string, unknown>> extends CustomVisualizationEventProps<DataPoint> {
183
184
  /** Data source for the custom visualization */
184
185
  dataSource?: DataSource;
185
186
  /** Data options defining what data to display */
@@ -190,7 +191,46 @@ export interface CustomVisualizationProps<DataOptions = GenericDataOptions, Styl
190
191
  filters?: Filter[] | FilterRelations;
191
192
  /** Highlight filters for interactive highlighting */
192
193
  highlights?: Filter[];
194
+ /**
195
+ * Arbitrary plugin-specific options that is not data- or style-related.
196
+ *
197
+ * @sisenseInternal
198
+ */
199
+ customOptions?: CustomOptions;
200
+ /**
201
+ * Emit a partial state update to be persisted through the dashboard
202
+ * persistence layer. Injected by the dashboard when the widget lives inside a
203
+ * Dashboard component; `undefined` in standalone use or read-only mode — always
204
+ * call it with optional chaining.
205
+ *
206
+ * @example
207
+ * ```tsx
208
+ * onChange?.({ customOptions: { lastPage: 3 } });
209
+ * ```
210
+ *
211
+ * @sisenseInternal
212
+ */
213
+ onChange?: (update: VisualizationStateUpdate<StyleOptions, CustomOptions>) => void;
193
214
  }
215
+ /**
216
+ * Partial persistable state a custom visualization can push back to the
217
+ * persistence layer. Carries the same props vocabulary the plugin already reads
218
+ * from.
219
+ *
220
+ * Both fields are deeply partial and are deep-merged into the current widget
221
+ * state: nested plain objects merge recursively at any depth, so a plugin
222
+ * passes only the leaf values that changed — e.g.
223
+ * `{ styleOptions: { pagination: { currentPage: 3 } } }` updates `currentPage`
224
+ * while preserving the sibling `pagination` keys. Arrays and primitives are
225
+ * replaced wholesale (last-write-wins). Keys cannot be deleted via merge —
226
+ * overwrite with an explicit value (e.g. `null`) instead.
227
+ *
228
+ * @sisenseInternal
229
+ */
230
+ export type VisualizationStateUpdate<StyleOptions = CustomVisualizationStyleOptions, CustomOptions = Record<string, unknown>> = {
231
+ styleOptions?: DeepPartial<StyleOptions>;
232
+ customOptions?: DeepPartial<CustomOptions>;
233
+ };
194
234
  /**
195
235
  * Style options for a custom visualization.
196
236
  *
@@ -206,6 +246,16 @@ export interface CustomVisualizationStyleOptions extends AnyObject {
206
246
  * @sisenseInternal
207
247
  */
208
248
  export type CustomVisualization<Props = CustomVisualizationProps> = (props: Props) => ReactNode;
249
+ /**
250
+ * A custom visualization with erased prop types, used for heterogeneous storage
251
+ * at registry/context boundaries. Each concrete visualization specializes
252
+ * {@link CustomVisualizationProps} differently (and may require extra props such
253
+ * as a widget `id`), so the registry cannot know each exact shape — the prop
254
+ * type is intentionally erased here. Do not consume prop types from this alias.
255
+ *
256
+ * @sisenseInternal
257
+ */
258
+ export type AnyCustomVisualization = CustomVisualization<any>;
209
259
  /**
210
260
  * Event props for custom visualizations with generic data point type.
211
261
  *
@@ -1,4 +1,4 @@
1
- import type { CustomVisualization } from './types.js';
1
+ import type { AnyCustomVisualization } from './types.js';
2
2
  /**
3
3
  * Central widget registration and lookup.
4
4
  * Plugin-sourced entries take priority over legacy-sourced entries.
@@ -12,7 +12,7 @@ export declare class WidgetPluginRegistry {
12
12
  * Plugin-sourced entries take priority over legacy-sourced entries.
13
13
  * Within the same source, first-write-wins (no silent overwrites).
14
14
  */
15
- register(widgetTypeName: string, component: CustomVisualization, source?: 'plugin' | 'legacy'): void;
15
+ register(widgetTypeName: string, component: AnyCustomVisualization, source?: 'plugin' | 'legacy'): void;
16
16
  /**
17
17
  * Unregister a widget by type name and source.
18
18
  * Only removes the entry if it matches the given source.
@@ -23,7 +23,7 @@ export declare class WidgetPluginRegistry {
23
23
  * When `source` is provided, returns the component only if the entry matches that source.
24
24
  * When omitted, returns the component for any source (plugin takes priority over legacy).
25
25
  */
26
- getComponent(widgetTypeName: string, source?: 'plugin' | 'legacy'): CustomVisualization | undefined;
26
+ getComponent(widgetTypeName: string, source?: 'plugin' | 'legacy'): AnyCustomVisualization | undefined;
27
27
  /**
28
28
  * Check if a widget is registered.
29
29
  * When `source` is provided, returns true only if an entry exists for that source.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Returns the dimensional attribute path with the `DM.` module prefix removed.
3
+ *
4
+ * @param dimensionString - NLQ dimension reference (e.g. `DM.Commerce.Date.Years`)
5
+ * @returns Path without `DM.` (e.g. `Commerce.Date.Years`)
6
+ *
7
+ * @internal
8
+ */
9
+ export declare function getDimensionName(dimensionString: string): string;
@@ -1,6 +1,7 @@
1
- import { Attribute, JSONArray } from '@sisense/sdk-data';
1
+ import { Attribute } from '@sisense/sdk-data';
2
2
  import type { SortDirection } from '@sisense/sdk-data';
3
3
  import { NlqTranslationResult } from '../../../types.js';
4
+ import { type DimensionItemJSON } from '../../types.js';
4
5
  /** Runtime StyledColumn: wrapper with column and optional CategoryStyle (from chart dataOptions) */
5
6
  type StyledColumn = {
6
7
  column: Attribute;
@@ -15,8 +16,8 @@ type StyledColumn = {
15
16
  * properties; otherwise outputs composeCode string.
16
17
  *
17
18
  * @param dimensions - Array of CSDK Attribute or StyledColumn objects
18
- * @returns NlqTranslationResult<JSONArray> - JSON array output for NLQ dimensions
19
+ * @returns NlqTranslationResult with dimension items in NLQ JSON format
19
20
  * @internal
20
21
  */
21
- export declare function translateDimensionsToJSON(dimensions: (Attribute | StyledColumn)[]): NlqTranslationResult<JSONArray>;
22
+ export declare function translateDimensionsToJSON(dimensions: (Attribute | StyledColumn)[]): NlqTranslationResult<DimensionItemJSON[]>;
22
23
  export {};
@@ -0,0 +1,10 @@
1
+ import type { FunctionCall } from '../../types.js';
2
+ /**
3
+ * Extracts a human-readable label from a filter FunctionCall.
4
+ *
5
+ * @param call - Filter factory function call
6
+ * @returns Attribute name, measure name, or function suffix for logical combinators
7
+ *
8
+ * @internal
9
+ */
10
+ export declare function getFilterName(call: FunctionCall): string;
@@ -1,4 +1,4 @@
1
- import { Filter, FilterRelations, JSONArray } from '@sisense/sdk-data';
1
+ import { Filter, FilterRelations, type FunctionCall } from '@sisense/sdk-data';
2
2
  import { NlqTranslationResult } from '../../../types.js';
3
3
  /**
4
4
  * Translates CSDK Filter array or FilterRelations to NLQ JSON format (FunctionCall array).
@@ -10,7 +10,7 @@ import { NlqTranslationResult } from '../../../types.js';
10
10
  * @returns NlqTranslationResult<FunctionCall[]> with array of FunctionCall objects or structured errors
11
11
  * @internal
12
12
  */
13
- export declare function translateFiltersToJSON(filters: Filter[] | FilterRelations | undefined): NlqTranslationResult<JSONArray>;
13
+ export declare function translateFiltersToJSON(filters: Filter[] | FilterRelations | undefined): NlqTranslationResult<FunctionCall[]>;
14
14
  /**
15
15
  * Translates CSDK Filter array to NLQ JSON format (FunctionCall array).
16
16
  *
@@ -22,4 +22,4 @@ export declare function translateFiltersToJSON(filters: Filter[] | FilterRelatio
22
22
  * @returns NlqTranslationResult<FunctionCall[]> with array of FunctionCall objects or structured errors
23
23
  * @internal
24
24
  */
25
- export declare function translateHighlightsToJSON(highlights: Filter[] | undefined): NlqTranslationResult<JSONArray>;
25
+ export declare function translateHighlightsToJSON(highlights: Filter[] | undefined): NlqTranslationResult<FunctionCall[]>;
@@ -0,0 +1,23 @@
1
+ import { type ElementSummary, type QueryElementItemJSON } from '../types.js';
2
+ /**
3
+ * Options for {@link getQueryElementSummary}.
4
+ *
5
+ * @internal
6
+ */
7
+ export type GetQueryElementSummaryOptions = {
8
+ /**
9
+ * Distinguishes filter vs highlight when `item` is a `filterFactory.*` call.
10
+ * Ignored for dimensions and measures. Defaults to `'filter'`.
11
+ */
12
+ readonly role?: 'filter' | 'highlight';
13
+ };
14
+ /**
15
+ * Derives a human-readable name and element kind from a query JSON item.
16
+ *
17
+ * @param item - Dimension, measure, filter, or highlight JSON entry
18
+ * @param options - When `item` is a filter/highlight `FunctionCall`, `role` selects the returned kind
19
+ * @returns Summary with display name and type, or `null` when `item` is not a recognized shape
20
+ *
21
+ * @internal
22
+ */
23
+ export declare function getQueryElementSummary(item: QueryElementItemJSON, options?: GetQueryElementSummaryOptions): ElementSummary | null;
@@ -0,0 +1,10 @@
1
+ import type { FunctionCall } from '../../types.js';
2
+ /**
3
+ * Extracts a human-readable name from a measure FunctionCall.
4
+ *
5
+ * @param call - Measure factory function call
6
+ * @returns Display name for LLM / UI labels
7
+ *
8
+ * @internal
9
+ */
10
+ export declare function getMeasureName(call: FunctionCall): string;
@@ -1,6 +1,7 @@
1
- import { JSONArray, Measure } from '@sisense/sdk-data';
1
+ import { Measure } from '@sisense/sdk-data';
2
2
  import type { SortDirection } from '@sisense/sdk-data';
3
3
  import { NlqTranslationResult } from '../../../types.js';
4
+ import type { MeasureItemJSON } from '../../types.js';
4
5
  /** Runtime StyledMeasureColumn: wrapper with column and optional style (from chart dataOptions) */
5
6
  type StyledMeasureColumn = {
6
7
  column: Measure;
@@ -15,8 +16,8 @@ type StyledMeasureColumn = {
15
16
  * otherwise outputs the parsed FunctionCall.
16
17
  *
17
18
  * @param measures - Array of CSDK Measure or StyledMeasureColumn objects
18
- * @returns NlqTranslationResult<JSONArray> - JSON array output for NLQ measures
19
+ * @returns NlqTranslationResult with measure items in NLQ JSON format
19
20
  * @internal
20
21
  */
21
- export declare function translateMeasuresToJSON(measures: (Measure | StyledMeasureColumn)[]): NlqTranslationResult<JSONArray>;
22
+ export declare function translateMeasuresToJSON(measures: (Measure | StyledMeasureColumn)[]): NlqTranslationResult<MeasureItemJSON[]>;
22
23
  export {};
@@ -9,4 +9,6 @@ export * from './widget/translate-widget-to-json.js';
9
9
  export * from './dashboard/translate-dashboard-from-json.js';
10
10
  export * from './dashboard/translate-dashboard-to-json.js';
11
11
  export * from './query/translate-query-to-jaql.js';
12
- export type { ChartJSON, DataOptionsJSON, ChartInput, DataSourceJSON, PivotTableJSON, PivotTableDataOptionsJSON, PivotTableInput, ChartWidgetJSON, PivotTableWidgetJSON, TextWidgetJSON, CustomWidgetJSON, WidgetJSON, WidgetInput, SpecificWidgetOptionsJSON, WidgetsOptionsJSON, DashboardJSON, DashboardInput, } from './types.js';
12
+ export { getQueryElementSummary } from './constructs/get-query-element-summary.js';
13
+ export type { GetQueryElementSummaryOptions } from './constructs/get-query-element-summary.js';
14
+ export type { ChartJSON, DataOptionsJSON, ChartInput, DataSourceJSON, PivotTableJSON, PivotTableDataOptionsJSON, PivotTableInput, ChartWidgetJSON, PivotTableWidgetJSON, TextWidgetJSON, CustomWidgetJSON, WidgetJSON, WidgetInput, WidgetConfigJSON, QueryJSON, QueryInput, DimensionItemJSON, MeasureItemJSON, FunctionCall, QueryElementKind, QueryElementItemJSON, ElementSummary, SpecificWidgetOptionsJSON, WidgetsOptionsJSON, DashboardJSON, DashboardInput, } from './types.js';
@@ -1,6 +1,6 @@
1
1
  import type { ExecuteQueryParams } from '../../../../domains/query-execution/index.js';
2
2
  import { NlqTranslationResult } from '../../types.js';
3
- import { QueryInput } from '../../types.js';
3
+ import { QueryInput } from '../types.js';
4
4
  /**
5
5
  * Translates NLQ JSON format to CSDK ExecuteQueryParams object.
6
6
  * Direction: JSON → CSDK
@@ -1,5 +1,6 @@
1
1
  import type { ExecuteQueryParams } from '../../../../domains/query-execution/index.js';
2
- import { NlqResponseJSON, NlqTranslationResult } from '../../types.js';
2
+ import { NlqTranslationResult } from '../../types.js';
3
+ import type { QueryJSON } from '../types.js';
3
4
  /**
4
5
  * Translates CSDK ExecuteQueryParams to NLQ JSON format.
5
6
  * Direction: CSDK → JSON
@@ -50,7 +51,7 @@ import { NlqResponseJSON, NlqTranslationResult } from '../../types.js';
50
51
  * ```
51
52
  *
52
53
  * @param query - ExecuteQueryParams object with CSDK objects
53
- * @returns NlqTranslationResult<NlqResponseJSON> with FunctionCall format or structured errors
54
+ * @returns NlqTranslationResult<QueryJSON> with FunctionCall format or structured errors
54
55
  * @internal
55
56
  */
56
- export declare function translateQueryToJSON(query: ExecuteQueryParams): NlqTranslationResult<NlqResponseJSON>;
57
+ export declare function translateQueryToJSON(query: ExecuteQueryParams): NlqTranslationResult<QueryJSON>;
@@ -1,5 +1,4 @@
1
1
  import type { Attribute, Measure } from '@sisense/sdk-data';
2
- import type { JSONArray } from '@sisense/sdk-data';
3
2
  import type { StyledColumn, StyledMeasureColumn } from '../../../../../domains/visualizations/core/chart-data-options/types.js';
4
3
  import type { NlqTranslationError } from '../../../types.js';
5
4
  import type { DimensionItemJSON, DimensionTranslationItem, MeasureItemJSON, MeasureTranslationItem } from '../../types.js';
@@ -12,5 +11,7 @@ import type { DimensionItemJSON, DimensionTranslationItem, MeasureItemJSON, Meas
12
11
  export type AxisType = 'dimension' | 'measure';
13
12
  export declare function adaptDimensionsToStyledColumn(items: DimensionTranslationItem[]): (Attribute | StyledColumn)[];
14
13
  export declare function adaptMeasuresToStyledMeasureColumn(items: MeasureTranslationItem[]): (Measure | StyledMeasureColumn)[];
15
- export declare function toJSONArray(value: DimensionItemJSON | DimensionItemJSON[] | MeasureItemJSON | MeasureItemJSON[]): JSONArray;
14
+ export declare function toDimensionItemsJSON(value: DimensionItemJSON | DimensionItemJSON[]): DimensionItemJSON[];
15
+ export declare function toMeasureItemsJSON(value: MeasureItemJSON | MeasureItemJSON[]): MeasureItemJSON[];
16
+ export declare function toDataOptionItemsJSON(value: DimensionItemJSON | DimensionItemJSON[] | MeasureItemJSON | MeasureItemJSON[]): (DimensionItemJSON | MeasureItemJSON)[];
16
17
  export declare function withAxisContext(axisKey: string): (e: NlqTranslationError) => NlqTranslationError;
@@ -4,6 +4,6 @@
4
4
  *
5
5
  * @internal
6
6
  */
7
- export { adaptDimensionsToStyledColumn, adaptMeasuresToStyledMeasureColumn, toJSONArray, withAxisContext, } from './adapters.js';
7
+ export { adaptDimensionsToStyledColumn, adaptMeasuresToStyledMeasureColumn, toDataOptionItemsJSON, toDimensionItemsJSON, toMeasureItemsJSON, withAxisContext, } from './adapters.js';
8
8
  export { translateSingleAxisFromJSON, type AxisType, type TranslatedAxis, } from './translate-axis-from-json.js';
9
9
  export { translateSingleAxisToJSON } from './translate-axis-to-json.js';
@@ -3,6 +3,7 @@ import type { CommonFiltersOptions } from '../../../domains/dashboarding/common-
3
3
  import type { DashboardConfig, DashboardLayoutOptions, DashboardStyleOptions } from '../../../domains/dashboarding/types.js';
4
4
  import { CategoryStyle, SeriesStyle, ValueStyle } from '../../../domains/visualizations/core/chart-data-options/types.js';
5
5
  import type { WidgetConfig, WidgetType } from '../../../domains/widgets/components/widget/types.js';
6
+ import type { ToolbarMenuConfig, WidgetHeaderTitleConfig } from '../../../domains/widgets/shared/widget-header/types.js';
6
7
  import type { CustomWidgetStyleOptions, PivotTableStyleOptions, TextWidgetStyleOptions } from '../../../types.js';
7
8
  import { DataSchemaContext, NlqTranslationInput } from '../types.js';
8
9
  import type { SchemaIndex } from './shared/utils/schema-index.js';
@@ -25,6 +26,8 @@ export type ArgType = 'string' | 'string[]' | 'number' | 'number[]' | 'boolean'
25
26
  export interface ArgSchema {
26
27
  type: ArgType;
27
28
  required: boolean;
29
+ /** Marks this positional arg as the human-readable display name. */
30
+ isName?: true;
28
31
  }
29
32
  export type ProcessedArg = unknown;
30
33
  export type QueryElement = Filter | FilterRelations | Measure;
@@ -41,10 +44,6 @@ export interface FunctionContext extends InternalDataSchemaContext {
41
44
  export interface ArgContext extends FunctionContext {
42
45
  argSchema: ArgSchema;
43
46
  }
44
- export type DimensionsInput = NlqTranslationInput<JSONArray, InternalDataSchemaContext>;
45
- export type MeasuresInput = NlqTranslationInput<JSONArray, InternalDataSchemaContext>;
46
- export type FiltersInput = NlqTranslationInput<JSONArray, InternalDataSchemaContext>;
47
- export type HighlightsInput = NlqTranslationInput<JSONArray, InternalDataSchemaContext>;
48
47
  export type MeasuresFunctionCallInput = NlqTranslationInput<FunctionCall[], InternalDataSchemaContext>;
49
48
  export type FiltersFunctionCallInput = NlqTranslationInput<FunctionCall[], InternalDataSchemaContext>;
50
49
  export type HighlightsFunctionCallInput = NlqTranslationInput<FunctionCall[], InternalDataSchemaContext>;
@@ -64,7 +63,7 @@ export type CustomFunctionProcessor = (processedArgs: ProcessedArg[], context: F
64
63
  */
65
64
  export declare function isRecordStringUnknown(value: unknown): value is Record<string, unknown>;
66
65
  export declare function isFunctionCall(value: unknown): value is FunctionCall;
67
- export declare function isFunctionCallArray(value: JSONArray): value is FunctionCall[];
66
+ export declare function isFunctionCallArray(value: readonly unknown[]): value is FunctionCall[];
68
67
  export declare function isFilterElement(arg: QueryElement): arg is Filter;
69
68
  export declare function isFilterRelationsElement(arg: QueryElement): arg is FilterRelations;
70
69
  export declare function isMeasureElement(arg: QueryElement): arg is Measure;
@@ -119,6 +118,54 @@ export type DimensionItemJSON = string | StyledColumnJSON;
119
118
  * @internal
120
119
  */
121
120
  export type MeasureItemJSON = FunctionCall | StyledMeasureColumnJSON;
121
+ /**
122
+ * Translation input types for query constructs (precise JSON arrays).
123
+ *
124
+ * @internal
125
+ */
126
+ export type DimensionsInput = NlqTranslationInput<DimensionItemJSON[], InternalDataSchemaContext>;
127
+ export type MeasuresInput = NlqTranslationInput<MeasureItemJSON[], InternalDataSchemaContext>;
128
+ export type FiltersInput = NlqTranslationInput<FunctionCall[], InternalDataSchemaContext>;
129
+ export type HighlightsInput = NlqTranslationInput<FunctionCall[], InternalDataSchemaContext>;
130
+ /**
131
+ * JSON representation of a query from the NLQ API.
132
+ * Precise serializable schema for dimensions, measures, filters, and highlights.
133
+ *
134
+ * @internal
135
+ */
136
+ export interface QueryJSON {
137
+ dimensions: DimensionItemJSON[];
138
+ measures: MeasureItemJSON[];
139
+ filters: FunctionCall[];
140
+ highlights?: FunctionCall[];
141
+ }
142
+ /**
143
+ * Input type for query translation (JSON → CSDK).
144
+ *
145
+ * @internal
146
+ */
147
+ export type QueryInput = NlqTranslationInput<QueryJSON, DataSchemaContext>;
148
+ /**
149
+ * Element kind for a single {@link QueryJSON} array entry.
150
+ *
151
+ * @internal
152
+ */
153
+ export type QueryElementKind = 'dimension' | 'measure' | 'filter' | 'highlight';
154
+ /**
155
+ * Display name and kind for a query JSON element.
156
+ *
157
+ * @internal
158
+ */
159
+ export interface ElementSummary {
160
+ readonly name: string;
161
+ readonly type: QueryElementKind;
162
+ }
163
+ /**
164
+ * A single item from {@link QueryJSON} dimensions, measures, filters, or highlights arrays.
165
+ *
166
+ * @internal
167
+ */
168
+ export type QueryElementItemJSON = DimensionItemJSON | MeasureItemJSON | FunctionCall;
122
169
  /**
123
170
  * Type guard: value is StyledColumnJSON (object with column, not a FunctionCall).
124
171
  *
@@ -223,6 +270,20 @@ type WithCommonWidgetJSON<Base, Type extends WidgetType> = Base & {
223
270
  widgetType: Type;
224
271
  readonly id: string;
225
272
  };
273
+ /**
274
+ * JSON-safe subset of {@link WidgetConfig} (drops function-bearing menu items).
275
+ * Structurally assignable to {@link WidgetConfig} because `items` is optional on the runtime type.
276
+ *
277
+ * @internal
278
+ */
279
+ export type WidgetConfigJSON = Pick<WidgetConfig, 'actions'> & {
280
+ header?: {
281
+ title?: WidgetHeaderTitleConfig;
282
+ toolbar?: {
283
+ menu?: Pick<ToolbarMenuConfig, 'enabled'>;
284
+ };
285
+ };
286
+ };
226
287
  /**
227
288
  * Data source in NLQ JSON — title only. Full JAQL details live in {@link DataSchemaContext}.
228
289
  *
@@ -238,7 +299,7 @@ export type ChartWidgetJSON = ChartJSON & {
238
299
  title?: string;
239
300
  description?: string;
240
301
  dataSource?: DataSourceJSON;
241
- config?: WidgetConfig;
302
+ config?: WidgetConfigJSON;
242
303
  highlightSelectionDisabled?: boolean;
243
304
  };
244
305
  /**
@@ -250,7 +311,7 @@ export type PivotTableWidgetJSON = PivotTableJSON & {
250
311
  title?: string;
251
312
  description?: string;
252
313
  dataSource?: DataSourceJSON;
253
- config?: WidgetConfig;
314
+ config?: WidgetConfigJSON;
254
315
  };
255
316
  /**
256
317
  * JSON representation of a text widget
@@ -259,7 +320,7 @@ export type PivotTableWidgetJSON = PivotTableJSON & {
259
320
  */
260
321
  export type TextWidgetJSON = {
261
322
  styleOptions: TextWidgetStyleOptions;
262
- config?: WidgetConfig;
323
+ config?: WidgetConfigJSON;
263
324
  };
264
325
  /**
265
326
  * JSON representation of a custom/plugin widget payload.
@@ -275,7 +336,7 @@ export type CustomWidgetJSON = {
275
336
  title?: string;
276
337
  description?: string;
277
338
  dataSource?: DataSourceJSON;
278
- config?: WidgetConfig;
339
+ config?: WidgetConfigJSON;
279
340
  filters?: FunctionCall[];
280
341
  highlights?: FunctionCall[];
281
342
  /** Opaque pass-through — GenericDataOptions serialized as plain JSON */
@@ -1,12 +1,12 @@
1
- import type { WidgetConfig, WidgetProps } from '../../../../../domains/widgets/components/widget/types.js';
1
+ import type { WidgetProps } from '../../../../../domains/widgets/components/widget/types.js';
2
2
  import type { ChartProps, PivotTableProps } from '../../../../../props.js';
3
- import type { DataSourceJSON } from '../../types.js';
3
+ import type { DataSourceJSON, WidgetConfigJSON } from '../../types.js';
4
4
  export type WidgetMeta = {
5
5
  readonly id: string;
6
6
  readonly title?: string;
7
7
  readonly description?: string;
8
8
  readonly dataSource?: DataSourceJSON;
9
- readonly config?: WidgetConfig;
9
+ readonly config?: WidgetConfigJSON;
10
10
  readonly highlightSelectionDisabled?: boolean;
11
11
  };
12
12
  /**
@@ -1,13 +1,12 @@
1
- import type { WidgetConfig } from '../../../../../domains/widgets/components/widget/types.js';
2
1
  import type { DataSchemaContext, NlqTranslationInput, NlqTranslationResult } from '../../../types.js';
3
- import type { DataSourceJSON } from '../../types.js';
2
+ import type { DataSourceJSON, WidgetConfigJSON } from '../../types.js';
4
3
  import type { WidgetMeta } from './to-widget-props.js';
5
4
  type WidgetEnvelopeJSON = {
6
5
  readonly id: string;
7
6
  readonly title?: string;
8
7
  readonly description?: string;
9
8
  readonly dataSource?: DataSourceJSON;
10
- readonly config?: WidgetConfig;
9
+ readonly config?: WidgetConfigJSON;
11
10
  readonly highlightSelectionDisabled?: boolean;
12
11
  };
13
12
  /**
@@ -1,4 +1,4 @@
1
- import { JaqlDataSourceForDto, JSONArray, MetadataItem } from '@sisense/sdk-data';
1
+ import { JaqlDataSourceForDto, MetadataItem } from '@sisense/sdk-data';
2
2
  import type { DashboardByIdConfig } from '../../domains/dashboarding';
3
3
  import { DashboardProps } from '../../domains/dashboarding/types.js';
4
4
  import { ExecutePivotQueryParams, ExecuteQueryParams } from '../../domains/query-execution/index.js';
@@ -319,17 +319,6 @@ export type NlqTranslationInput<DataType, ContextType> = {
319
319
  data: DataType;
320
320
  context: ContextType;
321
321
  };
322
- /**
323
- * Response JSON generated by the new NLQ API.
324
- *
325
- * @internal
326
- */
327
- export type NlqResponseJSON = {
328
- dimensions: JSONArray;
329
- measures: JSONArray;
330
- filters: JSONArray;
331
- highlights?: JSONArray;
332
- };
333
322
  /**
334
323
  * Data schema context for translation
335
324
  *
@@ -341,12 +330,6 @@ export interface DataSchemaContext {
341
330
  /** Available tables for attribute resolution */
342
331
  tables: NormalizedTable[];
343
332
  }
344
- /**
345
- * Query input for translation
346
- *
347
- * @internal
348
- */
349
- export type QueryInput = NlqTranslationInput<NlqResponseJSON, DataSchemaContext>;
350
333
  /**
351
334
  * Context used when building translation errors (before message is attached).
352
335
  *
@@ -9,6 +9,7 @@ import { HighchartsOptions } from './domains/visualizations/core/chart-options-p
9
9
  import type { ChartWidgetProps } from './domains/widgets/components/chart-widget/types';
10
10
  import { FiltersMergeStrategy } from './domains/widgets/components/widget-by-id/types';
11
11
  import { type AppConfig } from './infra/app/types';
12
+ import type { Module } from './infra/modules';
12
13
  import type { Plugin } from './infra/plugins/types';
13
14
  import { AreamapDataPoint, AreamapStyleOptions, AreaRangeStyleOptions, AreaStyleOptions, BoxplotDataPoint, BoxplotStyleOptions, CalendarHeatmapDataPoint, CalendarHeatmapStyleOptions, CartesianChartDataOptions, CategoricalChartDataOptions, ChartDataOptions, ChartDataPoints, ChartStyleOptions, ChartType, CustomDrilldownResult, DataPoint, DrilldownOptions, DrilldownSelection, FunnelStyleOptions, IndicatorDataPoint, IndicatorRenderOptions, IndicatorStyleOptions, LineStyleOptions, MenuAlignment, MenuItemSection, MenuPosition, PieStyleOptions, PivotTableDataPoint, PivotTableDrilldownOptions, PivotTableStyleOptions, PolarStyleOptions, RegularChartStyleOptions, RegularChartType, ScatterDataPoint, ScattermapDataPoint, ScattermapStyleOptions, ScatterStyleOptions, StackableStyleOptions, StreamgraphStyleOptions, SunburstStyleOptions, TableStyleOptions, TabularChartStyleOptions, TextWidgetDataPoint, ThemeConfig, ThemeOid, ThemeSettings, TreemapStyleOptions, WidgetByIdStyleOptions } from './types';
14
15
  export type { TabberButtonsWidgetProps } from './domains/widgets/components/tabber-buttons-widget/types';
@@ -167,6 +168,14 @@ export interface SisenseContextProviderProps {
167
168
  * @internal
168
169
  */
169
170
  plugins?: Plugin[];
171
+ /**
172
+ * Array of modules to register.
173
+ *
174
+ * @category Sisense App
175
+ *
176
+ * @alpha
177
+ */
178
+ modules?: Module[];
170
179
  }
171
180
  /**
172
181
  * Props for {@link ExecuteQuery} component.
@@ -9,4 +9,7 @@ export type { ThemeConfig } from '../types';
9
9
  export { type TranslationDictionary, PACKAGE_NAMESPACE as translationNamespace, } from '../infra/translation/resources';
10
10
  export { CascadingFilterTile, type CascadingFilterTileProps, } from '../domains/filters/components/cascading-filter-tile';
11
11
  export { CustomFilterTile, type CustomFilterTileProps, } from '../domains/filters/components/custom-filter-tile';
12
+ export { useSyncedState, type UseSyncedStateOptions } from '../shared/hooks/use-synced-state';
12
13
  export { isIndicatorRenderOptions, isHighchartsOptions, type HighchartsOptions, type CalendarHeatmapChartEventProps, } from '../props';
14
+ export type { Module, ModuleRequirement } from '../infra/modules/types.js';
15
+ export { useModuleApiRegistry } from '../infra/modules/modules-context.js';