@athoscommerce/snap-preact 1.2.3-beta.3 → 1.2.3-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/dist/cjs/components/src/components/Atoms/TemplateSelect/TemplateSelect.d.ts +3 -3
- package/dist/cjs/components/src/components/Atoms/TemplateSelect/TemplateSelect.d.ts.map +1 -1
- package/dist/cjs/components/src/components/Atoms/TemplateSelect/TemplateSelect.js +7 -8
- package/dist/cjs/components/src/components/Molecules/ChatInspirationResultMessage/ChatInspirationResultMessage.d.ts +1 -1
- package/dist/cjs/components/src/components/Molecules/ChatInspirationResultMessage/ChatInspirationResultMessage.d.ts.map +1 -1
- package/dist/cjs/components/src/components/Molecules/ChatInspirationResultMessage/ChatInspirationResultMessage.js +3 -3
- package/dist/cjs/components/src/components/Molecules/ChatProductQueryMessage/ChatProductQueryMessage.d.ts +2 -0
- package/dist/cjs/components/src/components/Molecules/ChatProductQueryMessage/ChatProductQueryMessage.d.ts.map +1 -1
- package/dist/cjs/components/src/components/Molecules/ChatProductQueryMessage/ChatProductQueryMessage.js +29 -27
- package/dist/cjs/components/src/components/Molecules/Filter/Filter.d.ts +1 -1
- package/dist/cjs/components/src/components/Molecules/Filter/Filter.d.ts.map +1 -1
- package/dist/cjs/components/src/components/Molecules/Result/Result.d.ts.map +1 -1
- package/dist/cjs/components/src/components/Molecules/Result/Result.js +11 -6
- package/dist/cjs/components/src/components/Molecules/SearchInput/SearchInput.d.ts +4 -1
- package/dist/cjs/components/src/components/Molecules/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/cjs/components/src/components/Molecules/SearchInput/SearchInput.js +3 -3
- package/dist/cjs/components/src/components/Molecules/TemplatesEditor/Components/AbstractedControls.js +5 -5
- package/dist/cjs/components/src/components/Molecules/TemplatesEditor/Components/Control.d.ts.map +1 -1
- package/dist/cjs/components/src/components/Molecules/TemplatesEditor/Components/Control.js +31 -31
- package/dist/cjs/components/src/components/Molecules/TemplatesEditor/TemplatesEditor.d.ts.map +1 -1
- package/dist/cjs/components/src/components/Molecules/TemplatesEditor/TemplatesEditor.js +22 -36
- package/dist/cjs/components/src/components/Organisms/Chat/Chat.d.ts +8 -0
- package/dist/cjs/components/src/components/Organisms/Chat/Chat.d.ts.map +1 -1
- package/dist/cjs/components/src/components/Organisms/Chat/Chat.js +715 -427
- package/dist/cjs/components/src/components/Organisms/Chat/ChatResult.d.ts.map +1 -1
- package/dist/cjs/components/src/components/Organisms/Chat/ChatResult.js +13 -3
- package/dist/cjs/components/src/components/Organisms/Chat/MessageText.d.ts +3 -1
- package/dist/cjs/components/src/components/Organisms/Chat/MessageText.d.ts.map +1 -1
- package/dist/cjs/components/src/components/Organisms/Chat/MessageText.js +22 -19
- package/dist/cjs/components/src/components/Organisms/Chat/MessageUser.d.ts +3 -1
- package/dist/cjs/components/src/components/Organisms/Chat/MessageUser.d.ts.map +1 -1
- package/dist/cjs/components/src/components/Organisms/Chat/MessageUser.js +40 -23
- package/dist/cjs/components/src/components/Organisms/Chat/ResultsDisplay.d.ts +1 -1
- package/dist/cjs/components/src/components/Organisms/Chat/ResultsDisplay.d.ts.map +1 -1
- package/dist/cjs/components/src/components/Organisms/Chat/ResultsDisplay.js +8 -7
- package/dist/cjs/components/src/components/Organisms/Facet/Facet.js +2 -1
- package/dist/cjs/components/src/components/Organisms/FacetsHorizontal/FacetsHorizontal.js +2 -1
- package/dist/cjs/components/src/components/Organisms/FilterSummary/FilterSummary.d.ts +2 -2
- package/dist/cjs/components/src/components/Organisms/FilterSummary/FilterSummary.d.ts.map +1 -1
- package/dist/cjs/components/src/components/Organisms/ProductQuickView/ProductQuickView.d.ts +11 -0
- package/dist/cjs/components/src/components/Organisms/ProductQuickView/ProductQuickView.d.ts.map +1 -0
- package/dist/cjs/components/src/components/Organisms/ProductQuickView/ProductQuickView.js +461 -0
- package/dist/cjs/components/src/components/Organisms/ProductQuickView/index.d.ts +2 -0
- package/dist/cjs/components/src/components/Organisms/ProductQuickView/index.d.ts.map +1 -0
- package/dist/cjs/components/src/components/Organisms/ProductQuickView/index.js +17 -0
- package/dist/cjs/components/src/components/Templates/AutocompleteModal/AutocompleteModal.d.ts.map +1 -1
- package/dist/cjs/components/src/components/Templates/AutocompleteModal/AutocompleteModal.js +0 -2
- package/dist/cjs/components/src/hooks/useAcRenderedInput.d.ts.map +1 -1
- package/dist/cjs/components/src/hooks/useAcRenderedInput.js +65 -15
- package/dist/cjs/components/src/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/cjs/components/src/hooks/useMediaQuery.js +3 -1
- package/dist/cjs/components/src/index.d.ts +1 -0
- package/dist/cjs/components/src/index.d.ts.map +1 -1
- package/dist/cjs/components/src/index.js +1 -0
- package/dist/cjs/components/src/providers/theme.d.ts +1 -1
- package/dist/cjs/components/src/providers/theme.d.ts.map +1 -1
- package/dist/cjs/components/src/themes/base/base.js +3 -3
- package/dist/cjs/components/src/utilities/Colour/Colour.d.ts +11 -0
- package/dist/cjs/components/src/utilities/Colour/Colour.d.ts.map +1 -1
- package/dist/cjs/components/src/utilities/Colour/Colour.js +32 -0
- package/dist/cjs/src/Instantiators/RecommendationInstantiator.d.ts +1 -0
- package/dist/cjs/src/Instantiators/RecommendationInstantiator.d.ts.map +1 -1
- package/dist/cjs/src/Instantiators/RecommendationInstantiator.js +161 -123
- package/dist/cjs/src/Snap.d.ts +1 -1
- package/dist/cjs/src/Snap.d.ts.map +1 -1
- package/dist/cjs/src/Snap.js +18 -6
- package/dist/cjs/src/SnapHybrid.d.ts.map +1 -1
- package/dist/cjs/src/Templates/SnapTemplates.d.ts +13 -72
- package/dist/cjs/src/Templates/SnapTemplates.d.ts.map +1 -1
- package/dist/cjs/src/Templates/SnapTemplates.js +123 -72
- package/dist/cjs/src/Templates/Stores/TargetStore.d.ts +7 -6
- package/dist/cjs/src/Templates/Stores/TargetStore.d.ts.map +1 -1
- package/dist/cjs/src/Templates/Stores/TargetStore.js +14 -8
- package/dist/cjs/src/Templates/Stores/TemplateEditor/TemplateEditorStore.d.ts +58 -8
- package/dist/cjs/src/Templates/Stores/TemplateEditor/TemplateEditorStore.d.ts.map +1 -1
- package/dist/cjs/src/Templates/Stores/TemplateEditor/TemplateEditorStore.js +467 -96
- package/dist/cjs/src/Templates/Stores/TemplateEditor/uiAbstractions/autocompleteControllerUI.d.ts +1 -0
- package/dist/cjs/src/Templates/Stores/TemplateEditor/uiAbstractions/autocompleteControllerUI.d.ts.map +1 -1
- package/dist/cjs/src/Templates/Stores/TemplateEditor/uiAbstractions/autocompleteControllerUI.js +123 -70
- package/dist/cjs/src/Templates/Stores/TemplateEditor/uiAbstractions/configUI.d.ts.map +1 -1
- package/dist/cjs/src/Templates/Stores/TemplateEditor/uiAbstractions/configUI.js +9 -3
- package/dist/cjs/src/Templates/Stores/TemplateEditor/uiAbstractions/searchControllerUI.d.ts +1 -0
- package/dist/cjs/src/Templates/Stores/TemplateEditor/uiAbstractions/searchControllerUI.d.ts.map +1 -1
- package/dist/cjs/src/Templates/Stores/TemplateEditor/uiAbstractions/searchControllerUI.js +86 -1
- package/dist/cjs/src/Templates/Stores/TemplateEditor/uiAbstractions/themeUI.d.ts.map +1 -1
- package/dist/cjs/src/Templates/Stores/TemplateEditor/uiAbstractions/themeUI.js +33 -14
- package/dist/cjs/src/Templates/Stores/TemplateStore.d.ts +93 -30
- package/dist/cjs/src/Templates/Stores/TemplateStore.d.ts.map +1 -1
- package/dist/cjs/src/Templates/Stores/TemplateStore.js +33 -41
- package/dist/cjs/src/Templates/Stores/ThemeStore.d.ts +2 -8
- package/dist/cjs/src/Templates/Stores/ThemeStore.d.ts.map +1 -1
- package/dist/cjs/src/Templates/Stores/ThemeStore.js +3 -28
- package/dist/cjs/src/Templates/index.d.ts +1 -1
- package/dist/cjs/src/Templates/index.d.ts.map +1 -1
- package/dist/cjs/src/create/createChatController.js +1 -1
- package/dist/cjs/src/index.d.ts +1 -0
- package/dist/cjs/src/index.d.ts.map +1 -1
- package/dist/cjs/src/setupEvents.d.ts +13 -0
- package/dist/cjs/src/setupEvents.d.ts.map +1 -1
- package/dist/cjs/src/setupEvents.js +56 -8
- package/dist/cjs/src/types.d.ts +3 -1
- package/dist/cjs/src/types.d.ts.map +1 -1
- package/dist/cjs/src/utils/combineMerge.d.ts +2 -0
- package/dist/cjs/src/utils/combineMerge.d.ts.map +1 -0
- package/dist/cjs/src/utils/combineMerge.js +22 -0
- package/dist/cjs/src/utils/index.d.ts +1 -0
- package/dist/cjs/src/utils/index.d.ts.map +1 -1
- package/dist/cjs/src/utils/index.js +3 -1
- package/dist/esm/components/src/components/Atoms/TemplateSelect/TemplateSelect.d.ts +3 -3
- package/dist/esm/components/src/components/Atoms/TemplateSelect/TemplateSelect.d.ts.map +1 -1
- package/dist/esm/components/src/components/Atoms/TemplateSelect/TemplateSelect.js +7 -8
- package/dist/esm/components/src/components/Molecules/ChatInspirationResultMessage/ChatInspirationResultMessage.d.ts +1 -1
- package/dist/esm/components/src/components/Molecules/ChatInspirationResultMessage/ChatInspirationResultMessage.d.ts.map +1 -1
- package/dist/esm/components/src/components/Molecules/ChatInspirationResultMessage/ChatInspirationResultMessage.js +3 -3
- package/dist/esm/components/src/components/Molecules/ChatProductQueryMessage/ChatProductQueryMessage.d.ts +2 -0
- package/dist/esm/components/src/components/Molecules/ChatProductQueryMessage/ChatProductQueryMessage.d.ts.map +1 -1
- package/dist/esm/components/src/components/Molecules/ChatProductQueryMessage/ChatProductQueryMessage.js +29 -28
- package/dist/esm/components/src/components/Molecules/Filter/Filter.d.ts +1 -1
- package/dist/esm/components/src/components/Molecules/Filter/Filter.d.ts.map +1 -1
- package/dist/esm/components/src/components/Molecules/Result/Result.d.ts.map +1 -1
- package/dist/esm/components/src/components/Molecules/Result/Result.js +9 -4
- package/dist/esm/components/src/components/Molecules/SearchInput/SearchInput.d.ts +4 -1
- package/dist/esm/components/src/components/Molecules/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/esm/components/src/components/Molecules/SearchInput/SearchInput.js +3 -3
- package/dist/esm/components/src/components/Molecules/TemplatesEditor/Components/AbstractedControls.js +5 -5
- package/dist/esm/components/src/components/Molecules/TemplatesEditor/Components/Control.d.ts.map +1 -1
- package/dist/esm/components/src/components/Molecules/TemplatesEditor/Components/Control.js +29 -29
- package/dist/esm/components/src/components/Molecules/TemplatesEditor/TemplatesEditor.d.ts.map +1 -1
- package/dist/esm/components/src/components/Molecules/TemplatesEditor/TemplatesEditor.js +22 -35
- package/dist/esm/components/src/components/Organisms/Chat/Chat.d.ts +8 -0
- package/dist/esm/components/src/components/Organisms/Chat/Chat.d.ts.map +1 -1
- package/dist/esm/components/src/components/Organisms/Chat/Chat.js +636 -359
- package/dist/esm/components/src/components/Organisms/Chat/ChatResult.d.ts.map +1 -1
- package/dist/esm/components/src/components/Organisms/Chat/ChatResult.js +13 -3
- package/dist/esm/components/src/components/Organisms/Chat/MessageText.d.ts +3 -1
- package/dist/esm/components/src/components/Organisms/Chat/MessageText.d.ts.map +1 -1
- package/dist/esm/components/src/components/Organisms/Chat/MessageText.js +21 -19
- package/dist/esm/components/src/components/Organisms/Chat/MessageUser.d.ts +3 -1
- package/dist/esm/components/src/components/Organisms/Chat/MessageUser.d.ts.map +1 -1
- package/dist/esm/components/src/components/Organisms/Chat/MessageUser.js +37 -23
- package/dist/esm/components/src/components/Organisms/Chat/ResultsDisplay.d.ts +1 -1
- package/dist/esm/components/src/components/Organisms/Chat/ResultsDisplay.d.ts.map +1 -1
- package/dist/esm/components/src/components/Organisms/Chat/ResultsDisplay.js +8 -7
- package/dist/esm/components/src/components/Organisms/Facet/Facet.js +1 -1
- package/dist/esm/components/src/components/Organisms/FacetsHorizontal/FacetsHorizontal.js +1 -1
- package/dist/esm/components/src/components/Organisms/FilterSummary/FilterSummary.d.ts +2 -2
- package/dist/esm/components/src/components/Organisms/FilterSummary/FilterSummary.d.ts.map +1 -1
- package/dist/esm/components/src/components/Organisms/ProductQuickView/ProductQuickView.d.ts +11 -0
- package/dist/esm/components/src/components/Organisms/ProductQuickView/ProductQuickView.d.ts.map +1 -0
- package/dist/esm/components/src/components/Organisms/ProductQuickView/ProductQuickView.js +436 -0
- package/dist/esm/components/src/components/Organisms/ProductQuickView/index.d.ts +2 -0
- package/dist/esm/components/src/components/Organisms/ProductQuickView/index.d.ts.map +1 -0
- package/dist/esm/components/src/components/Organisms/ProductQuickView/index.js +1 -0
- package/dist/esm/components/src/components/Templates/AutocompleteModal/AutocompleteModal.d.ts.map +1 -1
- package/dist/esm/components/src/components/Templates/AutocompleteModal/AutocompleteModal.js +0 -2
- package/dist/esm/components/src/hooks/useAcRenderedInput.d.ts.map +1 -1
- package/dist/esm/components/src/hooks/useAcRenderedInput.js +61 -11
- package/dist/esm/components/src/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/esm/components/src/hooks/useMediaQuery.js +3 -1
- package/dist/esm/components/src/index.d.ts +1 -0
- package/dist/esm/components/src/index.d.ts.map +1 -1
- package/dist/esm/components/src/index.js +1 -0
- package/dist/esm/components/src/providers/theme.d.ts +1 -1
- package/dist/esm/components/src/providers/theme.d.ts.map +1 -1
- package/dist/esm/components/src/themes/base/base.js +3 -3
- package/dist/esm/components/src/utilities/Colour/Colour.d.ts +11 -0
- package/dist/esm/components/src/utilities/Colour/Colour.d.ts.map +1 -1
- package/dist/esm/components/src/utilities/Colour/Colour.js +30 -0
- package/dist/esm/src/Instantiators/RecommendationInstantiator.d.ts +1 -0
- package/dist/esm/src/Instantiators/RecommendationInstantiator.d.ts.map +1 -1
- package/dist/esm/src/Instantiators/RecommendationInstantiator.js +130 -84
- package/dist/esm/src/Snap.d.ts +1 -1
- package/dist/esm/src/Snap.d.ts.map +1 -1
- package/dist/esm/src/Snap.js +21 -6
- package/dist/esm/src/SnapHybrid.d.ts.map +1 -1
- package/dist/esm/src/Templates/SnapTemplates.d.ts +13 -72
- package/dist/esm/src/Templates/SnapTemplates.d.ts.map +1 -1
- package/dist/esm/src/Templates/SnapTemplates.js +137 -78
- package/dist/esm/src/Templates/Stores/TargetStore.d.ts +7 -6
- package/dist/esm/src/Templates/Stores/TargetStore.d.ts.map +1 -1
- package/dist/esm/src/Templates/Stores/TargetStore.js +14 -8
- package/dist/esm/src/Templates/Stores/TemplateEditor/TemplateEditorStore.d.ts +58 -8
- package/dist/esm/src/Templates/Stores/TemplateEditor/TemplateEditorStore.d.ts.map +1 -1
- package/dist/esm/src/Templates/Stores/TemplateEditor/TemplateEditorStore.js +447 -89
- package/dist/esm/src/Templates/Stores/TemplateEditor/uiAbstractions/autocompleteControllerUI.d.ts +1 -0
- package/dist/esm/src/Templates/Stores/TemplateEditor/uiAbstractions/autocompleteControllerUI.d.ts.map +1 -1
- package/dist/esm/src/Templates/Stores/TemplateEditor/uiAbstractions/autocompleteControllerUI.js +118 -66
- package/dist/esm/src/Templates/Stores/TemplateEditor/uiAbstractions/configUI.d.ts.map +1 -1
- package/dist/esm/src/Templates/Stores/TemplateEditor/uiAbstractions/configUI.js +9 -3
- package/dist/esm/src/Templates/Stores/TemplateEditor/uiAbstractions/searchControllerUI.d.ts +1 -0
- package/dist/esm/src/Templates/Stores/TemplateEditor/uiAbstractions/searchControllerUI.d.ts.map +1 -1
- package/dist/esm/src/Templates/Stores/TemplateEditor/uiAbstractions/searchControllerUI.js +82 -1
- package/dist/esm/src/Templates/Stores/TemplateEditor/uiAbstractions/themeUI.d.ts.map +1 -1
- package/dist/esm/src/Templates/Stores/TemplateEditor/uiAbstractions/themeUI.js +27 -8
- package/dist/esm/src/Templates/Stores/TemplateStore.d.ts +93 -30
- package/dist/esm/src/Templates/Stores/TemplateStore.d.ts.map +1 -1
- package/dist/esm/src/Templates/Stores/TemplateStore.js +29 -38
- package/dist/esm/src/Templates/Stores/ThemeStore.d.ts +2 -8
- package/dist/esm/src/Templates/Stores/ThemeStore.d.ts.map +1 -1
- package/dist/esm/src/Templates/Stores/ThemeStore.js +3 -26
- package/dist/esm/src/Templates/index.d.ts +1 -1
- package/dist/esm/src/Templates/index.d.ts.map +1 -1
- package/dist/esm/src/create/createChatController.js +1 -1
- package/dist/esm/src/index.d.ts +1 -0
- package/dist/esm/src/index.d.ts.map +1 -1
- package/dist/esm/src/setupEvents.d.ts +13 -0
- package/dist/esm/src/setupEvents.d.ts.map +1 -1
- package/dist/esm/src/setupEvents.js +25 -8
- package/dist/esm/src/types.d.ts +3 -1
- package/dist/esm/src/types.d.ts.map +1 -1
- package/dist/esm/src/utils/combineMerge.d.ts +2 -0
- package/dist/esm/src/utils/combineMerge.d.ts.map +1 -0
- package/dist/esm/src/utils/combineMerge.js +16 -0
- package/dist/esm/src/utils/index.d.ts +1 -0
- package/dist/esm/src/utils/index.d.ts.map +1 -1
- package/dist/esm/src/utils/index.js +1 -0
- package/package.json +20 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../components/src/providers/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEzE,eAAO,MAAM,YAAY,EAAE,KAc1B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,KAAK,mBAAmB,GAAG;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,WAAW,EAAE,wBAAwB,CAAC;IACtC,MAAM,EAAE,mBAAmB,CAAC;CAC5B,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IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE;CACrF,CAAC;AACF,MAAM,MAAM,4CAA4C,GAAG,mBAAmB,CAAC,yBAAyB,CAAC,CAAC;AAG1G,MAAM,MAAM,uBAAuB,GAAG;IACrC,MAAM,CAAC,EAAE,4CAA4C,CAAC;IACtD,MAAM,CAAC,EAAE,4CAA4C,CAAC;IACtD,OAAO,CAAC,EAAE,4CAA4C,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,uBAAuB,GAAG;IAAE,OAAO,CAAC,EAAE,4CAA4C,CAAA;CAAE,CAAC;AAEnI,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEzE,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,YAAY,CAAC,GAAG;IAC7E,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC,UAAU,CAAC,EAAE,yBAAyB,CAAC;CACvC,CAAC;AACF,MAAM,MAAM,cAAc,GAAG;IAAE,UAAU,CAAC,EAAE,yBAAyB,CAAC;IAAC,UAAU,CAAC,EAAE,eAAe,CAAA;CAAE,CAAC;AAEtG,MAAM,MAAM,YAAY,GAAG;IAAE,UAAU,CAAC,EAAE,yBAAyB,CAAA;CAAE,CAAC"}
|
|
@@ -12,11 +12,22 @@ export declare class Colour {
|
|
|
12
12
|
opacity(offset: number): Colour;
|
|
13
13
|
transparency(offset: number): Colour;
|
|
14
14
|
opaque(offset: number): Colour;
|
|
15
|
+
/** Returns a hex string mixed linearly toward black. `amount` (0-1) is the proportion
|
|
16
|
+
* of black in the result — 0.9 yields a near-black with a slight tint of the original.
|
|
17
|
+
* Uses linear RGB mixing so light inputs reliably produce darker outputs. */
|
|
18
|
+
darkenHex(amount?: number): string;
|
|
19
|
+
/** Returns a hex string mixed linearly toward white. `amount` (0-1) is the proportion
|
|
20
|
+
* of white in the result — 0.9 yields a near-white with a slight tint of the original.
|
|
21
|
+
* Uses linear RGB mixing so dark inputs reliably produce paler outputs. */
|
|
22
|
+
lightenHex(amount?: number): string;
|
|
15
23
|
static isRgb(color: string): boolean;
|
|
16
24
|
static isHex(color: string): boolean;
|
|
17
25
|
static hexToRgb(hex: string): string;
|
|
18
26
|
static rgbToHex(rgb: string): string;
|
|
19
27
|
static opacity(color: string | undefined, offset: number): string | undefined;
|
|
28
|
+
/** Linear RGB mix between two hex colors. `amount` (0-1) is the proportion of `towardHex`
|
|
29
|
+
* in the result. Returns the source `hex` unchanged when either input is invalid. */
|
|
30
|
+
static mixToward(hex: string | undefined, towardHex: string, amount: number): string;
|
|
20
31
|
static brightness(color: string | undefined, offset: number): string | undefined;
|
|
21
32
|
}
|
|
22
33
|
//# sourceMappingURL=Colour.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Colour.d.ts","sourceRoot":"","sources":["../../../../../../components/src/utilities/Colour/Colour.ts"],"names":[],"mappings":"AAqBA,qBAAa,MAAM;IAClB,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,QAAQ,CAAqB;IAErC,IAAW,GAAG,IAAI,MAAM,GAAG,SAAS,CAOnC;IAED,IAAW,GAAG,IAAI,MAAM,GAAG,SAAS,CAOnC;IAED,IAAW,QAAQ,IAAI,MAAM,GAAG,SAAS,CAoBxC;gBAEW,KAAK,EAAE,MAAM,GAAG,SAAS;IAuBrC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAI7B,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAK/B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAK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,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAKpC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAK9B;;iFAE6E;IAC7E,SAAS,CAAC,MAAM,GAAE,MAAY,GAAG,MAAM;IAIvC;;+EAE2E;IAC3E,UAAU,CAAC,MAAM,GAAE,MAAY,GAAG,MAAM;IAIxC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAOpC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIpC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAgBpC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAoBpC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IA+B7E;yFACqF;IACrF,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAqBpF,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAoChF"}
|
|
@@ -99,6 +99,18 @@ export class Colour {
|
|
|
99
99
|
return this;
|
|
100
100
|
return new Colour(Colour.opacity(this.hex, -offset));
|
|
101
101
|
}
|
|
102
|
+
/** Returns a hex string mixed linearly toward black. `amount` (0-1) is the proportion
|
|
103
|
+
* of black in the result — 0.9 yields a near-black with a slight tint of the original.
|
|
104
|
+
* Uses linear RGB mixing so light inputs reliably produce darker outputs. */
|
|
105
|
+
darkenHex(amount = 0.3) {
|
|
106
|
+
return Colour.mixToward(this.hex, '#000000', amount);
|
|
107
|
+
}
|
|
108
|
+
/** Returns a hex string mixed linearly toward white. `amount` (0-1) is the proportion
|
|
109
|
+
* of white in the result — 0.9 yields a near-white with a slight tint of the original.
|
|
110
|
+
* Uses linear RGB mixing so dark inputs reliably produce paler outputs. */
|
|
111
|
+
lightenHex(amount = 0.3) {
|
|
112
|
+
return Colour.mixToward(this.hex, '#ffffff', amount);
|
|
113
|
+
}
|
|
102
114
|
static isRgb(color) {
|
|
103
115
|
return Boolean(color.match(/^rgba?\([0-9]{1,3}[\s,\,]+[0-9]{1,3}[\s,\,]+[0-9]{1,3}[\s,\,]*\)$/i) ||
|
|
104
116
|
color.match(/^rgba?\([0-9]{1,3}[\s,\,]+[0-9]{1,3}[\s,\,]+[0-9]{1,3}[\s,\,]+0?\.?[0-9]+%?[\s,\,]*\)$/i));
|
|
@@ -167,6 +179,24 @@ export class Colour {
|
|
|
167
179
|
}
|
|
168
180
|
return hexValue;
|
|
169
181
|
}
|
|
182
|
+
/** Linear RGB mix between two hex colors. `amount` (0-1) is the proportion of `towardHex`
|
|
183
|
+
* in the result. Returns the source `hex` unchanged when either input is invalid. */
|
|
184
|
+
static mixToward(hex, towardHex, amount) {
|
|
185
|
+
if (!hex || !Colour.isHex(hex) || !Colour.isHex(towardHex))
|
|
186
|
+
return hex || '';
|
|
187
|
+
const clamped = Math.max(0, Math.min(1, amount));
|
|
188
|
+
const sourceR = parseInt(hex.slice(1, 3), 16);
|
|
189
|
+
const sourceG = parseInt(hex.slice(3, 5), 16);
|
|
190
|
+
const sourceB = parseInt(hex.slice(5, 7), 16);
|
|
191
|
+
const targetR = parseInt(towardHex.slice(1, 3), 16);
|
|
192
|
+
const targetG = parseInt(towardHex.slice(3, 5), 16);
|
|
193
|
+
const targetB = parseInt(towardHex.slice(5, 7), 16);
|
|
194
|
+
const mix = (s, t) => Math.round(s * (1 - clamped) + t * clamped);
|
|
195
|
+
const r = mix(sourceR, targetR).toString(16).padStart(2, '0');
|
|
196
|
+
const g = mix(sourceG, targetG).toString(16).padStart(2, '0');
|
|
197
|
+
const b = mix(sourceB, targetB).toString(16).padStart(2, '0');
|
|
198
|
+
return `#${r}${g}${b}`;
|
|
199
|
+
}
|
|
170
200
|
static brightness(color, offset) {
|
|
171
201
|
let isRgb = false;
|
|
172
202
|
if (color && Colour.isRgb(color)) {
|
|
@@ -69,6 +69,7 @@ export declare class RecommendationInstantiator {
|
|
|
69
69
|
plugin(func: (cntrlr: AbstractController, ...args: any) => void | Promise<void>, ...args: unknown[]): void;
|
|
70
70
|
on<T>(event: string, ...func: Middleware<T>[]): void;
|
|
71
71
|
use(attachments: Attachments): void;
|
|
72
|
+
cleanupStaleControllers(): void;
|
|
72
73
|
}
|
|
73
74
|
type DefinedProps = {
|
|
74
75
|
[key: string]: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecommendationInstantiator.d.ts","sourceRoot":"","sources":["../../../../src/Instantiators/RecommendationInstantiator.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAc,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAA2D,MAAM,4BAA4B,CAAC;AACvI,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,KAAK,EACX,kBAAkB,EAClB,wBAAwB,EACxB,WAAW,EACX,gBAAgB,EAEhB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"RecommendationInstantiator.d.ts","sourceRoot":"","sources":["../../../../src/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AAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAAC,IAAI,EAAE,OAAO,EAAE,CAAA;KAAE,EAAE,CAAM;IAC9G,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAA;KAAE,EAAE,CAAM;gBAEzD,MAAM,EAAE,gCAAgC,EAAE,QAAQ,CAAC,EAAE,kCAAkC,EAAE,OAAO,CAAC,EAAE,gBAAgB;IAkOxH,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAI1G,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI;IAIpD,GAAG,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI;IAKnC,uBAAuB,IAAI,IAAI;CAqBtC;AA4LD,KAAK,YAAY,GAAG;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACnB,CAAC;AAEF,wBAAgB,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,YAAY,CAUrE"}
|
|
@@ -5,6 +5,7 @@ import { AppMode, DomTargeter, getContext } from '@athoscommerce/snap-toolbox';
|
|
|
5
5
|
import { Client } from '@athoscommerce/snap-client';
|
|
6
6
|
import { Logger } from '@athoscommerce/snap-logger';
|
|
7
7
|
import { Tracker } from '@athoscommerce/snap-tracker';
|
|
8
|
+
import { createRecommendationController } from '../create';
|
|
8
9
|
const DEFAULT_BRANCH = 'production';
|
|
9
10
|
export class RecommendationInstantiator {
|
|
10
11
|
constructor(config, services, context) {
|
|
@@ -40,29 +41,26 @@ export class RecommendationInstantiator {
|
|
|
40
41
|
this.tracker = services?.tracker || new Tracker(this.config.client.globals);
|
|
41
42
|
this.logger = services?.logger || new Logger({ prefix: 'RecommendationInstantiator ', mode: this.mode });
|
|
42
43
|
const profileCount = {};
|
|
44
|
+
// script block targeter for "grouped" and "legacy" blocks
|
|
43
45
|
this.targeter = new DomTargeter([
|
|
44
46
|
{
|
|
45
47
|
selector: `${this.config.selector ||
|
|
46
48
|
'script[type="searchspring/recommend"], script[type="searchspring/personalized-recommendations"], script[type="athos/recommend"], script[type="athos/personalized-recommendations"]'}, script[type="searchspring/recommend"][profile="email"], script[type="athos/recommend"][profile="email"]`,
|
|
47
49
|
autoRetarget: true,
|
|
48
50
|
clickRetarget: true,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
element: (target, origElement) => {
|
|
52
|
-
const profile = origElement.getAttribute('profile') || '';
|
|
53
|
-
const recsContainer = document.createElement('div');
|
|
54
|
-
recsContainer.setAttribute('searchspring-recommend', profile);
|
|
55
|
-
return recsContainer;
|
|
56
|
-
},
|
|
57
|
-
},
|
|
51
|
+
navigationRetarget: true,
|
|
52
|
+
emptyTarget: false,
|
|
58
53
|
},
|
|
59
54
|
{
|
|
60
55
|
selector: 'script[type="searchspring/recommendations"], script[type="athos/recommendations"]',
|
|
61
56
|
autoRetarget: true,
|
|
62
57
|
clickRetarget: true,
|
|
58
|
+
navigationRetarget: true,
|
|
63
59
|
emptyTarget: false,
|
|
64
60
|
},
|
|
65
|
-
], async (target, elem
|
|
61
|
+
], async (target, elem) => {
|
|
62
|
+
this.cleanupStaleControllers();
|
|
63
|
+
const scriptElement = elem;
|
|
66
64
|
const elemContext = getContext([
|
|
67
65
|
'shopperId',
|
|
68
66
|
'shopper',
|
|
@@ -77,7 +75,7 @@ export class RecommendationInstantiator {
|
|
|
77
75
|
'custom',
|
|
78
76
|
'profiles',
|
|
79
77
|
'globals',
|
|
80
|
-
],
|
|
78
|
+
], scriptElement);
|
|
81
79
|
if (elemContext.profiles && elemContext.profiles.length) {
|
|
82
80
|
// using the "grouped block" integration structure
|
|
83
81
|
// type the new profile specific integration context variables
|
|
@@ -91,34 +89,52 @@ export class RecommendationInstantiator {
|
|
|
91
89
|
cart: scriptContextGlobals?.cart && getArrayFunc(scriptContextGlobals.cart),
|
|
92
90
|
products: scriptContextGlobals?.products,
|
|
93
91
|
shopper: scriptContextGlobals?.shopper?.id,
|
|
94
|
-
batchId: Math.random(),
|
|
92
|
+
batchId: Math.floor(Math.random() * Number.MAX_SAFE_INTEGER),
|
|
95
93
|
}),
|
|
96
94
|
};
|
|
97
|
-
|
|
98
|
-
//
|
|
99
|
-
scriptContextProfiles.forEach((profile) => {
|
|
95
|
+
// create a per-profile DomTargeter for each profile so each controller
|
|
96
|
+
// gets its own targeter tracking its specific element
|
|
97
|
+
scriptContextProfiles.forEach((profile, index) => {
|
|
100
98
|
if (profile.selector) {
|
|
101
|
-
const
|
|
99
|
+
const profileTarget = {
|
|
102
100
|
selector: profile.selector,
|
|
103
101
|
autoRetarget: true,
|
|
104
|
-
clickRetarget: true,
|
|
105
102
|
profile,
|
|
103
|
+
order: index,
|
|
106
104
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
105
|
+
// track the controller for this profile so multiple matched elements share it
|
|
106
|
+
let profileControllerPromise;
|
|
107
|
+
new DomTargeter([profileTarget], async (target, targetElem, _originalElem, targeter) => {
|
|
108
|
+
// skip retarget if the source script element was removed and release the current target
|
|
109
|
+
if (scriptElement.isConnected === false) {
|
|
110
|
+
if (targetElem) {
|
|
111
|
+
targeter?.releaseTargets([targetElem]);
|
|
112
|
+
}
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (target.profile?.profile || target.profile?.tag) {
|
|
116
|
+
const profileRequestGlobals = {
|
|
117
|
+
...requestGlobals,
|
|
118
|
+
profile: { ...target.profile?.options, order: target.order },
|
|
119
|
+
tag: target.profile.tag || target.profile.profile, // have to support both tag and profile due to having profile at release, but will favor tag
|
|
120
|
+
};
|
|
121
|
+
const profileContext = deepmerge(this.context, defined({ globals: scriptContextGlobals, profile: target.profile }));
|
|
122
|
+
if (elemContext.custom) {
|
|
123
|
+
profileContext.custom = deepmerge(profileContext.custom, elemContext.custom);
|
|
124
|
+
}
|
|
125
|
+
if (!profileControllerPromise) {
|
|
126
|
+
// first element match — create the controller
|
|
127
|
+
profileControllerPromise = readyTheController(this, services || {}, targetElem, profileContext, profileCount, scriptElement, profileRequestGlobals, target, targeter);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
// subsequent element matches — reuse the existing controller and just render
|
|
131
|
+
const controller = await profileControllerPromise;
|
|
132
|
+
if (controller && targetElem) {
|
|
133
|
+
renderController(this, services || {}, controller, targetElem, scriptElement, target);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
});
|
|
122
138
|
}
|
|
123
139
|
});
|
|
124
140
|
}
|
|
@@ -138,7 +154,23 @@ export class RecommendationInstantiator {
|
|
|
138
154
|
profile: options,
|
|
139
155
|
}),
|
|
140
156
|
};
|
|
141
|
-
|
|
157
|
+
// inject a render container before the script element
|
|
158
|
+
const profileAttr = scriptElement.getAttribute('profile') || '';
|
|
159
|
+
const recsContainer = scriptElement.ownerDocument.createElement('div');
|
|
160
|
+
recsContainer.setAttribute('searchspring-recommend', profileAttr);
|
|
161
|
+
scriptElement.before(recsContainer);
|
|
162
|
+
const legacyContext = deepmerge(this.context, elemContext);
|
|
163
|
+
// create a per-element DomTargeter for the injected div (mirrors grouped block pattern)
|
|
164
|
+
new DomTargeter([{ selector: `[searchspring-recommend="${profileAttr}"]`, name: `legacy_${profile}_${profileCount[profile || ''] || 0}` }], async (_target, targetElem, _originalElem, targeter) => {
|
|
165
|
+
// skip retarget if the source script element was removed and release the current target
|
|
166
|
+
if (scriptElement.isConnected === false) {
|
|
167
|
+
if (targetElem) {
|
|
168
|
+
targeter?.releaseTargets([targetElem]);
|
|
169
|
+
}
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
readyTheController(this, services || {}, targetElem, legacyContext, profileCount, scriptElement, profileRequestGlobals, target, targeter);
|
|
173
|
+
});
|
|
142
174
|
}
|
|
143
175
|
});
|
|
144
176
|
}
|
|
@@ -151,26 +183,43 @@ export class RecommendationInstantiator {
|
|
|
151
183
|
use(attachments) {
|
|
152
184
|
this.uses.push(attachments);
|
|
153
185
|
}
|
|
186
|
+
// cleanup to ensure we release controllers no longer rendering in the DOM (memory leak prevention for SPA's)
|
|
187
|
+
cleanupStaleControllers() {
|
|
188
|
+
Object.keys(this.controller).forEach((id) => {
|
|
189
|
+
const controller = this.controller[id];
|
|
190
|
+
const targeters = Object.values(controller.targeters);
|
|
191
|
+
const hasConnectedTarget = targeters.some((targeter) => targeter.getTargetedElems().some((elem) => {
|
|
192
|
+
const attr = elem.isConnected !== false && elem.getAttribute('ss-controller-id');
|
|
193
|
+
return attr === id;
|
|
194
|
+
}));
|
|
195
|
+
if (!hasConnectedTarget) {
|
|
196
|
+
Object.keys(controller.targeters).forEach((targeterId) => controller.targeters[targeterId].destroy());
|
|
197
|
+
controller.targeters = {};
|
|
198
|
+
delete this.controller[id];
|
|
199
|
+
if (window.athos?.controller) {
|
|
200
|
+
delete window.athos.controller[id];
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
154
205
|
}
|
|
155
|
-
async function readyTheController(instance, services,
|
|
206
|
+
async function readyTheController(instance, services, targetElem, context, profileCount, scriptElem, controllerGlobals, target, targeter) {
|
|
156
207
|
const { profile, batchId, cart, tag } = controllerGlobals;
|
|
157
208
|
const batched = profile?.batched ?? controllerGlobals.batched ?? true;
|
|
158
209
|
if (!tag) {
|
|
159
210
|
// FEEDBACK: change message depending on script integration type (profile vs. legacy)
|
|
160
|
-
instance.logger.warn(`'tag' is missing from <script> tag, skipping this profile`,
|
|
211
|
+
instance.logger.warn(`'tag' is missing from <script> tag, skipping this profile`, scriptElem);
|
|
161
212
|
return;
|
|
162
213
|
}
|
|
163
214
|
if (Array.isArray(cart)) {
|
|
164
215
|
instance.tracker.cookies.cart.set(cart);
|
|
165
216
|
}
|
|
166
|
-
profileCount[tag] = profileCount[tag] + 1 || 1;
|
|
167
217
|
const globals = deepmerge.all([
|
|
168
218
|
instance.config.client?.globals || {},
|
|
169
219
|
instance.config.config?.globals || {},
|
|
170
220
|
controllerGlobals,
|
|
171
221
|
]);
|
|
172
|
-
const
|
|
173
|
-
id: `recommend_${tag}_${profileCount[tag] - 1}`,
|
|
222
|
+
const controllerConfigBase = {
|
|
174
223
|
tag,
|
|
175
224
|
batched: batched ?? instance.config.config?.batched ?? true,
|
|
176
225
|
realtime: Boolean(context.options?.realtime ?? context.profile?.options?.realtime ?? instance.config.config?.realtime),
|
|
@@ -179,78 +228,77 @@ async function readyTheController(instance, services, injectedElem, context, pro
|
|
|
179
228
|
plugins: instance.config.config.plugins,
|
|
180
229
|
branch: instance.config.config?.branch || 'production',
|
|
181
230
|
limit: instance.config.config?.limit,
|
|
231
|
+
beacon: instance.config.config?.beacon || { enabled: true },
|
|
182
232
|
settings: {
|
|
183
233
|
variants: instance.config.config?.variants,
|
|
184
234
|
},
|
|
185
235
|
globals,
|
|
186
236
|
};
|
|
187
237
|
if (profile?.branch) {
|
|
188
|
-
|
|
238
|
+
controllerConfigBase.branch = profile?.branch;
|
|
189
239
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
globals: controllerConfig.globals,
|
|
205
|
-
tag: controllerConfig.tag,
|
|
206
|
-
realtime: controllerConfig.realtime,
|
|
207
|
-
}));
|
|
208
|
-
})[0];
|
|
209
|
-
if (!controller) {
|
|
210
|
-
// no existing controller found of same configuration - creating a new controller
|
|
211
|
-
const createRecommendationController = (await import('../create/createRecommendationController')).default;
|
|
212
|
-
controller = createRecommendationController({
|
|
213
|
-
url: instance.config.url,
|
|
214
|
-
controller: controllerConfig,
|
|
215
|
-
context,
|
|
216
|
-
mode: instance.config.mode,
|
|
217
|
-
}, { client: instance.client, tracker: instance.tracker });
|
|
218
|
-
instance.uses.forEach((attachements) => controller.use(attachements));
|
|
219
|
-
instance.plugins.forEach((plugin) => controller.plugin(plugin.func, ...plugin.args));
|
|
220
|
-
instance.middleware.forEach((middleware) => controller.on(middleware.event, ...middleware.func));
|
|
240
|
+
profileCount[tag] = profileCount[tag] + 1 || 1;
|
|
241
|
+
const controllerConfig = {
|
|
242
|
+
id: `recommend_${tag}_${profileCount[tag] - 1}`,
|
|
243
|
+
...controllerConfigBase,
|
|
244
|
+
};
|
|
245
|
+
const controller = createRecommendationController({
|
|
246
|
+
url: instance.config.url,
|
|
247
|
+
controller: controllerConfig,
|
|
248
|
+
context,
|
|
249
|
+
mode: instance.config.mode,
|
|
250
|
+
}, { client: instance.client, tracker: instance.tracker });
|
|
251
|
+
// mark element with controller id so cleanupStaleControllers knows it's active
|
|
252
|
+
if (targetElem) {
|
|
253
|
+
targetElem.setAttribute('ss-controller-id', controller.id);
|
|
221
254
|
}
|
|
255
|
+
instance.uses.forEach((attachements) => controller.use(attachements));
|
|
256
|
+
instance.plugins.forEach((plugin) => controller.plugin(plugin.func, ...plugin.args));
|
|
257
|
+
instance.middleware.forEach((middleware) => controller.on(middleware.event, ...middleware.func));
|
|
258
|
+
// add controller to instantiator and global namespace
|
|
259
|
+
instance.controller[controller.config.id] = controller;
|
|
260
|
+
window.athos.controller = window.athos.controller || {};
|
|
261
|
+
window.athos.controller[controller.config.id] = controller;
|
|
262
|
+
// register targeter on the controller for element tracking
|
|
263
|
+
controller.addTargeter(targeter);
|
|
222
264
|
// run a search on the controller if it is not currently
|
|
223
265
|
if (!controller.store.loading) {
|
|
224
266
|
await controller.search();
|
|
225
267
|
}
|
|
226
|
-
controller.addTargeter(instance.targeter);
|
|
227
|
-
instance.controller[controller.config.id] = controller;
|
|
228
|
-
window.athos.controller = window.athos.controller || {};
|
|
229
|
-
window.athos.controller[controller.config.id] = controller;
|
|
230
268
|
const profileVars = controller.store.profile.display?.templateParameters;
|
|
231
|
-
const component = controller.store.profile.display?.template?.component;
|
|
232
269
|
if (controller.store.error) {
|
|
233
270
|
//something went wrong
|
|
234
271
|
//err was already logged - nothing to do.
|
|
235
272
|
return;
|
|
236
273
|
}
|
|
237
274
|
if (!controller.store.profile.display.template) {
|
|
238
|
-
instance.logger.error(`profile '${tag}' found on the following element is missing a template!\n${
|
|
275
|
+
instance.logger.error(`profile '${tag}' found on the following element is missing a template!\n${scriptElem?.outerHTML}`);
|
|
239
276
|
return;
|
|
240
277
|
}
|
|
241
278
|
if (!profileVars) {
|
|
242
|
-
instance.logger.error(`profile '${tag}' found on the following element is missing templateParameters!\n${
|
|
279
|
+
instance.logger.error(`profile '${tag}' found on the following element is missing templateParameters!\n${scriptElem?.outerHTML}`);
|
|
243
280
|
return;
|
|
244
281
|
}
|
|
282
|
+
if (targetElem) {
|
|
283
|
+
await renderController(instance, services, controller, targetElem, scriptElem, target);
|
|
284
|
+
}
|
|
285
|
+
return controller;
|
|
286
|
+
}
|
|
287
|
+
async function renderController(instance, services, controller, targetElem, scriptElem, target) {
|
|
288
|
+
// update the element with the controller id
|
|
289
|
+
if (targetElem) {
|
|
290
|
+
targetElem.setAttribute('ss-controller-id', controller.id);
|
|
291
|
+
}
|
|
292
|
+
const tag = controller.config.tag;
|
|
293
|
+
const component = controller.store.profile.display?.template?.component;
|
|
245
294
|
if (!component) {
|
|
246
|
-
instance.logger.error(`profile '${tag}' found on the following element is missing a component!\n${
|
|
295
|
+
instance.logger.error(`profile '${tag}' found on the following element is missing a component!\n${scriptElem?.outerHTML}`);
|
|
247
296
|
return;
|
|
248
297
|
}
|
|
249
298
|
let props = {};
|
|
250
299
|
let RecommendationsComponent = undefined;
|
|
251
300
|
props.className = `ss__recommendation-${component.toLowerCase()}`;
|
|
252
|
-
|
|
253
|
-
instance.config.components[component]?.onTarget?.(target, elem, injectedElem, controller);
|
|
301
|
+
instance.config.components[component]?.onTarget?.(target, scriptElem, targetElem, controller);
|
|
254
302
|
if (instance.config.components[component] && typeof instance.config.components[component] == 'function') {
|
|
255
303
|
RecommendationsComponent = await instance.config.components[component]();
|
|
256
304
|
}
|
|
@@ -263,13 +311,11 @@ async function readyTheController(instance, services, injectedElem, context, pro
|
|
|
263
311
|
RecommendationsComponent = importResolutions[0];
|
|
264
312
|
}
|
|
265
313
|
if (!RecommendationsComponent) {
|
|
266
|
-
instance.logger.error(`profile '${tag}' found on the following element is expecting component mapping for '${component}' - verify instantiator config.\n${
|
|
314
|
+
instance.logger.error(`profile '${tag}' found on the following element is expecting component mapping for '${component}' - verify instantiator config.\n${scriptElem?.outerHTML}`);
|
|
267
315
|
return;
|
|
268
316
|
}
|
|
269
317
|
setTimeout(() => {
|
|
270
|
-
|
|
271
|
-
render(_jsx(RecommendationsComponent, { controller: controller, snap: services?.snap, ...props }), injectedElem);
|
|
272
|
-
}
|
|
318
|
+
render(_jsx(RecommendationsComponent, { controller: controller, snap: services?.snap, ...props }), targetElem);
|
|
273
319
|
});
|
|
274
320
|
}
|
|
275
321
|
function getArrayFunc(arrayOrFunc) {
|
package/dist/esm/src/Snap.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { Controllers, AbstractController, SearchControllerConfig, ChatContr
|
|
|
9
9
|
import type { TrackerConfig, TrackerGlobals } from '@athoscommerce/snap-tracker';
|
|
10
10
|
import type { Target, OnTarget } from '@athoscommerce/snap-toolbox';
|
|
11
11
|
import type { UrlTranslatorConfig } from '@athoscommerce/snap-url-manager';
|
|
12
|
-
import { RecommendationInstantiator, RecommendationInstantiatorConfig } from './Instantiators/RecommendationInstantiator';
|
|
12
|
+
import type { RecommendationInstantiator, RecommendationInstantiatorConfig } from './Instantiators/RecommendationInstantiator';
|
|
13
13
|
import type { SnapControllerServices, InitialUrlConfig, SnapFeatures } from './types';
|
|
14
14
|
import type { TemplatesStore } from './Templates/Stores/TemplateStore';
|
|
15
15
|
export declare const BRANCH_COOKIE = "athosBranch";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Snap.d.ts","sourceRoot":"","sources":["../../../src/Snap.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAgE,MAAM,6BAA6B,CAAC;AACpH,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAIjE,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,EACX,WAAW,EACX,kBAAkB,EAElB,sBAAsB,EACtB,oBAAoB,EACpB,4BAA4B,EAC5B,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,gBAAgB,EAEhB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAmB,MAAM,6BAA6B,CAAC;AAClG,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAG3E,OAAO,EAAE,0BAA0B,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"Snap.d.ts","sourceRoot":"","sources":["../../../src/Snap.tsx"],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,gBAAgB,aACf,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KACjF,OAAO,CAAC,WAAW,CAAC,CAarB;IAGF,OAAO,CAAC,iBAAiB,CAyDvB;IAEK,QAAQ;4BACM,UAAU,KAAG,IAAI;uBAsDtB,UAAU,KAAG,IAAI;MAgC/B;gBAEU,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,YAAY;CAswBvD"}
|
package/dist/esm/src/Snap.js
CHANGED
|
@@ -144,12 +144,14 @@ export class Snap {
|
|
|
144
144
|
let elem = null;
|
|
145
145
|
elem = event && event.target;
|
|
146
146
|
while (Object.keys(attributes).length == 0 && elem !== null && levels <= MAX_PARENT_LEVELS) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
if (elem.attributes) {
|
|
148
|
+
Object.values(elem.attributes).forEach((attr) => {
|
|
149
|
+
const attrName = attr.nodeName;
|
|
150
|
+
if (attributeList.indexOf(attrName) != -1) {
|
|
151
|
+
attributes[attrName] = elem && elem.getAttribute(attrName);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
153
155
|
elem = elem.parentElement;
|
|
154
156
|
levels++;
|
|
155
157
|
}
|
|
@@ -578,6 +580,19 @@ export class Snap {
|
|
|
578
580
|
if (!target.component) {
|
|
579
581
|
throw new Error(`Targets at index ${target_index} missing component value (Component).`);
|
|
580
582
|
}
|
|
583
|
+
// Chat mounts at the document level — if the consumer aimed at <body>
|
|
584
|
+
// directly, give DomTargeter a child to render into instead of stomping on body.
|
|
585
|
+
if (target.selector === 'body' && !target.inject) {
|
|
586
|
+
target = {
|
|
587
|
+
...target,
|
|
588
|
+
inject: {
|
|
589
|
+
action: 'append',
|
|
590
|
+
element: () => {
|
|
591
|
+
return document.createElement('div');
|
|
592
|
+
},
|
|
593
|
+
},
|
|
594
|
+
};
|
|
595
|
+
}
|
|
581
596
|
const targeter = new DomTargeter([{ ...target }], async (target, elem, originalElem) => {
|
|
582
597
|
const cntrlr = await this._createController(ControllerTypes.chat, controller.config, controller.services, controller.url, controller.context, (cntrlr) => {
|
|
583
598
|
if (cntrlr)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SnapHybrid.d.ts","sourceRoot":"","sources":["../../../src/SnapHybrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"SnapHybrid.d.ts","sourceRoot":"","sources":["../../../src/SnapHybrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,EAAoB,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAKrH,KAAK,uBAAuB,GAAG;IAC9B,eAAe,EAAE,yBAAyB,GAAG,2BAA2B,CAAC;IACzE,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,CAAC,EAAE,YAAY,CAAC;CACxB,CAAC;AAEF,qBAAa,UAAW,SAAQ,IAAI;gBACvB,MAAM,EAAE,uBAAuB;CAqB3C"}
|