@searchcraft/react-sdk 0.13.0 → 0.13.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.
@@ -582,8 +582,9 @@ declare class MeasureClient {
582
582
  private config;
583
583
  private sdkInfo;
584
584
  private userId;
585
+ private userType;
585
586
  sessionId: string;
586
- constructor(config: SearchcraftConfig, sdkInfo: SearchcraftSDKInfo, userId: string);
587
+ constructor(config: SearchcraftConfig, sdkInfo: SearchcraftSDKInfo, userId: string, userType: "authenticated" | "anonymous");
587
588
  /**
588
589
  * Getter for the base url used by the /measure endpoints.
589
590
  */
@@ -719,6 +720,7 @@ export declare class SearchcraftCore {
719
720
  searchClient: SearchClient | undefined;
720
721
  adClient: AdClient | undefined;
721
722
  userId: string;
723
+ userType: "authenticated" | "anonymous";
722
724
  private requestTimeout;
723
725
  private subscriptionEvents;
724
726
  /**
@@ -766,9 +768,13 @@ export namespace Components {
766
768
  */
767
769
  interface SearchcraftAd {
768
770
  "adClientResponseItem"?: AdClientResponseItem;
771
+ /**
772
+ * @default 'Custom'
773
+ */
769
774
  "adSource": "Custom" | "Nativo" | "adMarketplace";
770
775
  /**
771
776
  * Where the ad is being rendered within the search results div. Lifecycle behavior differs for ads being rendered in different positions, so we need to be able to handle all of those cases.
777
+ * @default 'interstitial'
772
778
  */
773
779
  "renderPosition": "interstitial" | "top" | "bottom";
774
780
  /**
@@ -783,10 +789,12 @@ export namespace Components {
783
789
  interface SearchcraftButton {
784
790
  /**
785
791
  * Whether the button is disabled.
792
+ * @default false
786
793
  */
787
794
  "disabled"?: boolean;
788
795
  /**
789
796
  * Controls the visual representation of the button.
797
+ * @default 'primary'
790
798
  */
791
799
  "hierarchy"?: "primary" | "tertiary";
792
800
  /**
@@ -795,18 +803,22 @@ export namespace Components {
795
803
  "icon"?: Element;
796
804
  /**
797
805
  * Should the button only display an icon.
806
+ * @default false
798
807
  */
799
808
  "iconOnly"?: boolean;
800
809
  /**
801
810
  * The position of the icon.
811
+ * @default 'left'
802
812
  */
803
813
  "iconPosition"?: "left" | "right";
804
814
  /**
805
815
  * The label for the button.
816
+ * @default 'Search'
806
817
  */
807
818
  "label": string;
808
819
  /**
809
820
  * The type of the button.
821
+ * @default 'button'
810
822
  */
811
823
  "type"?: "submit" | "reset" | "button";
812
824
  }
@@ -842,6 +854,7 @@ export namespace Components {
842
854
  "exclude"?: string[];
843
855
  /**
844
856
  * The name of the field where facets are applied.
857
+ * @default ''
845
858
  */
846
859
  "fieldName": string;
847
860
  /**
@@ -878,14 +891,17 @@ export namespace Components {
878
891
  interface SearchcraftFilterPanel {
879
892
  /**
880
893
  * The items to filter.
894
+ * @default []
881
895
  */
882
896
  "items": FilterItem[];
883
897
  /**
884
898
  * Controls whether the filter panel automatically hides/shows based on window size. - 'auto': Automatically hide/show based on window width - 'manual': User controls visibility manually
899
+ * @default 'auto'
885
900
  */
886
901
  "responsiveBehavior"?: "auto" | "manual";
887
902
  /**
888
903
  * The breakpoint (in pixels) below which the filter panel will be hidden. Defaults to 768px (--sc-breakpoint-md).
904
+ * @default 768
889
905
  */
890
906
  "responsiveBreakpoint"?: number;
891
907
  /**
@@ -915,6 +931,7 @@ export namespace Components {
915
931
  interface SearchcraftInputForm {
916
932
  /**
917
933
  * Whether or not to automatically submit the search term when the input changes.
934
+ * @default true
918
935
  */
919
936
  "autoSearch"?: boolean;
920
937
  /**
@@ -923,6 +940,7 @@ export namespace Components {
923
940
  "buttonLabel"?: string;
924
941
  /**
925
942
  * Where to place the search button.
943
+ * @default 'none'
926
944
  */
927
945
  "buttonPlacement"?: "left" | "right" | "none";
928
946
  /**
@@ -935,6 +953,7 @@ export namespace Components {
935
953
  "placeholderBehavior"?: "hide-on-focus" | "hide-on-text-entered";
936
954
  /**
937
955
  * The input element's placeholder value.
956
+ * @default 'Enter Search'
938
957
  */
939
958
  "placeholderValue"?: string;
940
959
  /**
@@ -955,8 +974,12 @@ export namespace Components {
955
974
  interface SearchcraftInputLabel {
956
975
  /**
957
976
  * The classname applied to the label element.
977
+ * @default ''
958
978
  */
959
979
  "inputLabelClassName"?: string | undefined;
980
+ /**
981
+ * @default ''
982
+ */
960
983
  "label": string;
961
984
  }
962
985
  /**
@@ -1079,10 +1102,12 @@ export namespace Components {
1079
1102
  interface SearchcraftPopoverForm {
1080
1103
  /**
1081
1104
  * The hotkey that activates the popover.
1105
+ * @default 'k'
1082
1106
  */
1083
1107
  "hotkey"?: string;
1084
1108
  /**
1085
1109
  * The hotkey modifier that activates the popover. Used together with the `hotkey` prop.
1110
+ * @default 'meta'
1086
1111
  */
1087
1112
  "hotkeyModifier"?: "ctrl" | "meta" | "alt" | "option";
1088
1113
  /**
@@ -1091,6 +1116,7 @@ export namespace Components {
1091
1116
  "placeholderBehavior"?: "hide-on-focus" | "hide-on-text-entered";
1092
1117
  /**
1093
1118
  * The input element's placeholder value.
1119
+ * @default 'Enter Search'
1094
1120
  */
1095
1121
  "placeholderValue"?: string;
1096
1122
  /**
@@ -1103,6 +1129,7 @@ export namespace Components {
1103
1129
  "searchcraftId"?: string;
1104
1130
  /**
1105
1131
  * The type of popover form to render. - `inline` - Renders inline with the rest of the content on the page. The search results pop over the page content. - `fullscreen` - Renders in fullscreen view. Used together with the `searchcraft-popover-button` component. - `modal` - Renders in a modal view. Used together with the `searchcraft-popover-button` component.
1132
+ * @default 'inline'
1106
1133
  */
1107
1134
  "type"?: "inline" | "fullscreen" | "modal";
1108
1135
  }
@@ -1112,6 +1139,7 @@ export namespace Components {
1112
1139
  interface SearchcraftPopoverListItem {
1113
1140
  /**
1114
1141
  * The document position relative to the search results (For Measure)
1142
+ * @default 0
1115
1143
  */
1116
1144
  "documentPosition": number;
1117
1145
  "item": SearchClientResponseItem | undefined;
@@ -1195,6 +1223,7 @@ export namespace Components {
1195
1223
  interface SearchcraftSearchResult {
1196
1224
  /**
1197
1225
  * The position in the document. Used with the "document_clicked" measure event.
1226
+ * @default 0
1198
1227
  */
1199
1228
  "documentPosition": number;
1200
1229
  /**
@@ -1288,6 +1317,7 @@ export namespace Components {
1288
1317
  interface SearchcraftSearchResultsPerPage {
1289
1318
  /**
1290
1319
  * The amount the options will increase (e.g. 20 = [20, 40, 60, 80, 100]). The base value is defined by the `searchResultsPerPage` option in the configuration.
1320
+ * @default 20
1291
1321
  */
1292
1322
  "increment": string | number;
1293
1323
  /**
@@ -1313,6 +1343,7 @@ export namespace Components {
1313
1343
  "caption"?: string;
1314
1344
  /**
1315
1345
  * Whether the select input is disabled.
1346
+ * @default false
1316
1347
  */
1317
1348
  "disabled"?: boolean;
1318
1349
  /**
@@ -1333,6 +1364,7 @@ export namespace Components {
1333
1364
  "name": string;
1334
1365
  /**
1335
1366
  * The options for the select input.
1367
+ * @default []
1336
1368
  */
1337
1369
  "options": SearchcraftSelectOption[] | string;
1338
1370
  }
@@ -1342,6 +1374,7 @@ export namespace Components {
1342
1374
  interface SearchcraftSlider {
1343
1375
  /**
1344
1376
  * The type of data the sliders are using.
1377
+ * @default 'number'
1345
1378
  */
1346
1379
  "dataType": "number" | "date";
1347
1380
  /**
@@ -1350,14 +1383,17 @@ export namespace Components {
1350
1383
  "dateGranularity"?: "year" | "month" | "day" | "hour";
1351
1384
  /**
1352
1385
  * The maximum value allowed.
1386
+ * @default 100
1353
1387
  */
1354
1388
  "max": number;
1355
1389
  /**
1356
1390
  * The minimum value allowed.
1391
+ * @default 0
1357
1392
  */
1358
1393
  "min": number;
1359
1394
  /**
1360
1395
  * The step amount for the slider inputs.
1396
+ * @default 1
1361
1397
  */
1362
1398
  "step": number;
1363
1399
  }
@@ -1414,6 +1450,7 @@ export namespace Components {
1414
1450
  interface SearchcraftToggleButton {
1415
1451
  /**
1416
1452
  * The label.
1453
+ * @default 'Toggle'
1417
1454
  */
1418
1455
  "label": string;
1419
1456
  /**
@@ -2023,9 +2060,13 @@ declare namespace LocalJSX {
2023
2060
  */
2024
2061
  interface SearchcraftAd {
2025
2062
  "adClientResponseItem"?: AdClientResponseItem;
2063
+ /**
2064
+ * @default 'Custom'
2065
+ */
2026
2066
  "adSource"?: "Custom" | "Nativo" | "adMarketplace";
2027
2067
  /**
2028
2068
  * Where the ad is being rendered within the search results div. Lifecycle behavior differs for ads being rendered in different positions, so we need to be able to handle all of those cases.
2069
+ * @default 'interstitial'
2029
2070
  */
2030
2071
  "renderPosition"?: "interstitial" | "top" | "bottom";
2031
2072
  /**
@@ -2040,10 +2081,12 @@ declare namespace LocalJSX {
2040
2081
  interface SearchcraftButton {
2041
2082
  /**
2042
2083
  * Whether the button is disabled.
2084
+ * @default false
2043
2085
  */
2044
2086
  "disabled"?: boolean;
2045
2087
  /**
2046
2088
  * Controls the visual representation of the button.
2089
+ * @default 'primary'
2047
2090
  */
2048
2091
  "hierarchy"?: "primary" | "tertiary";
2049
2092
  /**
@@ -2052,14 +2095,17 @@ declare namespace LocalJSX {
2052
2095
  "icon"?: Element;
2053
2096
  /**
2054
2097
  * Should the button only display an icon.
2098
+ * @default false
2055
2099
  */
2056
2100
  "iconOnly"?: boolean;
2057
2101
  /**
2058
2102
  * The position of the icon.
2103
+ * @default 'left'
2059
2104
  */
2060
2105
  "iconPosition"?: "left" | "right";
2061
2106
  /**
2062
2107
  * The label for the button.
2108
+ * @default 'Search'
2063
2109
  */
2064
2110
  "label"?: string;
2065
2111
  /**
@@ -2068,6 +2114,7 @@ declare namespace LocalJSX {
2068
2114
  "onButtonClick"?: (event: SearchcraftButtonCustomEvent<void>) => void;
2069
2115
  /**
2070
2116
  * The type of the button.
2117
+ * @default 'button'
2071
2118
  */
2072
2119
  "type"?: "submit" | "reset" | "button";
2073
2120
  }
@@ -2103,6 +2150,7 @@ declare namespace LocalJSX {
2103
2150
  "exclude"?: string[];
2104
2151
  /**
2105
2152
  * The name of the field where facets are applied.
2153
+ * @default ''
2106
2154
  */
2107
2155
  "fieldName"?: string;
2108
2156
  /**
@@ -2145,14 +2193,17 @@ declare namespace LocalJSX {
2145
2193
  interface SearchcraftFilterPanel {
2146
2194
  /**
2147
2195
  * The items to filter.
2196
+ * @default []
2148
2197
  */
2149
2198
  "items"?: FilterItem[];
2150
2199
  /**
2151
2200
  * Controls whether the filter panel automatically hides/shows based on window size. - 'auto': Automatically hide/show based on window width - 'manual': User controls visibility manually
2201
+ * @default 'auto'
2152
2202
  */
2153
2203
  "responsiveBehavior"?: "auto" | "manual";
2154
2204
  /**
2155
2205
  * The breakpoint (in pixels) below which the filter panel will be hidden. Defaults to 768px (--sc-breakpoint-md).
2206
+ * @default 768
2156
2207
  */
2157
2208
  "responsiveBreakpoint"?: number;
2158
2209
  /**
@@ -2182,6 +2233,7 @@ declare namespace LocalJSX {
2182
2233
  interface SearchcraftInputForm {
2183
2234
  /**
2184
2235
  * Whether or not to automatically submit the search term when the input changes.
2236
+ * @default true
2185
2237
  */
2186
2238
  "autoSearch"?: boolean;
2187
2239
  /**
@@ -2190,6 +2242,7 @@ declare namespace LocalJSX {
2190
2242
  "buttonLabel"?: string;
2191
2243
  /**
2192
2244
  * Where to place the search button.
2245
+ * @default 'none'
2193
2246
  */
2194
2247
  "buttonPlacement"?: "left" | "right" | "none";
2195
2248
  /**
@@ -2214,6 +2267,7 @@ declare namespace LocalJSX {
2214
2267
  "placeholderBehavior"?: "hide-on-focus" | "hide-on-text-entered";
2215
2268
  /**
2216
2269
  * The input element's placeholder value.
2270
+ * @default 'Enter Search'
2217
2271
  */
2218
2272
  "placeholderValue"?: string;
2219
2273
  /**
@@ -2234,8 +2288,12 @@ declare namespace LocalJSX {
2234
2288
  interface SearchcraftInputLabel {
2235
2289
  /**
2236
2290
  * The classname applied to the label element.
2291
+ * @default ''
2237
2292
  */
2238
2293
  "inputLabelClassName"?: string | undefined;
2294
+ /**
2295
+ * @default ''
2296
+ */
2239
2297
  "label"?: string;
2240
2298
  }
2241
2299
  /**
@@ -2358,10 +2416,12 @@ declare namespace LocalJSX {
2358
2416
  interface SearchcraftPopoverForm {
2359
2417
  /**
2360
2418
  * The hotkey that activates the popover.
2419
+ * @default 'k'
2361
2420
  */
2362
2421
  "hotkey"?: string;
2363
2422
  /**
2364
2423
  * The hotkey modifier that activates the popover. Used together with the `hotkey` prop.
2424
+ * @default 'meta'
2365
2425
  */
2366
2426
  "hotkeyModifier"?: "ctrl" | "meta" | "alt" | "option";
2367
2427
  /**
@@ -2370,6 +2430,7 @@ declare namespace LocalJSX {
2370
2430
  "placeholderBehavior"?: "hide-on-focus" | "hide-on-text-entered";
2371
2431
  /**
2372
2432
  * The input element's placeholder value.
2433
+ * @default 'Enter Search'
2373
2434
  */
2374
2435
  "placeholderValue"?: string;
2375
2436
  /**
@@ -2382,6 +2443,7 @@ declare namespace LocalJSX {
2382
2443
  "searchcraftId"?: string;
2383
2444
  /**
2384
2445
  * The type of popover form to render. - `inline` - Renders inline with the rest of the content on the page. The search results pop over the page content. - `fullscreen` - Renders in fullscreen view. Used together with the `searchcraft-popover-button` component. - `modal` - Renders in a modal view. Used together with the `searchcraft-popover-button` component.
2446
+ * @default 'inline'
2385
2447
  */
2386
2448
  "type"?: "inline" | "fullscreen" | "modal";
2387
2449
  }
@@ -2391,6 +2453,7 @@ declare namespace LocalJSX {
2391
2453
  interface SearchcraftPopoverListItem {
2392
2454
  /**
2393
2455
  * The document position relative to the search results (For Measure)
2456
+ * @default 0
2394
2457
  */
2395
2458
  "documentPosition"?: number;
2396
2459
  "item"?: SearchClientResponseItem | undefined;
@@ -2474,6 +2537,7 @@ declare namespace LocalJSX {
2474
2537
  interface SearchcraftSearchResult {
2475
2538
  /**
2476
2539
  * The position in the document. Used with the "document_clicked" measure event.
2540
+ * @default 0
2477
2541
  */
2478
2542
  "documentPosition"?: number;
2479
2543
  /**
@@ -2567,6 +2631,7 @@ declare namespace LocalJSX {
2567
2631
  interface SearchcraftSearchResultsPerPage {
2568
2632
  /**
2569
2633
  * The amount the options will increase (e.g. 20 = [20, 40, 60, 80, 100]). The base value is defined by the `searchResultsPerPage` option in the configuration.
2634
+ * @default 20
2570
2635
  */
2571
2636
  "increment"?: string | number;
2572
2637
  /**
@@ -2592,6 +2657,7 @@ declare namespace LocalJSX {
2592
2657
  "caption"?: string;
2593
2658
  /**
2594
2659
  * Whether the select input is disabled.
2660
+ * @default false
2595
2661
  */
2596
2662
  "disabled"?: boolean;
2597
2663
  /**
@@ -2616,6 +2682,7 @@ declare namespace LocalJSX {
2616
2682
  "onSelectChange"?: (event: SearchcraftSelectCustomEvent<string>) => void;
2617
2683
  /**
2618
2684
  * The options for the select input.
2685
+ * @default []
2619
2686
  */
2620
2687
  "options"?: SearchcraftSelectOption[] | string;
2621
2688
  }
@@ -2625,6 +2692,7 @@ declare namespace LocalJSX {
2625
2692
  interface SearchcraftSlider {
2626
2693
  /**
2627
2694
  * The type of data the sliders are using.
2695
+ * @default 'number'
2628
2696
  */
2629
2697
  "dataType"?: "number" | "date";
2630
2698
  /**
@@ -2633,10 +2701,12 @@ declare namespace LocalJSX {
2633
2701
  "dateGranularity"?: "year" | "month" | "day" | "hour";
2634
2702
  /**
2635
2703
  * The maximum value allowed.
2704
+ * @default 100
2636
2705
  */
2637
2706
  "max"?: number;
2638
2707
  /**
2639
2708
  * The minimum value allowed.
2709
+ * @default 0
2640
2710
  */
2641
2711
  "min"?: number;
2642
2712
  /**
@@ -2645,6 +2715,7 @@ declare namespace LocalJSX {
2645
2715
  "onRangeChanged"?: (event: SearchcraftSliderCustomEvent<any>) => void;
2646
2716
  /**
2647
2717
  * The step amount for the slider inputs.
2718
+ * @default 1
2648
2719
  */
2649
2720
  "step"?: number;
2650
2721
  }
@@ -2701,6 +2772,7 @@ declare namespace LocalJSX {
2701
2772
  interface SearchcraftToggleButton {
2702
2773
  /**
2703
2774
  * The label.
2775
+ * @default 'Toggle'
2704
2776
  */
2705
2777
  "label"?: string;
2706
2778
  /**