@coveo/quantic 3.32.0 → 3.33.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 (25) hide show
  1. package/docs/out/quantic-docs.json +1 -1
  2. package/force-app/main/default/lwc/quanticInsightInterface/quanticInsightInterface.js +1 -1
  3. package/force-app/main/default/lwc/quanticUtils/recentQueriesUtils.js +20 -12
  4. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +3 -3
  5. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/recent-queries-list/headless-core-recent-queries-list.d.ts +91 -0
  6. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/attach-to-case/headless-attach-to-case.d.ts +2 -0
  7. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/attached-results/headless-attached-results.d.ts +68 -0
  8. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/recent-queries-list/headless-insight-recent-queries-list.d.ts +14 -0
  9. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recent-queries-list/headless-recent-queries-list.d.ts +2 -79
  10. package/force-app/main/default/staticresources/coveoheadless/definitions/features/analytics/search-action-cause.d.ts +9 -1
  11. package/force-app/main/default/staticresources/coveoheadless/definitions/features/attached-results/attached-results-state.d.ts +1 -0
  12. package/force-app/main/default/staticresources/coveoheadless/definitions/features/recent-queries/recent-queries-insight-analytics-actions.d.ts +3 -0
  13. package/force-app/main/default/staticresources/coveoheadless/definitions/insight.index.d.ts +4 -0
  14. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/fetch-static-state.d.ts +3 -0
  15. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/from-build-result.d.ts +6 -0
  16. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/hydrate-static-state.d.ts +3 -0
  17. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/common/augment-preprocess-request.d.ts +7 -2
  18. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/common/types/fetch-static-state.d.ts +3 -0
  19. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/common/types/hydrate-static-state.d.ts +3 -0
  20. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/common/augment-preprocess-request.d.ts +7 -2
  21. package/force-app/main/default/staticresources/coveoheadless/definitions/state/insight-app-state.d.ts +2 -2
  22. package/force-app/main/default/staticresources/coveoheadless/headless.js +10 -10
  23. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +9 -9
  24. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +3 -3
  25. package/package.json +2 -2
@@ -4901,7 +4901,7 @@
4901
4901
  "CustomEvent#event:quantic__insightinterfaceinitialized"
4902
4902
  ],
4903
4903
  "examples": [
4904
- "<c-quantic-insight-interface engine-id={engineId} insight-id={insightId}></c-quantic-insight-interface>"
4904
+ "<c-quantic-insight-interface engine-id={engineId} insight-id={insightId} record-id={recordId}></c-quantic-insight-interface>"
4905
4905
  ],
4906
4906
  "xmlMeta": {
4907
4907
  "apiVersion": "54.0",
@@ -20,7 +20,7 @@ import {LightningElement, api} from 'lwc';
20
20
  * @fires CustomEvent#quantic__insightinterfaceinitialized
21
21
  * @category Insight Panel
22
22
  * @example
23
- * <c-quantic-insight-interface engine-id={engineId} insight-id={insightId}></c-quantic-insight-interface>
23
+ * <c-quantic-insight-interface engine-id={engineId} insight-id={insightId} record-id={recordId}></c-quantic-insight-interface>
24
24
  */
25
25
  export default class QuanticInsightInterface extends LightningElement {
26
26
  /**
@@ -1,3 +1,4 @@
1
+ // TODO SFINT-6408: [v4] Remove RecentQueryUtils from QuanticUtils once deprecated usage is fully removed.
1
2
  export class RecentQueryUtils {
2
3
  /**
3
4
  * Highlights a recent query based on the letters that match the current query.
@@ -6,17 +7,24 @@ export class RecentQueryUtils {
6
7
  * @returns {String}
7
8
  */
8
9
  static formatRecentQuery(recentQuery, query) {
9
- const highlightedValue = CoveoHeadless.HighlightUtils.highlightString({
10
- content: recentQuery,
11
- openingDelimiter: '<b>',
12
- closingDelimiter: '</b>',
13
- highlights: [
14
- {
15
- offset: query.length,
16
- length: recentQuery.length - query.length,
17
- },
18
- ],
19
- });
20
- return highlightedValue;
10
+ try {
11
+ const headlessBundle = Object.values(window.coveoHeadless)[0].bundle;
12
+ const highlightedValue = headlessBundle.HighlightUtils.highlightString({
13
+ content: recentQuery,
14
+ openingDelimiter: '<b>',
15
+ closingDelimiter: '</b>',
16
+ highlights: [
17
+ {
18
+ offset: query.length,
19
+ length: recentQuery.length - query.length,
20
+ },
21
+ ],
22
+ });
23
+ return highlightedValue;
24
+ } catch (e) {
25
+ console.warn('Unable to highlight recent query text.');
26
+ console.warn(e);
27
+ return recentQuery;
28
+ }
21
29
  }
22
30
  }