@thoughtspot/visual-embed-sdk 1.47.2 → 1.47.3

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 (144) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/embed/app.d.ts +6 -1
  3. package/cjs/src/embed/app.d.ts.map +1 -1
  4. package/cjs/src/embed/app.js +4 -1
  5. package/cjs/src/embed/app.js.map +1 -1
  6. package/cjs/src/embed/app.spec.js +112 -0
  7. package/cjs/src/embed/app.spec.js.map +1 -1
  8. package/cjs/src/embed/conversation.d.ts +2 -1
  9. package/cjs/src/embed/conversation.d.ts.map +1 -1
  10. package/cjs/src/embed/conversation.js.map +1 -1
  11. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  12. package/cjs/src/embed/liveboard.js +4 -1
  13. package/cjs/src/embed/liveboard.js.map +1 -1
  14. package/cjs/src/embed/liveboard.spec.js +22 -0
  15. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  16. package/cjs/src/embed/search.d.ts +24 -1
  17. package/cjs/src/embed/search.d.ts.map +1 -1
  18. package/cjs/src/embed/search.js +15 -2
  19. package/cjs/src/embed/search.js.map +1 -1
  20. package/cjs/src/embed/search.spec.js +99 -0
  21. package/cjs/src/embed/search.spec.js.map +1 -1
  22. package/cjs/src/embed/spotter-utils.d.ts +3 -0
  23. package/cjs/src/embed/spotter-utils.d.ts.map +1 -1
  24. package/cjs/src/embed/spotter-utils.js +11 -3
  25. package/cjs/src/embed/spotter-utils.js.map +1 -1
  26. package/cjs/src/embed/spotter-utils.spec.js +51 -0
  27. package/cjs/src/embed/spotter-utils.spec.js.map +1 -1
  28. package/cjs/src/embed/ts-embed.d.ts +1 -0
  29. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  30. package/cjs/src/embed/ts-embed.js +15 -3
  31. package/cjs/src/embed/ts-embed.js.map +1 -1
  32. package/cjs/src/embed/ts-embed.spec.js +139 -0
  33. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  34. package/cjs/src/index.d.ts +2 -2
  35. package/cjs/src/index.d.ts.map +1 -1
  36. package/cjs/src/index.js +8 -1
  37. package/cjs/src/index.js.map +1 -1
  38. package/cjs/src/mixpanel-service.d.ts.map +1 -1
  39. package/cjs/src/mixpanel-service.js +2 -0
  40. package/cjs/src/mixpanel-service.js.map +1 -1
  41. package/cjs/src/mixpanel-service.spec.js +2 -0
  42. package/cjs/src/mixpanel-service.spec.js.map +1 -1
  43. package/cjs/src/test/test-utils.d.ts +1 -0
  44. package/cjs/src/test/test-utils.d.ts.map +1 -1
  45. package/cjs/src/test/test-utils.js +26 -1
  46. package/cjs/src/test/test-utils.js.map +1 -1
  47. package/cjs/src/types.d.ts +424 -0
  48. package/cjs/src/types.d.ts.map +1 -1
  49. package/cjs/src/types.js +121 -1
  50. package/cjs/src/types.js.map +1 -1
  51. package/dist/{index-CFZ7RDZ9.js → index-DZq20cR6.js} +1 -1
  52. package/dist/src/embed/app.d.ts +6 -1
  53. package/dist/src/embed/app.d.ts.map +1 -1
  54. package/dist/src/embed/conversation.d.ts +2 -1
  55. package/dist/src/embed/conversation.d.ts.map +1 -1
  56. package/dist/src/embed/liveboard.d.ts.map +1 -1
  57. package/dist/src/embed/search.d.ts +24 -1
  58. package/dist/src/embed/search.d.ts.map +1 -1
  59. package/dist/src/embed/spotter-utils.d.ts +3 -0
  60. package/dist/src/embed/spotter-utils.d.ts.map +1 -1
  61. package/dist/src/embed/ts-embed.d.ts +1 -0
  62. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  63. package/dist/src/index.d.ts +2 -2
  64. package/dist/src/index.d.ts.map +1 -1
  65. package/dist/src/mixpanel-service.d.ts.map +1 -1
  66. package/dist/src/test/test-utils.d.ts +1 -0
  67. package/dist/src/test/test-utils.d.ts.map +1 -1
  68. package/dist/src/types.d.ts +424 -0
  69. package/dist/src/types.d.ts.map +1 -1
  70. package/dist/tsembed-react.es.js +173 -13
  71. package/dist/tsembed-react.js +172 -12
  72. package/dist/tsembed.es.js +174 -14
  73. package/dist/tsembed.js +172 -12
  74. package/dist/visual-embed-sdk-react-full.d.ts +425 -0
  75. package/dist/visual-embed-sdk-react.d.ts +425 -0
  76. package/dist/visual-embed-sdk.d.ts +453 -0
  77. package/lib/package.json +1 -1
  78. package/lib/src/embed/app.d.ts +6 -1
  79. package/lib/src/embed/app.d.ts.map +1 -1
  80. package/lib/src/embed/app.js +4 -1
  81. package/lib/src/embed/app.js.map +1 -1
  82. package/lib/src/embed/app.spec.js +113 -1
  83. package/lib/src/embed/app.spec.js.map +1 -1
  84. package/lib/src/embed/conversation.d.ts +2 -1
  85. package/lib/src/embed/conversation.d.ts.map +1 -1
  86. package/lib/src/embed/conversation.js.map +1 -1
  87. package/lib/src/embed/liveboard.d.ts.map +1 -1
  88. package/lib/src/embed/liveboard.js +4 -1
  89. package/lib/src/embed/liveboard.js.map +1 -1
  90. package/lib/src/embed/liveboard.spec.js +22 -0
  91. package/lib/src/embed/liveboard.spec.js.map +1 -1
  92. package/lib/src/embed/search.d.ts +24 -1
  93. package/lib/src/embed/search.d.ts.map +1 -1
  94. package/lib/src/embed/search.js +15 -2
  95. package/lib/src/embed/search.js.map +1 -1
  96. package/lib/src/embed/search.spec.js +100 -1
  97. package/lib/src/embed/search.spec.js.map +1 -1
  98. package/lib/src/embed/spotter-utils.d.ts +3 -0
  99. package/lib/src/embed/spotter-utils.d.ts.map +1 -1
  100. package/lib/src/embed/spotter-utils.js +11 -3
  101. package/lib/src/embed/spotter-utils.js.map +1 -1
  102. package/lib/src/embed/spotter-utils.spec.js +51 -0
  103. package/lib/src/embed/spotter-utils.spec.js.map +1 -1
  104. package/lib/src/embed/ts-embed.d.ts +1 -0
  105. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  106. package/lib/src/embed/ts-embed.js +14 -2
  107. package/lib/src/embed/ts-embed.js.map +1 -1
  108. package/lib/src/embed/ts-embed.spec.js +139 -0
  109. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  110. package/lib/src/index.d.ts +2 -2
  111. package/lib/src/index.d.ts.map +1 -1
  112. package/lib/src/index.js +2 -2
  113. package/lib/src/index.js.map +1 -1
  114. package/lib/src/mixpanel-service.d.ts.map +1 -1
  115. package/lib/src/mixpanel-service.js +2 -0
  116. package/lib/src/mixpanel-service.js.map +1 -1
  117. package/lib/src/mixpanel-service.spec.js +2 -0
  118. package/lib/src/mixpanel-service.spec.js.map +1 -1
  119. package/lib/src/test/test-utils.d.ts +1 -0
  120. package/lib/src/test/test-utils.d.ts.map +1 -1
  121. package/lib/src/test/test-utils.js +25 -1
  122. package/lib/src/test/test-utils.js.map +1 -1
  123. package/lib/src/types.d.ts +424 -0
  124. package/lib/src/types.d.ts.map +1 -1
  125. package/lib/src/types.js +120 -0
  126. package/lib/src/types.js.map +1 -1
  127. package/lib/src/visual-embed-sdk.d.ts +453 -0
  128. package/package.json +1 -1
  129. package/src/embed/app.spec.ts +141 -0
  130. package/src/embed/app.ts +11 -0
  131. package/src/embed/conversation.ts +2 -1
  132. package/src/embed/liveboard.spec.ts +32 -0
  133. package/src/embed/liveboard.ts +5 -0
  134. package/src/embed/search.spec.ts +118 -0
  135. package/src/embed/search.ts +43 -1
  136. package/src/embed/spotter-utils.spec.ts +52 -0
  137. package/src/embed/spotter-utils.ts +19 -3
  138. package/src/embed/ts-embed.spec.ts +185 -0
  139. package/src/embed/ts-embed.ts +14 -3
  140. package/src/index.ts +16 -0
  141. package/src/mixpanel-service.spec.ts +2 -0
  142. package/src/mixpanel-service.ts +2 -0
  143. package/src/test/test-utils.ts +33 -1
  144. package/src/types.ts +454 -0
