@envive-ai/react-widgets-v3 0.3.2
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.
- package/dist/CXIntegration/hooks/useUnifiedCXButton.cjs +23 -0
- package/dist/CXIntegration/hooks/useUnifiedCXButton.js +22 -0
- package/dist/CXIntegration/implementations/useDefaultUnifiedCXButton.cjs +11 -0
- package/dist/CXIntegration/implementations/useDefaultUnifiedCXButton.js +10 -0
- package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.cjs +20 -0
- package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.js +19 -0
- package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.cjs +53 -0
- package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.js +52 -0
- package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.cjs +45 -0
- package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.js +44 -0
- package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.cjs +70 -0
- package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.js +69 -0
- package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.cjs +59 -0
- package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.js +58 -0
- package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.cjs +65 -0
- package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.js +64 -0
- package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.cjs +53 -0
- package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.js +52 -0
- package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.cjs +18 -0
- package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.js +17 -0
- package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.cjs +54 -0
- package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.js +53 -0
- package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.cjs +18 -0
- package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.js +17 -0
- package/dist/CXIntegration/types.cjs +19 -0
- package/dist/CXIntegration/types.js +18 -0
- package/dist/CXIntegration/utils/functions.cjs +30 -0
- package/dist/CXIntegration/utils/functions.js +30 -0
- package/dist/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/hocs/withBaseWidget/index.cjs +3 -0
- package/dist/hocs/withBaseWidget/index.d.cts +3 -0
- package/dist/hocs/withBaseWidget/index.d.ts +3 -0
- package/dist/hocs/withBaseWidget/index.js +3 -0
- package/dist/hocs/withBaseWidget/types.d.cts +37 -0
- package/dist/hocs/withBaseWidget/types.d.ts +39 -0
- package/dist/hocs/withBaseWidget/withBaseWidget.cjs +101 -0
- package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +10 -0
- package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +10 -0
- package/dist/hocs/withBaseWidget/withBaseWidget.js +100 -0
- package/dist/hooks/dist/application/models/api/orgConfigResults.d.ts +1 -0
- package/dist/hooks/dist/application/models/frontendConfig.d.ts +1 -0
- package/dist/hooks/dist/contexts/amplitudeContext/amplitudeContext.d.ts +2 -0
- package/dist/hooks/dist/contexts/amplitudeContext/index.d.ts +2 -0
- package/dist/hooks/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.d.ts +2 -0
- package/dist/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.cts +8 -0
- package/dist/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.ts +11 -0
- package/dist/hooks/dist/contexts/hardcopyContext/index.d.ts +1 -0
- package/dist/hooks/dist/contexts/types.d.cts +44 -0
- package/dist/hooks/dist/contexts/types.d.ts +47 -0
- package/dist/hooks/dist/contexts/typesV3.d.cts +201 -0
- package/dist/hooks/dist/contexts/typesV3.d.ts +201 -0
- package/dist/hooks/dist/services/amplitudeService/amplitudeService.d.cts +36 -0
- package/dist/hooks/dist/services/amplitudeService/amplitudeService.d.ts +37 -0
- package/dist/hooks/dist/types/customerService.d.cts +18 -0
- package/dist/hooks/dist/types/customerService.d.ts +18 -0
- package/dist/stories/SalesAgentTest/index.cjs +0 -0
- package/dist/stories/SalesAgentTest/index.d.cts +1 -0
- package/dist/stories/SalesAgentTest/index.d.ts +1 -0
- package/dist/stories/SalesAgentTest/index.js +0 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +98 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +19 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +19 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +96 -0
- package/dist/widgets/ChatPreviewComparisonWidget/index.cjs +4 -0
- package/dist/widgets/ChatPreviewComparisonWidget/index.d.cts +2 -0
- package/dist/widgets/ChatPreviewComparisonWidget/index.d.ts +2 -0
- package/dist/widgets/ChatPreviewComparisonWidget/index.js +3 -0
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs +44 -0
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +16 -0
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +16 -0
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js +42 -0
- package/dist/widgets/ChatPreviewLoadingWidget/index.cjs +4 -0
- package/dist/widgets/ChatPreviewLoadingWidget/index.d.cts +2 -0
- package/dist/widgets/ChatPreviewLoadingWidget/index.d.ts +2 -0
- package/dist/widgets/ChatPreviewLoadingWidget/index.js +3 -0
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +86 -0
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +19 -0
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +19 -0
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +84 -0
- package/dist/widgets/ChatPreviewWidget/index.cjs +4 -0
- package/dist/widgets/ChatPreviewWidget/index.d.cts +2 -0
- package/dist/widgets/ChatPreviewWidget/index.d.ts +2 -0
- package/dist/widgets/ChatPreviewWidget/index.js +3 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.cjs +66 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.js +64 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +70 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +10 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +10 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +69 -0
- package/dist/widgets/FloatingChatWidget/constants.cjs +6 -0
- package/dist/widgets/FloatingChatWidget/constants.d.cts +4 -0
- package/dist/widgets/FloatingChatWidget/constants.d.ts +4 -0
- package/dist/widgets/FloatingChatWidget/constants.js +5 -0
- package/dist/widgets/FloatingChatWidget/index.cjs +5 -0
- package/dist/widgets/FloatingChatWidget/index.d.cts +3 -0
- package/dist/widgets/FloatingChatWidget/index.d.ts +3 -0
- package/dist/widgets/FloatingChatWidget/index.js +4 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +60 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +19 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +19 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +58 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/index.cjs +4 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/index.d.cts +2 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/index.d.ts +2 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/index.js +3 -0
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +64 -0
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +14 -0
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +14 -0
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +63 -0
- package/dist/widgets/PromptCarouselWidget/index.cjs +3 -0
- package/dist/widgets/PromptCarouselWidget/index.d.cts +2 -0
- package/dist/widgets/PromptCarouselWidget/index.d.ts +2 -0
- package/dist/widgets/PromptCarouselWidget/index.js +3 -0
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +35 -0
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +14 -0
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +14 -0
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +34 -0
- package/dist/widgets/SocialProofFlowWidget/index.cjs +3 -0
- package/dist/widgets/SocialProofFlowWidget/index.d.cts +2 -0
- package/dist/widgets/SocialProofFlowWidget/index.d.ts +2 -0
- package/dist/widgets/SocialProofFlowWidget/index.js +3 -0
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +118 -0
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +19 -0
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +19 -0
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +116 -0
- package/dist/widgets/SocialProofWidget/index.cjs +4 -0
- package/dist/widgets/SocialProofWidget/index.d.cts +2 -0
- package/dist/widgets/SocialProofWidget/index.d.ts +2 -0
- package/dist/widgets/SocialProofWidget/index.js +3 -0
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +67 -0
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +14 -0
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +14 -0
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +66 -0
- package/dist/widgets/TitledPromptCarouselWidget/index.cjs +3 -0
- package/dist/widgets/TitledPromptCarouselWidget/index.d.cts +2 -0
- package/dist/widgets/TitledPromptCarouselWidget/index.d.ts +2 -0
- package/dist/widgets/TitledPromptCarouselWidget/index.js +3 -0
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +35 -0
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +14 -0
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +14 -0
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +34 -0
- package/dist/widgets/TypingAnimationFlowWidget/index.cjs +3 -0
- package/dist/widgets/TypingAnimationFlowWidget/index.d.cts +2 -0
- package/dist/widgets/TypingAnimationFlowWidget/index.d.ts +2 -0
- package/dist/widgets/TypingAnimationFlowWidget/index.js +3 -0
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +90 -0
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +19 -0
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +19 -0
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +88 -0
- package/dist/widgets/TypingAnimationWidget/index.cjs +4 -0
- package/dist/widgets/TypingAnimationWidget/index.d.cts +2 -0
- package/dist/widgets/TypingAnimationWidget/index.d.ts +2 -0
- package/dist/widgets/TypingAnimationWidget/index.js +3 -0
- package/dist/widgets/dist/SearchResults/SearchResults.d.cts +15 -0
- package/dist/widgets/dist/SearchResults/SearchResults.d.ts +15 -0
- package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +9 -0
- package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.ts +9 -0
- package/dist/widgets/dist/SearchResults/index.d.ts +2 -0
- package/dist/widgets/dist/SearchResults/types.d.cts +20 -0
- package/dist/widgets/dist/SearchResults/types.d.ts +20 -0
- package/dist/widgets/dist/SearchZeroState/SearchZeroState.d.cts +10 -0
- package/dist/widgets/dist/SearchZeroState/SearchZeroState.d.ts +10 -0
- package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +18 -0
- package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts +18 -0
- package/dist/widgets/dist/SearchZeroState/index.d.ts +4 -0
- package/dist/widgets/dist/SearchZeroState/types.d.cts +13 -0
- package/dist/widgets/dist/SearchZeroState/types.d.ts +13 -0
- package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.cts +36 -0
- package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.ts +36 -0
- package/dist/widgets/dist/SuggestionBar/index.d.ts +2 -0
- package/dist/widgets/dist/SuggestionBar/types.d.cts +9 -0
- package/dist/widgets/dist/SuggestionBar/types.d.ts +9 -0
- package/dist/widgets/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.cts +9 -0
- package/dist/widgets/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.ts +9 -0
- package/dist/widgets/dist/SuggestionButtonContainer/types.d.cts +20 -0
- package/dist/widgets/dist/SuggestionButtonContainer/types.d.ts +20 -0
- package/dist/widgets/dist/config/BaseWidgetConfig.d.cts +13 -0
- package/dist/widgets/dist/config/BaseWidgetConfig.d.ts +13 -0
- package/dist/widgets/dist/config/WidgetType.d.cts +23 -0
- package/dist/widgets/dist/config/WidgetType.d.ts +23 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/api/response.d.cts +14 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/api/response.d.ts +14 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/api/search.d.cts +15 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/api/search.d.ts +15 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.cts +73 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.ts +73 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.cts +61 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts +61 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.cts +25 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.ts +25 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.cts +35 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.ts +35 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.cts +32 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.ts +32 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.cts +32 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.ts +32 -0
- package/dist/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.cts +14 -0
- package/dist/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.ts +15 -0
- package/dist/widgets/dist/packages/hooks/dist/contexts/types.d.cts +61 -0
- package/dist/widgets/dist/packages/hooks/dist/contexts/types.d.ts +61 -0
- package/dist/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.cts +60 -0
- package/dist/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.ts +60 -0
- package/dist/widgets/dist/packages/hooks/dist/hooks/utils.d.cts +11 -0
- package/dist/widgets/dist/packages/hooks/dist/hooks/utils.d.ts +11 -0
- package/dist/widgets/dist/packages/hooks/dist/types/search-filter-types.d.cts +28 -0
- package/dist/widgets/dist/packages/hooks/dist/types/search-filter-types.d.ts +28 -0
- package/dist/widgets/dist/packages/hooks/dist/types/test-types.d.cts +10 -0
- package/dist/widgets/dist/packages/hooks/dist/types/test-types.d.ts +10 -0
- package/dist/widgets/hooks/useGetWidgetStatus.cjs +27 -0
- package/dist/widgets/hooks/useGetWidgetStatus.js +26 -0
- package/dist/widgets/utils/functions.cjs +55 -0
- package/dist/widgets/utils/functions.js +48 -0
- package/dist/widgets-v2/SearchResults/index.cjs +5 -0
- package/dist/widgets-v2/SearchResults/index.d.cts +3 -0
- package/dist/widgets-v2/SearchResults/index.d.ts +4 -0
- package/dist/widgets-v2/SearchResults/index.js +3 -0
- package/dist/widgets-v2/SearchZeroState/index.cjs +8 -0
- package/dist/widgets-v2/SearchZeroState/index.d.cts +5 -0
- package/dist/widgets-v2/SearchZeroState/index.d.ts +6 -0
- package/dist/widgets-v2/SearchZeroState/index.js +3 -0
- package/dist/widgets-v2/SuggestionBar/index.cjs +5 -0
- package/dist/widgets-v2/SuggestionBar/index.d.cts +3 -0
- package/dist/widgets-v2/SuggestionBar/index.d.ts +4 -0
- package/dist/widgets-v2/SuggestionBar/index.js +3 -0
- package/dist/widgets-v2/SuggestionButtonContainer/index.cjs +5 -0
- package/dist/widgets-v2/SuggestionButtonContainer/index.d.cts +3 -0
- package/dist/widgets-v2/SuggestionButtonContainer/index.d.ts +3 -0
- package/dist/widgets-v2/SuggestionButtonContainer/index.js +3 -0
- package/package.json +158 -0
- package/src/CXIntegration/hooks/useUnifiedCXButton.ts +38 -0
- package/src/CXIntegration/implementations/useDefaultUnifiedCXButton.ts +8 -0
- package/src/CXIntegration/implementations/useGladlyUnifiedCXButton.ts +28 -0
- package/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.ts +67 -0
- package/src/CXIntegration/implementations/useGrooveUnifiedCXButton.ts +83 -0
- package/src/CXIntegration/implementations/useKustomerUnifiedCXButton.ts +120 -0
- package/src/CXIntegration/implementations/useReDoUnifiedCXButton.ts +80 -0
- package/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.ts +83 -0
- package/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.ts +78 -0
- package/src/CXIntegration/implementations/useTidioUnifiedCXButton.ts +34 -0
- package/src/CXIntegration/implementations/useZendeskUnifiedCXButton.ts +69 -0
- package/src/CXIntegration/implementations/useZowieUnifiedCXButton.ts +34 -0
- package/src/CXIntegration/types.ts +24 -0
- package/src/CXIntegration/utils/functions.ts +50 -0
- package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +689 -0
- package/src/hocs/withBaseWidget/index.ts +2 -0
- package/src/hocs/withBaseWidget/types.ts +39 -0
- package/src/hocs/withBaseWidget/withBaseWidget.tsx +126 -0
- package/src/stories/FloatingChatWidget.stories.tsx +56 -0
- package/src/stories/PromptButtonCarouselWithImageWidget.stories.tsx +54 -0
- package/src/stories/PromptCarouselWidget.stories.tsx +54 -0
- package/src/stories/SalesAgentTest/SalesAgentTest.stories.tsx +18 -0
- package/src/stories/SalesAgentTest/SalesAgentTest.tsx +111 -0
- package/src/stories/SalesAgentTest/index.ts +0 -0
- package/src/stories/SearchResults.stories.tsx +29 -0
- package/src/stories/SearchZeroState.stories.tsx +52 -0
- package/src/stories/SocialProofFlowWidget.stories.tsx +77 -0
- package/src/stories/SuggestionBar.stories.tsx +45 -0
- package/src/stories/TitledPromptCarouselWidget.stories.tsx +71 -0
- package/src/stories/TypingAnimationFlowWidget.stories.tsx +67 -0
- package/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx +152 -0
- package/src/widgets/ChatPreviewComparisonWidget/index.ts +7 -0
- package/src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.tsx +82 -0
- package/src/widgets/ChatPreviewLoadingWidget/index.ts +7 -0
- package/src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx +119 -0
- package/src/widgets/ChatPreviewWidget/index.ts +4 -0
- package/src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx +115 -0
- package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +110 -0
- package/src/widgets/FloatingChatWidget/constants.ts +1 -0
- package/src/widgets/FloatingChatWidget/index.ts +5 -0
- package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +87 -0
- package/src/widgets/PromptButtonCarouselWithImageWidget/index.ts +6 -0
- package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +83 -0
- package/src/widgets/PromptCarouselWidget/index.ts +2 -0
- package/src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.tsx +61 -0
- package/src/widgets/SocialProofFlowWidget/index.ts +4 -0
- package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +160 -0
- package/src/widgets/SocialProofWidget/index.ts +2 -0
- package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +93 -0
- package/src/widgets/TitledPromptCarouselWidget/index.ts +2 -0
- package/src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.tsx +61 -0
- package/src/widgets/TypingAnimationFlowWidget/index.ts +4 -0
- package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +115 -0
- package/src/widgets/TypingAnimationWidget/index.ts +2 -0
- package/src/widgets/hooks/useGetWidgetStatus.tsx +29 -0
- package/src/widgets/utils/functions.ts +104 -0
- package/src/widgets-v2/SearchResults/index.ts +3 -0
- package/src/widgets-v2/SearchZeroState/index.ts +15 -0
- package/src/widgets-v2/SuggestionBar/index.ts +6 -0
- package/src/widgets-v2/SuggestionButtonContainer/index.ts +6 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { SplitWords } from "./splitWords.cjs";
|
|
2
|
+
|
|
3
|
+
//#region ../widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.ts
|
|
4
|
+
|
|
5
|
+
//#region ../hooks/dist/application/models/utilityTypes/camelCase.d.ts
|
|
6
|
+
//#region src/application/models/utilityTypes/camelCase.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* CamelCase options.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link CamelCase}
|
|
11
|
+
*/
|
|
12
|
+
type CamelCaseOptions = {
|
|
13
|
+
/**
|
|
14
|
+
* Whether to preserved consecutive uppercase letter.
|
|
15
|
+
*
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
preserveConsecutiveUppercase?: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Convert an array of words to camel-case.
|
|
22
|
+
*/
|
|
23
|
+
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;
|
|
24
|
+
/**
|
|
25
|
+
* Convert a string literal to camel-case.
|
|
26
|
+
*
|
|
27
|
+
* This can be useful when, for example, converting some kebab-cased command-line flags or a snake-cased database result.
|
|
28
|
+
*
|
|
29
|
+
* By default, consecutive uppercase letter are preserved. See {@link CamelCaseOptions.preserveConsecutiveUppercase preserveConsecutiveUppercase} option to change this behaviour.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```
|
|
33
|
+
* import type {CamelCase} from 'type-fest';
|
|
34
|
+
*
|
|
35
|
+
* // Simple
|
|
36
|
+
*
|
|
37
|
+
* const someVariable: CamelCase<'foo-bar'> = 'fooBar';
|
|
38
|
+
*
|
|
39
|
+
* // Advanced
|
|
40
|
+
*
|
|
41
|
+
* type CamelCasedProperties<T> = {
|
|
42
|
+
* [K in keyof T as CamelCase<K>]: T[K]
|
|
43
|
+
* };
|
|
44
|
+
*
|
|
45
|
+
* interface RawOptions {
|
|
46
|
+
* 'dry-run': boolean;
|
|
47
|
+
* 'full_family_name': string;
|
|
48
|
+
* foo: number;
|
|
49
|
+
* BAR: string;
|
|
50
|
+
* QUZ_QUX: number;
|
|
51
|
+
* 'OTHER-FIELD': boolean;
|
|
52
|
+
* }
|
|
53
|
+
*
|
|
54
|
+
* const dbResult: CamelCasedProperties<RawOptions> = {
|
|
55
|
+
* dryRun: true,
|
|
56
|
+
* fullFamilyName: 'bar.js',
|
|
57
|
+
* foo: 123,
|
|
58
|
+
* bar: 'foo',
|
|
59
|
+
* quzQux: 6,
|
|
60
|
+
* otherField: false
|
|
61
|
+
* };
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @category Change case
|
|
65
|
+
* @category Template literal
|
|
66
|
+
*/
|
|
67
|
+
type CamelCase<Type, Options extends CamelCaseOptions = {
|
|
68
|
+
preserveConsecutiveUppercase: true;
|
|
69
|
+
}> = Type extends string ? string extends Type ? Type : Uncapitalize<CamelCaseFromArray<SplitWords<Type extends Uppercase<Type> ? Lowercase<Type> : Type>, Options>> : Type;
|
|
70
|
+
//#endregion
|
|
71
|
+
//#endregion
|
|
72
|
+
//#endregion
|
|
73
|
+
export { CamelCase, CamelCaseOptions };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { SplitWords } from "./splitWords.js";
|
|
2
|
+
|
|
3
|
+
//#region ../widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.ts
|
|
4
|
+
|
|
5
|
+
//#region ../hooks/dist/application/models/utilityTypes/camelCase.d.ts
|
|
6
|
+
//#region src/application/models/utilityTypes/camelCase.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* CamelCase options.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link CamelCase}
|
|
11
|
+
*/
|
|
12
|
+
type CamelCaseOptions = {
|
|
13
|
+
/**
|
|
14
|
+
* Whether to preserved consecutive uppercase letter.
|
|
15
|
+
*
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
preserveConsecutiveUppercase?: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Convert an array of words to camel-case.
|
|
22
|
+
*/
|
|
23
|
+
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;
|
|
24
|
+
/**
|
|
25
|
+
* Convert a string literal to camel-case.
|
|
26
|
+
*
|
|
27
|
+
* This can be useful when, for example, converting some kebab-cased command-line flags or a snake-cased database result.
|
|
28
|
+
*
|
|
29
|
+
* By default, consecutive uppercase letter are preserved. See {@link CamelCaseOptions.preserveConsecutiveUppercase preserveConsecutiveUppercase} option to change this behaviour.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```
|
|
33
|
+
* import type {CamelCase} from 'type-fest';
|
|
34
|
+
*
|
|
35
|
+
* // Simple
|
|
36
|
+
*
|
|
37
|
+
* const someVariable: CamelCase<'foo-bar'> = 'fooBar';
|
|
38
|
+
*
|
|
39
|
+
* // Advanced
|
|
40
|
+
*
|
|
41
|
+
* type CamelCasedProperties<T> = {
|
|
42
|
+
* [K in keyof T as CamelCase<K>]: T[K]
|
|
43
|
+
* };
|
|
44
|
+
*
|
|
45
|
+
* interface RawOptions {
|
|
46
|
+
* 'dry-run': boolean;
|
|
47
|
+
* 'full_family_name': string;
|
|
48
|
+
* foo: number;
|
|
49
|
+
* BAR: string;
|
|
50
|
+
* QUZ_QUX: number;
|
|
51
|
+
* 'OTHER-FIELD': boolean;
|
|
52
|
+
* }
|
|
53
|
+
*
|
|
54
|
+
* const dbResult: CamelCasedProperties<RawOptions> = {
|
|
55
|
+
* dryRun: true,
|
|
56
|
+
* fullFamilyName: 'bar.js',
|
|
57
|
+
* foo: 123,
|
|
58
|
+
* bar: 'foo',
|
|
59
|
+
* quzQux: 6,
|
|
60
|
+
* otherField: false
|
|
61
|
+
* };
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @category Change case
|
|
65
|
+
* @category Template literal
|
|
66
|
+
*/
|
|
67
|
+
type CamelCase<Type, Options extends CamelCaseOptions = {
|
|
68
|
+
preserveConsecutiveUppercase: true;
|
|
69
|
+
}> = Type extends string ? string extends Type ? Type : Uncapitalize<CamelCaseFromArray<SplitWords<Type extends Uppercase<Type> ? Lowercase<Type> : Type>, Options>> : Type;
|
|
70
|
+
//#endregion
|
|
71
|
+
//#endregion
|
|
72
|
+
//#endregion
|
|
73
|
+
export { CamelCase, CamelCaseOptions };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { CamelCase, CamelCaseOptions } from "./camelCase.cjs";
|
|
2
|
+
import { UnknownArray } from "./unknownArray.cjs";
|
|
3
|
+
|
|
4
|
+
//#region ../widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts
|
|
5
|
+
|
|
6
|
+
//#region ../hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts
|
|
7
|
+
//#region src/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Convert object properties to camel case recursively.
|
|
10
|
+
*
|
|
11
|
+
* This can be useful when, for example, converting some API types from a different style.
|
|
12
|
+
*
|
|
13
|
+
* @see CamelCasedProperties
|
|
14
|
+
* @see CamelCase
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```
|
|
18
|
+
* import type {CamelCasedPropertiesDeep} from 'type-fest';
|
|
19
|
+
*
|
|
20
|
+
* interface User {
|
|
21
|
+
* UserId: number;
|
|
22
|
+
* UserName: string;
|
|
23
|
+
* }
|
|
24
|
+
*
|
|
25
|
+
* interface UserWithFriends {
|
|
26
|
+
* UserInfo: User;
|
|
27
|
+
* UserFriends: User[];
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* const result: CamelCasedPropertiesDeep<UserWithFriends> = {
|
|
31
|
+
* userInfo: {
|
|
32
|
+
* userId: 1,
|
|
33
|
+
* userName: 'Tom',
|
|
34
|
+
* },
|
|
35
|
+
* userFriends: [
|
|
36
|
+
* {
|
|
37
|
+
* userId: 2,
|
|
38
|
+
* userName: 'Jerry',
|
|
39
|
+
* },
|
|
40
|
+
* {
|
|
41
|
+
* userId: 3,
|
|
42
|
+
* userName: 'Spike',
|
|
43
|
+
* },
|
|
44
|
+
* ],
|
|
45
|
+
* };
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @category Change case
|
|
49
|
+
* @category Template literal
|
|
50
|
+
* @category Object
|
|
51
|
+
*/
|
|
52
|
+
type CamelCasedPropertiesDeep<Value, Options extends CamelCaseOptions = {
|
|
53
|
+
preserveConsecutiveUppercase: true;
|
|
54
|
+
}> = 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> };
|
|
55
|
+
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;
|
|
56
|
+
//#endregion
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
export { CamelCasedPropertiesDeep };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { CamelCase, CamelCaseOptions } from "./camelCase.js";
|
|
2
|
+
import { UnknownArray } from "./unknownArray.js";
|
|
3
|
+
|
|
4
|
+
//#region ../widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts
|
|
5
|
+
|
|
6
|
+
//#region ../hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts
|
|
7
|
+
//#region src/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Convert object properties to camel case recursively.
|
|
10
|
+
*
|
|
11
|
+
* This can be useful when, for example, converting some API types from a different style.
|
|
12
|
+
*
|
|
13
|
+
* @see CamelCasedProperties
|
|
14
|
+
* @see CamelCase
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```
|
|
18
|
+
* import type {CamelCasedPropertiesDeep} from 'type-fest';
|
|
19
|
+
*
|
|
20
|
+
* interface User {
|
|
21
|
+
* UserId: number;
|
|
22
|
+
* UserName: string;
|
|
23
|
+
* }
|
|
24
|
+
*
|
|
25
|
+
* interface UserWithFriends {
|
|
26
|
+
* UserInfo: User;
|
|
27
|
+
* UserFriends: User[];
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* const result: CamelCasedPropertiesDeep<UserWithFriends> = {
|
|
31
|
+
* userInfo: {
|
|
32
|
+
* userId: 1,
|
|
33
|
+
* userName: 'Tom',
|
|
34
|
+
* },
|
|
35
|
+
* userFriends: [
|
|
36
|
+
* {
|
|
37
|
+
* userId: 2,
|
|
38
|
+
* userName: 'Jerry',
|
|
39
|
+
* },
|
|
40
|
+
* {
|
|
41
|
+
* userId: 3,
|
|
42
|
+
* userName: 'Spike',
|
|
43
|
+
* },
|
|
44
|
+
* ],
|
|
45
|
+
* };
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @category Change case
|
|
49
|
+
* @category Template literal
|
|
50
|
+
* @category Object
|
|
51
|
+
*/
|
|
52
|
+
type CamelCasedPropertiesDeep<Value, Options extends CamelCaseOptions = {
|
|
53
|
+
preserveConsecutiveUppercase: true;
|
|
54
|
+
}> = 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> };
|
|
55
|
+
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;
|
|
56
|
+
//#endregion
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
export { CamelCasedPropertiesDeep };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Trim } from "./trim.cjs";
|
|
2
|
+
|
|
3
|
+
//#region ../widgets/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.ts
|
|
4
|
+
|
|
5
|
+
//#region ../hooks/dist/application/models/utilityTypes/internal.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Returns a boolean for whether the string is numeric.
|
|
8
|
+
*
|
|
9
|
+
* This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/microsoft/TypeScript/issues/46109#issuecomment-930307987).
|
|
10
|
+
*/
|
|
11
|
+
type IsNumeric<T extends string> = T extends `${number}` ? Trim<T> extends T ? true : false : false;
|
|
12
|
+
/**
|
|
13
|
+
* Returns a boolean for whether the string is lowercased.
|
|
14
|
+
*/
|
|
15
|
+
type IsLowerCase<T extends string> = T extends Lowercase<T> ? true : false;
|
|
16
|
+
/**
|
|
17
|
+
* Returns a boolean for whether the string is upper-cased.
|
|
18
|
+
*/
|
|
19
|
+
type IsUpperCase<T extends string> = T extends Uppercase<T> ? true : false;
|
|
20
|
+
type WordSeparators = '-' | '_' | Whitespace;
|
|
21
|
+
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}';
|
|
22
|
+
//#endregion
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { IsLowerCase, IsNumeric, IsUpperCase, Whitespace, WordSeparators };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Trim } from "./trim.js";
|
|
2
|
+
|
|
3
|
+
//#region ../widgets/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.ts
|
|
4
|
+
|
|
5
|
+
//#region ../hooks/dist/application/models/utilityTypes/internal.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Returns a boolean for whether the string is numeric.
|
|
8
|
+
*
|
|
9
|
+
* This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/microsoft/TypeScript/issues/46109#issuecomment-930307987).
|
|
10
|
+
*/
|
|
11
|
+
type IsNumeric<T extends string> = T extends `${number}` ? Trim<T> extends T ? true : false : false;
|
|
12
|
+
/**
|
|
13
|
+
* Returns a boolean for whether the string is lowercased.
|
|
14
|
+
*/
|
|
15
|
+
type IsLowerCase<T extends string> = T extends Lowercase<T> ? true : false;
|
|
16
|
+
/**
|
|
17
|
+
* Returns a boolean for whether the string is upper-cased.
|
|
18
|
+
*/
|
|
19
|
+
type IsUpperCase<T extends string> = T extends Uppercase<T> ? true : false;
|
|
20
|
+
type WordSeparators = '-' | '_' | Whitespace;
|
|
21
|
+
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}';
|
|
22
|
+
//#endregion
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { IsLowerCase, IsNumeric, IsUpperCase, Whitespace, WordSeparators };
|
package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.cts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IsLowerCase, IsNumeric, IsUpperCase, WordSeparators } from "./internal.cjs";
|
|
2
|
+
|
|
3
|
+
//#region ../widgets/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.ts
|
|
4
|
+
|
|
5
|
+
//#region ../hooks/dist/application/models/utilityTypes/splitWords.d.ts
|
|
6
|
+
//#region src/application/models/utilityTypes/splitWords.d.ts
|
|
7
|
+
type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
|
|
8
|
+
type RemoveLastCharacter<Sentence extends string, Character extends string> = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
|
|
9
|
+
/**
|
|
10
|
+
* Split a string (almost) like Lodash's `_.words()` function.
|
|
11
|
+
*
|
|
12
|
+
* - Split on each word that begins with a capital letter.
|
|
13
|
+
* - Split on each {@link WordSeparators}.
|
|
14
|
+
* - Split on numeric sequence.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```
|
|
18
|
+
* type Words0 = SplitWords<'helloWorld'>; // ['hello', 'World']
|
|
19
|
+
* type Words1 = SplitWords<'helloWORLD'>; // ['hello', 'WORLD']
|
|
20
|
+
* type Words2 = SplitWords<'hello-world'>; // ['hello', 'world']
|
|
21
|
+
* type Words3 = SplitWords<'--hello the_world'>; // ['hello', 'the', 'world']
|
|
22
|
+
* type Words4 = SplitWords<'lifeIs42'>; // ['life', 'Is', '42']
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
* @category Change case
|
|
27
|
+
* @category Template literal
|
|
28
|
+
*/
|
|
29
|
+
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>];
|
|
30
|
+
//#endregion
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { SplitWords };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IsLowerCase, IsNumeric, IsUpperCase, WordSeparators } from "./internal.js";
|
|
2
|
+
|
|
3
|
+
//#region ../widgets/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.ts
|
|
4
|
+
|
|
5
|
+
//#region ../hooks/dist/application/models/utilityTypes/splitWords.d.ts
|
|
6
|
+
//#region src/application/models/utilityTypes/splitWords.d.ts
|
|
7
|
+
type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
|
|
8
|
+
type RemoveLastCharacter<Sentence extends string, Character extends string> = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
|
|
9
|
+
/**
|
|
10
|
+
* Split a string (almost) like Lodash's `_.words()` function.
|
|
11
|
+
*
|
|
12
|
+
* - Split on each word that begins with a capital letter.
|
|
13
|
+
* - Split on each {@link WordSeparators}.
|
|
14
|
+
* - Split on numeric sequence.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```
|
|
18
|
+
* type Words0 = SplitWords<'helloWorld'>; // ['hello', 'World']
|
|
19
|
+
* type Words1 = SplitWords<'helloWORLD'>; // ['hello', 'WORLD']
|
|
20
|
+
* type Words2 = SplitWords<'hello-world'>; // ['hello', 'world']
|
|
21
|
+
* type Words3 = SplitWords<'--hello the_world'>; // ['hello', 'the', 'world']
|
|
22
|
+
* type Words4 = SplitWords<'lifeIs42'>; // ['life', 'Is', '42']
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
* @category Change case
|
|
27
|
+
* @category Template literal
|
|
28
|
+
*/
|
|
29
|
+
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>];
|
|
30
|
+
//#endregion
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { SplitWords };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Whitespace } from "./internal.cjs";
|
|
2
|
+
|
|
3
|
+
//#region ../widgets/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.ts
|
|
4
|
+
|
|
5
|
+
//#region ../hooks/dist/application/models/utilityTypes/trim.d.ts
|
|
6
|
+
//#region src/application/models/utilityTypes/trim.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Remove spaces from the left side.
|
|
9
|
+
*/
|
|
10
|
+
type TrimLeft<V extends string> = V extends `${Whitespace}${infer R}` ? TrimLeft<R> : V;
|
|
11
|
+
/**
|
|
12
|
+
* Remove spaces from the right side.
|
|
13
|
+
*/
|
|
14
|
+
type TrimRight<V extends string> = V extends `${infer R}${Whitespace}` ? TrimRight<R> : V;
|
|
15
|
+
/**
|
|
16
|
+
* Remove leading and trailing spaces from a string.
|
|
17
|
+
* @example
|
|
18
|
+
* ```
|
|
19
|
+
* import type {Trim} from 'type-fest';
|
|
20
|
+
*
|
|
21
|
+
* Trim<' foo '>
|
|
22
|
+
* //=> 'foo'
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category String
|
|
26
|
+
* @category Template literal
|
|
27
|
+
*/
|
|
28
|
+
type Trim<V extends string> = TrimLeft<TrimRight<V>>;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#endregion
|
|
31
|
+
//#endregion
|
|
32
|
+
export { Trim };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Whitespace } from "./internal.js";
|
|
2
|
+
|
|
3
|
+
//#region ../widgets/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.ts
|
|
4
|
+
|
|
5
|
+
//#region ../hooks/dist/application/models/utilityTypes/trim.d.ts
|
|
6
|
+
//#region src/application/models/utilityTypes/trim.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Remove spaces from the left side.
|
|
9
|
+
*/
|
|
10
|
+
type TrimLeft<V extends string> = V extends `${Whitespace}${infer R}` ? TrimLeft<R> : V;
|
|
11
|
+
/**
|
|
12
|
+
* Remove spaces from the right side.
|
|
13
|
+
*/
|
|
14
|
+
type TrimRight<V extends string> = V extends `${infer R}${Whitespace}` ? TrimRight<R> : V;
|
|
15
|
+
/**
|
|
16
|
+
* Remove leading and trailing spaces from a string.
|
|
17
|
+
* @example
|
|
18
|
+
* ```
|
|
19
|
+
* import type {Trim} from 'type-fest';
|
|
20
|
+
*
|
|
21
|
+
* Trim<' foo '>
|
|
22
|
+
* //=> 'foo'
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category String
|
|
26
|
+
* @category Template literal
|
|
27
|
+
*/
|
|
28
|
+
type Trim<V extends string> = TrimLeft<TrimRight<V>>;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#endregion
|
|
31
|
+
//#endregion
|
|
32
|
+
export { Trim };
|
package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.cts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region ../widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.ts
|
|
2
|
+
//#region ../hooks/dist/application/models/utilityTypes/unknownArray.d.ts
|
|
3
|
+
//#region src/application/models/utilityTypes/unknownArray.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Represents an array with `unknown` value.
|
|
6
|
+
*
|
|
7
|
+
* Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```
|
|
11
|
+
* import type {UnknownArray} from 'type-fest';
|
|
12
|
+
*
|
|
13
|
+
* type IsArray<T> = T extends UnknownArray ? true : false;
|
|
14
|
+
*
|
|
15
|
+
* type A = IsArray<['foo']>;
|
|
16
|
+
* //=> true
|
|
17
|
+
*
|
|
18
|
+
* type B = IsArray<readonly number[]>;
|
|
19
|
+
* //=> true
|
|
20
|
+
*
|
|
21
|
+
* type C = IsArray<string>;
|
|
22
|
+
* //=> false
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Type
|
|
26
|
+
* @category Array
|
|
27
|
+
*/
|
|
28
|
+
type UnknownArray = readonly unknown[];
|
|
29
|
+
//#endregion
|
|
30
|
+
//#endregion
|
|
31
|
+
//#endregion
|
|
32
|
+
export { UnknownArray };
|
package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region ../widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.ts
|
|
2
|
+
//#region ../hooks/dist/application/models/utilityTypes/unknownArray.d.ts
|
|
3
|
+
//#region src/application/models/utilityTypes/unknownArray.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Represents an array with `unknown` value.
|
|
6
|
+
*
|
|
7
|
+
* Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```
|
|
11
|
+
* import type {UnknownArray} from 'type-fest';
|
|
12
|
+
*
|
|
13
|
+
* type IsArray<T> = T extends UnknownArray ? true : false;
|
|
14
|
+
*
|
|
15
|
+
* type A = IsArray<['foo']>;
|
|
16
|
+
* //=> true
|
|
17
|
+
*
|
|
18
|
+
* type B = IsArray<readonly number[]>;
|
|
19
|
+
* //=> true
|
|
20
|
+
*
|
|
21
|
+
* type C = IsArray<string>;
|
|
22
|
+
* //=> false
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Type
|
|
26
|
+
* @category Array
|
|
27
|
+
*/
|
|
28
|
+
type UnknownArray = readonly unknown[];
|
|
29
|
+
//#endregion
|
|
30
|
+
//#endregion
|
|
31
|
+
//#endregion
|
|
32
|
+
export { UnknownArray };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region ../widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.ts
|
|
2
|
+
|
|
3
|
+
//#region ../hooks/dist/atoms/search/searchAPI.d.ts
|
|
4
|
+
|
|
5
|
+
//#region src/atoms/search/searchAPI.d.ts
|
|
6
|
+
type SelectedFilterOption = {
|
|
7
|
+
id: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
filterId: string;
|
|
10
|
+
filterItemId: string;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
//#endregion
|
|
14
|
+
export { SelectedFilterOption };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "jotai";
|
|
2
|
+
|
|
3
|
+
//#region ../widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.ts
|
|
4
|
+
|
|
5
|
+
//#region ../hooks/dist/atoms/search/searchAPI.d.ts
|
|
6
|
+
//#region src/atoms/search/searchAPI.d.ts
|
|
7
|
+
type SelectedFilterOption = {
|
|
8
|
+
id: string;
|
|
9
|
+
displayName: string;
|
|
10
|
+
filterId: string;
|
|
11
|
+
filterItemId: string;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
//#endregion
|
|
15
|
+
export { SelectedFilterOption };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//#region ../widgets/dist/packages/hooks/dist/contexts/types.d.ts
|
|
2
|
+
|
|
3
|
+
type ProductCardVariant = 'filled' | 'bordered' | 'minimal' | 'transparentBordered';
|
|
4
|
+
type ProductCardHoverVariant = 'backgroundDark' | 'none';
|
|
5
|
+
type ProductCardLayoutVariant = 'normal' | 'tall' | 'square';
|
|
6
|
+
interface ProductCardConfig {
|
|
7
|
+
variant: ProductCardVariant;
|
|
8
|
+
hoverVariant: ProductCardHoverVariant;
|
|
9
|
+
layoutVariant: ProductCardLayoutVariant;
|
|
10
|
+
pricePrefix?: string;
|
|
11
|
+
}
|
|
12
|
+
type SuggestionButtonVariant = 'outlined' | 'outlinedLight' | 'primary' | 'secondary' | 'tertiary' | 'dark' | 'darkAccent' | 'darkPrimary' | 'secondaryDark' | 'secondaryAccent' | 'transparent' | 'transparentDark' | 'lightDark';
|
|
13
|
+
interface SuggestionButtonConfig {
|
|
14
|
+
variant?: SuggestionButtonVariant;
|
|
15
|
+
hoverVariant?: SuggestionButtonVariant;
|
|
16
|
+
answerVariant?: SuggestionButtonVariant;
|
|
17
|
+
borderRadius?: 'sm' | 'md' | 'lg';
|
|
18
|
+
}
|
|
19
|
+
type SearchZeroStateVariant = 'backgroundTertiary' | 'backgroundDark' | 'backgroundPrimary';
|
|
20
|
+
type SearchZeroStateLayout = 'input' | 'icon';
|
|
21
|
+
type SearchInputVariant = 'standard';
|
|
22
|
+
type SearchIconVariant = 'thin' | 'bold';
|
|
23
|
+
declare enum WidgetType {
|
|
24
|
+
ChatPreview = "ChatPreview",
|
|
25
|
+
SocialProofV2 = "SocialProofV2",
|
|
26
|
+
ChatPreviewV2 = "ChatPreviewV2",
|
|
27
|
+
ChatPreviewIsLoading = "ChatPreviewIsLoading",
|
|
28
|
+
ChatPreviewPostInteraction = "ChatPreviewPostInteraction",
|
|
29
|
+
ChatPreviewProductComparison = "ChatPreviewProductComparison",
|
|
30
|
+
SuggestionBar = "SuggestionBar",
|
|
31
|
+
SuggestionBarV2 = "SuggestionBarV2",
|
|
32
|
+
ImagePromptCard = "ImagePromptCard",
|
|
33
|
+
ImageBanner = "ImageBanner",
|
|
34
|
+
SingleImagePrompt = "SingleImagePrompt",
|
|
35
|
+
SearchPrompt = "SearchPrompt",
|
|
36
|
+
SearchZeroStateEntryPoint = "SearchZeroStateEntryPoint",
|
|
37
|
+
SearchResultsEntryPoint = "SearchResultsEntryPoint",
|
|
38
|
+
SearchOverlayHost = "SearchOverlayHost",
|
|
39
|
+
NoOp = "NoOp",
|
|
40
|
+
}
|
|
41
|
+
interface BaseWidgetConfig<T extends WidgetType> {
|
|
42
|
+
widgetConfigId: string;
|
|
43
|
+
type: T;
|
|
44
|
+
contentId?: string;
|
|
45
|
+
}
|
|
46
|
+
interface SearchEntryPointWidgetConfig extends BaseWidgetConfig<WidgetType.SearchZeroStateEntryPoint> {
|
|
47
|
+
searchZeroStateVariant: SearchZeroStateVariant;
|
|
48
|
+
searchInputVariant: SearchInputVariant;
|
|
49
|
+
searchIconVariant?: SearchIconVariant;
|
|
50
|
+
searchIconSize?: number;
|
|
51
|
+
suggestionButtonConfig: SuggestionButtonConfig;
|
|
52
|
+
layout: SearchZeroStateLayout;
|
|
53
|
+
searchBoxPlaceholder: string;
|
|
54
|
+
animationSpeed?: 'standard' | 'slow' | 'none';
|
|
55
|
+
compactLabel?: string;
|
|
56
|
+
initialSuggestions?: string[];
|
|
57
|
+
usingPortal?: boolean;
|
|
58
|
+
includeSubtitle?: boolean;
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { type ProductCardConfig, type SearchEntryPointWidgetConfig, SearchInputVariant, type SuggestionButtonVariant };
|