@coveo/quantic 3.44.1 → 3.44.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 (207) hide show
  1. package/README.md +12 -3
  2. package/force-app/main/default/classes/OrganizationEndpointsTest.cls +71 -15
  3. package/force-app/main/default/classes/RecommendationsControllerTest.cls +1 -1
  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/quanticTabBar/quanticTabBar.js +148 -125
  7. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +16 -16
  8. package/force-app/main/default/staticresources/coveoheadless/headless.js +17 -17
  9. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
  10. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +16 -16
  11. package/force-app/main/default/staticresources/dompurify/purify.min.js +2 -2
  12. package/package.json +43 -41
  13. package/force-app/main/default/lwc/quanticAriaLive/__tests__/quanticAriaLive.test.js +0 -106
  14. package/force-app/main/default/lwc/quanticBreadcrumbManager/__tests__/quanticBreadcrumbManager.test.js +0 -752
  15. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/data.ts +0 -130
  16. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/fixture.ts +0 -87
  17. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/pageObject.ts +0 -282
  18. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/quanticBreadcrumbManager.e2e.ts +0 -208
  19. package/force-app/main/default/lwc/quanticCarousel/__tests__/quanticCarousel.test.js +0 -262
  20. package/force-app/main/default/lwc/quanticCaseClassification/__tests__/quanticCaseClassification.test.js +0 -819
  21. package/force-app/main/default/lwc/quanticCaseClassification/e2e/data.ts +0 -23
  22. package/force-app/main/default/lwc/quanticCaseClassification/e2e/fixture.ts +0 -51
  23. package/force-app/main/default/lwc/quanticCaseClassification/e2e/pageObject.ts +0 -152
  24. package/force-app/main/default/lwc/quanticCaseClassification/e2e/quanticCaseClassification.e2e.ts +0 -269
  25. package/force-app/main/default/lwc/quanticCategoryFacet/__tests__/quanticCategoryFacet.test.js +0 -1183
  26. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/data.ts +0 -91
  27. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/fixture.ts +0 -79
  28. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/pageObject.ts +0 -55
  29. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/quanticCategoryFacet.e2e.ts +0 -219
  30. package/force-app/main/default/lwc/quanticCitation/__tests__/quanticCitation.test.js +0 -581
  31. package/force-app/main/default/lwc/quanticColoredResultBadge/__tests__/quanticColoredResultBadge.test.js +0 -212
  32. package/force-app/main/default/lwc/quanticDateFacet/__tests__/quanticDateFacet.test.js +0 -688
  33. package/force-app/main/default/lwc/quanticDateFacet/e2e/data.ts +0 -44
  34. package/force-app/main/default/lwc/quanticDateFacet/e2e/fixture.ts +0 -72
  35. package/force-app/main/default/lwc/quanticDateFacet/e2e/pageObject.ts +0 -27
  36. package/force-app/main/default/lwc/quanticDateFacet/e2e/quanticDateFacet.e2e.ts +0 -167
  37. package/force-app/main/default/lwc/quanticDidYouMean/__tests__/quanticDidYouMean.test.js +0 -348
  38. package/force-app/main/default/lwc/quanticDidYouMean/e2e/data.ts +0 -48
  39. package/force-app/main/default/lwc/quanticDidYouMean/e2e/fixture.ts +0 -84
  40. package/force-app/main/default/lwc/quanticDidYouMean/e2e/pageObject.ts +0 -173
  41. package/force-app/main/default/lwc/quanticDidYouMean/e2e/quanticDidYouMean.e2e.ts +0 -219
  42. package/force-app/main/default/lwc/quanticDocumentSuggestion/__tests__/quanticDocumentSuggestion.test.js +0 -404
  43. package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/fixture.ts +0 -38
  44. package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/pageObject.ts +0 -52
  45. package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/quanticDocumentSuggestion.e2e.ts +0 -102
  46. package/force-app/main/default/lwc/quanticFacet/__tests__/quanticFacet.test.js +0 -1105
  47. package/force-app/main/default/lwc/quanticFacet/e2e/data.ts +0 -62
  48. package/force-app/main/default/lwc/quanticFacet/e2e/fixture.ts +0 -78
  49. package/force-app/main/default/lwc/quanticFacet/e2e/pageObject.ts +0 -67
  50. package/force-app/main/default/lwc/quanticFacet/e2e/quanticFacet.e2e.ts +0 -242
  51. package/force-app/main/default/lwc/quanticFacetCaption/__tests__/quanticFacetCaption.test.js +0 -28
  52. package/force-app/main/default/lwc/quanticFacetManager/__tests__/quanticFacetManager.test.js +0 -178
  53. package/force-app/main/default/lwc/quanticFacetManager/e2e/data.ts +0 -59
  54. package/force-app/main/default/lwc/quanticFacetManager/e2e/fixture.ts +0 -75
  55. package/force-app/main/default/lwc/quanticFacetManager/e2e/pageObject.ts +0 -23
  56. package/force-app/main/default/lwc/quanticFacetManager/e2e/quanticFacetManager.e2e.ts +0 -82
  57. package/force-app/main/default/lwc/quanticFeedback/__tests__/quanticFeedback.test.js +0 -403
  58. package/force-app/main/default/lwc/quanticFeedbackModal/__tests__/quanticFeedbackModal.test.js +0 -448
  59. package/force-app/main/default/lwc/quanticFeedbackModalQna/__tests__/quanticFeedbackModalQna.test.js +0 -298
  60. package/force-app/main/default/lwc/quanticFoldedResultList/__tests__/quanticFoldedResultList.test.js +0 -323
  61. package/force-app/main/default/lwc/quanticFoldedResultList/e2e/fixture.ts +0 -74
  62. package/force-app/main/default/lwc/quanticFoldedResultList/e2e/pageObject.ts +0 -81
  63. package/force-app/main/default/lwc/quanticFoldedResultList/e2e/quanticFoldedResultList.e2e.ts +0 -69
  64. package/force-app/main/default/lwc/quanticGeneratedAnswer/__tests__/quanticGeneratedAnswer.test.js +0 -1575
  65. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/agentData.ts +0 -279
  66. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/data.ts +0 -56
  67. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture-agent.ts +0 -77
  68. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture.ts +0 -194
  69. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/pageObject.ts +0 -599
  70. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswer.e2e.ts +0 -333
  71. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswerAgent.e2e.ts +0 -298
  72. package/force-app/main/default/lwc/quanticGeneratedAnswerBody/__tests__/quanticGeneratedAnswerBody.test.js +0 -418
  73. package/force-app/main/default/lwc/quanticGeneratedAnswerContent/__tests__/quanticGeneratedAnswerContent.test.js +0 -447
  74. package/force-app/main/default/lwc/quanticGeneratedAnswerCopyToClipboard/__tests__/quanticGeneratedAnswerCopyToClipboard.test.js +0 -129
  75. package/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/__tests__/quanticGeneratedAnswerFollowUpInput.test.js +0 -466
  76. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/__tests__/quanticGeneratedAnswerStreamOfThought.test.js +0 -402
  77. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/__tests__/stepsUtils.test.js +0 -118
  78. package/force-app/main/default/lwc/quanticGeneratedAnswerThread/__tests__/quanticGeneratedAnswerThread.test.js +0 -285
  79. package/force-app/main/default/lwc/quanticHeading/__tests__/quanticHeading.test.js +0 -71
  80. package/force-app/main/default/lwc/quanticHeadlessLoader/__tests__/quanticHeadlessLoader.test.js +0 -651
  81. package/force-app/main/default/lwc/quanticInsightInterface/__tests__/quanticInsightInterface.test.js +0 -194
  82. package/force-app/main/default/lwc/quanticInsightSummary/__tests__/quanticInsightSummary.test.js +0 -230
  83. package/force-app/main/default/lwc/quanticModal/__tests__/quanticModal.test.js +0 -205
  84. package/force-app/main/default/lwc/quanticNotifications/__tests__/quanticNotifications.test.js +0 -309
  85. package/force-app/main/default/lwc/quanticNotifications/e2e/fixture.ts +0 -62
  86. package/force-app/main/default/lwc/quanticNotifications/e2e/pageObject.ts +0 -55
  87. package/force-app/main/default/lwc/quanticNotifications/e2e/quanticNotifications.e2e.ts +0 -47
  88. package/force-app/main/default/lwc/quanticNumericFacet/__tests__/quanticNumericFacet.test.js +0 -953
  89. package/force-app/main/default/lwc/quanticNumericFacet/e2e/data.ts +0 -48
  90. package/force-app/main/default/lwc/quanticNumericFacet/e2e/fixture.ts +0 -75
  91. package/force-app/main/default/lwc/quanticNumericFacet/e2e/pageObject.ts +0 -59
  92. package/force-app/main/default/lwc/quanticNumericFacet/e2e/quanticNumericFacet.e2e.ts +0 -186
  93. package/force-app/main/default/lwc/quanticPager/__tests__/quanticPager.test.js +0 -430
  94. package/force-app/main/default/lwc/quanticPager/e2e/fixture.ts +0 -65
  95. package/force-app/main/default/lwc/quanticPager/e2e/pageObject.ts +0 -69
  96. package/force-app/main/default/lwc/quanticPager/e2e/quanticPager.e2e.ts +0 -106
  97. package/force-app/main/default/lwc/quanticPlaceholder/__tests__/quanticPlaceholder.test.js +0 -47
  98. package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/defaultTestCase.json +0 -13
  99. package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/youtubeTestCase.json +0 -14
  100. package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/quanticQuickviewContent.test.js +0 -82
  101. package/force-app/main/default/lwc/quanticRadioButtonsGroup/__tests__/quanticRadioButtonsGroup.test.js +0 -273
  102. package/force-app/main/default/lwc/quanticRecentQueriesList/__tests__/quanticRecentQueriesList.test.js +0 -448
  103. package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/fixture.ts +0 -43
  104. package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/pageObject.ts +0 -55
  105. package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/quanticRecentQueriesList.e2e.ts +0 -93
  106. package/force-app/main/default/lwc/quanticRecentResultsList/__tests__/quanticRecentResultsList.test.js +0 -516
  107. package/force-app/main/default/lwc/quanticRecentResultsList/e2e/fixture.ts +0 -43
  108. package/force-app/main/default/lwc/quanticRecentResultsList/e2e/pageObject.ts +0 -61
  109. package/force-app/main/default/lwc/quanticRecentResultsList/e2e/quanticRecentResultsList.e2e.ts +0 -48
  110. package/force-app/main/default/lwc/quanticRecommendationList/__tests__/quanticRecommendationList.test.js +0 -491
  111. package/force-app/main/default/lwc/quanticRecommendationList/e2e/fixture.ts +0 -36
  112. package/force-app/main/default/lwc/quanticRecommendationList/e2e/pageObject.ts +0 -52
  113. package/force-app/main/default/lwc/quanticRecommendationList/e2e/quanticRecommendationList.e2e.ts +0 -53
  114. package/force-app/main/default/lwc/quanticRefineModalContent/__tests__/quanticRefineModalContent.test.js +0 -747
  115. package/force-app/main/default/lwc/quanticRefineToggle/__tests__/quanticRefineToggle.test.js +0 -544
  116. package/force-app/main/default/lwc/quanticResultAction/__tests__/quanticResultAction.test.js +0 -262
  117. package/force-app/main/default/lwc/quanticResultActionBar/__tests__/quanticResultActionBar.test.js +0 -141
  118. package/force-app/main/default/lwc/quanticResultChildren/__tests__/quanticResultChildren.test.js +0 -340
  119. package/force-app/main/default/lwc/quanticResultCopyToClipboard/__tests__/quanticResultCopyToClipboard.test.js +0 -300
  120. package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/fixture.ts +0 -49
  121. package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/pageObject.ts +0 -49
  122. package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/quanticResultCopyToClipboard.e2e.ts +0 -40
  123. package/force-app/main/default/lwc/quanticResultDate/__tests__/quanticResultDate.test.js +0 -144
  124. package/force-app/main/default/lwc/quanticResultField/__tests__/quanticResultField.test.js +0 -120
  125. package/force-app/main/default/lwc/quanticResultHighlightedTextField/__tests__/quanticResultHighlightedTextField.test.js +0 -209
  126. package/force-app/main/default/lwc/quanticResultLink/__tests__/quanticResultLink.test.js +0 -302
  127. package/force-app/main/default/lwc/quanticResultList/__tests__/quanticResultList.test.js +0 -342
  128. package/force-app/main/default/lwc/quanticResultList/e2e/fixture.ts +0 -70
  129. package/force-app/main/default/lwc/quanticResultList/e2e/pageObject.ts +0 -81
  130. package/force-app/main/default/lwc/quanticResultList/e2e/quanticResultList.e2e.ts +0 -69
  131. package/force-app/main/default/lwc/quanticResultMultiValueText/__tests__/quanticResultMultiValueText.test.js +0 -235
  132. package/force-app/main/default/lwc/quanticResultNumber/__tests__/quanticResultNumber.test.js +0 -144
  133. package/force-app/main/default/lwc/quanticResultPrintableUri/__tests__/quanticResultPrintableUri.test.js +0 -324
  134. package/force-app/main/default/lwc/quanticResultQuickview/__tests__/quanticResultQuickview.test.js +0 -308
  135. package/force-app/main/default/lwc/quanticResultQuickview/e2e/fixture.ts +0 -85
  136. package/force-app/main/default/lwc/quanticResultQuickview/e2e/pageObject.ts +0 -38
  137. package/force-app/main/default/lwc/quanticResultQuickview/e2e/quanticResultQuickView.e2e.ts +0 -66
  138. package/force-app/main/default/lwc/quanticResultTemplate/__tests__/quanticResultTemplate.test.js +0 -90
  139. package/force-app/main/default/lwc/quanticResultText/__tests__/quanticResultText.test.js +0 -155
  140. package/force-app/main/default/lwc/quanticResultsPerPage/__tests__/quanticResultsPerPage.test.js +0 -464
  141. package/force-app/main/default/lwc/quanticResultsPerPage/e2e/fixture.ts +0 -78
  142. package/force-app/main/default/lwc/quanticResultsPerPage/e2e/pageObject.ts +0 -85
  143. package/force-app/main/default/lwc/quanticResultsPerPage/e2e/quanticResultsPerPage.e2e.ts +0 -97
  144. package/force-app/main/default/lwc/quanticSearchBox/__tests__/quanticSearchBox.test.js +0 -487
  145. package/force-app/main/default/lwc/quanticSearchBox/e2e/fixture.ts +0 -86
  146. package/force-app/main/default/lwc/quanticSearchBox/e2e/pageObject.ts +0 -45
  147. package/force-app/main/default/lwc/quanticSearchBox/e2e/quanticSearchBox.e2e.ts +0 -159
  148. package/force-app/main/default/lwc/quanticSearchBoxInput/__tests__/quanticSearchBoxInput.test.js +0 -743
  149. package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/__tests__/quanticSearchBoxSuggestionsList.test.js +0 -571
  150. package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/fixture.ts +0 -113
  151. package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/pageObject.ts +0 -113
  152. package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/quanticSearchBoxSuggestionsList.e2e.ts +0 -282
  153. package/force-app/main/default/lwc/quanticSmartSnippet/__tests__/quanticSmartSnippet.test.js +0 -341
  154. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/data.ts +0 -21
  155. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/fixture.ts +0 -93
  156. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/pageObject.ts +0 -196
  157. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/quanticSmartSnippet.e2e.ts +0 -168
  158. package/force-app/main/default/lwc/quanticSmartSnippetAnswer/__tests__/quanticSmartSnippetAnswer.test.js +0 -126
  159. package/force-app/main/default/lwc/quanticSmartSnippetSource/__tests__/quanticSmartSnippetSource.test.js +0 -290
  160. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/__tests__/quanticSmartSnippetSuggestions.test.js +0 -329
  161. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/data.ts +0 -31
  162. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/fixture.ts +0 -95
  163. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/pageObject.ts +0 -160
  164. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/quanticSmartSnippetSuggestions.e2e.ts +0 -127
  165. package/force-app/main/default/lwc/quanticSort/__tests__/quanticSort.test.js +0 -416
  166. package/force-app/main/default/lwc/quanticSort/e2e/fixture.ts +0 -62
  167. package/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts +0 -100
  168. package/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts +0 -86
  169. package/force-app/main/default/lwc/quanticSourceCitations/__tests__/quanticSourceCitations.test.js +0 -156
  170. package/force-app/main/default/lwc/quanticStandaloneSearchBox/__tests__/quanticStandaloneSearchBox.test.js +0 -387
  171. package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/fixture.ts +0 -54
  172. package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/pageObject.ts +0 -54
  173. package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/quanticStandaloneSearchBox.e2e.ts +0 -72
  174. package/force-app/main/default/lwc/quanticStatefulButton/__tests__/quanticStatefulButton.test.js +0 -222
  175. package/force-app/main/default/lwc/quanticSummary/__tests__/quanticSummary.test.js +0 -244
  176. package/force-app/main/default/lwc/quanticTab/__tests__/quanticTab.test.js +0 -333
  177. package/force-app/main/default/lwc/quanticTab/e2e/fixture.ts +0 -60
  178. package/force-app/main/default/lwc/quanticTab/e2e/pageObject.ts +0 -68
  179. package/force-app/main/default/lwc/quanticTab/e2e/quanticTab.e2e.ts +0 -72
  180. package/force-app/main/default/lwc/quanticTabBar/__tests__/quanticTabBar.test.js +0 -331
  181. package/force-app/main/default/lwc/quanticTabBar/e2e/fixture.ts +0 -65
  182. package/force-app/main/default/lwc/quanticTabBar/e2e/pageObject.ts +0 -80
  183. package/force-app/main/default/lwc/quanticTabBar/e2e/quanticTabBar.e2e.ts +0 -172
  184. package/force-app/main/default/lwc/quanticThreadItem/__tests__/quanticThreadItem.test.js +0 -314
  185. package/force-app/main/default/lwc/quanticTimeframeFacet/__tests__/quanticTimeframeFacet.test.js +0 -1059
  186. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/data.ts +0 -66
  187. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/fixture.ts +0 -74
  188. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/pageObject.ts +0 -43
  189. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/quanticTimeframeFacet.e2e.ts +0 -184
  190. package/force-app/main/default/lwc/quanticTooltip/__tests__/quanticTooltip.test.js +0 -107
  191. package/force-app/main/default/lwc/quanticUserAction/__tests__/quanticUserAction.test.js +0 -427
  192. package/force-app/main/default/lwc/quanticUserActionsSession/__tests__/quanticUserActionsSession.test.js +0 -269
  193. package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/data/userActionsState.json +0 -89
  194. package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/quanticUserActionsTimeline.test.js +0 -511
  195. package/force-app/main/default/lwc/quanticUserActionsToggle/__tests__/quanticUserActionsToggle.test.js +0 -229
  196. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/data.ts +0 -32
  197. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/fixture.ts +0 -32
  198. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/pageObject.ts +0 -71
  199. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/quanticUserActionsToggle.e2e.ts +0 -39
  200. package/force-app/main/default/lwc/quanticUtils/__tests__/accessibilityUtils.test.js +0 -214
  201. package/force-app/main/default/lwc/quanticUtils/__tests__/citationAnchoringUtils.test.js +0 -84
  202. package/force-app/main/default/lwc/quanticUtils/__tests__/facetDependenciesUtils.test.js +0 -92
  203. package/force-app/main/default/lwc/quanticUtils/__tests__/facetStoreUtils.test.js +0 -86
  204. package/force-app/main/default/lwc/quanticUtils/__tests__/markdownUtils.test.js +0 -109
  205. package/force-app/main/default/lwc/quanticUtils/__tests__/quanticUtils.test.js +0 -233
  206. package/force-app/main/default/lwc/quanticUtils/__tests__/timeAndDateUtils.test.js +0 -22
  207. package/force-app/main/default/lwc/quanticViewedByCustomerBadge/__tests__/quanticViewedByCustomerBadge.test.js +0 -131
