@searchcraft/javascript-sdk 0.14.0 → 0.15.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.
Files changed (67) hide show
  1. package/dist/components/defineCustomElements.js +25 -23
  2. package/dist/components/html.js +1 -1
  3. package/dist/components/index.d.ts +131 -5
  4. package/dist/components/index.js +245 -62
  5. package/dist/components/index.js.map +1 -1
  6. package/dist/components/{searchcraft-summary-box2.js → marked.esm.js} +3 -101
  7. package/dist/components/marked.esm.js.map +1 -0
  8. package/dist/components/searchcraft-ad.js +1 -1
  9. package/dist/components/searchcraft-ad2.js +4 -4
  10. package/dist/components/searchcraft-button.js +1 -1
  11. package/dist/components/searchcraft-button2.js +2 -2
  12. package/dist/components/searchcraft-error-message.js +1 -1
  13. package/dist/components/searchcraft-error-message2.js +1 -1
  14. package/dist/components/searchcraft-facet-list.js +1 -1
  15. package/dist/components/searchcraft-facet-list2.js +2 -2
  16. package/dist/components/searchcraft-filter-panel.js +5 -5
  17. package/dist/components/searchcraft-input-form.js +1 -1
  18. package/dist/components/searchcraft-input-form2.js +6 -6
  19. package/dist/components/searchcraft-input-label.js +1 -1
  20. package/dist/components/searchcraft-input-label2.js +2 -2
  21. package/dist/components/searchcraft-loading.js +1 -1
  22. package/dist/components/searchcraft-loading2.js +1 -1
  23. package/dist/components/searchcraft-pagination.js +4 -4
  24. package/dist/components/searchcraft-popover-button.js +6 -4
  25. package/dist/components/searchcraft-popover-button.js.map +1 -1
  26. package/dist/components/searchcraft-popover-footer.js +1 -1
  27. package/dist/components/searchcraft-popover-footer2.js +5 -7
  28. package/dist/components/searchcraft-popover-footer2.js.map +1 -1
  29. package/dist/components/searchcraft-popover-form.js +18 -18
  30. package/dist/components/searchcraft-popover-form.js.map +1 -1
  31. package/dist/components/searchcraft-popover-list-item.js +1 -1
  32. package/dist/components/searchcraft-popover-list-item2.js +4 -4
  33. package/dist/components/searchcraft-popover-list-view.js +1 -1
  34. package/dist/components/searchcraft-popover-list-view2.js +4 -4
  35. package/dist/components/searchcraft-results-info.js +4 -4
  36. package/dist/components/searchcraft-results-summary.d.ts +11 -0
  37. package/dist/components/searchcraft-results-summary.js +9 -0
  38. package/dist/components/searchcraft-results-summary.js.map +1 -0
  39. package/dist/components/searchcraft-results-summary2.js +98 -0
  40. package/dist/components/searchcraft-results-summary2.js.map +1 -0
  41. package/dist/components/searchcraft-search-result.js +1 -1
  42. package/dist/components/searchcraft-search-result2.js +3 -3
  43. package/dist/components/searchcraft-search-results-per-page.js +3 -3
  44. package/dist/components/searchcraft-search-results.js +5 -5
  45. package/dist/components/searchcraft-select.js +1 -1
  46. package/dist/components/searchcraft-select2.js +1 -1
  47. package/dist/components/searchcraft-slider.js +1 -1
  48. package/dist/components/searchcraft-slider2.js +5 -5
  49. package/dist/components/searchcraft-summary-box.js +89 -1
  50. package/dist/components/searchcraft-summary-box.js.map +1 -1
  51. package/dist/components/searchcraft-theme.js +3 -3
  52. package/dist/components/searchcraft-theme.js.map +1 -1
  53. package/dist/components/searchcraft-toggle-button.js +1 -1
  54. package/dist/components/searchcraft-toggle-button2.js +5 -5
  55. package/dist/hydrate/index.js +2076 -1973
  56. package/dist/hydrate/index.mjs +2076 -1973
  57. package/dist/themes/hologram.css +1 -1
  58. package/dist/themes/hologram.css.map +1 -1
  59. package/dist/types/clients/SummaryClient.d.ts +10 -1
  60. package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +1 -1
  61. package/dist/types/components/searchcraft-results-summary/searchcraft-results-summary.d.ts +65 -0
  62. package/dist/types/components/searchcraft-summary-box/searchcraft-summary-box.d.ts +5 -5
  63. package/dist/types/components.d.ts +119 -2
  64. package/dist/types/store/SearchcraftStore.types.d.ts +1 -0
  65. package/dist/types/types/core-types/SearchcraftConfig.types.d.ts +2 -2
  66. package/package.json +2 -2
  67. package/dist/components/searchcraft-summary-box2.js.map +0 -1
