@useinsider/guido 3.30.0-beta.6ee9542 → 3.30.0-beta.8b6fc0a
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/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +1 -1
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +52 -46
- package/dist/config/migrator/itemsBlockMigrator.js +1 -1
- package/dist/package.json.js +4 -4
- package/dist/utils/pairProductVariables.js +98 -108
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import r from "./AssignStrategyDrawer.vue2.js";
|
|
|
3
3
|
import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var a = function() {
|
|
5
5
|
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
6
|
-
return t.
|
|
6
|
+
return t.isRendered ? s(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, show: t.store.assignStrategyDrawerStatus, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
|
|
7
7
|
return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [t.strategiesLoading ? s(t.InSkeleton, { staticClass: "assign-strategy-select-skeleton", attrs: { sizing: t.SELECT_SKELETON_SIZING } }) : s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select w-23-s", attrs: { id: "assign-strategy-select", "create-button-visible": "", "info-box-position": "bottom right", "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { create: function(c) {
|
|
8
8
|
return t.store.openStrategyCreation();
|
|
9
9
|
}, infoBoxButtonClick: t.onInfoBoxButtonClick, select: t.onSelect } })], 1)];
|
|
@@ -1,51 +1,57 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as N, defineAsyncComponent as E, ref as p, computed as o, watch as R, nextTick as P } from "vue";
|
|
2
2
|
import "@useinsider/design-system-organisms/style";
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import { DOTTED_DATE_LOCALE as
|
|
6
|
-
import { URLS as
|
|
7
|
-
import { ToasterTypeOptions as
|
|
8
|
-
import { useRecommendationExtensionStore as
|
|
9
|
-
import { commitStrategyChange as
|
|
10
|
-
import
|
|
11
|
-
import { formatShortDate as
|
|
12
|
-
import { asText as
|
|
13
|
-
import { escapeHtml as
|
|
14
|
-
import { InSkeleton as
|
|
15
|
-
const
|
|
3
|
+
import { useToaster as U } from "../../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as G } from "../../../../composables/useTranslations.js";
|
|
5
|
+
import { DOTTED_DATE_LOCALE as M } from "../../../../enums/date.js";
|
|
6
|
+
import { URLS as $ } from "../../../../enums/extensions/recommendationBlock.js";
|
|
7
|
+
import { ToasterTypeOptions as f } from "../../../../enums/toaster.js";
|
|
8
|
+
import { useRecommendationExtensionStore as z } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import { commitStrategyChange as D } from "../../../../extensions/Blocks/Recommendation/utils/strategyCommit.js";
|
|
10
|
+
import H from "./StrategyInfoBoxContent.vue.js";
|
|
11
|
+
import { formatShortDate as F } from "../../../../utils/dateUtil.js";
|
|
12
|
+
import { asText as O } from "../../../../utils/genericUtil.js";
|
|
13
|
+
import { escapeHtml as K } from "../../../../utils/htmlEscape.js";
|
|
14
|
+
import { InSkeleton as I } from "@useinsider/design-system-vue";
|
|
15
|
+
const lt = /* @__PURE__ */ N({
|
|
16
16
|
__name: "AssignStrategyDrawer",
|
|
17
|
-
setup(
|
|
18
|
-
const g = () => import("@useinsider/design-system-organisms"),
|
|
19
|
-
render: (s) => s(
|
|
20
|
-
}),
|
|
17
|
+
setup(V) {
|
|
18
|
+
const g = () => import("@useinsider/design-system-organisms"), S = (t, r) => ({
|
|
19
|
+
render: (s) => s(I, { props: { sizing: { width: t, height: r } } })
|
|
20
|
+
}), h = E({
|
|
21
21
|
loader: async () => (await g()).OrgStrategyDetailModal,
|
|
22
|
-
loadingComponent:
|
|
22
|
+
loadingComponent: S(480, 240),
|
|
23
23
|
delay: 0
|
|
24
|
-
}),
|
|
24
|
+
}), x = E({
|
|
25
25
|
loader: async () => (await g()).OrgStrategyDropdown
|
|
26
|
-
}), i = "guido-edit-strategy-",
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
}), i = "guido-edit-strategy-", A = { width: 480, height: 42 }, a = G(), e = z(), { showToaster: c } = U(), n = p(null), d = "legacy", l = p(!1), m = p(!1), C = o(() => e.strategiesLoading || e.legacyConversionLoading), L = o(() => a(
|
|
27
|
+
"email-editor.assign-strategy-description",
|
|
28
|
+
{ url: $.RECOMMENDATION_STRATEGIES_PANEL_PATH }
|
|
29
|
+
));
|
|
30
|
+
R(() => e.assignStrategyDrawerStatus, async (t) => {
|
|
31
|
+
if (!t) {
|
|
32
|
+
await P(), m.value = e.assignStrategyDrawerStatus;
|
|
29
33
|
return;
|
|
34
|
+
}
|
|
35
|
+
m.value = !0;
|
|
30
36
|
const { strategyId: r } = e.recommendationConfigs;
|
|
31
37
|
n.value = r || (e.isLegacyStrategyBlock ? d : null), l.value = !1, e.invalidateStrategies(), e.fetchStrategies().catch(() => {
|
|
32
38
|
c({
|
|
33
|
-
type:
|
|
39
|
+
type: f.Error,
|
|
34
40
|
message: a("discovery-strategy.error-description")
|
|
35
41
|
});
|
|
36
42
|
});
|
|
37
|
-
});
|
|
38
|
-
const
|
|
39
|
-
const r =
|
|
43
|
+
}, { immediate: !0 });
|
|
44
|
+
const v = (t) => {
|
|
45
|
+
const r = O(t.updated_at || t.created_at);
|
|
40
46
|
if (!r)
|
|
41
47
|
return "";
|
|
42
|
-
const s =
|
|
48
|
+
const s = F(r, M);
|
|
43
49
|
return a("recommendation-strategy.last-updated-on", { value: s });
|
|
44
|
-
},
|
|
50
|
+
}, T = o(() => ({
|
|
45
51
|
text: a("ds-steps.legacy-strategy"),
|
|
46
52
|
value: d,
|
|
47
53
|
hidden: !0
|
|
48
|
-
})),
|
|
54
|
+
})), u = o(() => e.strategies.map((t) => ({
|
|
49
55
|
text: t.name,
|
|
50
56
|
value: t.strategy_id,
|
|
51
57
|
infoBoxProps: {
|
|
@@ -54,10 +60,10 @@ const it = /* @__PURE__ */ b({
|
|
|
54
60
|
variant: "information",
|
|
55
61
|
size: "small",
|
|
56
62
|
class: "assign-strategy-info-box",
|
|
57
|
-
titleText:
|
|
63
|
+
titleText: K(O(t.name)),
|
|
58
64
|
descriptionStatus: !0,
|
|
59
|
-
descriptionText:
|
|
60
|
-
slot:
|
|
65
|
+
descriptionText: v(t),
|
|
66
|
+
slot: H,
|
|
61
67
|
slotProps: { strategy: t },
|
|
62
68
|
// The info box drops the option's value/text, so the id is the only channel
|
|
63
69
|
// that can carry the strategy back to the click handler.
|
|
@@ -70,17 +76,17 @@ const it = /* @__PURE__ */ b({
|
|
|
70
76
|
icon: "line-open-website"
|
|
71
77
|
}]
|
|
72
78
|
}
|
|
73
|
-
}))),
|
|
74
|
-
var
|
|
75
|
-
const r = (
|
|
79
|
+
}))), k = o(() => e.isLegacyStrategyBlock ? [T.value, ...u.value] : u.value), B = (t) => {
|
|
80
|
+
var w;
|
|
81
|
+
const r = (w = t == null ? void 0 : t.id) != null && w.startsWith(i) ? t.id.slice(i.length) : "";
|
|
76
82
|
if (!r)
|
|
77
83
|
return;
|
|
78
84
|
const s = e.currentRecommendationId, y = e.recommendationConfigs.strategyId === r;
|
|
79
|
-
e.openStrategyEdit(r) && (String(n.value ?? "") === r && (n.value = null), y && (e.removeStrategy(), s !== null &&
|
|
80
|
-
},
|
|
85
|
+
e.openStrategyEdit(r) && (String(n.value ?? "") === r && (n.value = null), y && (e.removeStrategy(), s !== null && D(s, "Removed recommendation strategy")));
|
|
86
|
+
}, _ = o(() => {
|
|
81
87
|
const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
|
|
82
88
|
return t ? { ...t, fallback_config: null } : null;
|
|
83
|
-
}),
|
|
89
|
+
}), b = o(() => ({
|
|
84
90
|
primaryButton: {
|
|
85
91
|
styling: "solid",
|
|
86
92
|
type: "primary",
|
|
@@ -92,10 +98,10 @@ const it = /* @__PURE__ */ b({
|
|
|
92
98
|
labelText: a("products.cancel")
|
|
93
99
|
}
|
|
94
100
|
}));
|
|
95
|
-
return { __sfc: !0, loadOrganisms: g, skeleton:
|
|
101
|
+
return { __sfc: !0, loadOrganisms: g, skeleton: S, OrgStrategyDetailModal: h, OrgStrategyDropdown: x, EDIT_BUTTON_ID_PREFIX: i, SELECT_SKELETON_SIZING: A, trans: a, store: e, showToaster: c, selectedStrategyId: n, LEGACY_OPTION_VALUE: d, showSelectionError: l, isRendered: m, strategiesLoading: C, drawerDescription: L, lastUpdatedText: v, legacyStrategyOption: T, remoteStrategyOptions: u, strategyOptions: k, onInfoBoxButtonClick: B, selectedStrategy: _, footerButtonGroupOptions: b, closeDrawer: () => {
|
|
96
102
|
e.closeAssignStrategyDrawer();
|
|
97
103
|
}, assignStrategy: async () => {
|
|
98
|
-
const t =
|
|
104
|
+
const t = _.value;
|
|
99
105
|
if (!t) {
|
|
100
106
|
l.value = !0;
|
|
101
107
|
return;
|
|
@@ -108,21 +114,21 @@ const it = /* @__PURE__ */ b({
|
|
|
108
114
|
}
|
|
109
115
|
if (!r) {
|
|
110
116
|
c({
|
|
111
|
-
type:
|
|
117
|
+
type: f.Error,
|
|
112
118
|
message: a("email-editor.strategy-assign-failed", { strategyName: t.name })
|
|
113
119
|
});
|
|
114
120
|
return;
|
|
115
121
|
}
|
|
116
122
|
const s = e.currentRecommendationId;
|
|
117
123
|
e.assignStrategy(t), c({
|
|
118
|
-
type:
|
|
124
|
+
type: f.Success,
|
|
119
125
|
message: a("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
120
|
-
}), e.closeAssignStrategyDrawer(), s !== null && await
|
|
126
|
+
}), e.closeAssignStrategyDrawer(), s !== null && await D(s, "Assigned recommendation strategy");
|
|
121
127
|
}, onSelect: (t) => {
|
|
122
128
|
n.value = t.value, l.value = !1;
|
|
123
|
-
}, InSkeleton:
|
|
129
|
+
}, InSkeleton: I };
|
|
124
130
|
}
|
|
125
131
|
});
|
|
126
132
|
export {
|
|
127
|
-
|
|
133
|
+
lt as default
|
|
128
134
|
};
|
|
@@ -134,7 +134,7 @@ class tt {
|
|
|
134
134
|
if (F().$patch((u) => {
|
|
135
135
|
u.migrations = { ...u.migrations, [H]: a.length };
|
|
136
136
|
}), a.length === 0)
|
|
137
|
-
return console.warn("ItemsBlockMigrator: No blocks found with items block selectors"), this.backfillV2ProductTdAttributes(
|
|
137
|
+
return console.warn("ItemsBlockMigrator: No blocks found with items block selectors"), this.backfillV2ProductTdAttributes(t);
|
|
138
138
|
const c = new Set(Array.from(a).filter(q));
|
|
139
139
|
return a.forEach((u) => {
|
|
140
140
|
const o = this.extractConfiguration(u), n = $({
|
package/dist/package.json.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const o = "3.30.0-beta.
|
|
1
|
+
const o = "3.30.0-beta.8b6fc0a", s = { stripo: { version: "2.87.0" } }, t = {
|
|
2
2
|
version: o,
|
|
3
|
-
guido:
|
|
3
|
+
guido: s
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
t as default,
|
|
7
|
+
s as guido,
|
|
8
8
|
o as version
|
|
9
9
|
};
|
|
@@ -1,129 +1,128 @@
|
|
|
1
|
-
import { isNewPriceFormatRoot as
|
|
2
|
-
import { productPairs as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const q = {
|
|
1
|
+
import { isNewPriceFormatRoot as W, ITEMS_PRICE_FORMAT_ATTR as w, currencyPositionFromLocation as V, ITEMS_CURRENCY_ATTR as x, isCustomCurrencySymbol as G } from "../extensions/Blocks/Items/constants/currency.js";
|
|
2
|
+
import { productPairs as N } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
3
|
+
import { preserveTextStyles as H } from "./preserveTextStyles.js";
|
|
4
|
+
import { protectTableText as Y, restoreTableText as B } from "./protectTableText.js";
|
|
5
|
+
import { unwrapProductNameLinks as X } from "./unwrapProductNameLink.js";
|
|
6
|
+
const D = {
|
|
8
7
|
CART_ITEMS: "ins_apr",
|
|
9
8
|
BROWSED_ITEMS: "browsed_item",
|
|
10
9
|
PURCHASED_ITEMS: "purchased_item"
|
|
11
|
-
},
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
for (;
|
|
15
|
-
|
|
16
|
-
return
|
|
10
|
+
}, U = (r) => r.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
|
|
11
|
+
function v(r, _, u) {
|
|
12
|
+
let l = _;
|
|
13
|
+
for (; l > 0 && /\s/.test(r[l - 1]); )
|
|
14
|
+
l -= 1;
|
|
15
|
+
return u.some((p) => r.endsWith(p, l));
|
|
17
16
|
}
|
|
18
|
-
const
|
|
19
|
-
function
|
|
20
|
-
var
|
|
21
|
-
const
|
|
22
|
-
for (let
|
|
23
|
-
(
|
|
17
|
+
const j = /(\s)href=(["'])(?:[^"']*#!|#)?\2/gi;
|
|
18
|
+
function Q(r, _) {
|
|
19
|
+
var l;
|
|
20
|
+
const u = r.ownerDocument.createTreeWalker(r, NodeFilter.SHOW_COMMENT);
|
|
21
|
+
for (let p = u.nextNode(); p; p = u.nextNode())
|
|
22
|
+
(l = p.nodeValue) != null && l.includes("[if mso]") && (p.nodeValue = p.nodeValue.replace(j, (I, E) => `${E}href="${_}"`));
|
|
24
23
|
}
|
|
25
|
-
function
|
|
24
|
+
function z(r) {
|
|
26
25
|
return {
|
|
27
26
|
isFormatted: r.getAttribute("data-formated") === "true",
|
|
28
27
|
isSinglePrice: r.getAttribute("data-single_price") === "true",
|
|
29
|
-
currencyPosition: r.getAttribute(
|
|
30
|
-
configuredSymbol: (r.getAttribute(
|
|
28
|
+
currencyPosition: r.getAttribute(x.POSITION) || "before",
|
|
29
|
+
configuredSymbol: (r.getAttribute(x.SYMBOL) || "").trim()
|
|
31
30
|
};
|
|
32
31
|
}
|
|
33
|
-
function
|
|
32
|
+
function J(r) {
|
|
34
33
|
return {
|
|
35
34
|
isFormatted: !1,
|
|
36
|
-
isSinglePrice: r.getAttribute(
|
|
37
|
-
currencyPosition:
|
|
38
|
-
r.getAttribute(
|
|
35
|
+
isSinglePrice: r.getAttribute(w.SINGLE_PRICE) === "true",
|
|
36
|
+
currencyPosition: V(
|
|
37
|
+
r.getAttribute(w.ALIGNMENT) ?? void 0
|
|
39
38
|
),
|
|
40
|
-
configuredSymbol: (r.getAttribute(
|
|
39
|
+
configuredSymbol: (r.getAttribute(w.SYMBOL) || "").trim()
|
|
41
40
|
};
|
|
42
41
|
}
|
|
43
|
-
function
|
|
44
|
-
const { isFormatted:
|
|
42
|
+
function K(r, _, u) {
|
|
43
|
+
const { isFormatted: l, isSinglePrice: p, currencyPosition: I, configuredSymbol: E } = u;
|
|
45
44
|
let y;
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
let
|
|
49
|
-
return
|
|
45
|
+
p ? y = l ? r.SINGLE_PRICE_FORMATTED : r.SINGLE_PRICE : y = l ? r.PRICE_FORMATTED : r.PRICE;
|
|
46
|
+
const b = r.CURRENCY;
|
|
47
|
+
let S = `{{${y}_${_}}}`, o = "";
|
|
48
|
+
return G(E) ? o = E : b && (o = `{{${b}_${_}}}`), o && (S = I === "after" ? `${S} ${o}` : `${o} ${S}`), S;
|
|
50
49
|
}
|
|
51
|
-
function
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
Object.entries(
|
|
56
|
-
|
|
57
|
-
const
|
|
50
|
+
function nt(r) {
|
|
51
|
+
const _ = U(Y(r)), u = new DOMParser().parseFromString(_, "text/html");
|
|
52
|
+
X(u);
|
|
53
|
+
const l = N.PAIRS_FOR_EXTENSION;
|
|
54
|
+
Object.entries(l).forEach(([o, R]) => {
|
|
55
|
+
u.querySelectorAll(".ins-product-td").forEach((n) => {
|
|
56
|
+
const m = n.getAttribute("data-number") || "1", C = n.getAttribute("data-type") || "CART_ITEMS";
|
|
58
57
|
n.querySelectorAll(`[product-attr="${o}"]`).forEach((t) => {
|
|
59
|
-
var
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
58
|
+
var h, L, k, O;
|
|
59
|
+
const P = t.getAttribute("data-type") || C, c = t.getAttribute("data-number") || m, d = R[P];
|
|
60
|
+
if (d)
|
|
62
61
|
switch (o) {
|
|
63
62
|
case "imageSrc": {
|
|
64
63
|
let e = null, i = null;
|
|
65
64
|
if (t.tagName === "IMG" ? (e = t, i = e.closest("a")) : (e = t.querySelector("img"), i = t.querySelector("a") || t.closest("a")), !e)
|
|
66
65
|
break;
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
return
|
|
66
|
+
const A = d.DEFAULT, a = d.ATTR;
|
|
67
|
+
if (A && e.src) {
|
|
68
|
+
const f = e.src;
|
|
69
|
+
A.some((F) => {
|
|
70
|
+
const T = F.split("/").pop() || "", q = f.split("/").pop() || "";
|
|
71
|
+
return f.includes(F) || f.includes(T) || q === T;
|
|
73
72
|
}) && (e.src = `{{${a}_${c}}}`);
|
|
74
73
|
}
|
|
75
|
-
const s = (
|
|
74
|
+
const s = (L = (h = l.name) == null ? void 0 : h[P]) == null ? void 0 : L.ATTR;
|
|
76
75
|
if (s && e.setAttribute("alt", `{{${s}_${c}}}`), i) {
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
80
|
-
(
|
|
76
|
+
const f = (k = l.itemLink) == null ? void 0 : k[P];
|
|
77
|
+
if (f) {
|
|
78
|
+
const M = f.HREF, F = f.DEFAULT_HREF || "#!", T = i.href;
|
|
79
|
+
(T === "#" || T === "" || T.endsWith("#!") || T.endsWith(F) || T === `${window.location.href}${F}` || !T || T === window.location.href) && (i.href = `{{${M}_${c}}}`);
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
break;
|
|
84
83
|
}
|
|
85
84
|
case "name": {
|
|
86
|
-
const e =
|
|
87
|
-
t.textContent && (t.innerHTML =
|
|
85
|
+
const e = d, i = e.ATTR, A = e.DEFAULT_HREF || "#!", a = e.HREF;
|
|
86
|
+
t.textContent && (t.innerHTML = H(t, `{{${i}_${c}}}`));
|
|
88
87
|
const s = t.closest("a") || (t.tagName === "A" ? t : null);
|
|
89
88
|
if (s && a) {
|
|
90
|
-
const
|
|
91
|
-
(
|
|
89
|
+
const f = s.href, M = `${window.location.href}${A}`;
|
|
90
|
+
(f === M || f.endsWith(A)) && (s.href = `{{${a}_${c}}}`);
|
|
92
91
|
}
|
|
93
92
|
break;
|
|
94
93
|
}
|
|
95
94
|
case "price":
|
|
96
95
|
case "originalPrice": {
|
|
97
|
-
const e =
|
|
98
|
-
t.innerHTML =
|
|
96
|
+
const e = d, i = W(n) ? J(n) : z(t);
|
|
97
|
+
t.innerHTML = H(t, K(e, c, i));
|
|
99
98
|
break;
|
|
100
99
|
}
|
|
101
100
|
case "quantity": {
|
|
102
|
-
const e =
|
|
103
|
-
a &&
|
|
101
|
+
const e = d, i = e.ATTR, A = [e.DEFAULT, ...e.LEGACY_DEFAULTS], a = (O = t.textContent) == null ? void 0 : O.trim();
|
|
102
|
+
a && A.includes(a) && (t.innerHTML = H(t, `{{${i}_${c}}}`));
|
|
104
103
|
break;
|
|
105
104
|
}
|
|
106
105
|
case "button": {
|
|
107
|
-
const e =
|
|
106
|
+
const e = d, i = e.HREF, A = e.DEFAULT_HREF || "#!", a = t.tagName === "A" ? t : t.querySelector("a");
|
|
108
107
|
if (a) {
|
|
109
|
-
const s = a.href || "",
|
|
110
|
-
(s === "" || s === "#" || s ===
|
|
108
|
+
const s = a.href || "", f = `${window.location.href}${A}`;
|
|
109
|
+
(s === "" || s === "#" || s === f || s.endsWith(A) || s.endsWith("#!") || s === window.location.href) && (a.href = `{{${i}_${c}}}`);
|
|
111
110
|
}
|
|
112
|
-
|
|
111
|
+
Q(t, `{{${i}_${c}}}`);
|
|
113
112
|
break;
|
|
114
113
|
}
|
|
115
114
|
case "itemLink": {
|
|
116
|
-
const e =
|
|
115
|
+
const e = d, i = e.HREF, A = e.DEFAULT_HREF || "#!", a = t;
|
|
117
116
|
if (a.href) {
|
|
118
|
-
const s = a.href,
|
|
119
|
-
(s ===
|
|
117
|
+
const s = a.href, f = `${window.location.href}${A}`;
|
|
118
|
+
(s === f || s.endsWith(A)) && (a.href = `{{${i}_${c}}}`);
|
|
120
119
|
}
|
|
121
120
|
break;
|
|
122
121
|
}
|
|
123
122
|
default: {
|
|
124
|
-
if ("ATTR" in
|
|
125
|
-
const e =
|
|
126
|
-
t.textContent && (t.innerHTML =
|
|
123
|
+
if ("ATTR" in d) {
|
|
124
|
+
const e = d.ATTR;
|
|
125
|
+
t.textContent && (t.innerHTML = H(t, `{{${e}_${c}}}`));
|
|
127
126
|
}
|
|
128
127
|
break;
|
|
129
128
|
}
|
|
@@ -131,49 +130,40 @@ function at(r) {
|
|
|
131
130
|
});
|
|
132
131
|
});
|
|
133
132
|
});
|
|
134
|
-
const
|
|
135
|
-
` : ""
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
number: _
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
let E = L + p.documentElement.outerHTML;
|
|
146
|
-
y.reverse().forEach(({ outerHtml: o, type: T, number: _ }) => {
|
|
147
|
-
const n = q[T], S = n ? `${n}_total_product_kind` : "";
|
|
148
|
-
if (S) {
|
|
149
|
-
const b = parseInt(_) - 1, c = `${`{% if ${S} > ${b} %}`}${o}{% endif %}`;
|
|
150
|
-
E = E.replace(o, v(c));
|
|
151
|
-
}
|
|
133
|
+
const p = _.match(/<!DOCTYPE[^>]*>/i), I = p ? `${p[0]}
|
|
134
|
+
` : "";
|
|
135
|
+
u.querySelectorAll(".ins-product-td").forEach((o) => {
|
|
136
|
+
const R = o.getAttribute("data-type") || "CART_ITEMS", $ = D[R];
|
|
137
|
+
if (!$)
|
|
138
|
+
return;
|
|
139
|
+
const n = parseInt(o.getAttribute("data-number") || "1") - 1;
|
|
140
|
+
o.before(u.createComment(`{% if ${$}_total_product_kind > ${n} %}`)), o.after(u.createComment("{% endif %}"));
|
|
152
141
|
});
|
|
153
|
-
|
|
154
|
-
|
|
142
|
+
let E = I + u.documentElement.outerHTML;
|
|
143
|
+
const y = u.querySelectorAll('[product-attr="originalPrice"][data-type]'), b = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Set();
|
|
144
|
+
return y.forEach((o) => {
|
|
155
145
|
var t;
|
|
156
|
-
const
|
|
157
|
-
if (!
|
|
146
|
+
const R = o.getAttribute("data-number"), $ = o.getAttribute("data-type");
|
|
147
|
+
if (!R || !D[$])
|
|
158
148
|
return;
|
|
159
149
|
const n = o.closest(".product-original-price-class");
|
|
160
|
-
if (!n ||
|
|
150
|
+
if (!n || S.has(n))
|
|
161
151
|
return;
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
}),
|
|
166
|
-
if (n.includes("{% if") ||
|
|
152
|
+
S.add(n);
|
|
153
|
+
const m = n.outerHTML, C = (t = o.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup"), g = b.get(m) ?? { number: R, type: $, wrap: [] };
|
|
154
|
+
g.wrap.push(C !== "false"), b.set(m, g);
|
|
155
|
+
}), b.forEach(({ number: o, type: R, wrap: $ }, n) => {
|
|
156
|
+
if (n.includes("{% if") || !$.some(Boolean))
|
|
167
157
|
return;
|
|
168
|
-
const
|
|
169
|
-
let
|
|
170
|
-
for (;
|
|
171
|
-
const
|
|
172
|
-
|
|
158
|
+
const m = N.PAIRS_FOR_EXTENSION.price[R].PRICE, C = N.PAIRS_FOR_EXTENSION.originalPrice[R].PRICE, g = `{% if ${m}_${o} != ${C}_${o} %}`, t = [g, U(g)];
|
|
159
|
+
let P = "", c = 0, d = 0, h = E.indexOf(n);
|
|
160
|
+
for (; h !== -1; ) {
|
|
161
|
+
const L = $[d] === !0 && !v(E, h, t);
|
|
162
|
+
P += E.slice(c, h) + (L ? `${g}${n}{% endif %}` : n), c = h + n.length, d += 1, h = E.indexOf(n, c);
|
|
173
163
|
}
|
|
174
|
-
E =
|
|
175
|
-
}),
|
|
164
|
+
E = P + E.slice(c);
|
|
165
|
+
}), B(E.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}"));
|
|
176
166
|
}
|
|
177
167
|
export {
|
|
178
|
-
|
|
168
|
+
nt as pairProductVariables
|
|
179
169
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.30.0-beta.
|
|
3
|
+
"version": "3.30.0-beta.8b6fc0a",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|