@useinsider/guido 3.2.0-beta.7e0c6bd → 3.2.0-beta.7fb9b70
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 +117 -1
- package/dist/@types/config/schemas.js +153 -95
- package/dist/@types/config/validator.js +34 -27
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +95 -88
- package/dist/components/organisms/AutoSaveController.vue.js +17 -0
- package/dist/components/organisms/AutoSaveController.vue2.js +13 -0
- package/dist/components/organisms/base/Toaster.vue2.js +11 -10
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +12 -12
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +6 -6
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +15 -9
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +40 -31
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +20 -19
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +14 -11
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
- package/dist/components/organisms/header/EditorActions.vue.js +12 -11
- package/dist/components/organisms/header/EditorActions.vue2.js +22 -18
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +15 -12
- package/dist/components/organisms/header/LeftSlot.vue2.js +19 -16
- package/dist/components/organisms/header/MiddleSlot.vue2.js +11 -14
- package/dist/components/organisms/header/RightSlot.vue.js +8 -8
- package/dist/components/organisms/header/RightSlot.vue2.js +17 -13
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +26 -24
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +44 -41
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +38 -36
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +21 -18
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +31 -27
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +32 -30
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +23 -21
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +9 -8
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -9
- package/dist/composables/useActionsApi.js +38 -37
- package/dist/composables/useAutoSave.js +71 -0
- package/dist/composables/useBlocksConfig.js +26 -26
- package/dist/composables/useFullStoryBridge.js +9 -8
- package/dist/composables/useHtmlCompiler.js +26 -34
- package/dist/composables/useHtmlValidator.js +109 -101
- package/dist/composables/useHttp.js +30 -30
- package/dist/composables/usePartner.js +1 -1
- package/dist/composables/useRecommendation.js +46 -25
- package/dist/composables/useRibbonOffset.js +15 -15
- package/dist/composables/useSave.js +25 -21
- package/dist/composables/useStripo.js +48 -53
- package/dist/composables/useSyncModuleExtractor.js +29 -31
- package/dist/composables/useTimerClone.js +25 -24
- package/dist/composables/useTranslations.js +16 -23
- package/dist/composables/useValidation.js +8 -7
- package/dist/composables/validators/useCouponBlockValidator.js +24 -0
- package/dist/composables/validators/useLiquidValidator.js +13 -13
- package/dist/config/compiler/recommendationCompilerRules.js +25 -25
- package/dist/config/compiler/unsubscribeCompilerRules.js +19 -17
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +105 -71
- package/dist/config/migrator/checkboxMigrator.js +21 -20
- package/dist/config/migrator/couponBlockMigrator.js +19 -18
- package/dist/config/migrator/index.js +9 -9
- package/dist/config/migrator/itemsBlockMigrator.js +89 -87
- package/dist/config/migrator/radioButtonMigrator.js +63 -42
- package/dist/config/migrator/recommendation/compositionMapper.js +98 -0
- package/dist/config/migrator/recommendation/extractors.js +27 -0
- package/dist/config/migrator/recommendation/htmlBuilder.js +496 -0
- package/dist/config/migrator/recommendation/parseLegacyConfig.js +33 -0
- package/dist/config/migrator/recommendation/settingsMapper.js +70 -0
- package/dist/config/migrator/recommendation/themeMapper.js +93 -0
- package/dist/config/migrator/recommendationMigrator.js +74 -287
- package/dist/config/migrator/unsubscribeMigrator.js +11 -10
- package/dist/enums/extensions/recommendationBlock.js +2 -1
- package/dist/enums/unsubscribe.js +19 -18
- package/dist/extensions/Blocks/Items/block.js +9 -9
- package/dist/extensions/Blocks/Items/controls/button/link.js +14 -14
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +97 -89
- package/dist/extensions/Blocks/Items/controls/image/link.js +14 -14
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +24 -23
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +14 -13
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +47 -44
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -38
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +11 -11
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +40 -38
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +35 -35
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +162 -155
- package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
- package/dist/extensions/Blocks/Items/template.js +210 -210
- package/dist/extensions/Blocks/RadioButton/template.js +1 -1
- package/dist/extensions/Blocks/Recommendation/block.js +35 -32
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +133 -128
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +10 -10
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +34 -32
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +6 -4
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +90 -82
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +18 -18
- package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +36 -35
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +240 -192
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +10 -10
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +32 -32
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +20 -18
- package/dist/extensions/Blocks/Recommendation/extension.js +32 -31
- package/dist/extensions/Blocks/Recommendation/services/configService.js +65 -29
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +16 -8
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +150 -109
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +37 -27
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +10 -10
- package/dist/extensions/Blocks/Recommendation/templates/index.js +6 -6
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +37 -26
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +47 -45
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +21 -0
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +13 -22
- package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +16 -13
- package/dist/extensions/Blocks/Unsubscribe/control.js +13 -11
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +18 -16
- package/dist/extensions/Blocks/common-control.js +26 -25
- package/dist/extensions/DynamicContent/dynamic-content.js +58 -53
- package/dist/guido.css +1 -1
- package/dist/library.js +12 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +234 -233
- package/dist/node_modules/lodash-es/_DataView.js +6 -0
- package/dist/node_modules/lodash-es/_Hash.js +20 -0
- package/dist/node_modules/lodash-es/_ListCache.js +20 -0
- package/dist/node_modules/lodash-es/_Map.js +6 -0
- package/dist/node_modules/lodash-es/_MapCache.js +20 -0
- package/dist/node_modules/lodash-es/_Promise.js +6 -0
- package/dist/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/lodash-es/_SetCache.js +13 -0
- package/dist/node_modules/lodash-es/_Stack.js +18 -0
- package/dist/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/lodash-es/_WeakMap.js +6 -0
- package/dist/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +20 -0
- package/dist/node_modules/lodash-es/_arrayMap.js +8 -0
- package/dist/node_modules/lodash-es/_arrayPush.js +8 -0
- package/dist/node_modules/lodash-es/_arraySome.js +9 -0
- package/dist/node_modules/lodash-es/_assocIndexOf.js +10 -0
- package/dist/node_modules/lodash-es/_baseEach.js +6 -0
- package/dist/node_modules/lodash-es/_baseFlatten.js +13 -0
- package/dist/node_modules/lodash-es/_baseFor.js +5 -0
- package/dist/node_modules/lodash-es/_baseForOwn.js +8 -0
- package/dist/node_modules/lodash-es/_baseGet.js +11 -0
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/dist/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/node_modules/lodash-es/_baseHasIn.js +6 -0
- package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/lodash-es/_baseIsEqual.js +8 -0
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
- package/dist/node_modules/lodash-es/_baseIsMatch.js +29 -0
- package/dist/node_modules/lodash-es/_baseIsNative.js +16 -0
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
- package/dist/node_modules/lodash-es/_baseIteratee.js +11 -0
- package/dist/node_modules/lodash-es/_baseKeys.js +14 -0
- package/dist/node_modules/lodash-es/_baseMap.js +11 -0
- package/dist/node_modules/lodash-es/_baseMatches.js +12 -0
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
- package/dist/node_modules/lodash-es/_baseProperty.js +8 -0
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +9 -0
- package/dist/node_modules/lodash-es/_baseRange.js +9 -0
- package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
- package/dist/node_modules/lodash-es/_baseToString.js +18 -0
- package/dist/node_modules/lodash-es/_baseTrim.js +8 -0
- package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/lodash-es/_cacheHas.js +6 -0
- package/dist/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/node_modules/lodash-es/_coreJsData.js +5 -0
- package/dist/node_modules/lodash-es/_createBaseEach.js +15 -0
- package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
- package/dist/node_modules/lodash-es/_createRange.js +11 -0
- package/dist/node_modules/lodash-es/_equalArrays.js +40 -0
- package/dist/node_modules/lodash-es/_equalByTag.js +45 -0
- package/dist/node_modules/lodash-es/_equalObjects.js +36 -0
- package/dist/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/dist/node_modules/lodash-es/_getMapData.js +8 -0
- package/dist/node_modules/lodash-es/_getMatchData.js +12 -0
- package/dist/node_modules/lodash-es/_getNative.js +9 -0
- package/dist/node_modules/lodash-es/_getRawTag.js +15 -0
- package/dist/node_modules/lodash-es/_getSymbols.js +10 -0
- package/dist/node_modules/lodash-es/_getTag.js +28 -0
- package/dist/node_modules/lodash-es/_getValue.js +6 -0
- package/dist/node_modules/lodash-es/_hasPath.js +19 -0
- package/dist/node_modules/lodash-es/_hashClear.js +7 -0
- package/dist/node_modules/lodash-es/_hashDelete.js +7 -0
- package/dist/node_modules/lodash-es/_hashGet.js +13 -0
- package/dist/node_modules/lodash-es/_hashHas.js +9 -0
- package/dist/node_modules/lodash-es/_hashSet.js +9 -0
- package/dist/node_modules/lodash-es/_isFlattenable.js +10 -0
- package/dist/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
- package/dist/node_modules/lodash-es/_isKey.js +12 -0
- package/dist/node_modules/lodash-es/_isKeyable.js +7 -0
- package/dist/node_modules/lodash-es/_isMasked.js +11 -0
- package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -0
- package/dist/node_modules/lodash-es/_listCacheClear.js +6 -0
- package/dist/node_modules/lodash-es/_listCacheDelete.js +12 -0
- package/dist/node_modules/lodash-es/_listCacheGet.js +8 -0
- package/dist/node_modules/lodash-es/_listCacheHas.js +7 -0
- package/dist/node_modules/lodash-es/_listCacheSet.js +8 -0
- package/dist/node_modules/lodash-es/_mapCacheClear.js +13 -0
- package/dist/node_modules/lodash-es/_mapCacheDelete.js +8 -0
- package/dist/node_modules/lodash-es/_mapCacheGet.js +7 -0
- package/dist/node_modules/lodash-es/_mapCacheHas.js +7 -0
- package/dist/node_modules/lodash-es/_mapCacheSet.js +8 -0
- package/dist/node_modules/lodash-es/_mapToArray.js +9 -0
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
- package/dist/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/node_modules/lodash-es/_nativeCreate.js +5 -0
- package/dist/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
- package/dist/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/lodash-es/_root.js +5 -0
- package/dist/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/lodash-es/_stackSet.js +17 -0
- package/dist/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/node_modules/lodash-es/_toSource.js +17 -0
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
- package/dist/node_modules/lodash-es/eq.js +6 -0
- package/dist/node_modules/lodash-es/flatMap.js +8 -0
- package/dist/node_modules/lodash-es/get.js +8 -0
- package/dist/node_modules/lodash-es/hasIn.js +8 -0
- package/dist/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/lodash-es/isFunction.js +12 -0
- package/dist/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/lodash-es/isObject.js +7 -0
- package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/lodash-es/map.js +11 -0
- package/dist/node_modules/lodash-es/memoize.js +18 -0
- package/dist/node_modules/lodash-es/property.js +10 -0
- package/dist/node_modules/lodash-es/range.js +5 -0
- package/dist/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/lodash-es/toFinite.js +14 -0
- package/dist/node_modules/lodash-es/toNumber.js +22 -0
- package/dist/node_modules/lodash-es/toString.js +7 -0
- package/dist/node_modules/valibot/dist/index.js +458 -239
- package/dist/services/recommendationApi.js +17 -14
- package/dist/services/templateLibraryApi.js +40 -38
- package/dist/src/@types/config/defaults.d.ts +5 -1
- package/dist/src/@types/config/index.d.ts +3 -3
- package/dist/src/@types/config/schemas.d.ts +217 -0
- package/dist/src/@types/config/types.d.ts +9 -1
- package/dist/src/components/Guido.vue.d.ts +1 -1
- package/dist/src/components/organisms/AutoSaveController.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/components/wrappers/WpModal.vue.d.ts +2 -2
- package/dist/src/composables/useAutoSave.d.ts +3 -0
- package/dist/src/composables/useConfig.d.ts +58 -0
- package/dist/src/composables/useHtmlCompiler.d.ts +2 -1
- package/dist/src/composables/useRecommendation.d.ts +10 -1
- package/dist/src/composables/useRecommendation.test.d.ts +1 -0
- package/dist/src/composables/useSave.d.ts +1 -1
- package/dist/src/composables/useTranslations.d.ts +1 -1
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/config/migrator/index.d.ts +2 -1
- package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +2 -0
- package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +7 -0
- package/dist/src/config/migrator/recommendation/extractors.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +11 -0
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +15 -0
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +7 -0
- package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/themeMapper.d.ts +5 -0
- package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/types.d.ts +205 -0
- package/dist/src/config/migrator/recommendationMigrator.d.ts +13 -1
- package/dist/src/config/migrator/recommendationMigrator.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +21 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -3
- package/dist/src/library.d.ts +1 -1
- package/dist/src/stores/autosave.d.ts +12 -0
- package/dist/src/stores/config.d.ts +522 -0
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/src/stores/editor.d.ts +23 -0
- package/dist/src/utils/htmlEscape.d.ts +5 -0
- package/dist/src/utils/htmlEscape.test.d.ts +1 -0
- package/dist/src/utils/timeUtil.d.ts +8 -0
- package/dist/stores/autosave.js +17 -0
- package/dist/stores/config.js +81 -25
- package/dist/stores/dynamic-content.js +11 -6
- package/dist/stores/editor.js +3 -1
- package/dist/stores/onboarding.js +1 -1
- package/dist/stores/preview.js +9 -6
- package/dist/stores/unsubscribe.js +4 -1
- package/dist/utils/dateUtil.js +10 -7
- package/dist/utils/genericUtil.js +13 -10
- package/dist/utils/htmlEscape.js +13 -0
- package/dist/utils/pairProductVariables.js +89 -87
- package/dist/utils/templatePreparation.js +72 -32
- package/dist/utils/timeUtil.js +19 -0
- package/package.json +7 -6
- package/dist/enums/displayConditions.js +0 -80
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
- package/dist/src/enums/displayConditions.d.ts +0 -2
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { RecommendationFeedSourceMaps as
|
|
2
|
-
import { useRecommendationApi as
|
|
3
|
-
import { useConfigStore as
|
|
4
|
-
import { defineStore as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { getDefaultProducts as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
const h =
|
|
11
|
-
let
|
|
12
|
-
function
|
|
1
|
+
import { RecommendationFeedSourceMaps as S, getOperatorOptions as R, PriceAttributes as y } from "../../../../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { useRecommendationApi as C } from "../../../../services/recommendationApi.js";
|
|
3
|
+
import { useConfigStore as G } from "../../../../stores/config.js";
|
|
4
|
+
import { defineStore as P } from "pinia";
|
|
5
|
+
import { DEFAULT_CARDS_IN_ROW as F } from "../constants/layout.js";
|
|
6
|
+
import { EXCLUDED_ALGORITHM_IDS as D } from "../constants/defaultConfig.js";
|
|
7
|
+
import { getDefaultProducts as g } from "../templates/utils.js";
|
|
8
|
+
import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
|
|
9
|
+
import { isFilterValid as w } from "../validation/filterSchema.js";
|
|
10
|
+
const h = C();
|
|
11
|
+
let u = null, m = null, d = null;
|
|
12
|
+
function k() {
|
|
13
13
|
return {
|
|
14
|
-
cardsInRow:
|
|
14
|
+
cardsInRow: F,
|
|
15
15
|
currencySettings: {
|
|
16
16
|
name: "USD",
|
|
17
17
|
value: "USD",
|
|
@@ -37,9 +37,9 @@ function b() {
|
|
|
37
37
|
customAttributes: []
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function I() {
|
|
41
41
|
return {
|
|
42
|
-
recommendationConfigs:
|
|
42
|
+
recommendationConfigs: k(),
|
|
43
43
|
recommendationProducts: [],
|
|
44
44
|
filterStatus: !1,
|
|
45
45
|
filterSelectionDrawerStatus: !1,
|
|
@@ -48,7 +48,7 @@ function D() {
|
|
|
48
48
|
filterSnapshot: null
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
const
|
|
51
|
+
const v = () => ({
|
|
52
52
|
recommendationCampaignUrls: {},
|
|
53
53
|
activePredictiveAlgorithms: [],
|
|
54
54
|
languages: {},
|
|
@@ -57,8 +57,8 @@ const P = () => ({
|
|
|
57
57
|
blockStates: {},
|
|
58
58
|
currentRecommendationId: null,
|
|
59
59
|
configVersion: 0
|
|
60
|
-
}), _ =
|
|
61
|
-
state: () =>
|
|
60
|
+
}), _ = P("guidoRecommendationExtension", {
|
|
61
|
+
state: () => v(),
|
|
62
62
|
getters: {
|
|
63
63
|
// ====================================================================
|
|
64
64
|
// Proxy Getters — Backward Compatible Access to Current Block State
|
|
@@ -68,7 +68,7 @@ const P = () => ({
|
|
|
68
68
|
* This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
|
|
69
69
|
*/
|
|
70
70
|
recommendationConfigs(t) {
|
|
71
|
-
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs :
|
|
71
|
+
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : k();
|
|
72
72
|
},
|
|
73
73
|
/**
|
|
74
74
|
* Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
|
|
@@ -102,45 +102,45 @@ const P = () => ({
|
|
|
102
102
|
},
|
|
103
103
|
hasValidFilters() {
|
|
104
104
|
const { filters: t } = this.recommendationConfigs;
|
|
105
|
-
return t.length ? t.every((
|
|
105
|
+
return t.length ? t.every((e) => e.isValid) : !1;
|
|
106
106
|
},
|
|
107
107
|
getFilterGroupCount() {
|
|
108
108
|
const { filters: t } = this.recommendationConfigs;
|
|
109
|
-
return t.length ? new Set(t.map((
|
|
109
|
+
return t.length ? new Set(t.map((e) => e.filterGroup)).size : 0;
|
|
110
110
|
},
|
|
111
111
|
getUniqueFilterGroups() {
|
|
112
112
|
const { filters: t } = this.recommendationConfigs;
|
|
113
|
-
return [...new Set(t.map((
|
|
113
|
+
return [...new Set(t.map((e) => e.filterGroup))].sort((e, r) => e - r);
|
|
114
114
|
},
|
|
115
115
|
getActivePredictiveAlgorithms: (t) => {
|
|
116
|
-
const
|
|
117
|
-
return t.activePredictiveAlgorithms.filter((
|
|
118
|
-
|
|
119
|
-
}),
|
|
120
|
-
text:
|
|
121
|
-
value:
|
|
116
|
+
const e = [];
|
|
117
|
+
return t.activePredictiveAlgorithms.filter((r) => !D.includes(r)).forEach((r) => {
|
|
118
|
+
e.push(...S.filter((n) => n.id === r));
|
|
119
|
+
}), e.map((r) => ({
|
|
120
|
+
text: r.name,
|
|
121
|
+
value: r.key
|
|
122
122
|
}));
|
|
123
123
|
},
|
|
124
|
-
getLanguages: (t) => Object.entries(t.languages).map(([
|
|
125
|
-
text:
|
|
126
|
-
value:
|
|
124
|
+
getLanguages: (t) => Object.entries(t.languages).map(([e, r]) => ({
|
|
125
|
+
text: r,
|
|
126
|
+
value: e
|
|
127
127
|
})),
|
|
128
|
-
getCurrencySymbolList: (t) => t.currencyList.map((
|
|
129
|
-
text:
|
|
130
|
-
value:
|
|
128
|
+
getCurrencySymbolList: (t) => t.currencyList.map((e) => ({
|
|
129
|
+
text: e.text,
|
|
130
|
+
value: e.text
|
|
131
131
|
})),
|
|
132
132
|
getFilterList() {
|
|
133
133
|
return Object.values(this.filterList).map((t) => {
|
|
134
|
-
let
|
|
135
|
-
return t.type === "productAttribute" ?
|
|
134
|
+
let e;
|
|
135
|
+
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : y.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
|
|
136
136
|
text: t.displayName,
|
|
137
|
-
value:
|
|
137
|
+
value: e,
|
|
138
138
|
type: t.attributeType
|
|
139
139
|
};
|
|
140
140
|
});
|
|
141
141
|
},
|
|
142
142
|
getSelectedFilterGroup() {
|
|
143
|
-
return (t) => [...this.recommendationConfigs.filters].filter((
|
|
143
|
+
return (t) => [...this.recommendationConfigs.filters].filter((e) => e.filterGroup === t);
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
146
|
actions: {
|
|
@@ -154,7 +154,7 @@ const P = () => ({
|
|
|
154
154
|
setCurrentBlock(t) {
|
|
155
155
|
this.blockStates[t] || (this.blockStates = {
|
|
156
156
|
...this.blockStates,
|
|
157
|
-
[t]:
|
|
157
|
+
[t]: I()
|
|
158
158
|
}), this.currentRecommendationId = t;
|
|
159
159
|
},
|
|
160
160
|
/**
|
|
@@ -162,15 +162,15 @@ const P = () => ({
|
|
|
162
162
|
* Resets currentRecommendationId if it was the deleted block.
|
|
163
163
|
*/
|
|
164
164
|
removeBlockState(t) {
|
|
165
|
-
const
|
|
166
|
-
if (this.recommendationCampaignUrls[
|
|
167
|
-
const
|
|
168
|
-
delete
|
|
165
|
+
const e = t.toString();
|
|
166
|
+
if (this.recommendationCampaignUrls[e]) {
|
|
167
|
+
const n = { ...this.recommendationCampaignUrls };
|
|
168
|
+
delete n[e], this.recommendationCampaignUrls = n;
|
|
169
169
|
}
|
|
170
|
-
const
|
|
171
|
-
if (delete
|
|
172
|
-
const
|
|
173
|
-
this.currentRecommendationId =
|
|
170
|
+
const r = { ...this.blockStates };
|
|
171
|
+
if (delete r[t], this.blockStates = r, this.currentRecommendationId === t) {
|
|
172
|
+
const n = Object.keys(this.blockStates).map(Number);
|
|
173
|
+
this.currentRecommendationId = n.length > 0 ? n[0] : null;
|
|
174
174
|
}
|
|
175
175
|
},
|
|
176
176
|
/**
|
|
@@ -180,37 +180,75 @@ const P = () => ({
|
|
|
180
180
|
markBlockInitialized(t) {
|
|
181
181
|
this.blockStates[t] && (this.blockStates[t].isInitialized = !0);
|
|
182
182
|
},
|
|
183
|
+
/**
|
|
184
|
+
* Seeds the URL-relevant fields of a block from a persisted node config.
|
|
185
|
+
*
|
|
186
|
+
* Used at save-time to ensure the campaign URL is built from the
|
|
187
|
+
* persisted truth (the `esd-ext-config` blob in the raw HTML) even when
|
|
188
|
+
* the user never selected the block in this editor session — without
|
|
189
|
+
* this seed, `_syncNodeConfigToStore` would never have run for that
|
|
190
|
+
* block and the store would hold default values (USD/en_US/mostPopular)
|
|
191
|
+
* instead of the real config.
|
|
192
|
+
*
|
|
193
|
+
* Creates the block entry if missing; otherwise patches only the URL-
|
|
194
|
+
* relevant subset and leaves runtime fields (e.g., `recommendedProducts`,
|
|
195
|
+
* `isInitialized`) alone.
|
|
196
|
+
*/
|
|
197
|
+
seedBlockUrlConfig(t, e) {
|
|
198
|
+
const r = (o, s) => o === "." || o === "," || o === " " ? o : s, n = {
|
|
199
|
+
name: e.currencyCode,
|
|
200
|
+
value: e.currencyCode,
|
|
201
|
+
symbol: e.currencyCode,
|
|
202
|
+
alignment: e.currencyAlignment === "before" ? "0" : "1",
|
|
203
|
+
decimalCount: String(e.currencyDecimalCount),
|
|
204
|
+
decimalSeparator: r(e.currencyDecimalSeparator, ","),
|
|
205
|
+
thousandSeparator: r(e.currencyThousandSeparator, ".")
|
|
206
|
+
}, c = !this.blockStates[t], i = c ? I() : this.blockStates[t];
|
|
207
|
+
i.recommendationConfigs = {
|
|
208
|
+
...i.recommendationConfigs,
|
|
209
|
+
strategy: e.strategy,
|
|
210
|
+
language: e.language,
|
|
211
|
+
size: e.size,
|
|
212
|
+
productIds: e.productIds,
|
|
213
|
+
filters: e.filters,
|
|
214
|
+
shuffleProducts: e.shuffleProducts,
|
|
215
|
+
currencySettings: n
|
|
216
|
+
}, c && (this.blockStates = {
|
|
217
|
+
...this.blockStates,
|
|
218
|
+
[t]: i
|
|
219
|
+
});
|
|
220
|
+
},
|
|
183
221
|
/**
|
|
184
222
|
* Patches the current block's recommendationConfigs.
|
|
185
223
|
* Replaces `store.$patch({ recommendationConfigs: { ... } })` pattern.
|
|
186
224
|
*/
|
|
187
|
-
patchCurrentBlockConfig(t,
|
|
225
|
+
patchCurrentBlockConfig(t, e = {}) {
|
|
188
226
|
if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
|
|
189
227
|
return;
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
...
|
|
228
|
+
const r = this.blockStates[this.currentRecommendationId];
|
|
229
|
+
r.recommendationConfigs = {
|
|
230
|
+
...r.recommendationConfigs,
|
|
193
231
|
...t,
|
|
194
232
|
currencySettings: {
|
|
195
|
-
...
|
|
233
|
+
...r.recommendationConfigs.currencySettings,
|
|
196
234
|
...t.currencySettings || {}
|
|
197
235
|
}
|
|
198
236
|
};
|
|
199
|
-
const { triggerRefetch:
|
|
200
|
-
|
|
237
|
+
const { triggerRefetch: n = !0 } = e;
|
|
238
|
+
n && this.configVersion++;
|
|
201
239
|
},
|
|
202
240
|
/**
|
|
203
241
|
* Creates a filter with the first available attribute and operator pre-selected.
|
|
204
242
|
*/
|
|
205
|
-
createDefaultFilter(t,
|
|
206
|
-
const [
|
|
243
|
+
createDefaultFilter(t, e) {
|
|
244
|
+
const [r] = this.getFilterList, [n] = R(r == null ? void 0 : r.type);
|
|
207
245
|
return {
|
|
208
246
|
type: "standardFilter",
|
|
209
|
-
attribute:
|
|
210
|
-
operator:
|
|
247
|
+
attribute: (r == null ? void 0 : r.value) ?? "",
|
|
248
|
+
operator: (n == null ? void 0 : n.value) ?? "",
|
|
211
249
|
innerGroupOperator: "*",
|
|
212
250
|
outerGroupOperator: "*",
|
|
213
|
-
filterNumber:
|
|
251
|
+
filterNumber: e,
|
|
214
252
|
filterGroup: t,
|
|
215
253
|
isValid: !1,
|
|
216
254
|
value: ""
|
|
@@ -255,43 +293,43 @@ const P = () => ({
|
|
|
255
293
|
// ====================================================================
|
|
256
294
|
async fetchRecommendationCreateData() {
|
|
257
295
|
if (!this.activePredictiveAlgorithms.length) {
|
|
258
|
-
if (
|
|
259
|
-
await
|
|
296
|
+
if (u) {
|
|
297
|
+
await u;
|
|
260
298
|
return;
|
|
261
299
|
}
|
|
262
|
-
|
|
300
|
+
u = (async () => {
|
|
263
301
|
const {
|
|
264
302
|
activePredictiveAlgorithms: t,
|
|
265
|
-
languages:
|
|
266
|
-
currencies:
|
|
303
|
+
languages: e,
|
|
304
|
+
currencies: r
|
|
267
305
|
} = await h.fetchRecommendationCreateData();
|
|
268
|
-
if (this.activePredictiveAlgorithms = t, this.languages =
|
|
269
|
-
const
|
|
270
|
-
|
|
306
|
+
if (this.activePredictiveAlgorithms = t, this.languages = e, this.currentRecommendationId !== null && this.blockStates[this.currentRecommendationId]) {
|
|
307
|
+
const n = this.blockStates[this.currentRecommendationId];
|
|
308
|
+
n.filterStatus = !!n.recommendationConfigs.filters.length;
|
|
271
309
|
}
|
|
272
|
-
this.currencyList =
|
|
310
|
+
this.currencyList = r;
|
|
273
311
|
})();
|
|
274
312
|
try {
|
|
275
|
-
await
|
|
313
|
+
await u;
|
|
276
314
|
} finally {
|
|
277
|
-
|
|
315
|
+
u = null;
|
|
278
316
|
}
|
|
279
317
|
}
|
|
280
318
|
},
|
|
281
319
|
async fetchRecommendationFilters() {
|
|
282
320
|
if (!Object.keys(this.filterList).length) {
|
|
283
|
-
if (
|
|
284
|
-
await
|
|
321
|
+
if (m) {
|
|
322
|
+
await m;
|
|
285
323
|
return;
|
|
286
324
|
}
|
|
287
|
-
|
|
325
|
+
m = (async () => {
|
|
288
326
|
const t = await h.fetchRecommendationFilters();
|
|
289
327
|
this.filterList = t;
|
|
290
328
|
})();
|
|
291
329
|
try {
|
|
292
|
-
await
|
|
330
|
+
await m;
|
|
293
331
|
} finally {
|
|
294
|
-
|
|
332
|
+
m = null;
|
|
295
333
|
}
|
|
296
334
|
}
|
|
297
335
|
},
|
|
@@ -306,59 +344,59 @@ const P = () => ({
|
|
|
306
344
|
deleteFilterGroup(t) {
|
|
307
345
|
if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
|
|
308
346
|
return;
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
...
|
|
312
|
-
filterGroup: c.get(
|
|
347
|
+
const e = this.blockStates[this.currentRecommendationId], r = e.recommendationConfigs.filters.filter((i) => i.filterGroup !== t), n = [...new Set(r.map((i) => i.filterGroup))].sort((i, o) => i - o), c = new Map(n.map((i, o) => [i, o + 1]));
|
|
348
|
+
e.recommendationConfigs.filters = r.map((i) => ({
|
|
349
|
+
...i,
|
|
350
|
+
filterGroup: c.get(i.filterGroup) ?? i.filterGroup
|
|
313
351
|
}));
|
|
314
352
|
},
|
|
315
353
|
updateFilter(t) {
|
|
316
354
|
if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
|
|
317
355
|
return;
|
|
318
|
-
const
|
|
319
|
-
if (
|
|
320
|
-
const
|
|
321
|
-
|
|
356
|
+
const e = this.blockStates[this.currentRecommendationId], r = e.recommendationConfigs.filters.findIndex((n) => n.filterNumber === t.filterNumber && n.filterGroup === t.filterGroup);
|
|
357
|
+
if (r !== -1) {
|
|
358
|
+
const n = [...e.recommendationConfigs.filters];
|
|
359
|
+
n[r] = {
|
|
322
360
|
...t,
|
|
323
|
-
isValid:
|
|
324
|
-
},
|
|
361
|
+
isValid: w(t)
|
|
362
|
+
}, e.recommendationConfigs.filters = n;
|
|
325
363
|
}
|
|
326
364
|
},
|
|
327
365
|
deleteFilter(t) {
|
|
328
366
|
if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
|
|
329
367
|
return;
|
|
330
|
-
const
|
|
331
|
-
if (
|
|
332
|
-
let
|
|
333
|
-
if (
|
|
334
|
-
let
|
|
335
|
-
|
|
368
|
+
const e = this.blockStates[this.currentRecommendationId], r = [...e.recommendationConfigs.filters].findIndex((n) => n.filterNumber === t.filterNumber && n.filterGroup === t.filterGroup);
|
|
369
|
+
if (r !== -1) {
|
|
370
|
+
let n = [...e.recommendationConfigs.filters];
|
|
371
|
+
if (n.splice(r, 1), n.some((i) => i.filterGroup === t.filterGroup)) {
|
|
372
|
+
let i = 1;
|
|
373
|
+
n = n.map((o) => o.filterGroup === t.filterGroup ? { ...o, filterNumber: i++ } : o);
|
|
336
374
|
} else {
|
|
337
|
-
const
|
|
338
|
-
|
|
375
|
+
const i = [...new Set(n.map((s) => s.filterGroup))].sort((s, a) => s - a), o = new Map(i.map((s, a) => [s, a + 1]));
|
|
376
|
+
n = n.map((s) => ({
|
|
339
377
|
...s,
|
|
340
378
|
filterGroup: o.get(s.filterGroup) ?? s.filterGroup
|
|
341
379
|
}));
|
|
342
380
|
}
|
|
343
|
-
|
|
381
|
+
e.recommendationConfigs.filters = n;
|
|
344
382
|
}
|
|
345
383
|
},
|
|
346
384
|
addFilter(t) {
|
|
347
385
|
if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
|
|
348
386
|
return;
|
|
349
|
-
const
|
|
387
|
+
const e = this.blockStates[this.currentRecommendationId], r = [...e.recommendationConfigs.filters], c = r.filter(
|
|
350
388
|
(o) => o.filterGroup === t.filterGroup
|
|
351
|
-
).length + 1,
|
|
352
|
-
|
|
389
|
+
).length + 1, i = r.findLastIndex((o) => o.filterGroup === t.filterGroup);
|
|
390
|
+
i !== -1 ? r.splice(i + 1, 0, {
|
|
353
391
|
...t,
|
|
354
392
|
filterNumber: c
|
|
355
|
-
}) :
|
|
393
|
+
}) : r.push({
|
|
356
394
|
...t,
|
|
357
395
|
filterNumber: c
|
|
358
|
-
}),
|
|
396
|
+
}), e.recommendationConfigs.filters = r;
|
|
359
397
|
},
|
|
360
398
|
generateFilterQuery() {
|
|
361
|
-
return
|
|
399
|
+
return b(this.recommendationConfigs.filters);
|
|
362
400
|
},
|
|
363
401
|
// ====================================================================
|
|
364
402
|
// Per-Block Product Fetching
|
|
@@ -378,25 +416,28 @@ const P = () => ({
|
|
|
378
416
|
}
|
|
379
417
|
},
|
|
380
418
|
async _doFetchProducts() {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
419
|
+
var p;
|
|
420
|
+
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = r.filters.filter((l) => l.isValid), c = b(n), i = ((p = S.find((l) => l.key === r.strategy)) == null ? void 0 : p.path) || "", o = G(), s = parseInt(r.size) || 6, a = {
|
|
421
|
+
locale: r.language,
|
|
422
|
+
currency: r.currencySettings.value,
|
|
384
423
|
partnerName: o.partnerName,
|
|
385
|
-
size:
|
|
424
|
+
size: r.size,
|
|
386
425
|
details: !0,
|
|
387
426
|
campaignId: o.variationId
|
|
388
427
|
};
|
|
389
|
-
|
|
390
|
-
const l = parseInt(e.size) || 6;
|
|
428
|
+
r.strategy === "manualMerchandising" ? a.productId = r.productIds.slice(0, s).join(",") : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0);
|
|
391
429
|
let f;
|
|
392
430
|
try {
|
|
393
|
-
f = await h.fetchRecommendationProducts(
|
|
431
|
+
f = await h.fetchRecommendationProducts(i, a);
|
|
394
432
|
} catch {
|
|
395
433
|
f = [];
|
|
396
434
|
}
|
|
397
435
|
if (this.blockStates[t]) {
|
|
398
|
-
const
|
|
399
|
-
this.blockStates[t].recommendationProducts =
|
|
436
|
+
const l = f.length > 0 ? f : g(s);
|
|
437
|
+
l.length < s ? this.blockStates[t].recommendationProducts = [
|
|
438
|
+
...l,
|
|
439
|
+
...g(s - l.length)
|
|
440
|
+
] : l.length > s ? this.blockStates[t].recommendationProducts = l.slice(0, s) : this.blockStates[t].recommendationProducts = l;
|
|
400
441
|
}
|
|
401
442
|
}
|
|
402
443
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useRecommendationExtensionStore as p } from "../../store/recommendation.js";
|
|
2
|
-
import { formatPrice as b } from "../../utils/priceFormatter.js";
|
|
3
|
-
import { sanitizeImageUrl as g, CUSTOM_CELL_HTML as u } from "../utils.js";
|
|
4
|
-
import { ATTR_PRODUCT_ATTR as m, ATTR_PRODUCT_BUTTON as h, ATTR_PRODUCT_OMNIBUS_DISCOUNT as y, ATTR_PRODUCT_OMNIBUS_PRICE as T, ATTR_PRODUCT_OLD_PRICE as f, ATTR_PRODUCT_PRICE as x, ATTR_PRODUCT_NAME as _, ATTR_PRODUCT_IMAGE as $ } from "../../constants/selectors.js";
|
|
5
1
|
import { RecommendationBlockId as s } from "../../constants/blockIds.js";
|
|
2
|
+
import { ATTR_PRODUCT_ATTR as b, ATTR_PRODUCT_BUTTON as u, ATTR_PRODUCT_OMNIBUS_DISCOUNT as m, ATTR_PRODUCT_OMNIBUS_PRICE as h, ATTR_PRODUCT_OLD_PRICE as y, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_NAME as f, ATTR_PRODUCT_IMAGE as x } from "../../constants/selectors.js";
|
|
3
|
+
import { useRecommendationExtensionStore as _ } from "../../store/recommendation.js";
|
|
4
|
+
import { formatPrice as $ } from "../../utils/priceFormatter.js";
|
|
5
|
+
import { sanitizeImageUrl as C, CUSTOM_CELL_HTML as R } from "../utils.js";
|
|
6
6
|
const a = "0 5px", l = "attribute-cell";
|
|
7
|
-
function
|
|
8
|
-
const t =
|
|
7
|
+
function p() {
|
|
8
|
+
const t = _(), { currencySettings: e } = t.recommendationConfigs;
|
|
9
9
|
return {
|
|
10
10
|
code: e.value,
|
|
11
11
|
symbol: e.symbol,
|
|
@@ -15,15 +15,15 @@ function c() {
|
|
|
15
15
|
thousandSeparator: e.thousandSeparator
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
const o =
|
|
20
|
-
return
|
|
18
|
+
function i(t, e = "price") {
|
|
19
|
+
const o = p(), n = t[e], d = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
|
|
20
|
+
return $({
|
|
21
21
|
price: d,
|
|
22
22
|
currency: o
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
const
|
|
26
|
-
[
|
|
25
|
+
const I = {
|
|
26
|
+
[x]: (t) => `
|
|
27
27
|
<td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
|
|
28
28
|
<table
|
|
29
29
|
class="product-card-segment"
|
|
@@ -40,7 +40,7 @@ const U = {
|
|
|
40
40
|
esd-extension-block-id="${s.IMAGE}">
|
|
41
41
|
<a target="_blank" href="${t.url}">
|
|
42
42
|
<img
|
|
43
|
-
src="${
|
|
43
|
+
src="${C(t.image_url)}"
|
|
44
44
|
alt="${t.name}"
|
|
45
45
|
style="display: block; max-width: 100%; height: auto;"
|
|
46
46
|
class="adapt-img">
|
|
@@ -51,7 +51,7 @@ const U = {
|
|
|
51
51
|
</table>
|
|
52
52
|
</td>
|
|
53
53
|
`,
|
|
54
|
-
[
|
|
54
|
+
[f]: (t) => `
|
|
55
55
|
<td class="${l}" style="padding: ${a}; height: 100%;" valign="middle">
|
|
56
56
|
<table
|
|
57
57
|
class="product-card-segment"
|
|
@@ -76,7 +76,7 @@ const U = {
|
|
|
76
76
|
</table>
|
|
77
77
|
</td>
|
|
78
78
|
`,
|
|
79
|
-
[
|
|
79
|
+
[T]: (t) => `
|
|
80
80
|
<td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
|
|
81
81
|
<table
|
|
82
82
|
class="product-card-segment"
|
|
@@ -92,7 +92,7 @@ const U = {
|
|
|
92
92
|
align="center"
|
|
93
93
|
esd-extension-block-id="${s.PRICE}">
|
|
94
94
|
<p contenteditable="false" style="font-size: 16px; color: #333333;">
|
|
95
|
-
<strong>${
|
|
95
|
+
<strong>${i(t, "price")}</strong>
|
|
96
96
|
</p>
|
|
97
97
|
</td>
|
|
98
98
|
</tr>
|
|
@@ -100,7 +100,7 @@ const U = {
|
|
|
100
100
|
</table>
|
|
101
101
|
</td>
|
|
102
102
|
`,
|
|
103
|
-
[
|
|
103
|
+
[y]: (t) => `
|
|
104
104
|
<td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
|
|
105
105
|
<table
|
|
106
106
|
class="product-card-segment"
|
|
@@ -116,7 +116,7 @@ const U = {
|
|
|
116
116
|
align="center"
|
|
117
117
|
esd-extension-block-id="${s.OLD_PRICE}">
|
|
118
118
|
<p contenteditable="false" style="font-size: 14px; color: #999999;">
|
|
119
|
-
<strong>${
|
|
119
|
+
<strong>${i(t, "original_price")}</strong>
|
|
120
120
|
</p>
|
|
121
121
|
</td>
|
|
122
122
|
</tr>
|
|
@@ -124,7 +124,7 @@ const U = {
|
|
|
124
124
|
</table>
|
|
125
125
|
</td>
|
|
126
126
|
`,
|
|
127
|
-
[
|
|
127
|
+
[h]: (t) => `
|
|
128
128
|
<td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
|
|
129
129
|
<table
|
|
130
130
|
class="product-card-segment"
|
|
@@ -143,7 +143,7 @@ const U = {
|
|
|
143
143
|
esd-extension-block-id="${s.OMNIBUS_PRICE}">
|
|
144
144
|
<p contenteditable="false" style="font-size: 12px; color: #666666;">
|
|
145
145
|
<span class="omnibus-text-before">Lowest 30-day price: </span>
|
|
146
|
-
<span class="omnibus-price-value">${
|
|
146
|
+
<span class="omnibus-price-value">${i(t, "original_price")}</span>
|
|
147
147
|
<span class="omnibus-text-after"></span>
|
|
148
148
|
</p>
|
|
149
149
|
</td>
|
|
@@ -152,8 +152,9 @@ const U = {
|
|
|
152
152
|
</table>
|
|
153
153
|
</td>
|
|
154
154
|
`,
|
|
155
|
-
[
|
|
156
|
-
|
|
155
|
+
[m]: (t) => {
|
|
156
|
+
var r, c;
|
|
157
|
+
const e = p(), o = ((r = t.original_price) == null ? void 0 : r[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, n = ((c = t.price) == null ? void 0 : c[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, d = o > 0 ? Math.round((o - n) / o * 100) : 0, g = d > 0 ? `-${d}%` : "0%";
|
|
157
158
|
return `
|
|
158
159
|
<td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
|
|
159
160
|
<table
|
|
@@ -173,7 +174,7 @@ const U = {
|
|
|
173
174
|
esd-extension-block-id="${s.OMNIBUS_DISCOUNT}">
|
|
174
175
|
<p contenteditable="false" style="font-size: 12px; color: #666666;">
|
|
175
176
|
<span class="omnibus-text-before"></span>
|
|
176
|
-
<span class="omnibus-discount-value">${
|
|
177
|
+
<span class="omnibus-discount-value">${g}</span>
|
|
177
178
|
<span class="omnibus-text-after"></span>
|
|
178
179
|
</p>
|
|
179
180
|
</td>
|
|
@@ -183,7 +184,7 @@ const U = {
|
|
|
183
184
|
</td>
|
|
184
185
|
`;
|
|
185
186
|
},
|
|
186
|
-
[
|
|
187
|
+
[u]: () => `
|
|
187
188
|
<td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
|
|
188
189
|
<table
|
|
189
190
|
class="product-card-segment"
|
|
@@ -209,7 +210,16 @@ const U = {
|
|
|
209
210
|
href="#"
|
|
210
211
|
class="es-button buy-button"
|
|
211
212
|
target="_blank"
|
|
212
|
-
style="
|
|
213
|
+
style="
|
|
214
|
+
color: rgb(56, 118, 29);
|
|
215
|
+
background: rgb(217, 234, 211);
|
|
216
|
+
font-family: arial, 'helvetica neue', helvetica, sans-serif;
|
|
217
|
+
font-size: 16px;
|
|
218
|
+
font-weight: normal;
|
|
219
|
+
line-height: 120%;
|
|
220
|
+
mso-border-alt: 10px solid rgb(217, 234, 211);
|
|
221
|
+
mso-padding-alt: 0;
|
|
222
|
+
">
|
|
213
223
|
Buy
|
|
214
224
|
</a>
|
|
215
225
|
</span>
|
|
@@ -226,7 +236,7 @@ const U = {
|
|
|
226
236
|
* @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
|
|
227
237
|
* @param content - Display content for the cell
|
|
228
238
|
*/
|
|
229
|
-
[
|
|
239
|
+
[R]: (t, e) => `
|
|
230
240
|
<td class="${l}" style="padding: ${a}; height: 100%;" valign="middle">
|
|
231
241
|
<table
|
|
232
242
|
class="product-card-segment"
|
|
@@ -239,7 +249,7 @@ const U = {
|
|
|
239
249
|
<tbody>
|
|
240
250
|
<tr valign="top">
|
|
241
251
|
<td
|
|
242
|
-
${
|
|
252
|
+
${b}="${t}"
|
|
243
253
|
class="esd-block-text product-custom-attribute es-p0t es-p0b es-p15l es-p15r"
|
|
244
254
|
align="center"
|
|
245
255
|
esd-extension-block-id="${s.CUSTOM_ATTRIBUTE}">
|
|
@@ -254,5 +264,5 @@ const U = {
|
|
|
254
264
|
export {
|
|
255
265
|
l as ATTRIBUTE_CELL_CLASS,
|
|
256
266
|
a as DEFAULT_CELL_PADDING,
|
|
257
|
-
|
|
267
|
+
I as gridElementRenderer
|
|
258
268
|
};
|