package/README.md CHANGED
@@ -66,6 +66,15 @@ To access the links to the created communities, check the generated `.env` file
66
66
 
67
67
  Or you can run the individual commands below.
68
68
 
69
+ ### Playground Components and Solution Examples
70
+
71
+ Quantic has two separate folders for example components, each serving a different purpose, use the following rules when adding an example component:
72
+
73
+ - **`force-app/playgroundComponents`** contains the components used to build the Quantic Examples community playground and to support Playwright end-to-end tests. Add a component here when it demonstrates an individual Quantic component, exposes its configurable properties for experimentation, or provides test coverage for the component.
74
+ - **`force-app/solutionExamples`** contains real-world reference implementations that demonstrate how to combine Quantic components to solve a broader Salesforce use case. Examples include `exampleInsightPanel`, `exampleRelevantGenerativeAnswering`, `examplePageViewTracker` and more. Add a component here when it demonstrates an integration or reusable solution pattern rather than an individual component playground.
75
+
76
+ Both folders are deployed by `pnpm run deploy:examples`.
77
+
69
78
  #### Create a Default Scratch Org
70
79
 
71
80
  - Make sure you are in the `packages/quantic` root folder.
@@ -130,19 +139,19 @@ pnpm run deploy:examples MyCustomOrg
130
139
  To run Playwright tests, run:
131
140
 
132
141
  ```bash
133
- pnpm run e2e:playwright
142
+ pnpm run e2e:pre-provisioned
134
143
  ```
135
144
 
136
145
  To run Playwright tests only for the scratch org where LWS is enabled, run:
137
146
 
138
147
  ```bash
139
- pnpm run e2e:playwright:lws-enabled
148
+ pnpm run e2e:pre-provisioned:lws-enabled
140
149
  ```
141
150
 
142
151
  To run Playwright tests only for the scratch org where LWS is disabled, run:
143
152
 
144
153
  ```bash
145
- pnpm run e2e:playwright:lws-disabled
154
+ pnpm run e2e:pre-provisioned:lws-disabled
146
155
  ```
147
156
 
148
157
  ### Run LWC unit tests for Quantic Components
@@ -5,17 +5,36 @@ public class OrganizationEndpointsTest {
5
5
  String orgId = 'testOrgId';
6
6
  String env = 'prod';
7
7
 
8
- Map<String, String> endpoints = OrganizationEndpoints.getOrganizationEndpoints(orgId, env);
8
+ Map<String, String> endpoints = OrganizationEndpoints.getOrganizationEndpoints(
9
+ orgId,
10
+ env
11
+ );
9
12
 
10
13
  String expectedPlatform = 'https://testOrgId.org.coveo.com';
11
14
  String expectedAnalytics = 'https://testOrgIdanalytics.org.coveo.com';
12
15
  String expectedSearch = expectedPlatform + '/rest/search/v2';
13
16
  String expectedAdmin = 'https://testOrgIdadmin.org.coveo.com';
14
17
 
15
- System.assertEquals(expectedPlatform, endpoints.get('platform'), 'Platform URL mismatch for prod');
16
- System.assertEquals(expectedAnalytics, endpoints.get('analytics'), 'Analytics URL mismatch for prod');
17
- System.assertEquals(expectedSearch, endpoints.get('search'), 'Search URL mismatch for prod');
18
- System.assertEquals(expectedAdmin, endpoints.get('admin'), 'Admin URL mismatch for prod');
18
+ System.assertEquals(
19
+ expectedPlatform,
20
+ endpoints.get('platform'),
21
+ 'Platform URL mismatch for prod'
22
+ );
23
+ System.assertEquals(
24
+ expectedAnalytics,
25
+ endpoints.get('analytics'),
26
+ 'Analytics URL mismatch for prod'
27
+ );
28
+ System.assertEquals(
29
+ expectedSearch,
30
+ endpoints.get('search'),
31
+ 'Search URL mismatch for prod'
32
+ );
33
+ System.assertEquals(
34
+ expectedAdmin,
35
+ endpoints.get('admin'),
36
+ 'Admin URL mismatch for prod'
37
+ );
19
38
  }