@@ -1,26 +1,27 @@
1
- import { defineCustomElement as define_searchcraft_ad } from './searchcraft-ad.js?scv=0.14.0';
2
- import { defineCustomElement as define_searchcraft_button } from './searchcraft-button.js?scv=0.14.0';
3
- import { defineCustomElement as define_searchcraft_error_message } from './searchcraft-error-message.js?scv=0.14.0';
4
- import { defineCustomElement as define_searchcraft_facet_list } from './searchcraft-facet-list.js?scv=0.14.0';
5
- import { defineCustomElement as define_searchcraft_filter_panel } from './searchcraft-filter-panel.js?scv=0.14.0';
6
- import { defineCustomElement as define_searchcraft_input_form } from './searchcraft-input-form.js?scv=0.14.0';
7
- import { defineCustomElement as define_searchcraft_input_label } from './searchcraft-input-label.js?scv=0.14.0';
8
- import { defineCustomElement as define_searchcraft_loading } from './searchcraft-loading.js?scv=0.14.0';
9
- import { defineCustomElement as define_searchcraft_pagination } from './searchcraft-pagination.js?scv=0.14.0';
10
- import { defineCustomElement as define_searchcraft_popover_button } from './searchcraft-popover-button.js?scv=0.14.0';
11
- import { defineCustomElement as define_searchcraft_popover_footer } from './searchcraft-popover-footer.js?scv=0.14.0';
12
- import { defineCustomElement as define_searchcraft_popover_form } from './searchcraft-popover-form.js?scv=0.14.0';
13
- import { defineCustomElement as define_searchcraft_popover_list_item } from './searchcraft-popover-list-item.js?scv=0.14.0';
14
- import { defineCustomElement as define_searchcraft_popover_list_view } from './searchcraft-popover-list-view.js?scv=0.14.0';
15
- import { defineCustomElement as define_searchcraft_results_info } from './searchcraft-results-info.js?scv=0.14.0';
16
- import { defineCustomElement as define_searchcraft_search_result } from './searchcraft-search-result.js?scv=0.14.0';
17
- import { defineCustomElement as define_searchcraft_search_results_per_page } from './searchcraft-search-results-per-page.js?scv=0.14.0';
18
- import { defineCustomElement as define_searchcraft_search_results } from './searchcraft-search-results.js?scv=0.14.0';
19
- import { defineCustomElement as define_searchcraft_select } from './searchcraft-select.js?scv=0.14.0';
20
- import { defineCustomElement as define_searchcraft_slider } from './searchcraft-slider.js?scv=0.14.0';
21
- import { defineCustomElement as define_searchcraft_summary_box } from './searchcraft-summary-box.js?scv=0.14.0';
22
- import { defineCustomElement as define_searchcraft_theme } from './searchcraft-theme.js?scv=0.14.0';
23
- import { defineCustomElement as define_searchcraft_toggle_button } from './searchcraft-toggle-button.js?scv=0.14.0';
1
+ import { defineCustomElement as define_searchcraft_ad } from './searchcraft-ad.js?scv=0.15.1';
2
+ import { defineCustomElement as define_searchcraft_button } from './searchcraft-button.js?scv=0.15.1';
3
+ import { defineCustomElement as define_searchcraft_error_message } from './searchcraft-error-message.js?scv=0.15.1';
4
+ import { defineCustomElement as define_searchcraft_facet_list } from './searchcraft-facet-list.js?scv=0.15.1';
5
+ import { defineCustomElement as define_searchcraft_filter_panel } from './searchcraft-filter-panel.js?scv=0.15.1';
6
+ import { defineCustomElement as define_searchcraft_input_form } from './searchcraft-input-form.js?scv=0.15.1';
7
+ import { defineCustomElement as define_searchcraft_input_label } from './searchcraft-input-label.js?scv=0.15.1';
8
+ import { defineCustomElement as define_searchcraft_loading } from './searchcraft-loading.js?scv=0.15.1';
9
+ import { defineCustomElement as define_searchcraft_pagination } from './searchcraft-pagination.js?scv=0.15.1';
10
+ import { defineCustomElement as define_searchcraft_popover_button } from './searchcraft-popover-button.js?scv=0.15.1';
11
+ import { defineCustomElement as define_searchcraft_popover_footer } from './searchcraft-popover-footer.js?scv=0.15.1';
12
+ import { defineCustomElement as define_searchcraft_popover_form } from './searchcraft-popover-form.js?scv=0.15.1';
13
+ import { defineCustomElement as define_searchcraft_popover_list_item } from './searchcraft-popover-list-item.js?scv=0.15.1';
14
+ import { defineCustomElement as define_searchcraft_popover_list_view } from './searchcraft-popover-list-view.js?scv=0.15.1';
15
+ import { defineCustomElement as define_searchcraft_results_info } from './searchcraft-results-info.js?scv=0.15.1';
16
+ import { defineCustomElement as define_searchcraft_results_summary } from './searchcraft-results-summary.js?scv=0.15.1';
17
+ import { defineCustomElement as define_searchcraft_search_result } from './searchcraft-search-result.js?scv=0.15.1';
18
+ import { defineCustomElement as define_searchcraft_search_results_per_page } from './searchcraft-search-results-per-page.js?scv=0.15.1';
19
+ import { defineCustomElement as define_searchcraft_search_results } from './searchcraft-search-results.js?scv=0.15.1';
20
+ import { defineCustomElement as define_searchcraft_select } from './searchcraft-select.js?scv=0.15.1';
21
+ import { defineCustomElement as define_searchcraft_slider } from './searchcraft-slider.js?scv=0.15.1';
22
+ import { defineCustomElement as define_searchcraft_summary_box } from './searchcraft-summary-box.js?scv=0.15.1';
23
+ import { defineCustomElement as define_searchcraft_theme } from './searchcraft-theme.js?scv=0.15.1';
24
+ import { defineCustomElement as define_searchcraft_toggle_button } from './searchcraft-toggle-button.js?scv=0.15.1';
24
25
 
