@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,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { BLOCK_ID as
|
|
5
|
-
import { productPairs as
|
|
6
|
-
import { ItemInCartOptions as
|
|
7
|
-
import { getDefaultTemplate as
|
|
8
|
-
import { useTemplateStore as
|
|
9
|
-
const
|
|
1
|
+
var M = Object.defineProperty;
|
|
2
|
+
var R = (r, t, o) => t in r ? M(r, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[t] = o;
|
|
3
|
+
var T = (r, t, o) => R(r, typeof t != "symbol" ? t + "" : t, o);
|
|
4
|
+
import { BLOCK_ID as h } from "../../extensions/Blocks/Items/block.js";
|
|
5
|
+
import { productPairs as k } from "../../extensions/Blocks/Items/enums/productEnums.js";
|
|
6
|
+
import { ItemInCartOptions as I, DefaultConfigValues as y, SETTINGS_ENUMS as s } from "../../extensions/Blocks/Items/enums/settingsEnums.js";
|
|
7
|
+
import { getDefaultTemplate as L } from "../../extensions/Blocks/Items/template.js";
|
|
8
|
+
import { useTemplateStore as B } from "../../stores/template.js";
|
|
9
|
+
const v = {
|
|
10
10
|
img: {
|
|
11
11
|
pairsKey: "imageSrc",
|
|
12
12
|
defaultKey: "DEFAULT",
|
|
@@ -73,10 +73,10 @@ const q = {
|
|
|
73
73
|
isArray: !1
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
function
|
|
76
|
+
function U() {
|
|
77
77
|
return String(Date.now() + Math.floor(Math.random() * 1e3));
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function K(r) {
|
|
80
80
|
return r ? {
|
|
81
81
|
CartItems: s.ITEMS_TYPE.CART_ITEMS,
|
|
82
82
|
BrowsedItems: s.ITEMS_TYPE.BROWSED_ITEMS,
|
|
@@ -86,20 +86,19 @@ function $(r) {
|
|
|
86
86
|
PURCHASED_ITEMS: s.ITEMS_TYPE.PURCHASED_ITEMS
|
|
87
87
|
}[r] || s.ITEMS_TYPE.CART_ITEMS : s.ITEMS_TYPE.CART_ITEMS;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
_ && _[c] && (i = _[c].value);
|
|
89
|
+
function A(r) {
|
|
90
|
+
const t = (e, l) => e == null ? l : e === "1" || e === "true", o = (e, l) => e || l, i = r["data-type"] || r["data-source"], a = K(i), c = I[a];
|
|
91
|
+
let n = r["data-cart_items_select_control_value"] || c?.[0]?.value || y.cartItemsSelectControlValue;
|
|
92
|
+
if (n && !n.includes("{{") && /^\d+$/.test(n)) {
|
|
93
|
+
const e = parseInt(n) - 1, l = I[a];
|
|
94
|
+
l && l[e] && (n = l[e].value);
|
|
96
95
|
}
|
|
97
96
|
return {
|
|
98
97
|
initialized: !0,
|
|
99
|
-
blockInstanceId: o(r["data-block-instance-id"],
|
|
98
|
+
blockInstanceId: o(r["data-block-instance-id"], U()),
|
|
100
99
|
source: a,
|
|
101
100
|
type: a,
|
|
102
|
-
itemsSelectValue:
|
|
101
|
+
itemsSelectValue: n,
|
|
103
102
|
orientation: r["data-card_orientation_control_value"] || s.ORIENTATION.VERTICAL,
|
|
104
103
|
nameTrimming: t(r["data-product_name_control_trim"], !0),
|
|
105
104
|
priceHideDiscount: t(r["data-product_price_control_nodup"], !0),
|
|
@@ -107,16 +106,16 @@ function R(r) {
|
|
|
107
106
|
priceSinglePrice: t(r["data-product_price_control_single_price"], !1),
|
|
108
107
|
priceCurrencySymbol: o(
|
|
109
108
|
r["data-product_price_control_currency_symbol"],
|
|
110
|
-
|
|
109
|
+
y.productPriceCurrencySymbolControlValue
|
|
111
110
|
),
|
|
112
111
|
priceCurrencyLocation: o(
|
|
113
112
|
r["data-product_price_currency_location"],
|
|
114
|
-
|
|
113
|
+
y.productPriceCurrencyLocationControlValue
|
|
115
114
|
),
|
|
116
115
|
priceOrientation: r["data-product_original_price_control_orientation"] || "horizontal",
|
|
117
116
|
quantityControlEnabled: t(r["data-product_quantity_control_enabled"], !0),
|
|
118
|
-
buttonLink: o(r["data-product_button_link"],
|
|
119
|
-
imageLink: o(r["data-product_image_link"],
|
|
117
|
+
buttonLink: o(r["data-product_button_link"], y.productButtonLinkControlValue),
|
|
118
|
+
imageLink: o(r["data-product_image_link"], y.productImageLinkControlValue),
|
|
120
119
|
buttonLabel: o(r["data-product_button_control_label"], "Buy"),
|
|
121
120
|
buttonFullWidth: t(r["data-product_button_control_atw"], !0),
|
|
122
121
|
imageVisible: t(r["data-product_image_control_enabled"], !0),
|
|
@@ -127,12 +126,12 @@ function R(r) {
|
|
|
127
126
|
buttonVisible: t(r["data-product_button_control_enabled"], !0)
|
|
128
127
|
};
|
|
129
128
|
}
|
|
130
|
-
const
|
|
129
|
+
const q = {
|
|
131
130
|
ins_apr: "CART_ITEMS",
|
|
132
131
|
browsed_item: "BROWSED_ITEMS",
|
|
133
132
|
purchased_item: "PURCHASED_ITEMS"
|
|
134
133
|
};
|
|
135
|
-
function
|
|
134
|
+
function w(r, t) {
|
|
136
135
|
const o = {
|
|
137
136
|
CART_ITEMS: `{{Abandoned Cart Item (${t}) Image}}`,
|
|
138
137
|
BROWSED_ITEMS: `{{Browsed Item (${t}) Image}}`,
|
|
@@ -140,7 +139,7 @@ function V(r, t) {
|
|
|
140
139
|
};
|
|
141
140
|
return o[r] || o.CART_ITEMS;
|
|
142
141
|
}
|
|
143
|
-
function
|
|
142
|
+
function O(r, t) {
|
|
144
143
|
const o = {
|
|
145
144
|
CART_ITEMS: `{{Abandoned Cart Item (${t}) Url}}`,
|
|
146
145
|
BROWSED_ITEMS: `{{Browsed Item (${t}) Url}}`,
|
|
@@ -148,22 +147,22 @@ function N(r, t) {
|
|
|
148
147
|
};
|
|
149
148
|
return o[r] || o.CART_ITEMS;
|
|
150
149
|
}
|
|
151
|
-
class
|
|
150
|
+
class F {
|
|
152
151
|
constructor() {
|
|
153
|
-
|
|
152
|
+
T(this, "parser");
|
|
154
153
|
this.parser = new DOMParser();
|
|
155
154
|
}
|
|
156
155
|
migrate(t) {
|
|
157
156
|
try {
|
|
158
157
|
let o = this.removeJinjaConditionals(t);
|
|
159
158
|
o = this.replaceTemplateVariables(o);
|
|
160
|
-
const
|
|
159
|
+
const i = this.parser.parseFromString(o, "text/html"), a = i.querySelectorAll(
|
|
161
160
|
"td.esd-cart-items-block, td.esd-browsed-items-block, td.esd-purchased-items-block"
|
|
162
161
|
);
|
|
163
|
-
return
|
|
164
|
-
|
|
165
|
-
}), a.length === 0 ? (console.warn("ItemsBlockMigrator: No blocks found with items block selectors"), o) : (a.forEach((
|
|
166
|
-
const e = this.extractConfiguration(
|
|
162
|
+
return B().$patch((n) => {
|
|
163
|
+
n.migrations = { ...n.migrations, [h]: a.length };
|
|
164
|
+
}), a.length === 0 ? (console.warn("ItemsBlockMigrator: No blocks found with items block selectors"), o) : (a.forEach((n) => {
|
|
165
|
+
const e = this.extractConfiguration(n), l = L({
|
|
167
166
|
orientation: e.orientation,
|
|
168
167
|
itemsType: e.itemsType,
|
|
169
168
|
itemId: e.itemId,
|
|
@@ -177,18 +176,18 @@ class z {
|
|
|
177
176
|
priceStyles: e.priceStyles,
|
|
178
177
|
originalPriceStyles: e.originalPriceStyles,
|
|
179
178
|
quantityStyles: e.quantityStyles,
|
|
180
|
-
nodeConfig:
|
|
179
|
+
nodeConfig: A(e.configBlockAttributes)
|
|
181
180
|
}), d = this.parser.parseFromString(
|
|
182
|
-
`<table><tbody><tr>${
|
|
181
|
+
`<table><tbody><tr>${l}</tr></tbody></table>`,
|
|
183
182
|
"text/html"
|
|
184
183
|
).querySelector("td");
|
|
185
|
-
if (d &&
|
|
186
|
-
const p =
|
|
184
|
+
if (d && n.parentNode) {
|
|
185
|
+
const p = A(e.configBlockAttributes);
|
|
187
186
|
d.setAttribute("esd-ext-config", JSON.stringify(p));
|
|
188
187
|
const u = d.querySelector("esd-config-block");
|
|
189
|
-
u && u.remove(),
|
|
188
|
+
u && u.remove(), n.parentNode.replaceChild(d, n);
|
|
190
189
|
}
|
|
191
|
-
}),
|
|
190
|
+
}), i.documentElement.outerHTML);
|
|
192
191
|
} catch (o) {
|
|
193
192
|
return console.error("ItemsBlockMigrator failed:", o), t;
|
|
194
193
|
}
|
|
@@ -200,24 +199,23 @@ class z {
|
|
|
200
199
|
* - UI styles from product elements (name, price, button, quantity, etc.)
|
|
201
200
|
*/
|
|
202
201
|
extractConfiguration(t) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
const y = t.querySelector('a[product-attr="name"]'), I = (y == null ? void 0 : y.getAttribute("style")) || void 0, f = t.querySelector('a[product-attr="button"]'), m = (f == null ? void 0 : f.getAttribute("style")) || void 0, h = (e == null ? void 0 : e.getAttribute("style")) || void 0, A = t.querySelector("p.original-price"), k = (A == null ? void 0 : A.getAttribute("style")) || void 0, E = t.querySelector('[product-attr="quantity"]'), L = (E == null ? void 0 : E.getAttribute("style")) || void 0;
|
|
202
|
+
const o = t.querySelector("[data-type]")?.getAttribute("data-type") || "CART_ITEMS", i = t.querySelector("[data-number]")?.getAttribute("data-number") || "1", a = parseInt(i) - 1, c = I[o], n = c?.[a]?.value || c[0].value, e = t.querySelector('[product-attr="price"]'), l = e?.getAttribute("data-currency_symbol") || "USD", d = (e?.getAttribute("data-curency") || "before") === "after" ? "1" : "0", p = e?.getAttribute("data-formated") !== "false", u = this.extractConfigBlockAttributes(t, o, i), f = u["data-card_orientation_control_value"];
|
|
203
|
+
let g;
|
|
204
|
+
f ? g = f === "horizontal" ? "horizontal" : "vertical" : g = t.querySelector('[colspan="2"]') !== null ? "vertical" : "horizontal";
|
|
205
|
+
const E = t.querySelector('a[product-attr="name"]')?.getAttribute("style") || void 0, m = t.querySelector('a[product-attr="button"]')?.getAttribute("style") || void 0, C = e?.getAttribute("style") || void 0, D = t.querySelector("p.original-price")?.getAttribute("style") || void 0, P = t.querySelector('[product-attr="quantity"]')?.getAttribute("style") || void 0;
|
|
208
206
|
return {
|
|
209
|
-
orientation:
|
|
207
|
+
orientation: g,
|
|
210
208
|
itemsType: o,
|
|
211
|
-
itemId:
|
|
212
|
-
currencySymbol:
|
|
209
|
+
itemId: n,
|
|
210
|
+
currencySymbol: l,
|
|
213
211
|
currencyLocation: d,
|
|
214
212
|
formattedPrice: p,
|
|
215
213
|
configBlockAttributes: u,
|
|
216
|
-
nameStyles:
|
|
214
|
+
nameStyles: E,
|
|
217
215
|
buttonStyles: m,
|
|
218
|
-
priceStyles:
|
|
219
|
-
originalPriceStyles:
|
|
220
|
-
quantityStyles:
|
|
216
|
+
priceStyles: C,
|
|
217
|
+
originalPriceStyles: D,
|
|
218
|
+
quantityStyles: P
|
|
221
219
|
};
|
|
222
220
|
}
|
|
223
221
|
/**
|
|
@@ -227,27 +225,27 @@ class z {
|
|
|
227
225
|
* @param itemsType - The type of items (CART_ITEMS, BROWSED_ITEMS, PURCHASED_ITEMS)
|
|
228
226
|
* @param itemNumber - The item number (1-based index)
|
|
229
227
|
*/
|
|
230
|
-
extractConfigBlockAttributes(t, o,
|
|
231
|
-
const a = t.querySelector("esd-config-block"),
|
|
228
|
+
extractConfigBlockAttributes(t, o, i) {
|
|
229
|
+
const a = t.querySelector("esd-config-block"), c = {};
|
|
232
230
|
if (!a)
|
|
233
231
|
return this.getDefaultConfigBlockAttributes();
|
|
234
232
|
if (Array.from(a.attributes).forEach((e) => {
|
|
235
|
-
e.name.startsWith("data-") && (
|
|
236
|
-
}),
|
|
237
|
-
const e =
|
|
233
|
+
e.name.startsWith("data-") && (c[e.name] = e.value);
|
|
234
|
+
}), c["data-cart_items_select_control_value"]) {
|
|
235
|
+
const e = c["data-cart_items_select_control_value"];
|
|
238
236
|
if (/^\d+$/.test(e)) {
|
|
239
|
-
const
|
|
240
|
-
_ && _[
|
|
237
|
+
const l = parseInt(e) - 1, _ = I[o];
|
|
238
|
+
_ && _[l] && (c["data-cart_items_select_control_value"] = _[l].value);
|
|
241
239
|
}
|
|
242
240
|
}
|
|
243
|
-
if (
|
|
244
|
-
const e =
|
|
245
|
-
let
|
|
246
|
-
e === "before" ?
|
|
241
|
+
if (c["data-product_price_control_curency"]) {
|
|
242
|
+
const e = c["data-product_price_control_curency"];
|
|
243
|
+
let l = e;
|
|
244
|
+
e === "before" ? l = "0" : e === "after" && (l = "1"), c["data-product_price_control_curency"] = l, c["data-product_price_currency_location"] = l;
|
|
247
245
|
}
|
|
248
|
-
(!
|
|
249
|
-
const
|
|
250
|
-
return
|
|
246
|
+
(!c["data-product_price_control_currency_symbol"] || c["data-product_price_control_currency_symbol"].trim() === "") && (c["data-product_price_control_currency_symbol"] = "USD");
|
|
247
|
+
const n = { ...this.getDefaultConfigBlockAttributes(), ...c };
|
|
248
|
+
return n["data-type"] = o, n["data-source"] = o, n["data-product_image_link"] = w(o, i), n["data-product_button_link"] = O(o, i), n;
|
|
251
249
|
}
|
|
252
250
|
/**
|
|
253
251
|
* Returns default esd-config-block attributes based on the old template structure
|
|
@@ -307,15 +305,15 @@ class z {
|
|
|
307
305
|
* contains display condition Jinja scripts that should NOT be removed.
|
|
308
306
|
*/
|
|
309
307
|
removeJinjaConditionals(t) {
|
|
310
|
-
const o = "__ESD_DISPLAY_CONDITIONS_PLACEHOLDER__",
|
|
311
|
-
let a =
|
|
308
|
+
const o = "__ESD_DISPLAY_CONDITIONS_PLACEHOLDER__", i = t.match(/esd-custom-display-conditions="[^"]*"/);
|
|
309
|
+
let a = i ? t.replace(i[0], o) : t;
|
|
312
310
|
return a = a.replace(
|
|
313
311
|
/\{%\s*if\s+(ins_apr|browsed_item|purchased_item)_total_product_kind\s*(>|>)\s*\d+\s*%\}/g,
|
|
314
312
|
""
|
|
315
313
|
), a = a.replace(
|
|
316
314
|
/\{%\s*if\s+(ins_apr|browsed_item|purchased_item)_price_\d+\s*(!=|!=)\s*\1_originalprice_\d+\s*%\}/g,
|
|
317
315
|
""
|
|
318
|
-
), a = a.replace(/\{%\s*endif\s*%\}/g, ""),
|
|
316
|
+
), a = a.replace(/\{%\s*endif\s*%\}/g, ""), i && (a = a.replace(o, i[0])), a = a.replace(/\n\s*\n\s*\n/g, `
|
|
319
317
|
|
|
320
318
|
`), a;
|
|
321
319
|
}
|
|
@@ -329,32 +327,32 @@ class z {
|
|
|
329
327
|
* - {{purchased_item_formattedprice_5}} → '1,490.49' (PURCHASED_ITEMS)
|
|
330
328
|
*/
|
|
331
329
|
replaceTemplateVariables(t) {
|
|
332
|
-
const { PAIRS_FOR_EXTENSION: o } =
|
|
333
|
-
return t.replace(/{{([^}]+)}}/g, (
|
|
334
|
-
const
|
|
335
|
-
if (!
|
|
336
|
-
return
|
|
337
|
-
const [,
|
|
330
|
+
const { PAIRS_FOR_EXTENSION: o } = k;
|
|
331
|
+
return t.replace(/{{([^}]+)}}/g, (i, a) => {
|
|
332
|
+
const c = a.match(/^(ins_apr|browsed_item|purchased_item)_([a-z_]+)_(\d+)$/);
|
|
333
|
+
if (!c)
|
|
334
|
+
return i;
|
|
335
|
+
const [, n, e, l] = c, _ = q[n];
|
|
338
336
|
if (!_)
|
|
339
|
-
return console.warn(`Unknown variable prefix: ${
|
|
340
|
-
const d =
|
|
337
|
+
return console.warn(`Unknown variable prefix: ${n}`), i;
|
|
338
|
+
const d = v[e];
|
|
341
339
|
if (!d)
|
|
342
|
-
return console.warn(`Unknown variable suffix mapping for: ${e}`),
|
|
343
|
-
const { pairsKey: p, defaultKey: u, isArray:
|
|
344
|
-
if (!
|
|
345
|
-
return console.warn(`No data found for: ${p}.${_}`),
|
|
346
|
-
if (
|
|
347
|
-
const
|
|
348
|
-
return Array.isArray(m) && m[
|
|
340
|
+
return console.warn(`Unknown variable suffix mapping for: ${e}`), i;
|
|
341
|
+
const { pairsKey: p, defaultKey: u, isArray: f } = d, S = o[p][_];
|
|
342
|
+
if (!S)
|
|
343
|
+
return console.warn(`No data found for: ${p}.${_}`), i;
|
|
344
|
+
if (f) {
|
|
345
|
+
const b = parseInt(l) - 1, m = S[u];
|
|
346
|
+
return Array.isArray(m) && m[b] ? m[b] : (console.warn(`Array value not found: ${p}.${_}.${u}[${b}]`), i);
|
|
349
347
|
}
|
|
350
|
-
const
|
|
351
|
-
return
|
|
348
|
+
const E = S[u];
|
|
349
|
+
return E !== void 0 ? String(E) : (console.warn(`Default value not found: ${p}.${_}.${u}`), i);
|
|
352
350
|
});
|
|
353
351
|
}
|
|
354
352
|
}
|
|
355
|
-
function
|
|
356
|
-
return new
|
|
353
|
+
function J(r) {
|
|
354
|
+
return new F().migrate(r);
|
|
357
355
|
}
|
|
358
356
|
export {
|
|
359
|
-
|
|
357
|
+
J as migrateItemsBlock
|
|
360
358
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var x = Object.defineProperty;
|
|
2
2
|
var f = (r, t, e) => t in r ? x(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
-
var
|
|
3
|
+
var m = (r, t, e) => f(r, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import h from "../../extensions/Blocks/RadioButton/template.js";
|
|
5
5
|
class T {
|
|
6
6
|
constructor() {
|
|
7
|
-
|
|
7
|
+
m(this, "parser");
|
|
8
8
|
this.parser = new DOMParser();
|
|
9
9
|
}
|
|
10
10
|
migrate(t) {
|
|
@@ -13,18 +13,17 @@ class T {
|
|
|
13
13
|
return i.length === 0 ? t : (i.forEach((s) => {
|
|
14
14
|
if (s.classList.contains("radio-button-v2"))
|
|
15
15
|
return;
|
|
16
|
-
const n = s.getAttribute("id"), l = this.extractTextFromElement(s, "ins-title"),
|
|
17
|
-
`<table id="tempDoc"><tbody><tr>${
|
|
16
|
+
const n = s.getAttribute("id"), l = this.extractTextFromElement(s, "ins-title"), o = this.extractTextFromElement(s, "ins-description"), c = this.extractTextFromElement(s, "ins-subscribe"), a = this.extractTextFromElement(s, "ins-unsubscribe"), p = this.buildTextBlock(l), u = this.buildTextBlock(o), d = this.buildTextBlock({ ...c, classList: "" }), y = this.buildTextBlock({ ...a, classList: "" }), b = h.replace("{-{-TITLE-}-}", p).replace("{-{-DESCRIPTION-}-}", u).replace("{-{-YES-}-}", d).replace("{-{-NO-}-}", y), g = this.parser.parseFromString(
|
|
17
|
+
`<table id="tempDoc"><tbody><tr>${b}</tr></tbody></table>`,
|
|
18
18
|
"text/html"
|
|
19
19
|
).querySelector(".radio-button-v2");
|
|
20
|
-
|
|
20
|
+
g && s.parentNode && (g.setAttribute("id", n || ""), s.parentNode.replaceChild(g, s));
|
|
21
21
|
}), e.documentElement.outerHTML);
|
|
22
22
|
} catch (e) {
|
|
23
23
|
return console.error("RadioButtonMigrator failed:", e), t;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
extractTextFromElement(t, e) {
|
|
27
|
-
var o, c;
|
|
28
27
|
const i = t.querySelector(`.${e}`);
|
|
29
28
|
if (!i)
|
|
30
29
|
return {
|
|
@@ -38,21 +37,21 @@ class T {
|
|
|
38
37
|
const s = i.querySelector("p");
|
|
39
38
|
if (!s)
|
|
40
39
|
return {
|
|
41
|
-
text:
|
|
40
|
+
text: i.textContent?.trim() || (e === "ins-title" ? "Title" : "Description"),
|
|
42
41
|
isBold: !1,
|
|
43
42
|
isItalic: !1,
|
|
44
43
|
align: i.getAttribute("align") || "left",
|
|
45
44
|
styles: "",
|
|
46
45
|
classList: ""
|
|
47
46
|
};
|
|
48
|
-
const n =
|
|
47
|
+
const n = s.textContent?.trim() || (e === "ins-title" ? "Title" : "Description"), l = s.getAttribute("style") || "", o = i.getAttribute("align") || s.getAttribute("align") || "left", c = /font-weight\s*:\s*bold/i.test(l) || !!s.querySelector("b, strong"), a = /font-style\s*:\s*italic/i.test(l) || !!s.querySelector("i, em"), p = this.removeStyleProperties(l, ["font-weight", "font-style"]), u = this.convertInlineToBlock(p), d = i.getAttribute("class") || "";
|
|
49
48
|
return {
|
|
50
49
|
text: n,
|
|
51
|
-
isBold:
|
|
52
|
-
isItalic:
|
|
53
|
-
align:
|
|
54
|
-
styles:
|
|
55
|
-
classList:
|
|
50
|
+
isBold: c,
|
|
51
|
+
isItalic: a,
|
|
52
|
+
align: o,
|
|
53
|
+
styles: u,
|
|
54
|
+
classList: d
|
|
56
55
|
};
|
|
57
56
|
}
|
|
58
57
|
buildTextBlock(t) {
|