20
39
 
21
40
  @isTest
@@ -23,33 +42,70 @@ public class OrganizationEndpointsTest {
23
42
  String orgId = 'testOrgId';
24
43
  String env = 'dev';
25
44
 
26
- Map<String, String> endpoints = OrganizationEndpoints.getOrganizationEndpoints(orgId, env);
45
+ Map<String, String> endpoints = OrganizationEndpoints.getOrganizationEndpoints(
46
+ orgId,
47
+ env
48
+ );
27
49
 
28
50
  String expectedPlatform = 'https://testOrgId.orgdev.coveo.com';
29
51
  String expectedAnalytics = 'https://testOrgIdanalytics.orgdev.coveo.com';
30
52
  String expectedSearch = expectedPlatform + '/rest/search/v2';
31
53
  String expectedAdmin = 'https://testOrgIdadmin.orgdev.coveo.com';
32
54
 
33
- System.assertEquals(expectedPlatform, endpoints.get('platform'), 'Platform URL mismatch for dev');
34
- System.assertEquals(expectedAnalytics, endpoints.get('analytics'), 'Analytics URL mismatch for dev');
35
- System.assertEquals(expectedSearch, endpoints.get('search'), 'Search URL mismatch for dev');
36
- System.assertEquals(expectedAdmin, endpoints.get('admin'), 'Admin URL mismatch for dev');
55
+ System.assertEquals(
56
+ expectedPlatform,
57
+ endpoints.get('platform'),
58
+ 'Platform URL mismatch for dev'
59
+ );
60
+ System.assertEquals(
61
+ expectedAnalytics,
62
+ endpoints.get('analytics'),
63
+ 'Analytics URL mismatch for dev'
64
+ );
65
+ System.assertEquals(
66
+ expectedSearch,
67
+ endpoints.get('search'),
68
+ 'Search URL mismatch for dev'
69
+ );
70
+ System.assertEquals(
71
+ expectedAdmin,
72
+ endpoints.get('admin'),
73
+ 'Admin URL mismatch for dev'
74
+ );
37
75
  }