25
26
  export const defineCustomElements = () => {
26
27
  define_searchcraft_ad();
@@ -38,6 +39,7 @@ export const defineCustomElements = () => {
38
39
  define_searchcraft_popover_list_item();
39
40
  define_searchcraft_popover_list_view();
40
41
  define_searchcraft_results_info();
42
+ define_searchcraft_results_summary();
41
43
  define_searchcraft_search_result();
42
44
  define_searchcraft_search_results_per_page();
43
45
  define_searchcraft_search_results();
@@ -1,4 +1,4 @@
1
- import { p as purify } from './purify.es.js?scv=0.14.0';
1
+ import { p as purify } from './purify.es.js?scv=0.15.1';
2
2
 
3
3
  /**
4
4
  * This allows you to parse a template string with a function.
@@ -369,11 +369,11 @@ export interface SearchcraftConfig {
369
369
  */
370
370
  searchResultsPerPage?: number;
371
371
  /**
372
- * The URL pointing towards Searchcraft Cloud's semantic search and RAG summary processing layer. When using a `searchcraft-summary-box` component, this value must be specified.
372
+ * @deprecated Summary requests now use `endpointURL` and `indexName`. This field is ignored by current SDK summary requests.
373
373
  */
374
374
  cortexURL?: string;
375
375
  /**
376
- * Instructions provided to the LLM when creating search result summaries.
376
+ * @deprecated Summary prompt instructions are configured server-side on the index. This field is ignored by the engine summary endpoint.
377
377
  */
378
378
  summaryInstructionsPrompt?: string;
379
379
  /**
@@ -653,8 +653,16 @@ declare class SummaryClient {
653
653
  private get;
654
654
  private abortController;
655
655
  private timeout;
656
+ private hasWarnedAboutDeprecatedCortexURL;
656
657
  constructor(get: SearchcraftStore["getState"], set: SearchcraftStore["setState"]);
657
- streamSummaryData(): void;
658
+ streamSummaryData(requestProperties: SearchClientRequestProperties | string): void;
659
+ private setSummaryUnavailable;
660
+ private warnIfUsingDeprecatedCortexURL;
661
+ private buildSearchClientRequest;
662
+ private formatParamsForRequest;
663
+ private processSseBuffer;
664
+ private handleSseFrame;
665
+ private parseSseFrame;
658
666
  }
659
667
  /**
660
668
  * Callable functions made available by the SearchcraftStore.
@@ -715,6 +723,7 @@ export interface SearchcraftStateValues {
715
723
  orderByField: string | undefined | null;
716
724
  sortType: "asc" | "desc" | undefined | null;
717
725
  summary: string;
726
+ summaryErrorMessage: string;
718
727
  hasSummaryBox: boolean;
719
728
  isSummaryLoading: boolean;
720
729
  summaryClient?: SummaryClient;
@@ -1126,7 +1135,7 @@ export namespace Components {
1126
1135
  /**
1127
1136
  * The type of popover button to render.
1128
1137
  */
1129
- "type"?: "skeuomorphic";
1138
+ "type"?: "skeuomorphic" | "magnifying-glass";
1130
1139
  }
1131
1140
  /**
1132
1141
  * Renders the footer for the searchcraft-popover-form.
@@ -1310,6 +1319,33 @@ export namespace Components {
1310
1319
  */
1311
1320
  "template"?: ResultsInfoTemplate;
1312
1321
  }
