@useinsider/guido 3.18.1-beta.0725bd5 → 3.18.1-beta.12053dd
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/composables/useCustomInterfaceAppearance.js +50 -45
- package/dist/composables/useRecommendation.js +38 -36
- package/dist/composables/useStripo.js +28 -28
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +1 -1
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +39 -27
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +3 -2
- package/dist/static/styles/components/recommendation-strategy.css.js +0 -17
- package/dist/static/styles/components/skeleton.css.js +23 -0
- package/dist/utils/templatePreparation.js +10 -10
- package/package.json +1 -1
|
@@ -1,72 +1,77 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import p from "../static/assets/icons/line-change.svg.js";
|
|
2
|
+
import s from "../static/assets/icons/line-delete.svg.js";
|
|
3
|
+
import a from "../static/assets/icons/line-plus.svg.js";
|
|
4
|
+
import f from "../static/styles/base.css.js";
|
|
5
5
|
import C from "../static/styles/components/alert-message.css.js";
|
|
6
6
|
import c from "../static/styles/components/amp-block.css.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import l from "../static/styles/components/base-input.css.js";
|
|
8
|
+
import d from "../static/styles/components/button-group.css.js";
|
|
9
9
|
import u from "../static/styles/components/button.css.js";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import h from "../static/styles/components/combobox.css.js";
|
|
11
|
+
import g from "../static/styles/components/counter.css.js";
|
|
12
12
|
import w from "../static/styles/components/dropdown-menu.css.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
import y from "../static/styles/components/loader.css.js";
|
|
14
|
+
import I from "../static/styles/components/narrow-panel.css.js";
|
|
15
|
+
import A from "../static/styles/components/popup.css.js";
|
|
16
|
+
import b from "../static/styles/components/recommendation-strategy.css.js";
|
|
17
|
+
import B from "../static/styles/components/skeleton.css.js";
|
|
18
|
+
import D from "../static/styles/components/switcher.css.js";
|
|
19
|
+
import $ from "../static/styles/components/tabs.css.js";
|
|
20
|
+
import P from "../static/styles/components/tools.css.js";
|
|
21
|
+
import R from "../static/styles/components/version-history.css.js";
|
|
22
|
+
import T from "../static/styles/components/wide-panel.css.js";
|
|
23
|
+
import x from "../static/styles/variables.css.js";
|
|
24
|
+
function r(S, o) {
|
|
25
|
+
return `--guido-icon-${S}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
|
|
25
26
|
}
|
|
26
|
-
const
|
|
27
|
-
${r("line-change",
|
|
28
|
-
${r("line-delete",
|
|
29
|
-
${r("line-plus",
|
|
30
|
-
}`,
|
|
31
|
-
|
|
27
|
+
const M = `:host {
|
|
28
|
+
${r("line-change", p)}
|
|
29
|
+
${r("line-delete", s)}
|
|
30
|
+
${r("line-plus", a)}
|
|
31
|
+
}`, O = [
|
|
32
|
+
x,
|
|
32
33
|
// Must be on top
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
M,
|
|
35
|
+
f,
|
|
35
36
|
// Must be on top
|
|
36
37
|
C,
|
|
37
38
|
c,
|
|
38
|
-
f,
|
|
39
39
|
l,
|
|
40
|
-
u,
|
|
41
40
|
d,
|
|
41
|
+
u,
|
|
42
42
|
h,
|
|
43
|
-
w,
|
|
44
|
-
I,
|
|
45
43
|
g,
|
|
44
|
+
w,
|
|
46
45
|
y,
|
|
47
|
-
|
|
46
|
+
I,
|
|
47
|
+
A,
|
|
48
48
|
B,
|
|
49
49
|
D,
|
|
50
50
|
$,
|
|
51
51
|
P,
|
|
52
|
-
|
|
52
|
+
R,
|
|
53
|
+
T,
|
|
54
|
+
b
|
|
53
55
|
// Last: overrides button.css / wide-panel.css defaults
|
|
54
56
|
].join(`
|
|
55
57
|
|
|
56
|
-
`),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
`), V = 3e4;
|
|
59
|
+
let e = null;
|
|
60
|
+
function W() {
|
|
61
|
+
return e || (e = new CSSStyleSheet(), e.replaceSync(O)), e;
|
|
62
|
+
}
|
|
63
|
+
const So = () => ({ importCss: () => {
|
|
64
|
+
const o = W(), i = Date.now() + V, m = () => {
|
|
65
|
+
var n;
|
|
66
|
+
const t = (n = document.querySelector("ui-editor")) == null ? void 0 : n.shadowRoot;
|
|
67
|
+
if (t) {
|
|
68
|
+
t.adoptedStyleSheets.includes(o) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, o]);
|
|
64
69
|
return;
|
|
65
70
|
}
|
|
66
|
-
Date.now() <
|
|
71
|
+
Date.now() < i && requestAnimationFrame(m);
|
|
67
72
|
};
|
|
68
|
-
|
|
73
|
+
m();
|
|
69
74
|
} });
|
|
70
75
|
export {
|
|
71
|
-
|
|
76
|
+
So as useCustomInterfaceAppearance
|
|
72
77
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { getRecommendationFeedSourceMaps as y, URLS as I } from "../enums/extensions/recommendationBlock.js";
|
|
2
2
|
import { MinDeviceViewport as C, DefaultPadding as R } from "../enums/recommendation.js";
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
3
|
+
import { useRecommendationExtensionStore as g } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
4
|
import { generateCompleteFilterQuery as b } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
5
5
|
import { getPartnerRecommendationParams as h } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
|
|
6
6
|
import { sanitizeProductIds as x } from "../extensions/Blocks/Recommendation/utils/productIds.js";
|
|
7
7
|
import { useConfigStore as P } from "../stores/config.js";
|
|
8
8
|
const B = () => ({
|
|
9
9
|
calculateCardWidth: ({
|
|
10
|
-
mobileLeftPadding:
|
|
10
|
+
mobileLeftPadding: s,
|
|
11
11
|
mobileRightPadding: c,
|
|
12
|
-
cardsInRow:
|
|
13
|
-
unresponsive:
|
|
12
|
+
cardsInRow: o,
|
|
13
|
+
unresponsive: a
|
|
14
14
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
return (C - e) /
|
|
15
|
+
const i = a ? o : 1, e = s + c + (i - 1) * R;
|
|
16
|
+
return (C - e) / i;
|
|
17
17
|
},
|
|
18
|
-
getRecommendationCampaignData: (
|
|
19
|
-
const c =
|
|
20
|
-
if (!
|
|
18
|
+
getRecommendationCampaignData: (s) => {
|
|
19
|
+
const c = g(), o = Number(s), a = c.blockStates[o];
|
|
20
|
+
if (!a)
|
|
21
21
|
return {
|
|
22
22
|
textTrimming: !1,
|
|
23
23
|
orientation: "vertical",
|
|
@@ -30,57 +30,59 @@ const B = () => ({
|
|
|
30
30
|
discountBeforeTextValue: "",
|
|
31
31
|
discountAfterTextValue: ""
|
|
32
32
|
};
|
|
33
|
-
const { recommendationConfigs:
|
|
33
|
+
const { recommendationConfigs: i } = a, e = i.orientation === "grid" ? "vertical" : "horizontal";
|
|
34
34
|
return {
|
|
35
|
-
textTrimming:
|
|
35
|
+
textTrimming: i.textTrimming,
|
|
36
36
|
orientation: e,
|
|
37
37
|
mobileLeftPadding: 0,
|
|
38
38
|
mobileRightPadding: 0,
|
|
39
|
-
cardsInRow:
|
|
40
|
-
unresponsive:
|
|
39
|
+
cardsInRow: i.cardsInRow,
|
|
40
|
+
unresponsive: i.unresponsive,
|
|
41
41
|
priceBeforeTextValue: "",
|
|
42
42
|
priceAfterTextValue: "",
|
|
43
43
|
discountBeforeTextValue: "",
|
|
44
44
|
discountAfterTextValue: ""
|
|
45
45
|
};
|
|
46
46
|
},
|
|
47
|
-
buildCampaignUrl: (
|
|
47
|
+
buildCampaignUrl: (s, c) => {
|
|
48
48
|
var l;
|
|
49
|
-
const
|
|
49
|
+
const o = g(), a = P(), i = Number(s);
|
|
50
50
|
let e;
|
|
51
51
|
if (c)
|
|
52
52
|
e = c;
|
|
53
53
|
else {
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
54
|
+
const r = o.blockStates[i];
|
|
55
|
+
if (!r)
|
|
56
56
|
return "";
|
|
57
|
-
const { recommendationConfigs:
|
|
57
|
+
const { recommendationConfigs: n } = r;
|
|
58
58
|
e = {
|
|
59
|
-
strategy:
|
|
60
|
-
strategyId:
|
|
61
|
-
language:
|
|
62
|
-
currencyCode:
|
|
63
|
-
size:
|
|
64
|
-
productIds:
|
|
65
|
-
filters:
|
|
66
|
-
shuffleProducts:
|
|
59
|
+
strategy: n.strategy,
|
|
60
|
+
strategyId: n.strategyId,
|
|
61
|
+
language: n.language,
|
|
62
|
+
currencyCode: n.currencySettings.value,
|
|
63
|
+
size: n.size,
|
|
64
|
+
productIds: n.productIds,
|
|
65
|
+
filters: n.filters,
|
|
66
|
+
shuffleProducts: n.shuffleProducts
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
if (e.strategyId &&
|
|
70
|
-
return
|
|
69
|
+
if (e.strategyId && a.isFeatureEnabled("reusableRecommendationStrategy"))
|
|
70
|
+
return o.recommendationCampaignUrls[s] = {
|
|
71
71
|
strategyId: e.strategyId,
|
|
72
72
|
locale: e.language,
|
|
73
73
|
currency: e.currencyCode
|
|
74
74
|
}, "";
|
|
75
|
-
const d = ((l = y().find((
|
|
76
|
-
if (!d)
|
|
77
|
-
|
|
75
|
+
const d = ((l = y().find((r) => r.key === e.strategy)) == null ? void 0 : l.path) || "";
|
|
76
|
+
if (!d) {
|
|
77
|
+
const r = { ...o.recommendationCampaignUrls };
|
|
78
|
+
return delete r[s], o.recommendationCampaignUrls = r, "";
|
|
79
|
+
}
|
|
78
80
|
const t = new URLSearchParams();
|
|
79
|
-
t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName",
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
const p = decodeURIComponent(t.toString()),
|
|
83
|
-
return
|
|
81
|
+
t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", a.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", a.variationId), e.strategy === "manualMerchandising" ? t.set("productId", x(e.productIds)) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
82
|
+
const f = e.filters.filter((r) => r.isValid), m = b(f);
|
|
83
|
+
m && t.set("filter", m), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(h(a.partnerName, e.strategy)).forEach(([r, n]) => t.set(r, n));
|
|
84
|
+
const p = decodeURIComponent(t.toString()), u = `${I.RECOMMENDATION_API_URL}/v2/${d}?${p}`;
|
|
85
|
+
return o.recommendationCampaignUrls[s] = u, u;
|
|
84
86
|
}
|
|
85
87
|
});
|
|
86
88
|
export {
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
1
|
+
import { useActionsApi as O } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as q } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as H } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as w } from "./useCustomInterfaceAppearance.js";
|
|
5
5
|
import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
|
|
6
6
|
import { useModuleRepair as j } from "./useModuleRepair.js";
|
|
7
7
|
import { useStripoEventHandler as z } from "./useStripoEventHandler.js";
|
|
8
8
|
import { useStripoNotifications as $ } from "./useStripoNotifications.js";
|
|
9
9
|
import { useToaster as G } from "./useToaster.js";
|
|
10
10
|
import { localePatch as J } from "../config/i18n/index.js";
|
|
11
|
-
import { en as
|
|
11
|
+
import { en as b } from "../config/i18n/en/index.js";
|
|
12
12
|
import { ToasterTypeOptions as X } from "../enums/toaster.js";
|
|
13
13
|
import { useStripoApi as K } from "../services/stripoApi.js";
|
|
14
14
|
import Q from "../static/styles/customEditorStyle.css.js";
|
|
15
|
-
import { useEditorStore as
|
|
15
|
+
import { useEditorStore as k } from "../stores/editor.js";
|
|
16
16
|
import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../utils/genericUtil.js";
|
|
17
17
|
import Z from "../package.json.js";
|
|
18
18
|
let n = null;
|
|
19
19
|
const he = () => {
|
|
20
|
-
const { features: c, template: u, isFeatureEnabled: m } =
|
|
20
|
+
const { features: c, template: u, isFeatureEnabled: m } = H(), { handleError: p, showToaster: B } = G(), { getToken: M, getCustomFonts: T, getSyncModulesStatus: v } = K(), { handleEvent: F } = z(), { handleModuleAdd: A } = j(), { getStripoBlocksConfig: V } = q(), { getStripoNotifications: _ } = $(), f = () => n || (n = new Promise((i, s) => {
|
|
21
21
|
var d;
|
|
22
22
|
if (document.getElementById("UiEditorScript")) {
|
|
23
23
|
i();
|
|
@@ -29,16 +29,16 @@ const he = () => {
|
|
|
29
29
|
}, document.body.appendChild(e);
|
|
30
30
|
}), n.catch(() => {
|
|
31
31
|
n = null;
|
|
32
|
-
}), n),
|
|
32
|
+
}), n), D = async (i, s, o, a = [], r = !1) => {
|
|
33
33
|
var y, E, h, C;
|
|
34
|
-
const e =
|
|
35
|
-
|
|
34
|
+
const e = k(), { html: d, css: R } = i, { baseBlocks: g, extensions: P } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), x = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
|
|
35
|
+
w().importCss(), await window.UIEditor.initEditor(
|
|
36
36
|
document.querySelector("#guido-editor"),
|
|
37
37
|
{
|
|
38
38
|
metadata: s,
|
|
39
39
|
html: d,
|
|
40
|
-
css:
|
|
41
|
-
forceRecreate:
|
|
40
|
+
css: R,
|
|
41
|
+
forceRecreate: I,
|
|
42
42
|
locale: "en",
|
|
43
43
|
undoButtonSelector: "#guido__undo-button",
|
|
44
44
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -52,7 +52,7 @@ const he = () => {
|
|
|
52
52
|
conditionsEnabled: S,
|
|
53
53
|
customConditionsEnabled: S,
|
|
54
54
|
enableXSSSecurity: !0,
|
|
55
|
-
modulesDisabled:
|
|
55
|
+
modulesDisabled: U,
|
|
56
56
|
syncModulesEnabled: r,
|
|
57
57
|
messageSettingsEnabled: !0,
|
|
58
58
|
displayGmailAnnotations: !0,
|
|
@@ -62,7 +62,7 @@ const he = () => {
|
|
|
62
62
|
displayUTM: !1,
|
|
63
63
|
selectElementAfterDrop: !0,
|
|
64
64
|
sameFontSizeForOutlook: !0,
|
|
65
|
-
allowedScriptSourceDomains:
|
|
65
|
+
allowedScriptSourceDomains: x,
|
|
66
66
|
...g ? { baseBlocks: g } : {},
|
|
67
67
|
editorFonts: {
|
|
68
68
|
showDefaultStandardFonts: !0,
|
|
@@ -80,7 +80,7 @@ const he = () => {
|
|
|
80
80
|
],
|
|
81
81
|
async onTokenRefreshRequest(t) {
|
|
82
82
|
try {
|
|
83
|
-
const l = await
|
|
83
|
+
const l = await M();
|
|
84
84
|
t(l);
|
|
85
85
|
} catch (l) {
|
|
86
86
|
p(l, "Failed to refresh token");
|
|
@@ -88,8 +88,8 @@ const he = () => {
|
|
|
88
88
|
},
|
|
89
89
|
onTemplateLoaded() {
|
|
90
90
|
try {
|
|
91
|
-
const { activateCustomViewStyles: t, updateTimerInClonedTemplate: l } =
|
|
92
|
-
t(),
|
|
91
|
+
const { activateCustomViewStyles: t, updateTimerInClonedTemplate: l } = O(), { injectFullStory: L } = N();
|
|
92
|
+
w().importCss(), t(), L(), l(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
93
93
|
e.hasChanges = !1;
|
|
94
94
|
}, 1e3);
|
|
95
95
|
} catch (t) {
|
|
@@ -108,34 +108,34 @@ const he = () => {
|
|
|
108
108
|
onDataChanged() {
|
|
109
109
|
e.hasChanges = !0;
|
|
110
110
|
},
|
|
111
|
-
onEvent:
|
|
112
|
-
onModuleAdd:
|
|
113
|
-
notifications:
|
|
111
|
+
onEvent: F,
|
|
112
|
+
onModuleAdd: A,
|
|
113
|
+
notifications: _(),
|
|
114
114
|
ignoreClickOutsideSelectors: [
|
|
115
115
|
"#guido-dynamic-content-modal",
|
|
116
116
|
".in-on-board-wrapper",
|
|
117
117
|
".in-drawer__container"
|
|
118
118
|
],
|
|
119
|
-
extensions:
|
|
119
|
+
extensions: P,
|
|
120
120
|
localePatch: J
|
|
121
121
|
}
|
|
122
122
|
);
|
|
123
123
|
};
|
|
124
124
|
return { initPlugin: async (i, s, o) => {
|
|
125
|
-
const a =
|
|
125
|
+
const a = k();
|
|
126
126
|
try {
|
|
127
127
|
await f();
|
|
128
128
|
const [r, e] = await Promise.all([
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
T(),
|
|
130
|
+
v()
|
|
131
131
|
]);
|
|
132
|
-
a.syncModulesEnabled = e, await
|
|
132
|
+
a.syncModulesEnabled = e, await D(i, s, o, r, e);
|
|
133
133
|
} catch {
|
|
134
|
-
a.loadingStatus = !1,
|
|
134
|
+
a.loadingStatus = !1, B({
|
|
135
135
|
type: X.Error,
|
|
136
|
-
message:
|
|
136
|
+
message: b["An error has occurred. Please report the error code to support."],
|
|
137
137
|
actionButton: {
|
|
138
|
-
text:
|
|
138
|
+
text: b["Reload page"],
|
|
139
139
|
onClick: () => window.location.reload()
|
|
140
140
|
}
|
|
141
141
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { DEFAULT_COLUMN_SPACING as
|
|
2
|
-
import { ATTR_PRODUCT_IMAGE as o, ATTR_PRODUCT_NAME as t, ATTR_PRODUCT_OLD_PRICE as _, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as
|
|
3
|
-
const
|
|
1
|
+
import { DEFAULT_COLUMN_SPACING as i, DEFAULT_ROW_SPACING as s, DEFAULT_MOBILE_ROW_SPACING as n, DEFAULT_MOBILE_COLUMN_SPACING as O, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as C } from "./layout.js";
|
|
2
|
+
import { ATTR_PRODUCT_IMAGE as o, ATTR_PRODUCT_NAME as t, ATTR_PRODUCT_OLD_PRICE as _, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as I, ATTR_PRODUCT_OMNIBUS_DISCOUNT as R, ATTR_PRODUCT_BUTTON as r, ATTR_RECOMMENDATION_TITLE as E } from "./selectors.js";
|
|
3
|
+
const U = 1, u = 2, m = 2, A = {
|
|
4
4
|
code: "USD",
|
|
5
5
|
symbol: "USD",
|
|
6
6
|
alignment: "after",
|
|
7
7
|
decimalCount: 2,
|
|
8
8
|
decimalSeparator: ".",
|
|
9
9
|
thousandSeparator: ","
|
|
10
|
-
},
|
|
10
|
+
}, D = {
|
|
11
11
|
textBefore: "",
|
|
12
12
|
textAfter: ""
|
|
13
13
|
}, a = {
|
|
@@ -18,26 +18,26 @@ const A = 1, u = 2, D = {
|
|
|
18
18
|
t,
|
|
19
19
|
_,
|
|
20
20
|
T,
|
|
21
|
-
r,
|
|
22
21
|
I,
|
|
23
|
-
|
|
22
|
+
R,
|
|
23
|
+
r
|
|
24
24
|
], N = {
|
|
25
|
-
[
|
|
25
|
+
[E]: !0,
|
|
26
26
|
[o]: !0,
|
|
27
27
|
[t]: !0,
|
|
28
28
|
[T]: !0,
|
|
29
29
|
[_]: !0,
|
|
30
|
-
[r]: !1,
|
|
31
30
|
[I]: !1,
|
|
32
|
-
[
|
|
33
|
-
|
|
31
|
+
[R]: !1,
|
|
32
|
+
[r]: !0
|
|
33
|
+
}, L = {
|
|
34
34
|
// Settings
|
|
35
35
|
strategy: "mostPopular",
|
|
36
36
|
productIds: [],
|
|
37
37
|
size: "6",
|
|
38
38
|
shuffleProducts: !1,
|
|
39
39
|
language: "en_US",
|
|
40
|
-
currency:
|
|
40
|
+
currency: A,
|
|
41
41
|
filters: [],
|
|
42
42
|
strategyId: "",
|
|
43
43
|
// Layout
|
|
@@ -46,7 +46,7 @@ const A = 1, u = 2, D = {
|
|
|
46
46
|
mobileCardsInRow: e,
|
|
47
47
|
mobileLayoutEnabled: !1,
|
|
48
48
|
previousMobileCardsInRow: e,
|
|
49
|
-
columnSpacing:
|
|
49
|
+
columnSpacing: i,
|
|
50
50
|
rowSpacing: s,
|
|
51
51
|
mobileColumnSpacing: O,
|
|
52
52
|
mobileRowSpacing: n,
|
|
@@ -55,7 +55,7 @@ const A = 1, u = 2, D = {
|
|
|
55
55
|
visibility: N,
|
|
56
56
|
previousTitleHtml: "",
|
|
57
57
|
// Element settings
|
|
58
|
-
omnibusPrice:
|
|
58
|
+
omnibusPrice: D,
|
|
59
59
|
omnibusDiscount: a,
|
|
60
60
|
textTrimming: !1,
|
|
61
61
|
// Price placement (block-level, affects all cards)
|
|
@@ -66,17 +66,18 @@ const A = 1, u = 2, D = {
|
|
|
66
66
|
// of "false" (the actual hiding happens server-side at send).
|
|
67
67
|
priceHideIfSameAsDiscounted: !1,
|
|
68
68
|
// Meta
|
|
69
|
-
configVersion:
|
|
69
|
+
configVersion: U,
|
|
70
70
|
recommendationId: 0
|
|
71
|
-
},
|
|
71
|
+
}, P = [11, 12];
|
|
72
72
|
export {
|
|
73
73
|
u as CURRENT_CONFIG_VERSION,
|
|
74
74
|
c as DEFAULT_COMPOSITION,
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
A as DEFAULT_CURRENCY,
|
|
76
|
+
L as DEFAULT_NODE_CONFIG,
|
|
77
77
|
a as DEFAULT_OMNIBUS_DISCOUNT,
|
|
78
|
-
|
|
78
|
+
D as DEFAULT_OMNIBUS_PRICE,
|
|
79
79
|
N as DEFAULT_VISIBILITY,
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
P as EXCLUDED_ALGORITHM_IDS,
|
|
81
|
+
U as PRE_RRS_CONFIG_VERSION,
|
|
82
|
+
m as RRS_CONFIG_VERSION
|
|
82
83
|
};
|
|
@@ -4,7 +4,7 @@ var r = (g, c, t) => C(g, typeof c != "symbol" ? c + "" : c, t);
|
|
|
4
4
|
import { useConfig as p } from "../../../../../composables/useConfig.js";
|
|
5
5
|
import { ModificationDescription as y } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
6
|
import { CommonControl as N } from "../../../common-control.js";
|
|
7
|
-
import {
|
|
7
|
+
import { RRS_CONFIG_VERSION as _, DEFAULT_NODE_CONFIG as a } from "../../constants/defaultConfig.js";
|
|
8
8
|
import { RECOMMENDATION_ID_ATTR as I } from "../../constants/selectors.js";
|
|
9
9
|
import { RecommendationConfigService as l } from "../../services/configService.js";
|
|
10
10
|
import { useRecommendationExtensionStore as R } from "../../store/recommendation.js";
|
|
@@ -4,7 +4,7 @@ var r = (o, n, t) => S(o, typeof n != "symbol" ? n + "" : n, t);
|
|
|
4
4
|
import { ACADEMY_LINKS as _ } from "../../../../../enums/academy.js";
|
|
5
5
|
import { useOnboardingStore as f } from "../../../../../stores/onboarding.js";
|
|
6
6
|
import { CommonControl as v } from "../../../common-control.js";
|
|
7
|
-
import {
|
|
7
|
+
import { RRS_CONFIG_VERSION as b } from "../../constants/defaultConfig.js";
|
|
8
8
|
import { RecommendationConfigService as h } from "../../services/configService.js";
|
|
9
9
|
import { useRecommendationExtensionStore as C } from "../../store/recommendation.js";
|
|
10
10
|
const k = "recommendation-strategy-control";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { getRecommendationFeedSourceMaps as k, strategyEditPath as G, URLS as D, getOperatorOptions as _, PriceAttributes as
|
|
2
|
-
import { useRecommendationApi as
|
|
1
|
+
import { getRecommendationFeedSourceMaps as k, strategyEditPath as G, URLS as D, getOperatorOptions as _, PriceAttributes as N } from "../../../../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { useRecommendationApi as U } from "../../../../services/recommendationApi.js";
|
|
3
3
|
import { useConfigStore as F } from "../../../../stores/config.js";
|
|
4
|
-
import { defineStore as
|
|
4
|
+
import { defineStore as A } from "pinia";
|
|
5
5
|
import "../constants/selectors.js";
|
|
6
|
-
import { DEFAULT_MOBILE_CARDS_IN_ROW as
|
|
6
|
+
import { DEFAULT_MOBILE_CARDS_IN_ROW as L, DEFAULT_CARDS_IN_ROW as E } from "../constants/layout.js";
|
|
7
7
|
import { DEFAULT_NODE_CONFIG as x, EXCLUDED_ALGORITHM_IDS as B } from "../constants/defaultConfig.js";
|
|
8
8
|
import { getDefaultProducts as C } from "../templates/utils.js";
|
|
9
9
|
import { generateCompleteFilterQuery as v } from "../utils/filterUtil.js";
|
|
@@ -11,13 +11,13 @@ import { getPartnerRecommendationParams as M } from "../utils/partnerCustomizati
|
|
|
11
11
|
import { sanitizeProductIds as O } from "../utils/productIds.js";
|
|
12
12
|
import { isFilterValid as T } from "../validation/filterSchema.js";
|
|
13
13
|
import { getInvalidFields as z, isConfigValid as V } from "../validation/requiredFields.js";
|
|
14
|
-
const d =
|
|
14
|
+
const d = U();
|
|
15
15
|
let h = null, g = null, S = null, p = null, y = 0;
|
|
16
16
|
const b = /* @__PURE__ */ new Map();
|
|
17
17
|
let l = null;
|
|
18
18
|
function P() {
|
|
19
19
|
return {
|
|
20
|
-
cardsInRow:
|
|
20
|
+
cardsInRow: E,
|
|
21
21
|
currencySettings: {
|
|
22
22
|
name: "USD",
|
|
23
23
|
value: "USD",
|
|
@@ -31,7 +31,7 @@ function P() {
|
|
|
31
31
|
productIds: [],
|
|
32
32
|
id: 1,
|
|
33
33
|
language: "en_US",
|
|
34
|
-
mobileCardsInRow:
|
|
34
|
+
mobileCardsInRow: L,
|
|
35
35
|
mobileLayoutEnabled: !1,
|
|
36
36
|
orientation: "grid",
|
|
37
37
|
recommendedProducts: [],
|
|
@@ -79,7 +79,7 @@ const j = () => ({
|
|
|
79
79
|
currentRecommendationId: null,
|
|
80
80
|
strategyPanelOpen: !1,
|
|
81
81
|
configVersion: 0
|
|
82
|
-
}), it =
|
|
82
|
+
}), it = A("guidoRecommendationExtension", {
|
|
83
83
|
state: () => j(),
|
|
84
84
|
getters: {
|
|
85
85
|
// ====================================================================
|
|
@@ -164,7 +164,7 @@ const j = () => ({
|
|
|
164
164
|
getFilterList() {
|
|
165
165
|
return Object.values(this.filterList).filter((t) => t.isFilterable !== 0 && t.isFilterable !== !1).map((t) => {
|
|
166
166
|
let e;
|
|
167
|
-
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` :
|
|
167
|
+
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : N.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
|
|
168
168
|
text: t.displayName,
|
|
169
169
|
value: e,
|
|
170
170
|
type: t.attributeType
|
|
@@ -353,22 +353,27 @@ const j = () => ({
|
|
|
353
353
|
this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId] || (this.blockStates[this.currentRecommendationId].removeStrategyModalStatus = !1);
|
|
354
354
|
},
|
|
355
355
|
async fetchStrategies() {
|
|
356
|
-
|
|
356
|
+
for (; p; )
|
|
357
|
+
try {
|
|
358
|
+
await p;
|
|
359
|
+
} catch {
|
|
360
|
+
}
|
|
361
|
+
if (this.strategiesFetched)
|
|
357
362
|
return;
|
|
358
|
-
const t = y
|
|
359
|
-
p = (async () => {
|
|
363
|
+
const t = y, e = (async () => {
|
|
360
364
|
this.strategiesLoading = !0;
|
|
361
365
|
try {
|
|
362
|
-
const
|
|
366
|
+
const r = await d.fetchRecommendationStrategies();
|
|
363
367
|
if (t !== y)
|
|
364
368
|
return;
|
|
365
|
-
this.strategies =
|
|
369
|
+
this.strategies = r, this.strategiesFetched = !0;
|
|
366
370
|
} finally {
|
|
367
371
|
this.strategiesLoading = !1, t === y && (this.strategiesSettled = !0);
|
|
368
372
|
}
|
|
369
373
|
})();
|
|
374
|
+
p = e;
|
|
370
375
|
try {
|
|
371
|
-
await
|
|
376
|
+
await e;
|
|
372
377
|
} finally {
|
|
373
378
|
p = null;
|
|
374
379
|
}
|
|
@@ -378,8 +383,9 @@ const j = () => ({
|
|
|
378
383
|
},
|
|
379
384
|
/**
|
|
380
385
|
* Opens a Smart Recommender strategy page in a new tab and refreshes the list every time
|
|
381
|
-
* the user comes back. `visibilitychange`
|
|
382
|
-
*
|
|
386
|
+
* the user comes back. `visibilitychange` only: a `focus` listener would also fire when
|
|
387
|
+
* focus merely returns from the Stripo canvas iframe to the panel, refetching and
|
|
388
|
+
* regenerating the canvas while the user never left the editor (SD-149916).
|
|
383
389
|
*
|
|
384
390
|
* Deliberately NOT one-shot: the strategy tab stays open, so a user can create a second
|
|
385
391
|
* strategy in it and come back again — a listener that disarmed on the first return would
|
|
@@ -389,7 +395,9 @@ const j = () => ({
|
|
|
389
395
|
*/
|
|
390
396
|
_armStrategyPageReturn(t) {
|
|
391
397
|
const e = window.open(t, "_blank");
|
|
392
|
-
|
|
398
|
+
if (!e)
|
|
399
|
+
return;
|
|
400
|
+
e.opener = null, l == null || l();
|
|
393
401
|
let r = !1;
|
|
394
402
|
const i = () => {
|
|
395
403
|
document.hidden || r || (e != null && e.closed && (l == null || l()), r = !0, this.invalidateStrategies(), this.fetchStrategies().then(() => this._refreshAssignedStrategyProducts()).catch(() => {
|
|
@@ -397,8 +405,8 @@ const j = () => ({
|
|
|
397
405
|
r = !1;
|
|
398
406
|
}));
|
|
399
407
|
};
|
|
400
|
-
document.addEventListener("visibilitychange", i),
|
|
401
|
-
document.removeEventListener("visibilitychange", i),
|
|
408
|
+
document.addEventListener("visibilitychange", i), l = () => {
|
|
409
|
+
document.removeEventListener("visibilitychange", i), l = null;
|
|
402
410
|
};
|
|
403
411
|
},
|
|
404
412
|
/**
|
|
@@ -448,7 +456,11 @@ const j = () => ({
|
|
|
448
456
|
});
|
|
449
457
|
},
|
|
450
458
|
removeStrategy() {
|
|
451
|
-
this.patchCurrentBlockConfig({
|
|
459
|
+
this.patchCurrentBlockConfig({
|
|
460
|
+
strategyId: "",
|
|
461
|
+
strategy: "",
|
|
462
|
+
size: x.size
|
|
463
|
+
});
|
|
452
464
|
},
|
|
453
465
|
// ====================================================================
|
|
454
466
|
// Shared Data Fetching (fetched once, used by all blocks)
|
|
@@ -604,7 +616,7 @@ const j = () => ({
|
|
|
604
616
|
this._setBlockProducts(t, [], s);
|
|
605
617
|
return;
|
|
606
618
|
}
|
|
607
|
-
const n = r.filters.filter((
|
|
619
|
+
const n = r.filters.filter((m) => m.isValid), o = v(n), c = ((f = k().find((m) => m.key === r.strategy)) == null ? void 0 : f.path) || "", a = {
|
|
608
620
|
locale: r.language,
|
|
609
621
|
currency: r.currencySettings.value,
|
|
610
622
|
partnerName: i.partnerName,
|
|
@@ -616,13 +628,13 @@ const j = () => ({
|
|
|
616
628
|
a,
|
|
617
629
|
M(i.partnerName, r.strategy)
|
|
618
630
|
);
|
|
619
|
-
let
|
|
631
|
+
let u;
|
|
620
632
|
try {
|
|
621
|
-
|
|
633
|
+
u = await d.fetchRecommendationProducts(c, a);
|
|
622
634
|
} catch {
|
|
623
|
-
|
|
635
|
+
u = [];
|
|
624
636
|
}
|
|
625
|
-
this._setBlockProducts(t,
|
|
637
|
+
this._setBlockProducts(t, u, s);
|
|
626
638
|
},
|
|
627
639
|
async _doFetchStrategyProducts(t) {
|
|
628
640
|
const e = (b.get(t) ?? 0) + 1;
|
|
@@ -636,7 +648,7 @@ const j = () => ({
|
|
|
636
648
|
);
|
|
637
649
|
if (n) {
|
|
638
650
|
s = parseInt(String(n.size ?? "")) || s;
|
|
639
|
-
const o = r.currencySettings.value, a = (await this.resolveStrategyUrlTemplate(n, o)).replaceAll("{locale}", r.language).replaceAll("{currency}", o),
|
|
651
|
+
const o = r.currencySettings.value, a = (await this.resolveStrategyUrlTemplate(n, o)).replaceAll("{locale}", r.language).replaceAll("{currency}", o), u = a.indexOf("?"), f = u === -1 ? a : a.slice(0, u), m = (u === -1 ? "" : a.slice(u + 1)).split("&").filter((R) => R && !R.startsWith("user_id=")), I = m.length ? `${f}?${m.join("&")}` : f;
|
|
640
652
|
I && (i = await d.fetchRecommendationProductsByUrl(I));
|
|
641
653
|
}
|
|
642
654
|
} catch {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import type { RecommendationNodeConfig, CurrencyConfig, OmnibusTextConfig } from '../types/nodeConfig';
|
|
11
11
|
export declare const PRE_RRS_CONFIG_VERSION = 1;
|
|
12
12
|
export declare const CURRENT_CONFIG_VERSION = 2;
|
|
13
|
+
export declare const RRS_CONFIG_VERSION = 2;
|
|
13
14
|
/**
|
|
14
15
|
* Default currency configuration
|
|
15
16
|
* Uses USD as the base currency with standard formatting
|
|
@@ -10,4 +10,4 @@ export { RecommendationBlockId } from './blockIds';
|
|
|
10
10
|
export { RecommendationControlId } from './controlIds';
|
|
11
11
|
export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON, CSS_CLASS_SKIP_COMPILE, RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_RECOMMENDATION_TITLE, SELECTOR_TITLE_CELL, ATTR_CUSTOM_PREFIX, ATTR_DATA_CARD_COMPOSITION, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, CSS_CLASS_ATTRIBUTE_ROW, CSS_CLASS_SPACER, SELECTOR_ATTRIBUTE_ROW, ATTR_DATA_ATTRIBUTE_TYPE, ATTR_DATA_VISIBILITY, PRODUCT_ATTRIBUTE_PREFIX, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
|
|
12
12
|
export { LAYOUT_VALUES, LAYOUT_OPTIONS, DEFAULT_PRODUCTS_PER_ROW, DEFAULT_CARDS_IN_ROW, DEFAULT_MOBILE_CARDS_IN_ROW, MAX_PRODUCT_COUNT, MIN_PRODUCT_COUNT, MAX_PRODUCTS_PER_ROW, MIN_PRODUCTS_PER_ROW, MAX_MOBILE_PRODUCTS_PER_ROW, MIN_MOBILE_PRODUCTS_PER_ROW, DEFAULT_COLUMN_SPACING, DEFAULT_ROW_SPACING, DEFAULT_MOBILE_COLUMN_SPACING, DEFAULT_MOBILE_ROW_SPACING, MIN_SPACING, MAX_SPACING, SPACING_STEP, } from './layout';
|
|
13
|
-
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, PRE_RRS_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
13
|
+
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, PRE_RRS_CONFIG_VERSION, RRS_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
@@ -472,8 +472,9 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
472
472
|
invalidateStrategies(): void;
|
|
473
473
|
/**
|
|
474
474
|
* Opens a Smart Recommender strategy page in a new tab and refreshes the list every time
|
|
475
|
-
* the user comes back. `visibilitychange`
|
|
476
|
-
*
|
|
475
|
+
* the user comes back. `visibilitychange` only: a `focus` listener would also fire when
|
|
476
|
+
* focus merely returns from the Stripo canvas iframe to the panel, refetching and
|
|
477
|
+
* regenerating the canvas while the user never left the editor (SD-149916).
|
|
477
478
|
*
|
|
478
479
|
* Deliberately NOT one-shot: the strategy tab stays open, so a user can create a second
|
|
479
480
|
* strategy in it and come back again — a listener that disarmed on the first return would
|
|
@@ -68,23 +68,6 @@ const n = `.strategy-control-header {
|
|
|
68
68
|
line-height: 24px;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
/*
|
|
72
|
-
* Mirrors the design system's InSkeleton 1:1 (gradient stops, 200% size, 1.6s linear).
|
|
73
|
-
* The Stripo panel lives in the editor's shadow root and is built from raw HTML strings,
|
|
74
|
-
* so the Vue component cannot be used there. Hex values are literal in the DS too.
|
|
75
|
-
*/
|
|
76
|
-
.guido-skeleton {
|
|
77
|
-
display: none;
|
|
78
|
-
border-radius: 4px;
|
|
79
|
-
background: linear-gradient(90deg, #f0f0f0 39.5%, #e1e1e1 66.02%, #f0f0f0 89.42%);
|
|
80
|
-
background-size: 200% 100%;
|
|
81
|
-
animation: guido-skeleton-shine 1.6s linear infinite;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@keyframes guido-skeleton-shine {
|
|
85
|
-
to { background-position-x: -200%; }
|
|
86
|
-
}
|
|
87
|
-
|
|
88
71
|
/* Each skeleton mirrors the footprint of the element it stands in for, so retiring
|
|
89
72
|
the loading state does not shift the panel. */
|
|
90
73
|
.guido-skeleton--strategy-title {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const e = `/*
|
|
2
|
+
* Mirrors the design system's InSkeleton 1:1 (gradient stops, 200% size, 1.6s linear).
|
|
3
|
+
* The Stripo panel lives in the editor's shadow root and is built from raw HTML strings,
|
|
4
|
+
* so the Vue component cannot be used there. Hex values are literal in the DS too.
|
|
5
|
+
*
|
|
6
|
+
* Base only: each panel sizes its own \`.guido-skeleton--*\` modifier to the footprint of
|
|
7
|
+
* the element it stands in for.
|
|
8
|
+
*/
|
|
9
|
+
.guido-skeleton {
|
|
10
|
+
display: none;
|
|
11
|
+
border-radius: 4px;
|
|
12
|
+
background: linear-gradient(90deg, #f0f0f0 39.5%, #e1e1e1 66.02%, #f0f0f0 89.42%);
|
|
13
|
+
background-size: 200% 100%;
|
|
14
|
+
animation: guido-skeleton-shine 1.6s linear infinite;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@keyframes guido-skeleton-shine {
|
|
18
|
+
to { background-position-x: -200%; }
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
21
|
+
export {
|
|
22
|
+
e as default
|
|
23
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { useActionsApi as R } from "../composables/useActionsApi.js";
|
|
2
2
|
import { useConfig as k } from "../composables/useConfig.js";
|
|
3
3
|
import { useHtmlCompiler as N } from "../composables/useHtmlCompiler.js";
|
|
4
|
-
import {
|
|
4
|
+
import { RRS_CONFIG_VERSION as U, DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
5
5
|
import { useRecommendationExtensionStore as T } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
6
|
import { mapLegacyStrategy as x } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
7
|
-
import { DATA_ATTRIBUTES as
|
|
7
|
+
import { DATA_ATTRIBUTES as C } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
8
8
|
import { parsePageList as L } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
9
9
|
import { useDynamicContentStore as z } from "../stores/dynamic-content.js";
|
|
10
10
|
import { useEditorStore as _ } from "../stores/editor.js";
|
|
11
11
|
import { useUnsubscribeStore as O } from "../stores/unsubscribe.js";
|
|
12
12
|
import { assignTrackingIds as v } from "./linkTrackingIds.js";
|
|
13
13
|
function B(m) {
|
|
14
|
-
const i = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${
|
|
14
|
+
const i = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${C.PAGE_LIST}]`), t = [];
|
|
15
15
|
return i.forEach((s) => {
|
|
16
|
-
const r = s.getAttribute(
|
|
16
|
+
const r = s.getAttribute(C.PAGE_LIST);
|
|
17
17
|
r && t.push(...L(r));
|
|
18
18
|
}), [...new Set(t)];
|
|
19
19
|
}
|
|
@@ -85,19 +85,19 @@ const ee = () => {
|
|
|
85
85
|
resetDataSavedFlag: !1
|
|
86
86
|
});
|
|
87
87
|
n.selectedUnsubscribePages.length && await n.fetchTemplates(), await G(o);
|
|
88
|
-
const { compiledHtml: I, stats: S, appliedRules:
|
|
88
|
+
const { compiledHtml: I, stats: S, appliedRules: w } = r(f), D = c && p(c).compiledHtml, E = m.getSelectedDynamicContentList, F = T(), A = B(o);
|
|
89
89
|
return console.debug("HTML Compilation Stats:", {
|
|
90
90
|
originalSize: S.originalSize,
|
|
91
91
|
compiledSize: S.compiledSize,
|
|
92
92
|
reduction: `${S.reductionPercentage.toFixed(2)}%`,
|
|
93
|
-
appliedRules:
|
|
93
|
+
appliedRules: w,
|
|
94
94
|
executionTime: `${S.executionTime.toFixed(2)}ms`
|
|
95
95
|
}), {
|
|
96
|
-
dynamicContentList:
|
|
96
|
+
dynamicContentList: E,
|
|
97
97
|
compiledHtml: I,
|
|
98
98
|
rawHtml: o,
|
|
99
99
|
css: l,
|
|
100
|
-
ampHtml:
|
|
100
|
+
ampHtml: D,
|
|
101
101
|
ampErrors: y,
|
|
102
102
|
modules: g.map(Number),
|
|
103
103
|
recommendation: {
|
|
@@ -105,8 +105,8 @@ const ee = () => {
|
|
|
105
105
|
configs: {}
|
|
106
106
|
},
|
|
107
107
|
unsubscribe: {
|
|
108
|
-
status:
|
|
109
|
-
config:
|
|
108
|
+
status: A.length > 0,
|
|
109
|
+
config: A
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.18.1-beta.
|
|
3
|
+
"version": "3.18.1-beta.12053dd",
|
|
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",
|