38
76
 
39
77
  @isTest
40
78
  static void testGetOrganizationEndpointsWithoutEnv() {
41
79
  String orgId = 'testOrgId';
42
80
 
43
- Map<String, String> endpoints = OrganizationEndpoints.getOrganizationEndpoints(orgId);
81
+ Map<String, String> endpoints = OrganizationEndpoints.getOrganizationEndpoints(
82
+ orgId
83
+ );
44
84
 
45
85
  String expectedPlatform = 'https://testOrgId.org.coveo.com';
46
86
  String expectedAnalytics = 'https://testOrgIdanalytics.org.coveo.com';
47
87
  String expectedSearch = expectedPlatform + '/rest/search/v2';
48
88
  String expectedAdmin = 'https://testOrgIdadmin.org.coveo.com';
49
89
 
50
- System.assertEquals(expectedPlatform, endpoints.get('platform'), 'Platform URL mismatch');
51
- System.assertEquals(expectedAnalytics, endpoints.get('analytics'), 'Analytics URL mismatch');
52
- System.assertEquals(expectedSearch, endpoints.get('search'), 'Search URL mismatch');
53
- System.assertEquals(expectedAdmin, endpoints.get('admin'), 'Admin URL mismatch');
90
+ System.assertEquals(
91
+ expectedPlatform,
92
+ endpoints.get('platform'),
93
+ 'Platform URL mismatch'
94
+ );
95
+ System.assertEquals(
96
+ expectedAnalytics,
97
+ endpoints.get('analytics'),
98
+ 'Analytics URL mismatch'
99
+ );
100
+ System.assertEquals(
101
+ expectedSearch,
102
+ endpoints.get('search'),
103
+ 'Search URL mismatch'
104
+ );
105
+ System.assertEquals(
106
+ expectedAdmin,
107
+ endpoints.get('admin'),
108
+ 'Admin URL mismatch'
109
+ );
54
110
  }
55
111
  }
@@ -1,7 +1,7 @@
1
1
  @isTest