1322
+ /**
1323
+ * This component renders a results summary for RAG search result summaries.
1324
+ * When the user makes a search, a network call is made to retrieve the summary content, which is then
1325
+ * rendered in this box.
1326
+ * NOTE: This component requires the usage of a read key that has "SUMMARY" permissions.
1327
+ * @react-import ```jsx
1328
+ * import { SearchcraftResultsSummary } from "@searchcraft/react-sdk";
1329
+ * ```
1330
+ * @vue-import ```ts
1331
+ * import { SearchcraftResultsSummary } from "@searchcraft/vue-sdk";
1332
+ * ```
1333
+ * @js-example ```html
1334
+ * <searchcraft-results-summary />
1335
+ * ```
1336
+ * @react-example ```jsx
1337
+ * <SearchcraftResultsSummary />
1338
+ * ```
1339
+ * @vue-example ```jsx
1340
+ * <SearchcraftResultsSummary />
1341
+ * ```
1342
+ */
1343
+ interface SearchcraftResultsSummary {
1344
+ /**
1345
+ * The id of the Searchcraft instance that this component should use.
1346
+ */
1347
+ "searchcraftId"?: string;
1348
+ }
1313
1349
  /**
1314
1350
  * This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
1315
1351
  */
@@ -1491,6 +1527,9 @@ export namespace Components {
1491
1527
  "step": number;
1492
1528
  }
