@useinsider/guido 3.18.0 → 3.18.1-beta.0725bd5
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 +1 -1
- package/dist/components/Guido.vue2.js +86 -82
- 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/header/EditorActions.vue.js +1 -1
- package/dist/components/organisms/header/EditorActions.vue2.js +54 -41
- 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/useActionsApi.js +82 -67
- package/dist/composables/useAutoSave.js +31 -26
- package/dist/composables/useCustomInterfaceAppearance.js +46 -41
- package/dist/composables/useEditorLock.js +20 -0
- package/dist/composables/useGuidoStateBridge.js +37 -31
- package/dist/composables/useHtmlValidator.js +84 -79
- package/dist/composables/useRecommendation.js +21 -18
- package/dist/composables/useSave.js +42 -39
- package/dist/composables/useStripo.js +7 -7
- 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 +210 -130
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
- package/dist/src/composables/useEditorLock.d.ts +10 -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/stores/onboarding.d.ts +377 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +51 -4
- package/dist/stores/onboarding.js +41 -36
- package/dist/utils/templatePreparation.js +50 -50
- package/package.json +2 -2
|
@@ -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.
|
|
3
|
+
"version": "3.18.1-beta.0725bd5",
|
|
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",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
},
|
|
119
119
|
"guido": {
|
|
120
120
|
"stripo": {
|
|
121
|
-
"version": "2.
|
|
121
|
+
"version": "2.73.0"
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
}
|