@envive-ai/react-widgets 0.3.3 → 0.3.5

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 (72) hide show
  1. package/dist/SearchResults/SearchResults.d.cts +2 -2
  2. package/dist/SearchResults/SearchResults.d.ts +3 -2
  3. package/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
  4. package/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
  5. package/dist/SearchZeroState/index.d.cts +2 -1
  6. package/dist/SearchZeroState/index.d.ts +2 -1
  7. package/dist/SearchZeroState/types.d.cts +2 -2
  8. package/dist/SearchZeroState/types.d.ts +2 -2
  9. package/dist/SuggestionBar/SuggestionBar.d.cts +3 -3
  10. package/dist/SuggestionBar/SuggestionBar.d.ts +3 -3
  11. package/dist/SuggestionButtonContainer/types.d.cts +3 -2
  12. package/dist/SuggestionButtonContainer/types.d.ts +3 -2
  13. package/dist/hooks/dist/application/models/api/response.d.cts +11 -0
  14. package/dist/hooks/dist/application/models/api/search.d.cts +13 -0
  15. package/dist/hooks/dist/application/models/chatElementDisplayLocation.d.cts +27 -0
  16. package/dist/hooks/dist/application/models/featureGates.d.cts +30 -0
  17. package/dist/hooks/dist/application/models/frontendConfig.d.cts +17 -0
  18. package/dist/hooks/dist/application/models/utilityTypes/camelCase.d.cts +71 -0
  19. package/dist/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.cts +58 -0
  20. package/dist/hooks/dist/application/models/utilityTypes/internal.d.cts +22 -0
  21. package/dist/hooks/dist/application/models/utilityTypes/splitWords.d.cts +31 -0
  22. package/dist/hooks/dist/application/models/utilityTypes/trim.d.cts +30 -0
  23. package/dist/hooks/dist/application/models/utilityTypes/unknownArray.d.cts +30 -0
  24. package/dist/hooks/dist/application/models/variantInfo/pageVisitInfo.d.cts +11 -0
  25. package/dist/hooks/dist/application/models/variantInfo/plpInfo.d.cts +8 -0
  26. package/dist/hooks/dist/application/models/variantInfo/productInfo.d.cts +10 -0
  27. package/dist/hooks/dist/application/models/variantInfo/variantInfo.d.cts +31 -0
  28. package/dist/hooks/dist/application/utils/overrides.d.cts +22 -0
  29. package/dist/hooks/dist/atoms/search/searchAPI.d.cts +11 -0
  30. package/dist/hooks/dist/contexts/types.d.cts +671 -0
  31. package/dist/hooks/dist/hooks/Search/useSearch.d.cts +57 -0
  32. package/dist/hooks/dist/hooks/utils.d.cts +9 -0
  33. package/dist/hooks/dist/merchants/domInsertion.d.cts +15 -0
  34. package/dist/hooks/dist/merchants/gridInsertion.d.cts +22 -0
  35. package/dist/hooks/dist/types/customerService.d.cts +24 -0
  36. package/dist/hooks/dist/types/custservice-types.d.cts +10 -0
  37. package/dist/hooks/dist/types/enviveConfig.d.cts +30 -0
  38. package/dist/hooks/dist/types/index.d.cts +6 -0
  39. package/dist/hooks/dist/types/search-filter-types.d.cts +26 -0
  40. package/dist/hooks/dist/types/suggestionBarV2-types.d.cts +9 -0
  41. package/dist/hooks/dist/types/test-types.d.cts +8 -0
  42. package/dist/packages/hooks/dist/application/models/api/response.d.ts +11 -0
  43. package/dist/packages/hooks/dist/application/models/api/search.d.ts +13 -0
  44. package/dist/packages/hooks/dist/application/models/chatElementDisplayLocation.d.ts +27 -0
  45. package/dist/packages/hooks/dist/application/models/featureGates.d.ts +30 -0
  46. package/dist/packages/hooks/dist/application/models/frontendConfig.d.ts +17 -0
  47. package/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.ts +71 -0
  48. package/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts +58 -0
  49. package/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.ts +22 -0
  50. package/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.ts +31 -0
  51. package/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.ts +30 -0
  52. package/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.ts +30 -0
  53. package/dist/packages/hooks/dist/application/models/variantInfo/pageVisitInfo.d.ts +11 -0
  54. package/dist/packages/hooks/dist/application/models/variantInfo/plpInfo.d.ts +8 -0
  55. package/dist/packages/hooks/dist/application/models/variantInfo/productInfo.d.ts +10 -0
  56. package/dist/packages/hooks/dist/application/models/variantInfo/variantInfo.d.ts +31 -0
  57. package/dist/packages/hooks/dist/application/utils/overrides.d.ts +22 -0
  58. package/dist/packages/hooks/dist/atoms/search/searchAPI.d.ts +13 -0
  59. package/dist/packages/hooks/dist/contexts/types.d.ts +671 -0
  60. package/dist/packages/hooks/dist/hooks/Search/index.d.ts +1 -0
  61. package/dist/packages/hooks/dist/hooks/Search/useSearch.d.ts +57 -0
  62. package/dist/packages/hooks/dist/hooks/utils.d.ts +9 -0
  63. package/dist/packages/hooks/dist/merchants/domInsertion.d.ts +15 -0
  64. package/dist/packages/hooks/dist/merchants/gridInsertion.d.ts +22 -0
  65. package/dist/packages/hooks/dist/types/customerService.d.ts +24 -0
  66. package/dist/packages/hooks/dist/types/custservice-types.d.ts +10 -0
  67. package/dist/packages/hooks/dist/types/enviveConfig.d.ts +30 -0
  68. package/dist/packages/hooks/dist/types/index.d.ts +5 -0
  69. package/dist/packages/hooks/dist/types/search-filter-types.d.ts +26 -0
  70. package/dist/packages/hooks/dist/types/suggestionBarV2-types.d.ts +9 -0
  71. package/dist/packages/hooks/dist/types/test-types.d.ts +8 -0
  72. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