1493
1529
  /**
1530
+ * @deprecated Use `searchcraft-results-summary` instead.
1531
+ * This component is deprecated and will be removed in a future version.
1532
+ * Please update to use `searchcraft-results-summary` which has the same functionality.
1494
1533
  * This component renders a summary box for RAG search result summaries.
1495
1534
  * When the user makes a search, a network call is made to retrieve the summary content, which is then
1496
1535
  * rendered in this box.
@@ -1935,6 +1974,33 @@ declare global {
1935
1974
  prototype: HTMLSearchcraftResultsInfoElement;
1936
1975
  new (): HTMLSearchcraftResultsInfoElement;
1937
1976
  };
1977
+ /**
1978
+ * This component renders a results summary for RAG search result summaries.
1979
+ * When the user makes a search, a network call is made to retrieve the summary content, which is then
1980
+ * rendered in this box.
1981
+ * NOTE: This component requires the usage of a read key that has "SUMMARY" permissions.
1982
+ * @react-import ```jsx
1983
+ * import { SearchcraftResultsSummary } from "@searchcraft/react-sdk";
1984
+ * ```
1985
+ * @vue-import ```ts
1986
+ * import { SearchcraftResultsSummary } from "@searchcraft/vue-sdk";
1987
+ * ```
1988
+ * @js-example ```html
1989
+ * <searchcraft-results-summary />
1990
+ * ```
1991
+ * @react-example ```jsx
1992
+ * <SearchcraftResultsSummary />
1993
+ * ```
1994
+ * @vue-example ```jsx
1995
+ * <SearchcraftResultsSummary />
1996
+ * ```
1997
+ */
1998
+ interface HTMLSearchcraftResultsSummaryElement extends Components.SearchcraftResultsSummary, HTMLStencilElement {
1999
+ }
2000
+ var HTMLSearchcraftResultsSummaryElement: {
2001
+ prototype: HTMLSearchcraftResultsSummaryElement;
2002
+ new (): HTMLSearchcraftResultsSummaryElement;
2003
+ };
1938
2004
  /**
1939
2005
  * This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
1940
2006
  */
@@ -2065,6 +2131,9 @@ declare global {
2065
2131
  new (): HTMLSearchcraftSliderElement;
2066
2132
  };
2067
2133
  /**
2134
+ * @deprecated Use `searchcraft-results-summary` instead.
2135
+ * This component is deprecated and will be removed in a future version.
2136
+ * Please update to use `searchcraft-results-summary` which has the same functionality.
2068
2137
  * This component renders a summary box for RAG search result summaries.
2069
2138
  * When the user makes a search, a network call is made to retrieve the summary content, which is then
2070
2139
  * rendered in this box.
@@ -2151,6 +2220,7 @@ declare global {
2151
2220
  "searchcraft-popover-list-item": HTMLSearchcraftPopoverListItemElement;
2152
2221
  "searchcraft-popover-list-view": HTMLSearchcraftPopoverListViewElement;
2153
2222
  "searchcraft-results-info": HTMLSearchcraftResultsInfoElement;
2223
+ "searchcraft-results-summary": HTMLSearchcraftResultsSummaryElement;
2154
2224
  "searchcraft-search-result": HTMLSearchcraftSearchResultElement;
2155
2225
  "searchcraft-search-results": HTMLSearchcraftSearchResultsElement;
2156
2226
  "searchcraft-search-results-per-page": HTMLSearchcraftSearchResultsPerPageElement;
@@ -2524,7 +2594,7 @@ declare namespace LocalJSX {
2524
2594
  /**
2525
2595
  * The type of popover button to render.
2526
2596
  */
2527
- "type"?: "skeuomorphic";
2597
+ "type"?: "skeuomorphic" | "magnifying-glass";
2528
2598
  }
2529
2599
  /**
2530
2600
  * Renders the footer for the searchcraft-popover-form.
@@ -2708,6 +2778,33 @@ declare namespace LocalJSX {
2708
2778
  */
2709
2779
  "template"?: ResultsInfoTemplate;
2710
2780
  }
2781
+ /**
2782
+ * This component renders a results summary for RAG search result summaries.
2783
+ * When the user makes a search, a network call is made to retrieve the summary content, which is then
2784
+ * rendered in this box.
2785
+ * NOTE: This component requires the usage of a read key that has "SUMMARY" permissions.
2786
+ * @react-import ```jsx
2787
+ * import { SearchcraftResultsSummary } from "@searchcraft/react-sdk";
2788
+ * ```
2789
+ * @vue-import ```ts
2790
+ * import { SearchcraftResultsSummary } from "@searchcraft/vue-sdk";
2791
+ * ```
2792
+ * @js-example ```html
2793
+ * <searchcraft-results-summary />
2794
+ * ```
2795
+ * @react-example ```jsx
2796
+ * <SearchcraftResultsSummary />
2797
+ * ```
2798
+ * @vue-example ```jsx
2799
+ * <SearchcraftResultsSummary />
2800
+ * ```
2801
+ */
2802
+ interface SearchcraftResultsSummary {
2803
+ /**
2804
+ * The id of the Searchcraft instance that this component should use.
2805
+ */
2806
+ "searchcraftId"?: string;
2807
+ }
2711
2808
  /**
2712
2809
  * This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
2713
2810
  */