@@ -2963,6 +2963,22 @@ export interface LiveboardAppEmbedViewConfig {
2963
2963
  * ```
2964
2964
  */
2965
2965
  isLiveboardMasterpiecesEnabled?: boolean;
2966
+ /**
2967
+ * Enable or disable Muze chart phase 1 GA
2968
+ *
2969
+ * Supported embed types: `AppEmbed`, `LiveboardEmbed`
2970
+ * @version SDK: 1.49.0 | ThoughtSpot Cloud: 26.6.0.cl
2971
+ * @default false
2972
+ * @example
2973
+ * ```js
2974
+ * // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
2975
+ * const embed = new <EmbedComponent>('#tsEmbed', {
2976
+ * ... // other embed view config
2977
+ * newChartsLibrary: true,
2978
+ * })
2979
+ * ```
2980
+ */
2981
+ newChartsLibrary?: boolean;
2966
2982
  }
2967
2983
  export interface AllEmbedViewConfig extends BaseViewConfig, SearchLiveboardCommonViewConfig, HomePageConfig, LiveboardAppEmbedViewConfig {
2968
2984
  }
@@ -8892,6 +8908,413 @@ export interface ContextObject {
8892
8908
  objectIds: ObjectIds;
8893
8909
  };
8894
8910
  }
8911
+ export interface FontProperties {
8912
+ color?: string;
8913
+ bold?: boolean;
8914
+ italic?: boolean;
8915
+ strikeThrough?: boolean;
8916
+ underline?: boolean;
8917
+ }
8918
+ export interface SolidBackgroundAttrs {
8919
+ color?: string;
8920
+ }
8921
+ export interface GradientBackgroundAttrs {
8922
+ backgroundFormatMidpoint?: number;
8923
+ colors?: string[];
8924
+ backgroundFormatRange?: number[];
8925
+ isAutoScaled?: boolean;
8926
+ }
8927
+ /**
8928
+ * Data label filter operators
8929
+ * @group Visual Overrides
8930
+ */
8931
+ export enum DataLabelFilterOperator {
8932
+ /** Greater than */
8933
+ GreaterThan = "GREATER_THAN",
8934
+ /** Less than */
8935
+ LessThan = "LESS_THAN",
8936
+ /** Greater than or equal to */
8937
+ GreaterThanOrEqualTo = "GREATER_THAN_OR_EQUAL_TO",
8938
+ /** Less than or equal to */
8939
+ LessThanOrEqualTo = "LESS_THAN_OR_EQUAL_TO",
8940
+ /** Equal to */
8941
+ EqualTo = "EQUAL_TO",
8942
+ /** Not equal to */
8943
+ NotEqualTo = "NOT_EQUAL_TO"
8944
+ }
8945
+ /**
8946
+ * Conditional formatting operators
8947
+ * @group Visual Overrides
8948
+ */
8949
+ export enum ConditionalFormattingOperator {
8950
+ /** Is equal to */
8951
+ Is = "IS",
8952
+ /** Is not equal to */
8953
+ IsNot = "IS_NOT",
8954
+ /** Contains */
8955
+ Contains = "CONTAINS",
8956
+ /** Does not contain */
8957
+ DoesNotContain = "DOES_NOT_CONTAIN",
8958
+ /** Starts with */
8959
+ StartsWith = "STARTS_WITH",
8960
+ /** Ends with */
8961
+ EndsWith = "ENDS_WITH",
8962
+ /** Greater than */
8963
+ GreaterThan = "GREATER_THAN",
8964
+ /** Less than */
8965
+ LessThan = "LESS_THAN",
8966
+ /** Greater than or equal to */
8967
+ GreaterThanEqualTo = "GREATER_THAN_EQUAL_TO",
8968
+ /** Less than or equal to */
8969
+ LessThanEqualTo = "LESS_THAN_EQUAL_TO",
8970
+ /** Equal to */
8971
+ EqualTo = "EQUAL_TO",
8972
+ /** Not equal to */
8973
+ NotEqualTo = "NOT_EQUAL_TO",
8974
+ /** Is between */
8975
+ IsBetween = "IS_BETWEEN",
8976
+ /** Is null */
8977
+ IsNull = "IS_NULL",
8978
+ /** Is not null */
8979
+ IsNotNull = "IS_NOT_NULL"
8980
+ }
8981
+ /**
8982
+ * Background format types for conditional formatting
8983
+ * @group Visual Overrides
8984
+ */
8985
+ export enum BackgroundFormatType {
8986
+ /** Solid color background */
8987
+ Solid = "SOLID",
8988
+ /** Gradient background */
8989
+ Gradient = "GRADIENT"
8990
+ }
8991
+ /**
8992
+ * Comparison types for conditional formatting
8993
+ * @group Visual Overrides
8994
+ */
8995
+ export enum ConditionalFormattingComparisonType {
8996
+ /** Value-based comparison */
8997
+ ValueBased = "VALUE_BASED",
8998
+ /** Column-based comparison */
8999
+ ColumnBased = "COLUMN_BASED",
9000
+ /** Parameter-based comparison */
9001
+ ParameterBased = "PARAMETER_BASED"
9002
+ }
9003
+ /**
9004
+ * A single conditional formatting rule row
9005
+ * @group Visual Overrides
9006
+ */
9007
+ export interface ConditionalFormattingRow {
9008
+ /** Comparison operator */
9009
+ operator: ConditionalFormattingOperator | string;
9010
+ /** Value to compare against */
9011
+ value?: string;
9012
+ /** Range values for range-based comparisons */
9013
+ rangeValues?: {
9014
+ min: number;
9015
+ max: number;
9016
+ };
9017
+ /** Plot the formatting as a band/area */
9018
+ plotAsBand?: boolean;
9019
+ /** Highlight this row if the condition is met */
9020
+ isHighlightRow?: boolean;
9021
+ /** Type of comparison: value-based, column-based, or parameter-based */
9022
+ comparisonType?: ConditionalFormattingComparisonType | string;
9023
+ /** Column ID to apply the formatting to (left-hand side) */
9024
+ lhsColumnId?: string;
9025
+ /** Column name to compare against (right-hand side) */
9026
+ columnToCompare?: string;
9027
+ /** Parameter ID to compare against */
9028
+ comparisonParameterId?: string;
9029
+ /** Font properties to apply (color, bold, italic, etc.) */
9030
+ fontProperties?: FontProperties;
9031
+ /** Background format type: solid color or gradient */
9032
+ backgroundFormatType?: BackgroundFormatType | string;
9033
+ /** Solid background color attributes */
9034
+ solidBackgroundAttrs?: SolidBackgroundAttrs;
9035
+ /** Gradient background attributes */
9036
+ gradientBackgroundAttrs?: GradientBackgroundAttrs;
9037
+ }
9038
+ /**
9039
+ * Conditional formatting configuration
9040
+ * @group Visual Overrides
9041
+ */
9042
+ export interface ConditionalFormatting {
9043
+ /** Array of conditional formatting rules */
9044
+ rows?: ConditionalFormattingRow[];
9045
+ }
9046
+ /**
9047
+ * Color palette for charts
9048
+ * @group Visual Overrides
9049
+ */
9050
+ export interface ColorPalette {
9051
+ /** Array of color values (hex codes or color names) */
9052
+ colors?: string[];
9053
+ }
9054
+ /**
9055
+ * Legend position options
9056
+ * @group Visual Overrides
9057
+ */
9058
+ export enum LegendPosition {
9059
+ /** Position legend at the top */
9060
+ Top = "top",
9061
+ /** Position legend at the bottom */
9062
+ Bottom = "bottom",
9063
+ /** Position legend on the left */
9064
+ Left = "left",
9065
+ /** Position legend on the right */
9066
+ Right = "right"
9067
+ }
9068
+ /**
9069
+ * Table theme options
9070
+ * @group Visual Overrides
9071
+ */
9072
+ export enum TableTheme {
9073
+ /** Outline theme */
9074
+ Outline = "OUTLINE",
9075
+ /** Row theme */
9076
+ Row = "ROW",
9077
+ /** Zebra theme */
9078
+ Zebra = "ZEBRA"
9079
+ }
9080
+ /**
9081
+ * Table content density options
9082
+ * @group Visual Overrides
9083
+ */
9084
+ export enum TableContentDensity {
9085
+ /** Regular density */
9086
+ Regular = "REGULAR",
9087
+ /** Compact density */
9088
+ Compact = "COMPACT"
9089
+ }
9090
+ /**
9091
+ * Chart legend configuration
9092
+ * @group Visual Overrides
9093
+ */
9094
+ export interface ChartLegend {
9095
+ /** Show or hide the legend */
9096
+ show?: boolean;
9097
+ /** Position of the legend */
9098
+ position?: LegendPosition | string;
9099
+ /** Color palette to use for legend colors */
9100
+ colorPalette?: ColorPalette;
9101
+ }
9102
+ /**
9103
+ * Filter for data labels
9104
+ * @group Visual Overrides
9105
+ */
9106
+ export interface DataLabelFilter {
9107
+ /** Filter threshold value */
9108
+ value?: number;
9109
+ /** Filter operator */
9110
+ operator?: DataLabelFilterOperator | string;
9111
+ }
9112
+ /**
9113
+ * Data label configuration for a specific column
9114
+ * @group Visual Overrides
9115
+ */
9116
+ export interface ColumnDataLabel {
9117
+ /** Column name to apply data label overrides to */
9118
+ name: string;
9119
+ /** Show or hide data labels for this column */
9120
+ visible?: boolean;
9121
+ /** Filter to apply to data labels */
9122
+ filter?: DataLabelFilter | null;
9123
+ }
9124
+ /**
9125
+ * Chart data label configuration
9126
+ * @group Visual Overrides
9127
+ */
9128
+ export interface ChartDataLabel {
9129
+ /** Show labels for all data points */
9130
+ allLabels?: boolean;
9131
+ /** Show labels for stacked values */
9132
+ stackLabels?: boolean;
9133
+ /** Per-column data label configurations */
9134
+ columnDataLabel?: ColumnDataLabel[];
9135
+ }
9136
+ /**
9137
+ * Chart summaries and totals configuration
9138
+ * @group Visual Overrides
9139
+ */
9140
+ export interface ChartSummaries {
9141
+ /** Show row totals */
9142
+ showRowTotals?: boolean;
9143
+ /** Show column totals */
9144
+ showColumnTotals?: boolean;
9145
+ /** Show row grand totals */
9146
+ showRowGrandTotals?: boolean;
9147
+ /** Show column grand totals */
9148
+ showColumnGrandTotals?: boolean;
9149
+ }
9150
+ /**
9151
+ * Gridline configuration
9152
+ * @group Visual Overrides
9153
+ */
9154
+ export interface GridLine {
9155
+ /** Show vertical gridlines */
9156
+ x?: boolean;
9157
+ /** Show horizontal gridlines */
9158
+ y?: boolean;
9159
+ }
9160
+ /**
9161
+ * Chart display configuration
9162
+ * @group Visual Overrides
9163
+ */
9164
+ export interface ChartDisplay {
9165
+ /** Summary and totals configuration */
9166
+ summaries?: ChartSummaries;
9167
+ /** Show regression line on chart */
9168
+ regressionLine?: boolean;
9169
+ /** Gridline visibility configuration */
9170
+ gridLine?: GridLine;
9171
+ }
9172
+ /**
9173
+ * Y-axis range configuration
9174
+ * @group Visual Overrides
9175
+ */
9176
+ export interface YAxisRange {
9177
+ /** Minimum value for Y-axis */
9178
+ min?: number;
9179
+ /** Maximum value for Y-axis */
9180
+ max?: number;
9181
+ }
9182
+ /**
9183
+ * Chart axis configuration
9184
+ * @group Visual Overrides
9185
+ */
9186
+ export interface ChartAxis {
9187
+ /** Column names to link to this axis */
9188
+ linkedColumns?: string[];
9189
+ /** Show the axis name */
9190
+ showName?: boolean;
9191
+ /** Show the axis label values */
9192
+ showLabelValue?: boolean;
9193
+ /** Y-axis range configuration */
9194
+ yAxisRange?: YAxisRange;
9195
+ }
9196
+ /**
9197
+ * Chart column override configuration
9198
+ * @group Visual Overrides
9199
+ */
9200
+ export interface ChartColumn {
9201
+ /** Column name to apply overrides to */
9202
+ name: string;
9203
+ /** Color for the column (hex code) */
9204
+ color?: string;
9205
+ /** Conditional formatting rules to apply to the column */
9206
+ conditionalFormatting?: ConditionalFormatting;
9207
+ }
9208
+ /**
9209
+ * Chart visualization overrides
9210
+ * @group Visual Overrides
9211
+ */
9212
+ export interface ChartOverrides {
9213
+ /** Legend configuration */
9214
+ legend?: ChartLegend;
9215
+ /** Data label configuration */
9216
+ dataLabel?: ChartDataLabel;
9217
+ /** Display properties (summaries, regression line, gridlines) */
9218
+ display?: ChartDisplay;
9219
+ /** Per-axis configurations */
9220
+ axis?: ChartAxis[];
9221
+ /** Per-column configurations */
9222
+ columns?: ChartColumn[];
9223
+ /** Update mask paths for partial updates */
9224
+ updateMaskPaths?: string[];
9225
+ }
9226
+ /**
9227
+ * Table column override configuration
9228
+ * @group Visual Overrides
9229
+ */
9230
+ export interface TableColumn {
9231
+ /**
9232
+ * Name of the column to apply overrides to
9233
+ */
9234
+ name: string;
9235
+ /**
9236
+ * Enable or disable text wrapping for the column
9237
+ */
9238
+ wrapText?: boolean;
9239
+ /**
9240
+ * Show or hide the column
9241
+ */
9242
+ show?: boolean;
9243
+ /**
9244
+ * Conditional formatting rules to apply to the column
9245
+ */
9246
+ conditionalFormatting?: ConditionalFormatting;
9247
+ }
9248
+ /**
9249
+ * Table display configuration
9250
+ * @group Visual Overrides
9251
+ */
9252
+ export interface TableDisplay {
9253
+ /** Table theme */
9254
+ tableTheme?: TableTheme | string;
9255
+ /** Table content density */
9256
+ tableContentDensity?: TableContentDensity | string;
9257
+ }
9258
+ /**
9259
+ * Column summary visibility configuration
9260
+ * @group Visual Overrides
9261
+ */
9262
+ export interface ColumnSummaryVisibility {
9263
+ /** Column ID to control summary visibility for */
9264
+ columnId: string;
9265
+ /** Show or hide summary for this column */
9266
+ visible: boolean;
9267
+ }
9268
+ /**
9269
+ * Display summary configuration
9270
+ * @group Visual Overrides
9271
+ */
9272
+ export interface DisplaySummaryConfig {
9273
+ /** Show all column summaries by default */
9274
+ showAllSummaries?: boolean;
9275
+ /** Per-column summary visibility overrides */
9276
+ columnVisibility?: ColumnSummaryVisibility[];
9277
+ }
9278
+ /**
9279
+ * Table visualization overrides
9280
+ * @group Visual Overrides
9281
+ */
9282
+ export interface TableOverrides {
9283
+ /** Per-column configurations (properties, conditional formatting) */
9284
+ columns?: TableColumn[];
9285
+ /** Table display properties (theme, density) */
9286
+ display?: TableDisplay;
9287
+ /** Summary/headline column visibility configuration */
9288
+ displaySummaryConfig?: DisplaySummaryConfig;
9289
+ /** Update mask paths for partial updates */
9290
+ updateMaskPaths?: string[];
9291
+ }
9292
+ /**
9293
+ * Visualization overrides to customize chart and table rendering
9294
+ * within embedded ThoughtSpot components.
9295
+ *
9296
+ * @group Visual Overrides
9297
+ * @example
9298
+ * ```js
9299
+ * const embed = new AppEmbed('#tsEmbed', {
9300
+ * visualOverrides: {
9301
+ * chart: {
9302
+ * legend: { show: true, position: 'bottom' },
9303
+ * columns: [{ name: 'Revenue', color: '#1f77b4' }],
9304
+ * },
9305
+ * table: {
9306
+ * display: { tableTheme: 'ZEBRA', tableContentDensity: 'COMPACT' },
9307
+ * },
9308
+ * },
9309
+ * });
9310
+ * ```
9311
+ */
9312
+ export interface VisualizationOverrides {
9313
+ /** Chart visualization overrides */
9314
+ chart?: ChartOverrides;
9315
+ /** Table visualization overrides */
9316
+ table?: TableOverrides;
9317
+ }
8895
9318
  export interface LiveboardTab {
8896
9319
  id: string;
8897
9320
  name: string;
@@ -9362,6 +9785,7 @@ class TsEmbed {
9362
9785
  * @returns
9363
9786
  */
9364
9787
  protected createEmbedEventResponder: (eventPort: MessagePort | void, eventType: EmbedEvent) => (payload: any) => void;
9788
+ private shouldSkipEvent;
9365
9789
  /**
9366
9790
  * Executes all registered event handlers for a particular event type
9367
9791
  * @param eventType The event type
@@ -10005,6 +10429,7 @@ export interface ConversationViewConfig extends SpotterEmbedViewConfig {
10005
10429
  export interface SpotterAppInitData extends DefaultAppInitData {
10006
10430
  embedParams?: {
10007
10431
  spotterSidebarConfig?: SpotterSidebarViewConfig;
10432
+ visualOverridesParams?: VisualizationOverrides | null;
10008
10433
  };
10009
10434
  }
10010
10435
  /**
@@ -10822,6 +11247,11 @@ export interface AppViewConfig extends AllEmbedViewConfig {
10822
11247
  * ```
10823
11248
  */
10824
11249
  enableLiveboardDataCache?: boolean;
11250
+ /**
11251
+ * Visual overrides to customize the chart or table properties.
11252
+ * @version SDK: 1.49.0 | ThoughtSpot: 26.6.0.cl
11253
+ */
11254
+ visualOverrides?: VisualizationOverrides;
10825
11255
  }
