@coveo/quantic 3.17.1 → 3.18.0-pre.1cdc15abee

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.
@@ -4911,6 +4911,34 @@
4911
4911
  }
4912
4912
  ]
4913
4913
  },
4914
+ {
4915
+ "name": "QuanticInsightPanelSummary",
4916
+ "attribute": "quantic-insight-panel-summary",
4917
+ "description": "<p>The <code>QuanticInsightPanelSummary</code> component is a composite component that displays a title or a Quantic Query Summary depending whether a user query is performed.</p>",
4918
+ "categories": [
4919
+ "Insight Panel"
4920
+ ],
4921
+ "fires": "",
4922
+ "examples": [
4923
+ "<c-quantic-insight-query-summary engine-id={engineId}></c-quantic-insight-query-summary>"
4924
+ ],
4925
+ "xmlMeta": {
4926
+ "apiVersion": "60.0",
4927
+ "isExposed": "false",
4928
+ "targets": []
4929
+ },
4930
+ "properties": [
4931
+ {
4932
+ "name": "engineId",
4933
+ "attribute": "engine-id",
4934
+ "access": "@api",
4935
+ "description": "<p>The ID of the engine instance the component registers to.</p>",
4936
+ "required": true,
4937
+ "defaultValue": "",
4938
+ "type": "string"
4939
+ }
4940
+ ]
4941
+ },
4914
4942
  {
4915
4943
  "name": "QuanticModal",
4916
4944
  "attribute": "quantic-modal",
@@ -1610,4 +1610,11 @@
1610
1610
  <protected>false</protected>
1611
1611
  <shortDescription>Close notification</shortDescription>
1612
1612
  </labels>
1613
+ <labels>
1614
+ <fullName>quantic_InsightRelatedToThisCase</fullName>
1615
+ <value>Insights related to this case</value>
1616
+ <language>en_US</language>
1617
+ <protected>false</protected>
1618
+ <shortDescription>Insights related to this case</shortDescription>
1619
+ </labels>
1613
1620
  </CustomLabels>
@@ -0,0 +1,5 @@
1
+ .initial-summary-message {
2
+ background-color: #d8e6fe;
3
+ color: #54698d;
4
+ width: 100%;
5
+ }
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <template lwc:if={hasInitializationError}>
3
+ <c-quantic-component-error component-name={template.host.localName}>
4
+ </c-quantic-component-error>
5
+ </template>
6
+ <template lwc:else>
7
+ <template if:false={hasError}>
8
+ <template if:false={showQuerySummary}>
9
+ <div data-testid="initial-summary-message" class="slds-text-title_bold initial-summary-message slds-var-p-vertical_small slds-var-p-horizontal_medium">{labels.insightRelatedToThisCase}</div>
10
+ </template>
11
+ <template if:true={showQuerySummary}>
12
+ <div class="slds-var-p-vertical_small slds-var-p-horizontal_medium">
13
+ <c-quantic-summary engine-id={engineId}></c-quantic-summary>
14
+ </div>
15
+ </template>
16
+ </template>
17
+ </template>
18
+ </template>
@@ -0,0 +1,95 @@
1
+ import {LightningElement, api} from 'lwc';
2
+ import {
3
+ registerComponentForInit,
4
+ initializeWithHeadless,
5
+ getHeadlessBundle,
6
+ } from 'c/quanticHeadlessLoader';
7
+ import insightRelatedToThisCase from '@salesforce/label/c.quantic_InsightRelatedToThisCase';
8
+
9
+ /** @typedef {import("coveo").InsightEngine} InsightEngine */
10
+ /** @typedef {import("coveo").SearchBox} SearchBox */
11
+ /** @typedef {import("coveo").QuerySummary} QuerySummary */
12
+
13
+ /**
14
+ * The `QuanticInsightPanelSummary` component is a composite component that displays a title or a Quantic Query Summary depending whether a user query is performed.
15
+ * @category Insight Panel
16
+ * @example
17
+ * <c-quantic-insight-query-summary engine-id={engineId}></c-quantic-insight-query-summary>
18
+ */
19
+ export default class QuanticInsightPanelSummary extends LightningElement {
20
+ /**
21
+ * The ID of the engine instance the component registers to.
22
+ * @api
23
+ * @type {string}
24
+ */
25
+ @api engineId;
26
+
27
+ labels = {
28
+ insightRelatedToThisCase,
29
+ };
30
+
31
+ /** @type {boolean} */
32
+ showQuerySummary = false;
33
+ /** @type {boolean} */
34
+ hasError = false;
35
+
36
+ /** @type {AnyHeadless} */
37
+ headless;
38
+ /** @type {SearchBox} */
39
+ searchBox;
40
+ /** @type {QuerySummary} */
41
+ querySummary;
42
+ /** @type {boolean} */
43
+ hasInitializationError;
44
+
45
+ connectedCallback() {
46
+ registerComponentForInit(this, this.engineId);
47
+ }
48
+
49
+ renderedCallback() {
50
+ initializeWithHeadless(this, this.engineId, this.initialize);
51
+ }
52
+
53
+ /**
54
+ * @param {InsightEngine} engine
55
+ */
56
+ initialize = (engine) => {
57
+ this.headless = getHeadlessBundle(this.engineId);
58
+ this.searchBox = this.headless.buildSearchBox(engine);
59
+ this.querySummary = this.headless.buildQuerySummary(engine);
60
+ this.unsubscribeSearchBox = this.searchBox.subscribe(() =>
61
+ this.updateSummaryVisibility()
62
+ );
63
+ this.unsubscribeQuerySummary = this.querySummary.subscribe(() =>
64
+ this.updateHasError()
65
+ );
66
+ };
67
+
68
+ disconnectedCallback() {
69
+ this.unsubscribeSearchBox?.();
70
+ this.unsubscribeQuerySummary?.();
71
+ }
72
+
73
+ /**
74
+ * Updates summary visibility.
75
+ * @returns {void}
76
+ */
77
+ updateSummaryVisibility() {
78
+ this.showQuerySummary = !!this.searchBox.state.value;
79
+ }
80
+
81
+ /**
82
+ * updates the error state of the component.
83
+ * @returns {void}
84
+ */
85
+ updateHasError() {
86
+ this.hasError = this.querySummary?.state?.hasError;
87
+ }
88
+
89
+ /**
90
+ * Sets the component in the initialization error state.
91
+ */
92
+ setInitializationError() {
93
+ this.hasInitializationError = true;
94
+ }
95
+ }
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <apiVersion>60.0</apiVersion>
4
+ <isExposed>false</isExposed>
5
+ </LightningComponentBundle>
@@ -11,7 +11,7 @@
11
11
  </button>
12
12
  </template>
13
13
  <template if:false={loading}>
14
- <lightning-button-icon-stateful onclick={handleClick} aria-label={displayedLabel} variant="border-filled"
14
+ <lightning-button-icon-stateful data-testid="result-action-button" onclick={handleClick} aria-label={displayedLabel} variant="border-filled"
15
15
  class={resultActionOrderClasses} icon-name={displayedIcon} selected={_selected}>
16
16
  </lightning-button-icon-stateful>
17
17
  </template>
@@ -49,4 +49,4 @@ For more information, refer to the documentation: https://docs.coveo.com/en/o3r9
49
49
  * limitations under the License.
50
50
  */if(__exports!=exports)module.exports=exports;return module.exports});
