@useinsider/guido 3.18.1-beta.280b4e1 → 3.18.1-beta.2e195ed
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 +13 -11
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +65 -53
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +20 -18
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +47 -0
- package/dist/composables/useCustomInterfaceAppearance.js +56 -48
- package/dist/composables/useHtmlValidator.js +84 -79
- package/dist/composables/useRecommendation.js +21 -18
- package/dist/composables/useStripo.js +30 -30
- package/dist/enums/extensions/recommendationBlock.js +38 -31
- package/dist/extensions/Blocks/Recommendation/block.js +43 -39
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +62 -57
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +84 -52
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +165 -78
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
- package/dist/guido.css +1 -1
- package/dist/library.js +13 -15
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +74 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
- package/dist/src/library.d.ts +0 -2
- package/dist/src/public/trackingIds.d.ts +2 -6
- package/dist/src/stores/guido-email-editor.d.ts +27 -27
- package/dist/src/stores/onboarding.d.ts +377 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +51 -4
- package/dist/stores/guido-email-editor.js +4 -0
- package/dist/stores/onboarding.js +41 -36
- package/dist/utils/templatePreparation.js +50 -50
- package/package.json +1 -5
- package/dist/public/editorState.js +0 -4
- package/dist/src/public/editorState.d.ts +0 -14
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useOnboardingApi as
|
|
2
|
-
import { defineStore as
|
|
1
|
+
import { useOnboardingApi as e } from "../services/onboardingApi.js";
|
|
2
|
+
import { defineStore as s } from "pinia";
|
|
3
3
|
const t = () => ({
|
|
4
4
|
cardIndex: 0,
|
|
5
5
|
isActive: !1,
|
|
@@ -11,49 +11,54 @@ const t = () => ({
|
|
|
11
11
|
textBlockOnboarding: t(),
|
|
12
12
|
versionHistoryOnboarding: t(),
|
|
13
13
|
ampOnboarding: t(),
|
|
14
|
-
itemsOnboarding: t()
|
|
14
|
+
itemsOnboarding: t(),
|
|
15
|
+
recommendationStrategyOnboarding: t()
|
|
15
16
|
},
|
|
16
17
|
userModalState: {},
|
|
17
18
|
isFetched: !1
|
|
18
|
-
}), c =
|
|
19
|
+
}), c = s("guidoOnboarding", {
|
|
19
20
|
state: () => a(),
|
|
20
21
|
getters: {
|
|
21
|
-
getOnboarding: (n) => (
|
|
22
|
-
isActive: (n) => (
|
|
23
|
-
getCurrentCard: (n) => (
|
|
24
|
-
const
|
|
25
|
-
return
|
|
22
|
+
getOnboarding: (n) => (o) => n.onboardings[o],
|
|
23
|
+
isActive: (n) => (o) => n.onboardings[o].isActive,
|
|
24
|
+
getCurrentCard: (n) => (o) => {
|
|
25
|
+
const i = n.onboardings[o];
|
|
26
|
+
return i.config[i.cardIndex];
|
|
26
27
|
},
|
|
27
28
|
getGenericCurrentCard: (n) => {
|
|
28
|
-
const { genericOnboarding:
|
|
29
|
-
return
|
|
29
|
+
const { genericOnboarding: o } = n.onboardings;
|
|
30
|
+
return o.config[o.cardIndex];
|
|
30
31
|
},
|
|
31
32
|
getTextBlockCurrentCard: (n) => {
|
|
32
|
-
const { textBlockOnboarding:
|
|
33
|
-
return
|
|
33
|
+
const { textBlockOnboarding: o } = n.onboardings;
|
|
34
|
+
return o.config[o.cardIndex];
|
|
34
35
|
},
|
|
35
36
|
getVersionHistoryCurrentCard: (n) => {
|
|
36
|
-
const { versionHistoryOnboarding:
|
|
37
|
-
return
|
|
37
|
+
const { versionHistoryOnboarding: o } = n.onboardings;
|
|
38
|
+
return o.config[o.cardIndex];
|
|
38
39
|
},
|
|
39
40
|
getAmpCurrentCard: (n) => {
|
|
40
|
-
const { ampOnboarding:
|
|
41
|
-
return
|
|
41
|
+
const { ampOnboarding: o } = n.onboardings;
|
|
42
|
+
return o.config[o.cardIndex];
|
|
42
43
|
},
|
|
43
44
|
getItemsCurrentCard: (n) => {
|
|
44
|
-
const { itemsOnboarding:
|
|
45
|
-
return
|
|
45
|
+
const { itemsOnboarding: o } = n.onboardings;
|
|
46
|
+
return o.config[o.cardIndex];
|
|
47
|
+
},
|
|
48
|
+
getRecommendationStrategyCurrentCard: (n) => {
|
|
49
|
+
const { recommendationStrategyOnboarding: o } = n.onboardings;
|
|
50
|
+
return o.config[o.cardIndex];
|
|
46
51
|
},
|
|
47
|
-
shouldShowOnboarding: (n) => (
|
|
48
|
-
const
|
|
49
|
-
return
|
|
52
|
+
shouldShowOnboarding: (n) => (o) => {
|
|
53
|
+
const i = n.userModalState.Guido;
|
|
54
|
+
return o === "newVersionPopup" && (i != null && i.genericOnboarding) ? !1 : i ? !i[o] : !0;
|
|
50
55
|
}
|
|
51
56
|
},
|
|
52
57
|
actions: {
|
|
53
58
|
closeOtherOnboardings(n) {
|
|
54
|
-
Object.keys(this.onboardings).forEach((
|
|
55
|
-
const
|
|
56
|
-
|
|
59
|
+
Object.keys(this.onboardings).forEach((o) => {
|
|
60
|
+
const i = o;
|
|
61
|
+
i !== n && this.onboardings[i].isActive && (this.onboardings[i].isActive = !1, this.onboardings[i].cardIndex = 0, this.onboardings[i].config = []);
|
|
57
62
|
});
|
|
58
63
|
},
|
|
59
64
|
start(n) {
|
|
@@ -71,12 +76,12 @@ const t = () => ({
|
|
|
71
76
|
previous(n) {
|
|
72
77
|
this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
|
|
73
78
|
},
|
|
74
|
-
updateCardPosition(n,
|
|
75
|
-
const r = this.onboardings[n].config[
|
|
76
|
-
r && (r.top =
|
|
79
|
+
updateCardPosition(n, o, i) {
|
|
80
|
+
const r = this.onboardings[n].config[o];
|
|
81
|
+
r && (r.top = i.top, r.position = i.position);
|
|
77
82
|
},
|
|
78
|
-
setConfig(n,
|
|
79
|
-
this.onboardings[n].config =
|
|
83
|
+
setConfig(n, o) {
|
|
84
|
+
this.onboardings[n].config = o ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
|
|
80
85
|
},
|
|
81
86
|
async onDiscoverNowClicked() {
|
|
82
87
|
await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido"), this.start("genericOnboarding");
|
|
@@ -93,16 +98,16 @@ const t = () => ({
|
|
|
93
98
|
async fetchUserModalState() {
|
|
94
99
|
if (this.isFetched)
|
|
95
100
|
return;
|
|
96
|
-
const { fetchUserModalState: n } =
|
|
101
|
+
const { fetchUserModalState: n } = e();
|
|
97
102
|
try {
|
|
98
|
-
const
|
|
99
|
-
this.userModalState =
|
|
103
|
+
const o = await n();
|
|
104
|
+
this.userModalState = o, this.isFetched = !0;
|
|
100
105
|
} catch {
|
|
101
106
|
}
|
|
102
107
|
},
|
|
103
|
-
async setUserModalState(n,
|
|
104
|
-
const { setUserModalState: r } =
|
|
105
|
-
await r(n,
|
|
108
|
+
async setUserModalState(n, o, i) {
|
|
109
|
+
const { setUserModalState: r } = e();
|
|
110
|
+
await r(n, o, i), this.isFetched = !1, await this.fetchUserModalState();
|
|
106
111
|
}
|
|
107
112
|
}
|
|
108
113
|
});
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useHtmlCompiler as
|
|
4
|
-
import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
5
|
-
import { useRecommendationExtensionStore as
|
|
6
|
-
import { mapLegacyStrategy as
|
|
1
|
+
import { useActionsApi as R } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useConfig as k } from "../composables/useConfig.js";
|
|
3
|
+
import { useHtmlCompiler as N } from "../composables/useHtmlCompiler.js";
|
|
4
|
+
import { CURRENT_CONFIG_VERSION as U, DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
5
|
+
import { useRecommendationExtensionStore as T } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
|
+
import { mapLegacyStrategy as x } 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 L } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
9
|
+
import { useDynamicContentStore as z } from "../stores/dynamic-content.js";
|
|
10
|
+
import { useEditorStore as _ } from "../stores/editor.js";
|
|
11
|
+
import { useUnsubscribeStore as O } from "../stores/unsubscribe.js";
|
|
12
12
|
import { assignTrackingIds as v } from "./linkTrackingIds.js";
|
|
13
|
-
function
|
|
13
|
+
function B(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 r = s.getAttribute(A.PAGE_LIST);
|
|
17
|
+
r && t.push(...L(r));
|
|
18
18
|
}), [...new Set(t)];
|
|
19
19
|
}
|
|
20
|
-
async function
|
|
20
|
+
async function G(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 = T();
|
|
25
25
|
n.forEach((t) => {
|
|
26
|
-
var
|
|
27
|
-
const s = t.getAttribute("recommendation-id"),
|
|
28
|
-
if (!Number.isFinite(
|
|
26
|
+
var l, g, f, c, y;
|
|
27
|
+
const s = t.getAttribute("recommendation-id"), r = s ? Number(s) : NaN;
|
|
28
|
+
if (!Number.isFinite(r))
|
|
29
29
|
return;
|
|
30
30
|
const p = t.getAttribute("esd-ext-config");
|
|
31
31
|
if (!p)
|
|
@@ -38,11 +38,11 @@ async function M(m) {
|
|
|
38
38
|
}
|
|
39
39
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
40
40
|
return;
|
|
41
|
-
const
|
|
41
|
+
const b = !!e.strategyId || (e.configVersion ?? 0) >= U, o = {
|
|
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: x(e.strategy) || (b ? "" : 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 M(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: ((l = e.currency) == null ? void 0 : l.code) ?? d.code,
|
|
55
|
+
currencyAlignment: ((g = e.currency) == null ? void 0 : g.alignment) ?? d.alignment,
|
|
56
|
+
currencyDecimalCount: ((f = e.currency) == null ? void 0 : f.decimalCount) ?? d.decimalCount,
|
|
57
|
+
currencyDecimalSeparator: ((c = e.currency) == null ? void 0 : c.decimalSeparator) ?? d.decimalSeparator,
|
|
58
|
+
currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ?? d.thousandSeparator
|
|
59
59
|
};
|
|
60
|
-
i.seedBlockUrlConfig(
|
|
60
|
+
i.seedBlockUrlConfig(r, o);
|
|
61
61
|
});
|
|
62
62
|
try {
|
|
63
63
|
await i.fetchRecommendationCreateData();
|
|
@@ -68,51 +68,51 @@ async function M(m) {
|
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
const
|
|
72
|
-
const m =
|
|
71
|
+
const ee = () => {
|
|
72
|
+
const m = z(), u = _(), n = O(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = R(), { compileHtml: r, compileAmpHtml: p } = N(), { isFeatureEnabled: e } = k();
|
|
73
73
|
return {
|
|
74
74
|
prepareTemplateDetails: async () => {
|
|
75
|
-
let { html:
|
|
75
|
+
let { html: o, 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: h, changed: P, nextSeq: H } = v(o, u.trackIdSessionFloor);
|
|
79
|
+
u.trackIdSessionFloor = H, P && (o = h, await s(h, l));
|
|
80
|
+
} catch (h) {
|
|
81
|
+
console.error("Tracking-id step failed, saving anyway:", h);
|
|
82
82
|
}
|
|
83
|
-
const { html: f, ampHtml: c = "", ampErrors:
|
|
83
|
+
const { html: f, ampHtml: c = "", ampErrors: y = [] } = 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 G(o);
|
|
88
|
+
const { compiledHtml: I, stats: S, appliedRules: E } = r(f), w = c && p(c).compiledHtml, D = m.getSelectedDynamicContentList, F = T(), C = B(o);
|
|
89
89
|
return console.debug("HTML Compilation Stats:", {
|
|
90
|
-
originalSize:
|
|
91
|
-
compiledSize:
|
|
92
|
-
reduction: `${
|
|
93
|
-
appliedRules:
|
|
94
|
-
executionTime: `${
|
|
90
|
+
originalSize: S.originalSize,
|
|
91
|
+
compiledSize: S.compiledSize,
|
|
92
|
+
reduction: `${S.reductionPercentage.toFixed(2)}%`,
|
|
93
|
+
appliedRules: E,
|
|
94
|
+
executionTime: `${S.executionTime.toFixed(2)}ms`
|
|
95
95
|
}), {
|
|
96
|
-
dynamicContentList:
|
|
96
|
+
dynamicContentList: D,
|
|
97
97
|
compiledHtml: I,
|
|
98
|
-
rawHtml:
|
|
98
|
+
rawHtml: o,
|
|
99
99
|
css: l,
|
|
100
|
-
ampHtml:
|
|
101
|
-
ampErrors:
|
|
100
|
+
ampHtml: w,
|
|
101
|
+
ampErrors: y,
|
|
102
102
|
modules: g.map(Number),
|
|
103
103
|
recommendation: {
|
|
104
|
-
campaignUrls:
|
|
104
|
+
campaignUrls: F.recommendationCampaignUrls,
|
|
105
105
|
configs: {}
|
|
106
106
|
},
|
|
107
107
|
unsubscribe: {
|
|
108
|
-
status:
|
|
109
|
-
config:
|
|
108
|
+
status: C.length > 0,
|
|
109
|
+
config: C
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
114
|
};
|
|
115
115
|
export {
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
B as getHtmlReferencedUnsubscribePages,
|
|
117
|
+
ee 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.2e195ed",
|
|
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",
|
|
@@ -18,10 +18,6 @@
|
|
|
18
18
|
"types": "./dist/src/public/trackingIds.d.ts",
|
|
19
19
|
"import": "./dist/public/trackingIds.js"
|
|
20
20
|
},
|
|
21
|
-
"./editor-state": {
|
|
22
|
-
"types": "./dist/src/public/editorState.d.ts",
|
|
23
|
-
"import": "./dist/public/editorState.js"
|
|
24
|
-
},
|
|
25
21
|
"./style": "./dist/guido.css"
|
|
26
22
|
},
|
|
27
23
|
"scripts": {
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Published as `@useinsider/guido/editor-state` — the live editor snapshot Guido
|
|
3
|
-
* writes into the host's shared Pinia singleton.
|
|
4
|
-
*
|
|
5
|
-
* Importing from here pulls in nothing but pinia, so the editor never enters a
|
|
6
|
-
* consumer's module graph. Re-export surface only: this is the contract,
|
|
7
|
-
* `stores/guido-email-editor` is the implementation and stays free to move.
|
|
8
|
-
*
|
|
9
|
-
* Consumers read the store by importing it; the id `guidoEmailEditor` remains
|
|
10
|
-
* part of the contract for cortex-fe, which probes `pinia._s` at runtime instead
|
|
11
|
-
* of taking a build-time dependency on this package.
|
|
12
|
-
*/
|
|
13
|
-
export { useGuidoEmailEditorStore } from '../stores/guido-email-editor';
|
|
14
|
-
export type { GuidoEmailEditorState } from '../stores/guido-email-editor';
|