@coveo/quantic 3.44.2 → 3.45.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 (23) hide show
  1. package/README.md +12 -3
  2. package/docs/out/quantic-docs.json +58 -0
  3. package/force-app/main/default/labels/CustomLabels.labels-meta.xml +28 -0
  4. package/force-app/main/default/lwc/quanticCitation/quanticCitation.js +2 -2
  5. package/force-app/main/default/lwc/quanticHeadlessLoader/quanticHeadlessLoader.js +158 -87
  6. package/force-app/main/default/lwc/quanticLoadMoreResults/quanticLoadMoreResults.css +5 -0
  7. package/force-app/main/default/lwc/quanticLoadMoreResults/quanticLoadMoreResults.html +30 -0
  8. package/force-app/main/default/lwc/quanticLoadMoreResults/quanticLoadMoreResults.js +162 -0
  9. package/force-app/main/default/lwc/quanticLoadMoreResults/quanticLoadMoreResults.js-meta.xml +5 -0
  10. package/force-app/main/default/lwc/quanticResultLink/quanticResultLink.js +2 -2
  11. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +15 -15
  12. package/force-app/main/default/staticresources/coveoheadless/definitions/api/analytics/analytics-relay-client.d.ts +2 -1
  13. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/factories/build-factory.d.ts +1 -1
  14. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/common/access-token-manager.d.ts +7 -1
  15. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/build.d.ts +10 -0
  16. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/engine.d.ts +1 -1
  17. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/common/access-token-manager.d.ts +7 -1
  18. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/search/types/engine.d.ts +1 -1
  19. package/force-app/main/default/staticresources/coveoheadless/headless.js +17 -17
  20. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
  21. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +15 -15
  22. package/force-app/main/default/staticresources/dompurify/purify.min.js +2 -2
  23. package/package.json +14 -14
@@ -1,3 +1,4 @@
1
+ import { lruMemoize } from '@reduxjs/toolkit';
1
2
  import type { NavigatorContextProvider } from '../../app/navigator-context-provider.js';
2
3
  import type { CommerceConfigurationSection, ConfigurationSection } from '../../state/state-sections.js';
3
4
  type StateNeededByRelay = ConfigurationSection | CommerceConfigurationSection;
@@ -20,6 +21,6 @@ export declare const getRelayInstanceFromState: ((state: StateNeededByRelay, nav
20
21
  resetDependencyRecomputations: () => void;
21
22
  } & {
22
23
  argsMemoize: typeof import("reselect").weakMapMemoize;
23
- memoize: typeof import("reselect").weakMapMemoize;
24
+ memoize: typeof lruMemoize;
24
25
  };
25
26
  export {};
@@ -38,7 +38,7 @@ export type CommerceEngineDefinitionOptions<TControllers extends ControllerDefin
38
38
  /**
39
39
  * Callback invoked when the access token changes.
40
40
  */
41
- onAccessTokenUpdate?: (updateCallback: (token: string) => void) => void;
41
+ onAccessTokenUpdate?: (updateCallback: (token: string) => void, owner: object) => void;
42
42
  };
43
43
  export declare const buildFactory: <TControllerDefinitions extends CommerceControllerDefinitionsMap>(controllerDefinitions: TControllerDefinitions | undefined, options: CommerceEngineDefinitionOptions<TControllerDefinitions>) => <T extends SolutionType>(solutionType: T) => (...[buildOptions]: BuildParameters<TControllerDefinitions>) => Promise<{
44
44
  engine: SSRCommerceEngine;
@@ -1,3 +1,4 @@
1
+ type TokenChangeCallback = (accessToken: string) => void;
1
2
  /**
2
3
  * This helper allows updating the search token at any point in the SSR workflow—before or after
3
4
  * static state creation, and before or after hydration.
@@ -14,6 +15,11 @@ export declare function createAccessTokenManager(initialToken: string): {
14
15
  /**
15
16
  * Registers a callback function to be invoked when the access token changes.
16
17
  * If there's a queued token, the callback will be invoked immediately.
18
+ *
19
+ * @param callback - Invoked with the new token on every subsequent change.
20
+ * @param owner - The object whose lifetime bounds the subscription (the engine).
21
+ * @returns An unsubscribe function that removes the callback immediately.
17
22
  */
18
- registerCallback(callback: (accessToken: string) => void): void;
23
+ registerCallback(callback: TokenChangeCallback, owner: object): () => void;
19
24
  };
25
+ export {};
@@ -154,5 +154,15 @@ export interface CommonBuildConfig {
154
154
  * ```
155
155
  */
156
156
  cart?: CartInitialState;
157
+ /**
158
+ * A per-request access token (for example, a per-user Coveo search token) to use for this
159
+ * `fetchStaticState()` or `hydrateStaticState()` call only.
160
+ *
161
+ * When provided, it overrides the access token from the engine definition configuration for this
162
+ * request without mutating the shared definition, which is the supported way to use per-user
163
+ * search tokens in a multi-tenant server process. When omitted, the definition's configured
164
+ * access token is used.
165
+ */
166
+ accessToken?: string;
157
167
  }
158
168
  export type BuildConfig<TControllers extends ControllerDefinitionsMap<Controller>, TSolutionType extends SolutionType> = TSolutionType extends SolutionType.search ? SearchBuildConfig : TSolutionType extends SolutionType.listing ? ListingBuildConfig : TSolutionType extends SolutionType.recommendation ? RecommendationBuildConfig<TControllers> : TSolutionType extends SolutionType.standalone ? CommonBuildConfig : never;
@@ -25,7 +25,7 @@ export type CommerceEngineDefinitionOptions<TControllers extends ControllerDefin
25
25
  /**
26
26
  * Callback invoked when the access token changes.
27
27
  */
28
- onAccessTokenUpdate?: (updateCallback: (token: string) => void) => void;
28
+ onAccessTokenUpdate?: (updateCallback: (token: string) => void, owner: object) => void;
29
29
  };
30
30
  export interface CommerceEngineDefinition<TControllers extends ControllerDefinitionsMap<Controller>, TSolutionType extends SolutionType> {
31
31
  /**
@@ -1,3 +1,4 @@
1
+ type TokenChangeCallback = (accessToken: string) => void;
1
2
  /**
2
3
  * This helper allows updating the search token at any point in the SSR workflow—before or after
3
4
  * static state creation, and before or after hydration.
@@ -14,6 +15,11 @@ export declare function createAccessTokenManager(initialToken: string): {
14
15
  /**
15
16
  * Registers a callback function to be invoked when the access token changes.
16
17
  * If there's a queued token, the callback will be invoked immediately.
18
+ *
19
+ * @param callback - Invoked with the new token on every subsequent change.
20
+ * @param owner - The object whose lifetime bounds the subscription (the engine).
21
+ * @returns An unsubscribe function that removes the callback immediately.
17
22
  */
18
- registerCallback(callback: (accessToken: string) => void): void;
23
+ registerCallback(callback: TokenChangeCallback, owner: object): () => void;
19
24
  };
25
+ export {};
@@ -26,7 +26,7 @@ export type SearchEngineDefinitionOptions<TControllers extends SearchControllerD
26
26
  /**
27
27
  * Callback invoked when the access token changes.
28
28
  */
29
- onAccessTokenUpdate?: (updateCallback: (token: string) => void) => void;
29
+ onAccessTokenUpdate?: (updateCallback: (token: string) => void, owner: object) => void;
30
30
  };
31
31
  export interface SearchEngineDefinition<TEngine extends CoreEngine | CoreEngineNext, TControllers extends ControllerDefinitionsMap<TEngine, Controller>> {
32
32
  /**