@coveo/quantic 3.33.6 → 3.34.1
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.
- package/docs/out/quantic-docs.json +1 -1
- package/force-app/main/default/lwc/jsconfig.json +1 -1
- package/force-app/main/default/lwc/quanticResultQuickview/__tests__/quanticResultQuickview.test.js +8 -1
- package/force-app/main/default/lwc/quanticResultQuickview/quanticResultQuickview.js +13 -5
- package/force-app/main/default/lwc/quanticUtils/quanticUtils.js +8 -8
- package/force-app/main/default/staticresources/coveobueno/browser/bueno.js +1 -1
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +10 -10
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/commerce-api-client.d.ts +6 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/commerce-api-params.d.ts +6 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/commerce-metadata.d.ts +7 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/product.d.ts +5 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/result.d.ts +52 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/listing/request.d.ts +3 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/listing/response.d.ts +5 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/product-enrichment/product-enrichment-request.d.ts +29 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/product-enrichment/product-enrichment-response.d.ts +17 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/search/date/date-format.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts +9 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/interactive-spotlight-content/headless-core-interactive-spotlight-content.d.ts +38 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/sub-controller/headless-sub-controller.d.ts +10 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/product-enrichment/headless-product-enrichment.d.ts +56 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/product-listing/headless-product-listing.d.ts +14 -5
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-enrichment/product-enrichment-actions-loader.d.ts +28 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-enrichment/product-enrichment-actions.d.ts +27 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-enrichment/product-enrichment-slice.d.ts +4 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-enrichment/product-enrichment-state.d.ts +17 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-enrichment/product-enrichment.d.ts +7 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-listing/product-listing-actions-loader.d.ts +3 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-listing/product-listing-actions.d.ts +12 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-listing/product-listing-state.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/spotlight-content/spotlight-content-actions-loaders.d.ts +29 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/spotlight-content/spotlight-content-actions.d.ts +29 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce.index.d.ts +2 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/state/commerce-app-state.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/state/state-sections.d.ts +7 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/test/mock-product-enrichment.d.ts +6 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/test/mock-product-listing.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/test/mock-spotlight-content.d.ts +3 -0
- package/force-app/main/default/staticresources/coveoheadless/headless.js +12 -12
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +11 -11
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +9 -9
- package/package.json +4 -4
package/force-app/main/default/lwc/quanticResultQuickview/__tests__/quanticResultQuickview.test.js
CHANGED
|
@@ -44,6 +44,8 @@ const exampleResult = {
|
|
|
44
44
|
},
|
|
45
45
|
title: 'abc',
|
|
46
46
|
uniqueId: '123',
|
|
47
|
+
parentResult: {},
|
|
48
|
+
childResults: [],
|
|
47
49
|
};
|
|
48
50
|
|
|
49
51
|
const functionMocks = {
|
|
@@ -149,8 +151,13 @@ describe('c-quantic-result-quick-view', () => {
|
|
|
149
151
|
await quickViewButton.click();
|
|
150
152
|
await flushPromises();
|
|
151
153
|
|
|
154
|
+
// eslint-disable-next-line no-unused-vars
|
|
155
|
+
const {parentResult, childResults, ...expectedPayload} = exampleResult;
|
|
156
|
+
|
|
152
157
|
expect(functionMocks.pushRecentResult).toHaveBeenCalledTimes(1);
|
|
153
|
-
expect(functionMocks.pushRecentResult).toHaveBeenCalledWith(
|
|
158
|
+
expect(functionMocks.pushRecentResult).toHaveBeenCalledWith(
|
|
159
|
+
expectedPayload
|
|
160
|
+
);
|
|
154
161
|
});
|
|
155
162
|
|
|
156
163
|
describe('when the result has no preview', () => {
|
|
@@ -16,6 +16,13 @@ import {LightningElement, api, track} from 'lwc';
|
|
|
16
16
|
/** @typedef {import("coveo").QuickviewState} QuickviewState */
|
|
17
17
|
/** @typedef {import("coveo").SearchEngine} SearchEngine */
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {Object} ResultWithFolding
|
|
21
|
+
* @mixes Result
|
|
22
|
+
* @property {Result} parentResult
|
|
23
|
+
* @property {Result[]} childResults
|
|
24
|
+
*/
|
|
25
|
+
|
|
19
26
|
/**
|
|
20
27
|
* The `QuanticResultQuickview` component renders a button which the end user can click to open a modal box containing certain information about a result.
|
|
21
28
|
* @category Result Template
|
|
@@ -33,7 +40,7 @@ export default class QuanticResultQuickview extends LightningElement {
|
|
|
33
40
|
/**
|
|
34
41
|
* The result to retrieve a quickview for.
|
|
35
42
|
* @api
|
|
36
|
-
* @type {
|
|
43
|
+
* @type {ResultWithFolding}
|
|
37
44
|
*/
|
|
38
45
|
@api result;
|
|
39
46
|
/**
|
|
@@ -173,10 +180,11 @@ export default class QuanticResultQuickview extends LightningElement {
|
|
|
173
180
|
this.engine
|
|
174
181
|
);
|
|
175
182
|
|
|
176
|
-
//
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
183
|
+
// Exclude parentResult and childResults to prevent Salesforce Proxy extensibility errors.
|
|
184
|
+
// These nested result objects remain proxied after spreading, causing 'isExtensible' trap violations when accessed by the Headless library.
|
|
185
|
+
// eslint-disable-next-line no-unused-vars
|
|
186
|
+
const {parentResult, childResults, ...result} = this.result;
|
|
187
|
+
this.engine.dispatch(pushRecentResult({...result, raw: {...result.raw}}));
|
|
180
188
|
}
|
|
181
189
|
|
|
182
190
|
closeQuickview() {
|
|
@@ -987,6 +987,7 @@ export function getElementPadding(element) {
|
|
|
987
987
|
|
|
988
988
|
/**
|
|
989
989
|
* Returns the absolute height of an element.
|
|
990
|
+
* Uses getBoundingClientRect() to ensure synchronous layout calculation.
|
|
990
991
|
* @param {Element} element
|
|
991
992
|
* @returns {number} The absolute height of the element including padding.
|
|
992
993
|
*/
|
|
@@ -994,15 +995,15 @@ export function getAbsoluteHeight(element) {
|
|
|
994
995
|
if (!element) {
|
|
995
996
|
return 0;
|
|
996
997
|
}
|
|
997
|
-
const paddings = getElementPadding(element);
|
|
998
|
-
const padding = paddings.top + paddings.bottom;
|
|
999
998
|
|
|
1000
|
-
//
|
|
1001
|
-
|
|
999
|
+
// Using getBoundingClientRect ensures accurate height measurements across all browsers, especially Safari.
|
|
1000
|
+
const elementBoundingRect = element.getBoundingClientRect();
|
|
1001
|
+
return Math.ceil(elementBoundingRect.height);
|
|
1002
1002
|
}
|
|
1003
1003
|
|
|
1004
1004
|
/**
|
|
1005
1005
|
* Returns the absolute width of an element.
|
|
1006
|
+
* Uses getBoundingClientRect() to ensure synchronous layout calculation.
|
|
1006
1007
|
* @param {Element} element
|
|
1007
1008
|
* @returns {number} The absolute width of the element including padding.
|
|
1008
1009
|
*/
|
|
@@ -1010,9 +1011,8 @@ export function getAbsoluteWidth(element) {
|
|
|
1010
1011
|
if (!element) {
|
|
1011
1012
|
return 0;
|
|
1012
1013
|
}
|
|
1013
|
-
const paddings = getElementPadding(element);
|
|
1014
|
-
const padding = paddings.left + paddings.right;
|
|
1015
1014
|
|
|
1016
|
-
//
|
|
1017
|
-
|
|
1015
|
+
// Using getBoundingClientRect ensures accurate width measurements across all browsers, especially Safari.
|
|
1016
|
+
const elementBoundingRect = element.getBoundingClientRect();
|
|
1017
|
+
return Math.ceil(elementBoundingRect.width);
|
|
1018
1018
|
}
|