10826
11256
  /**
10827
11257
  * APP_INIT data shape for AppEmbed.
@@ -12087,9 +12517,32 @@ export interface SearchViewConfig extends SearchLiveboardCommonViewConfig, Omit<
12087
12517
  * ```
12088
12518
  */
12089
12519
  focusSearchBarOnRender?: boolean;
12520
+ /**
12521
+ * Enable or disable Muze chart phase 1 GA
12522
+ *
12523
+ * Supported embed types: `SearchEmbed`
12524
+ * @version SDK: 1.49.0 | ThoughtSpot Cloud: 26.6.0.cl
12525
+ * @default false
12526
+ * @example
12527
+ * ```js
12528
+ * const embed = new SearchEmbed('#tsEmbed', {
12529
+ * ... // other embed view config
12530
+ * newChartsLibrary: true,
12531
+ * })
12532
+ * ```
12533
+ */
12534
+ newChartsLibrary?: boolean;
12535
+ /**
12536
+ * Visual overrides to customize the chart or table properties.
12537
+ * @version SDK: 1.49.0 | ThoughtSpot: 26.6.0.cl
12538
+ */
12539
+ visualOverrides?: VisualizationOverrides;
12090
12540
  }
12091
12541
  export interface SearchAppInitData extends DefaultAppInitData {
12092
12542
  searchOptions?: SearchOptions$1;
12543
+ embedParams?: {
12544
+ visualOverridesParams?: VisualizationOverrides | null;
12545
+ };
12093
12546
  }
