@useinsider/guido 3.1.1-beta.c70df9c → 3.1.1-beta.dc20933
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.
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { usePartner as
|
|
2
|
-
import { LINK_REGEXES as
|
|
3
|
-
import { parsePageList as
|
|
4
|
-
import { useConfigStore as
|
|
5
|
-
import { useDynamicContentStore as
|
|
6
|
-
import { useUnsubscribeStore as
|
|
7
|
-
const
|
|
1
|
+
import { usePartner as y } from "../../composables/usePartner.js";
|
|
2
|
+
import { LINK_REGEXES as p, LINK_TYPES as S, INSIDER_ID as m, URLS as R } from "../../enums/unsubscribe.js";
|
|
3
|
+
import { parsePageList as I } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
4
|
+
import { useConfigStore as N } from "../../stores/config.js";
|
|
5
|
+
import { useDynamicContentStore as U } from "../../stores/dynamic-content.js";
|
|
6
|
+
import { useUnsubscribeStore as C } from "../../stores/unsubscribe.js";
|
|
7
|
+
const G = [
|
|
8
8
|
{
|
|
9
9
|
id: "add-unsubscribe-link-values",
|
|
10
10
|
description: "Adding unsubscribe link values",
|
|
11
11
|
type: "custom",
|
|
12
12
|
processor: (t) => {
|
|
13
|
-
const { getPartnerName: i } =
|
|
13
|
+
const { getPartnerName: i } = y(), o = N(), s = U(), d = C(), a = o.variationId;
|
|
14
14
|
if (!a)
|
|
15
15
|
return t;
|
|
16
16
|
let e = t;
|
|
17
|
-
const r = `/${i()}/email/${a}?user={{iid}}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const r = `/${i()}/email/${a}?user={{iid}}`, E = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]");
|
|
18
|
+
let c = !1, l = !1;
|
|
19
|
+
return E.forEach((f) => {
|
|
20
|
+
var b;
|
|
21
|
+
const u = f.getAttribute("data-unsubscribe-page-list");
|
|
22
|
+
if (!u)
|
|
22
23
|
return;
|
|
23
|
-
const
|
|
24
|
-
(
|
|
25
|
-
)) ?? []
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}), e;
|
|
24
|
+
const _ = I(u), g = ((b = d.templates) == null ? void 0 : b.filter(
|
|
25
|
+
(n) => _.includes(n.id)
|
|
26
|
+
)) ?? [];
|
|
27
|
+
c = c || g.some((n) => n.type === S.UNSUBSCRIBE_LINK_TYPE), l = l || g.some((n) => n.type === S.PREFERENCES_LINK_TYPE);
|
|
28
|
+
}), (c || l) && (s.selectedDynamicContentList.some((u) => u.value === m) || s.selectedDynamicContentList.push({
|
|
29
|
+
text: m,
|
|
30
|
+
value: m,
|
|
31
|
+
fallback: ""
|
|
32
|
+
})), c && (e = e.replace(
|
|
33
|
+
p.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
|
|
34
|
+
R.UNSUBSCRIBE_URL + r
|
|
35
|
+
)), l && (e = e.replace(
|
|
36
|
+
p.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
|
|
37
|
+
R.PREFERENCES_URL + r
|
|
38
|
+
)), E.length && (e = e.replace(p.UNSUBSCRIBE_LINK_REGEX, "")), e;
|
|
39
39
|
},
|
|
40
40
|
priority: 60
|
|
41
41
|
},
|
|
@@ -43,7 +43,7 @@ const D = [
|
|
|
43
43
|
id: "remove-data-ogsb-button-styles",
|
|
44
44
|
description: "Removing styles like [data-ogsb] .es-button.es-button-123 { background: red; }",
|
|
45
45
|
type: "regex",
|
|
46
|
-
pattern:
|
|
46
|
+
pattern: p.DATA_OGSB_BUTTON_CSS_REGEX,
|
|
47
47
|
replacement: "",
|
|
48
48
|
flags: "g",
|
|
49
49
|
priority: 61
|
|
@@ -61,16 +61,16 @@ const D = [
|
|
|
61
61
|
type: "custom",
|
|
62
62
|
processor: (t) => {
|
|
63
63
|
let i = t;
|
|
64
|
-
const
|
|
65
|
-
return
|
|
66
|
-
if (
|
|
64
|
+
const o = i.match(/<a[^>]+>(.*?)<\/a>/gm);
|
|
65
|
+
return o && o.forEach((s) => {
|
|
66
|
+
if (s.includes("insEmail=1"))
|
|
67
67
|
return;
|
|
68
|
-
if (
|
|
69
|
-
const a =
|
|
68
|
+
if (s.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
|
|
69
|
+
const a = s.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
|
|
70
70
|
const r = e.slice(6, e.length - 1).trim();
|
|
71
71
|
return e.includes("?") || e.includes("#") ? r.slice(-1) === "&" ? e.replace(r, `${r}insEmail=1`) : e.replace(r, `${r}&insEmail=1`) : e.replace(r, `${r}?insEmail=1`);
|
|
72
72
|
});
|
|
73
|
-
i = i.replace(
|
|
73
|
+
i = i.replace(s, a);
|
|
74
74
|
}
|
|
75
75
|
}), i;
|
|
76
76
|
},
|
|
@@ -78,5 +78,5 @@ const D = [
|
|
|
78
78
|
}
|
|
79
79
|
];
|
|
80
80
|
export {
|
|
81
|
-
|
|
81
|
+
G as unsubscribeCompilerRules
|
|
82
82
|
};
|
|
@@ -75,7 +75,8 @@ const e = {
|
|
|
75
75
|
"The image with the invalid link cannot be saved to the image gallery": "Enter a valid image link to continue.",
|
|
76
76
|
"The data source link is unavailable. Please, make sure there is an access to the data source.": "Enter an accessible Data Source Link to contiue.",
|
|
77
77
|
"The file should not exceed the maximum resolution of {maxImageResolution}px.": "Upload files up to 1024x512 pixels to continue.",
|
|
78
|
-
"The option is disabled because was overridden in the Code editor": "The option is disabled because it was overridden in the Code Editor."
|
|
78
|
+
"The option is disabled because was overridden in the Code editor": "The option is disabled because it was overridden in the Code Editor.",
|
|
79
|
+
"Dropdown with a list of available data services, preliminarily created in the Data section → Services tab of the Account.": "Service for Data Collection lets you enter a form submission URL for the recipients to submit."
|
|
79
80
|
};
|
|
80
81
|
export {
|
|
81
82
|
e as default
|
|
@@ -3,22 +3,24 @@ import { useHtmlCompiler as C } from "../composables/useHtmlCompiler.js";
|
|
|
3
3
|
import { useRecommendationExtensionStore as T } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
4
|
import { useDynamicContentStore as x } from "../stores/dynamic-content.js";
|
|
5
5
|
import { useUnsubscribeStore as y } from "../stores/unsubscribe.js";
|
|
6
|
-
const
|
|
7
|
-
const o = x(),
|
|
6
|
+
const w = () => {
|
|
7
|
+
const o = x(), e = y(), { getCompiledEmail: i, getTemplateData: s, editorSave: n } = f(), { compileHtml: a } = C();
|
|
8
8
|
return {
|
|
9
9
|
prepareTemplateDetails: async () => {
|
|
10
|
-
const { html:
|
|
10
|
+
const { html: m, ampHtml: r = "", ampErrors: c = [] } = await i({
|
|
11
11
|
minimize: !0,
|
|
12
12
|
resetDataSavedFlag: !1
|
|
13
|
-
}), { html: l, css: p, syncModulesIds: u = [] } = await
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
}), { html: l, css: p, syncModulesIds: u = [] } = await s();
|
|
14
|
+
e.selectedUnsubscribePages.length && await e.fetchTemplates();
|
|
15
|
+
const { compiledHtml: d, stats: t, appliedRules: g } = a(m), S = o.getSelectedDynamicContentList, b = T();
|
|
16
|
+
return n(), console.debug("HTML Compilation Stats:", {
|
|
17
|
+
originalSize: t.originalSize,
|
|
18
|
+
compiledSize: t.compiledSize,
|
|
19
|
+
reduction: `${t.reductionPercentage.toFixed(2)}%`,
|
|
20
|
+
appliedRules: g,
|
|
21
|
+
executionTime: `${t.executionTime.toFixed(2)}ms`
|
|
20
22
|
}), {
|
|
21
|
-
dynamicContentList:
|
|
23
|
+
dynamicContentList: S,
|
|
22
24
|
compiledHtml: d,
|
|
23
25
|
rawHtml: l,
|
|
24
26
|
css: p,
|
|
@@ -30,13 +32,13 @@ const E = () => {
|
|
|
30
32
|
configs: {}
|
|
31
33
|
},
|
|
32
34
|
unsubscribe: {
|
|
33
|
-
status:
|
|
34
|
-
config:
|
|
35
|
+
status: e.unsubscribePagesStatus,
|
|
36
|
+
config: e.selectedUnsubscribePages
|
|
35
37
|
}
|
|
36
38
|
};
|
|
37
39
|
}
|
|
38
40
|
};
|
|
39
41
|
};
|
|
40
42
|
export {
|
|
41
|
-
|
|
43
|
+
w as useTemplatePreparation
|
|
42
44
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
id:
|
|
1
|
+
const o = (i, t = {}) => ({
|
|
2
|
+
id: i,
|
|
3
3
|
dynamicPosition: t.dynamicPosition ?? !1,
|
|
4
4
|
staticPosition: t.staticPosition ?? "bottom center",
|
|
5
5
|
iconStatus: t.iconStatus ?? !1,
|
|
6
|
-
offset: t.offset
|
|
7
|
-
preventXss: t.preventXss
|
|
6
|
+
offset: t.offset
|
|
8
7
|
});
|
|
9
8
|
export {
|
|
10
|
-
|
|
9
|
+
o as getTooltipOptions
|
|
11
10
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.1.1-beta.
|
|
3
|
+
"version": "3.1.1-beta.dc20933",
|
|
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",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"license": "ISC",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@stripoinc/ui-editor-extensions": "3.5.0",
|
|
36
|
-
"@useinsider/design-system-vue": "0.
|
|
36
|
+
"@useinsider/design-system-vue": "1.1.0-beta.73ec2fa",
|
|
37
37
|
"@vueuse/core": "11.3.0",
|
|
38
38
|
"lodash-es": "4.17.21",
|
|
39
39
|
"pinia": "2.3.1",
|