@useinsider/guido 3.23.0-beta.668404b → 3.23.0-beta.778056a
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/composables/useHtmlCompiler.js +0 -2
- package/dist/config/compiler/htmlCompilerRules.js +6 -14
- package/dist/package.json.js +1 -1
- package/dist/services/templateLibraryApi.js +39 -36
- package/dist/static/stripo-runtime-manifest.json.js +1 -1
- package/package.json +2 -2
- package/dist/src/utils/trimHrefWhitespace.d.ts +0 -5
- package/dist/utils/trimHrefWhitespace.js +0 -10
|
@@ -16,8 +16,6 @@ const x = /* @__PURE__ */ new Set([
|
|
|
16
16
|
"fix-tags-end",
|
|
17
17
|
// Unwrap translate-injected <font dir="auto"> tags — pure removal, never emits AMP-forbidden output.
|
|
18
18
|
"strip-font-tags",
|
|
19
|
-
// Trim whitespace inside href values — attribute-value edit only, emits nothing new.
|
|
20
|
-
"trim-href-whitespace",
|
|
21
19
|
// Image domain corrections — plain string replacement.
|
|
22
20
|
"replace-old-image-domain",
|
|
23
21
|
"replace-old-v2-image-domain",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { stripFontTags as
|
|
2
|
-
|
|
3
|
-
const f = [
|
|
1
|
+
import { stripFontTags as p } from "../../utils/stripFontTags.js";
|
|
2
|
+
const d = [
|
|
4
3
|
{
|
|
5
4
|
id: "fix-url-encoding-start",
|
|
6
5
|
description: "Replace {%22 with %7B%22 to fix URL encoding",
|
|
@@ -59,16 +58,9 @@ const f = [
|
|
|
59
58
|
id: "strip-font-tags",
|
|
60
59
|
description: 'Unwrap browser-translate-injected <font dir="auto"> tags, keeping inner content; other <font> elements are left intact.',
|
|
61
60
|
type: "custom",
|
|
62
|
-
processor: (e) =>
|
|
61
|
+
processor: (e) => p(e),
|
|
63
62
|
priority: 15
|
|
64
63
|
},
|
|
65
|
-
{
|
|
66
|
-
id: "trim-href-whitespace",
|
|
67
|
-
description: "Trim leading/trailing whitespace and from every href value",
|
|
68
|
-
type: "custom",
|
|
69
|
-
processor: (e) => l(e),
|
|
70
|
-
priority: 16
|
|
71
|
-
},
|
|
72
64
|
{
|
|
73
65
|
id: "remove-apty-iframe",
|
|
74
66
|
description: "Cleanup Apty Iframe Code",
|
|
@@ -165,8 +157,8 @@ const f = [
|
|
|
165
157
|
processor: (e) => {
|
|
166
158
|
const t = (i) => i.toString(16).padStart(2, "0");
|
|
167
159
|
return e.replace(/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/gi, (i, o, n, r) => {
|
|
168
|
-
const [s, a,
|
|
169
|
-
return s > 255 || a > 255 ||
|
|
160
|
+
const [s, a, c] = [Number(o), Number(n), Number(r)];
|
|
161
|
+
return s > 255 || a > 255 || c > 255 ? i : `#${t(s)}${t(a)}${t(c)}`;
|
|
170
162
|
}).replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3\b/gi, "#$1$2$3");
|
|
171
163
|
},
|
|
172
164
|
priority: 44
|
|
@@ -208,5 +200,5 @@ const f = [
|
|
|
208
200
|
}
|
|
209
201
|
];
|
|
210
202
|
export {
|
|
211
|
-
|
|
203
|
+
d as defaultHtmlCompilerRules
|
|
212
204
|
};
|
package/dist/package.json.js
CHANGED
|
@@ -1,60 +1,63 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
1
|
+
import { useActionsApi as A } from "../composables/useActionsApi.js";
|
|
2
2
|
import { useConfig as S } from "../composables/useConfig.js";
|
|
3
|
-
import { useHttp as
|
|
3
|
+
import { useHttp as E } from "../composables/useHttp.js";
|
|
4
4
|
import { useToaster as x } from "../composables/useToaster.js";
|
|
5
|
-
import { useTranslations as
|
|
6
|
-
import { useHtmlDocumentCountValidator as
|
|
5
|
+
import { useTranslations as P } from "../composables/useTranslations.js";
|
|
6
|
+
import { useHtmlDocumentCountValidator as L } from "../composables/validators/useHtmlDocumentCountValidator.js";
|
|
7
7
|
import { useLiquidValidator as N } from "../composables/validators/useLiquidValidator.js";
|
|
8
8
|
import { EditorType as H } from "../enums/defaults.js";
|
|
9
|
-
import { ToasterTypeOptions as
|
|
9
|
+
import { ToasterTypeOptions as T } from "../enums/toaster.js";
|
|
10
10
|
import { useRecommendationExtensionStore as D } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
11
|
-
import { useSaveAsTemplateStore as
|
|
11
|
+
import { useSaveAsTemplateStore as q } from "../stores/save-as-template.js";
|
|
12
12
|
import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
|
|
13
|
-
import { isPlainObject as
|
|
13
|
+
import { isPlainObject as w } from "../utils/genericUtil.js";
|
|
14
14
|
import { useTemplatePreparation as F } from "../utils/templatePreparation.js";
|
|
15
15
|
const Z = () => {
|
|
16
|
-
const { get:
|
|
16
|
+
const { get: l, post: c } = E(), { handleError: o, showToaster: i } = x(), { config: p, isFeatureEnabled: u } = S(), { validateLiquidSyntax: b } = N(), { validateSingleHtmlDocument: C } = L(), { getTemplateData: h } = A(), n = P();
|
|
17
17
|
return {
|
|
18
18
|
getCategories: async () => {
|
|
19
19
|
try {
|
|
20
|
-
const { data: e
|
|
21
|
-
return e
|
|
20
|
+
const { data: e } = await l("/newsletter/template-library/get-template-categories");
|
|
21
|
+
return Array.isArray(e) ? e : ((!w(e) || e.type !== "alert") && console.error("[TEMPLATE_LIBRARY_API] Unexpected get-template-categories response", e), i({
|
|
22
|
+
message: n("newsletter.template-library-service-error"),
|
|
23
|
+
type: T.Error
|
|
24
|
+
}), []);
|
|
22
25
|
} catch (e) {
|
|
23
|
-
return
|
|
26
|
+
return o(e, "Failed to fetch template categories"), [];
|
|
24
27
|
}
|
|
25
28
|
},
|
|
26
29
|
checkTemplateNameAvailability: async (e) => {
|
|
27
|
-
const { data: { status: t = !1 } } = await
|
|
30
|
+
const { data: { status: t = !1 } } = await l(
|
|
28
31
|
`/newsletter/template-library/template-name-exists?name=${e}`
|
|
29
32
|
);
|
|
30
33
|
return !t;
|
|
31
34
|
},
|
|
32
35
|
createCategory: async (e) => {
|
|
33
36
|
try {
|
|
34
|
-
const { data: { id: t } } = await
|
|
37
|
+
const { data: { id: t } } = await c(
|
|
35
38
|
"/newsletter/template-library/create-category",
|
|
36
39
|
{ name: e }
|
|
37
40
|
);
|
|
38
41
|
return t.toString();
|
|
39
42
|
} catch (t) {
|
|
40
|
-
return
|
|
43
|
+
return o(t, "Failed to create category"), "";
|
|
41
44
|
}
|
|
42
45
|
},
|
|
43
46
|
createTemplate: async () => {
|
|
44
47
|
var e, t, d, y;
|
|
45
48
|
try {
|
|
46
|
-
const { prepareTemplateDetails:
|
|
47
|
-
if (!
|
|
49
|
+
const { prepareTemplateDetails: m } = F(), s = q(), g = await h();
|
|
50
|
+
if (!C(g.html))
|
|
48
51
|
return !1;
|
|
49
|
-
const a = await
|
|
50
|
-
if (
|
|
52
|
+
const a = await m(g);
|
|
53
|
+
if (u("liquidSyntax") && !await b(a.compiledHtml))
|
|
51
54
|
return !1;
|
|
52
|
-
const
|
|
53
|
-
name:
|
|
54
|
-
categories:
|
|
55
|
-
productId: ((t = (e =
|
|
55
|
+
const v = {
|
|
56
|
+
name: s.getTemplateName,
|
|
57
|
+
categories: s.getSelectedCategoryIds,
|
|
58
|
+
productId: ((t = (e = p.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
|
|
56
59
|
editorType: H,
|
|
57
|
-
messageType: ((y = (d =
|
|
60
|
+
messageType: ((y = (d = p.value) == null ? void 0 : d.partner) == null ? void 0 : y.messageType) || 0,
|
|
58
61
|
content: r(a.compiledHtml),
|
|
59
62
|
css: r(a.css),
|
|
60
63
|
unsubscriptionPreferencePageStatus: !1,
|
|
@@ -65,34 +68,34 @@ const Z = () => {
|
|
|
65
68
|
recommendationConfigs: r({}),
|
|
66
69
|
isGuido: !0,
|
|
67
70
|
// eslint-disable-next-line camelcase
|
|
68
|
-
template_engine:
|
|
71
|
+
template_engine: u("liquidSyntax") ? 1 : 0,
|
|
69
72
|
stripoConfig: r({
|
|
70
73
|
editor: "stripo",
|
|
71
74
|
html: a.rawHtml,
|
|
72
75
|
css: a.css,
|
|
73
76
|
dynamicContentList: a.dynamicContentList
|
|
74
77
|
})
|
|
75
|
-
}, { data: f } = await
|
|
78
|
+
}, { data: f } = await c(
|
|
76
79
|
"/newsletter/template-library/create-template",
|
|
77
|
-
|
|
80
|
+
v
|
|
78
81
|
);
|
|
79
|
-
if (!
|
|
82
|
+
if (!w(f))
|
|
80
83
|
throw new Error("Unexpected create-template response");
|
|
81
|
-
return f.type === "alert" ? (
|
|
82
|
-
message:
|
|
84
|
+
return f.type === "alert" ? (i({
|
|
85
|
+
message: n(
|
|
83
86
|
"newsletter.template-library-save-alert",
|
|
84
|
-
{ templateName:
|
|
87
|
+
{ templateName: s.getTemplateName }
|
|
85
88
|
),
|
|
86
|
-
type:
|
|
87
|
-
}), !1) : (
|
|
88
|
-
message:
|
|
89
|
+
type: T.Error
|
|
90
|
+
}), !1) : (i({
|
|
91
|
+
message: n(
|
|
89
92
|
"newsletter.template-library-save-success",
|
|
90
|
-
{ templateName:
|
|
93
|
+
{ templateName: s.getTemplateName }
|
|
91
94
|
),
|
|
92
95
|
type: "success"
|
|
93
96
|
}), !0);
|
|
94
|
-
} catch (
|
|
95
|
-
return
|
|
97
|
+
} catch (m) {
|
|
98
|
+
return o(m, "Failed to create template"), !1;
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
101
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const s = "2.
|
|
1
|
+
const s = "2.83.1", n = ["UIEditor.js", "zone.js", "styles-BWH3PMR4.css", "polyfills-FF3RLU5F.js", "main-OTN2PYRT.js", "chunk-62K3AMOD.js", "chunk-6RGJBGUG.js", "chunk-6W43DTQG.js", "chunk-EC4WGEOZ.js", "chunk-GLBBUJ54.js", "chunk-GPJLJCMF.js", "chunk-MDCDEJUH.js", "chunk-P7HQTFJV.js", "chunk-PA4WGBC4.js", "chunk-QMDAV6OU.js", "chunk-R2F3ADM2.js", "chunk-YSKQ2TWF.js", "chunk-ZU5ASRKR.js", "assets/css/uiEditor.css", "assets/i18n/en.json", "assets/icons/ui-editor-icons.sprite.svg", "assets/icons/ui-editor-icons.map.json", "assets/imageeditor/scripts.min.js", "assets/imageeditor/assets/icons/merged.svg"], i = {
|
|
2
2
|
version: s,
|
|
3
3
|
files: n
|
|
4
4
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.23.0-beta.
|
|
3
|
+
"version": "3.23.0-beta.778056a",
|
|
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",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
},
|
|
129
129
|
"guido": {
|
|
130
130
|
"stripo": {
|
|
131
|
-
"version": "2.
|
|
131
|
+
"version": "2.83.1"
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
const E = /(<[a-z][\w:-]*(?:\s[^>]*?)?\shref\s*=\s*)(["'])([\s\S]*?)\2/gi, c = /^(?:\s| | | )+|(?:\s| | | )+$/gi;
|
|
2
|
-
function a(e) {
|
|
3
|
-
return !e || !/href/i.test(e) ? e : e.replace(E, (i, s, r, n) => {
|
|
4
|
-
const t = n.replace(c, "");
|
|
5
|
-
return `${s}${r}${t}${r}`;
|
|
6
|
-
});
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
a as trimHrefWhitespace
|
|
10
|
-
};
|