@envive-ai/react-hooks 0.1.0
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/LICENSE +2 -0
- package/README.md +2 -0
- package/dist/GridInsertionService-CEYo9pGj.js +22 -0
- package/dist/GridInsertionService-CS_bnPh0.cjs +28 -0
- package/dist/bandolier-Ble8jEa8.js +1221 -0
- package/dist/bandolier-Bm2xAt_j.cjs +1221 -0
- package/dist/carpe-Da7b-LCW.cjs +599 -0
- package/dist/carpe-W13mhRRP.js +597 -0
- package/dist/cdnService-CZ-aXcY6.cjs +23 -0
- package/dist/cdnService-zQfKk3Eb.js +18 -0
- package/dist/chatElementDisplayLocation-CX8fuNao.d.cts +239 -0
- package/dist/chatElementDisplayLocation-CwptS9tx.d.ts +239 -0
- package/dist/chunk-CUT6urMc.cjs +30 -0
- package/dist/contexts/index.cjs +13 -0
- package/dist/contexts/index.d.cts +65 -0
- package/dist/contexts/index.d.ts +66 -0
- package/dist/contexts/index.js +7 -0
- package/dist/contexts-BRjfVq_k.js +5064 -0
- package/dist/contexts-BYArqZtK.cjs +5164 -0
- package/dist/coterie-3y0D9ko4.cjs +229 -0
- package/dist/coterie-DOWcJAYv.js +229 -0
- package/dist/custservice-types-CFIFwZ-r.js +10 -0
- package/dist/custservice-types-CkfxZiHY.cjs +16 -0
- package/dist/default-C2fEZKXk.js +175 -0
- package/dist/default-CBUq6Q6G.cjs +4 -0
- package/dist/default-CGIFZK6m.js +4 -0
- package/dist/default-D_KPZdPJ.cjs +198 -0
- package/dist/divIds-Bss-btao.js +49 -0
- package/dist/divIds-DnZNd7rA.cjs +223 -0
- package/dist/dreamlandBaby-DCIsuU9R.cjs +338 -0
- package/dist/dreamlandBaby-DvSaZGrz.js +338 -0
- package/dist/entrypoints-D_JUvkgy.cjs +18 -0
- package/dist/entrypoints-YLQsbBRD.js +6 -0
- package/dist/enviveConfigContext-CUGLpPGU.js +34 -0
- package/dist/enviveConfigContext-Dfr2VH6u.cjs +48 -0
- package/dist/fiveCbd-B1SESMCO.js +605 -0
- package/dist/fiveCbd-CkOlVby_.cjs +605 -0
- package/dist/forLoveAndLemons-CfYPMnKS.cjs +660 -0
- package/dist/forLoveAndLemons-DmwYZIk0.js +658 -0
- package/dist/greenpan-Bsl3ir59.cjs +389 -0
- package/dist/greenpan-BtOi45lf.js +389 -0
- package/dist/grooveLife-6_dtYsRk.js +334 -0
- package/dist/grooveLife-Cmm1PSCL.cjs +334 -0
- package/dist/homegrownCannabis-C-kw-74X.js +400 -0
- package/dist/homegrownCannabis-CO0uY_mp.cjs +400 -0
- package/dist/hooks/index.cjs +16 -0
- package/dist/hooks/index.d.cts +357 -0
- package/dist/hooks/index.d.ts +357 -0
- package/dist/hooks/index.js +7 -0
- package/dist/jackArcher-CLVmwwpI.js +719 -0
- package/dist/jackArcher-DdYTIzAV.cjs +719 -0
- package/dist/jordanCraig-Am-Oor-O.js +1778 -0
- package/dist/jordanCraig-_u3-w4Hp.cjs +1778 -0
- package/dist/kindredBravely-CWovIDSc.cjs +482 -0
- package/dist/kindredBravely-eWp-ud_E.js +482 -0
- package/dist/kutFromTheKloth-BMV4BuGQ.js +361 -0
- package/dist/kutFromTheKloth-Q589bAOC.cjs +361 -0
- package/dist/larryAndSerges-BMUlTgI-.js +252 -0
- package/dist/larryAndSerges-CEau764j.cjs +252 -0
- package/dist/leapsAndRebounds-DGMzPO7T.js +352 -0
- package/dist/leapsAndRebounds-DHAtRTJD.cjs +352 -0
- package/dist/logger-Dln20ans.cjs +25 -0
- package/dist/logger-pdEEY8T2.js +19 -0
- package/dist/longevityrx-CZW8Hxzi.cjs +312 -0
- package/dist/longevityrx-jH2JLhNH.js +312 -0
- package/dist/lookOptic-BGXP5P_V.js +274 -0
- package/dist/lookOptic-CA6RwLbG.cjs +274 -0
- package/dist/mantraBrand-Cm9_PBCT.js +742 -0
- package/dist/mantraBrand-DByNqpnL.cjs +742 -0
- package/dist/medterra-B0wxj_PV.js +575 -0
- package/dist/medterra-DnPN2ksU.cjs +575 -0
- package/dist/modells-Bmz8Ag5M.js +476 -0
- package/dist/modells-CoYgkLSp.cjs +476 -0
- package/dist/models-DHdb7QWn.js +51 -0
- package/dist/models-ixxUsGL_.cjs +69 -0
- package/dist/pressedFloral-DSKs_oVG.js +653 -0
- package/dist/pressedFloral-DjBiSoUl.cjs +653 -0
- package/dist/skinPerfection-B_3xzVNS.cjs +326 -0
- package/dist/skinPerfection-IDrBuAPt.js +326 -0
- package/dist/snapSupplements-BJk5T5ba.js +277 -0
- package/dist/snapSupplements-BStTsdOZ.cjs +277 -0
- package/dist/socialProofClasses-Bhv2Vulz.js +9 -0
- package/dist/socialProofClasses-CrQBWdSA.cjs +39 -0
- package/dist/spanx-BYg0LE7R.js +653 -0
- package/dist/spanx-LwU1zSzq.cjs +655 -0
- package/dist/spanxStaging-CfSmuKYB.js +837 -0
- package/dist/spanxStaging-OZLV9qix.cjs +840 -0
- package/dist/suggestionBarV2-types-BllzwsBD.js +34 -0
- package/dist/suggestionBarV2-types-CaovchMP.cjs +46 -0
- package/dist/supergoop-BqPXDnKk.cjs +327 -0
- package/dist/supergoop-CIlrHND_.js +325 -0
- package/dist/types-C4T5UOIW.cjs +230 -0
- package/dist/types-CYNvLeSA.js +176 -0
- package/dist/uniqueVintage-B30mOqbH.cjs +1205 -0
- package/dist/uniqueVintage-CFueJOhO.js +1203 -0
- package/dist/venaCbd-DHGZy49P.cjs +357 -0
- package/dist/venaCbd-T0CqVD4k.js +357 -0
- package/dist/westonJonBoucher-BdMzs_Yg.cjs +414 -0
- package/dist/westonJonBoucher-b4TCQ4ev.js +414 -0
- package/dist/wineEnthusiast-BLGlOjgr.cjs +932 -0
- package/dist/wineEnthusiast-BqR0i_54.js +932 -0
- package/dist/wolfMattress-CyyO-LoC.js +362 -0
- package/dist/wolfMattress-DNGZOivg.cjs +362 -0
- package/dist/wolfTactical-3Mm2fvVF.js +341 -0
- package/dist/wolfTactical-BmXYlFjr.cjs +341 -0
- package/package.json +66 -0
- package/src/adapters/amplitude/amplitudeAdapter.ts +454 -0
- package/src/adapters/amplitude/index.ts +2 -0
- package/src/adapters/amplitude/stubAmplitudeAdapter.ts +34 -0
- package/src/adapters/spiffy/commerce/api.ts +596 -0
- package/src/adapters/spiffy/commerce/exceptions/sessionExceptions.ts +6 -0
- package/src/adapters/spiffy/commerce/exceptions/unsupportedProductExceptions.ts +6 -0
- package/src/adapters/spiffy/commerce/graphql.ts +184 -0
- package/src/application/config/generalStaticConfig.ts +37 -0
- package/src/application/logging/logger.ts +29 -0
- package/src/application/models/api/context.ts +4 -0
- package/src/application/models/api/generationParams.ts +4 -0
- package/src/application/models/api/nextMessageRequest.ts +11 -0
- package/src/application/models/api/orgAnalyticsConfig.ts +19 -0
- package/src/application/models/api/orgConfigResults.ts +40 -0
- package/src/application/models/api/organizationConfig.ts +12 -0
- package/src/application/models/api/response.ts +132 -0
- package/src/application/models/api/responseGenerics.ts +67 -0
- package/src/application/models/api/search.ts +26 -0
- package/src/application/models/api/suggestion.ts +4 -0
- package/src/application/models/api/supportedEventRequest.ts +8 -0
- package/src/application/models/api/userEvent.ts +101 -0
- package/src/application/models/cachedValue.ts +8 -0
- package/src/application/models/chatElementDisplayLocation.ts +22 -0
- package/src/application/models/clientDetails.ts +18 -0
- package/src/application/models/colorsConfig.ts +28 -0
- package/src/application/models/conversationalSearchIds.ts +5 -0
- package/src/application/models/dataLayer.ts +45 -0
- package/src/application/models/domMutationContinuation.ts +7 -0
- package/src/application/models/domObservationStrategy.ts +9 -0
- package/src/application/models/events.ts +5 -0
- package/src/application/models/featureGates.ts +23 -0
- package/src/application/models/frontendConfig.ts +14 -0
- package/src/application/models/googleAnalyticsEvents.ts +8 -0
- package/src/application/models/graphql/index.ts +2 -0
- package/src/application/models/graphql/queries/getMerchantColorsQuery.ts +37 -0
- package/src/application/models/graphql/queries/getMerchantFrontendConfigQuery.ts +103 -0
- package/src/application/models/graphql/queries/getMerchantOrgIdQuery.ts +11 -0
- package/src/application/models/guards/api/index.ts +12 -0
- package/src/application/models/guards/api/isApiFormResponse.ts +90 -0
- package/src/application/models/guards/api/isApiFormSubmittedResponseAttributes.ts +37 -0
- package/src/application/models/guards/api/isApiOrderResponseAttributes.ts +155 -0
- package/src/application/models/guards/api/isApiOrgConfigResults.ts +277 -0
- package/src/application/models/guards/api/isApiOrganizationConfig.ts +207 -0
- package/src/application/models/guards/api/isApiPDPEventAttributes.ts +21 -0
- package/src/application/models/guards/api/isApiPLPEventAttributes.ts +41 -0
- package/src/application/models/guards/api/isApiPageResponseAttributes.ts +21 -0
- package/src/application/models/guards/api/isApiProductResponseAttributes.ts +85 -0
- package/src/application/models/guards/api/isApiProductSearchAttributes.ts +23 -0
- package/src/application/models/guards/api/isApiProductSearchFilterAttributes.ts +15 -0
- package/src/application/models/guards/api/isApiQueryTypedEventAttributes.ts +4 -0
- package/src/application/models/guards/api/isApiResponse.ts +39 -0
- package/src/application/models/guards/api/isApiReviewResponseAttributes.ts +30 -0
- package/src/application/models/guards/api/isApiReviewRichInformation.ts +37 -0
- package/src/application/models/guards/api/isApiSearchEventAttributes.ts +28 -0
- package/src/application/models/guards/api/isApiSuggestion.ts +36 -0
- package/src/application/models/guards/api/isApiSuggestionClickedEventAttributes.ts +9 -0
- package/src/application/models/guards/api/isApiTextResponseAttributes.ts +9 -0
- package/src/application/models/guards/api/isApiUserEvent.ts +25 -0
- package/src/application/models/guards/graphQL/isGraphQLColorsConfig.ts +50 -0
- package/src/application/models/guards/isBaseEcommerceEvent.ts +17 -0
- package/src/application/models/guards/isGA4EcommerceEvent.ts +17 -0
- package/src/application/models/guards/isLegacyUAEcommerceEvent.ts +17 -0
- package/src/application/models/guards/isMobilePLPChatPlacementParameter.ts +11 -0
- package/src/application/models/guards/isSpanxTakeAQuizCtaParameter.ts +4 -0
- package/src/application/models/guards/isVariantInfo.ts +37 -0
- package/src/application/models/guards/utils.ts +43 -0
- package/src/application/models/index.ts +20 -0
- package/src/application/models/localStorageEventListener.ts +4 -0
- package/src/application/models/message.ts +146 -0
- package/src/application/models/mobilePLPChatPlacementParameter.ts +3 -0
- package/src/application/models/orgsEnum.ts +36 -0
- package/src/application/models/productExperiment.ts +5 -0
- package/src/application/models/spanxTakeAQuizCtaParameter.ts +4 -0
- package/src/application/models/spiffyWidgets.ts +16 -0
- package/src/application/models/supportedOrgs.ts +137 -0
- package/src/application/models/utilityTypes/camelCase.ts +87 -0
- package/src/application/models/utilityTypes/camelCasedPropertiesDeep.ts +80 -0
- package/src/application/models/utilityTypes/delimiterCase.ts +121 -0
- package/src/application/models/utilityTypes/delimiterCasedPropertiesDeep.ts +98 -0
- package/src/application/models/utilityTypes/index.ts +1 -0
- package/src/application/models/utilityTypes/internal.ts +93 -0
- package/src/application/models/utilityTypes/primitive.ts +8 -0
- package/src/application/models/utilityTypes/snakeCasedPropertiesDeep.ts +49 -0
- package/src/application/models/utilityTypes/splitWords.ts +76 -0
- package/src/application/models/utilityTypes/trim.ts +28 -0
- package/src/application/models/utilityTypes/unknownArray.ts +25 -0
- package/src/application/models/utils/snakeToCamelTransformer.ts +90 -0
- package/src/application/models/utils/stringToFulfillmentDisplayStatusEnumValue.ts +68 -0
- package/src/application/models/validators/validateGraphQLColorsConfig.ts +29 -0
- package/src/application/models/validators/validateGraphQLFrontendConfig.ts +594 -0
- package/src/application/models/validators/validateGraphQLOrgId.ts +7 -0
- package/src/application/models/validators/validateMobilePLPChatPlacementParameter.ts +14 -0
- package/src/application/models/validators/validateOrgConfigResults.ts +47 -0
- package/src/application/models/validators/validateOrganizationConfig.ts +37 -0
- package/src/application/models/validators/validateResponse.ts +187 -0
- package/src/application/models/validators/validateSuggestion.ts +16 -0
- package/src/application/models/validators/validateUserEvent.ts +110 -0
- package/src/application/models/variantInfo/index.ts +1 -0
- package/src/application/models/variantInfo/pageVisitInfo.ts +6 -0
- package/src/application/models/variantInfo/plpInfo.ts +3 -0
- package/src/application/models/variantInfo/productInfo.ts +5 -0
- package/src/application/models/variantInfo/variantInfo.ts +23 -0
- package/src/application/service/cachingService.ts +84 -0
- package/src/application/service/cdnService.ts +18 -0
- package/src/application/service/customerService/index.ts +8 -0
- package/src/application/service/customerService/providers/UnsupportedCustomerService.ts +15 -0
- package/src/application/service/customerService/types.ts +31 -0
- package/src/application/service/domMutationObserver.ts +320 -0
- package/src/application/service/domMutations/GridInsertionService.ts +123 -0
- package/src/application/service/domMutations/dataLayer/dataLayerEventsListener.ts +99 -0
- package/src/application/service/domMutations/domInsertionService.ts +90 -0
- package/src/application/service/domMutations/domMutationListener.ts +15 -0
- package/src/application/service/domMutations/domMutationListenerState.ts +52 -0
- package/src/application/service/domMutations/floatingChat/embeddedChatsPlacementsListener.ts +41 -0
- package/src/application/service/domMutations/gladly/gladlyListener.ts +61 -0
- package/src/application/service/domMutations/spiffy/orgs/common/kustomerVisibilityListener.ts +41 -0
- package/src/application/service/domMutations/spiffy/orgs/common/orgsCommonDataLayerListener.ts +119 -0
- package/src/application/service/environmentService.ts +51 -0
- package/src/application/service/featureFlagService.ts +130 -0
- package/src/application/service/kustomerIntegrationService.ts +111 -0
- package/src/application/service/localStorageService.ts +77 -0
- package/src/application/service/pageVariantService.ts +779 -0
- package/src/application/service/searchService.ts +140 -0
- package/src/application/service/sessionStorageService.ts +27 -0
- package/src/application/service/shopifyUrlService.ts +63 -0
- package/src/application/service/userIdentityService.ts +114 -0
- package/src/application/service/windowChatToggleService.ts +71 -0
- package/src/application/service/windowDataLayerService.ts +181 -0
- package/src/application/service/windowFrontendConfigService.ts +104 -0
- package/src/application/utils/__tests__/divideArrays.test.ts +14 -0
- package/src/application/utils/analyticsUtils.ts +110 -0
- package/src/application/utils/coreContextToApiContext.ts +11 -0
- package/src/application/utils/coreUserEventToApiUserEvent.ts +106 -0
- package/src/application/utils/divideArray.ts +7 -0
- package/src/application/utils/domObserver.ts +96 -0
- package/src/application/utils/elementObserver.ts +246 -0
- package/src/application/utils/imageFilter.ts +12 -0
- package/src/application/utils/index.ts +3 -0
- package/src/application/utils/merchantUtils.ts +16 -0
- package/src/application/utils/messageFromFormSubmittedEvent.ts +31 -0
- package/src/application/utils/messageFromQueryEvent.ts +38 -0
- package/src/application/utils/messageFromResponse.ts +133 -0
- package/src/application/utils/messageFromSuggestionEvent.ts +32 -0
- package/src/application/utils/mouseEventTypes.ts +1 -0
- package/src/application/utils/mutationHelper.ts +51 -0
- package/src/application/utils/nextMessageRequestToApiRequest.ts +31 -0
- package/src/application/utils/nodeSelector.ts +133 -0
- package/src/application/utils/overrides.ts +196 -0
- package/src/application/utils/stringUtils.ts +55 -0
- package/src/application/utils/supportedEventRequestToApiRequest.ts +12 -0
- package/src/application/utils/urlsParser.ts +53 -0
- package/src/application/utils/validation.ts +5 -0
- package/src/atoms/app/index.ts +57 -0
- package/src/atoms/app/variant.ts +261 -0
- package/src/atoms/atomStore.ts +34 -0
- package/src/atoms/chat/chatState.ts +44 -0
- package/src/atoms/chat/form.ts +19 -0
- package/src/atoms/chat/index.ts +38 -0
- package/src/atoms/chat/lastMessage.ts +11 -0
- package/src/atoms/chat/messageQueue.ts +65 -0
- package/src/atoms/chat/performanceMetrics.ts +84 -0
- package/src/atoms/chat/renderedWidgetRefs.ts +28 -0
- package/src/atoms/chat/replies.ts +51 -0
- package/src/atoms/chat/suggestions.ts +36 -0
- package/src/atoms/globalSearch.ts +12 -0
- package/src/atoms/index.ts +5 -0
- package/src/atoms/org/customerService.ts +13 -0
- package/src/atoms/org/graphqlConfig.ts +27 -0
- package/src/atoms/org/index.ts +7 -0
- package/src/atoms/org/merchantCss.ts +44 -0
- package/src/atoms/org/org.ts +256 -0
- package/src/atoms/org/orgAnalyticsConfig.ts +28 -0
- package/src/atoms/org/orgPageConfig.ts +38 -0
- package/src/atoms/org/orgUIConfig.ts +122 -0
- package/src/atoms/search/chatSearch.ts +293 -0
- package/src/atoms/search/index.ts +2 -0
- package/src/atoms/search/productFilters.ts +207 -0
- package/src/atoms/search/productSorter.ts +23 -0
- package/src/atoms/search/searchAPI.ts +194 -0
- package/src/atoms/search/types.ts +55 -0
- package/src/atoms/search/utils.ts +18 -0
- package/src/config/divIds.ts +27 -0
- package/src/config/locators/components/chat/entrypoints.ts +13 -0
- package/src/config/locators/components/chat/index.ts +23 -0
- package/src/config/locators/components/chat/preview.ts +13 -0
- package/src/config/locators/components/chat/variants/index.ts +16 -0
- package/src/config/locators/components/common/buttons.ts +6 -0
- package/src/config/locators/components/common/cards.ts +18 -0
- package/src/config/locators/components/common/links.ts +1 -0
- package/src/config/locators/components/common/tables.ts +2 -0
- package/src/config/locators/components/floating-button.ts +2 -0
- package/src/config/locators/components/index.ts +3 -0
- package/src/config/locators/components/report-issue.ts +21 -0
- package/src/config/locators/components/search/index.ts +5 -0
- package/src/config/locators/components/shadow-dom.ts +1 -0
- package/src/config/locators/embedded.ts +21 -0
- package/src/config/locators/index.ts +3 -0
- package/src/config/socialProofClasses.ts +17 -0
- package/src/contexts/chatContext.tsx +451 -0
- package/src/contexts/enviveConfigContext.tsx +70 -0
- package/src/contexts/index.ts +4 -0
- package/src/contexts/systemSettingsContext.tsx +61 -0
- package/src/contexts/types.ts +1059 -0
- package/src/enabled-features.ts +83 -0
- package/src/events/event-types.ts +11 -0
- package/src/events/index.ts +52 -0
- package/src/events/registerAnalyticsListeners.ts +49 -0
- package/src/extension.ts +63 -0
- package/src/hooks/index.ts +22 -0
- package/src/hooks/useBlockBackButton.ts +29 -0
- package/src/hooks/useChatToggle.ts +66 -0
- package/src/hooks/useCustomerSupportHandoff.ts +39 -0
- package/src/hooks/useDebounce.ts +17 -0
- package/src/hooks/useDynamicVariants.ts +210 -0
- package/src/hooks/useElementObserver.ts +245 -0
- package/src/hooks/useFileUpload.ts +61 -0
- package/src/hooks/useGrabAndScroll.ts +133 -0
- package/src/hooks/useHideElements.ts +82 -0
- package/src/hooks/useHorizontalScrollAnimation.ts +115 -0
- package/src/hooks/useImageResolver.ts +51 -0
- package/src/hooks/useIntersection.ts +28 -0
- package/src/hooks/useIsSmallScreen.ts +23 -0
- package/src/hooks/useMessageFilter.ts +49 -0
- package/src/hooks/useMessageScrollObserver.ts +47 -0
- package/src/hooks/useReducedMotionWithOverride.ts +15 -0
- package/src/hooks/useSearch.tsx +433 -0
- package/src/hooks/useSnapCalculator.ts +38 -0
- package/src/hooks/useSnapControl.ts +155 -0
- package/src/hooks/useSystemSettingsContext.ts +12 -0
- package/src/hooks/useTrackComponentVisibleEvent.ts +52 -0
- package/src/hooks/useUpdateAnalyticsProps.ts +56 -0
- package/src/hooks/utils.ts +153 -0
- package/src/index.ts +31 -0
- package/src/initialize.ts +163 -0
- package/src/interceptors/types.ts +6 -0
- package/src/interceptors/useFormEscalation.ts +40 -0
- package/src/interceptors/useMessageInterceptor.ts +32 -0
- package/src/main.ts +85 -0
- package/src/main.tsx +123 -0
- package/src/merchants/bandolier/bandolier.ts +1389 -0
- package/src/merchants/carpe/carpe.ts +656 -0
- package/src/merchants/coterie/coterie.ts +280 -0
- package/src/merchants/default.ts +193 -0
- package/src/merchants/dreamlandBaby/dreamlandBaby.ts +375 -0
- package/src/merchants/fiveCbd/fiveCbd.ts +697 -0
- package/src/merchants/forLoveAndLemons/forLoveAndLemons.ts +721 -0
- package/src/merchants/greenpan/greenpan.ts +440 -0
- package/src/merchants/grooveLife/grooveLife.ts +386 -0
- package/src/merchants/homegrownCannabis/homegrownCannabis.ts +468 -0
- package/src/merchants/init-merchant.sh +53 -0
- package/src/merchants/jackArcher/jackArcher.ts +974 -0
- package/src/merchants/jordanCraig/jordanCraig.ts +1927 -0
- package/src/merchants/kindredBravely/kindredBravely.ts +529 -0
- package/src/merchants/kutFromTheKloth/kutFromTheKloth.ts +418 -0
- package/src/merchants/larryAndSerges/larryAndSerges.ts +314 -0
- package/src/merchants/leapsAndRebounds/leapsAndRebounds.ts +424 -0
- package/src/merchants/longevityrx/longevityrx.ts +368 -0
- package/src/merchants/lookOptic/lookOptic.ts +323 -0
- package/src/merchants/mantraBrand/mantraBrand.ts +838 -0
- package/src/merchants/medterra/medterra.ts +670 -0
- package/src/merchants/modells/modells.ts +546 -0
- package/src/merchants/pressedFloral/pressedFloral.ts +734 -0
- package/src/merchants/skinPerfection/skinPerfection.ts +379 -0
- package/src/merchants/snapSupplements/snapSupplements.ts +325 -0
- package/src/merchants/spanx/spanx.ts +810 -0
- package/src/merchants/spanx/spanxStaging.ts +942 -0
- package/src/merchants/supergoop/supergoop.ts +376 -0
- package/src/merchants/uniqueVintage/uniqueVintage.ts +1314 -0
- package/src/merchants/uniqueVintage/views/useUniqueVintageChatSearch.ts +147 -0
- package/src/merchants/venaCbd/venaCbd.ts +410 -0
- package/src/merchants/westonJonBoucher/westonJonBoucher.ts +473 -0
- package/src/merchants/wineEnthusiast/wineEnthusiast.ts +990 -0
- package/src/merchants/wolfMattress/wolfMattress.ts +411 -0
- package/src/merchants/wolfTactical/wolfTactical.ts +389 -0
- package/src/types/custservice-types.ts +28 -0
- package/src/types/search-filter-types.ts +111 -0
- package/src/types/suggestionBarV2-types.ts +4 -0
- package/src/types/test-types.ts +3 -0
- package/src/types.ts +66 -0
|
@@ -0,0 +1,1059 @@
|
|
|
1
|
+
import { ChatElementDisplayLocation } from "src/application/models/chatElementDisplayLocation";
|
|
2
|
+
import {
|
|
3
|
+
ColorMapping,
|
|
4
|
+
ColorNames,
|
|
5
|
+
colorVar,
|
|
6
|
+
} from "src/application/models/colorsConfig";
|
|
7
|
+
import { FeatureGates } from "src/application/models/featureGates";
|
|
8
|
+
import {
|
|
9
|
+
CustomerServiceIntegrationMode,
|
|
10
|
+
CustomerServiceType,
|
|
11
|
+
} from "src/application/service/customerService/types";
|
|
12
|
+
import { GridInsertionType } from "src/application/service/domMutations/GridInsertionService";
|
|
13
|
+
import { DOMInsertionType } from "src/application/service/domMutations/domInsertionService";
|
|
14
|
+
|
|
15
|
+
import type {
|
|
16
|
+
PageVisitCategory,
|
|
17
|
+
SupportedEventProductCategory,
|
|
18
|
+
} from "@spiffy-ai/commerce-api-client";
|
|
19
|
+
import { ChatState } from "src/types/custservice-types";
|
|
20
|
+
import { SuggestionBarLocationForMetrics } from "src/types/suggestionBarV2-types";
|
|
21
|
+
import { TestProps } from "src/types/test-types";
|
|
22
|
+
|
|
23
|
+
type ShowFloatingButtonOptions =
|
|
24
|
+
| "always"
|
|
25
|
+
| "after-interaction-on-mobile-always-desktop"
|
|
26
|
+
| "after-interaction-anywhere"
|
|
27
|
+
| "never";
|
|
28
|
+
|
|
29
|
+
type FloatingEntryPointConfig = {
|
|
30
|
+
position: "bottom-left" | "middle-left" | "middle-right" | "bottom-right";
|
|
31
|
+
expansionText?: {
|
|
32
|
+
pdp: string;
|
|
33
|
+
plp: string;
|
|
34
|
+
};
|
|
35
|
+
minimizedColor: string;
|
|
36
|
+
expandedColor: string;
|
|
37
|
+
textColor?: string;
|
|
38
|
+
showOption: ShowFloatingButtonOptions;
|
|
39
|
+
iconSVGSrc?: string;
|
|
40
|
+
iconSize?: number;
|
|
41
|
+
iconStrokeColor?: string;
|
|
42
|
+
iconFillColor?: string;
|
|
43
|
+
height?: number;
|
|
44
|
+
fontSize?: number;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type WelcomeSectionVariant = "standard" | "outlined";
|
|
48
|
+
|
|
49
|
+
type WelcomeSectionColorVariant = "standard" | "accent" | "brand" | "light";
|
|
50
|
+
|
|
51
|
+
type WelcomeSectionConfig = {
|
|
52
|
+
variant: WelcomeSectionVariant;
|
|
53
|
+
colorVariant?: WelcomeSectionColorVariant;
|
|
54
|
+
title?: string;
|
|
55
|
+
subtitle?: string;
|
|
56
|
+
// icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
57
|
+
/* Serializable icon name that maps to a React component. Preferred over icon for database storage. */
|
|
58
|
+
iconName?: string;
|
|
59
|
+
imageSrc?: string;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
type ChatPreviewConfig = {
|
|
63
|
+
variant: "flat" | "filled" | "outlined";
|
|
64
|
+
largeProductComparison?: boolean;
|
|
65
|
+
filledBackgroundColor: string;
|
|
66
|
+
iconFillColor: string;
|
|
67
|
+
buttonTextColor?: string;
|
|
68
|
+
buttonTextSecondaryColor?: string;
|
|
69
|
+
buttonTextHoverColor?: string;
|
|
70
|
+
buttonBackgroundColor: string;
|
|
71
|
+
buttonBackgroundHoverColor: string;
|
|
72
|
+
buttonBorderColor?: string;
|
|
73
|
+
buttonBorderHoverColor?: string;
|
|
74
|
+
copies: { pdp: string[]; plp: string[] };
|
|
75
|
+
staticSuggestionCopies?: { pdp: string[]; plp: string[] };
|
|
76
|
+
staticPLPImages?: string[];
|
|
77
|
+
footerConfig?: ChatPreviewFooterConfig;
|
|
78
|
+
headerConfig?: ChatPreviewHeaderConfig;
|
|
79
|
+
topMargin?: number;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
type ChatPreviewHeaderConfig = {
|
|
83
|
+
title?: string;
|
|
84
|
+
imageSrc?: string;
|
|
85
|
+
imageHeight?: number;
|
|
86
|
+
sparklesColor?: string; // used by: spanx, uniqueVintage, dreamlandBaby
|
|
87
|
+
fontSize?: string;
|
|
88
|
+
iconWidth?: string;
|
|
89
|
+
iconHeight?: string;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
interface ChatPreviewFooterConfig {
|
|
93
|
+
hasFade?: boolean; // used by: spanx, uniqueVintage
|
|
94
|
+
suggestionButtonVariant?: "dark" | "light" | "outlined";
|
|
95
|
+
suggestionsBackground?: string; // used by: carbahn
|
|
96
|
+
replyButtonIcon?:
|
|
97
|
+
| "send"
|
|
98
|
+
| "magnifyingGlass"
|
|
99
|
+
| "thinMagnifyingGlass"
|
|
100
|
+
| "searchIcon";
|
|
101
|
+
replyButtonText?: string;
|
|
102
|
+
replyInputHasShadow?: boolean; // used by: spanx
|
|
103
|
+
replyInputHasBorder?: boolean; // used by: spanx
|
|
104
|
+
backgroundColor?: string; // used by spanx, tushbaby, will need custom CSS when switching over
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
type ProductReviewStyleVariant = "standard" | "bordered";
|
|
108
|
+
|
|
109
|
+
type ProductReviewColorVariant = "neutral" | "brand" | "premium";
|
|
110
|
+
|
|
111
|
+
interface ProductReviewConfig {
|
|
112
|
+
styleVariant: ProductReviewStyleVariant;
|
|
113
|
+
colorVariant: ProductReviewColorVariant;
|
|
114
|
+
verifiedBuyerTitle: string;
|
|
115
|
+
incentivizedReviewFlag?: boolean;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
type PageCardVariant = "filled" | "outlined" | "minimal";
|
|
119
|
+
|
|
120
|
+
type PageCardHoverVariant = "none" | "shadow" | "lift";
|
|
121
|
+
|
|
122
|
+
type PageCardIconVariant = "primary" | "accent" | "background" | "none";
|
|
123
|
+
|
|
124
|
+
type PageCardConfig = {
|
|
125
|
+
variant: PageCardVariant;
|
|
126
|
+
hoverVariant: PageCardHoverVariant;
|
|
127
|
+
iconVariant: PageCardIconVariant;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
type ProductCardVariant =
|
|
131
|
+
| "filled"
|
|
132
|
+
| "bordered"
|
|
133
|
+
| "minimal"
|
|
134
|
+
| "transparentBordered";
|
|
135
|
+
|
|
136
|
+
type ProductCardHoverVariant = "backgroundDark" | "none";
|
|
137
|
+
|
|
138
|
+
type ProductCardLayoutVariant = "normal" | "tall" | "square";
|
|
139
|
+
|
|
140
|
+
interface ProductCardConfig {
|
|
141
|
+
variant: ProductCardVariant;
|
|
142
|
+
hoverVariant: ProductCardHoverVariant;
|
|
143
|
+
layoutVariant: ProductCardLayoutVariant;
|
|
144
|
+
pricePrefix?: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
type CSSwitchConfig = {
|
|
148
|
+
variant: "attached" | "detached";
|
|
149
|
+
backgroundColor: string;
|
|
150
|
+
borderColor: string;
|
|
151
|
+
selectedTextColor: string;
|
|
152
|
+
selectedBackgroundColor?: string;
|
|
153
|
+
unselectedTextColor: string;
|
|
154
|
+
unselectedBackgroundColor?: string;
|
|
155
|
+
supportTitle?: string;
|
|
156
|
+
spiffyTitle?: string;
|
|
157
|
+
spiffyTitleHasLogo?: boolean;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
type ChatHeaderConfig = {
|
|
161
|
+
collapsedColor: string;
|
|
162
|
+
expandedColor: string;
|
|
163
|
+
chevronColor: string;
|
|
164
|
+
imageSrc?: string;
|
|
165
|
+
icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
166
|
+
closeIcon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
167
|
+
borderBottom?: string;
|
|
168
|
+
headerBarHeightPartialView: number;
|
|
169
|
+
headerBarHeightFullView: number;
|
|
170
|
+
customerSupportSwitchConfig?: CSSwitchConfig;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
type SimpleCustomerServiceIntegration = {
|
|
174
|
+
integrationMode: CustomerServiceIntegrationMode;
|
|
175
|
+
provider: CustomerServiceType;
|
|
176
|
+
useUnifiedButton?: boolean;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
type FullCustomerServiceIntegration = {
|
|
180
|
+
integrationMode: CustomerServiceIntegrationMode;
|
|
181
|
+
provider: CustomerServiceType;
|
|
182
|
+
useUnifiedButton?: boolean;
|
|
183
|
+
chatEnabledDuringBusinessHours?: boolean;
|
|
184
|
+
showNameInput?: boolean;
|
|
185
|
+
formAiName?: string;
|
|
186
|
+
welcomeTitle: string;
|
|
187
|
+
welcomeDescription: string;
|
|
188
|
+
showWelcomeOnForm?: boolean;
|
|
189
|
+
contactSubjectOptions?: string[];
|
|
190
|
+
getCustomWaitingMessage?: (name?: string) => string;
|
|
191
|
+
withinBusinessHoursMessage?: string;
|
|
192
|
+
withinBusinessHoursWaitingMessage?: string;
|
|
193
|
+
outsideBusinessHoursMessage?: string;
|
|
194
|
+
outsideBusinessHoursWaitingMessage?: string;
|
|
195
|
+
withinBusinessHoursFormMessage?: string;
|
|
196
|
+
outsideBusinessHoursFormMessage?: string;
|
|
197
|
+
suggestedAIQuestions?: string[];
|
|
198
|
+
businessHoursPolling?: number;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* @deprecated This is handled by the BE.
|
|
202
|
+
*/
|
|
203
|
+
businessHoursStartUTC?: string;
|
|
204
|
+
/**
|
|
205
|
+
* @deprecated This is handled by the BE.
|
|
206
|
+
*/
|
|
207
|
+
businessHoursEndUTC?: string;
|
|
208
|
+
/**
|
|
209
|
+
* @deprecated This is handled by the BE.
|
|
210
|
+
*/
|
|
211
|
+
businessHoursTimezone?: string;
|
|
212
|
+
|
|
213
|
+
showAISuggestionsWithinBusinessHours?: boolean;
|
|
214
|
+
waitingMessagePosition?: "BEFORE_MESSAGES" | "AFTER_MESSAGES";
|
|
215
|
+
legalMessage?: string;
|
|
216
|
+
withinBusinessHoursInitialState?: ChatState;
|
|
217
|
+
outsideBusinessHoursInitialState?: ChatState;
|
|
218
|
+
withinBusinessHoursButtontext?: string;
|
|
219
|
+
outsideBusinessHoursButtontext?: string;
|
|
220
|
+
reopenChatMessage: string;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
type CustomerServiceIntegration =
|
|
224
|
+
| SimpleCustomerServiceIntegration
|
|
225
|
+
| FullCustomerServiceIntegration;
|
|
226
|
+
|
|
227
|
+
type ConversationalSeach = {
|
|
228
|
+
enabled?: boolean;
|
|
229
|
+
replyInput?: ReplyInputConfig;
|
|
230
|
+
suggestions?: string[];
|
|
231
|
+
entrypointBgColor?: string;
|
|
232
|
+
entrypointTextColor?: string;
|
|
233
|
+
entrypointBtnColor?: string;
|
|
234
|
+
entrypointBtnTextColor?: string;
|
|
235
|
+
entrypointBtnBorderColor?: string;
|
|
236
|
+
entrypointContainer?: string;
|
|
237
|
+
entrypointTrigger?: string;
|
|
238
|
+
productGridContainer?: string;
|
|
239
|
+
generalSearchBtn?: string;
|
|
240
|
+
pageContent?: string;
|
|
241
|
+
searchContent?: string;
|
|
242
|
+
sortingTitle?: string;
|
|
243
|
+
selectionTitle?: string;
|
|
244
|
+
sortingFont?: string;
|
|
245
|
+
optionsFont?: string;
|
|
246
|
+
sortingButtonText?: string;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
type ChatMessageVariant = "standard" | "premium" | "accent";
|
|
250
|
+
|
|
251
|
+
interface ChatMessageConfig {
|
|
252
|
+
assistantChatTitle: string;
|
|
253
|
+
variant: ChatMessageVariant;
|
|
254
|
+
productLink: {
|
|
255
|
+
variant: ProductLinkVariant;
|
|
256
|
+
hoverVariant: ProductLinkHoverVariant;
|
|
257
|
+
iconVariant: ProductLinkIconVariant;
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
interface ReplyInputConfig {
|
|
262
|
+
// TODO consider making this a number
|
|
263
|
+
size?: "md" | "lg";
|
|
264
|
+
sendIcon: "arrowUp" | "send" | "search";
|
|
265
|
+
placeholder?: string;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
interface PartialViewConfig {
|
|
269
|
+
// maximum height of the partial view as a percentage of the screen height
|
|
270
|
+
maxHeight: number;
|
|
271
|
+
borderRadius?: string;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
type ProductLinkIconVariant =
|
|
275
|
+
| "accentPrimary"
|
|
276
|
+
| "backgroundPrimary"
|
|
277
|
+
| "backgroundPrimaryDark"
|
|
278
|
+
| "borderLight"
|
|
279
|
+
| "backgroundSaturated";
|
|
280
|
+
|
|
281
|
+
type ProductLinkVariant = "textLink";
|
|
282
|
+
|
|
283
|
+
type ProductLinkHoverVariant = "backgroundDark";
|
|
284
|
+
|
|
285
|
+
type SearchCardVariant =
|
|
286
|
+
| "backgroundPrimary"
|
|
287
|
+
| "backgroundSecondary"
|
|
288
|
+
| "backgroundSecondaryDark"
|
|
289
|
+
| "backgroundLight"
|
|
290
|
+
| "backgroundSaturated";
|
|
291
|
+
|
|
292
|
+
type SuggestionButtonVariant =
|
|
293
|
+
| "outlined"
|
|
294
|
+
| "outlinedLight"
|
|
295
|
+
| "primary"
|
|
296
|
+
| "secondary"
|
|
297
|
+
| "tertiary"
|
|
298
|
+
| "dark"
|
|
299
|
+
| "darkAccent"
|
|
300
|
+
| "darkPrimary"
|
|
301
|
+
| "secondaryDark"
|
|
302
|
+
| "secondaryAccent"
|
|
303
|
+
| "transparent"
|
|
304
|
+
| "transparentDark"
|
|
305
|
+
| "lightDark";
|
|
306
|
+
|
|
307
|
+
interface SuggestionButtonConfig {
|
|
308
|
+
variant?: SuggestionButtonVariant;
|
|
309
|
+
hoverVariant?: SuggestionButtonVariant;
|
|
310
|
+
answerVariant?: SuggestionButtonVariant;
|
|
311
|
+
borderRadius?: "sm" | "md" | "lg";
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
type NumRows = "default" | "alwaysOneRow" | "alwaysTwoRows" | "twoRowsOnMobile";
|
|
315
|
+
|
|
316
|
+
interface AlphabeticFilterSorting {
|
|
317
|
+
type: "alphabetic";
|
|
318
|
+
}
|
|
319
|
+
interface ProductCountFilterSorting {
|
|
320
|
+
type: "productCount";
|
|
321
|
+
}
|
|
322
|
+
interface CustomFilterSorting {
|
|
323
|
+
type: "custom";
|
|
324
|
+
map: Record<string, number>;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
type FilterSorting =
|
|
328
|
+
| AlphabeticFilterSorting
|
|
329
|
+
| ProductCountFilterSorting
|
|
330
|
+
| CustomFilterSorting;
|
|
331
|
+
|
|
332
|
+
interface BaseFilterConfig {
|
|
333
|
+
filterId: string;
|
|
334
|
+
displayName: string;
|
|
335
|
+
}
|
|
336
|
+
interface DynamicFilterConfig extends BaseFilterConfig {
|
|
337
|
+
type: "dynamic";
|
|
338
|
+
attribute: string;
|
|
339
|
+
sorting: FilterSorting;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
interface PriceFilterConfig extends BaseFilterConfig {
|
|
343
|
+
type: "price";
|
|
344
|
+
bucketSize: number;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export type FilterAttribute = DynamicFilterConfig | PriceFilterConfig;
|
|
348
|
+
|
|
349
|
+
export type SearchZeroStateVariant =
|
|
350
|
+
| "backgroundTertiary"
|
|
351
|
+
| "backgroundDark"
|
|
352
|
+
| "backgroundPrimary";
|
|
353
|
+
export type SearchZeroStateLayout = "input" | "icon";
|
|
354
|
+
|
|
355
|
+
export type SearchInputVariant = "standard";
|
|
356
|
+
|
|
357
|
+
export type SearchIconVariant = "thin" | "bold";
|
|
358
|
+
|
|
359
|
+
export type SearchFilterSidebarVariant = "darkButton" | "lightButton";
|
|
360
|
+
|
|
361
|
+
export type ProductGridVariant = "standard" | "square";
|
|
362
|
+
|
|
363
|
+
type UserQueryButtonIcon =
|
|
364
|
+
| "magnifyingGlass"
|
|
365
|
+
| "send"
|
|
366
|
+
| "magnifyingGlassThin"
|
|
367
|
+
| "sendArrow"
|
|
368
|
+
| "searchIcon";
|
|
369
|
+
|
|
370
|
+
interface UserQueryButtonConfig {
|
|
371
|
+
variant?: "box" | "underlineLight" | "underlineDark";
|
|
372
|
+
placeholderText?: string;
|
|
373
|
+
icon: UserQueryButtonIcon;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// TODO: this should be included in the top-level widget config
|
|
377
|
+
interface TermsAndConditionsConfig {
|
|
378
|
+
copy: string;
|
|
379
|
+
link: string;
|
|
380
|
+
linkText: string;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
interface MerchantVariantSettings {
|
|
384
|
+
dynamicVariants: {
|
|
385
|
+
enabled: boolean; // This feature will enable dynamic variants for the merchant. Useful for SPA's
|
|
386
|
+
refreshInterval?: number; // The interval in milliseconds to check for changes in the URL
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
interface FloatingChatConfig {
|
|
391
|
+
enableWatermark: boolean;
|
|
392
|
+
userQueryInputEnabled: boolean;
|
|
393
|
+
ignoreFirstModelResponse?: boolean;
|
|
394
|
+
neverShowSingleProductCards?: boolean;
|
|
395
|
+
termsAndConditionsConfig?: TermsAndConditionsConfig;
|
|
396
|
+
|
|
397
|
+
// Footer config
|
|
398
|
+
suggestionButtonConfig?: SuggestionButtonConfig;
|
|
399
|
+
replyInputConfig: ReplyInputConfig;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
interface SearchConfig {
|
|
403
|
+
enableGlobalSearch: boolean;
|
|
404
|
+
searchFilterConfig: FilterAttribute[];
|
|
405
|
+
redirectSearchResultsUrl?: string;
|
|
406
|
+
additiveDynamicFilters?: boolean;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
type OrgUIConfig = {
|
|
410
|
+
shortName: string;
|
|
411
|
+
id?: string;
|
|
412
|
+
floatingEntrypointConfig?: FloatingEntryPointConfig;
|
|
413
|
+
// Deprecated - remove with ChatPreview rewrite
|
|
414
|
+
chatPreviewConfig?: ChatPreviewConfig;
|
|
415
|
+
|
|
416
|
+
customerServiceIntegration: CustomerServiceIntegration;
|
|
417
|
+
// Deprecated - remove when Global Search is fully launched
|
|
418
|
+
conversationalSearch?: ConversationalSeach;
|
|
419
|
+
|
|
420
|
+
merchantOverrideCss?: string;
|
|
421
|
+
|
|
422
|
+
// Deprecated TODO: Remove this deprecated value when Groove CX has proper unified button support
|
|
423
|
+
// selectors for elements that should be hidden when the chat is open
|
|
424
|
+
// e.g. CS widgets with max z-index ("div[id*='cs-container']")
|
|
425
|
+
hiddenElementSelectors?: string[];
|
|
426
|
+
|
|
427
|
+
merchantVariantSettings?: MerchantVariantSettings;
|
|
428
|
+
// TODO: Migrate all floating chat config into this top-level key
|
|
429
|
+
//
|
|
430
|
+
floatingChatConfig: FloatingChatConfig;
|
|
431
|
+
|
|
432
|
+
// Contain all search config here
|
|
433
|
+
searchConfig: SearchConfig;
|
|
434
|
+
// TODO: Move these into FloatingChatConfig
|
|
435
|
+
// Chat Header related values
|
|
436
|
+
chatHeader: ChatHeaderConfig;
|
|
437
|
+
stickyAgentSwitchSuggestion?: boolean;
|
|
438
|
+
partialViewConfig: PartialViewConfig;
|
|
439
|
+
welcomeSectionConfig?: WelcomeSectionConfig;
|
|
440
|
+
// Different response values
|
|
441
|
+
productCardConfig?: ProductCardConfig;
|
|
442
|
+
productReviewConfig?: ProductReviewConfig;
|
|
443
|
+
pageCardConfig?: PageCardConfig;
|
|
444
|
+
chatMessageConfig: ChatMessageConfig;
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
type InsertionPoint = {
|
|
448
|
+
selector: string;
|
|
449
|
+
// this is the index of the target element, 0 if missing
|
|
450
|
+
selectionIndex?: number;
|
|
451
|
+
insertionType: DOMInsertionType;
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
type URLTest = "shopify" | "null";
|
|
455
|
+
|
|
456
|
+
type IdExtractor =
|
|
457
|
+
| "shopify-product-id"
|
|
458
|
+
| "shopify-collection-id"
|
|
459
|
+
| "shopify-product-variant-id"
|
|
460
|
+
| "url-resolver-product-id"
|
|
461
|
+
| "url-resolver-plp-id"
|
|
462
|
+
| "null";
|
|
463
|
+
|
|
464
|
+
// This contains a map between PageVisitCategory and a list of URL's that are classified as the value
|
|
465
|
+
enum CategoryExtractorType {
|
|
466
|
+
VisitCategoryMap = "VisitCategoryMap",
|
|
467
|
+
VisitCategoryDefault = "VisitCategoryDefault",
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
interface BaseCategoryExtractor<T extends CategoryExtractorType> {
|
|
471
|
+
type: T;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// This map betweens a category and a list of url patterns
|
|
475
|
+
interface VisitCategoryMap
|
|
476
|
+
extends BaseCategoryExtractor<CategoryExtractorType.VisitCategoryMap> {
|
|
477
|
+
map: {
|
|
478
|
+
[key in PageVisitCategory]?: string[];
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// This will return a hard-coded default PageVisitCategory. It is intended to be used by fallback page types
|
|
483
|
+
interface VisitCategoryDefault
|
|
484
|
+
extends BaseCategoryExtractor<CategoryExtractorType.VisitCategoryDefault> {
|
|
485
|
+
value: PageVisitCategory;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
type CategoryExtractor = VisitCategoryMap | VisitCategoryDefault;
|
|
489
|
+
|
|
490
|
+
type WrappingElement = {
|
|
491
|
+
className: string;
|
|
492
|
+
element: string;
|
|
493
|
+
insertionType: DOMInsertionType;
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
enum PageVariantTestType {
|
|
497
|
+
ShopifyPLP = "ShopifyPLP",
|
|
498
|
+
ShopifyPDP = "ShopifyPDP",
|
|
499
|
+
PageCategory = "PageCategory",
|
|
500
|
+
CatalogCategory = "CatalogCategory",
|
|
501
|
+
TopCatalogCategory = "TopCatalogCategory",
|
|
502
|
+
HasReviews = "HasReviews",
|
|
503
|
+
InCollection = "InCollection",
|
|
504
|
+
HasMerchantTag = "HasMerchantTag",
|
|
505
|
+
FeatureGate = "FeatureGate",
|
|
506
|
+
PlpId = "PlpId",
|
|
507
|
+
QueryParam = "QueryParam",
|
|
508
|
+
ProductId = "ProductId",
|
|
509
|
+
UserHasInteracted = "UserHasInteracted",
|
|
510
|
+
UserHasNotInteracted = "UserHasNotInteracted",
|
|
511
|
+
isLoading = "isLoading",
|
|
512
|
+
isProductComparison = "isProductComparison",
|
|
513
|
+
Fallback = "Fallback",
|
|
514
|
+
UrlResolver = "UrlResolver",
|
|
515
|
+
Null = "null",
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
interface BasePageVariantTest<T extends PageVariantTestType> {
|
|
519
|
+
testType: T;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
interface TopCatalogCategory
|
|
523
|
+
extends BasePageVariantTest<PageVariantTestType.TopCatalogCategory> {
|
|
524
|
+
topCategory: string[];
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
interface CatalogCategoryTest
|
|
528
|
+
extends BasePageVariantTest<PageVariantTestType.CatalogCategory> {
|
|
529
|
+
category: SupportedEventProductCategory;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
interface HasReviewsTest
|
|
533
|
+
extends BasePageVariantTest<PageVariantTestType.HasReviews> {
|
|
534
|
+
reviewMinimum?: number;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
// This will return true if the product is in any of the listed collections
|
|
538
|
+
interface InCollectionTest
|
|
539
|
+
extends BasePageVariantTest<PageVariantTestType.InCollection> {
|
|
540
|
+
collections: string[];
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
// This will return true if the product has any of the listed merchant tags
|
|
544
|
+
interface HasMerchantTagTest
|
|
545
|
+
extends BasePageVariantTest<PageVariantTestType.HasMerchantTag> {
|
|
546
|
+
merchantTags: string[];
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
interface ShopifyPLPURLTest
|
|
550
|
+
extends BasePageVariantTest<PageVariantTestType.ShopifyPLP> {}
|
|
551
|
+
|
|
552
|
+
interface ShopifyPDPURLTest
|
|
553
|
+
extends BasePageVariantTest<PageVariantTestType.ShopifyPDP> {}
|
|
554
|
+
|
|
555
|
+
interface PageCategoryTest
|
|
556
|
+
extends BasePageVariantTest<PageVariantTestType.PageCategory> {
|
|
557
|
+
extractor: CategoryExtractor;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
interface FeatureGateTest
|
|
561
|
+
extends BasePageVariantTest<PageVariantTestType.FeatureGate> {
|
|
562
|
+
featureGate: FeatureGates;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
interface ProductIdTest
|
|
566
|
+
extends BasePageVariantTest<PageVariantTestType.ProductId> {
|
|
567
|
+
productIdExtractor: IdExtractor;
|
|
568
|
+
productIds: string[];
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
interface PlpIdTest extends BasePageVariantTest<PageVariantTestType.PlpId> {
|
|
572
|
+
plpIdExtractor: IdExtractor;
|
|
573
|
+
plpIds: string[];
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
interface QueryParamTest
|
|
577
|
+
extends BasePageVariantTest<PageVariantTestType.QueryParam> {
|
|
578
|
+
queryParam: string;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
interface UserHasInteractedTest
|
|
582
|
+
extends BasePageVariantTest<PageVariantTestType.UserHasInteracted> {}
|
|
583
|
+
|
|
584
|
+
interface UserHasNotInteractedTest
|
|
585
|
+
extends BasePageVariantTest<PageVariantTestType.UserHasNotInteracted> {}
|
|
586
|
+
|
|
587
|
+
interface IsLoadingTest
|
|
588
|
+
extends BasePageVariantTest<PageVariantTestType.isLoading> {}
|
|
589
|
+
|
|
590
|
+
interface IsProductComparison
|
|
591
|
+
extends BasePageVariantTest<PageVariantTestType.isProductComparison> {}
|
|
592
|
+
|
|
593
|
+
interface PageFallbackTest
|
|
594
|
+
extends BasePageVariantTest<PageVariantTestType.Fallback> {}
|
|
595
|
+
|
|
596
|
+
interface UrlResolverTest
|
|
597
|
+
extends BasePageVariantTest<PageVariantTestType.UrlResolver> {}
|
|
598
|
+
|
|
599
|
+
export type PageVariantTest =
|
|
600
|
+
| PageCategoryTest
|
|
601
|
+
| ShopifyPLPURLTest
|
|
602
|
+
| ShopifyPDPURLTest
|
|
603
|
+
| CatalogCategoryTest
|
|
604
|
+
| TopCatalogCategory
|
|
605
|
+
| HasReviewsTest
|
|
606
|
+
| InCollectionTest
|
|
607
|
+
| HasMerchantTagTest
|
|
608
|
+
| FeatureGateTest
|
|
609
|
+
| ProductIdTest
|
|
610
|
+
| PlpIdTest
|
|
611
|
+
| QueryParamTest
|
|
612
|
+
| UserHasInteractedTest
|
|
613
|
+
| UserHasNotInteractedTest
|
|
614
|
+
| IsLoadingTest
|
|
615
|
+
| IsProductComparison
|
|
616
|
+
| PageFallbackTest
|
|
617
|
+
| UrlResolverTest;
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Configuration for the social proof embedded widget
|
|
621
|
+
*
|
|
622
|
+
* @param headerTitle - The title text to display in the widget header
|
|
623
|
+
* @param staticSuggestions - A list of strings to display as suggestions in the widget
|
|
624
|
+
* @param suggestionButtonVariantDefault - The variant of the suggestion button to display in the widget footer
|
|
625
|
+
* @param suggestionButtonVariantAccent - The variant of the suggestion button to display in the widget body
|
|
626
|
+
* @param staticImageIndex - Index of the imageUrl to use from the product response
|
|
627
|
+
*/
|
|
628
|
+
interface SocialProofConfig {
|
|
629
|
+
customerQuery: string;
|
|
630
|
+
headerTitle: string;
|
|
631
|
+
staticPLPImagesLayout?: "grid" | "horizontal";
|
|
632
|
+
headerFontFamily?: string;
|
|
633
|
+
staticPLPImageNames?: string[];
|
|
634
|
+
staticImageIndex?: number;
|
|
635
|
+
suggestionButtonStrings: string[];
|
|
636
|
+
suggestionButtonVariantDefault: SuggestionButtonVariant;
|
|
637
|
+
suggestionButtonVariantAccent?: SuggestionButtonVariant;
|
|
638
|
+
suggestionButtonDataAttributes?: Record<string, string>;
|
|
639
|
+
userQueryButtonConfig?: UserQueryButtonConfig;
|
|
640
|
+
logoName?: string;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Configuration for creating the mount point for a widget
|
|
645
|
+
*
|
|
646
|
+
* @param className - Optional class name to apply to the mount point. Tailwind classes are supported
|
|
647
|
+
* and encouraged. Use this parameter to style the mounting container for the widget.
|
|
648
|
+
*/
|
|
649
|
+
export type WidgetMountingConfig = {
|
|
650
|
+
mountingConfigId: string;
|
|
651
|
+
containerId: string;
|
|
652
|
+
testId: string;
|
|
653
|
+
parentInsertionPoint?: InsertionPoint;
|
|
654
|
+
insertionPoint: InsertionPoint;
|
|
655
|
+
gridInsertionType?: GridInsertionType;
|
|
656
|
+
wrappingElement?: WrappingElement;
|
|
657
|
+
divCheckSelector?: string;
|
|
658
|
+
suppressionSelector?: string;
|
|
659
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
660
|
+
className?: string;
|
|
661
|
+
dataAttributes?: Record<string, string>;
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
type StaticWidgetMounting = {
|
|
665
|
+
mountingConfigId: string;
|
|
666
|
+
widgetConfigId: string;
|
|
667
|
+
};
|
|
668
|
+
type DynamicWidgetMounting = {
|
|
669
|
+
mountingConfigId: string;
|
|
670
|
+
mountingPointWidgets: WidgetDisplayTests[];
|
|
671
|
+
};
|
|
672
|
+
|
|
673
|
+
type WidgetDisplayTests = {
|
|
674
|
+
tests: PageVariantTest[];
|
|
675
|
+
widgetConfigId: string;
|
|
676
|
+
};
|
|
677
|
+
|
|
678
|
+
type WidgetMounting = StaticWidgetMounting | DynamicWidgetMounting;
|
|
679
|
+
|
|
680
|
+
enum WidgetType {
|
|
681
|
+
ChatPreview = "ChatPreview",
|
|
682
|
+
SocialProofV2 = "SocialProofV2",
|
|
683
|
+
ChatPreviewV2 = "ChatPreviewV2",
|
|
684
|
+
ChatPreviewIsLoading = "ChatPreviewIsLoading",
|
|
685
|
+
ChatPreviewPostInteraction = "ChatPreviewPostInteraction",
|
|
686
|
+
ChatPreviewProductComparison = "ChatPreviewProductComparison",
|
|
687
|
+
SuggestionBar = "SuggestionBar",
|
|
688
|
+
SuggestionBarV2 = "SuggestionBarV2",
|
|
689
|
+
ImagePromptCard = "ImagePromptCard",
|
|
690
|
+
ImageBanner = "ImageBanner",
|
|
691
|
+
SingleImagePrompt = "SingleImagePrompt",
|
|
692
|
+
SearchPrompt = "SearchPrompt",
|
|
693
|
+
SearchZeroStateEntryPoint = "SearchZeroStateEntryPoint",
|
|
694
|
+
SearchResultsEntryPoint = "SearchResultsEntryPoint",
|
|
695
|
+
SearchOverlayHost = "SearchOverlayHost",
|
|
696
|
+
NoOp = "NoOp",
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
type WidgetConfig =
|
|
700
|
+
| ChatPreviewWidgetConfig
|
|
701
|
+
| SocialProofV2WidgetConfig
|
|
702
|
+
| ChatPreviewV2WidgetConfig
|
|
703
|
+
| ChatPreviewPostInteractionWidgetConfig
|
|
704
|
+
| ChatPreviewIsLoadingWidgetConfig
|
|
705
|
+
| ChatPreviewProductComparisonWidgetConfig
|
|
706
|
+
| SuggestionBarWidgetV2Config
|
|
707
|
+
| ImagePromptWidgetConfig
|
|
708
|
+
| ImageBannerWidgetConfig
|
|
709
|
+
| SingleImagePromptWidgetConfig
|
|
710
|
+
| SearchPromptWidgetConfig
|
|
711
|
+
| SearchEntryPointWidgetConfig
|
|
712
|
+
| SearchResultsEntryPointWidgetConfig
|
|
713
|
+
| SearchOverlayHostWidgetConfig
|
|
714
|
+
| NoOpWidgetConfig;
|
|
715
|
+
|
|
716
|
+
interface BaseWidgetConfig<T extends WidgetType> {
|
|
717
|
+
widgetConfigId: string;
|
|
718
|
+
type: T;
|
|
719
|
+
contentId?: string;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
interface ImageBannerWidgetConfig
|
|
723
|
+
extends BaseWidgetConfig<WidgetType.ImageBanner> {
|
|
724
|
+
imageSrc: string;
|
|
725
|
+
title: string;
|
|
726
|
+
subtitle: string;
|
|
727
|
+
assistantMessage: string;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
interface ChatPreviewWidgetConfig
|
|
731
|
+
extends BaseWidgetConfig<WidgetType.ChatPreview> {
|
|
732
|
+
variant: "filled" | "flat" | "outlined";
|
|
733
|
+
addSeparators?: boolean;
|
|
734
|
+
socialProofConfig?: SocialProofConfig;
|
|
735
|
+
footerConfig?: ChatPreviewFooterConfig;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
interface ChatPreviewHeaderV2Config {
|
|
739
|
+
title?: string; // Default: 'Shopping Assistant'
|
|
740
|
+
imageSrc?: string;
|
|
741
|
+
imageHeight?: number;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
type SingleImageConfig = {
|
|
745
|
+
layout: "single";
|
|
746
|
+
imageIndex: number;
|
|
747
|
+
};
|
|
748
|
+
type MultiImageConfig = {
|
|
749
|
+
layout: "grid" | "horizontal";
|
|
750
|
+
imageNames: string[];
|
|
751
|
+
};
|
|
752
|
+
type SocialProofImageConfig = SingleImageConfig | MultiImageConfig;
|
|
753
|
+
|
|
754
|
+
type ChatPreviewSuggestionButtonConfig = {
|
|
755
|
+
buttonStrings: string[];
|
|
756
|
+
accentButtonVariants?: {
|
|
757
|
+
button: SuggestionButtonVariant;
|
|
758
|
+
hover: SuggestionButtonVariant;
|
|
759
|
+
};
|
|
760
|
+
buttonVariants: {
|
|
761
|
+
button: SuggestionButtonVariant;
|
|
762
|
+
hover: SuggestionButtonVariant;
|
|
763
|
+
};
|
|
764
|
+
numRows?: NumRows;
|
|
765
|
+
};
|
|
766
|
+
|
|
767
|
+
type ChatPreviewAnimatedTextConfig = {
|
|
768
|
+
leadingText: string;
|
|
769
|
+
animatedStrings: string[];
|
|
770
|
+
};
|
|
771
|
+
|
|
772
|
+
type ChatPreviewVariant =
|
|
773
|
+
| { variant: "flat" }
|
|
774
|
+
| { variant: "filled"; backgroundFillColor: string }
|
|
775
|
+
| { variant: "outlined" };
|
|
776
|
+
|
|
777
|
+
// Base interface for common chat preview properties
|
|
778
|
+
interface BaseChatPreviewConfig {
|
|
779
|
+
headerConfig: ChatPreviewHeaderV2Config;
|
|
780
|
+
suggestionButtonsConfig: ChatPreviewSuggestionButtonConfig;
|
|
781
|
+
userQueryButtonConfig: UserQueryButtonConfig;
|
|
782
|
+
chatPreviewVariant: ChatPreviewVariant;
|
|
783
|
+
addSeparators?: boolean;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
// Specific chat preview widget configurations
|
|
787
|
+
interface ChatPreviewPostInteractionWidgetConfig
|
|
788
|
+
extends BaseWidgetConfig<WidgetType.ChatPreviewPostInteraction>,
|
|
789
|
+
BaseChatPreviewConfig {
|
|
790
|
+
chatPreviewVariant: ChatPreviewVariant;
|
|
791
|
+
addSeparators?: boolean;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
interface ChatPreviewIsLoadingWidgetConfig
|
|
795
|
+
extends BaseWidgetConfig<WidgetType.ChatPreviewIsLoading>,
|
|
796
|
+
BaseChatPreviewConfig {}
|
|
797
|
+
|
|
798
|
+
interface ChatPreviewProductComparisonWidgetConfig
|
|
799
|
+
extends BaseWidgetConfig<WidgetType.ChatPreviewProductComparison>,
|
|
800
|
+
BaseChatPreviewConfig {
|
|
801
|
+
useLargeProductComparison?: boolean;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
interface ChatPreviewV2WidgetConfig
|
|
805
|
+
extends BaseWidgetConfig<WidgetType.ChatPreviewV2>,
|
|
806
|
+
BaseChatPreviewConfig {
|
|
807
|
+
animatedTextConfig: ChatPreviewAnimatedTextConfig;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
interface SocialProofV2WidgetConfig
|
|
811
|
+
extends BaseWidgetConfig<WidgetType.SocialProofV2>,
|
|
812
|
+
BaseChatPreviewConfig {
|
|
813
|
+
customerQuery?: string; // Default: 'asked which products are the best'
|
|
814
|
+
imageConfig: SocialProofImageConfig;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
interface SuggestionBarWidgetV2Config
|
|
818
|
+
extends BaseWidgetConfig<WidgetType.SuggestionBarV2> {
|
|
819
|
+
metricDisplayLocation: ChatElementDisplayLocation;
|
|
820
|
+
location: SuggestionBarLocationForMetrics;
|
|
821
|
+
variant: SuggestionButtonVariant;
|
|
822
|
+
hoverVariant: SuggestionButtonVariant;
|
|
823
|
+
buttonTexts: {
|
|
824
|
+
default: string[];
|
|
825
|
+
productSpecific?: { [productId: string]: string[] };
|
|
826
|
+
};
|
|
827
|
+
boldFirstButton?: boolean;
|
|
828
|
+
twoRowsOnMobile?: boolean;
|
|
829
|
+
animationSpeed?: "standard" | "slow" | "none";
|
|
830
|
+
buttonBorderRadius?: "sm" | "md" | "lg";
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
interface ImagePromptWidgetConfig
|
|
834
|
+
extends BaseWidgetConfig<WidgetType.ImagePromptCard> {
|
|
835
|
+
url: string;
|
|
836
|
+
lightText?: boolean;
|
|
837
|
+
title: string;
|
|
838
|
+
subtitle: string[];
|
|
839
|
+
staticSuggestionCopies: string[];
|
|
840
|
+
userQueryButtonConfig: UserQueryButtonConfig;
|
|
841
|
+
fallbackBackgroundColor?: string;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
interface SingleImagePromptWidgetConfig
|
|
845
|
+
extends BaseWidgetConfig<WidgetType.SingleImagePrompt> {
|
|
846
|
+
title: string;
|
|
847
|
+
staticSuggestionCopies: string[];
|
|
848
|
+
userQueryButtonConfig: UserQueryButtonConfig;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
interface SearchEntryPointWidgetConfig
|
|
852
|
+
extends BaseWidgetConfig<WidgetType.SearchZeroStateEntryPoint> {
|
|
853
|
+
searchZeroStateVariant: SearchZeroStateVariant;
|
|
854
|
+
searchInputVariant: SearchInputVariant;
|
|
855
|
+
searchIconVariant?: SearchIconVariant;
|
|
856
|
+
searchIconSize?: number;
|
|
857
|
+
suggestionButtonConfig: SuggestionButtonConfig;
|
|
858
|
+
layout: SearchZeroStateLayout;
|
|
859
|
+
searchBoxPlaceholder: string;
|
|
860
|
+
animationSpeed?: "standard" | "slow" | "none";
|
|
861
|
+
compactLabel?: string;
|
|
862
|
+
initialSuggestions?: string[];
|
|
863
|
+
usingPortal?: boolean;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
interface NoOpWidgetConfig extends BaseWidgetConfig<WidgetType.NoOp> {}
|
|
867
|
+
interface SearchOverlayHostWidgetConfig
|
|
868
|
+
extends BaseWidgetConfig<WidgetType.SearchOverlayHost> {}
|
|
869
|
+
|
|
870
|
+
interface SearchResultsEntryPointWidgetConfig
|
|
871
|
+
extends BaseWidgetConfig<WidgetType.SearchResultsEntryPoint> {
|
|
872
|
+
searchInputVariant: SearchInputVariant;
|
|
873
|
+
searchFilterSidebarVariant: SearchFilterSidebarVariant;
|
|
874
|
+
productGridVariant: ProductGridVariant;
|
|
875
|
+
searchBoxPlaceholder: string;
|
|
876
|
+
noResultsFoundText?: string;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
export interface WidgetHeaderProps extends TestProps {
|
|
880
|
+
title?: string;
|
|
881
|
+
logo?: string;
|
|
882
|
+
logoHeight?: number;
|
|
883
|
+
orgShortName: string;
|
|
884
|
+
variant?: SearchPromptVariant;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
export interface UserQueryOptions {
|
|
888
|
+
footerVariant?: "standard";
|
|
889
|
+
replyButtonText?: string;
|
|
890
|
+
replyButtonIcon?:
|
|
891
|
+
| "magnifyingGlass"
|
|
892
|
+
| "send"
|
|
893
|
+
| "thinMagnifyingGlass"
|
|
894
|
+
| "ai-search";
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
type SearchPromptVariant = "primary";
|
|
898
|
+
interface SearchPromptWidgetConfig
|
|
899
|
+
extends BaseWidgetConfig<WidgetType.SearchPrompt> {
|
|
900
|
+
variant: SearchPromptVariant;
|
|
901
|
+
title: string;
|
|
902
|
+
headerConfig: WidgetHeaderProps;
|
|
903
|
+
suggestionButtons: {
|
|
904
|
+
variant: SuggestionButtonVariant;
|
|
905
|
+
hoverVariant: SuggestionButtonVariant;
|
|
906
|
+
buttonTexts: string[];
|
|
907
|
+
};
|
|
908
|
+
footerConfig?: UserQueryOptions;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
type PageVariantBase = {
|
|
912
|
+
// Unique identifier for each entry within the pageVariants.
|
|
913
|
+
// Useful to differentiate which variant is loaded when there are multiples of a single type.
|
|
914
|
+
variantId: string;
|
|
915
|
+
widgetMounting: WidgetMounting[];
|
|
916
|
+
variantTests: PageVariantTest[];
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
type PLPPageVariant = PageVariantBase & {
|
|
920
|
+
variantType: "plp";
|
|
921
|
+
plpIdExtractor: IdExtractor;
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
type PDPPageVariant = PageVariantBase & {
|
|
925
|
+
variantType: "pdp";
|
|
926
|
+
parentProductIdExtractor?: IdExtractor;
|
|
927
|
+
productIdExtractor: IdExtractor;
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
type VisitPageVariant = PageVariantBase & {
|
|
931
|
+
variantType: "page_visit";
|
|
932
|
+
};
|
|
933
|
+
|
|
934
|
+
type OtherPageVariant = PageVariantBase & {
|
|
935
|
+
variantType: "other";
|
|
936
|
+
};
|
|
937
|
+
|
|
938
|
+
type HomePageVariant = PageVariantBase & {
|
|
939
|
+
variantType: "homepage";
|
|
940
|
+
};
|
|
941
|
+
|
|
942
|
+
type SearchPageVariant = PageVariantBase & {
|
|
943
|
+
variantType: "search";
|
|
944
|
+
};
|
|
945
|
+
|
|
946
|
+
export type PageVariantConfig =
|
|
947
|
+
| PLPPageVariant
|
|
948
|
+
| PDPPageVariant
|
|
949
|
+
| VisitPageVariant
|
|
950
|
+
| OtherPageVariant
|
|
951
|
+
| HomePageVariant
|
|
952
|
+
| SearchPageVariant;
|
|
953
|
+
|
|
954
|
+
export type OrgPageConfig = {
|
|
955
|
+
// pageVariants is a list of page variants that we support.
|
|
956
|
+
pageVariants: PageVariantConfig[];
|
|
957
|
+
// widgetConfigs is a named set of widget configs
|
|
958
|
+
widgetConfigs: Record<string, WidgetConfig>;
|
|
959
|
+
mountingConfigs: Record<string, WidgetMountingConfig>;
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
interface OrgConfigContextType {
|
|
963
|
+
orgUIConfig: OrgUIConfig;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
export {
|
|
967
|
+
CategoryExtractorType,
|
|
968
|
+
ColorNames,
|
|
969
|
+
colorVar,
|
|
970
|
+
PageVariantTestType,
|
|
971
|
+
WidgetType,
|
|
972
|
+
};
|
|
973
|
+
|
|
974
|
+
export interface EnviveConfig {
|
|
975
|
+
amplitudeApiKey: string;
|
|
976
|
+
dataResidency: string;
|
|
977
|
+
env: string;
|
|
978
|
+
baseUrl: string;
|
|
979
|
+
reactAppName: string;
|
|
980
|
+
cdnUrl: string;
|
|
981
|
+
contextSource: string;
|
|
982
|
+
orgLevelApiKey: string;
|
|
983
|
+
orgShortName: string;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
export type {
|
|
987
|
+
CategoryExtractor,
|
|
988
|
+
ChatMessageVariant,
|
|
989
|
+
ChatMessageConfig,
|
|
990
|
+
ChatPreviewConfig,
|
|
991
|
+
ChatPreviewIsLoadingWidgetConfig,
|
|
992
|
+
ChatPreviewPostInteractionWidgetConfig,
|
|
993
|
+
ChatPreviewProductComparisonWidgetConfig,
|
|
994
|
+
ChatPreviewSuggestionButtonConfig,
|
|
995
|
+
SocialProofV2WidgetConfig,
|
|
996
|
+
ChatPreviewHeaderV2Config,
|
|
997
|
+
ChatPreviewV2WidgetConfig,
|
|
998
|
+
ChatPreviewFooterConfig,
|
|
999
|
+
ChatPreviewHeaderConfig,
|
|
1000
|
+
ChatPreviewWidgetConfig,
|
|
1001
|
+
ChatPreviewVariant,
|
|
1002
|
+
ColorMapping,
|
|
1003
|
+
CustomerServiceIntegration,
|
|
1004
|
+
FloatingEntryPointConfig,
|
|
1005
|
+
FullCustomerServiceIntegration,
|
|
1006
|
+
IdExtractor,
|
|
1007
|
+
ImageBannerWidgetConfig,
|
|
1008
|
+
ImagePromptWidgetConfig,
|
|
1009
|
+
InsertionPoint,
|
|
1010
|
+
MultiImageConfig,
|
|
1011
|
+
OrgConfigContextType,
|
|
1012
|
+
OrgUIConfig,
|
|
1013
|
+
PageCardConfig,
|
|
1014
|
+
PageCardVariant,
|
|
1015
|
+
PageCardHoverVariant,
|
|
1016
|
+
PageCardIconVariant,
|
|
1017
|
+
ProductCardConfig,
|
|
1018
|
+
ProductCardVariant,
|
|
1019
|
+
ProductCardLayoutVariant,
|
|
1020
|
+
ProductCardHoverVariant,
|
|
1021
|
+
ProductLinkHoverVariant,
|
|
1022
|
+
ProductLinkIconVariant,
|
|
1023
|
+
ProductLinkVariant,
|
|
1024
|
+
ProductReviewConfig,
|
|
1025
|
+
ProductReviewStyleVariant,
|
|
1026
|
+
ProductReviewColorVariant,
|
|
1027
|
+
SearchPromptVariant,
|
|
1028
|
+
SearchPromptWidgetConfig,
|
|
1029
|
+
SearchResultsEntryPointWidgetConfig,
|
|
1030
|
+
ShowFloatingButtonOptions,
|
|
1031
|
+
SingleImagePromptWidgetConfig,
|
|
1032
|
+
SearchEntryPointWidgetConfig,
|
|
1033
|
+
SearchOverlayHostWidgetConfig,
|
|
1034
|
+
SocialProofConfig,
|
|
1035
|
+
SuggestionBarWidgetV2Config,
|
|
1036
|
+
SuggestionButtonConfig,
|
|
1037
|
+
SuggestionButtonVariant,
|
|
1038
|
+
URLTest,
|
|
1039
|
+
UserQueryButtonConfig,
|
|
1040
|
+
UserQueryButtonIcon,
|
|
1041
|
+
WelcomeSectionConfig,
|
|
1042
|
+
WelcomeSectionVariant,
|
|
1043
|
+
WelcomeSectionColorVariant,
|
|
1044
|
+
WidgetConfig,
|
|
1045
|
+
WrappingElement,
|
|
1046
|
+
SearchCardVariant,
|
|
1047
|
+
WidgetDisplayTests,
|
|
1048
|
+
NoOpWidgetConfig,
|
|
1049
|
+
WidgetMounting,
|
|
1050
|
+
StaticWidgetMounting,
|
|
1051
|
+
DynamicWidgetMounting,
|
|
1052
|
+
PDPPageVariant,
|
|
1053
|
+
PLPPageVariant,
|
|
1054
|
+
VisitPageVariant,
|
|
1055
|
+
OtherPageVariant,
|
|
1056
|
+
HomePageVariant,
|
|
1057
|
+
SearchPageVariant,
|
|
1058
|
+
NumRows,
|
|
1059
|
+
};
|