2
2
  private class RecommendationsControllerTest {
3
3
  // This API key is intentionally public — it belongs to a sample organization used for samples/docs.
4
- static final String sampleHeadlessConfiguration = '{"accessToken":"xx564559b1-0045-48e1-953c-3addd1ee4457","organizationId":"searchuisamples"}';
4
+ static final String sampleHeadlessConfiguration = '{"accessToken":"xxb9c21134-8dad-4d53-8a5e-855bacddba8f","organizationId":"searchuisamples"}';
5
5
  @IsTest
6
6
  static void shouldReturnStringifiedConfiguration() {
7
7
  Test.startTest();
@@ -21,7 +21,7 @@ export default class QuanticCitation extends NavigationMixin(LightningElement) {
21
21
  /**
22
22
  * The citation item information.
23
23
  * @api
24
- * @type {{title: string, index: number, text: string, uri: string, clickUri: string, fields: object}}
24
+ * @type {{title: string, index: number, text: string, uri: string, clickUri: string, fields: object, filetype: string}}
25
25
  */
26
26
  @api citation;
27
27
  /**
@@ -78,7 +78,7 @@ export default class QuanticCitation extends NavigationMixin(LightningElement) {
78
78
  hideTimer = null;
79
79
 
80
80
  connectedCallback() {
81
- const fileType = this.citation?.fields?.filetype;
81
+ const fileType = this.citation.filetype ?? this.citation.fields?.filetype;
82
82
  this.isHrefWithTextFragment =
83
83
  !this.disableCitationAnchoring &&
84
84
  supportedFileTypesForTextFragment.includes(fileType) &&
@@ -52,8 +52,8 @@ const headlessBundles = {
52
52
 
53
53
  /**
54
54
  * Loads the Bueno library dependency.
55
- * @param element The Lightning element to use to load dependencies.
56
- * @returns {Promise}
55
+ * @param element The Lightning element used to load the dependency.
56
+ * @returns {Promise<void>} A promise that resolves when Bueno is available.
57
57
  */
58
58
  const getBueno = (element) => {
59
59
  if (window.Bueno) {
@@ -63,11 +63,20 @@ const getBueno = (element) => {
63
63
  };
64
64
 
65
65
  /**
66
- * Initiates dependency loading promises.
67
- * @param element The Lightning element to use to load dependencies.
68
- * @returns {Promise<AnyHeadless>}
66
+ * Loads the dependencies for an engine use case and returns its Headless bundle.
67
+ * @param element The Lightning element used to load dependencies.
68
+ * @param {string} [headlessUseCase=HeadlessBundleNames.search] The Headless use case whose bundle should be loaded.
69
+ * @returns {Promise<AnyHeadless>} A promise that resolves to the loaded Headless bundle.
70
+ * @throws {Error} If a dependency cannot be loaded.
69
71
  */
70
72
  const loadDependencies = async (element, headlessUseCase) => {
73
+ if (
74
+ headlessUseCase &&
75
+ !Object.prototype.hasOwnProperty.call(headlessBundles, headlessUseCase)
76
+ ) {
77
+ throw new Error(`Unsupported Headless use case: ${headlessUseCase}`);
78
+ }
79
+
71
80
  const bundleInfo = headlessUseCase
72
81
  ? headlessBundles[headlessUseCase]
73
82
  : headlessBundles.search;
@@ -83,17 +92,23 @@ const loadDependencies = async (element, headlessUseCase) => {
83
92
  };
84
93
 
85
94
  /**
86
- * Sets callback to execute when all components are registered with the specified engine.
87
- * @param {Function} callback
88
- * @param {string} engineId
95
+ * Registers a callback to run after the Headless engine has been initialized.
96
+ * @param {(engine: AnyEngine) => void} callback The callback to invoke with the initialized engine
97
+ * @throws {Error} If no engine is registered for the specified engine ID.
89
98
  */
90
99
  const setInitializedCallback = (callback, engineId) => {
91
- window.coveoHeadless[engineId].initializedCallback = callback;
100
+ const engine = window.coveoHeadless?.[engineId];
101
+ if (!engine) {
102
+ throw new Error(
103
+ `Engine has not been registered for engine ID: ${engineId}`
104
+ );
105
+ }
106
+ engine.initializedCallback = callback;
92
107
  };
93
108
 
94
109
  /**
95
110
  * Cancels the delayed search query.
96
- * @param {string} engineId The id of the engine.
111
+ * @param {string} engineId The ID of the engine.
97
112
  */
98
113
  const cancelInitializedCallback = (engineId) => {
99
114
  if (debouncers[engineId]) {
@@ -103,20 +118,34 @@ const cancelInitializedCallback = (engineId) => {
103
118
  };
104
119
 
105
120
  /**
106
- * Dispatches search request.
107
- * @param {string} engineId The id of the engine.
121
+ * Executes the initialization callback with the engine once the debounce delay expires.
122
+ * @param {string} engineId The ID of the engine.
123
+ * @returns {Promise<void>}
108
124
  */
109
125
  const executeInitializedCallback = async (engineId) => {
110
- if (window.coveoHeadless[engineId]) {
111
- window.coveoHeadless[engineId].initializedCallback(
112
- await window.coveoHeadless[engineId].enginePromise
126
+ const engine = window.coveoHeadless?.[engineId];
127
+ if (!engine?.initializedCallback) {
128
+ return;
129
+ }
130
+
131
+ try {
132
+ await engine.initializedCallback(await engine.enginePromise);
133
+ } catch (error) {
134
+ console.error(
135
+ `Fatal error: unable to execute the initialization callback for engine ID: ${engineId}`,
136
+ error
137
+ );
138
+ throw new Error(
139
+ `Fatal error: unable to execute the initialization callback for engine ID: ${engineId}`,
140
+ // @ts-ignore Error constructor cause options are supported at runtime.
141
+ {cause: error}
113
142
  );
114
143
  }
115
144
  };
116
145
 
117
146
  /**
118
- * Starts the debounced initial search request.
119
- * @param {string} engineId The id of the engine.
147
+ * Schedules the engine's initialization callback after a short debounce period.
148
+ * @param {string} engineId The ID of the engine.
120
149
  */
121
150
  const debounceInitializedCallback = (engineId) => {
122
151
  if (!debouncers[engineId]) {
@@ -129,28 +158,30 @@ const debounceInitializedCallback = (engineId) => {
129
158
  };
130
159
 
131
160
  /**
132
- * Returns true if registered components are initialized, false otherwise.
133
- * @param {string} engineId The id of the engine.
161
+ * Checks whether every component registered for an engine has initialized.
162
+ * @param {string} engineId The ID of the engine.
163
+ * @returns {boolean}
134
164
  */
135
165
  const areAllComponentsInitialized = (engineId) =>
136
- !window.coveoHeadless[engineId].components.find(
137
- (component) => component.initialized === false
138
- );
166
+ window.coveoHeadless?.[engineId]?.components?.every(
167
+ (component) => component.initialized === true
168
+ ) ?? false;
139
169
 
140
170
  /**
141
- * Returns the registered component object if it exists.
142
- * @param element The Lightning Element component with which to load dependencies.
143
- * @param {string} engineId The id of the engine.
171
+ * Finds a component registered for an engine.
172
+ * @param element The component to find.
173
+ * @param {string} engineId The ID of the engine.
174
+ * @returns {Object | undefined} The registered component, if found.
144
175
  */
145
176
  const getRegisteredComponent = (element, engineId) =>
146
- window.coveoHeadless[engineId].components.find(
177
+ window.coveoHeadless?.[engineId]?.components?.find(
147
178
  (component) => component.element === element
148
179
  );
149
180
 
150
181
  /**
151
182
  * Instantiates the coveoHeadless window object and the engine attribute for the provided ID.
152
- * @param element The Lightning element to use to load dependencies.
153
- * @param {string} engineId The id of the engine.
183
+ * @param element The Lightning element associated with the engine.
184
+ * @param {string} engineId The ID of the engine.
154
185
  */
155
186
  const instantiateWindowEngineObject = (element, engineId) => {
156
187
  const newWindowEngineObject = {
@@ -170,50 +201,67 @@ const instantiateWindowEngineObject = (element, engineId) => {
170
201
  };
171
202
 
172
203
  /**
173
- * Loads dependencies and returns an initialized Headless engine.
174
- * @param {string} engineId The id of the engine.
204
+ * Creates and returns the Headless engine for an engine ID.
205
+ * @param {string} engineId The ID of the engine.
206
+ * @returns {Promise<AnyHeadless>} A promise that resolves to the initialized Headless engine.
207
+ * @throws {Error} If the engine state or options is invalid, or engine construction fails.
175
208
  */
176
209
  async function initEngine(engineId) {
177
210
  try {
178
- if (window.coveoHeadless[engineId].bindings.engine) {
211
+ const engineState = window.coveoHeadless?.[engineId];
212
+ if (!engineState) {
213
+ throw new Error(
214
+ `Engine has not been registered for engine ID: ${engineId}`
215
+ );
216
+ }
217
+ if (engineState.bindings.engine) {
179
218
  throw new Error(`Engine already instantiated for engine ID: ${engineId}`);
180
219
  }
181
- if (!window.coveoHeadless[engineId].options) {
220
+ if (!engineState.options) {
182
221
  throw new Error('Engine options have not been set.');
183
222
  }
184
223
 
185
- const options = await window.coveoHeadless[engineId].options.promise;
186
- return window.coveoHeadless[engineId].engineConstructor(options);
224
+ const options = await engineState.options.promise;
225
+ return engineState.engineConstructor(options);
187
226
  } catch (error) {
188
- throw new Error(
189
- 'Fatal error: unable to initialize Coveo Headless: ' + error
190
- );
227
+ // @ts-ignore Error constructor cause options are supported at runtime.
228
+ throw new Error('Fatal error: unable to initialize Coveo Headless', {
229
+ cause: error,
230
+ });
191
231
  }
192
232
  }
193
233
 
194
234
  /**
195
- * Initialize coveoHeadless Store object
235
+ * Initializes the Quantic store for an engine when one is not already available.
196
236
  * @param {string} engineId The ID of the engine.
237
+ * @throws {Error} If the engine state cannot be accessed or the store cannot be initialized.
197
238
  */
198
239
  const initQuanticStore = (engineId) => {
199
240
  try {
200
- if (!window.coveoHeadless[engineId].bindings.store) {
201
- window.coveoHeadless[engineId].bindings.store = Store.initialize();
241
+ const engineState = window.coveoHeadless?.[engineId];
242
+ if (!engineState) {
243
+ throw new Error(
244
+ `Engine has not been registered for engine ID: ${engineId}`
245
+ );
246
+ }
247
+ if (!engineState.bindings.store) {
248
+ engineState.bindings.store = Store.initialize();
202
249
  }
203
250
  } catch (error) {
204
- throw new Error(
205
- 'Fatal error: unable to initialize Quantic store: ' + error
206
- );
251
+ // @ts-ignore Error constructor cause options are supported at runtime.
252
+ throw new Error('Fatal error: unable to initialize Quantic store', {
253
+ cause: error,
254
+ });
207
255
  }
208
256
  };
209
257
 
210
258
  /**
211
259
  * Sets the options passed to engine constructor for given engine ID.
212
260
  * @param options The Headless options for the specified engine ID.
213
- * @param {(options: unknown) => unknown} engineConstructor Th engine constructor.
214
- * @param {string} engineId The id of the engine.
261
+ * @param {(options: unknown) => unknown} engineConstructor The Headless engine constructor.
262
+ * @param {string} engineId The ID of the engine.
215
263
  * @param element The Lightning element to use to load dependencies.
216
- * @param headlessBundle The headless bundle associated to the engine.
264
+ * @param headlessBundle The Headless bundle associated with the engine.
217
265
  */
218
266
  function setEngineOptions(
219
267
  options,
@@ -239,7 +287,7 @@ function setEngineOptions(
239
287
  /**
240
288
  * Registers a component for future initialization.
241
289
  * @param element The Lightning element to use to load dependencies.
242
- * @param {string} engineId The id of the engine.
290
+ * @param {string} engineId The ID of the engine.
243
291
  */
244
292
  function registerComponentForInit(element, engineId) {
245
293
  cancelInitializedCallback(engineId);
@@ -257,7 +305,8 @@ function registerComponentForInit(element, engineId) {
257
305
  /**
258
306
  * Sets registered component to initialized.
259
307
  * @param element The Lightning element to use to load dependencies.
260
- * @param {string} engineId The id of the engine.
308
+ * @param {string} engineId The ID of the engine.
309
+ * @throws {Error} If the component was not registered for the engine.
261
310
  */
262
311
  function setComponentInitialized(element, engineId) {
263
312
  const component = window.coveoHeadless?.[engineId]
@@ -280,43 +329,62 @@ function setComponentInitialized(element, engineId) {
280
329
 
281
330
  /**
282
331
  * Returns headless engine promise.
283
- * @param {string} engineId The id of the engine.
332
+ * @param {string} engineId The ID of the engine.
333
+ * @returns {Promise<AnyHeadless>} A promise that resolves to the Headless engine.
334
+ * @throws {Error} If engine initialization fails.
284
335
  */
285
336
  function getHeadlessEnginePromise(engineId) {
286
- if (!window.coveoHeadless[engineId].enginePromise) {
287
- window.coveoHeadless[engineId].enginePromise = initEngine(engineId).then(
288
- (engine) => {
289
- window.coveoHeadless[engineId].bindings.engine = engine;
290
- return engine;
291
- }
337
+ const engineState = window.coveoHeadless?.[engineId];
338
+ if (!engineState) {
339
+ throw new Error(
340
+ `Engine has not been registered for engine ID: ${engineId}`
292
341
  );
293
342
  }
294
- return window.coveoHeadless[engineId].enginePromise;
343
+ if (!engineState.enginePromise) {
344
+ engineState.enginePromise = initEngine(engineId).then((engine) => {
345
+ engineState.bindings.engine = engine;
346
+ return engine;
347
+ });
348
+ }
349
+ return engineState.enginePromise;
295
350
  }
296
351
 
297
352
  /**
298
353
  * Returns bindings object for specified engineId.
299
- * @param {string} engineId The id of the engine.
354
+ * @param {string} engineId The ID of the engine.
355
+ * @returns {Object | undefined} The engine bindings, if registered.
300
356
  */
301
357
  function getHeadlessBindings(engineId) {
302
358
  return window.coveoHeadless?.[engineId]?.bindings;
303
359
  }
304
360
 
305
361
  /**
306
- * Returns store object for specified engineId.
307
- * @param {string} engineId The engine ID.
362
+ * Returns the Quantic store associated with an engine.
363
+ * @param {string} engineId The ID of the engine.
364
+ * @returns {Object | undefined} The store, if initialized.
308
365
  */
309
366
  function getQuanticStore(engineId) {
310
367
  return window.coveoHeadless?.[engineId]?.bindings?.store;
311
368
  }
369
+
312
370
  /**
313
371
  * Initializes a component with Coveo Headless.
314
- * @param element The LightningElement component to initialize.
315
- * @param {string} engineId The id of the engine.
316
- * @param {Function} initialize The component's initialization function.
372
+ * Failures while initializing the Quantic store, Headless engine, or component
373
+ * callback are logged and reported through the component error UI.
374
+ * @param element The component to initialize.
375
+ * @param {string} engineId The ID of the engine.
376
+ * @param {(engine: AnyEngine) => void} initialize The component initialization callback function.
377
+ * @returns {Promise<void>} A promise that resolves after initialization handling completes.
378
+ * @throws {Error} If the component was not registered before initialization.
317
379
  */
318
380
  async function initializeWithHeadless(element, engineId, initialize) {
319
- if (getRegisteredComponent(element, engineId).initialized) {
381
+ const component = getRegisteredComponent(element, engineId);
382
+ if (!component) {
383
+ throw new Error(
384
+ 'Fatal Error: Component was not registered before initialization'
385
+ );
386
+ }
387
+ if (component.initialized) {
320
388
  return;
321
389
  }
322
390
  try {
@@ -345,8 +413,8 @@ async function initializeWithHeadless(element, engineId, initialize) {
345
413
  }
346
414
 
347
415
  /**
348
- * Removed the headless engine instance from the window object.
349
- * @param {string} engineId
416
+ * Removes the headless engine instance from the window object.
417
+ * @param {string} engineId The ID of the engine to remove.
350
418
  */
351
419
  function destroyEngine(engineId) {
352
420
  if (window.coveoHeadless?.[engineId]) {
@@ -355,10 +423,10 @@ function destroyEngine(engineId) {
355
423
  }
356
424
 
357
425
  /**
358
- * Register a facet in the store.
359
- * @param {string} engineId The engine ID.
360
- * @param {string} facetType
361
- * @param {{ label: string; facetId: string; format?: function, element?: HTMLElement, metadata?: object}} data
426
+ * Registers facet data in the engine's store.
427
+ * @param {string} engineId The ID of the engine.
428
+ * @param {string} facetType The store facet collection to update.
429
+ * @param {{label: string, facetId: string, format?: Function, element?: HTMLElement, metadata?: object}} data The facet data to register.
362
430
  */
363
431
  function registerToStore(engineId, facetType, data) {
364
432
  const store = getQuanticStore(engineId);
@@ -370,9 +438,9 @@ function registerToStore(engineId, facetType, data) {
370
438
  }
371
439
 
372
440
  /**
373
- * Register the sort options in the store.
374
- * @param {string} engineId The engine ID.
375
- * @param {Array<{label: string; value: string; criterion: SortCriterion;}>} data
441
+ * Registers sort options in the engine's store.
442
+ * @param {string} engineId The ID of the engine.
443
+ * @param {Array<{label: string, value: string, criterion: SortCriterion}>} data The sort options to register.
376
444
  */
377
445
  function registerSortOptionsToStore(engineId, data) {
378
446
  const store = getQuanticStore(engineId);
@@ -384,9 +452,10 @@ function registerSortOptionsToStore(engineId, data) {
384
452
  }
385
453
 
386
454
  /**
387
- * Get facet data from store.
388
- * @param {string} engineId The engine ID.
389
- * @param {string} facetType
455
+ * Gets facet data from the engine's store.
456
+ * @param {string} engineId The ID of the engine.
457
+ * @param {string} facetType The store facet collection to read.
458
+ * @returns {Object | undefined} The facet data, if available.
390
459
  */
391
460
  function getFromStore(engineId, facetType) {
392
461
  const store = getQuanticStore(engineId);
@@ -399,8 +468,9 @@ function getFromStore(engineId, facetType) {
399
468
  }
400
469
 
401
470
  /**
402
- * Get all facet data from store.
403
- * @param {string} engineId The engine ID.
471
+ * Gets all facet data from the engine's store.
472
+ * @param {string} engineId The ID of the engine.
473
+ * @returns {Object} All available facet data grouped by facet type.
404
474
  */
405
475
  function getAllFacetsFromStore(engineId) {
406
476
  return Object.values(Store.facetTypes).reduce(
@@ -413,8 +483,9 @@ function getAllFacetsFromStore(engineId) {
413
483
  }
414
484
 
415
485
  /**
416
- * Gets all sort options data from store.
417
- * @param {string} engineId The engine ID.
486
+ * Gets all sort option data from the engine's store.
487
+ * @param {string} engineId The ID of the engine.
488
+ * @returns {Array<{label: string, value: string, criterion: SortCriterion}> | undefined} The sort options, if available.
418
489
  */
419
490
  function getAllSortOptionsFromStore(engineId) {
420
491
  const store = getQuanticStore(engineId);
@@ -427,19 +498,19 @@ function getAllSortOptionsFromStore(engineId) {
427
498
  }
428
499
 
429
500
  /**
430
- * Get the headless bundle associated to the specified engine.
431
- * @param {string} engineId The engine ID.
432
- * @returns The headless bundle associated to the specified engine.
501
+ * Gets the Headless bundle associated with an engine.
502
+ * @param {string} engineId The ID of the engine.
503
+ * @returns {AnyHeadless} The configured Headless bundle, or the default search bundle.
433
504
  */
434
505
  function getHeadlessBundle(engineId) {
435
- return window.coveoHeadless[engineId]?.bundle ?? CoveoHeadless;
506
+ return window.coveoHeadless?.[engineId]?.bundle ?? CoveoHeadless;
436
507
  }
437
508
 
438
509
  /**
439
- * Gets whether the specified engine is using the expected bundle.
440
- * @param {string} engineId - The engine ID.
441
- * @param {string} expectedBundleName - The expected headless bundle name.
442
- * @returns
510
+ * Checks whether an engine uses the expected Headless bundle.
511
+ * @param {string} engineId The ID of the engine.
512
+ * @param {string} expectedBundleName The name of the expected Headless bundle.
513
+ * @returns {boolean} Whether the engine uses the expected bundle.
443
514
  */
444
515
  function isHeadlessBundle(engineId, expectedBundleName) {
445
516
  let expectedBundle;