@useinsider/guido 3.2.0-beta.e69fb3b → 3.2.0-beta.ecc7c6c
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 +34 -27
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +81 -76
- 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/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.vue2.js +17 -14
- 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/useBlocksConfig.js +26 -26
- package/dist/composables/useFullStoryBridge.js +9 -8
- package/dist/composables/useHtmlCompiler.js +26 -34
- package/dist/composables/useHtmlValidator.js +114 -101
- package/dist/composables/useHttp.js +30 -30
- package/dist/composables/usePartner.js +1 -1
- package/dist/composables/useRecommendation.js +15 -14
- package/dist/composables/useRibbonOffset.js +15 -15
- package/dist/composables/useSave.js +23 -19
- 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 +3 -2
- 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 +27 -27
- package/dist/config/compiler/unsubscribeCompilerRules.js +19 -17
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +11 -10
- package/dist/config/migrator/checkboxMigrator.js +21 -20
- package/dist/config/migrator/couponBlockMigrator.js +19 -18
- package/dist/config/migrator/itemsBlockMigrator.js +89 -87
- package/dist/config/migrator/radioButtonMigrator.js +63 -42
- package/dist/config/migrator/recommendationMigrator.js +109 -106
- package/dist/config/migrator/unsubscribeMigrator.js +11 -10
- 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/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 +18 -17
- 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 +135 -134
- 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/settingsPanel.js +16 -8
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +64 -54
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +23 -22
- 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 +25 -24
- 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/validation/filterSchema.js +16 -13
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
- 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/_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/_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/_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/_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/_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/_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/_getAllKeys.js +9 -0
- package/dist/node_modules/lodash-es/_getMatchData.js +12 -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 +1 -1
- package/dist/node_modules/lodash-es/_hasPath.js +19 -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/_isPrototype.js +8 -0
- package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -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/_nativeKeys.js +5 -0
- package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
- package/dist/node_modules/lodash-es/_overArg.js +8 -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/_trimmedEndIndex.js +9 -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/isLength.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/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 +126 -122
- package/dist/services/recommendationApi.js +17 -14
- package/dist/services/templateLibraryApi.js +40 -38
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useHtmlCompiler.d.ts +2 -1
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -1
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/stores/config.js +81 -25
- package/dist/stores/dynamic-content.js +11 -6
- 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/pairProductVariables.js +89 -87
- package/package.json +1 -6
- package/dist/enums/displayConditions.js +0 -80
- package/dist/src/enums/displayConditions.d.ts +0 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ModificationDescription as p } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { RecommendationBlockId as m } from "../../constants/blockIds.js";
|
|
3
|
+
import { MOBILE_CONTAINER_SELECTOR as P, MOBILE_ROW_SELECTOR as k, CURRENCY_ATTR as y, DESKTOP_CONTAINER_SELECTOR as q, CONTAINER_SELECTOR as $ } from "../../constants/selectors.js";
|
|
2
4
|
import { RecommendationConfigService as E } from "../../services/configService.js";
|
|
3
5
|
import { useRecommendationExtensionStore as C } from "../../store/recommendation.js";
|
|
4
|
-
import { prepareProductRows as
|
|
5
|
-
import { formatPrice as
|
|
6
|
-
import { isTdNode as
|
|
7
|
-
import {
|
|
8
|
-
import { MOBILE_CONTAINER_SELECTOR as P, MOBILE_ROW_SELECTOR as T, CURRENCY_ATTR as y, DESKTOP_CONTAINER_SELECTOR as q, CONTAINER_SELECTOR as v } from "../../constants/selectors.js";
|
|
9
|
-
import { getDefaultProducts as L, DEFAULT_CARD_COMPOSITION as M, sanitizeImageUrl as j } from "../../templates/utils.js";
|
|
6
|
+
import { prepareProductRows as T } from "../../templates/index.js";
|
|
7
|
+
import { formatPrice as B } from "../../utils/priceFormatter.js";
|
|
8
|
+
import { isTdNode as v } from "../../utils/tagName.js";
|
|
9
|
+
import { getDefaultProducts as L, DEFAULT_CARD_COMPOSITION as R, sanitizeImageUrl as j } from "../../templates/utils.js";
|
|
10
10
|
const h = "recommendation-block-v2";
|
|
11
|
-
function
|
|
11
|
+
function M(t) {
|
|
12
12
|
if (!t)
|
|
13
13
|
return null;
|
|
14
14
|
if ("getAttribute" in t) {
|
|
@@ -18,36 +18,36 @@ function R(t) {
|
|
|
18
18
|
}
|
|
19
19
|
return "querySelector" in t ? t.querySelector(`.${h}`) ?? null : null;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const e =
|
|
21
|
+
function g(t) {
|
|
22
|
+
const e = M(t);
|
|
23
23
|
if (!e || !("getAttribute" in e))
|
|
24
24
|
return "grid";
|
|
25
25
|
const o = e.getAttribute("data-layout");
|
|
26
26
|
return o === "list" || o === "horizontal" ? "list" : "grid";
|
|
27
27
|
}
|
|
28
28
|
function _(t) {
|
|
29
|
-
const e =
|
|
29
|
+
const e = M(t);
|
|
30
30
|
if (!e || !("getAttribute" in e))
|
|
31
|
-
return
|
|
31
|
+
return R;
|
|
32
32
|
const o = e.getAttribute("data-card-composition");
|
|
33
|
-
return o ? o.split(",").filter(Boolean) :
|
|
33
|
+
return o ? o.split(",").filter(Boolean) : R;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function b(t, e, o) {
|
|
36
36
|
if (!e || !("childNodes" in e))
|
|
37
37
|
return !1;
|
|
38
|
-
const
|
|
39
|
-
(
|
|
38
|
+
const i = e.childNodes().find(
|
|
39
|
+
(l) => "getType" in l && l.getType() === "text"
|
|
40
40
|
);
|
|
41
|
-
return
|
|
41
|
+
return i ? (t.modifyHtml(i).setText(o), !0) : !1;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function x(t, e) {
|
|
44
44
|
return t && t.length > 0 ? t : e.length > 0 ? e : L();
|
|
45
45
|
}
|
|
46
46
|
function V(t) {
|
|
47
47
|
const { currentNode: e, documentModifier: o } = t;
|
|
48
48
|
if (!e || !("querySelector" in e))
|
|
49
49
|
return;
|
|
50
|
-
const n = e.querySelector(
|
|
50
|
+
const n = e.querySelector(k);
|
|
51
51
|
n && (o.modifyHtml(n).setInnerHtml(""), o.apply(new p("Cleared mobile row content")));
|
|
52
52
|
}
|
|
53
53
|
function W(t) {
|
|
@@ -55,23 +55,23 @@ function W(t) {
|
|
|
55
55
|
currentNode: e,
|
|
56
56
|
documentModifier: o,
|
|
57
57
|
products: n,
|
|
58
|
-
layout:
|
|
59
|
-
composition:
|
|
58
|
+
layout: i,
|
|
59
|
+
composition: l
|
|
60
60
|
} = t;
|
|
61
61
|
if (!e || !("querySelector" in e))
|
|
62
62
|
return;
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
63
|
+
const r = i ?? g(e), u = E.getConfig(e);
|
|
64
|
+
if (r === "list" || !u.mobileLayoutEnabled) {
|
|
65
65
|
V({ currentNode: e, documentModifier: o });
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
const s = e.querySelector(
|
|
68
|
+
const s = e.querySelector(k);
|
|
69
69
|
if (!s)
|
|
70
70
|
return;
|
|
71
|
-
const
|
|
71
|
+
const c = C(), a = x(n, c.recommendationProducts), f = l ?? _(e), S = `<td><table class="ins-recommendation-product-container ins-recommendation-mobile-container" width="100%" cellpadding="0" cellspacing="0" border="0">${T(a, r, {
|
|
72
72
|
productsPerRow: u.mobileCardsInRow,
|
|
73
73
|
composition: f,
|
|
74
|
-
filterList:
|
|
74
|
+
filterList: c.filterList
|
|
75
75
|
})}</table></td>`;
|
|
76
76
|
o.modifyHtml(s).setInnerHtml(S), o.apply(new p("Updated mobile product rows"));
|
|
77
77
|
}
|
|
@@ -80,63 +80,63 @@ function G(t) {
|
|
|
80
80
|
currentNode: e,
|
|
81
81
|
documentModifier: o,
|
|
82
82
|
afterRegenerate: n,
|
|
83
|
-
products:
|
|
84
|
-
layout:
|
|
85
|
-
composition:
|
|
83
|
+
products: i,
|
|
84
|
+
layout: l,
|
|
85
|
+
composition: r
|
|
86
86
|
} = t;
|
|
87
87
|
if (!e || !("querySelector" in e))
|
|
88
88
|
return;
|
|
89
|
-
const u = e.querySelector(q) ?? e.querySelector(
|
|
89
|
+
const u = e.querySelector(q) ?? e.querySelector($);
|
|
90
90
|
if (!u)
|
|
91
91
|
return;
|
|
92
|
-
const s = C(),
|
|
92
|
+
const s = C(), c = x(i, s.recommendationProducts), { cardsInRow: a } = s.recommendationConfigs, f = r ?? _(e), d = l ?? g(e), S = T(c, d, {
|
|
93
93
|
productsPerRow: a,
|
|
94
94
|
composition: f,
|
|
95
95
|
filterList: s.filterList
|
|
96
96
|
});
|
|
97
|
-
o.modifyHtml(u).setInnerHtml(S).apply(new p("Updated product")), W(t), n
|
|
97
|
+
o.modifyHtml(u).setInnerHtml(S).apply(new p("Updated product")), W(t), n == null || n();
|
|
98
98
|
}
|
|
99
99
|
function I(t, e, o, n) {
|
|
100
|
-
const
|
|
101
|
-
let
|
|
100
|
+
const l = `0 ${Math.floor(o / 2)}px`;
|
|
101
|
+
let r = !1;
|
|
102
102
|
return n === "grid" ? Array.from(
|
|
103
103
|
t.querySelectorAll(".attribute-cell")
|
|
104
104
|
).forEach((s) => {
|
|
105
|
-
e.modifyHtml(s).setStyle("padding",
|
|
105
|
+
e.modifyHtml(s).setStyle("padding", l), r = !0;
|
|
106
106
|
}) : Array.from(
|
|
107
107
|
t.querySelectorAll(".product-card-wrapper")
|
|
108
108
|
).forEach((s) => {
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
}),
|
|
109
|
+
const c = "parentNode" in s ? s.parentNode : null;
|
|
110
|
+
c && v(c) && (e.modifyHtml(c).setStyle("padding", l), r = !0);
|
|
111
|
+
}), r;
|
|
112
112
|
}
|
|
113
113
|
function O(t, e, o) {
|
|
114
|
-
const n = `${o}px`,
|
|
115
|
-
let
|
|
116
|
-
return
|
|
117
|
-
e.modifyHtml(
|
|
118
|
-
}),
|
|
114
|
+
const n = `${o}px`, i = Array.from(t.querySelectorAll(".spacer"));
|
|
115
|
+
let l = !1;
|
|
116
|
+
return i.forEach((r) => {
|
|
117
|
+
e.modifyHtml(r).setStyle("height", n), l = !0;
|
|
118
|
+
}), l;
|
|
119
119
|
}
|
|
120
120
|
function Y(t) {
|
|
121
121
|
const { currentNode: e, documentModifier: o } = t;
|
|
122
122
|
if (!e)
|
|
123
123
|
return;
|
|
124
|
-
const n = E.getConfig(e),
|
|
125
|
-
let
|
|
126
|
-
const
|
|
127
|
-
if (
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
const n = E.getConfig(e), i = g(e);
|
|
125
|
+
let l = !1;
|
|
126
|
+
const r = e.querySelector(q);
|
|
127
|
+
if (r) {
|
|
128
|
+
l = I(
|
|
129
|
+
r,
|
|
130
130
|
o,
|
|
131
131
|
n.columnSpacing,
|
|
132
|
-
|
|
132
|
+
i
|
|
133
133
|
);
|
|
134
|
-
const
|
|
135
|
-
|
|
134
|
+
const c = O(
|
|
135
|
+
r,
|
|
136
136
|
o,
|
|
137
137
|
n.rowSpacing
|
|
138
138
|
);
|
|
139
|
-
|
|
139
|
+
l = l || c;
|
|
140
140
|
}
|
|
141
141
|
const u = e.querySelector(P);
|
|
142
142
|
if (u) {
|
|
@@ -144,37 +144,37 @@ function Y(t) {
|
|
|
144
144
|
u,
|
|
145
145
|
o,
|
|
146
146
|
n.mobileColumnSpacing,
|
|
147
|
-
|
|
147
|
+
i
|
|
148
148
|
);
|
|
149
|
-
|
|
150
|
-
const
|
|
149
|
+
l = l || s;
|
|
150
|
+
const c = O(
|
|
151
151
|
u,
|
|
152
152
|
o,
|
|
153
153
|
n.mobileRowSpacing
|
|
154
154
|
);
|
|
155
|
-
|
|
155
|
+
l = l || c;
|
|
156
156
|
}
|
|
157
|
-
|
|
157
|
+
l && o.apply(new p("Reapply spacing after regeneration"));
|
|
158
158
|
}
|
|
159
159
|
function re(t) {
|
|
160
|
-
const { currentNode: e, documentModifier: o, afterRegenerate: n, products:
|
|
160
|
+
const { currentNode: e, documentModifier: o, afterRegenerate: n, products: i, layout: l, composition: r } = t;
|
|
161
161
|
e && G({
|
|
162
162
|
currentNode: e,
|
|
163
163
|
documentModifier: o,
|
|
164
|
-
products:
|
|
165
|
-
layout:
|
|
166
|
-
composition:
|
|
164
|
+
products: i,
|
|
165
|
+
layout: l,
|
|
166
|
+
composition: r,
|
|
167
167
|
afterRegenerate: () => {
|
|
168
168
|
setTimeout(() => {
|
|
169
169
|
Y({ currentNode: e, documentModifier: o });
|
|
170
|
-
}, 0), n
|
|
170
|
+
}, 0), n == null || n();
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
function ie(t, e) {
|
|
175
175
|
return t.length === e ? t : t.length > e ? t.slice(0, e) : [...t, ...L(e - t.length)];
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function D() {
|
|
178
178
|
const t = C(), { currencySettings: e } = t.recommendationConfigs, o = parseInt(e.decimalCount);
|
|
179
179
|
return {
|
|
180
180
|
code: e.value,
|
|
@@ -186,34 +186,35 @@ function x() {
|
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
188
|
function A(t, e = "price") {
|
|
189
|
-
const o =
|
|
190
|
-
return
|
|
191
|
-
price:
|
|
189
|
+
const o = D(), n = t[e], i = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
|
|
190
|
+
return B({
|
|
191
|
+
price: i,
|
|
192
192
|
currency: o
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
function F(t) {
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
var l, r;
|
|
197
|
+
const e = D(), o = ((l = t.original_price) == null ? void 0 : l[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, n = ((r = t.price) == null ? void 0 : r[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, i = o > 0 ? Math.round((o - n) / o * 100) : 0;
|
|
198
|
+
return i > 0 ? `-${i}%` : "0%";
|
|
198
199
|
}
|
|
199
200
|
function H(t) {
|
|
200
|
-
const { documentModifier: e, product: o, priceEl: n, oldPriceEl:
|
|
201
|
+
const { documentModifier: e, product: o, priceEl: n, oldPriceEl: i, omnibusPriceEl: l, omnibusDiscountEl: r } = t;
|
|
201
202
|
let u = !1;
|
|
202
203
|
if (n && "querySelector" in n) {
|
|
203
|
-
const s = n.querySelector("strong") ?? null,
|
|
204
|
-
|
|
204
|
+
const s = n.querySelector("strong") ?? null, c = A(o, "price");
|
|
205
|
+
b(e, s, c) && (u = !0);
|
|
205
206
|
}
|
|
206
|
-
if (
|
|
207
|
-
const s =
|
|
208
|
-
|
|
207
|
+
if (i && "querySelector" in i) {
|
|
208
|
+
const s = i.querySelector("strong") ?? null, c = A(o, "original_price");
|
|
209
|
+
b(e, s, c) && (u = !0);
|
|
209
210
|
}
|
|
210
|
-
if (
|
|
211
|
-
const s =
|
|
212
|
-
|
|
211
|
+
if (l && "querySelector" in l) {
|
|
212
|
+
const s = l.querySelector(".omnibus-price-value") ?? null, c = A(o, "original_price");
|
|
213
|
+
b(e, s, c) && (u = !0);
|
|
213
214
|
}
|
|
214
|
-
if (
|
|
215
|
-
const s =
|
|
216
|
-
|
|
215
|
+
if (r && "querySelector" in r) {
|
|
216
|
+
const s = r.querySelector(".omnibus-discount-value") ?? null, c = F(o);
|
|
217
|
+
b(e, s, c) && (u = !0);
|
|
217
218
|
}
|
|
218
219
|
return u;
|
|
219
220
|
}
|
|
@@ -222,12 +223,12 @@ function K(t) {
|
|
|
222
223
|
documentModifier: e,
|
|
223
224
|
product: o,
|
|
224
225
|
imageEl: n,
|
|
225
|
-
nameEl:
|
|
226
|
-
priceEl:
|
|
227
|
-
oldPriceEl:
|
|
226
|
+
nameEl: i,
|
|
227
|
+
priceEl: l,
|
|
228
|
+
oldPriceEl: r,
|
|
228
229
|
omnibusPriceEl: u,
|
|
229
230
|
omnibusDiscountEl: s,
|
|
230
|
-
buttonEl:
|
|
231
|
+
buttonEl: c
|
|
231
232
|
} = t;
|
|
232
233
|
let a = !1;
|
|
233
234
|
if (n && "querySelector" in n) {
|
|
@@ -236,19 +237,19 @@ function K(t) {
|
|
|
236
237
|
const d = n.querySelector("a");
|
|
237
238
|
d && (e.modifyHtml(d).setAttribute("href", o.url), a = !0);
|
|
238
239
|
}
|
|
239
|
-
if (
|
|
240
|
-
const f =
|
|
241
|
-
|
|
240
|
+
if (i && "querySelector" in i) {
|
|
241
|
+
const f = i.querySelector("strong") ?? null;
|
|
242
|
+
b(e, f, o.name) && (a = !0);
|
|
242
243
|
}
|
|
243
244
|
if (H({
|
|
244
245
|
documentModifier: e,
|
|
245
246
|
product: o,
|
|
246
|
-
priceEl:
|
|
247
|
-
oldPriceEl:
|
|
247
|
+
priceEl: l,
|
|
248
|
+
oldPriceEl: r,
|
|
248
249
|
omnibusPriceEl: u,
|
|
249
250
|
omnibusDiscountEl: s
|
|
250
|
-
}) && (a = !0),
|
|
251
|
-
const f =
|
|
251
|
+
}) && (a = !0), c && "querySelector" in c) {
|
|
252
|
+
const f = c.querySelector("a.es-button") || c.querySelector("a");
|
|
252
253
|
f && (e.modifyHtml(f).setAttribute("href", o.url), a = !0);
|
|
253
254
|
}
|
|
254
255
|
return a;
|
|
@@ -261,17 +262,17 @@ function w(t, e, o) {
|
|
|
261
262
|
return !1;
|
|
262
263
|
const n = t.querySelectorAll(
|
|
263
264
|
`[esd-extension-block-id="${m.IMAGE}"]`
|
|
264
|
-
),
|
|
265
|
+
), i = t.querySelectorAll(
|
|
265
266
|
`[esd-extension-block-id="${m.NAME}"]`
|
|
266
|
-
),
|
|
267
|
+
), l = t.querySelectorAll(
|
|
267
268
|
`[esd-extension-block-id="${m.PRICE}"]`
|
|
268
|
-
),
|
|
269
|
+
), r = t.querySelectorAll(
|
|
269
270
|
`[esd-extension-block-id="${m.OLD_PRICE}"]`
|
|
270
271
|
), u = t.querySelectorAll(
|
|
271
272
|
`[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
|
|
272
273
|
), s = t.querySelectorAll(
|
|
273
274
|
`[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
|
|
274
|
-
),
|
|
275
|
+
), c = t.querySelectorAll(
|
|
275
276
|
`[esd-extension-block-id="${m.BUTTON}"]`
|
|
276
277
|
), a = Math.min(n.length, o.length);
|
|
277
278
|
let f = !1;
|
|
@@ -280,12 +281,12 @@ function w(t, e, o) {
|
|
|
280
281
|
documentModifier: e,
|
|
281
282
|
product: o[d],
|
|
282
283
|
imageEl: n[d] ?? null,
|
|
283
|
-
nameEl:
|
|
284
|
-
priceEl:
|
|
285
|
-
oldPriceEl:
|
|
284
|
+
nameEl: i[d] ?? null,
|
|
285
|
+
priceEl: l[d] ?? null,
|
|
286
|
+
oldPriceEl: r[d] ?? null,
|
|
286
287
|
omnibusPriceEl: u[d] ?? null,
|
|
287
288
|
omnibusDiscountEl: s[d] ?? null,
|
|
288
|
-
buttonEl:
|
|
289
|
+
buttonEl: c[d] ?? null
|
|
289
290
|
});
|
|
290
291
|
f = f || S;
|
|
291
292
|
}
|
|
@@ -295,47 +296,47 @@ function le(t) {
|
|
|
295
296
|
const { currentNode: e, documentModifier: o, products: n } = t;
|
|
296
297
|
if (!e || !("querySelectorAll" in e))
|
|
297
298
|
return !1;
|
|
298
|
-
const
|
|
299
|
-
if (!("querySelectorAll" in
|
|
299
|
+
const i = U(e);
|
|
300
|
+
if (!("querySelectorAll" in i) || i.querySelectorAll(
|
|
300
301
|
`[esd-extension-block-id="${m.IMAGE}"]`
|
|
301
302
|
).length !== n.length)
|
|
302
303
|
return !1;
|
|
303
|
-
let
|
|
304
|
-
const u =
|
|
304
|
+
let r = w(i, o, n);
|
|
305
|
+
const u = g(e), s = E.getConfig(e);
|
|
305
306
|
if (u !== "list" && s.mobileLayoutEnabled && "querySelector" in e) {
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
307
|
+
const c = e.querySelector(P);
|
|
308
|
+
if (c) {
|
|
308
309
|
const a = w(
|
|
309
|
-
|
|
310
|
+
c,
|
|
310
311
|
o,
|
|
311
312
|
n
|
|
312
313
|
);
|
|
313
|
-
|
|
314
|
+
r = r || a;
|
|
314
315
|
}
|
|
315
316
|
}
|
|
316
|
-
return
|
|
317
|
+
return r && o.apply(new p("Updated product content in-place")), !0;
|
|
317
318
|
}
|
|
318
319
|
function N(t, e, o) {
|
|
319
320
|
if (!("querySelectorAll" in t))
|
|
320
321
|
return !1;
|
|
321
322
|
const n = t.querySelectorAll(
|
|
322
323
|
`[esd-extension-block-id="${m.PRICE}"]`
|
|
323
|
-
),
|
|
324
|
+
), i = t.querySelectorAll(
|
|
324
325
|
`[esd-extension-block-id="${m.OLD_PRICE}"]`
|
|
325
|
-
),
|
|
326
|
+
), l = t.querySelectorAll(
|
|
326
327
|
`[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
|
|
327
|
-
),
|
|
328
|
+
), r = t.querySelectorAll(
|
|
328
329
|
`[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
|
|
329
330
|
), u = Math.min(n.length, o.length);
|
|
330
331
|
let s = !1;
|
|
331
|
-
for (let
|
|
332
|
+
for (let c = 0; c < u; c++)
|
|
332
333
|
H({
|
|
333
334
|
documentModifier: e,
|
|
334
|
-
product: o[
|
|
335
|
-
priceEl: n[
|
|
336
|
-
oldPriceEl:
|
|
337
|
-
omnibusPriceEl: c
|
|
338
|
-
omnibusDiscountEl:
|
|
335
|
+
product: o[c],
|
|
336
|
+
priceEl: n[c] ?? null,
|
|
337
|
+
oldPriceEl: i[c] ?? null,
|
|
338
|
+
omnibusPriceEl: l[c] ?? null,
|
|
339
|
+
omnibusDiscountEl: r[c] ?? null
|
|
339
340
|
}) && (s = !0);
|
|
340
341
|
return s;
|
|
341
342
|
}
|
|
@@ -343,36 +344,36 @@ function ce(t) {
|
|
|
343
344
|
const { currentNode: e, documentModifier: o } = t;
|
|
344
345
|
if (!e || !("querySelectorAll" in e))
|
|
345
346
|
return !1;
|
|
346
|
-
const
|
|
347
|
-
if (
|
|
347
|
+
const i = C().recommendationProducts;
|
|
348
|
+
if (i.length === 0)
|
|
348
349
|
return !1;
|
|
349
|
-
const
|
|
350
|
-
let
|
|
351
|
-
const u =
|
|
350
|
+
const l = U(e);
|
|
351
|
+
let r = N(l, o, i);
|
|
352
|
+
const u = g(e), s = E.getConfig(e);
|
|
352
353
|
if (u !== "list" && s.mobileLayoutEnabled && "querySelector" in e) {
|
|
353
|
-
const
|
|
354
|
-
if (
|
|
355
|
-
const a = N(
|
|
356
|
-
|
|
354
|
+
const c = e.querySelector(P);
|
|
355
|
+
if (c) {
|
|
356
|
+
const a = N(c, o, i);
|
|
357
|
+
r = r || a;
|
|
357
358
|
}
|
|
358
359
|
}
|
|
359
|
-
return
|
|
360
|
+
return r && o.apply(new p("Updated price formatting in-place")), r;
|
|
360
361
|
}
|
|
361
362
|
function se(t) {
|
|
362
|
-
const { currentNode: e, documentModifier: o, currency: n } = t,
|
|
363
|
-
if (!
|
|
363
|
+
const { currentNode: e, documentModifier: o, currency: n } = t, i = M(e);
|
|
364
|
+
if (!i)
|
|
364
365
|
return;
|
|
365
|
-
const
|
|
366
|
-
o.modifyHtml(
|
|
366
|
+
const l = n.alignment === "before" ? "0" : "1", r = (u, s) => {
|
|
367
|
+
o.modifyHtml(i).setAttribute(u, s);
|
|
367
368
|
};
|
|
368
|
-
|
|
369
|
+
r(y.CURRENCY, n.code), r(y.SYMBOL, n.symbol), r(y.ALIGNMENT, l), r(y.THOUSAND_SEPARATOR, n.thousandSeparator), r(y.DECIMAL_SEPARATOR, n.decimalSeparator), r(y.DECIMAL_COUNT, n.decimalCount.toString()), o.apply(new p("Update currency attributes"));
|
|
369
370
|
}
|
|
370
371
|
export {
|
|
371
372
|
ie as adjustProductsToSize,
|
|
372
373
|
A as formatProductPrice,
|
|
373
|
-
|
|
374
|
+
M as getBlockElement,
|
|
374
375
|
_ as getCardComposition,
|
|
375
|
-
|
|
376
|
+
g as getCurrentLayout,
|
|
376
377
|
Y as reapplySpacing,
|
|
377
378
|
W as regenerateMobileProductRows,
|
|
378
379
|
G as regenerateProductRows,
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { createPaddingsControl as n, createTextBackgroundColorControl as e, createTextFontFamilyControl as l, createTextStyleControl as C, createTextSizeControl as c, createTextColorControl as a, createTextAlignControl as i } from "../../../controlFactories.js";
|
|
2
|
+
import { RecommendationBlockId as o } from "../../constants/blockIds.js";
|
|
3
|
+
import { RecommendationControlId as t } from "../../constants/controlIds.js";
|
|
4
|
+
import { BLOCK_ROOT_SELECTOR as r } from "../../constants/selectors.js";
|
|
2
5
|
import { NameTextTrimControl as m } from "./textTrim.js";
|
|
3
|
-
import { BLOCK_ROOT_SELECTOR as o } from "../../constants/selectors.js";
|
|
4
|
-
import { RecommendationBlockId as t } from "../../constants/blockIds.js";
|
|
5
|
-
import { RecommendationControlId as r } from "../../constants/controlIds.js";
|
|
6
6
|
const A = i(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
t.NAME_ALIGN,
|
|
8
|
+
o.NAME,
|
|
9
|
+
r
|
|
10
10
|
), N = a(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
t.NAME_COLOR,
|
|
12
|
+
o.NAME,
|
|
13
|
+
r
|
|
14
14
|
), E = c(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
t.NAME_SIZE,
|
|
16
|
+
o.NAME,
|
|
17
|
+
r
|
|
18
18
|
), M = C(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
t.NAME_STYLE,
|
|
20
|
+
o.NAME,
|
|
21
|
+
r
|
|
22
22
|
), s = l(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
t.NAME_FONT_FAMILY,
|
|
24
|
+
o.NAME,
|
|
25
|
+
r
|
|
26
26
|
), d = e(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
t.NAME_BACKGROUND,
|
|
28
|
+
o.NAME,
|
|
29
|
+
r
|
|
30
30
|
), T = n(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
t.NAME_PADDINGS,
|
|
32
|
+
o.NAME,
|
|
33
|
+
r
|
|
34
34
|
), p = {
|
|
35
35
|
align: A,
|
|
36
36
|
color: N,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ModificationDescription as l } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { CommonControl as u } from "../../../common-control.js";
|
|
3
|
-
import {
|
|
4
|
-
import { RecommendationControlId as
|
|
5
|
-
import { BLOCK_ROOT_SELECTOR as
|
|
6
|
-
import {
|
|
3
|
+
import { RecommendationBlockId as a } from "../../constants/blockIds.js";
|
|
4
|
+
import { RecommendationControlId as d } from "../../constants/controlIds.js";
|
|
5
|
+
import { BLOCK_ROOT_SELECTOR as m } from "../../constants/selectors.js";
|
|
6
|
+
import { CSS_CLASS_TEXT_TRIM as r, ensureTextTrimCssRulesExist as T } from "../shared/textTrimCssRules.js";
|
|
7
7
|
const s = {
|
|
8
8
|
TEXT_TRIM_ENABLED: "textTrimEnabled"
|
|
9
9
|
};
|
|
10
10
|
class N extends u {
|
|
11
11
|
getId() {
|
|
12
|
-
return
|
|
12
|
+
return d.NAME_TEXT_TRIM;
|
|
13
13
|
}
|
|
14
14
|
getTemplate() {
|
|
15
15
|
return `
|
|
@@ -39,26 +39,26 @@ class N extends u {
|
|
|
39
39
|
return !1;
|
|
40
40
|
if (this.currentNode.hasClass(r))
|
|
41
41
|
return !0;
|
|
42
|
-
const e = this.currentNode.closest(
|
|
42
|
+
const e = this.currentNode.closest(m);
|
|
43
43
|
if (!e)
|
|
44
44
|
return !1;
|
|
45
45
|
const t = e.querySelector(
|
|
46
|
-
`[esd-extension-block-id="${
|
|
46
|
+
`[esd-extension-block-id="${a.NAME}"]`
|
|
47
47
|
);
|
|
48
48
|
return t && "hasClass" in t ? t.hasClass(r) : !1;
|
|
49
49
|
}
|
|
50
50
|
_onTextTrimChange(e) {
|
|
51
51
|
if (!this.currentNode || !("closest" in this.currentNode))
|
|
52
52
|
return;
|
|
53
|
-
const t = this.currentNode.closest(
|
|
53
|
+
const t = this.currentNode.closest(m);
|
|
54
54
|
if (!t || !("querySelectorAll" in t))
|
|
55
55
|
return;
|
|
56
56
|
const i = Array.from(
|
|
57
|
-
t.querySelectorAll(`[esd-extension-block-id="${
|
|
57
|
+
t.querySelectorAll(`[esd-extension-block-id="${a.NAME}"]`)
|
|
58
58
|
);
|
|
59
59
|
if (!i.length)
|
|
60
60
|
return;
|
|
61
|
-
e &&
|
|
61
|
+
e && T(this.api);
|
|
62
62
|
const o = this.api.getDocumentModifier();
|
|
63
63
|
i.forEach((n) => {
|
|
64
64
|
e ? o.modifyHtml(n).setClass(r) : o.modifyHtml(n).removeClass(r);
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { createPaddingsControl as r, createTextBackgroundColorControl as C, createTextFontFamilyControl as e, createTextStyleControl as l, createTextSizeControl as _, createTextColorControl as c, createTextAlignControl as O } from "../../../controlFactories.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { RecommendationBlockId as o } from "../../constants/blockIds.js";
|
|
3
|
+
import { RecommendationControlId as t } from "../../constants/controlIds.js";
|
|
4
|
+
import { BLOCK_ROOT_SELECTOR as n } from "../../constants/selectors.js";
|
|
5
5
|
const I = O(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
t.OLD_PRICE_ALIGN,
|
|
7
|
+
o.OLD_PRICE,
|
|
8
|
+
n
|
|
9
9
|
), L = c(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
t.OLD_PRICE_COLOR,
|
|
11
|
+
o.OLD_PRICE,
|
|
12
|
+
n
|
|
13
13
|
), R = _(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
t.OLD_PRICE_SIZE,
|
|
15
|
+
o.OLD_PRICE,
|
|
16
|
+
n
|
|
17
17
|
), a = l(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
t.OLD_PRICE_STYLE,
|
|
19
|
+
o.OLD_PRICE,
|
|
20
|
+
n
|
|
21
21
|
), i = e(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
t.OLD_PRICE_FONT_FAMILY,
|
|
23
|
+
o.OLD_PRICE,
|
|
24
|
+
n
|
|
25
25
|
), E = C(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
t.OLD_PRICE_BACKGROUND,
|
|
27
|
+
o.OLD_PRICE,
|
|
28
|
+
n
|
|
29
29
|
), P = r(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
t.OLD_PRICE_PADDINGS,
|
|
31
|
+
o.OLD_PRICE,
|
|
32
|
+
n
|
|
33
33
|
), T = {
|
|
34
34
|
align: I,
|
|
35
35
|
color: L,
|