@useinsider/guido 3.18.1-beta.e489d08 → 3.18.1-beta.e609a33
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/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +30 -30
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +11 -13
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +53 -65
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -20
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +34 -34
- package/dist/composables/useCustomInterfaceAppearance.js +41 -46
- package/dist/composables/useHtmlValidator.js +79 -84
- package/dist/composables/useHttp.js +24 -22
- package/dist/composables/useRecommendation.js +18 -21
- package/dist/composables/useStripo.js +7 -7
- package/dist/enums/extensions/recommendationBlock.js +31 -38
- package/dist/extensions/Blocks/Recommendation/block.js +39 -43
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +57 -62
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -80
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +73 -150
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -21
- package/dist/guido.css +1 -1
- package/dist/services/templateLibraryApi.js +39 -37
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -9
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -61
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -4
- package/dist/src/stores/onboarding.d.ts +0 -377
- package/dist/static/styles/components/recommendation-strategy.css.js +4 -51
- package/dist/stores/onboarding.js +36 -41
- package/dist/utils/templatePreparation.js +50 -50
- package/package.json +1 -1
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +0 -47
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +0 -2
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useHtmlCompiler as
|
|
4
|
-
import {
|
|
5
|
-
import { useRecommendationExtensionStore as
|
|
6
|
-
import { mapLegacyStrategy as
|
|
1
|
+
import { useActionsApi as k } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useConfig as U } from "../composables/useConfig.js";
|
|
3
|
+
import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
|
|
4
|
+
import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
5
|
+
import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
|
+
import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
7
7
|
import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
8
|
-
import { parsePageList as
|
|
9
|
-
import { useDynamicContentStore as
|
|
10
|
-
import { useEditorStore as
|
|
11
|
-
import { useUnsubscribeStore as
|
|
8
|
+
import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
9
|
+
import { useDynamicContentStore as N } from "../stores/dynamic-content.js";
|
|
10
|
+
import { useEditorStore as z } from "../stores/editor.js";
|
|
11
|
+
import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
|
|
12
12
|
import { assignTrackingIds as v } from "./linkTrackingIds.js";
|
|
13
|
-
function
|
|
13
|
+
function O(m) {
|
|
14
14
|
const i = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
|
|
15
15
|
return i.forEach((s) => {
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
const o = s.getAttribute(A.PAGE_LIST);
|
|
17
|
+
o && t.push(...R(o));
|
|
18
18
|
}), [...new Set(t)];
|
|
19
19
|
}
|
|
20
|
-
async function
|
|
20
|
+
async function M(m) {
|
|
21
21
|
const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
22
22
|
if (n.length === 0)
|
|
23
23
|
return;
|
|
24
|
-
const i =
|
|
24
|
+
const i = C();
|
|
25
25
|
n.forEach((t) => {
|
|
26
|
-
var l, g, f, c
|
|
27
|
-
const s = t.getAttribute("recommendation-id"),
|
|
28
|
-
if (!Number.isFinite(
|
|
26
|
+
var r, l, g, f, c;
|
|
27
|
+
const s = t.getAttribute("recommendation-id"), o = s ? Number(s) : NaN;
|
|
28
|
+
if (!Number.isFinite(o))
|
|
29
29
|
return;
|
|
30
30
|
const p = t.getAttribute("esd-ext-config");
|
|
31
31
|
if (!p)
|
|
@@ -38,11 +38,11 @@ async function G(m) {
|
|
|
38
38
|
}
|
|
39
39
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
40
40
|
return;
|
|
41
|
-
const
|
|
41
|
+
const h = {
|
|
42
42
|
// Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
|
|
43
43
|
// already-saved blocks that never re-run the migrator don't emit a
|
|
44
44
|
// strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
|
|
45
|
-
strategy:
|
|
45
|
+
strategy: L(e.strategy) || a.strategy,
|
|
46
46
|
strategyId: e.strategyId ?? a.strategyId,
|
|
47
47
|
language: e.language ?? a.language,
|
|
48
48
|
size: e.size ?? a.size,
|
|
@@ -51,13 +51,13 @@ async function G(m) {
|
|
|
51
51
|
productIds: e.productIds ?? [...a.productIds],
|
|
52
52
|
filters: e.filters ?? [...a.filters],
|
|
53
53
|
shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
|
|
54
|
-
currencyCode: ((
|
|
55
|
-
currencyAlignment: ((
|
|
56
|
-
currencyDecimalCount: ((
|
|
57
|
-
currencyDecimalSeparator: ((
|
|
58
|
-
currencyThousandSeparator: ((
|
|
54
|
+
currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? d.code,
|
|
55
|
+
currencyAlignment: ((l = e.currency) == null ? void 0 : l.alignment) ?? d.alignment,
|
|
56
|
+
currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? d.decimalCount,
|
|
57
|
+
currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? d.decimalSeparator,
|
|
58
|
+
currencyThousandSeparator: ((c = e.currency) == null ? void 0 : c.thousandSeparator) ?? d.thousandSeparator
|
|
59
59
|
};
|
|
60
|
-
i.seedBlockUrlConfig(
|
|
60
|
+
i.seedBlockUrlConfig(o, h);
|
|
61
61
|
});
|
|
62
62
|
try {
|
|
63
63
|
await i.fetchRecommendationCreateData();
|
|
@@ -68,51 +68,51 @@ async function G(m) {
|
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
const
|
|
72
|
-
const m =
|
|
71
|
+
const Z = () => {
|
|
72
|
+
const m = N(), u = z(), n = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
|
|
73
73
|
return {
|
|
74
74
|
prepareTemplateDetails: async () => {
|
|
75
|
-
let { html:
|
|
75
|
+
let { html: r, css: l, syncModulesIds: g = [] } = await t();
|
|
76
76
|
if (e("linkTrackingIds"))
|
|
77
77
|
try {
|
|
78
|
-
const { html:
|
|
79
|
-
u.trackIdSessionFloor = H,
|
|
80
|
-
} catch (
|
|
81
|
-
console.error("Tracking-id step failed, saving anyway:",
|
|
78
|
+
const { html: S, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
|
|
79
|
+
u.trackIdSessionFloor = H, F && (r = S, await s(S, l));
|
|
80
|
+
} catch (S) {
|
|
81
|
+
console.error("Tracking-id step failed, saving anyway:", S);
|
|
82
82
|
}
|
|
83
|
-
const { html: f, ampHtml: c = "", ampErrors:
|
|
83
|
+
const { html: f, ampHtml: c = "", ampErrors: T = [] } = await i({
|
|
84
84
|
minimize: !0,
|
|
85
85
|
resetDataSavedFlag: !1
|
|
86
86
|
});
|
|
87
|
-
n.selectedUnsubscribePages.length && await n.fetchTemplates(), await
|
|
88
|
-
const { compiledHtml: I, stats:
|
|
87
|
+
n.selectedUnsubscribePages.length && await n.fetchTemplates(), await M(r);
|
|
88
|
+
const { compiledHtml: I, stats: y, appliedRules: w } = o(f), D = c && p(c).compiledHtml, E = m.getSelectedDynamicContentList, P = C(), b = O(r);
|
|
89
89
|
return console.debug("HTML Compilation Stats:", {
|
|
90
|
-
originalSize:
|
|
91
|
-
compiledSize:
|
|
92
|
-
reduction: `${
|
|
93
|
-
appliedRules:
|
|
94
|
-
executionTime: `${
|
|
90
|
+
originalSize: y.originalSize,
|
|
91
|
+
compiledSize: y.compiledSize,
|
|
92
|
+
reduction: `${y.reductionPercentage.toFixed(2)}%`,
|
|
93
|
+
appliedRules: w,
|
|
94
|
+
executionTime: `${y.executionTime.toFixed(2)}ms`
|
|
95
95
|
}), {
|
|
96
|
-
dynamicContentList:
|
|
96
|
+
dynamicContentList: E,
|
|
97
97
|
compiledHtml: I,
|
|
98
|
-
rawHtml:
|
|
98
|
+
rawHtml: r,
|
|
99
99
|
css: l,
|
|
100
|
-
ampHtml:
|
|
101
|
-
ampErrors:
|
|
100
|
+
ampHtml: D,
|
|
101
|
+
ampErrors: T,
|
|
102
102
|
modules: g.map(Number),
|
|
103
103
|
recommendation: {
|
|
104
|
-
campaignUrls:
|
|
104
|
+
campaignUrls: P.recommendationCampaignUrls,
|
|
105
105
|
configs: {}
|
|
106
106
|
},
|
|
107
107
|
unsubscribe: {
|
|
108
|
-
status:
|
|
109
|
-
config:
|
|
108
|
+
status: b.length > 0,
|
|
109
|
+
config: b
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
114
|
};
|
|
115
115
|
export {
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
O as getHtmlReferencedUnsubscribePages,
|
|
117
|
+
Z as useTemplatePreparation
|
|
118
118
|
};
|
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.e609a33",
|
|
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",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import d from "./RecommendationStrategyOnboarding.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import g from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var m = function() {
|
|
5
|
-
var e, n, r, i, a;
|
|
6
|
-
var t = this, s = t._self._c, o = t._self._setupProxy;
|
|
7
|
-
return o.isVisible ? s(o.InOnboard, { key: "guido__recommendation-strategy-onboard", staticClass: "w-21-s p-a z-11", class: (e = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__recommendation-strategy-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "left-position": (n = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : n.left, "pages-config": o.onboardingStore.onboardings.recommendationStrategyOnboarding.config, "pointer-position": (r = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : r.position, "right-position": (i = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : i.right, "top-position": (a = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : a.top }, on: { close: function(p) {
|
|
8
|
-
return o.onboardingStore.close(o.ONBOARDING_TYPE);
|
|
9
|
-
}, nextButtonClick: o.handleNext } }) : t._e();
|
|
10
|
-
}, c = [], _ = /* @__PURE__ */ g(
|
|
11
|
-
d,
|
|
12
|
-
m,
|
|
13
|
-
c,
|
|
14
|
-
!1,
|
|
15
|
-
null,
|
|
16
|
-
"ec2027ff"
|
|
17
|
-
);
|
|
18
|
-
const S = _.exports;
|
|
19
|
-
export {
|
|
20
|
-
S as default
|
|
21
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { defineComponent as g, computed as p, watch as b } from "vue";
|
|
2
|
-
import { useRibbonOffset as u } from "../../../composables/useRibbonOffset.js";
|
|
3
|
-
import { useTranslations as l } from "../../../composables/useTranslations.js";
|
|
4
|
-
import { ACADEMY_LINKS as f } from "../../../enums/academy.js";
|
|
5
|
-
import { useRecommendationExtensionStore as O } from "../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
|
-
import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
|
|
7
|
-
import { InOnboard as y } from "@useinsider/design-system-vue";
|
|
8
|
-
const h = /* @__PURE__ */ g({
|
|
9
|
-
__name: "RecommendationStrategyOnboarding",
|
|
10
|
-
setup(C) {
|
|
11
|
-
const n = "recommendationStrategyOnboarding", e = l(), t = _(), i = O(), { getTopPosition: r } = u(), a = `<a href="${f.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${e("action-builder.visit-academy")}</a>`, m = () => [
|
|
12
|
-
{
|
|
13
|
-
classes: "guido-recommendation-strategy-onboarding",
|
|
14
|
-
// Sits in the gap left of the settings panel and points at the strategy section, which
|
|
15
|
-
// starts 208px down: the panel header and its tab row are fixed chrome above it.
|
|
16
|
-
right: "426px",
|
|
17
|
-
top: r(208),
|
|
18
|
-
position: "Right Top",
|
|
19
|
-
title: e("email-editor.onboarding-recommendation-strategy-title"),
|
|
20
|
-
description: e("email-editor.onboarding-recommendation-strategy-description", {
|
|
21
|
-
academyLink: a
|
|
22
|
-
}),
|
|
23
|
-
imageSource: "",
|
|
24
|
-
backButtonClick: () => {
|
|
25
|
-
},
|
|
26
|
-
nextButtonType: "text",
|
|
27
|
-
nextButtonText: e("action-builder.ok"),
|
|
28
|
-
nextButtonClick: () => {
|
|
29
|
-
t.close(n);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
], c = p(() => i.strategyPanelOpen && t.onboardings.recommendationStrategyOnboarding.config.length > 0 && t.onboardings.recommendationStrategyOnboarding.isActive), d = () => {
|
|
33
|
-
var o, s;
|
|
34
|
-
(s = (o = t.getRecommendationStrategyCurrentCard) == null ? void 0 : o.nextButtonClick) == null || s.call(o);
|
|
35
|
-
};
|
|
36
|
-
return b(
|
|
37
|
-
() => t.isActive(n),
|
|
38
|
-
(o) => {
|
|
39
|
-
o && t.setConfig(n, m());
|
|
40
|
-
},
|
|
41
|
-
{ immediate: !0 }
|
|
42
|
-
), { __sfc: !0, ONBOARDING_TYPE: n, trans: e, onboardingStore: t, recommendationStore: i, getTopPosition: r, academyLink: a, buildOnboardingCards: m, isVisible: c, handleNext: d, InOnboard: y };
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
export {
|
|
46
|
-
h as default
|
|
47
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|