+ import { SearchResultsHocProps } from "../hooks/dist/hooks/Search/useSearch.cjs";
1
2
  import { SearchResultsEntryPointWidgetConfig } from "./types.cjs";
2
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
3
- import { SearchResultsHocProps } from "@envive-ai/react-hooks/hooks/Search";
4
4
 
5
5
  //#region src/SearchResults/SearchResults.d.ts
6
6
  interface SearchResultsProps extends SearchResultsHocProps {
7
7
  widgetConfig: SearchResultsEntryPointWidgetConfig;
8
8
  }
9
- declare const SearchResults: (props: Omit<SearchResultsProps, string | number | symbol>) => react_jsx_runtime0.JSX.Element;
9
+ declare const SearchResults: (props: Omit<SearchResultsProps, keyof SearchResultsHocProps>) => react_jsx_runtime0.JSX.Element;
10
10
  //#endregion
11
11
  export { SearchResults };
@@ -1,11 +1,12 @@
1
+ import { SearchResultsHocProps } from "../packages/hooks/dist/hooks/Search/useSearch.js";
2
+ import "../packages/hooks/dist/hooks/Search/index.js";
1
3
  import { SearchResultsEntryPointWidgetConfig } from "./types.js";
2
- import { SearchResultsHocProps } from "@envive-ai/react-hooks/hooks/Search";
3
4
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
5
 
5
6
  //#region src/SearchResults/SearchResults.d.ts
6
7
  interface SearchResultsProps extends SearchResultsHocProps {
7
8
  widgetConfig: SearchResultsEntryPointWidgetConfig;
8
9
  }
9
- declare const SearchResults: (props: Omit<SearchResultsProps, string | number | symbol>) => react_jsx_runtime0.JSX.Element;
10
+ declare const SearchResults: (props: Omit<SearchResultsProps, keyof SearchResultsHocProps>) => react_jsx_runtime0.JSX.Element;
10
11
  //#endregion
11
12
  export { SearchResults };
@@ -1,6 +1,6 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/SearchResults/SearchResultsWidget.d.ts
4
- declare const SearchResultsWidget: () => react_jsx_runtime2.JSX.Element;
4
+ declare const SearchResultsWidget: () => react_jsx_runtime0.JSX.Element;
5
5
  //#endregion
6
6
  export { SearchResultsWidget };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/SearchZeroState/SearchZeroStateWidget.d.ts
4
4
  type SearchZeroStateWidgetProps = {
@@ -10,6 +10,6 @@ declare const SearchZeroStateWidget: ({
10
10
  initialIsOpen,
11
11
  widgetConfigId,
12
12
  entryPointRef
13
- }: SearchZeroStateWidgetProps) => react_jsx_runtime2.JSX.Element;
13
+ }: SearchZeroStateWidgetProps) => react_jsx_runtime3.JSX.Element;
14
14
  //#endregion
15
15
  export { SearchZeroStateWidget };
@@ -1,4 +1,5 @@
1
- import { SearchEntryPointWidgetConfig, SearchInputVariant, SearchZeroStateProps } from "./types.cjs";
1
+ import { SearchEntryPointWidgetConfig, SearchInputVariant } from "../hooks/dist/contexts/types.cjs";
2
+ import { SearchZeroStateProps } from "./types.cjs";
2
3
  import { SearchZeroState } from "./SearchZeroState.cjs";
3
4
  import { SearchZeroStateWidget } from "./SearchZeroStateWidget.cjs";