12094
12547
  /**
12095
12548
  * Embed ThoughtSpot search
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.47.2",
3
+ "version": "1.47.3",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
@@ -21,6 +21,8 @@ import {
21
21
  defaultParamsForPinboardEmbed,
22
22
  defaultParamsWithoutHiddenActions,
23
23
  expectUrlMatchesWithParams,
24
+ postMessageToParent,
25
+ testVisualOverridesInEmbed,
24
26
  } from '../test/test-utils';
25
27
  import { version } from '../../package.json';
26
28
  import * as config from '../config';
@@ -805,6 +807,53 @@ describe('App embed tests', () => {
805
807
  });
806
808
  });
807
809
 
810
+ test('Should add newChartsLibrary true to the iframe src', async () => {
811
+ const appEmbed = new AppEmbed(getRootEl(), {
812
+ ...defaultViewConfig,
813
+ showPrimaryNavbar: false,
814
+ newChartsLibrary: true,
815
+ } as AppViewConfig);
816
+
817
+ appEmbed.render();
818
+ await executeAfterWait(() => {
819
+ expectUrlMatchesWithParams(
820
+ getIFrameSrc(),
821
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=true${defaultParams}${defaultParamsPost}#/home`,
822
+ );
823
+ });
824
+ });
825
+
826
+ test('Should add newChartsLibrary false to the iframe src', async () => {
827
+ const appEmbed = new AppEmbed(getRootEl(), {
828
+ ...defaultViewConfig,
829
+ showPrimaryNavbar: false,
830
+ newChartsLibrary: false,
831
+ } as AppViewConfig);
832
+
833
+ appEmbed.render();
834
+ await executeAfterWait(() => {
835
+ expectUrlMatchesWithParams(
836
+ getIFrameSrc(),
837
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=false${defaultParams}${defaultParamsPost}#/home`,
838
+ );
839
+ });
840
+ });
841
+
842
+ test('Should not add newChartsLibrary to the iframe src when not specified', async () => {
843
+ const appEmbed = new AppEmbed(getRootEl(), {
844
+ ...defaultViewConfig,
845
+ showPrimaryNavbar: false,
846
+ } as AppViewConfig);
847
+
848
+ appEmbed.render();
849
+ await executeAfterWait(() => {
850
+ expectUrlMatchesWithParams(
851
+ getIFrameSrc(),
852
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
853
+ );
854
+ });
855
+ });
856
+
808
857
  test('Should add enableSearchAssist flagto the iframe src', async () => {
809
858
  const appEmbed = new AppEmbed(getRootEl(), {
810
859
  ...defaultViewConfig,
@@ -1812,4 +1861,96 @@ describe('App Embed Default Height and Minimum Height Handling', () => {
1812
1861
  });
1813
1862
  });
1814
1863
 
1864
+ describe('AppEmbed visualOverrides tests', () => {
1865
+ test('should include visualOverridesParams in APP_INIT when visualOverrides config is provided', async () => {
1866
+ const visualOverrides = {
1867
+ chart: {
1868
+ legend: {
1869
+ show: true,
1870
+ position: 'bottom' as const,
1871
+ },
1872
+ },
1873
+ };
1874
+ const appEmbed = new AppEmbed(getRootEl(), {
1875
+ ...defaultViewConfig,
1876
+ visualOverrides,
1877
+ } as AppViewConfig);
1878
+
1879
+ mockMessageChannel();
1880
+ await testVisualOverridesInEmbed(appEmbed, visualOverrides);
1881
+ });
1882
+
1883
+ test('should not include visualOverridesParams when visualOverrides is not provided', async () => {
1884
+ const appEmbed = new AppEmbed(getRootEl(), {
1885
+ ...defaultViewConfig,
1886
+ } as AppViewConfig);
1887
+
1888
+ const mockEmbedEventPayload = {
1889
+ type: EmbedEvent.APP_INIT,
1890
+ data: {},
1891
+ };
1892
+
1893
+ mockMessageChannel();
1894
+ appEmbed.render();
1895
+
1896
+ const mockPort: any = {
1897
+ postMessage: jest.fn(),
1898
+ };
1899
+
1900
+ await executeAfterWait(() => {
1901
+ const iframe = getIFrameEl();
1902
+ postMessageToParent(iframe.contentWindow, mockEmbedEventPayload, mockPort);
1903
+ });
1904
+
1905
+ await executeAfterWait(() => {
1906
+ const callArgs = mockPort.postMessage.mock.calls[0][0];
1907
+ expect(callArgs.type).toBe(EmbedEvent.APP_INIT);
1908
+ if (callArgs.data.embedParams) {
1909
+ expect(callArgs.data.embedParams.visualOverridesParams).toBeUndefined();
1910
+ }
1911
+ });
1912
+ });
1913
+
1914
+ test('should pass visualOverrides with table config in AppEmbed', async () => {
1915
+ const visualOverrides = {
1916
+ table: {
1917
+ display: {
1918
+ tableTheme: 'ZEBRA',
1919
+ tableContentDensity: 'COMPACT',
1920
+ },
1921
+ },
1922
+ };
1923
+ const appEmbed = new AppEmbed(getRootEl(), {
1924
+ ...defaultViewConfig,
1925
+ visualOverrides,
1926
+ } as AppViewConfig);
1927
+
1928
+ mockMessageChannel();
1929
+ await testVisualOverridesInEmbed(appEmbed, visualOverrides);
1930
+ });
1931
+
1932
+ test('should pass visualOverrides with both chart and table configs', async () => {
1933
+ const visualOverrides = {
1934
+ chart: {
1935
+ legend: {
1936
+ show: true,
1937
+ position: 'right' as const,
1938
+ },
1939
+ },
1940
+ table: {
1941
+ display: {
1942
+ tableTheme: 'STRIPED',
1943
+ },
1944
+ },
1945
+ };
1946
+ const appEmbed = new AppEmbed(getRootEl(), {
1947
+ ...defaultViewConfig,
1948
+ visualOverrides,
1949
+ } as AppViewConfig);
1950
+
1951
+ mockMessageChannel();
1952
+ await testVisualOverridesInEmbed(appEmbed, visualOverrides);
1953
+ });
1954
+ });
1955
+
1815
1956
 
package/src/embed/app.ts CHANGED
@@ -18,6 +18,7 @@ import {
18
18
  MessagePayload,
19
19
  AllEmbedViewConfig,
20
20
  DefaultAppInitData,
21
+ VisualizationOverrides,
21
22
  } from '../types';
22
23
  import { V1Embed } from './ts-embed';
23
24
  import { SpotterChatViewConfig, SpotterSidebarViewConfig } from './conversation';
@@ -798,6 +799,12 @@ export interface AppViewConfig extends AllEmbedViewConfig {
798
799
  * ```
799
800
  */