51
51
 
52
- window.coveoQuanticVersion = '3.17.1';
52
+ window.coveoQuanticVersion = '3.18.0-pre.1cdc15abee';
@@ -53,4 +53,4 @@ For more information, refer to the documentation: https://docs.coveo.com/en/o3r9
53
53
  * limitations under the License.
54
54
  */if(__exports!=exports)module.exports=exports;return module.exports});
55
55
 
56
- window.coveoQuanticVersion = '3.17.1';
56
+ window.coveoQuanticVersion = '3.18.0-pre.1cdc15abee';
@@ -50,4 +50,4 @@ For more information, refer to the documentation: https://docs.coveo.com/en/o3r9
50
50
  * limitations under the License.
51
51
  */if(__exports!=exports)module.exports=exports;return module.exports});
52
52
 
53
- window.coveoQuanticVersion = '3.17.1';
53
+ window.coveoQuanticVersion = '3.18.0-pre.1cdc15abee';
@@ -46,4 +46,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46
46
  * limitations under the License.
47
47
  */if(__exports!=exports)module.exports=exports;return module.exports});
48
48
 
49
- window.coveoQuanticVersion = '3.17.1';
49
+ window.coveoQuanticVersion = '3.18.0-pre.1cdc15abee';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveo/quantic",
3
- "version": "3.17.1",
3
+ "version": "3.18.0-pre.1cdc15abee",
4
4
  "description": "A Salesforce Lightning Web Component (LWC) library for building modern UIs interfacing with the Coveo platform",
5
5
  "author": "coveo.com",
6
6
  "homepage": "https://coveo.com",