4
5
  export { SearchEntryPointWidgetConfig, SearchInputVariant, SearchZeroState, SearchZeroStateProps, SearchZeroStateWidget };
@@ -1,4 +1,5 @@
1
- import { SearchEntryPointWidgetConfig, SearchInputVariant, SearchZeroStateProps } from "./types.js";
1
+ import { SearchEntryPointWidgetConfig, SearchInputVariant } from "../packages/hooks/dist/contexts/types.js";
2
+ import { SearchZeroStateProps } from "./types.js";
2
3
  import { SearchZeroState } from "./SearchZeroState.js";
3
4
  import { SearchZeroStateWidget } from "./SearchZeroStateWidget.js";
4
5
  export { SearchEntryPointWidgetConfig, SearchInputVariant, SearchZeroState, SearchZeroStateProps, SearchZeroStateWidget };
@@ -1,4 +1,4 @@
1
- import { SearchEntryPointWidgetConfig, SearchInputVariant } from "@envive-ai/react-hooks/contexts/types";
1
+ import { SearchEntryPointWidgetConfig, SearchInputVariant } from "../hooks/dist/contexts/types.cjs";
2
2
 
3
3
  //#region src/SearchZeroState/types.d.ts
4
4
  interface SearchZeroStateProps {
@@ -7,4 +7,4 @@ interface SearchZeroStateProps {
7
7
  entryPointRef?: React.Ref<HTMLButtonElement>;
8
8
  }
9
9
  //#endregion
10
- export { type SearchEntryPointWidgetConfig, type SearchInputVariant, SearchZeroStateProps };
10
+ export { SearchZeroStateProps };
@@ -1,4 +1,4 @@
1
- import { SearchEntryPointWidgetConfig, SearchInputVariant } from "@envive-ai/react-hooks/contexts/types";
1
+ import { SearchEntryPointWidgetConfig, SearchInputVariant } from "../packages/hooks/dist/contexts/types.js";
2
2
 
3
3
  //#region src/SearchZeroState/types.d.ts
4
4
  interface SearchZeroStateProps {
@@ -7,4 +7,4 @@ interface SearchZeroStateProps {
7
7
  entryPointRef?: React.Ref<HTMLButtonElement>;
8
8
  }
9
9
  //#endregion
10
- export { type SearchEntryPointWidgetConfig, type SearchInputVariant, SearchZeroStateProps };
10
+ export { SearchZeroStateProps };
@@ -1,6 +1,6 @@
1
+ import { SuggestionButtonVariant } from "../hooks/dist/contexts/types.cjs";
1
2
  import { SuggestionBarLocationForMetrics } from "./types.cjs";
2
- import * as react_jsx_runtime3 from "react/jsx-runtime";
3
- import { SuggestionButtonVariant } from "@envive-ai/react-hooks/contexts/types";
3
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
4
4
  import { Message } from "postcss";
5
5
 
6
6
  //#region src/SuggestionBar/SuggestionBar.d.ts
@@ -29,6 +29,6 @@ declare function SuggestionBar({
29
29
  buttonBorderRadius,
30
30
  handleReply,
31
31
  dataTestId
32
- }: Readonly<SuggestionBarProps>): react_jsx_runtime3.JSX.Element;
32
+ }: Readonly<SuggestionBarProps>): react_jsx_runtime2.JSX.Element;
33
33
  //#endregion
34
34
  export { SuggestionBar };
@@ -1,6 +1,6 @@
1
+ import { SuggestionButtonVariant } from "../packages/hooks/dist/contexts/types.js";
1
2
  import { SuggestionBarLocationForMetrics } from "./types.js";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
- import { SuggestionButtonVariant } from "@envive-ai/react-hooks/contexts/types";
3
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
4
4
  import { Message } from "postcss";
5
5
 
6
6
  //#region src/SuggestionBar/SuggestionBar.d.ts
@@ -29,6 +29,6 @@ declare function SuggestionBar({
29
29
  buttonBorderRadius,
30
30
  handleReply,
31
31
  dataTestId
32
- }: Readonly<SuggestionBarProps>): react_jsx_runtime0.JSX.Element;
32
+ }: Readonly<SuggestionBarProps>): react_jsx_runtime2.JSX.Element;
33
33
  //#endregion
34
34
  export { SuggestionBar };
@@ -1,5 +1,6 @@
1
- import { SuggestionButtonVariant } from "@envive-ai/react-hooks/contexts/types";
2
- import { TestProps } from "@envive-ai/react-hooks/types";
1
+ import { TestProps } from "../hooks/dist/types/test-types.cjs";
2
+ import { SuggestionButtonVariant } from "../hooks/dist/contexts/types.cjs";
3
+ import "../hooks/dist/types/index.cjs";
3
4
 
