@useinsider/guido 3.1.1-beta.e00a22b → 3.1.1-beta.e2f9e0a
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 +0 -1
- package/dist/@types/config/schemas.js +7 -9
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +91 -81
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +35 -45
- package/dist/components/organisms/header/RightSlot.vue.js +10 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +13 -16
- package/dist/composables/useHtmlCompiler.js +16 -18
- package/dist/composables/useSave.js +17 -23
- package/dist/composables/useStripo.js +41 -44
- package/dist/extensions/Blocks/CouponBlock/template.js +13 -24
- package/dist/extensions/DynamicContent/dynamic-content.js +12 -17
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +0 -2
- package/dist/src/stores/config.d.ts +0 -18
- package/dist/src/utils/genericUtil.d.ts +1 -1
- package/dist/static/styles/base.css.js +7 -2
- package/dist/utils/genericUtil.js +20 -42
- package/dist/utils/templatePreparation.js +34 -25
- package/package.json +1 -2
- package/dist/composables/validators/useLiquidValidator.js +0 -42
- package/dist/config/compiler/liquidCompilerRules.js +0 -15
- package/dist/src/composables/validators/useLiquidValidator.d.ts +0 -3
- package/dist/src/config/compiler/liquidCompilerRules.d.ts +0 -2
|
@@ -1,44 +1,53 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useHtmlCompiler as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { useActionsApi as T } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useHtmlCompiler as P } from "../composables/useHtmlCompiler.js";
|
|
3
|
+
import { useRecommendationExtensionStore as A } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
|
+
import { DATA_ATTRIBUTES as l } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
5
|
+
import { parsePageList as h } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
6
|
+
import { useDynamicContentStore as C } from "../stores/dynamic-content.js";
|
|
7
|
+
import { useUnsubscribeStore as D } from "../stores/unsubscribe.js";
|
|
8
|
+
function x(i, e) {
|
|
9
|
+
const r = new DOMParser().parseFromString(i, "text/html").querySelectorAll(`[${l.PAGE_LIST}]`), n = [];
|
|
10
|
+
return r.forEach((t) => {
|
|
11
|
+
const o = t.getAttribute(l.PAGE_LIST);
|
|
12
|
+
o && n.push(...h(o));
|
|
13
|
+
}), e.filter((t) => n.includes(t));
|
|
14
|
+
}
|
|
15
|
+
const I = () => {
|
|
16
|
+
const i = C(), e = D(), { getCompiledEmail: a, getTemplateData: m } = T(), { compileHtml: r } = P();
|
|
8
17
|
return {
|
|
9
18
|
prepareTemplateDetails: async () => {
|
|
10
|
-
const { html:
|
|
19
|
+
const { html: t, ampHtml: o = "", ampErrors: p = [] } = await a({
|
|
11
20
|
minimize: !0,
|
|
12
21
|
resetDataSavedFlag: !1
|
|
13
|
-
}), { html:
|
|
22
|
+
}), { html: u, css: d, syncModulesIds: g = [] } = await m();
|
|
14
23
|
e.selectedUnsubscribePages.length && await e.fetchTemplates();
|
|
15
|
-
const { compiledHtml:
|
|
24
|
+
const { compiledHtml: c, stats: s, appliedRules: S } = r(t), b = i.getSelectedDynamicContentList, f = A();
|
|
16
25
|
return console.debug("HTML Compilation Stats:", {
|
|
17
|
-
originalSize:
|
|
18
|
-
compiledSize:
|
|
19
|
-
reduction: `${
|
|
20
|
-
appliedRules:
|
|
21
|
-
executionTime: `${
|
|
26
|
+
originalSize: s.originalSize,
|
|
27
|
+
compiledSize: s.compiledSize,
|
|
28
|
+
reduction: `${s.reductionPercentage.toFixed(2)}%`,
|
|
29
|
+
appliedRules: S,
|
|
30
|
+
executionTime: `${s.executionTime.toFixed(2)}ms`
|
|
22
31
|
}), {
|
|
23
|
-
dynamicContentList:
|
|
24
|
-
compiledHtml:
|
|
25
|
-
rawHtml:
|
|
26
|
-
css:
|
|
27
|
-
ampHtml:
|
|
28
|
-
ampErrors:
|
|
29
|
-
modules:
|
|
32
|
+
dynamicContentList: b,
|
|
33
|
+
compiledHtml: c,
|
|
34
|
+
rawHtml: u,
|
|
35
|
+
css: d,
|
|
36
|
+
ampHtml: o,
|
|
37
|
+
ampErrors: p,
|
|
38
|
+
modules: g.map(Number),
|
|
30
39
|
recommendation: {
|
|
31
|
-
campaignUrls:
|
|
40
|
+
campaignUrls: f.recommendationCampaignUrls,
|
|
32
41
|
configs: {}
|
|
33
42
|
},
|
|
34
43
|
unsubscribe: {
|
|
35
44
|
status: e.unsubscribePagesStatus,
|
|
36
|
-
config: e.selectedUnsubscribePages
|
|
45
|
+
config: x(c, e.selectedUnsubscribePages)
|
|
37
46
|
}
|
|
38
47
|
};
|
|
39
48
|
}
|
|
40
49
|
};
|
|
41
50
|
};
|
|
42
51
|
export {
|
|
43
|
-
|
|
52
|
+
I as useTemplatePreparation
|
|
44
53
|
};
|
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.e2f9e0a",
|
|
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",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@stripoinc/ui-editor-extensions": "3.5.0",
|
|
36
36
|
"@useinsider/design-system-vue": "1.1.0-beta.73ec2fa",
|
|
37
|
-
"@useinsider/guido": "3.1.1-beta.22d798c",
|
|
38
37
|
"@vueuse/core": "11.3.0",
|
|
39
38
|
"lodash-es": "4.17.21",
|
|
40
39
|
"pinia": "2.3.1",
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ToasterTypeOptions as a } from "../../enums/toaster.js";
|
|
2
|
-
import { base64EncodeWithSpecialChars as u } from "../../utils/base64.js";
|
|
3
|
-
import { useHttp as d } from "../useHttp.js";
|
|
4
|
-
import { useToaster as c } from "../useToaster.js";
|
|
5
|
-
import { useTranslations as p } from "../useTranslations.js";
|
|
6
|
-
const v = () => {
|
|
7
|
-
const { post: i } = d(), { showToaster: e } = c(), s = p();
|
|
8
|
-
return { validateLiquidSyntax: async (o) => {
|
|
9
|
-
try {
|
|
10
|
-
const t = await i("/newsletter/contents/validate-syntax", [{
|
|
11
|
-
identifier: "default",
|
|
12
|
-
syntax: "liquid",
|
|
13
|
-
contents: {
|
|
14
|
-
subject: null,
|
|
15
|
-
preheader: null,
|
|
16
|
-
html: u(o),
|
|
17
|
-
ampHtml: null
|
|
18
|
-
}
|
|
19
|
-
}]);
|
|
20
|
-
if (!Array.isArray(t.data)) {
|
|
21
|
-
const l = t.data;
|
|
22
|
-
return e({
|
|
23
|
-
type: a.Warning,
|
|
24
|
-
message: l.message ?? s("journey-builder.liquid-validation-failed")
|
|
25
|
-
}), !1;
|
|
26
|
-
}
|
|
27
|
-
const [r] = t.data, n = Object.values((r == null ? void 0 : r.errors) ?? {});
|
|
28
|
-
return n.length ? (e({
|
|
29
|
-
type: a.Warning,
|
|
30
|
-
message: n[0].replace(/^line \d+:\s*/, "")
|
|
31
|
-
}), !1) : !0;
|
|
32
|
-
} catch {
|
|
33
|
-
return e({
|
|
34
|
-
type: a.Alert,
|
|
35
|
-
message: s("journey-builder.liquid-validation-failed")
|
|
36
|
-
}), !1;
|
|
37
|
-
}
|
|
38
|
-
} };
|
|
39
|
-
};
|
|
40
|
-
export {
|
|
41
|
-
v as useLiquidValidator
|
|
42
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { COUPON_PLACEHOLDER_LIQUID as e, COUPON_PLACEHOLDER_DEFAULT as i } from "../../extensions/Blocks/CouponBlock/template.js";
|
|
2
|
-
const o = [
|
|
3
|
-
{
|
|
4
|
-
id: "liquid-coupon-code",
|
|
5
|
-
description: "Replace legacy coupon placeholder with liquid syntax",
|
|
6
|
-
type: "replace",
|
|
7
|
-
search: i,
|
|
8
|
-
replacement: e,
|
|
9
|
-
replaceAll: !0,
|
|
10
|
-
priority: 50
|
|
11
|
-
}
|
|
12
|
-
];
|
|
13
|
-
export {
|
|
14
|
-
o as liquidCompilerRules
|
|
15
|
-
};
|