@useinsider/guido 3.2.0-beta.78d83bd → 3.2.0-beta.7e0c6bd
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/dist/@types/config/schemas.js +1 -1
- package/dist/@types/config/validator.js +27 -34
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +76 -81
- 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/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 +11 -12
- package/dist/components/organisms/header/EditorActions.vue2.js +18 -22
- 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.vue2.js +14 -17
- 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 +8 -9
- 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 +8 -9
- package/dist/composables/useHtmlCompiler.js +34 -26
- package/dist/composables/useHtmlValidator.js +101 -109
- package/dist/composables/useHttp.js +30 -30
- package/dist/composables/usePartner.js +1 -1
- package/dist/composables/useRecommendation.js +14 -15
- package/dist/composables/useRibbonOffset.js +21 -0
- package/dist/composables/useSave.js +21 -22
- package/dist/composables/useStripo.js +53 -50
- package/dist/composables/useSyncModuleExtractor.js +31 -29
- package/dist/composables/useTimerClone.js +24 -25
- package/dist/composables/useTranslations.js +23 -16
- package/dist/composables/useValidation.js +7 -8
- package/dist/composables/validators/useLiquidValidator.js +13 -13
- package/dist/config/compiler/unsubscribeCompilerRules.js +17 -19
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +10 -11
- package/dist/config/migrator/checkboxMigrator.js +20 -21
- package/dist/config/migrator/couponBlockMigrator.js +18 -19
- package/dist/config/migrator/itemsBlockMigrator.js +87 -89
- package/dist/config/migrator/radioButtonMigrator.js +12 -13
- package/dist/config/migrator/recommendationMigrator.js +106 -109
- package/dist/config/migrator/unsubscribeMigrator.js +10 -11
- package/dist/enums/onboarding.js +7 -2
- package/dist/enums/unsubscribe.js +18 -19
- 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 +9 -14
- package/dist/extensions/Blocks/Items/template.js +218 -216
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +128 -133
- 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 +17 -18
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +4 -6
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +82 -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 +134 -135
- 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 +18 -20
- package/dist/extensions/Blocks/Recommendation/extension.js +31 -32
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +8 -16
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +55 -56
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +22 -23
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +10 -10
- 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 +24 -25
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +45 -47
- package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +13 -16
- 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 +53 -58
- package/dist/guido.css +1 -1
- package/dist/library.js +11 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +233 -210
- package/dist/node_modules/valibot/dist/index.js +122 -126
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +14 -17
- package/dist/services/templateLibraryApi.js +37 -38
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useHtmlCompiler.d.ts +1 -2
- package/dist/src/composables/useRibbonOffset.d.ts +4 -0
- package/dist/src/composables/useTranslations.d.ts +1 -1
- package/dist/src/enums/onboarding.d.ts +6 -0
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/src/stores/onboarding.d.ts +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 +6 -9
- package/dist/stores/unsubscribe.js +1 -4
- package/dist/utils/dateUtil.js +7 -10
- package/dist/utils/genericUtil.js +10 -13
- package/dist/utils/pairProductVariables.js +13 -14
- package/package.json +8 -5
- package/dist/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/lodash-es/_Hash.js +0 -20
- package/dist/node_modules/lodash-es/_ListCache.js +0 -20
- package/dist/node_modules/lodash-es/_Map.js +0 -6
- package/dist/node_modules/lodash-es/_MapCache.js +0 -20
- 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/_Symbol.js +0 -5
- 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/_assocIndexOf.js +0 -10
- 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/_baseGetTag.js +0 -10
- 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/_baseIsNative.js +0 -16
- 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/_coreJsData.js +0 -5
- 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/_freeGlobal.js +0 -4
- package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_getMapData.js +0 -8
- package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
- package/dist/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/lodash-es/_getRawTag.js +0 -15
- 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/_getValue.js +0 -6
- package/dist/node_modules/lodash-es/_hasPath.js +0 -19
- package/dist/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/lodash-es/_hashSet.js +0 -9
- 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/_isKeyable.js +0 -7
- package/dist/node_modules/lodash-es/_isMasked.js +0 -11
- 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/_listCacheClear.js +0 -6
- package/dist/node_modules/lodash-es/_listCacheDelete.js +0 -12
- package/dist/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/lodash-es/_mapCacheSet.js +0 -8
- 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/_nativeCreate.js +0 -5
- 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/_objectToString.js +0 -7
- package/dist/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/lodash-es/_root.js +0 -5
- 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/_toSource.js +0 -17
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
- package/dist/node_modules/lodash-es/eq.js +0 -6
- 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/isFunction.js +0 -12
- package/dist/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/lodash-es/isObject.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/memoize.js +0 -18
- 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
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { ToasterTypeOptions as
|
|
1
|
+
import { ToasterTypeOptions as r } from "../../enums/toaster.js";
|
|
2
2
|
import { base64EncodeWithSpecialChars as u } from "../../utils/base64.js";
|
|
3
3
|
import { useHttp as d } from "../useHttp.js";
|
|
4
4
|
import { useToaster as c } from "../useToaster.js";
|
|
5
5
|
import { useTranslations as p } from "../useTranslations.js";
|
|
6
6
|
const v = () => {
|
|
7
|
-
const { post:
|
|
8
|
-
return { validateLiquidSyntax: async (
|
|
7
|
+
const { post: n } = d(), { showToaster: e } = c(), a = p();
|
|
8
|
+
return { validateLiquidSyntax: async (i) => {
|
|
9
9
|
try {
|
|
10
|
-
const t = await
|
|
10
|
+
const t = await n("/newsletter/contents/validate-syntax", [{
|
|
11
11
|
identifier: "default",
|
|
12
12
|
syntax: "liquid",
|
|
13
13
|
contents: {
|
|
14
14
|
subject: null,
|
|
15
15
|
preheader: null,
|
|
16
|
-
html: u(
|
|
16
|
+
html: u(i),
|
|
17
17
|
ampHtml: null
|
|
18
18
|
}
|
|
19
19
|
}]);
|
|
20
20
|
if (!Array.isArray(t.data)) {
|
|
21
21
|
const l = t.data;
|
|
22
22
|
return e({
|
|
23
|
-
type:
|
|
24
|
-
message: l.message ??
|
|
23
|
+
type: r.Warning,
|
|
24
|
+
message: l.message ?? a("journey-builder.liquid-validation-failed")
|
|
25
25
|
}), !1;
|
|
26
26
|
}
|
|
27
|
-
const [
|
|
28
|
-
return
|
|
29
|
-
type:
|
|
30
|
-
message:
|
|
27
|
+
const [o] = t.data, s = Object.values(o?.errors ?? {});
|
|
28
|
+
return s.length ? (e({
|
|
29
|
+
type: r.Warning,
|
|
30
|
+
message: s[0].replace(/^line \d+:\s*/, "")
|
|
31
31
|
}), !1) : !0;
|
|
32
32
|
} catch {
|
|
33
33
|
return e({
|
|
34
|
-
type:
|
|
35
|
-
message:
|
|
34
|
+
type: r.Alert,
|
|
35
|
+
message: a("journey-builder.liquid-validation-failed")
|
|
36
36
|
}), !1;
|
|
37
37
|
}
|
|
38
38
|
} };
|
|
@@ -1,43 +1,41 @@
|
|
|
1
|
-
import { usePartner as
|
|
2
|
-
import { LINK_REGEXES as p, PRODUCT_TYPE_URL_SEGMENTS as
|
|
3
|
-
import { parsePageList as
|
|
4
|
-
import { useConfigStore as
|
|
5
|
-
import { useDynamicContentStore as
|
|
6
|
-
import { useUnsubscribeStore as
|
|
7
|
-
import { ProductType as
|
|
8
|
-
|
|
9
|
-
const F = [
|
|
1
|
+
import { usePartner as I } from "../../composables/usePartner.js";
|
|
2
|
+
import { LINK_REGEXES as p, PRODUCT_TYPE_URL_SEGMENTS as S, LINK_TYPES as R, INSIDER_ID as m, URLS as _ } from "../../enums/unsubscribe.js";
|
|
3
|
+
import { parsePageList as U } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
4
|
+
import { useConfigStore as N } from "../../stores/config.js";
|
|
5
|
+
import { useDynamicContentStore as C } from "../../stores/dynamic-content.js";
|
|
6
|
+
import { useUnsubscribeStore as L } from "../../stores/unsubscribe.js";
|
|
7
|
+
import { ProductType as P } from "../../@types/config/schemas.js";
|
|
8
|
+
const $ = [
|
|
10
9
|
{
|
|
11
10
|
id: "add-unsubscribe-link-values",
|
|
12
11
|
description: "Adding unsubscribe link values",
|
|
13
12
|
type: "custom",
|
|
14
13
|
processor: (s) => {
|
|
15
|
-
const { getPartnerName: i } =
|
|
14
|
+
const { getPartnerName: i } = I(), n = N(), t = C(), E = L(), c = n.variationId;
|
|
16
15
|
if (!c)
|
|
17
16
|
return s;
|
|
18
|
-
const r =
|
|
17
|
+
const r = S[n.productType] ?? S[P.EMAIL];
|
|
19
18
|
let e = s;
|
|
20
19
|
const d = `/${i()}/${r}/${c}?user={{iid}}`, f = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]");
|
|
21
20
|
let a = !1, l = !1;
|
|
22
21
|
return f.forEach((g) => {
|
|
23
|
-
var S;
|
|
24
22
|
const u = g.getAttribute("data-unsubscribe-page-list");
|
|
25
23
|
if (!u)
|
|
26
24
|
return;
|
|
27
|
-
const
|
|
28
|
-
(o) =>
|
|
29
|
-
)
|
|
30
|
-
a = a || b.some((o) => o.type ===
|
|
25
|
+
const y = U(u), b = E.templates?.filter(
|
|
26
|
+
(o) => y.includes(o.id)
|
|
27
|
+
) ?? [];
|
|
28
|
+
a = a || b.some((o) => o.type === R.UNSUBSCRIBE_LINK_TYPE), l = l || b.some((o) => o.type === R.PREFERENCES_LINK_TYPE);
|
|
31
29
|
}), (a || l) && (t.selectedDynamicContentList.some((u) => u.value === m) || t.selectedDynamicContentList.push({
|
|
32
30
|
text: m,
|
|
33
31
|
value: m,
|
|
34
32
|
fallback: ""
|
|
35
33
|
})), a && (e = e.replace(
|
|
36
34
|
p.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
|
|
37
|
-
|
|
35
|
+
_.UNSUBSCRIBE_URL + d
|
|
38
36
|
)), l && (e = e.replace(
|
|
39
37
|
p.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
|
|
40
|
-
|
|
38
|
+
_.PREFERENCES_URL + d
|
|
41
39
|
)), f.length && (e = e.replace(p.UNSUBSCRIBE_LINK_REGEX, "")), e;
|
|
42
40
|
},
|
|
43
41
|
priority: 60
|
|
@@ -81,5 +79,5 @@ const F = [
|
|
|
81
79
|
}
|
|
82
80
|
];
|
|
83
81
|
export {
|
|
84
|
-
|
|
82
|
+
$ as unsubscribeCompilerRules
|
|
85
83
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useConfig as S } from "../../../composables/useConfig.js";
|
|
2
2
|
import { useRecommendation as _ } from "../../../composables/useRecommendation.js";
|
|
3
3
|
import { useRecommendationExtensionStore as d } from "../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
|
-
function
|
|
4
|
+
function m(e, u, r, o, s = "") {
|
|
5
5
|
const n = `{{${s}${e}_${u}_${r}}}`, t = `{{${s}${e}_${u}_currency}}`;
|
|
6
6
|
return o === "before" ? `${t} ${n}` : `${n} ${t}`;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function b(e, u, r, o, s, n) {
|
|
9
9
|
switch (u) {
|
|
10
10
|
case "productImage": {
|
|
11
11
|
const t = e.querySelector("img");
|
|
@@ -26,7 +26,7 @@ function m(e, u, r, o, s, n) {
|
|
|
26
26
|
const t = e.querySelector("p");
|
|
27
27
|
if (t) {
|
|
28
28
|
const c = t.querySelector("strong") || t;
|
|
29
|
-
c.textContent =
|
|
29
|
+
c.textContent = m(r, o, "price", s, n);
|
|
30
30
|
}
|
|
31
31
|
break;
|
|
32
32
|
}
|
|
@@ -34,7 +34,7 @@ function m(e, u, r, o, s, n) {
|
|
|
34
34
|
const t = e.querySelector("p");
|
|
35
35
|
if (t) {
|
|
36
36
|
const c = t.querySelector("strong") || t;
|
|
37
|
-
c.textContent =
|
|
37
|
+
c.textContent = m(
|
|
38
38
|
r,
|
|
39
39
|
o,
|
|
40
40
|
"original_price",
|
|
@@ -85,8 +85,8 @@ function q(e, u, r, o) {
|
|
|
85
85
|
n.querySelectorAll("[data-attribute-type]").forEach((a) => {
|
|
86
86
|
const i = a.getAttribute("data-attribute-type") || "", l = a.querySelectorAll(".attribute-cell");
|
|
87
87
|
l.length > 0 ? l.forEach((p) => {
|
|
88
|
-
|
|
89
|
-
}) :
|
|
88
|
+
b(p, i, u, t, r, o);
|
|
89
|
+
}) : b(a, i, u, t, r, o);
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
92
|
}
|
|
@@ -97,10 +97,10 @@ function g(e, u, r, o) {
|
|
|
97
97
|
const [n] = s, t = n.querySelector("[data-attribute-type]"), c = t ? t.querySelectorAll(".attribute-cell").length : 1;
|
|
98
98
|
s.forEach((a, i) => {
|
|
99
99
|
a.querySelectorAll("[data-attribute-type]").forEach((p) => {
|
|
100
|
-
const
|
|
100
|
+
const y = p.getAttribute("data-attribute-type") || "";
|
|
101
101
|
p.querySelectorAll(".attribute-cell").forEach((f, $) => {
|
|
102
102
|
const A = i * c + $;
|
|
103
|
-
|
|
103
|
+
b(f, y, u, A, r, o);
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
106
|
});
|
|
@@ -127,12 +127,11 @@ function T(e) {
|
|
|
127
127
|
n.recommendationCampaignUrls = {};
|
|
128
128
|
const { isFeatureEnabled: t } = S(), c = t("liquidSyntax") ? "reco_" : "";
|
|
129
129
|
return o.forEach((i) => {
|
|
130
|
-
var p, b;
|
|
131
130
|
const l = i.getAttribute("recommendation-id");
|
|
132
|
-
l && (
|
|
131
|
+
l && (i.parentNode?.insertBefore(r.createComment("REC_START"), i), i.parentNode?.insertBefore(r.createComment("REC_END"), i.nextSibling), s(l), C(i, l, c));
|
|
133
132
|
}), E(u, r).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
134
133
|
}
|
|
135
134
|
export {
|
|
136
|
-
|
|
135
|
+
m as formatPriceVariable,
|
|
137
136
|
T as prepareRecommendationBlocks
|
|
138
137
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
class
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var x = (s, t, e) => t in s ? m(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var d = (s, t, e) => x(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import y from "../../extensions/Blocks/Checkbox/template.js";
|
|
5
|
+
class b {
|
|
6
6
|
constructor() {
|
|
7
|
-
|
|
7
|
+
d(this, "parser");
|
|
8
8
|
this.parser = new DOMParser();
|
|
9
9
|
}
|
|
10
10
|
migrate(t) {
|
|
@@ -13,18 +13,17 @@ class f {
|
|
|
13
13
|
return i.length === 0 ? t : (i.forEach((r) => {
|
|
14
14
|
if (r.classList.contains("checkbox-block-v2"))
|
|
15
15
|
return;
|
|
16
|
-
const
|
|
17
|
-
`<table id="tempDoc"><tbody><tr>${
|
|
16
|
+
const o = r.getAttribute("id"), l = this.extractTextFromElement(r, "ins-title"), n = this.extractTextFromElement(r, "ins-description"), c = this.buildTextBlock(l), a = this.buildTextBlock(n), p = y.replace("{-{-TITLE-}-}", c).replace("{-{-DESCRIPTION-}-}", a), g = this.parser.parseFromString(
|
|
17
|
+
`<table id="tempDoc"><tbody><tr>${p}</tr></tbody></table>`,
|
|
18
18
|
"text/html"
|
|
19
19
|
).querySelector(".checkbox-block-v2");
|
|
20
|
-
|
|
20
|
+
g && r.parentNode && (g.setAttribute("id", o || ""), r.parentNode.replaceChild(g, r));
|
|
21
21
|
}), e.documentElement.outerHTML);
|
|
22
22
|
} catch (e) {
|
|
23
23
|
return console.error("CheckboxMigrator failed:", e), t;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
extractTextFromElement(t, e) {
|
|
27
|
-
var o, d;
|
|
28
27
|
const i = t.querySelector(`.${e}`);
|
|
29
28
|
if (!i)
|
|
30
29
|
return {
|
|
@@ -37,18 +36,18 @@ class f {
|
|
|
37
36
|
const r = i.querySelector("p");
|
|
38
37
|
if (!r)
|
|
39
38
|
return {
|
|
40
|
-
text:
|
|
39
|
+
text: i.textContent?.trim() || (e === "ins-title" ? "Title" : "Description"),
|
|
41
40
|
isBold: !1,
|
|
42
41
|
isItalic: !1,
|
|
43
42
|
align: i.getAttribute("align") || "left",
|
|
44
43
|
styles: ""
|
|
45
44
|
};
|
|
46
|
-
const
|
|
45
|
+
const o = r.textContent?.trim() || (e === "ins-title" ? "Title" : "Description"), l = r.getAttribute("style") || "", n = i.getAttribute("align") || r.getAttribute("align") || "left", c = /font-weight\s*:\s*bold/i.test(l) || !!r.querySelector("b, strong"), a = /font-style\s*:\s*italic/i.test(l) || !!r.querySelector("i, em"), p = this.removeStyleProperties(l, ["font-weight", "font-style"]), u = this.convertInlineToBlock(p);
|
|
47
46
|
return {
|
|
48
|
-
text:
|
|
49
|
-
isBold:
|
|
50
|
-
isItalic:
|
|
51
|
-
align:
|
|
47
|
+
text: o,
|
|
48
|
+
isBold: c,
|
|
49
|
+
isItalic: a,
|
|
50
|
+
align: n,
|
|
52
51
|
styles: u
|
|
53
52
|
};
|
|
54
53
|
}
|
|
@@ -65,8 +64,8 @@ class f {
|
|
|
65
64
|
`;
|
|
66
65
|
}
|
|
67
66
|
removeStyleProperties(t, e) {
|
|
68
|
-
return t ? e.reduce((r,
|
|
69
|
-
const l = new RegExp(`${
|
|
67
|
+
return t ? e.reduce((r, o) => {
|
|
68
|
+
const l = new RegExp(`${o}\\s*:\\s*[^;]*;?`, "gi");
|
|
70
69
|
return r.replace(l, "");
|
|
71
70
|
}, t).replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim() : "";
|
|
72
71
|
}
|
|
@@ -77,9 +76,9 @@ class f {
|
|
|
77
76
|
return /display\s*:/i.test(e) || (e = e ? `${e}; display: block` : "display: block"), e.replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim();
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
|
-
function
|
|
81
|
-
return new
|
|
79
|
+
function T(s) {
|
|
80
|
+
return new b().migrate(s);
|
|
82
81
|
}
|
|
83
82
|
export {
|
|
84
|
-
|
|
83
|
+
T as migrateCheckbox
|
|
85
84
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
class
|
|
1
|
+
var f = Object.defineProperty;
|
|
2
|
+
var k = (o, t, e) => t in o ? f(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
|
|
3
|
+
var d = (o, t, e) => k(o, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import m from "../../extensions/Blocks/CouponBlock/template.js";
|
|
5
|
+
class h {
|
|
6
6
|
constructor() {
|
|
7
|
-
|
|
7
|
+
d(this, "parser");
|
|
8
8
|
this.parser = new DOMParser();
|
|
9
9
|
}
|
|
10
10
|
migrate(t) {
|
|
11
11
|
try {
|
|
12
|
-
const e = this.parser.parseFromString(t, "text/html"),
|
|
13
|
-
return
|
|
14
|
-
const
|
|
12
|
+
const e = this.parser.parseFromString(t, "text/html"), i = e.querySelectorAll("td.coupon-block.ins-coupon-code:not([esd-extension-block-id])");
|
|
13
|
+
return i.length === 0 ? t : (i.forEach((s) => {
|
|
14
|
+
const n = this.extractText(s), c = this.extractAttributes(s), l = m.replace("{@COUPON_CODE}", n).replace(
|
|
15
15
|
'class="coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block"',
|
|
16
16
|
c.class
|
|
17
17
|
).replace(
|
|
@@ -28,26 +28,25 @@ class y {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
extractText(t) {
|
|
31
|
-
var g;
|
|
32
31
|
const e = t.querySelector(".ins-title");
|
|
33
32
|
if (!e)
|
|
34
33
|
return "{@COUPON_CODE}";
|
|
35
|
-
const
|
|
34
|
+
const i = e.textContent?.trim() || "{@COUPON_CODE}", s = e.getAttribute("style") || "", n = /font-weight\s*:\s*bold/i.test(s), c = /font-style\s*:\s*italic/i.test(s), l = /text-decoration[^;]*underline/i.test(s), u = /text-decoration[^;]*line-through/i.test(s), a = /vertical-align\s*:\s*sub/i.test(s), p = /vertical-align\s*:\s*super/i.test(s);
|
|
36
35
|
return [
|
|
37
|
-
[
|
|
36
|
+
[n, "strong"],
|
|
38
37
|
[c, "em"],
|
|
39
38
|
[l, "u"],
|
|
40
39
|
[u, "s"],
|
|
41
40
|
[a, "sub"],
|
|
42
41
|
[p, "sup"]
|
|
43
|
-
].reduce((
|
|
42
|
+
].reduce((g, [x, b]) => x ? `<${b}>${g}</${b}>` : g, i);
|
|
44
43
|
}
|
|
45
44
|
extractAttributes(t) {
|
|
46
|
-
const e = t.querySelector(".ins-title"),
|
|
45
|
+
const e = t.querySelector(".ins-title"), i = t.className.split(" ").filter((r) => r.startsWith("es-")), s = t.getAttribute("align"), n = t.getAttribute("bgcolor"), c = t.getAttribute("style"), l = e?.getAttribute("style");
|
|
47
46
|
let u = 'class="coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block';
|
|
48
|
-
|
|
47
|
+
i.length && (u += ` ${i.join(" ")}`), u += '"';
|
|
49
48
|
let a = "";
|
|
50
|
-
if (s && (a += ` align="${s}"`),
|
|
49
|
+
if (s && (a += ` align="${s}"`), n && (a += ` bgcolor="${n}"`), c) {
|
|
51
50
|
const r = c.replace(/background-color[^;]+;?/gi, "").replace(/;+/g, ";").trim();
|
|
52
51
|
r && (a += ` style="${r.replace(/"/g, "'")}"`);
|
|
53
52
|
}
|
|
@@ -59,9 +58,9 @@ class y {
|
|
|
59
58
|
return { class: u, block: a, text: p };
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
|
-
function
|
|
63
|
-
return new
|
|
61
|
+
function $(o) {
|
|
62
|
+
return new h().migrate(o);
|
|
64
63
|
}
|
|
65
64
|
export {
|
|
66
|
-
|
|
65
|
+
$ as migrateCouponBlock
|
|
67
66
|
};
|