@useinsider/guido 3.2.0-beta.e01b42a → 3.2.0-beta.e69fb3b
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 +1 -0
- package/dist/@types/config/schemas.js +66 -54
- package/dist/@types/config/validator.js +27 -34
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +87 -82
- package/dist/components/organisms/base/Toaster.vue2.js +10 -11
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +12 -12
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +6 -6
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +9 -15
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +31 -40
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +19 -20
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +11 -14
- package/dist/components/organisms/header/EditorActions.vue.js +12 -13
- package/dist/components/organisms/header/EditorActions.vue2.js +51 -40
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +12 -15
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -19
- package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -11
- package/dist/components/organisms/header/RightSlot.vue.js +10 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +13 -13
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +11 -12
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +49 -31
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +12 -13
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +36 -38
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +12 -13
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +47 -51
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +18 -21
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +27 -31
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +12 -13
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +33 -46
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +11 -12
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +20 -21
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +18 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +9 -10
- package/dist/composables/useActionsApi.js +37 -38
- package/dist/composables/useBlocksConfig.js +26 -26
- package/dist/composables/useFullStoryBridge.js +13 -0
- package/dist/composables/useHtmlCompiler.js +34 -24
- package/dist/composables/useHtmlValidator.js +91 -97
- package/dist/composables/useHttp.js +30 -30
- package/dist/composables/usePartner.js +1 -1
- package/dist/composables/usePreviewMode.js +20 -16
- package/dist/composables/useRecommendation.js +14 -15
- package/dist/composables/useRibbonOffset.js +21 -0
- package/dist/composables/useSave.js +23 -16
- package/dist/composables/useStripo.js +55 -47
- package/dist/composables/useSyncModuleExtractor.js +31 -29
- package/dist/composables/useTimerClone.js +24 -25
- package/dist/composables/useTranslations.js +2 -3
- package/dist/composables/useValidation.js +7 -8
- package/dist/composables/validators/useLiquidValidator.js +42 -0
- package/dist/config/compiler/liquidCompilerRules.js +15 -0
- package/dist/config/compiler/recommendationCompilerRules.js +162 -43
- package/dist/config/compiler/unsubscribeCompilerRules.js +45 -44
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +51 -46
- package/dist/config/migrator/checkboxMigrator.js +23 -22
- package/dist/config/migrator/couponBlockMigrator.js +18 -19
- package/dist/config/migrator/itemsBlockMigrator.js +87 -89
- package/dist/config/migrator/radioButtonMigrator.js +19 -18
- package/dist/config/migrator/recommendationMigrator.js +107 -110
- package/dist/config/migrator/unsubscribeMigrator.js +10 -11
- package/dist/enums/extensions/recommendationBlock.js +14 -11
- package/dist/enums/onboarding.js +7 -2
- package/dist/enums/recommendation.js +2 -2
- package/dist/enums/unsubscribe.js +33 -27
- package/dist/extensions/Blocks/CouponBlock/template.js +24 -13
- 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 +89 -97
- package/dist/extensions/Blocks/Items/controls/image/link.js +14 -14
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +23 -24
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +13 -14
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +44 -47
- 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 +38 -40
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +35 -35
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +155 -162
- package/dist/extensions/Blocks/Items/enums/productEnums.js +21 -14
- package/dist/extensions/Blocks/Items/template.js +210 -210
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +208 -200
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +23 -20
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +19 -20
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +4 -6
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +84 -90
- 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 +35 -36
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +127 -126
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
- 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/shared/textTrimCssRules.js +14 -0
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +50 -50
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +18 -20
- package/dist/extensions/Blocks/Recommendation/extension.js +31 -32
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +25 -32
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +72 -69
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +24 -23
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +10 -10
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +28 -27
- package/dist/extensions/Blocks/Recommendation/templates/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +26 -25
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -21
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +53 -48
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
- package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +13 -16
- package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
- package/dist/extensions/Blocks/Unsubscribe/control.js +11 -13
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +16 -18
- package/dist/extensions/Blocks/common-control.js +25 -26
- package/dist/extensions/DynamicContent/dynamic-content.js +59 -59
- package/dist/guido.css +1 -1
- package/dist/library.js +11 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +232 -210
- package/dist/node_modules/lodash-es/_getValue.js +1 -1
- package/dist/node_modules/valibot/dist/index.js +122 -126
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +12 -15
- package/dist/services/stripoApi.js +9 -9
- package/dist/services/templateLibraryApi.js +49 -48
- package/dist/src/@types/config/index.d.ts +1 -1
- package/dist/src/@types/config/schemas.d.ts +28 -0
- package/dist/src/@types/config/types.d.ts +3 -1
- package/dist/src/@types/generic.d.ts +0 -1
- package/dist/src/@types/save-as-template.d.ts +1 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +12 -0
- package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
- package/dist/src/composables/useHtmlCompiler.d.ts +1 -2
- package/dist/src/composables/useRibbonOffset.d.ts +4 -0
- package/dist/src/composables/validators/useLiquidValidator.d.ts +3 -0
- package/dist/src/config/compiler/liquidCompilerRules.d.ts +2 -0
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
- package/dist/src/enums/onboarding.d.ts +6 -0
- package/dist/src/enums/unsubscribe.d.ts +5 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
- package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
- package/dist/src/services/templateLibraryApi.d.ts +1 -1
- package/dist/src/stores/config.d.ts +108 -0
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/src/stores/preview.d.ts +3 -0
- package/dist/src/utils/genericUtil.d.ts +1 -1
- package/dist/src/utils/htmlCompiler.d.ts +2 -1
- package/dist/static/styles/base.css.js +7 -2
- package/dist/static/styles/components/button.css.js +3 -2
- package/dist/static/styles/components/loader.css.js +4 -0
- package/dist/stores/config.js +25 -81
- package/dist/stores/dynamic-content.js +6 -11
- package/dist/stores/onboarding.js +5 -1
- package/dist/stores/preview.js +8 -10
- package/dist/stores/unsubscribe.js +1 -4
- package/dist/utils/dateUtil.js +7 -10
- package/dist/utils/genericUtil.js +39 -20
- package/dist/utils/htmlCompiler.js +48 -41
- package/dist/utils/pairProductVariables.js +13 -14
- package/dist/utils/templatePreparation.js +36 -25
- package/dist/utils/tooltipUtils.js +4 -5
- package/package.json +9 -4
- package/dist/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/lodash-es/_SetCache.js +0 -13
- package/dist/node_modules/lodash-es/_Stack.js +0 -18
- package/dist/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +0 -20
- package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
- package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
- package/dist/node_modules/lodash-es/_arraySome.js +0 -9
- package/dist/node_modules/lodash-es/_baseEach.js +0 -6
- package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/dist/node_modules/lodash-es/_baseFor.js +0 -5
- package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
- package/dist/node_modules/lodash-es/_baseGet.js +0 -11
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
- package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +0 -12
- package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
- package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
- package/dist/node_modules/lodash-es/_baseMap.js +0 -11
- package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/dist/node_modules/lodash-es/_baseRange.js +0 -9
- package/dist/node_modules/lodash-es/_baseTimes.js +0 -8
- package/dist/node_modules/lodash-es/_baseToString.js +0 -18
- package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
- package/dist/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
- package/dist/node_modules/lodash-es/_createBaseFor.js +0 -13
- package/dist/node_modules/lodash-es/_createRange.js +0 -11
- package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
- package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
- package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
- package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
- package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/lodash-es/_getTag.js +0 -28
- package/dist/node_modules/lodash-es/_hasPath.js +0 -19
- package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/dist/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/lodash-es/_isIterateeCall.js +0 -13
- package/dist/node_modules/lodash-es/_isKey.js +0 -12
- package/dist/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
- package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
- package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/lodash-es/_nodeUtil.js +0 -11
- package/dist/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/lodash-es/_stackSet.js +0 -17
- package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
- package/dist/node_modules/lodash-es/flatMap.js +0 -8
- package/dist/node_modules/lodash-es/get.js +0 -8
- package/dist/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/lodash-es/identity.js +0 -6
- package/dist/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/lodash-es/map.js +0 -11
- package/dist/node_modules/lodash-es/property.js +0 -10
- package/dist/node_modules/lodash-es/range.js +0 -5
- package/dist/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/lodash-es/stubFalse.js +0 -6
- package/dist/node_modules/lodash-es/toFinite.js +0 -14
- package/dist/node_modules/lodash-es/toNumber.js +0 -22
- package/dist/node_modules/lodash-es/toString.js +0 -7
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const o = "https://email-static.useinsider.com/guido/guido-fs.js", c = () => ({ injectFullStory: () => {
|
|
2
|
+
const e = window;
|
|
3
|
+
if (typeof e._fs_org != "string" || !e._fs_org)
|
|
4
|
+
return;
|
|
5
|
+
const r = document.querySelector("ui-editor")?.shadowRoot?.querySelector("iframe")?.contentDocument;
|
|
6
|
+
if (!r || r.querySelector('script[data-fullstory-bridge="true"]'))
|
|
7
|
+
return;
|
|
8
|
+
const t = r.createElement("script");
|
|
9
|
+
t.src = o, t.async = !0, t.crossOrigin = "anonymous", t.dataset.fullstoryBridge = "true", r.head.appendChild(t);
|
|
10
|
+
} });
|
|
11
|
+
export {
|
|
12
|
+
c as useFullStoryBridge
|
|
13
|
+
};
|
|
@@ -1,27 +1,37 @@
|
|
|
1
|
-
import { defaultHtmlCompilerRules as
|
|
2
|
-
import { itemsCompilerRules as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { defaultHtmlCompilerRules as n } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
+
import { itemsCompilerRules as c } from "../config/compiler/itemsCompilerRules.js";
|
|
3
|
+
import { liquidCompilerRules as p } from "../config/compiler/liquidCompilerRules.js";
|
|
4
|
+
import { outlookCompilerRules as f } from "../config/compiler/outlookCompilerRules.js";
|
|
5
|
+
import { recommendationCompilerRules as d } from "../config/compiler/recommendationCompilerRules.js";
|
|
6
|
+
import { socialCompilerRules as R } from "../config/compiler/socialCompilerRules.js";
|
|
7
|
+
import { unsubscribeCompilerRules as b } from "../config/compiler/unsubscribeCompilerRules.js";
|
|
8
|
+
import { createHtmlCompiler as C } from "../utils/htmlCompiler.js";
|
|
9
|
+
import { useConfig as F } from "./useConfig.js";
|
|
10
|
+
let i = null, u, o = null;
|
|
11
|
+
const g = (l) => !i || !o ? !0 : o.ignoreDefaultRules !== l.ignoreDefaultRules || o.liquidEnabled !== l.liquidEnabled || o.customRules !== l.customRules || o.fallbackFont !== l.fallbackFont, B = () => {
|
|
12
|
+
const { compiler: l, isFeatureEnabled: m, partner: a } = F(), e = {
|
|
13
|
+
ignoreDefaultRules: !!l.value?.ignoreDefaultRules,
|
|
14
|
+
liquidEnabled: m("liquidSyntax"),
|
|
15
|
+
customRules: l.value?.customRules,
|
|
16
|
+
fallbackFont: a.value?.fallbackFont
|
|
17
|
+
};
|
|
18
|
+
if (g(e)) {
|
|
19
|
+
const t = [
|
|
20
|
+
...e.ignoreDefaultRules ? [] : n,
|
|
21
|
+
...d,
|
|
22
|
+
...b,
|
|
23
|
+
...c,
|
|
24
|
+
...f,
|
|
25
|
+
...R,
|
|
26
|
+
...e.liquidEnabled ? p : [],
|
|
27
|
+
...(e.customRules ?? []).map((r, s) => ({
|
|
28
|
+
...r,
|
|
29
|
+
priority: r.priority + 1e3 + s
|
|
30
|
+
}))
|
|
31
|
+
];
|
|
32
|
+
i = C(t), u = e.fallbackFont, o = e;
|
|
33
|
+
}
|
|
34
|
+
return { compileHtml: (t) => i.compile(t, void 0, u) };
|
|
25
35
|
};
|
|
26
36
|
export {
|
|
27
37
|
B as useHtmlCompiler
|
|
@@ -1,159 +1,153 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { TemplateTypes as
|
|
3
|
-
import { DISPLAY_CONDITIONS_REGEX as
|
|
4
|
-
import { ToasterTypeOptions as
|
|
5
|
-
import { itemsBlockDynamicVariables as
|
|
6
|
-
import { useRecommendationStore as
|
|
7
|
-
import { base64EncodeWithSpecialChars as
|
|
8
|
-
import { useHttp as
|
|
9
|
-
import { useToaster as
|
|
10
|
-
import { useTranslations as
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
return [...i.matchAll(
|
|
1
|
+
import { useConfig as R } from "./useConfig.js";
|
|
2
|
+
import { TemplateTypes as D } from "../enums/defaults.js";
|
|
3
|
+
import { DISPLAY_CONDITIONS_REGEX as L, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as V, CampaignCouldNotBeSavedKey as _, CanNotMakeAnyChangesForRunningKey as H } from "../enums/html-validator.js";
|
|
4
|
+
import { ToasterTypeOptions as r } from "../enums/toaster.js";
|
|
5
|
+
import { itemsBlockDynamicVariables as P } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
6
|
+
import { useRecommendationStore as G } from "../stores/recommendation.js";
|
|
7
|
+
import { base64EncodeWithSpecialChars as M } from "../utils/base64.js";
|
|
8
|
+
import { useHttp as $ } from "./useHttp.js";
|
|
9
|
+
import { useToaster as X } from "./useToaster.js";
|
|
10
|
+
import { useTranslations as j } from "./useTranslations.js";
|
|
11
|
+
const q = /recommendation-id="(\d+)"/g;
|
|
12
|
+
function z(i) {
|
|
13
|
+
return [...i.matchAll(q)].map((u) => u[1]);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function K(i, u) {
|
|
16
16
|
return u.some((d) => i.startsWith(`${d}_`));
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const { showToaster: i } = q(), { post: u } = j(), { config: d } = L(), r = z(), g = $(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === V.transactional, w = async (e) => {
|
|
18
|
+
const ae = () => {
|
|
19
|
+
const { showToaster: i } = X(), { post: u } = $(), { config: d } = R(), a = j(), g = G(), p = d.value?.partner?.messageType === D.transactional, v = async (e) => {
|
|
21
20
|
const t = await u(
|
|
22
21
|
"/newsletter/template-library/check-template-html-body",
|
|
23
|
-
{ html:
|
|
24
|
-
), { status: n, message:
|
|
22
|
+
{ html: M(e) }
|
|
23
|
+
), { status: n, message: c } = t.data;
|
|
25
24
|
return n || i({
|
|
26
|
-
type:
|
|
27
|
-
message: n === void 0 ?
|
|
28
|
-
}),
|
|
29
|
-
type:
|
|
30
|
-
message:
|
|
25
|
+
type: r.Alert,
|
|
26
|
+
message: n === void 0 ? c : a("newsletter.invalid-url-link-for-toaster")
|
|
27
|
+
}), a(_), c === a(H) && i({
|
|
28
|
+
type: r.Alert,
|
|
29
|
+
message: a("newsletter.already-in-progress")
|
|
31
30
|
}), n;
|
|
32
|
-
},
|
|
31
|
+
}, C = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), b = (e) => ["if", "endif"].includes(e.toLowerCase()), w = (e, s) => {
|
|
33
32
|
const t = e.match(/({%(.*?)%})/g);
|
|
34
33
|
let n = !0;
|
|
35
|
-
return t !== null && !p && t.forEach((
|
|
36
|
-
const o =
|
|
34
|
+
return t !== null && !p && t.forEach((c) => {
|
|
35
|
+
const o = c.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
37
36
|
if (o && o.length > 0) {
|
|
38
|
-
const [
|
|
39
|
-
|
|
40
|
-
type:
|
|
41
|
-
message:
|
|
37
|
+
const [l] = o;
|
|
38
|
+
C(l) && !s.includes(l) && (i({
|
|
39
|
+
type: r.Warning,
|
|
40
|
+
message: a("custom-fields.invalid-custom-fields")
|
|
42
41
|
}), n = !1);
|
|
43
42
|
}
|
|
44
43
|
}), n;
|
|
45
|
-
},
|
|
46
|
-
const n = t ? await
|
|
47
|
-
return
|
|
48
|
-
},
|
|
49
|
-
type:
|
|
50
|
-
message:
|
|
51
|
-
}), !1),
|
|
44
|
+
}, S = async (e, s, t) => {
|
|
45
|
+
const n = t ? await v(e) : !0;
|
|
46
|
+
return w(e, s) && n;
|
|
47
|
+
}, E = (e) => e.length > 0 ? !0 : (i({
|
|
48
|
+
type: r.Warning,
|
|
49
|
+
message: a("newsletter.html-content-is-empty")
|
|
50
|
+
}), !1), A = (e) => {
|
|
52
51
|
const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
|
|
53
52
|
return s > t && i({
|
|
54
|
-
type:
|
|
55
|
-
message:
|
|
53
|
+
type: r.Warning,
|
|
54
|
+
message: a("custom-fields.missing-closing-braces")
|
|
56
55
|
}), s < t && i({
|
|
57
|
-
type:
|
|
58
|
-
message:
|
|
56
|
+
type: r.Warning,
|
|
57
|
+
message: a("custom-fields.missing-opening-braces")
|
|
59
58
|
}), s === t;
|
|
60
|
-
},
|
|
59
|
+
}, I = (e) => {
|
|
61
60
|
const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
|
|
62
61
|
return s || i({
|
|
63
|
-
type:
|
|
64
|
-
message:
|
|
62
|
+
type: r.Warning,
|
|
63
|
+
message: a("custom-fields.invalid-custom-fields")
|
|
65
64
|
}), s;
|
|
66
|
-
},
|
|
65
|
+
}, k = (e, s) => {
|
|
67
66
|
const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
|
|
68
67
|
if (t && !p) {
|
|
69
|
-
const n = new Set(s.map((
|
|
70
|
-
if (t.forEach((
|
|
71
|
-
const m =
|
|
72
|
-
(!n.has(m) || m === "") && !
|
|
68
|
+
const n = new Set(s.map((l) => l.toLowerCase())), c = z(e), o = [];
|
|
69
|
+
if (t.forEach((l) => {
|
|
70
|
+
const m = l.slice(2, -2).trim().toLowerCase();
|
|
71
|
+
(!n.has(m) || m === "") && !K(m, c) && o.push(m);
|
|
73
72
|
}), o.length > 0) {
|
|
74
|
-
const
|
|
73
|
+
const l = `
|
|
75
74
|
<ul>
|
|
76
75
|
${o.map((m) => `<li>${m}</li>`).join("")}
|
|
77
76
|
</ul>
|
|
78
77
|
`;
|
|
79
78
|
return i({
|
|
80
|
-
type:
|
|
81
|
-
message:
|
|
79
|
+
type: r.Alert,
|
|
80
|
+
message: a("custom-fields.invalid-custom-fields") + l
|
|
82
81
|
}), !1;
|
|
83
82
|
}
|
|
84
83
|
}
|
|
85
84
|
return !0;
|
|
86
|
-
},
|
|
85
|
+
}, x = (e) => {
|
|
87
86
|
const s = e.match(/{%(.*?)%}/g), t = [];
|
|
88
87
|
let n = !0;
|
|
89
|
-
if (s && s.forEach((
|
|
90
|
-
const o =
|
|
91
|
-
(!o ||
|
|
92
|
-
type:
|
|
93
|
-
message:
|
|
88
|
+
if (s && s.forEach((c) => {
|
|
89
|
+
const o = c.match(L), l = c.match(V), m = o?.join("") || "";
|
|
90
|
+
(!o || c !== m) && !l && (i({
|
|
91
|
+
type: r.Alert,
|
|
92
|
+
message: a("newsletter.display-conditions-invalid-syntax")
|
|
94
93
|
}), n = !1), o && o.forEach((f) => {
|
|
95
94
|
f.trim() === "=" && (i({
|
|
96
|
-
type:
|
|
97
|
-
message:
|
|
95
|
+
type: r.Alert,
|
|
96
|
+
message: a("custom-conditions.wrong-equality-operators")
|
|
98
97
|
}), n = !1);
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
const y = f.match(/^[a-zA-Z]*$/g);
|
|
99
|
+
y && y.forEach((h) => {
|
|
100
|
+
b(h) && t.push(h);
|
|
102
101
|
});
|
|
103
102
|
});
|
|
104
103
|
}), t.length) {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
type:
|
|
108
|
-
message:
|
|
104
|
+
const c = t.filter((l) => l === "if"), o = t.filter((l) => l === "endif");
|
|
105
|
+
c.length !== o.length && (i({
|
|
106
|
+
type: r.Alert,
|
|
107
|
+
message: a("custom-conditions.missing-if-endif-tag")
|
|
109
108
|
}), n = !1);
|
|
110
109
|
}
|
|
111
110
|
return n;
|
|
112
|
-
},
|
|
111
|
+
}, T = (e) => {
|
|
113
112
|
const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
|
|
114
113
|
return n || i({
|
|
115
|
-
type:
|
|
116
|
-
message:
|
|
114
|
+
type: r.Warning,
|
|
115
|
+
message: a("custom-conditions.no-space-after-braces")
|
|
117
116
|
}), n;
|
|
118
|
-
},
|
|
119
|
-
type:
|
|
120
|
-
message:
|
|
121
|
-
}), !1) : !0,
|
|
122
|
-
type:
|
|
123
|
-
message:
|
|
124
|
-
}), !1) : !0,
|
|
117
|
+
}, F = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (i({
|
|
118
|
+
type: r.Warning,
|
|
119
|
+
message: a("custom-conditions.no-braces-inside-if-tag")
|
|
120
|
+
}), !1) : !0, W = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (i({
|
|
121
|
+
type: r.Alert,
|
|
122
|
+
message: a("newsletter.fill-all-necessary-fields")
|
|
123
|
+
}), !1) : !0, N = (e) => {
|
|
125
124
|
const s = /src="[^"]*\.(svg|pst)"/gm;
|
|
126
125
|
return e.match(s) === null ? !0 : (i({
|
|
127
|
-
type:
|
|
128
|
-
message:
|
|
126
|
+
type: r.Alert,
|
|
127
|
+
message: a("newsletter.invalid-image-type")
|
|
129
128
|
}), !1);
|
|
130
|
-
},
|
|
129
|
+
}, O = (e) => {
|
|
131
130
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
|
|
132
|
-
return Array.from(n).find((o) => {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}) ? (i({
|
|
136
|
-
type: c.Alert,
|
|
137
|
-
message: r("unsubscribe-templates.select-checkbox-groups")
|
|
131
|
+
return Array.from(n).find((o) => !o.id?.trim()) ? (i({
|
|
132
|
+
type: r.Alert,
|
|
133
|
+
message: a("unsubscribe-templates.select-checkbox-groups")
|
|
138
134
|
}), !1) : !0;
|
|
139
|
-
},
|
|
135
|
+
}, B = (e) => {
|
|
140
136
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
|
|
141
|
-
return Array.from(n).find((o) => {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}) ? (i({
|
|
145
|
-
type: c.Alert,
|
|
146
|
-
message: r("unsubscribe-templates.select-radio-button-groups")
|
|
137
|
+
return Array.from(n).find((o) => !o.id?.trim()) ? (i({
|
|
138
|
+
type: r.Alert,
|
|
139
|
+
message: a("unsubscribe-templates.select-radio-button-groups")
|
|
147
140
|
}), !1) : !0;
|
|
148
141
|
};
|
|
149
142
|
return { validateHtml: async (e, s, t = !1) => {
|
|
150
143
|
const n = [
|
|
151
144
|
...s.map((o) => o.value),
|
|
152
|
-
...
|
|
145
|
+
...P,
|
|
146
|
+
...d.value?.template?.customFieldAttributes ?? []
|
|
153
147
|
];
|
|
154
|
-
return await
|
|
148
|
+
return await S(e, n, t) && E(e) && A(e) && I(e) && k(e, n) && x(e) && T(e) && F(e) && W() && N(e) && O(e) && B(e);
|
|
155
149
|
} };
|
|
156
150
|
};
|
|
157
151
|
export {
|
|
158
|
-
|
|
152
|
+
ae as useHtmlValidator
|
|
159
153
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getCsrfToken as H } from "../utils/genericUtil.js";
|
|
2
|
-
import { ref as
|
|
3
|
-
const k = (
|
|
4
|
-
const
|
|
2
|
+
import { ref as T, computed as h } from "vue";
|
|
3
|
+
const k = (E = {}) => {
|
|
4
|
+
const d = T(!1), n = T(null), l = T(null), b = h(() => d.value), g = h(() => n.value !== null), m = {
|
|
5
5
|
baseURL: "",
|
|
6
6
|
timeout: 1e4,
|
|
7
7
|
retry: 0,
|
|
@@ -10,11 +10,11 @@ const k = (b = {}) => {
|
|
|
10
10
|
"Content-Type": "application/json",
|
|
11
11
|
"X-CSRF-TOKEN": H()
|
|
12
12
|
},
|
|
13
|
-
...
|
|
13
|
+
...E
|
|
14
14
|
}, w = (e, s) => {
|
|
15
15
|
if (e.startsWith("http://") || e.startsWith("https://"))
|
|
16
16
|
return e;
|
|
17
|
-
const t = s ||
|
|
17
|
+
const t = s || m.baseURL || "";
|
|
18
18
|
return t.endsWith("/") && e.startsWith("/") ? `${t}${e.slice(1)}` : t.endsWith("/") || e.startsWith("/") ? `${t}${e}` : `${t}/${e}`;
|
|
19
19
|
}, P = (e) => new Promise((s, t) => {
|
|
20
20
|
setTimeout(() => {
|
|
@@ -23,53 +23,53 @@ const k = (b = {}) => {
|
|
|
23
23
|
}), x = (e) => new Promise((s) => {
|
|
24
24
|
setTimeout(s, e);
|
|
25
25
|
}), i = async (e, s, t, D = {}) => {
|
|
26
|
-
|
|
27
|
-
const
|
|
26
|
+
n.value = null, d.value = !0, l.value = new AbortController();
|
|
27
|
+
const a = { ...m, ...D }, L = w(s, a.baseURL), u = {
|
|
28
28
|
method: e,
|
|
29
|
-
headers: { ...
|
|
30
|
-
signal:
|
|
31
|
-
...
|
|
29
|
+
headers: { ...a.headers },
|
|
30
|
+
signal: l.value.signal,
|
|
31
|
+
...a
|
|
32
32
|
};
|
|
33
|
-
t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete
|
|
34
|
-
const
|
|
33
|
+
t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete u.headers["Content-Type"], u.body = t) : u.body = JSON.stringify(t));
|
|
34
|
+
const y = async (p = 0) => {
|
|
35
35
|
try {
|
|
36
|
-
const o = [fetch(L,
|
|
37
|
-
|
|
36
|
+
const o = [fetch(L, u)];
|
|
37
|
+
a.timeout && o.push(P(a.timeout));
|
|
38
38
|
const r = await Promise.race(o);
|
|
39
39
|
if (!r.ok) {
|
|
40
|
-
const O = `HTTP Error: ${r.status} ${r.statusText}`,
|
|
41
|
-
throw
|
|
40
|
+
const O = `HTTP Error: ${r.status} ${r.statusText}`, f = new Error(O);
|
|
41
|
+
throw f.status = r.status, f.statusText = r.statusText, f.response = r, f;
|
|
42
42
|
}
|
|
43
|
-
let
|
|
44
|
-
const
|
|
45
|
-
return
|
|
46
|
-
data:
|
|
43
|
+
let c;
|
|
44
|
+
const v = r.headers.get("content-type");
|
|
45
|
+
return v?.includes("application/json") ? c = await r.json() : v?.includes("text/") ? c = await r.text() : c = await r.blob(), {
|
|
46
|
+
data: c,
|
|
47
47
|
status: r.status,
|
|
48
48
|
statusText: r.statusText,
|
|
49
49
|
headers: r.headers
|
|
50
50
|
};
|
|
51
51
|
} catch (o) {
|
|
52
52
|
const r = o instanceof Error && o.name === "AbortError";
|
|
53
|
-
if (
|
|
54
|
-
return await x(
|
|
55
|
-
throw o instanceof Error ? o.name === "AbortError" ?
|
|
53
|
+
if (p < (a.retry || 0) && !r)
|
|
54
|
+
return await x(a.retryDelay || 1e3), y(p + 1);
|
|
55
|
+
throw o instanceof Error ? o.name === "AbortError" ? n.value = { message: "Request was cancelled" } : n.value = { message: o.message } : n.value = o, o;
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
try {
|
|
59
|
-
return await
|
|
59
|
+
return await y();
|
|
60
60
|
} finally {
|
|
61
|
-
|
|
61
|
+
d.value = !1, l.value = null;
|
|
62
62
|
}
|
|
63
63
|
}, C = (e, s) => i("GET", e, void 0, s), $ = (e, s, t) => i("POST", e, s, t), R = (e, s, t) => i("PUT", e, s, t), U = (e, s, t) => i("PATCH", e, s, t), A = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
|
|
64
|
-
|
|
64
|
+
l.value && l.value.abort(e);
|
|
65
65
|
}, q = () => {
|
|
66
|
-
|
|
66
|
+
n.value = null;
|
|
67
67
|
};
|
|
68
68
|
return {
|
|
69
69
|
// State
|
|
70
|
-
loading:
|
|
71
|
-
error:
|
|
72
|
-
hasError:
|
|
70
|
+
loading: b,
|
|
71
|
+
error: h(() => n.value),
|
|
72
|
+
hasError: g,
|
|
73
73
|
// Methods
|
|
74
74
|
request: i,
|
|
75
75
|
get: C,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useConfigStore as i } from "../stores/config.js";
|
|
2
|
-
import { ProductType as t } from "../@types/config/schemas.js";
|
|
3
2
|
import { isTestPartner as o } from "../@types/config/defaults.js";
|
|
3
|
+
import { ProductType as t } from "../@types/config/schemas.js";
|
|
4
4
|
const T = () => {
|
|
5
5
|
const e = i(), n = () => e.initialized && e.partnerName ? e.partnerName : window.location.hostname.split(".")[0] || "";
|
|
6
6
|
return {
|
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
import { useEditorStore as
|
|
2
|
-
import { usePreviewStore as
|
|
3
|
-
import { useActionsApi as
|
|
4
|
-
import { useCodeEditorApi as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { useEditorStore as d } from "../stores/editor.js";
|
|
2
|
+
import { usePreviewStore as n } from "../stores/preview.js";
|
|
3
|
+
import { useActionsApi as p } from "./useActionsApi.js";
|
|
4
|
+
import { useCodeEditorApi as c } from "./useCodeEditorApi.js";
|
|
5
|
+
import { useHtmlCompiler as u } from "./useHtmlCompiler.js";
|
|
6
|
+
const g = () => {
|
|
7
|
+
const t = d(), e = n(), { closeCodeEditor: i } = c(), { getPreviewData: a, getCompiledEmail: s } = p(), { compileHtml: m } = u(), r = () => {
|
|
8
|
+
t.isPreviewModeOpen = !1, e.$reset();
|
|
8
9
|
};
|
|
9
10
|
return {
|
|
10
11
|
closePreviewMode: r,
|
|
11
12
|
openPreviewMode: () => {
|
|
12
|
-
|
|
13
|
+
t.isCodeEditorOpen && i(), t.isPreviewModeOpen = !0;
|
|
13
14
|
},
|
|
14
15
|
loadPreviewData: async () => {
|
|
15
|
-
if (!(
|
|
16
|
-
|
|
16
|
+
if (!(t.loadingStatus || e.isLoaded)) {
|
|
17
|
+
t.loadingStatus = !0;
|
|
17
18
|
try {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const [o, l] = await Promise.all([
|
|
20
|
+
a(),
|
|
21
|
+
s({ minimize: !0, resetDataSavedFlag: !1 })
|
|
22
|
+
]);
|
|
23
|
+
e.templateHtml = o.html || "", e.ampHtml = o.ampHtml || "", e.ampErrors = o.ampErrors || [], e.setEmailFormat(o.ampHtml ? "AMP" : "html"), e.emailSizeKB = m(l.html).estimatedSizeKB, e.isLoaded = !0;
|
|
24
|
+
} catch (o) {
|
|
25
|
+
console.error("Failed to load preview data:", o), r();
|
|
22
26
|
} finally {
|
|
23
|
-
|
|
27
|
+
t.loadingStatus = !1;
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
};
|
|
28
32
|
};
|
|
29
33
|
export {
|
|
30
|
-
|
|
34
|
+
g as usePreviewMode
|
|
31
35
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { RecommendationFeedSourceMaps as
|
|
2
|
-
import { MinDeviceViewport as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
4
|
-
import { generateCompleteFilterQuery as
|
|
5
|
-
import { useConfigStore as
|
|
6
|
-
const
|
|
1
|
+
import { RecommendationFeedSourceMaps as f, URLS as g } from "../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { MinDeviceViewport as p, DefaultPadding as R } from "../enums/recommendation.js";
|
|
3
|
+
import { useRecommendationExtensionStore as m } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
|
+
import { generateCompleteFilterQuery as b } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
5
|
+
import { useConfigStore as x } from "../stores/config.js";
|
|
6
|
+
const P = () => ({
|
|
7
7
|
calculateCardWidth: ({
|
|
8
8
|
mobileLeftPadding: i,
|
|
9
9
|
mobileRightPadding: n,
|
|
10
10
|
cardsInRow: o,
|
|
11
11
|
unresponsive: a
|
|
12
12
|
}) => {
|
|
13
|
-
const r = a ? o : 1, e = i + n + (r - 1) *
|
|
14
|
-
return (
|
|
13
|
+
const r = a ? o : 1, e = i + n + (r - 1) * R;
|
|
14
|
+
return (p - e) / r;
|
|
15
15
|
},
|
|
16
16
|
getRecommendationCampaignData: (i) => {
|
|
17
|
-
const n =
|
|
17
|
+
const n = m(), o = Number(i), a = n.blockStates[o];
|
|
18
18
|
if (!a)
|
|
19
19
|
return {
|
|
20
20
|
textTrimming: !1,
|
|
@@ -43,18 +43,17 @@ const N = () => ({
|
|
|
43
43
|
};
|
|
44
44
|
},
|
|
45
45
|
buildCampaignUrl: (i) => {
|
|
46
|
-
|
|
47
|
-
const n = u(), o = I(), a = Number(i), r = n.blockStates[a];
|
|
46
|
+
const n = m(), o = x(), a = Number(i), r = n.blockStates[a];
|
|
48
47
|
if (!r)
|
|
49
48
|
return "";
|
|
50
|
-
const { recommendationConfigs: e } = r,
|
|
49
|
+
const { recommendationConfigs: e } = r, u = f.find((s) => s.key === e.strategy)?.path || "", t = new URLSearchParams();
|
|
51
50
|
t.set("locale", e.language), t.set("currency", e.currencySettings.value), t.set("partnerName", o.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", o.variationId), e.strategy === "manualMerchandising" ? t.set("productId", e.productIds.join(",")) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
52
|
-
const
|
|
51
|
+
const l = e.filters.filter((s) => s.isValid), c = b(l);
|
|
53
52
|
c && t.set("filter", c), e.shuffleProducts && t.set("shuffle", "true");
|
|
54
|
-
const d = `${
|
|
53
|
+
const d = `${g.RECOMMENDATION_API_URL}/v2/${u}?${t.toString()}`;
|
|
55
54
|
return n.recommendationCampaignUrls[i] = d, d;
|
|
56
55
|
}
|
|
57
56
|
});
|
|
58
57
|
export {
|
|
59
|
-
|
|
58
|
+
P as useRecommendation
|
|
60
59
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RIBBON_SELECTOR as u } from "../enums/onboarding.js";
|
|
2
|
+
import { ref as i, onMounted as b, onBeforeUnmount as f } from "vue";
|
|
3
|
+
const d = () => {
|
|
4
|
+
const e = i(0);
|
|
5
|
+
let o = null;
|
|
6
|
+
const t = () => {
|
|
7
|
+
const r = document.querySelector(u)?.offsetHeight ?? 0;
|
|
8
|
+
e.value !== r && (e.value = r);
|
|
9
|
+
}, s = (n) => `${n + e.value}px`;
|
|
10
|
+
return b(() => {
|
|
11
|
+
t(), o = new MutationObserver(t), o.observe(document.body, {
|
|
12
|
+
childList: !0,
|
|
13
|
+
subtree: !0
|
|
14
|
+
});
|
|
15
|
+
}), f(() => {
|
|
16
|
+
o?.disconnect();
|
|
17
|
+
}), { ribbonOffset: e, getTopPosition: s };
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
d as useRibbonOffset
|
|
21
|
+
};
|
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { useActionsApi as v } from "./useActionsApi.js";
|
|
2
|
+
import { useConfig as S } from "./useConfig.js";
|
|
3
|
+
import { useSaveStart as V, useSaveComplete as x } from "./useGuidoActions.js";
|
|
4
|
+
import { useSyncModuleExtractor as y } from "./useSyncModuleExtractor.js";
|
|
5
|
+
import { useStripoApi as w } from "../services/stripoApi.js";
|
|
6
|
+
import { useTemplatePreparation as b } from "../utils/templatePreparation.js";
|
|
7
|
+
import { useHtmlValidator as q } from "./useHtmlValidator.js";
|
|
8
|
+
import { useLiquidValidator as H } from "./validators/useLiquidValidator.js";
|
|
9
|
+
const k = () => {
|
|
10
|
+
const e = V(), o = x(), { validateHtml: s } = q(), { validateLiquidSyntax: r } = H(), { callbacks: a, isFeatureEnabled: n } = S(), { extractSyncModuleData: l } = y(), { setSyncModuleUnsubscriptionPages: d } = w(), { editorSave: u } = v();
|
|
11
|
+
return { save: async (c = !1) => {
|
|
12
|
+
e();
|
|
13
|
+
const { prepareTemplateDetails: m } = b(), t = await m();
|
|
14
|
+
if (n("liquidSyntax")) {
|
|
15
|
+
if (!await r(t.compiledHtml))
|
|
16
|
+
return;
|
|
17
|
+
} else if (!await s(t.compiledHtml, t.dynamicContentList, !0))
|
|
14
18
|
return;
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
if (a.value?.externalValidation && !await a.value.externalValidation(t))
|
|
20
|
+
return;
|
|
21
|
+
await u();
|
|
22
|
+
const { unsubscribePayload: p, stripoModules: f } = l(t.rawHtml);
|
|
23
|
+
return await d(p), t.modules = f, c || o(t), t;
|
|
17
24
|
} };
|
|
18
25
|
};
|
|
19
26
|
export {
|
|
20
|
-
|
|
27
|
+
k as useSave
|
|
21
28
|
};
|