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