@useinsider/guido 3.18.0-beta.3ffa144 → 3.18.0-beta.599df29
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 +85 -81
- package/dist/components/organisms/header/EditorActions.vue.js +1 -1
- package/dist/components/organisms/header/EditorActions.vue2.js +54 -41
- package/dist/composables/useActionsApi.js +82 -67
- package/dist/composables/useAutoSave.js +31 -26
- package/dist/composables/useEditorLock.js +20 -0
- package/dist/composables/useGuidoStateBridge.js +37 -31
- package/dist/composables/useSave.js +42 -39
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +12 -18
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +17 -18
- package/dist/guido.css +1 -1
- package/dist/src/composables/useEditorLock.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -5
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -12
- package/dist/utils/templatePreparation.js +36 -37
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { useActionsApi as k } from "../composables/useActionsApi.js";
|
|
2
2
|
import { useConfig as U } from "../composables/useConfig.js";
|
|
3
3
|
import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
|
|
4
|
-
import { DEFAULT_CURRENCY as
|
|
5
|
-
import { useRecommendationExtensionStore as
|
|
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
6
|
import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
7
|
-
import { DATA_ATTRIBUTES as
|
|
7
|
+
import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
8
8
|
import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
9
9
|
import { useDynamicContentStore as N } from "../stores/dynamic-content.js";
|
|
10
10
|
import { useEditorStore as z } from "../stores/editor.js";
|
|
11
11
|
import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
|
|
12
12
|
import { assignTrackingIds as v } from "./linkTrackingIds.js";
|
|
13
|
-
function O(
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
const o =
|
|
13
|
+
function O(m) {
|
|
14
|
+
const i = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
|
|
15
|
+
return i.forEach((s) => {
|
|
16
|
+
const o = s.getAttribute(A.PAGE_LIST);
|
|
17
17
|
o && t.push(...R(o));
|
|
18
18
|
}), [...new Set(t)];
|
|
19
19
|
}
|
|
20
|
-
async function M(
|
|
21
|
-
const n = new DOMParser().parseFromString(
|
|
20
|
+
async function M(m) {
|
|
21
|
+
const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
22
22
|
if (n.length === 0)
|
|
23
23
|
return;
|
|
24
|
-
const
|
|
24
|
+
const i = C();
|
|
25
25
|
n.forEach((t) => {
|
|
26
|
-
var r,
|
|
27
|
-
const
|
|
26
|
+
var r, l, g, f, c;
|
|
27
|
+
const s = t.getAttribute("recommendation-id"), o = s ? Number(s) : NaN;
|
|
28
28
|
if (!Number.isFinite(o))
|
|
29
29
|
return;
|
|
30
30
|
const p = t.getAttribute("esd-ext-config");
|
|
@@ -38,7 +38,7 @@ async function M(l) {
|
|
|
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).
|
|
@@ -51,17 +51,16 @@ async function M(l) {
|
|
|
51
51
|
productIds: e.productIds ?? [...a.productIds],
|
|
52
52
|
filters: e.filters ?? [...a.filters],
|
|
53
53
|
shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
|
|
54
|
-
currencyCode: ((r = e.currency) == null ? void 0 : r.code) ??
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ?? m.thousandSeparator
|
|
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
|
|
60
59
|
};
|
|
61
|
-
|
|
60
|
+
i.seedBlockUrlConfig(o, h);
|
|
62
61
|
});
|
|
63
62
|
try {
|
|
64
|
-
await
|
|
63
|
+
await i.fetchRecommendationCreateData();
|
|
65
64
|
} catch (t) {
|
|
66
65
|
console.warn(
|
|
67
66
|
"Recommendation reference data pre-load failed; validator will skip the availability check.",
|
|
@@ -70,44 +69,44 @@ async function M(l) {
|
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
const Z = () => {
|
|
73
|
-
const
|
|
72
|
+
const m = N(), u = z(), n = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
|
|
74
73
|
return {
|
|
75
74
|
prepareTemplateDetails: async () => {
|
|
76
|
-
let { html: r, css:
|
|
75
|
+
let { html: r, css: l, syncModulesIds: g = [] } = await t();
|
|
77
76
|
if (e("linkTrackingIds"))
|
|
78
77
|
try {
|
|
79
|
-
const { html:
|
|
80
|
-
u.trackIdSessionFloor = H, F && (r =
|
|
81
|
-
} catch (
|
|
82
|
-
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);
|
|
83
82
|
}
|
|
84
|
-
const { html: f, ampHtml:
|
|
83
|
+
const { html: f, ampHtml: c = "", ampErrors: T = [] } = await i({
|
|
85
84
|
minimize: !0,
|
|
86
85
|
resetDataSavedFlag: !1
|
|
87
86
|
});
|
|
88
87
|
n.selectedUnsubscribePages.length && await n.fetchTemplates(), await M(r);
|
|
89
|
-
const { compiledHtml: I, stats:
|
|
88
|
+
const { compiledHtml: I, stats: y, appliedRules: w } = o(f), D = c && p(c).compiledHtml, E = m.getSelectedDynamicContentList, P = C(), b = O(r);
|
|
90
89
|
return console.debug("HTML Compilation Stats:", {
|
|
91
|
-
originalSize:
|
|
92
|
-
compiledSize:
|
|
93
|
-
reduction: `${
|
|
90
|
+
originalSize: y.originalSize,
|
|
91
|
+
compiledSize: y.compiledSize,
|
|
92
|
+
reduction: `${y.reductionPercentage.toFixed(2)}%`,
|
|
94
93
|
appliedRules: w,
|
|
95
|
-
executionTime: `${
|
|
94
|
+
executionTime: `${y.executionTime.toFixed(2)}ms`
|
|
96
95
|
}), {
|
|
97
96
|
dynamicContentList: E,
|
|
98
97
|
compiledHtml: I,
|
|
99
98
|
rawHtml: r,
|
|
100
|
-
css:
|
|
99
|
+
css: l,
|
|
101
100
|
ampHtml: D,
|
|
102
|
-
ampErrors:
|
|
101
|
+
ampErrors: T,
|
|
103
102
|
modules: g.map(Number),
|
|
104
103
|
recommendation: {
|
|
105
104
|
campaignUrls: P.recommendationCampaignUrls,
|
|
106
105
|
configs: {}
|
|
107
106
|
},
|
|
108
107
|
unsubscribe: {
|
|
109
|
-
status:
|
|
110
|
-
config:
|
|
108
|
+
status: b.length > 0,
|
|
109
|
+
config: b
|
|
111
110
|
}
|
|
112
111
|
};
|
|
113
112
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.18.0-beta.
|
|
3
|
+
"version": "3.18.0-beta.599df29",
|
|
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",
|