@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,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { DEFAULT_PRODUCTS_PER_ROW as L } from "../../constants/layout.js";
|
|
2
|
+
import { getDefaultProducts as E, createBlockTemplate as I, DEFAULTS as _, DEFAULT_CARD_COMPOSITION as S, spacer as b, buildElementRenderer as A, DEFAULT_CARD_VISIBILITY as f } from "../utils.js";
|
|
3
|
+
import { ATTRIBUTE_CELL_CLASS as w, DEFAULT_CELL_PADDING as D, gridElementRenderer as C } from "./elementRenderer.js";
|
|
4
4
|
const O = `
|
|
5
5
|
<tr class="recommendation-product-row">
|
|
6
6
|
<td>
|
|
@@ -27,10 +27,10 @@ const O = `
|
|
|
27
27
|
{-{-CELLS-}-}
|
|
28
28
|
</tr>
|
|
29
29
|
`;
|
|
30
|
-
function P(t, e, o, r =
|
|
31
|
-
const c = (100 / e).toFixed(2), i = e - t.length, l = `<td class="${w}" style="padding: ${D};" width="${c}%"></td>`, d = i > 0 ? l.repeat(i) : "", a =
|
|
30
|
+
function P(t, e, o, r = S, n = {}) {
|
|
31
|
+
const c = (100 / e).toFixed(2), i = e - t.length, l = `<td class="${w}" style="padding: ${D};" width="${c}%"></td>`, d = i > 0 ? l.repeat(i) : "", a = A(o, r, n);
|
|
32
32
|
return r.filter((s) => a[s]).map((s) => {
|
|
33
|
-
const T =
|
|
33
|
+
const T = f[s] ?? !0, u = T ? "" : 'style="display: none;"', R = t.map((m) => a[s](m).replace("<td", `<td width="${c}%"`)).join("");
|
|
34
34
|
return g.replace("{-{-ATTR_TYPE-}-}", s).replace("{-{-VISIBILITY-}-}", T ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", u).replace("{-{-CELLS-}-}", R + d);
|
|
35
35
|
}).join("");
|
|
36
36
|
}
|
|
@@ -46,15 +46,15 @@ function U(t, e, o, r, n = {}) {
|
|
|
46
46
|
r,
|
|
47
47
|
n
|
|
48
48
|
), p = O.replace("{-{-ATTRIBUTE_ROWS-}-}", a);
|
|
49
|
-
return d > 0 ?
|
|
49
|
+
return d > 0 ? b + p : p;
|
|
50
50
|
}).join("");
|
|
51
51
|
}
|
|
52
52
|
function h(t, e, o, r = {}) {
|
|
53
|
-
return U(t, e,
|
|
53
|
+
return U(t, e, C, o, r);
|
|
54
54
|
}
|
|
55
55
|
function F(t) {
|
|
56
|
-
const e = t ? `ins-recommendation-v3-block-${t}` : void 0, o =
|
|
57
|
-
return o.replace("{-{-TITLE-}-}",
|
|
56
|
+
const e = t ? `ins-recommendation-v3-block-${t}` : void 0, o = I("grid", e), r = E(), n = h(r, L);
|
|
57
|
+
return o.replace("{-{-TITLE-}-}", _.TITLE).replace("{-{-PRODUCT_ROWS-}-}", n).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
|
|
58
58
|
}
|
|
59
59
|
export {
|
|
60
60
|
F as getDefaultTemplate,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { prepareProductRows as c } from "./
|
|
3
|
-
import {
|
|
1
|
+
import { DEFAULT_PRODUCTS_PER_ROW as s } from "../constants/layout.js";
|
|
2
|
+
import { prepareProductRows as c } from "./grid/template.js";
|
|
3
|
+
import { prepareProductRows as R } from "./list/template.js";
|
|
4
4
|
function a(o, t, r = {}) {
|
|
5
5
|
if (t === "list")
|
|
6
|
-
return
|
|
7
|
-
const { productsPerRow: e =
|
|
8
|
-
return
|
|
6
|
+
return R(o, r.composition, r.filterList);
|
|
7
|
+
const { productsPerRow: e = s, composition: p, filterList: i } = r;
|
|
8
|
+
return c(o, e, p, i);
|
|
9
9
|
}
|
|
10
10
|
export {
|
|
11
11
|
a as prepareProductRows
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useRecommendationExtensionStore as p } from "../../store/recommendation.js";
|
|
2
|
-
import { formatPrice as b } from "../../utils/priceFormatter.js";
|
|
3
|
-
import { sanitizeImageUrl as u, CUSTOM_CELL_HTML as m } from "../utils.js";
|
|
4
|
-
import { ATTR_PRODUCT_ATTR as g, ATTR_PRODUCT_BUTTON as i, ATTR_PRODUCT_IMAGE as c, ATTR_PRODUCT_OMNIBUS_DISCOUNT as f, ATTR_PRODUCT_OMNIBUS_PRICE as T, ATTR_PRODUCT_OLD_PRICE as x, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_NAME as R } from "../../constants/selectors.js";
|
|
5
1
|
import { RecommendationBlockId as o } from "../../constants/blockIds.js";
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { ATTR_PRODUCT_ATTR as m, ATTR_PRODUCT_BUTTON as c, ATTR_PRODUCT_IMAGE as d, ATTR_PRODUCT_OMNIBUS_DISCOUNT as u, ATTR_PRODUCT_OMNIBUS_PRICE as g, ATTR_PRODUCT_OLD_PRICE as f, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_NAME as x } from "../../constants/selectors.js";
|
|
3
|
+
import { useRecommendationExtensionStore as _ } from "../../store/recommendation.js";
|
|
4
|
+
import { formatPrice as R } from "../../utils/priceFormatter.js";
|
|
5
|
+
import { sanitizeImageUrl as y, CUSTOM_CELL_HTML as C } from "../utils.js";
|
|
6
|
+
function p() {
|
|
7
|
+
const t = _(), { currencySettings: e } = t.recommendationConfigs;
|
|
8
8
|
return {
|
|
9
9
|
code: e.value,
|
|
10
10
|
symbol: e.symbol,
|
|
@@ -15,29 +15,29 @@ function l() {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
function s(t, e = "price") {
|
|
18
|
-
const n =
|
|
19
|
-
return
|
|
20
|
-
price:
|
|
18
|
+
const n = p(), a = t[e], r = (a == null ? void 0 : a[n.code]) ?? Object.values(a ?? {})[0] ?? 0;
|
|
19
|
+
return R({
|
|
20
|
+
price: r,
|
|
21
21
|
currency: n
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const U = {
|
|
25
25
|
/**
|
|
26
26
|
* Image cell - left column (120px fixed width)
|
|
27
27
|
* Has recommendation-attribute-row class and data attributes for Card Composition control
|
|
28
28
|
*/
|
|
29
|
-
[
|
|
29
|
+
[d]: (t) => `
|
|
30
30
|
<td
|
|
31
31
|
width="120"
|
|
32
32
|
class="esd-block-image product-image-cell recommendation-attribute-row es-p5"
|
|
33
33
|
esd-extension-block-id="${o.IMAGE}"
|
|
34
|
-
data-attribute-type="${
|
|
34
|
+
data-attribute-type="${d}"
|
|
35
35
|
data-visibility="1"
|
|
36
36
|
align="center"
|
|
37
37
|
valign="middle">
|
|
38
38
|
<a target="_blank" href="${t.url}">
|
|
39
39
|
<img
|
|
40
|
-
src="${
|
|
40
|
+
src="${y(t.image_url)}"
|
|
41
41
|
alt="${t.name}"
|
|
42
42
|
style="display: block; max-width: 100%; height: auto;"
|
|
43
43
|
class="adapt-img product-image">
|
|
@@ -47,7 +47,7 @@ const P = {
|
|
|
47
47
|
/**
|
|
48
48
|
* Name element - row for info cell table
|
|
49
49
|
*/
|
|
50
|
-
[
|
|
50
|
+
[x]: (t) => `
|
|
51
51
|
<tr>
|
|
52
52
|
<td
|
|
53
53
|
class="esd-block-text product-name"
|
|
@@ -62,7 +62,7 @@ const P = {
|
|
|
62
62
|
/**
|
|
63
63
|
* Price element - row for info cell table
|
|
64
64
|
*/
|
|
65
|
-
[
|
|
65
|
+
[T]: (t) => `
|
|
66
66
|
<tr>
|
|
67
67
|
<td
|
|
68
68
|
class="esd-block-text product-price"
|
|
@@ -77,7 +77,7 @@ const P = {
|
|
|
77
77
|
/**
|
|
78
78
|
* Old price element - row for info cell table
|
|
79
79
|
*/
|
|
80
|
-
[
|
|
80
|
+
[f]: (t) => `
|
|
81
81
|
<tr>
|
|
82
82
|
<td
|
|
83
83
|
class="esd-block-text product-old-price"
|
|
@@ -94,7 +94,7 @@ const P = {
|
|
|
94
94
|
/**
|
|
95
95
|
* Omnibus price element - row for info cell table
|
|
96
96
|
*/
|
|
97
|
-
[
|
|
97
|
+
[g]: (t) => `
|
|
98
98
|
<tr>
|
|
99
99
|
<td
|
|
100
100
|
class="esd-block-text product-omnibus-price"
|
|
@@ -113,8 +113,9 @@ const P = {
|
|
|
113
113
|
/**
|
|
114
114
|
* Omnibus discount element - row for info cell table
|
|
115
115
|
*/
|
|
116
|
-
[
|
|
117
|
-
|
|
116
|
+
[u]: (t) => {
|
|
117
|
+
var i, l;
|
|
118
|
+
const e = p(), n = ((i = t.original_price) == null ? void 0 : i[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, a = ((l = t.price) == null ? void 0 : l[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, r = n > 0 ? Math.round((n - a) / n * 100) : 0, b = r > 0 ? `-${r}%` : "0%";
|
|
118
119
|
return `
|
|
119
120
|
<tr>
|
|
120
121
|
<td
|
|
@@ -125,7 +126,7 @@ const P = {
|
|
|
125
126
|
align="left">
|
|
126
127
|
<p contenteditable="false" style="font-size: 12px; color: #666666; margin: 0;">
|
|
127
128
|
<span class="omnibus-text-before"></span>
|
|
128
|
-
<span class="omnibus-discount-value">${
|
|
129
|
+
<span class="omnibus-discount-value">${b}</span>
|
|
129
130
|
<span class="omnibus-text-after"></span>
|
|
130
131
|
</p>
|
|
131
132
|
</td>
|
|
@@ -136,12 +137,12 @@ const P = {
|
|
|
136
137
|
* Button cell - right column (100px fixed width)
|
|
137
138
|
* Has recommendation-attribute-row class and data attributes for Card Composition control
|
|
138
139
|
*/
|
|
139
|
-
[
|
|
140
|
+
[c]: (t) => `
|
|
140
141
|
<td
|
|
141
142
|
width="100"
|
|
142
143
|
class="esd-block-button button-cell recommendation-attribute-row product-button es-p5l es-p5r"
|
|
143
144
|
esd-extension-block-id="${o.BUTTON}"
|
|
144
|
-
data-attribute-type="${
|
|
145
|
+
data-attribute-type="${c}"
|
|
145
146
|
data-visibility="1"
|
|
146
147
|
align="center"
|
|
147
148
|
valign="middle">
|
|
@@ -156,7 +157,17 @@ const P = {
|
|
|
156
157
|
href="${t.url}"
|
|
157
158
|
target="_blank"
|
|
158
159
|
class="es-button buy-button"
|
|
159
|
-
style="
|
|
160
|
+
style="
|
|
161
|
+
color: rgb(56, 118, 29);
|
|
162
|
+
background: rgb(217, 234, 211);
|
|
163
|
+
font-family: arial, 'helvetica neue', helvetica, sans-serif;
|
|
164
|
+
font-size: 16px;
|
|
165
|
+
font-weight: normal;
|
|
166
|
+
line-height: 120%;
|
|
167
|
+
padding: 5px 30px;
|
|
168
|
+
mso-border-alt: 10px solid rgb(217, 234, 211);
|
|
169
|
+
mso-padding-alt: 0;
|
|
170
|
+
">
|
|
160
171
|
Buy
|
|
161
172
|
</a>
|
|
162
173
|
</span>
|
|
@@ -168,10 +179,10 @@ const P = {
|
|
|
168
179
|
* @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
|
|
169
180
|
* @param content - Display content for the cell
|
|
170
181
|
*/
|
|
171
|
-
[
|
|
182
|
+
[C]: (t, e) => `
|
|
172
183
|
<tr>
|
|
173
184
|
<td
|
|
174
|
-
${
|
|
185
|
+
${m}="${t}"
|
|
175
186
|
class="esd-block-text product-custom-attribute"
|
|
176
187
|
esd-extension-block-id="${o.CUSTOM_ATTRIBUTE}"
|
|
177
188
|
align="left">
|
|
@@ -181,5 +192,5 @@ const P = {
|
|
|
181
192
|
`
|
|
182
193
|
};
|
|
183
194
|
export {
|
|
184
|
-
|
|
195
|
+
U as listElementRenderer
|
|
185
196
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ATTR_PRODUCT_IMAGE as a, ATTR_PRODUCT_BUTTON as d } from "../../constants/selectors.js";
|
|
1
2
|
import { DEFAULT_CARD_COMPOSITION as b, spacer as m, buildElementRenderer as C, DEFAULT_CARD_VISIBILITY as T } from "../utils.js";
|
|
2
3
|
import { listElementRenderer as f } from "./elementRenderer.js";
|
|
3
|
-
import { ATTR_PRODUCT_IMAGE as a, ATTR_PRODUCT_BUTTON as d } from "../../constants/selectors.js";
|
|
4
4
|
function R(r, n, l) {
|
|
5
5
|
const t = l ? "" : ' style="display: none;"', o = r.replace(/<tr>/, "").replace(/<\/tr>/, "");
|
|
6
6
|
return `<tr
|
|
@@ -1,58 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
1
|
+
import { ATTR_CUSTOM_PREFIX as u, ATTR_PRODUCT_IMAGE as m, ATTR_PRODUCT_NAME as b, ATTR_PRODUCT_OLD_PRICE as T, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_OMNIBUS_PRICE as g, ATTR_PRODUCT_OMNIBUS_DISCOUNT as C, ATTR_PRODUCT_BUTTON as f } from "../constants/selectors.js";
|
|
2
|
+
function U(t) {
|
|
3
3
|
return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
|
|
5
|
+
function R(t, e) {
|
|
6
|
+
const n = Object.values(e).find((r) => r.attributeName === t);
|
|
7
|
+
return (n == null ? void 0 : n.type) === "defaultAttribute";
|
|
7
8
|
}
|
|
8
|
-
function
|
|
9
|
-
return
|
|
9
|
+
function y(t, e) {
|
|
10
|
+
return R(t, e) ? t : `product_attribute.${t}`;
|
|
10
11
|
}
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
const r = t[
|
|
12
|
+
const P = Symbol("customCellHtml");
|
|
13
|
+
function S(t, e, n = {}) {
|
|
14
|
+
const r = t[P];
|
|
14
15
|
if (!r)
|
|
15
16
|
return { ...t };
|
|
16
17
|
const l = { ...t };
|
|
17
|
-
return e.filter((o) => o.startsWith(
|
|
18
|
-
const s = o.substring(
|
|
18
|
+
return e.filter((o) => o.startsWith(u) && !l[o]).forEach((o) => {
|
|
19
|
+
const s = o.substring(u.length), a = U(s), D = y(s, n), O = R(s, n);
|
|
19
20
|
l[o] = (d) => {
|
|
20
|
-
|
|
21
|
+
var p;
|
|
22
|
+
const i = O ? d[s] : (p = d.product_attributes) == null ? void 0 : p[s];
|
|
21
23
|
let c = a;
|
|
22
|
-
return typeof i == "string" ? c = i : typeof i == "number" && (c = String(i)), r(
|
|
24
|
+
return typeof i == "string" ? c = i : typeof i == "number" && (c = String(i)), r(D, c);
|
|
23
25
|
};
|
|
24
26
|
}), l;
|
|
25
27
|
}
|
|
26
|
-
const
|
|
28
|
+
const L = {
|
|
27
29
|
TITLE: "You May Also Like!"
|
|
28
|
-
},
|
|
29
|
-
u,
|
|
30
|
+
}, M = [
|
|
30
31
|
m,
|
|
31
32
|
b,
|
|
32
33
|
T,
|
|
33
34
|
_,
|
|
34
35
|
g,
|
|
35
|
-
C
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
C,
|
|
37
|
+
f
|
|
38
|
+
], $ = {
|
|
38
39
|
[m]: !0,
|
|
39
|
-
[T]: !0,
|
|
40
40
|
[b]: !0,
|
|
41
|
-
[_]: !
|
|
41
|
+
[_]: !0,
|
|
42
|
+
[T]: !0,
|
|
42
43
|
[g]: !1,
|
|
43
|
-
[C]: !
|
|
44
|
-
|
|
44
|
+
[C]: !1,
|
|
45
|
+
[f]: !0
|
|
46
|
+
}, h = `
|
|
45
47
|
<tr>
|
|
46
48
|
<td class="spacer" style="height: 10px;"></td>
|
|
47
49
|
</tr>
|
|
48
|
-
`,
|
|
49
|
-
function
|
|
50
|
-
return !t || typeof t != "string" || t.trim() === "" ?
|
|
50
|
+
`, A = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
|
|
51
|
+
function w(t) {
|
|
52
|
+
return !t || typeof t != "string" || t.trim() === "" ? A : t.startsWith("http://") ? t.replace("http://", "https://") : t;
|
|
51
53
|
}
|
|
52
|
-
function
|
|
54
|
+
function I(t) {
|
|
53
55
|
return {
|
|
54
56
|
name: "Product Name",
|
|
55
|
-
image_url:
|
|
57
|
+
image_url: A,
|
|
56
58
|
price: { USD: 18 },
|
|
57
59
|
original_price: { USD: 20 },
|
|
58
60
|
discount: { USD: 2 },
|
|
@@ -64,13 +66,13 @@ function h(t) {
|
|
|
64
66
|
category: []
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
|
-
function
|
|
69
|
+
function N(t = 6) {
|
|
68
70
|
return Array.from(
|
|
69
71
|
{ length: t },
|
|
70
|
-
(e, n) =>
|
|
72
|
+
(e, n) => I(String(n + 1))
|
|
71
73
|
);
|
|
72
74
|
}
|
|
73
|
-
function
|
|
75
|
+
function k(t = "grid", e) {
|
|
74
76
|
const n = t === "list" ? `
|
|
75
77
|
data-layout="list"` : "", r = e ? ` ${e}` : "";
|
|
76
78
|
return `
|
|
@@ -108,7 +110,7 @@ function N(t = "grid", e) {
|
|
|
108
110
|
</table>
|
|
109
111
|
</td>
|
|
110
112
|
</tr>
|
|
111
|
-
${
|
|
113
|
+
${h}
|
|
112
114
|
<tr>
|
|
113
115
|
<td>
|
|
114
116
|
<table
|
|
@@ -147,17 +149,17 @@ function N(t = "grid", e) {
|
|
|
147
149
|
`;
|
|
148
150
|
}
|
|
149
151
|
export {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
152
|
+
P as CUSTOM_CELL_HTML,
|
|
153
|
+
L as DEFAULTS,
|
|
154
|
+
M as DEFAULT_CARD_COMPOSITION,
|
|
155
|
+
$ as DEFAULT_CARD_VISIBILITY,
|
|
156
|
+
A as PLACEHOLDER_IMAGE,
|
|
157
|
+
S as buildElementRenderer,
|
|
158
|
+
k as createBlockTemplate,
|
|
159
|
+
N as getDefaultProducts,
|
|
160
|
+
R as isDefaultAttribute,
|
|
161
|
+
y as resolveProductAttrValue,
|
|
162
|
+
w as sanitizeImageUrl,
|
|
163
|
+
h as spacer,
|
|
164
|
+
U as toDisplayName
|
|
163
165
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function r(e) {
|
|
2
|
+
if (!e)
|
|
3
|
+
return e;
|
|
4
|
+
switch (e) {
|
|
5
|
+
case "viewedTogether":
|
|
6
|
+
return "similarViewed";
|
|
7
|
+
case "purchasedTogether":
|
|
8
|
+
return "similarBought";
|
|
9
|
+
case "trending":
|
|
10
|
+
return "trendingProducts";
|
|
11
|
+
case "mostValuable":
|
|
12
|
+
return "mostValuableOfPartner";
|
|
13
|
+
case "topSellers":
|
|
14
|
+
return "mostPurchased";
|
|
15
|
+
default:
|
|
16
|
+
return e;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
r as mapLegacyStrategy
|
|
21
|
+
};
|
|
@@ -1,36 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
"&": "&",
|
|
4
|
-
"<": "<",
|
|
5
|
-
">": ">",
|
|
6
|
-
'"': """,
|
|
7
|
-
"'": "'"
|
|
8
|
-
};
|
|
9
|
-
return t.replace(/[&<>"']/g, (n) => e[n]);
|
|
10
|
-
}
|
|
11
|
-
function p(t) {
|
|
1
|
+
import { escapeHtml as m } from "../../../../utils/htmlEscape.js";
|
|
2
|
+
function T(t) {
|
|
12
3
|
return "getInnerHTML" in t && typeof t.getInnerHTML == "function" ? t.getInnerHTML().trim() : "innerHTML" in t ? t.innerHTML : "";
|
|
13
4
|
}
|
|
14
|
-
function
|
|
15
|
-
const n = m(
|
|
5
|
+
function H(t, f) {
|
|
6
|
+
const n = m(f);
|
|
16
7
|
if (!t)
|
|
17
8
|
return n;
|
|
18
|
-
const r =
|
|
9
|
+
const r = T(t);
|
|
19
10
|
if (!r || r.trim() === "" || !/<(strong|em|u|s|b|i)\b/i.test(r))
|
|
20
11
|
return n;
|
|
21
|
-
const
|
|
22
|
-
let
|
|
12
|
+
const e = [], s = [];
|
|
13
|
+
let o = r.trim();
|
|
23
14
|
for (; ; ) {
|
|
24
|
-
const u =
|
|
15
|
+
const u = o.match(/^<(strong|em|u|s|b|i)(\s[^>]*)?>(.*)$/is);
|
|
25
16
|
if (!u)
|
|
26
17
|
break;
|
|
27
|
-
const [,
|
|
28
|
-
if (!
|
|
18
|
+
const [, i, a = "", c] = u, g = new RegExp(`</${i}>$`, "i");
|
|
19
|
+
if (!g.test(c))
|
|
29
20
|
break;
|
|
30
|
-
|
|
21
|
+
e.push(`<${i}${a}>`), s.unshift(`</${i}>`), o = c.replace(g, "").trim();
|
|
31
22
|
}
|
|
32
|
-
return
|
|
23
|
+
return e.length > 0 ? e.join("") + n + s.join("") : n;
|
|
33
24
|
}
|
|
34
25
|
export {
|
|
35
|
-
|
|
26
|
+
H as preserveTextStyles
|
|
36
27
|
};
|
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
import { safeParse as
|
|
2
|
-
const e =
|
|
1
|
+
import { safeParse as o, object as p, boolean as l, number as i, pipe as c, minLength as f, string as m } from "../../../../node_modules/valibot/dist/index.js";
|
|
2
|
+
const e = c(m(), f(1)), s = p({
|
|
3
3
|
type: e,
|
|
4
4
|
attribute: e,
|
|
5
5
|
operator: e,
|
|
6
6
|
innerGroupOperator: e,
|
|
7
7
|
outerGroupOperator: e,
|
|
8
8
|
value: e,
|
|
9
|
-
filterGroup:
|
|
10
|
-
filterNumber:
|
|
11
|
-
isValid:
|
|
9
|
+
filterGroup: i(),
|
|
10
|
+
filterNumber: i(),
|
|
11
|
+
isValid: l()
|
|
12
12
|
});
|
|
13
|
-
function b(t) {
|
|
14
|
-
return i(o, t).success;
|
|
15
|
-
}
|
|
16
13
|
function g(t) {
|
|
17
|
-
|
|
14
|
+
return o(s, t).success;
|
|
15
|
+
}
|
|
16
|
+
function S(t) {
|
|
17
|
+
const r = o(s, t);
|
|
18
18
|
return r.success ? /* @__PURE__ */ new Set() : new Set(
|
|
19
|
-
r.issues.flatMap((
|
|
19
|
+
r.issues.flatMap((u) => {
|
|
20
|
+
var n;
|
|
21
|
+
return ((n = u.path) == null ? void 0 : n.map((a) => String(a.key))) ?? [];
|
|
22
|
+
})
|
|
20
23
|
);
|
|
21
24
|
}
|
|
22
25
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
s as FilterSchema,
|
|
27
|
+
S as getInvalidFilterFields,
|
|
28
|
+
g as isFilterValid
|
|
26
29
|
};
|
|
@@ -47,7 +47,8 @@ class B extends T {
|
|
|
47
47
|
}), this.valueChangeHandlers = [], this.currentNode = void 0, this.currentPages = void 0, this.currentPreviewIndex = 0, this.lastParsedAttribute = void 0;
|
|
48
48
|
}
|
|
49
49
|
get totalTemplates() {
|
|
50
|
-
|
|
50
|
+
var e;
|
|
51
|
+
return ((e = this.currentPages) == null ? void 0 : e.length) ?? 0;
|
|
51
52
|
}
|
|
52
53
|
_listenToFormUpdates() {
|
|
53
54
|
this.valueChangeHandlers.push(
|
|
@@ -76,23 +77,24 @@ class B extends T {
|
|
|
76
77
|
await l().fetchTemplates(), this._updatePreview(), this._updateCounter();
|
|
77
78
|
}
|
|
78
79
|
_updatePreview() {
|
|
79
|
-
|
|
80
|
+
var e;
|
|
81
|
+
if ((e = this.currentPages) != null && e.length)
|
|
80
82
|
try {
|
|
81
|
-
const
|
|
83
|
+
const t = this.currentPages[this.currentPreviewIndex], o = l().getThumbnailByTemplateId(t);
|
|
82
84
|
if (!o) {
|
|
83
|
-
console.warn("[UnsubscribeControl] No thumbnail found for page:",
|
|
85
|
+
console.warn("[UnsubscribeControl] No thumbnail found for page:", t);
|
|
84
86
|
return;
|
|
85
87
|
}
|
|
86
88
|
this.api.updateValues({
|
|
87
89
|
[r.PREVIEW_IMAGE]: o
|
|
88
90
|
});
|
|
89
|
-
} catch (
|
|
90
|
-
console.error("[UnsubscribeControl] Failed to update preview:",
|
|
91
|
+
} catch (t) {
|
|
92
|
+
console.error("[UnsubscribeControl] Failed to update preview:", t);
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
95
|
_updateCounter() {
|
|
94
|
-
const e = this.currentPreviewIndex + 1, t = this.totalTemplates,
|
|
95
|
-
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled,
|
|
96
|
+
const e = this.currentPreviewIndex + 1, t = this.totalTemplates, c = this.currentPreviewIndex === 0, o = this.currentPreviewIndex >= t - 1;
|
|
97
|
+
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, c), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, o), this.api.setUIEAttribute(
|
|
96
98
|
r.COUNTER_TEXT,
|
|
97
99
|
i.LABEL.text,
|
|
98
100
|
`${this.api.translate("Showing")} ${e} ${this.api.translate("of")} ${t}`
|
|
@@ -133,14 +135,14 @@ class B extends T {
|
|
|
133
135
|
</${n.LABEL}>
|
|
134
136
|
`;
|
|
135
137
|
}
|
|
136
|
-
_getIconButton(e, t,
|
|
137
|
-
const
|
|
138
|
+
_getIconButton(e, t, c) {
|
|
139
|
+
const o = c ? `${i.BUTTON.disabled}="true"` : "";
|
|
138
140
|
return `
|
|
139
141
|
<${n.BUTTON}
|
|
140
142
|
id="${e}"
|
|
141
143
|
class="flat-inline flat-white"
|
|
142
144
|
${i.BUTTON.name}="${e}"
|
|
143
|
-
${
|
|
145
|
+
${o}
|
|
144
146
|
>
|
|
145
147
|
<${n.ICON}
|
|
146
148
|
src="${t}"
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { UIElement as
|
|
5
|
-
const
|
|
6
|
-
class
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var m = (s, i, e) => i in s ? n(s, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[i] = e;
|
|
3
|
+
var r = (s, i, e) => m(s, typeof i != "symbol" ? i + "" : i, e);
|
|
4
|
+
import { UIElement as l } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
const E = "unsubscribe-preview", c = "img", a = "Unsubscribe page preview", g = "is-loaded";
|
|
6
|
+
class d extends l {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
9
|
-
|
|
9
|
+
r(this, "imgElement");
|
|
10
10
|
}
|
|
11
11
|
getId() {
|
|
12
|
-
return
|
|
12
|
+
return E;
|
|
13
13
|
}
|
|
14
14
|
getTemplate() {
|
|
15
15
|
return `
|
|
@@ -17,26 +17,28 @@ class u extends m {
|
|
|
17
17
|
<div class="unsubscribe-preview-loader"></div>
|
|
18
18
|
<img
|
|
19
19
|
src=""
|
|
20
|
-
alt="${
|
|
20
|
+
alt="${a}"
|
|
21
21
|
class="unsubscribe-preview-image"
|
|
22
22
|
/>
|
|
23
23
|
</div>
|
|
24
24
|
`;
|
|
25
25
|
}
|
|
26
|
-
onRender(
|
|
27
|
-
this.imgElement =
|
|
26
|
+
onRender(e) {
|
|
27
|
+
this.imgElement = e.querySelector(c);
|
|
28
28
|
}
|
|
29
|
-
setValue(
|
|
30
|
-
|
|
29
|
+
setValue(e) {
|
|
30
|
+
var t;
|
|
31
|
+
this.imgElement && (this.imgElement.src = e, (t = this.imgElement.parentElement) == null || t.classList.add(g));
|
|
31
32
|
}
|
|
32
33
|
getValue() {
|
|
33
|
-
|
|
34
|
+
var e;
|
|
35
|
+
return ((e = this.imgElement) == null ? void 0 : e.src) ?? "";
|
|
34
36
|
}
|
|
35
37
|
onDestroy() {
|
|
36
38
|
this.imgElement = void 0;
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
E as PREVIEW_UI_ELEMENT_ID,
|
|
43
|
+
d as PreviewUIElement
|
|
42
44
|
};
|