800
801
  enableLiveboardDataCache?: boolean;
802
+
803
+ /**
804
+ * Visual overrides to customize the chart or table properties.
805
+ * @version SDK: 1.49.0 | ThoughtSpot: 26.6.0.cl
806
+ */
807
+ visualOverrides?: VisualizationOverrides;
801
808
  }
802
809
 
803
810
  /**
@@ -875,6 +882,7 @@ export class AppEmbed extends V1Embed {
875
882
  showLiveboardDescription = true,
876
883
  showMaskedFilterChip = false,
877
884
  isLiveboardMasterpiecesEnabled = false,
885
+ newChartsLibrary,
878
886
  hideHomepageLeftNav = false,
879
887
  modularHomeExperience = false,
880
888
  isLiveboardHeaderSticky = true,
@@ -920,6 +928,9 @@ export class AppEmbed extends V1Embed {
920
928
  params[Param.ShowLiveboardDescription] = !!showLiveboardDescription;
921
929
  params[Param.ShowMaskedFilterChip] = showMaskedFilterChip;
922
930
  params[Param.IsLiveboardMasterpiecesEnabled] = isLiveboardMasterpiecesEnabled;
931
+ if (newChartsLibrary !== undefined) {
932
+ params[Param.EnableNewChartLibrary] = newChartsLibrary;
933
+ }
923
934
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
924
935
  params[Param.IsFullAppEmbed] = true;
925
936
  params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;