4
5
  //#region src/SuggestionButtonContainer/types.d.ts
5
6
  interface SuggestionButtonContainerProps extends TestProps {
@@ -1,5 +1,6 @@
1
- import { TestProps } from "@envive-ai/react-hooks/types";
2
- import { SuggestionButtonVariant } from "@envive-ai/react-hooks/contexts/types";
1
+ import { TestProps } from "../packages/hooks/dist/types/test-types.js";
2
+ import { SuggestionButtonVariant } from "../packages/hooks/dist/contexts/types.js";
3
+ import "../packages/hooks/dist/types/index.js";
3
4
 
4
5
  //#region src/SuggestionButtonContainer/types.d.ts
5
6
  interface SuggestionButtonContainerProps extends TestProps {
@@ -0,0 +1,11 @@
1
+ import { CamelCasedPropertiesDeep } from "../utilityTypes/camelCasedPropertiesDeep.cjs";
2
+ import { ResponseCategory, SearchResponseProduct } from "@spiffy-ai/commerce-api-client";
3
+
4
+ //#region ../hooks/dist/application/models/api/response.d.ts
5
+
6
+ interface SearchResponseProductAttributes {
7
+ category: ResponseCategory.Product;
8
+ attributes: CamelCasedPropertiesDeep<SearchResponseProduct>;
9
+ }
10
+ //#endregion
11
+ export { SearchResponseProductAttributes };
@@ -0,0 +1,13 @@
1
+ import { SearchResponseProduct } from "@spiffy-ai/commerce-api-client";
2
+
3
+ //#region ../hooks/dist/application/models/api/search.d.ts
4
+
5
+ interface SearchResult {
6
+ products: SearchResponseProduct[];
7
+ filters: string[];
8
+ generatedQuery?: string;
9
+ totalProductCount: number;
10
+ searchResponseId: string;
11
+ }
12
+ //#endregion
13
+ export { SearchResult };
@@ -0,0 +1,27 @@
1
+ //#region ../hooks/dist/application/models/chatElementDisplayLocation.d.ts
2
+ //#region src/application/models/chatElementDisplayLocation.d.ts
3
+ declare enum ChatElementDisplayLocation {
4
+ IN_CHAT = "in_chat",
5
+ CHAT_PREVIEW = "chat_preview",
6
+ FLOATING_BUTTON = "floating_button",
7
+ HELP_ME_CHOOSE = "help_me_choose",
8
+ PLP_IMAGE_BANNER = "plp_image_banner",
9
+ TOP_REVIEWS_SNIPPET = "top_reviews_snippet",
10
+ BOTTOM_REVIEWS_SNIPPET = "bottom_reviews_snippet",
11
+ BLOCK_BACK_BUTTON = "block_back_button",
12
+ SWITCH_TO_AGENT = "switch_to_agent",
13
+ CONVERSATIONAL_SEARCH = "conversational_search",
14
+ GLOBAL_SEARCH_ENTRYPOINT = "global_search_entrypoint",
15
+ SEARCH_NAV_ENTRYPOINT = "search_nav_entrypoint",
16
+ SEARCH_PROMPT = "search_prompt",
17
+ SEARCH_ZERO_STATE_SUGGESTED_PRODUCTS = "search_zero_state_suggested_products",
18
+ SEARCH_PROMPT_BUTTON = "search_prompt_button",
19
+ PRODUCT_GRID = "product_grid",
20
+ UNSPECIFIED = "unspecified",
21
+ FILTER_MODAL = "filter_modal",
22
+ PROMPT_CARD = "prompt_card",
23
+ WINDOW_API_CALL = "window_api_call",
24
+ }
25
+ //#endregion
26
+ //#endregion
27
+ export { ChatElementDisplayLocation };
@@ -0,0 +1,30 @@
1
+ //#region ../hooks/dist/application/models/featureGates.d.ts
2
+ //#region src/application/models/featureGates.d.ts
3
+ declare enum FeatureGates {
4
+ IsClientSessionEnabled = "is_client_session_enabled",
5
+ IsSalesAgentEnabled = "is_sales_agent_enabled",
6
+ IsNewFeatureEnabled = "is_new_feature_enabled",
7
+ IsFineTunedModel8b = "is_fine_tuned_model_8b",
8
+ IsImageBannerEnabled = "is_image_banner_enabled",
9
+ IsOrderLookupEnabled = "is_order_lookup_enabled",
10
+ IsSummarizeReviewsEnabled = "is_summarize_reviews_enabled",
11
+ IsGlobalSearchEnabled = "is_global_search_enabled",
12
+ IsImagePromptEnabled = "is_image_prompt_enabled",
13
+ IsWatermarkEnabled = "is_watermark_enabled",
14
+ IsInferenceRegion0 = "is_inference_region_0",
15
+ IsChatVariantEnabled = "is_chat_variant_enabled",
16
+ IsChatVariantAEnabled = "is_chat_variant_a_enabled",
17
+ IsChatVariantBEnabled = "is_chat_variant_b_enabled",
18
+ IsUserQueryAlwaysEnabled = "is_user_query_always_enabled",
19
+ IsSearchAutocompleteEnabled = "is_search_autocomplete_enabled",
20
+ IsEmptyDivPLPEnabled = "is_empty_div_plp_enabled",
21
+ IsRecommendedProductsEnabled = "is_recommended_products_enabled",
22
+ IsChatScrollPaused = "is_chat_scroll_paused",
23
+ IsSessionInSearchRerankerTest = "is_session_in_search_reranker_test",
24
+ IsReferrerBasedPromptEnabled = "is_referrer_based_prompt_enabled",
25
+ IsInModelExperiment = "is_in_model_experiment",
26
+ IsModelExperimentTreatment = "is_model_experiment_treatment",
27
+ }
28
+ //#endregion
29
+ //#endregion
30
+ export { FeatureGates };
@@ -0,0 +1,17 @@
1
+ import { Override } from "../utils/overrides.cjs";
2
+ import { OrgUIConfig, PageVariantConfig, WidgetConfig, WidgetMountingConfig } from "../../contexts/types.cjs";
3
+
4
+ //#region ../hooks/dist/application/models/frontendConfig.d.ts
5
+ //#region src/application/models/frontendConfig.d.ts
6
+ interface FrontendConfig {
7
+ merchant_override_css?: string;
8
+ pageVariants?: PageVariantConfig[];
9
+ mountingConfigs?: Record<string, WidgetMountingConfig>;
10
+ widgetConfigs?: Record<string, WidgetConfig>;
11
+ uiConfigs?: Omit<OrgUIConfig, 'merchantOverrideCss'>;
12
+ }
13
+ type FrontendConfigOverrides = Override<FrontendConfig>;
14
+ //#endregion
15
+
16
+ //#endregion
17
+ export { FrontendConfigOverrides };
@@ -0,0 +1,71 @@
1
+ import { SplitWords } from "./splitWords.cjs";
2
+
3
+ //#region ../hooks/dist/application/models/utilityTypes/camelCase.d.ts
4
+
5
+ //#region src/application/models/utilityTypes/camelCase.d.ts
6
+ /**
7
+ * CamelCase options.
8
+ *
9
+ * @see {@link CamelCase}
10
+ */
11
+ type CamelCaseOptions = {
12
+ /**
13
+ * Whether to preserved consecutive uppercase letter.
14
+ *
15
+ * @default true
16
+ */
17
+ preserveConsecutiveUppercase?: boolean;
18
+ };
19
+ /**
20
+ * Convert an array of words to camel-case.
21
+ */
22
+ type CamelCaseFromArray<Words extends string[], Options extends CamelCaseOptions, OutputString extends string = ''> = Words extends [infer FirstWord extends string, ...infer RemainingWords extends string[]] ? Options['preserveConsecutiveUppercase'] extends true ? `${Capitalize<FirstWord>}${CamelCaseFromArray<RemainingWords, Options>}` : `${Capitalize<Lowercase<FirstWord>>}${CamelCaseFromArray<RemainingWords, Options>}` : OutputString;
23
+ /**
24
+ * Convert a string literal to camel-case.
25
+ *
26
+ * This can be useful when, for example, converting some kebab-cased command-line flags or a snake-cased database result.
27
+ *
28
+ * By default, consecutive uppercase letter are preserved. See {@link CamelCaseOptions.preserveConsecutiveUppercase preserveConsecutiveUppercase} option to change this behaviour.
29
+ *
30
+ * @example
31
+ * ```
32
+ * import type {CamelCase} from 'type-fest';
33
+ *
34
+ * // Simple
35
+ *
36
+ * const someVariable: CamelCase<'foo-bar'> = 'fooBar';
37
+ *
38
+ * // Advanced
39
+ *
40
+ * type CamelCasedProperties<T> = {
41
+ * [K in keyof T as CamelCase<K>]: T[K]
42
+ * };
43
+ *
44
+ * interface RawOptions {
45
+ * 'dry-run': boolean;
46
+ * 'full_family_name': string;
47
+ * foo: number;
48
+ * BAR: string;
49
+ * QUZ_QUX: number;
50
+ * 'OTHER-FIELD': boolean;
51
+ * }
52
+ *
53
+ * const dbResult: CamelCasedProperties<RawOptions> = {
54
+ * dryRun: true,
55
+ * fullFamilyName: 'bar.js',
56
+ * foo: 123,
57
+ * bar: 'foo',
58
+ * quzQux: 6,
59
+ * otherField: false
60
+ * };
61
+ * ```
62
+ *
63
+ * @category Change case
64
+ * @category Template literal
65
+ */
66
+ type CamelCase<Type, Options extends CamelCaseOptions = {
67
+ preserveConsecutiveUppercase: true;
68
+ }> = Type extends string ? string extends Type ? Type : Uncapitalize<CamelCaseFromArray<SplitWords<Type extends Uppercase<Type> ? Lowercase<Type> : Type>, Options>> : Type;
69
+ //#endregion
70
+ //#endregion
71
+ export { CamelCase, CamelCaseOptions };
@@ -0,0 +1,58 @@
1
+ import { CamelCase, CamelCaseOptions } from "./camelCase.cjs";
2
+ import { UnknownArray } from "./unknownArray.cjs";
3
+
4
+ //#region ../hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts
5
+
6
+ //#region src/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts
7
+ /**
8
+ * Convert object properties to camel case recursively.
9
+ *
10
+ * This can be useful when, for example, converting some API types from a different style.
11
+ *
12
+ * @see CamelCasedProperties
13
+ * @see CamelCase
14
+ *
15
+ * @example
16
+ * ```
17
+ * import type {CamelCasedPropertiesDeep} from 'type-fest';
18
+ *
19
+ * interface User {
20
+ * UserId: number;
21
+ * UserName: string;
22
+ * }
23
+ *
24
+ * interface UserWithFriends {
25
+ * UserInfo: User;
26
+ * UserFriends: User[];
27
+ * }
28
+ *
29
+ * const result: CamelCasedPropertiesDeep<UserWithFriends> = {
30
+ * userInfo: {
31
+ * userId: 1,
32
+ * userName: 'Tom',
33
+ * },
34
+ * userFriends: [
35
+ * {
36
+ * userId: 2,
37
+ * userName: 'Jerry',
38
+ * },
39
+ * {
40
+ * userId: 3,
41
+ * userName: 'Spike',
42
+ * },
43
+ * ],
44
+ * };
45
+ * ```
46
+ *
47
+ * @category Change case
48
+ * @category Template literal
49
+ * @category Object
50
+ */
51
+ type CamelCasedPropertiesDeep<Value, Options extends CamelCaseOptions = {
52
+ preserveConsecutiveUppercase: true;
53
+ }> = Value extends Function ? Value : Value extends UnknownArray ? CamelCasedPropertiesArrayDeep<Value> : Value extends Set<infer U> ? Set<CamelCasedPropertiesDeep<U, Options>> : { [K in keyof Value as CamelCase<K, Options>]: CamelCasedPropertiesDeep<Value[K], Options> };
54
+ type CamelCasedPropertiesArrayDeep<Value extends UnknownArray> = Value extends [] ? [] : Value extends [infer U, ...infer V] ? [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>] : Value extends readonly [infer U, ...infer V] ? readonly [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>] : Value extends readonly [...infer U, infer V] ? [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>] : Value extends readonly [...infer U, infer V] ? readonly [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>] : Value extends Array<infer U> ? Array<CamelCasedPropertiesDeep<U>> : Value extends ReadonlyArray<infer U> ? ReadonlyArray<CamelCasedPropertiesDeep<U>> : never;
55
+ //#endregion
56
+
57
+ //#endregion
58
+ export { CamelCasedPropertiesDeep };
@@ -0,0 +1,22 @@
1
+ import { Trim } from "./trim.cjs";
2
+
3
+ //#region ../hooks/dist/application/models/utilityTypes/internal.d.ts
4
+
5
+ /**
6
+ * Returns a boolean for whether the string is numeric.
7
+ *
8
+ * This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/microsoft/TypeScript/issues/46109#issuecomment-930307987).
9
+ */
10
+ type IsNumeric<T extends string> = T extends `${number}` ? Trim<T> extends T ? true : false : false;
11
+ /**
12
+ * Returns a boolean for whether the string is lowercased.
13
+ */
14
+ type IsLowerCase<T extends string> = T extends Lowercase<T> ? true : false;
15
+ /**
16
+ * Returns a boolean for whether the string is upper-cased.
17
+ */
18
+ type IsUpperCase<T extends string> = T extends Uppercase<T> ? true : false;
19
+ type WordSeparators = '-' | '_' | Whitespace;
20
+ type Whitespace = '\u{9}' | '\u{A}' | '\u{B}' | '\u{C}' | '\u{D}' | '\u{20}' | '\u{85}' | '\u{A0}' | '\u{1680}' | '\u{2000}' | '\u{2001}' | '\u{2002}' | '\u{2003}' | '\u{2004}' | '\u{2005}' | '\u{2006}' | '\u{2007}' | '\u{2008}' | '\u{2009}' | '\u{200A}' | '\u{2028}' | '\u{2029}' | '\u{202F}' | '\u{205F}' | '\u{3000}' | '\u{FEFF}';
21
+ //#endregion
22
+ export { IsLowerCase, IsNumeric, IsUpperCase, Whitespace, WordSeparators };
@@ -0,0 +1,31 @@
1
+ import { IsLowerCase, IsNumeric, IsUpperCase, WordSeparators } from "./internal.cjs";
2
+
3
+ //#region ../hooks/dist/application/models/utilityTypes/splitWords.d.ts
4
+ //#region src/application/models/utilityTypes/splitWords.d.ts
5
+ type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
6
+ type RemoveLastCharacter<Sentence extends string, Character extends string> = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
7
+ /**
8
+ * Split a string (almost) like Lodash's `_.words()` function.
9
+ *
10
+ * - Split on each word that begins with a capital letter.
11
+ * - Split on each {@link WordSeparators}.
12
+ * - Split on numeric sequence.
13
+ *
14
+ * @example
15
+ * ```
16
+ * type Words0 = SplitWords<'helloWorld'>; // ['hello', 'World']
17
+ * type Words1 = SplitWords<'helloWORLD'>; // ['hello', 'WORLD']
18
+ * type Words2 = SplitWords<'hello-world'>; // ['hello', 'world']
19
+ * type Words3 = SplitWords<'--hello the_world'>; // ['hello', 'the', 'world']
20
+ * type Words4 = SplitWords<'lifeIs42'>; // ['life', 'Is', '42']
21
+ * ```
22
+ *
23
+ * @internal
24
+ * @category Change case
25
+ * @category Template literal
26
+ */
27
+ type SplitWords<Sentence extends string, LastCharacter extends string = '', CurrentWord extends string = ''> = Sentence extends `${infer FirstCharacter}${infer RemainingCharacters}` ? FirstCharacter extends WordSeparators ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters>] : LastCharacter extends '' ? SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter> : [false, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, false] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [true, true] extends [IsLowerCase<LastCharacter>, IsUpperCase<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, true] extends [IsUpperCase<LastCharacter>, IsLowerCase<FirstCharacter>] ? [...RemoveLastCharacter<CurrentWord, LastCharacter>, ...SplitWords<RemainingCharacters, FirstCharacter, `${LastCharacter}${FirstCharacter}`>] : SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [...SkipEmptyWord<CurrentWord>];
28
+ //#endregion
29
+
30
+ //#endregion
31
+ export { SplitWords };
@@ -0,0 +1,30 @@
1
+ import { Whitespace } from "./internal.cjs";
2
+
3
+ //#region ../hooks/dist/application/models/utilityTypes/trim.d.ts
4
+
5
+ //#region src/application/models/utilityTypes/trim.d.ts
6
+ /**
7
+ * Remove spaces from the left side.
8
+ */
9
+ type TrimLeft<V extends string> = V extends `${Whitespace}${infer R}` ? TrimLeft<R> : V;
10
+ /**
11
+ * Remove spaces from the right side.
12
+ */
13
+ type TrimRight<V extends string> = V extends `${infer R}${Whitespace}` ? TrimRight<R> : V;
14
+ /**
15
+ * Remove leading and trailing spaces from a string.
16
+ * @example
17
+ * ```
18
+ * import type {Trim} from 'type-fest';
19
+ *
20
+ * Trim<' foo '>
21
+ * //=> 'foo'
22
+ * ```
23
+ *
24
+ * @category String
25
+ * @category Template literal
26
+ */
27
+ type Trim<V extends string> = TrimLeft<TrimRight<V>>;
28
+ //#endregion
29
+ //#endregion
30
+ export { Trim };
@@ -0,0 +1,30 @@
1
+ //#region ../hooks/dist/application/models/utilityTypes/unknownArray.d.ts
2
+ //#region src/application/models/utilityTypes/unknownArray.d.ts
3
+ /**
4
+ * Represents an array with `unknown` value.
5
+ *
6
+ * Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
7
+ *
8
+ * @example
9
+ * ```
10
+ * import type {UnknownArray} from 'type-fest';
11
+ *
12
+ * type IsArray<T> = T extends UnknownArray ? true : false;
13
+ *
14
+ * type A = IsArray<['foo']>;
15
+ * //=> true
16
+ *
17
+ * type B = IsArray<readonly number[]>;
18
+ * //=> true
19
+ *
20
+ * type C = IsArray<string>;
21
+ * //=> false
22
+ * ```
23
+ *
24
+ * @category Type
25
+ * @category Array
26
+ */
27
+ type UnknownArray = readonly unknown[];
28
+ //#endregion
29
+ //#endregion
30
+ export { UnknownArray };
@@ -0,0 +1,11 @@
1
+ import { PageVisitCategory } from "@spiffy-ai/commerce-api-client";
2
+
3
+ //#region ../hooks/dist/application/models/variantInfo/pageVisitInfo.d.ts
4
+ //#region src/application/models/variantInfo/pageVisitInfo.d.ts
5
+ interface PageVisitInfo {
6
+ url: string;
7
+ pageVisitCategory: PageVisitCategory;
8
+ }
9
+ //#endregion
10
+ //#endregion
11
+ export { PageVisitInfo };
@@ -0,0 +1,8 @@
1
+ //#region ../hooks/dist/application/models/variantInfo/plpInfo.d.ts
2
+ //#region src/application/models/variantInfo/plpInfo.d.ts
3
+ interface PLPInfo {
4
+ plpId: string;
5
+ }
6
+ //#endregion
7
+ //#endregion
8
+ export { PLPInfo };
@@ -0,0 +1,10 @@
1
+ //#region ../hooks/dist/application/models/variantInfo/productInfo.d.ts
2
+ //#region src/application/models/variantInfo/productInfo.d.ts
3
+ interface ProductInfo {
4
+ productId: string;
5
+ parentProductId?: string;
6
+ url?: string;
7
+ }
8
+ //#endregion
9
+ //#endregion
10
+ export { ProductInfo };
@@ -0,0 +1,31 @@
1
+ import { PLPInfo } from "./plpInfo.cjs";
2
+ import { PageVisitInfo } from "./pageVisitInfo.cjs";
3
+ import { ProductInfo } from "./productInfo.cjs";
4
+
5
+ //#region ../hooks/dist/application/models/variantInfo/variantInfo.d.ts
6
+ //#region src/application/models/variantInfo/variantInfo.d.ts
7
+ declare enum VariantTypeEnum {
8
+ Pdp = "pdp",
9
+ Plp = "plp",
10
+ PageVisit = "page_visit",
11
+ Home = "home",
12
+ Search = "search",
13
+ Other = "other",
14
+ }
15
+ type VariantInfo = PDPVariantInfo | PLPVariantInfo | PageVisitVariantInfo;
16
+ type PDPVariantInfo = {
17
+ variantId: string;
18
+ variant: VariantTypeEnum.Pdp;
19
+ } & ProductInfo;
20
+ type PLPVariantInfo = {
21
+ variantId: string;
22
+ variant: VariantTypeEnum.Plp;
23
+ url?: string;
24
+ } & PLPInfo;
25
+ type PageVisitVariantInfo = {
26
+ variantId: string;
27
+ variant: VariantTypeEnum.PageVisit;
28
+ } & PageVisitInfo;
29
+ //#endregion
30
+ //#endregion
31
+ export { VariantInfo };
@@ -0,0 +1,22 @@
1
+ //#region ../hooks/dist/application/utils/overrides.d.ts
2
+ //#region src/application/utils/overrides.d.ts
3
+ type ReplaceOp<T> = {
4
+ $replace: T;
5
+ };
6
+ type DeleteOp = {
7
+ $delete: true;
8
+ };
9
+ type Builtin = Date | RegExp | ((...args: unknown[]) => unknown);
10
+ type Primitive = string | number | boolean | bigint | symbol | null | undefined;
11
+ /**
12
+ * Override<T> is a DeepPartial-like type with special operators:
13
+ * - { $replace: T } to replace an entire subtree/array
14
+ * - { $delete: true } to delete an object key
15
+ *
16
+ * Arrays behavior:
17
+ * - Arrays of objects: merge-by-index by default (unless `arrayStrategy: 'replace'` or `$replace` is used)
18
+ * - Arrays of primitives (string/number/boolean/...): replaced by default when a patch array is provided
19
+ */
20
+ type Override<T> = T extends Primitive | Builtin ? T | ReplaceOp<T> | DeleteOp : T extends (infer U)[] ? Array<Override<U> | undefined> | ReplaceOp<T> : T extends Map<unknown, unknown> | Set<unknown> ? ReplaceOp<T> : T extends object ? { [K in keyof T]?: Override<T[K]> | DeleteOp | null } | ReplaceOp<T> : T;
21
+ //#endregion
22
+ export { Override };
@@ -0,0 +1,11 @@
1
+ //#region ../hooks/dist/atoms/search/searchAPI.d.ts
2
+
3
+ //#region src/atoms/search/searchAPI.d.ts
4
+ type SelectedFilterOption = {
5
+ id: string;
6
+ displayName: string;
7
+ filterId: string;
8
+ filterItemId: string;
9
+ };
10
+ //#endregion
11
+ export { SelectedFilterOption };