@@ -2897,6 +2994,9 @@ declare namespace LocalJSX {
2897
2994
  "step"?: number;
2898
2995
  }
2899
2996
  /**
2997
+ * @deprecated Use `searchcraft-results-summary` instead.
2998
+ * This component is deprecated and will be removed in a future version.
2999
+ * Please update to use `searchcraft-results-summary` which has the same functionality.
2900
3000
  * This component renders a summary box for RAG search result summaries.
2901
3001
  * When the user makes a search, a network call is made to retrieve the summary content, which is then
2902
3002
  * rendered in this box.
@@ -2981,6 +3081,7 @@ declare namespace LocalJSX {
2981
3081
  "searchcraft-popover-list-item": SearchcraftPopoverListItem;
2982
3082
  "searchcraft-popover-list-view": SearchcraftPopoverListView;
2983
3083
  "searchcraft-results-info": SearchcraftResultsInfo;
3084
+ "searchcraft-results-summary": SearchcraftResultsSummary;
2984
3085
  "searchcraft-search-result": SearchcraftSearchResult;
2985
3086
  "searchcraft-search-results": SearchcraftSearchResults;
2986
3087
  "searchcraft-search-results-per-page": SearchcraftSearchResultsPerPage;
@@ -3236,6 +3337,28 @@ declare module "@stencil/core" {
3236
3337
  * ```
3237
3338
  */
3238
3339
  "searchcraft-results-info": LocalJSX.SearchcraftResultsInfo & JSXBase.HTMLAttributes<HTMLSearchcraftResultsInfoElement>;
3340
+ /**
3341
+ * This component renders a results summary for RAG search result summaries.
3342
+ * When the user makes a search, a network call is made to retrieve the summary content, which is then
3343
+ * rendered in this box.
3344
+ * NOTE: This component requires the usage of a read key that has "SUMMARY" permissions.
3345
+ * @react-import ```jsx
3346
+ * import { SearchcraftResultsSummary } from "@searchcraft/react-sdk";
3347
+ * ```
3348
+ * @vue-import ```ts
3349
+ * import { SearchcraftResultsSummary } from "@searchcraft/vue-sdk";
3350
+ * ```
3351
+ * @js-example ```html
3352
+ * <searchcraft-results-summary />
3353
+ * ```
3354
+ * @react-example ```jsx
3355
+ * <SearchcraftResultsSummary />
3356
+ * ```
3357
+ * @vue-example ```jsx
3358
+ * <SearchcraftResultsSummary />
3359
+ * ```
3360
+ */
3361
+ "searchcraft-results-summary": LocalJSX.SearchcraftResultsSummary & JSXBase.HTMLAttributes<HTMLSearchcraftResultsSummaryElement>;
3239
3362
  /**
3240
3363
  * This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
3241
3364
  */
@@ -3319,6 +3442,9 @@ declare module "@stencil/core" {
3319
3442
  */
3320
3443
  "searchcraft-slider": LocalJSX.SearchcraftSlider & JSXBase.HTMLAttributes<HTMLSearchcraftSliderElement>;
3321
3444
  /**
3445
+ * @deprecated Use `searchcraft-results-summary` instead.
3446
+ * This component is deprecated and will be removed in a future version.
3447
+ * Please update to use `searchcraft-results-summary` which has the same functionality.
3322
3448
  * This component renders a summary box for RAG search result summaries.
3323
3449
  * When the user makes a search, a network call is made to retrieve the summary content, which is then
3324
3450
  * rendered in this box.