@useinsider/guido 3.18.2-beta.8ef3138 → 3.18.2-beta.eedafd2
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/README.md +1 -0
- package/dist/@types/config/schemas.js +28 -26
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +53 -51
- package/dist/components/organisms/AutoSaveController.vue2.js +9 -8
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +86 -56
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +48 -0
- package/dist/components/wrappers/WpDrawer.vue.js +9 -7
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useHtmlCompiler.js +37 -26
- package/dist/composables/useHtmlValidator.js +2 -0
- package/dist/composables/useSave.js +90 -45
- package/dist/composables/useSaveValidation.js +279 -0
- package/dist/composables/useSaveValidationRollout.js +9 -0
- package/dist/composables/validators/useCouponBlockValidator.js +24 -21
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
- package/dist/enums/save-validation.js +4 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +43 -36
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/@types/save-validation.d.ts +19 -0
- package/dist/src/components/Guido.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
- package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useHtmlValidator.d.ts +21 -0
- package/dist/src/composables/useSave.d.ts +6 -1
- package/dist/src/composables/useSaveValidation.d.ts +6 -0
- package/dist/src/composables/useSaveValidationRollout.d.ts +3 -0
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
- package/dist/src/enums/save-validation.d.ts +27 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +5 -0
- package/dist/src/stores/config.d.ts +30 -0
- package/dist/src/stores/save-validation.d.ts +22 -0
- package/dist/src/utils/liquidDynamicContent.d.ts +20 -0
- package/dist/src/utils/templatePreparation.d.ts +30 -0
- package/dist/stores/config.js +39 -22
- package/dist/stores/save-validation.js +30 -0
- package/dist/utils/genericUtil.js +64 -61
- package/dist/utils/liquidDynamicContent.js +15 -0
- package/dist/utils/templatePreparation.js +28 -25
- package/package.json +1 -1
package/dist/stores/config.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../@types/config/schemas.js";
|
|
1
|
+
import { MessageType as r } from "../@types/config/schemas.js";
|
|
2
2
|
import "../@types/config/defaults.js";
|
|
3
3
|
import { parseConfig as o } from "../@types/config/validator.js";
|
|
4
|
-
import { defineStore as
|
|
5
|
-
const
|
|
4
|
+
import { defineStore as a } from "pinia";
|
|
5
|
+
const u = a("guido-config", {
|
|
6
6
|
state: () => ({
|
|
7
7
|
initialized: !1,
|
|
8
8
|
config: null
|
|
@@ -75,57 +75,74 @@ const f = r("guido-config", {
|
|
|
75
75
|
* Get the template ID
|
|
76
76
|
*/
|
|
77
77
|
templateId: (i) => {
|
|
78
|
-
var e,
|
|
79
|
-
return ((
|
|
78
|
+
var e, t;
|
|
79
|
+
return ((t = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : t.templateId) ?? "";
|
|
80
80
|
},
|
|
81
81
|
/**
|
|
82
82
|
* Get the user ID
|
|
83
83
|
*/
|
|
84
84
|
userId: (i) => {
|
|
85
|
-
var e,
|
|
86
|
-
return ((
|
|
85
|
+
var e, t;
|
|
86
|
+
return ((t = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : t.userId) ?? "";
|
|
87
87
|
},
|
|
88
88
|
/**
|
|
89
89
|
* Get the variation ID
|
|
90
90
|
*/
|
|
91
91
|
variationId: (i) => {
|
|
92
|
-
var e,
|
|
93
|
-
return ((
|
|
92
|
+
var e, t;
|
|
93
|
+
return ((t = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : t.variationId) ?? "";
|
|
94
94
|
},
|
|
95
95
|
/**
|
|
96
96
|
* Get the partner name
|
|
97
97
|
*/
|
|
98
98
|
partnerName: (i) => {
|
|
99
|
-
var e,
|
|
100
|
-
return ((
|
|
99
|
+
var e, t;
|
|
100
|
+
return ((t = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : t.name) ?? "";
|
|
101
101
|
},
|
|
102
102
|
/**
|
|
103
103
|
* Get the product type
|
|
104
104
|
*/
|
|
105
105
|
productType: (i) => {
|
|
106
|
-
var e,
|
|
107
|
-
return ((
|
|
106
|
+
var e, t;
|
|
107
|
+
return ((t = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : t.productType) ?? 60;
|
|
108
108
|
},
|
|
109
109
|
/**
|
|
110
110
|
* Get the message type
|
|
111
111
|
*/
|
|
112
112
|
messageType: (i) => {
|
|
113
|
-
var e,
|
|
114
|
-
return ((
|
|
113
|
+
var e, t;
|
|
114
|
+
return ((t = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : t.messageType) ?? 1;
|
|
115
|
+
},
|
|
116
|
+
/**
|
|
117
|
+
* Transactional campaigns keep the hard save block. Reactive getter, so
|
|
118
|
+
* consumers stay safe in setup where a raw config read snapshots null (SD-147945).
|
|
119
|
+
*/
|
|
120
|
+
isTransactional() {
|
|
121
|
+
return this.messageType === r.TRANSACTIONAL;
|
|
122
|
+
},
|
|
123
|
+
/**
|
|
124
|
+
* Soft-save policy: may the editor persist a template with validation errors?
|
|
125
|
+
* Default true (host sets features.allowSaveWithErrors=false for transactional +
|
|
126
|
+
* unsub). Reactive getter defaulting true — reading via isFeatureEnabled would
|
|
127
|
+
* floor to false pre-init and momentarily hide the soft-save option (SD-147430).
|
|
128
|
+
*/
|
|
129
|
+
allowSaveWithErrors() {
|
|
130
|
+
var i;
|
|
131
|
+
return ((i = this.features) == null ? void 0 : i.allowSaveWithErrors) ?? !0;
|
|
115
132
|
},
|
|
116
133
|
/**
|
|
117
134
|
* Get the username
|
|
118
135
|
*/
|
|
119
136
|
username: (i) => {
|
|
120
|
-
var e,
|
|
121
|
-
return ((
|
|
137
|
+
var e, t;
|
|
138
|
+
return ((t = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : t.username) ?? "Guido User";
|
|
122
139
|
},
|
|
123
140
|
/**
|
|
124
141
|
* Check if header should be shown
|
|
125
142
|
*/
|
|
126
143
|
showHeader: (i) => {
|
|
127
|
-
var e,
|
|
128
|
-
return ((
|
|
144
|
+
var e, t;
|
|
145
|
+
return ((t = (e = i.config) == null ? void 0 : e.ui) == null ? void 0 : t.showHeader) ?? !0;
|
|
129
146
|
},
|
|
130
147
|
/**
|
|
131
148
|
* Check if a specific feature is enabled.
|
|
@@ -134,8 +151,8 @@ const f = r("guido-config", {
|
|
|
134
151
|
*/
|
|
135
152
|
// eslint-disable-next-line @stylistic/max-len
|
|
136
153
|
isFeatureEnabled: (i) => (e) => {
|
|
137
|
-
var
|
|
138
|
-
return ((
|
|
154
|
+
var t, n;
|
|
155
|
+
return ((n = (t = i.config) == null ? void 0 : t.features) == null ? void 0 : n[e]) ?? !1;
|
|
139
156
|
}
|
|
140
157
|
},
|
|
141
158
|
actions: {
|
|
@@ -155,5 +172,5 @@ const f = r("guido-config", {
|
|
|
155
172
|
}
|
|
156
173
|
});
|
|
157
174
|
export {
|
|
158
|
-
|
|
175
|
+
u as useConfigStore
|
|
159
176
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineStore as n } from "pinia";
|
|
2
|
+
function i(e) {
|
|
3
|
+
const t = /* @__PURE__ */ new Set();
|
|
4
|
+
return e.filter((r) => {
|
|
5
|
+
const s = JSON.stringify([r.rule, r.message, r.detail ?? ""]);
|
|
6
|
+
return t.has(s) ? !1 : (t.add(s), !0);
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
const o = n("guidoSaveValidation", {
|
|
10
|
+
state: () => ({
|
|
11
|
+
errors: [],
|
|
12
|
+
isDrawerOpen: !1,
|
|
13
|
+
intent: null
|
|
14
|
+
}),
|
|
15
|
+
getters: {
|
|
16
|
+
errorCount: (e) => e.errors.length
|
|
17
|
+
},
|
|
18
|
+
actions: {
|
|
19
|
+
open(e, t) {
|
|
20
|
+
this.errors = i(e), this.intent = t, this.isDrawerOpen = !0;
|
|
21
|
+
},
|
|
22
|
+
// Errors are retained so rows don't blank during the ~300ms close animation.
|
|
23
|
+
close() {
|
|
24
|
+
this.isDrawerOpen = !1;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
export {
|
|
29
|
+
o as useSaveValidationStore
|
|
30
|
+
};
|
|
@@ -1,75 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { formatToLiquidFilter as b, quoteArgument as y, liquidFilterToFormat as h } from "./liquidDynamicContent.js";
|
|
2
|
+
const g = (t) => {
|
|
3
|
+
if (!t.includes("="))
|
|
4
|
+
return null;
|
|
5
|
+
const [r, e] = t.split("=");
|
|
6
|
+
return { key: r.trim(), value: e.trim() };
|
|
7
|
+
}, c = "default:", f = (t) => {
|
|
8
|
+
if (!t.startsWith(c))
|
|
9
|
+
return t;
|
|
10
|
+
const r = t.slice(c.length).trim(), e = (l) => r.length >= 2 && r.startsWith(l) && r.endsWith(l);
|
|
11
|
+
return e('"') || e("'") ? r.slice(1, -1) : r;
|
|
12
|
+
}, k = (t) => {
|
|
13
|
+
const e = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((a) => a.trim()), [l] = e, s = {
|
|
14
|
+
text: t.label,
|
|
15
|
+
value: l || ""
|
|
5
16
|
};
|
|
6
|
-
if (
|
|
7
|
-
const [,
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
n ? r.format = n : l || (r.fallback = e), l && (r.fallback = l);
|
|
17
|
+
if (e.length >= 2) {
|
|
18
|
+
const [, a, n] = e;
|
|
19
|
+
if (a.startsWith(c))
|
|
20
|
+
s.fallback = f(a);
|
|
21
|
+
else {
|
|
22
|
+
const o = h(a) ?? g(a);
|
|
23
|
+
o ? s.format = o : n || (s.fallback = a), n && (s.fallback = f(n));
|
|
14
24
|
}
|
|
15
25
|
}
|
|
16
|
-
return
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
if (c) {
|
|
24
|
-
if (!t.fallback)
|
|
25
|
-
return {
|
|
26
|
-
label: t.text,
|
|
27
|
-
value: `{{ ${t.value} }}`
|
|
28
|
-
};
|
|
29
|
-
const r = !Number.isNaN(Number(t.fallback)) && t.fallback.trim() !== "" ? t.fallback : `"${t.fallback}"`;
|
|
30
|
-
return {
|
|
31
|
-
label: `${t.text} | ${t.fallback}`,
|
|
32
|
-
value: `{{ ${t.value} | default: ${r} }}`
|
|
33
|
-
};
|
|
34
|
-
}
|
|
26
|
+
return s;
|
|
27
|
+
}, p = (t) => {
|
|
28
|
+
const e = !Number.isNaN(Number(t)) && t.trim() !== "" ? t : y(t);
|
|
29
|
+
return e === null ? null : `${c} ${e}`;
|
|
30
|
+
}, v = (t) => {
|
|
31
|
+
const r = t.format ? b(t.format) : null, e = t.fallback ? p(t.fallback) : null, l = [t.value, r, e].filter(Boolean);
|
|
35
32
|
return {
|
|
36
|
-
label: t.
|
|
37
|
-
value:
|
|
33
|
+
label: [t.text, r, e && t.fallback].filter(Boolean).join(" | "),
|
|
34
|
+
value: `{{ ${l.join(" | ")} }}`
|
|
38
35
|
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
}, i = (t, r = !1) => t.map((e) => r ? v(e) : e.format ? {
|
|
37
|
+
label: `${e.text} | ${e.format.key}=${e.format.value}`,
|
|
38
|
+
value: `{{${e.value}|${e.format.key}=${e.format.value}}}`
|
|
39
|
+
} : {
|
|
40
|
+
label: e.fallback ? `${e.text} | ${e.fallback}` : e.text,
|
|
41
|
+
value: e.fallback ? `{{${e.value}|${e.fallback}}}` : `{{${e.value}}}`
|
|
42
|
+
}), $ = (t) => {
|
|
43
|
+
const r = [], e = /* @__PURE__ */ new Set(), l = (a) => {
|
|
44
|
+
Array.isArray(a) && a.forEach((n) => {
|
|
45
|
+
const o = [...n.children ?? [], ...n.select_items ?? []];
|
|
46
|
+
if (o.length > 0) {
|
|
47
|
+
l(o);
|
|
45
48
|
return;
|
|
46
49
|
}
|
|
47
|
-
const
|
|
48
|
-
|
|
50
|
+
const u = n.text || n.tag_text;
|
|
51
|
+
u && n.value && !e.has(n.value) && (e.add(n.value), r.push({ text: u, value: n.value }));
|
|
49
52
|
});
|
|
50
|
-
}, [
|
|
51
|
-
return s
|
|
52
|
-
},
|
|
53
|
-
const
|
|
53
|
+
}, [s] = Object.values(t ?? {});
|
|
54
|
+
return l(s), r;
|
|
55
|
+
}, d = (t, r, e = !1) => {
|
|
56
|
+
const l = new Set(t.map((a) => a.value)), s = r.filter((a) => l.has(a.value) ? !1 : (l.add(a.value), !0));
|
|
54
57
|
return [
|
|
55
|
-
...
|
|
56
|
-
...
|
|
58
|
+
...i(t, e),
|
|
59
|
+
...i(s, e)
|
|
57
60
|
];
|
|
58
|
-
},
|
|
59
|
-
var
|
|
60
|
-
return ((
|
|
61
|
-
},
|
|
62
|
-
if (
|
|
61
|
+
}, F = () => {
|
|
62
|
+
var t;
|
|
63
|
+
return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
|
|
64
|
+
}, T = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "", x = (t) => {
|
|
65
|
+
if (t === null || typeof t != "object" || Array.isArray(t))
|
|
63
66
|
return !1;
|
|
64
|
-
const
|
|
65
|
-
return
|
|
67
|
+
const r = Object.getPrototypeOf(t);
|
|
68
|
+
return r === Object.prototype || r === null;
|
|
66
69
|
};
|
|
67
70
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
T as asText,
|
|
72
|
+
d as buildMergeTagEntries,
|
|
73
|
+
i as dynamicContentToMergeTags,
|
|
74
|
+
$ as flattenDynamicContentList,
|
|
75
|
+
F as getCsrfToken,
|
|
76
|
+
x as isPlainObject,
|
|
77
|
+
k as mergeTagToDynamicContent
|
|
75
78
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const E = "time-format", r = "date", u = new RegExp(`^${r}\\s*:\\s*(?:"([^"]*)"|'([^']*)')$`), s = /%[-_0^#]?\d*[a-zA-Z%]/, c = new RegExp(s, "g"), l = /\b(?:Y{2,4}|M{2,4}|D{1,4}|d{3,4}|H{2}|h{2}|m{2}|s{2}|S{1,3}|A|a)\b/, T = (t) => t.includes('"') ? t.includes("'") ? null : `'${t}'` : `"${t}"`, i = (t) => s.test(t) && !l.test(t.replace(c, "")), R = (t) => {
|
|
2
|
+
if (t.key !== E || !i(t.value ?? ""))
|
|
3
|
+
return null;
|
|
4
|
+
const n = T(t.value);
|
|
5
|
+
return n === null ? null : `${r}: ${n}`;
|
|
6
|
+
}, _ = (t) => {
|
|
7
|
+
const [, n, o] = t.match(u) ?? [], e = n ?? o;
|
|
8
|
+
return e ? { key: E, value: e } : null;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
E as TIME_FORMAT_KEY,
|
|
12
|
+
R as formatToLiquidFilter,
|
|
13
|
+
_ as liquidFilterToFormat,
|
|
14
|
+
T as quoteArgument
|
|
15
|
+
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
1
|
+
import { useActionsApi as R } 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
4
|
import { DEFAULT_CURRENCY as m, DEFAULT_NODE_CONFIG as n } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
5
|
-
import { useRecommendationExtensionStore as
|
|
5
|
+
import { useRecommendationExtensionStore as I } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
6
|
import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
7
7
|
import { DATA_ATTRIBUTES as T } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
8
|
-
import { parsePageList as
|
|
9
|
-
import { useDynamicContentStore as
|
|
10
|
-
import { useEditorStore as
|
|
11
|
-
import { useUnsubscribeStore as
|
|
12
|
-
import { isPlainObject as
|
|
13
|
-
import { assignTrackingIds as
|
|
14
|
-
function
|
|
8
|
+
import { parsePageList as N } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
9
|
+
import { useDynamicContentStore as z } from "../stores/dynamic-content.js";
|
|
10
|
+
import { useEditorStore as O } from "../stores/editor.js";
|
|
11
|
+
import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
|
|
12
|
+
import { isPlainObject as v } from "./genericUtil.js";
|
|
13
|
+
import { assignTrackingIds as M } from "./linkTrackingIds.js";
|
|
14
|
+
function q(l) {
|
|
15
15
|
const i = new DOMParser().parseFromString(l, "text/html").querySelectorAll(`[${T.PAGE_LIST}]`), t = [];
|
|
16
16
|
return i.forEach((c) => {
|
|
17
17
|
const o = c.getAttribute(T.PAGE_LIST);
|
|
18
|
-
o && t.push(...
|
|
18
|
+
o && t.push(...N(o));
|
|
19
19
|
}), [...new Set(t)];
|
|
20
20
|
}
|
|
21
|
-
async function
|
|
21
|
+
async function A(l) {
|
|
22
22
|
const a = new DOMParser().parseFromString(l, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
23
23
|
if (a.length === 0)
|
|
24
24
|
return;
|
|
25
|
-
const i =
|
|
25
|
+
const i = I();
|
|
26
26
|
a.forEach((t) => {
|
|
27
27
|
var r, d, g, f, s, y;
|
|
28
28
|
const c = t.getAttribute("recommendation-id"), o = c ? Number(c) : NaN;
|
|
@@ -37,7 +37,7 @@ async function q(l) {
|
|
|
37
37
|
} catch {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
if (!
|
|
40
|
+
if (!v(e))
|
|
41
41
|
return;
|
|
42
42
|
const b = {
|
|
43
43
|
// Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
|
|
@@ -71,14 +71,14 @@ async function q(l) {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
const te = () => {
|
|
74
|
-
const l =
|
|
74
|
+
const l = z(), u = O(), a = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: c } = R(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
|
|
75
75
|
return {
|
|
76
76
|
prepareTemplateDetails: async () => {
|
|
77
77
|
let { html: r, css: d, syncModulesIds: g = [] } = await t();
|
|
78
78
|
if (e("linkTrackingIds"))
|
|
79
79
|
try {
|
|
80
|
-
const { html: h, changed:
|
|
81
|
-
u.trackIdSessionFloor =
|
|
80
|
+
const { html: h, changed: H, nextSeq: k } = M(r, u.trackIdSessionFloor);
|
|
81
|
+
u.trackIdSessionFloor = k, H && (r = h, await c(h, d));
|
|
82
82
|
} catch (h) {
|
|
83
83
|
console.error("Tracking-id step failed, saving anyway:", h);
|
|
84
84
|
}
|
|
@@ -86,24 +86,24 @@ const te = () => {
|
|
|
86
86
|
minimize: !0,
|
|
87
87
|
resetDataSavedFlag: !1
|
|
88
88
|
});
|
|
89
|
-
a.selectedUnsubscribePages.length && await a.fetchTemplates(), await
|
|
90
|
-
const { compiledHtml:
|
|
89
|
+
a.selectedUnsubscribePages.length && await a.fetchTemplates(), await A(r);
|
|
90
|
+
const { compiledHtml: w, stats: S, appliedRules: D } = o(f), P = s && p(s).compiledHtml, E = l.getSelectedDynamicContentList, F = I(), C = q(r);
|
|
91
91
|
return console.debug("HTML Compilation Stats:", {
|
|
92
92
|
originalSize: S.originalSize,
|
|
93
93
|
compiledSize: S.compiledSize,
|
|
94
94
|
reduction: `${S.reductionPercentage.toFixed(2)}%`,
|
|
95
|
-
appliedRules:
|
|
95
|
+
appliedRules: D,
|
|
96
96
|
executionTime: `${S.executionTime.toFixed(2)}ms`
|
|
97
97
|
}), {
|
|
98
|
-
dynamicContentList:
|
|
99
|
-
compiledHtml:
|
|
98
|
+
dynamicContentList: E,
|
|
99
|
+
compiledHtml: w,
|
|
100
100
|
rawHtml: r,
|
|
101
101
|
css: d,
|
|
102
|
-
ampHtml:
|
|
102
|
+
ampHtml: P,
|
|
103
103
|
ampErrors: y,
|
|
104
104
|
modules: g.map(Number),
|
|
105
105
|
recommendation: {
|
|
106
|
-
campaignUrls:
|
|
106
|
+
campaignUrls: F.recommendationCampaignUrls,
|
|
107
107
|
configs: {}
|
|
108
108
|
},
|
|
109
109
|
unsubscribe: {
|
|
@@ -111,10 +111,13 @@ const te = () => {
|
|
|
111
111
|
config: C
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
|
-
}
|
|
114
|
+
},
|
|
115
|
+
// Exposed so the back/test validate-only path can seed the reco store the
|
|
116
|
+
// same way a full save does (required-field findings depend on it).
|
|
117
|
+
hydrateRecommendationStore: A
|
|
115
118
|
};
|
|
116
119
|
};
|
|
117
120
|
export {
|
|
118
|
-
|
|
121
|
+
q as getHtmlReferencedUnsubscribePages,
|
|
119
122
|
te as useTemplatePreparation
|
|
120
123
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.18.2-beta.
|
|
3
|
+
"version": "3.18.2-beta.eedafd2",
|
|
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",
|