@useinsider/guido 3.23.0-beta.6555b16 → 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/package.json.js
CHANGED
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
1
|
+
import { useActionsApi as A } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useConfig as S } from "../composables/useConfig.js";
|
|
3
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
|
|
7
|
-
import { useLiquidValidator as
|
|
8
|
-
import { EditorType as
|
|
5
|
+
import { useTranslations as P } from "../composables/useTranslations.js";
|
|
6
|
+
import { useHtmlDocumentCountValidator as L } from "../composables/validators/useHtmlDocumentCountValidator.js";
|
|
7
|
+
import { useLiquidValidator as N } from "../composables/validators/useLiquidValidator.js";
|
|
8
|
+
import { EditorType as H } from "../enums/defaults.js";
|
|
9
9
|
import { ToasterTypeOptions as T } from "../enums/toaster.js";
|
|
10
|
-
import { useRecommendationExtensionStore as
|
|
10
|
+
import { useRecommendationExtensionStore as D } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
11
11
|
import { useSaveAsTemplateStore as q } from "../stores/save-as-template.js";
|
|
12
12
|
import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
|
|
13
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 } = await
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
throw new Error("Unexpected get-template-categories response");
|
|
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
|
+
}), []);
|
|
26
25
|
} catch (e) {
|
|
27
26
|
return o(e, "Failed to fetch template categories"), [];
|
|
28
27
|
}
|
|
29
28
|
},
|
|
30
29
|
checkTemplateNameAvailability: async (e) => {
|
|
31
|
-
const { data: { status: t = !1 } } = await
|
|
30
|
+
const { data: { status: t = !1 } } = await l(
|
|
32
31
|
`/newsletter/template-library/template-name-exists?name=${e}`
|
|
33
32
|
);
|
|
34
33
|
return !t;
|
|
35
34
|
},
|
|
36
35
|
createCategory: async (e) => {
|
|
37
36
|
try {
|
|
38
|
-
const { data: { id: t } } = await
|
|
37
|
+
const { data: { id: t } } = await c(
|
|
39
38
|
"/newsletter/template-library/create-category",
|
|
40
39
|
{ name: e }
|
|
41
40
|
);
|
|
@@ -47,56 +46,56 @@ const Z = () => {
|
|
|
47
46
|
createTemplate: async () => {
|
|
48
47
|
var e, t, d, y;
|
|
49
48
|
try {
|
|
50
|
-
const { prepareTemplateDetails:
|
|
51
|
-
if (!
|
|
49
|
+
const { prepareTemplateDetails: m } = F(), s = q(), g = await h();
|
|
50
|
+
if (!C(g.html))
|
|
52
51
|
return !1;
|
|
53
|
-
const a = await
|
|
54
|
-
if (
|
|
52
|
+
const a = await m(g);
|
|
53
|
+
if (u("liquidSyntax") && !await b(a.compiledHtml))
|
|
55
54
|
return !1;
|
|
56
|
-
const
|
|
55
|
+
const v = {
|
|
57
56
|
name: s.getTemplateName,
|
|
58
57
|
categories: s.getSelectedCategoryIds,
|
|
59
|
-
productId: ((t = (e =
|
|
60
|
-
editorType:
|
|
61
|
-
messageType: ((y = (d =
|
|
58
|
+
productId: ((t = (e = p.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
|
|
59
|
+
editorType: H,
|
|
60
|
+
messageType: ((y = (d = p.value) == null ? void 0 : d.partner) == null ? void 0 : y.messageType) || 0,
|
|
62
61
|
content: r(a.compiledHtml),
|
|
63
62
|
css: r(a.css),
|
|
64
63
|
unsubscriptionPreferencePageStatus: !1,
|
|
65
64
|
unsubscriptionPreferencePages: [],
|
|
66
65
|
recommendationCampaignUrls: r(
|
|
67
|
-
|
|
66
|
+
D().recommendationCampaignUrls
|
|
68
67
|
),
|
|
69
68
|
recommendationConfigs: r({}),
|
|
70
69
|
isGuido: !0,
|
|
71
70
|
// eslint-disable-next-line camelcase
|
|
72
|
-
template_engine:
|
|
71
|
+
template_engine: u("liquidSyntax") ? 1 : 0,
|
|
73
72
|
stripoConfig: r({
|
|
74
73
|
editor: "stripo",
|
|
75
74
|
html: a.rawHtml,
|
|
76
75
|
css: a.css,
|
|
77
76
|
dynamicContentList: a.dynamicContentList
|
|
78
77
|
})
|
|
79
|
-
}, { data: f } = await
|
|
78
|
+
}, { data: f } = await c(
|
|
80
79
|
"/newsletter/template-library/create-template",
|
|
81
|
-
|
|
80
|
+
v
|
|
82
81
|
);
|
|
83
82
|
if (!w(f))
|
|
84
83
|
throw new Error("Unexpected create-template response");
|
|
85
84
|
return f.type === "alert" ? (i({
|
|
86
|
-
message:
|
|
85
|
+
message: n(
|
|
87
86
|
"newsletter.template-library-save-alert",
|
|
88
87
|
{ templateName: s.getTemplateName }
|
|
89
88
|
),
|
|
90
89
|
type: T.Error
|
|
91
90
|
}), !1) : (i({
|
|
92
|
-
message:
|
|
91
|
+
message: n(
|
|
93
92
|
"newsletter.template-library-save-success",
|
|
94
93
|
{ templateName: s.getTemplateName }
|
|
95
94
|
),
|
|
96
95
|
type: "success"
|
|
97
96
|
}), !0);
|
|
98
|
-
} catch (
|
|
99
|
-
return o(
|
|
97
|
+
} catch (m) {
|
|
98
|
+
return o(m, "Failed to create template"), !1;
|
|
100
99
|
}
|
|
101
100
|
}
|
|
102
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
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTemplateLibraryApi as o } from "../services/templateLibraryApi.js";
|
|
2
|
-
import { defineStore as
|
|
3
|
-
const
|
|
2
|
+
import { defineStore as i } from "pinia";
|
|
3
|
+
const r = () => ({
|
|
4
4
|
templateName: "",
|
|
5
5
|
categories: [],
|
|
6
6
|
selectedCategories: [],
|
|
@@ -17,8 +17,8 @@ const i = () => ({
|
|
|
17
17
|
editor: 2,
|
|
18
18
|
message: 1
|
|
19
19
|
}
|
|
20
|
-
}), g =
|
|
21
|
-
state: () =>
|
|
20
|
+
}), g = i("guidoSaveAsTemplate", {
|
|
21
|
+
state: () => r(),
|
|
22
22
|
getters: {
|
|
23
23
|
getTemplateName: (e) => e.templateName.trim(),
|
|
24
24
|
getSelectedCategoryIds: (e) => e.selectedCategories.map((a) => Number(a.value))
|
|
@@ -26,7 +26,7 @@ const i = () => ({
|
|
|
26
26
|
actions: {
|
|
27
27
|
async fetchCategories() {
|
|
28
28
|
const { getCategories: e } = o(), a = await e();
|
|
29
|
-
this.categories =
|
|
29
|
+
this.categories = a.map((t) => ({
|
|
30
30
|
value: t.id.toString(),
|
|
31
31
|
text: t.name
|
|
32
32
|
})).sort((t, s) => t.text.localeCompare(s.text));
|
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
|
}
|