@useinsider/guido 3.9.1-beta.6e7cd3e → 3.9.1-beta.7a75299
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/config/compiler/utils/recommendationCompilerUtils.js +106 -119
- package/dist/enums/defaults.js +7 -4
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +75 -69
- package/dist/services/blankTemplate.js +34 -0
- package/dist/services/stripoApi.js +13 -18
- package/dist/src/enums/defaults.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +6 -0
- package/dist/src/services/blankTemplate.d.ts +11 -0
- package/package.json +1 -1
- package/dist/static/templates/empty/index.html.js +0 -74
- package/dist/static/templates/empty/style.css.js +0 -779
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { useHttp as d } from "../composables/useHttp.js";
|
|
2
2
|
import { useToaster as m } from "../composables/useToaster.js";
|
|
3
3
|
import { MAX_DEFAULT_TEMPLATE_ID as y } from "../enums/defaults.js";
|
|
4
|
-
import f from "
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const { get: s, post: c } = d(), { handleError: r } = m();
|
|
4
|
+
import { useBlankTemplate as f } from "./blankTemplate.js";
|
|
5
|
+
const D = () => {
|
|
6
|
+
const { get: s, post: u } = d(), { handleError: r } = m(), { getBlankTemplate: o } = f();
|
|
8
7
|
return {
|
|
9
8
|
getToken: async () => {
|
|
10
9
|
try {
|
|
@@ -26,18 +25,14 @@ const E = () => {
|
|
|
26
25
|
}
|
|
27
26
|
},
|
|
28
27
|
getDefaultTemplate: async () => {
|
|
29
|
-
const t = {
|
|
30
|
-
html: f,
|
|
31
|
-
css: g
|
|
32
|
-
};
|
|
33
28
|
try {
|
|
34
|
-
const
|
|
35
|
-
if (!i && !
|
|
36
|
-
return
|
|
37
|
-
const
|
|
38
|
-
return !
|
|
39
|
-
} catch (
|
|
40
|
-
return r(
|
|
29
|
+
const t = new URLSearchParams(window.location.search), e = t.get("default-template"), l = t.get("master"), n = e ? parseInt(e) : 0, i = n >= 1 && n <= y ? n : 0;
|
|
30
|
+
if (!i && !l)
|
|
31
|
+
return await o();
|
|
32
|
+
const p = `/stripo/default-template/${i}`, { data: c } = await s(p), a = typeof c == "string" ? JSON.parse(c) : c;
|
|
33
|
+
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? await o() : a;
|
|
34
|
+
} catch (t) {
|
|
35
|
+
return r(t, "Failed to fetch default template"), o();
|
|
41
36
|
}
|
|
42
37
|
},
|
|
43
38
|
getSyncModulesStatus: async () => {
|
|
@@ -50,7 +45,7 @@ const E = () => {
|
|
|
50
45
|
},
|
|
51
46
|
updateSyncModule: async (t) => {
|
|
52
47
|
try {
|
|
53
|
-
return await
|
|
48
|
+
return await u(`/stripo/stripo-modules/${t.moduleId}/update`), !0;
|
|
54
49
|
} catch (e) {
|
|
55
50
|
return r(e, "Failed to update sync module"), !1;
|
|
56
51
|
}
|
|
@@ -71,7 +66,7 @@ const E = () => {
|
|
|
71
66
|
if (t.length === 0)
|
|
72
67
|
return !0;
|
|
73
68
|
try {
|
|
74
|
-
return await
|
|
69
|
+
return await u("/stripo/stripo-modules/set-unsubscription-preference-pages", t), !0;
|
|
75
70
|
} catch (e) {
|
|
76
71
|
return r(e, "Failed to set unsubscription preference pages"), !1;
|
|
77
72
|
}
|
|
@@ -79,5 +74,5 @@ const E = () => {
|
|
|
79
74
|
};
|
|
80
75
|
};
|
|
81
76
|
export {
|
|
82
|
-
|
|
77
|
+
D as useStripoApi
|
|
83
78
|
};
|
|
@@ -8,6 +8,9 @@ export declare const TemplateTypes: {
|
|
|
8
8
|
};
|
|
9
9
|
export declare const EditorType: number;
|
|
10
10
|
export declare const MAX_DEFAULT_TEMPLATE_ID = 13;
|
|
11
|
+
export declare const EMAIL_STATIC_BASE_URL = "https://email-static.useinsider.com";
|
|
12
|
+
export declare const BLANK_TEMPLATE_HTML_URL = "https://email-static.useinsider.com/templates/campaign/default.html";
|
|
13
|
+
export declare const BLANK_TEMPLATE_CSS_URL = "https://email-static.useinsider.com/templates/campaign/default.css";
|
|
11
14
|
export declare const ProductIds: Record<string, number>;
|
|
12
15
|
export declare const ModuleFolderDefaults: {
|
|
13
16
|
readonly SAVED_MODULES: "savedModules";
|
|
@@ -51,6 +51,12 @@ export declare function captureCellAlignments(node: ImmutableHtmlNode | null | u
|
|
|
51
51
|
* text-trim) keyed by composition key, so a regeneration can re-bake them
|
|
52
52
|
* instead of resetting to the renderer's hardcoded spacing classes. Stripo stores padding
|
|
53
53
|
* and margin as these classes (NOT inline style), so an inline-style capture misses them.
|
|
54
|
+
*
|
|
55
|
+
* Inline price mode: the merged columns carry POSITIONAL spacing classes
|
|
56
|
+
* (`es-p15l es-p5r` / `es-p5l es-p15r`) that build the side-by-side gap — layout
|
|
57
|
+
* mechanics, not user padding. Skip the price cells then, so toggling back to
|
|
58
|
+
* stacked resets them to the renderer defaults instead of baking the lopsided
|
|
59
|
+
* inline paddings (SD-145161).
|
|
54
60
|
*/
|
|
55
61
|
export declare function captureCellClasses(node: ImmutableHtmlNode | null | undefined): Record<string, string>;
|
|
56
62
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Template } from '@@/Types/stripo';
|
|
2
|
+
/**
|
|
3
|
+
* Fetches the blank starter template (html + css) from the email CDN — the single
|
|
4
|
+
* source of truth shared with email-fe. Retries a few times, caches the result for
|
|
5
|
+
* the session, and on persistent failure returns an empty template (the editor still
|
|
6
|
+
* opens) plus a toaster. Kept separate from stripoApi: this is a CDN asset fetch, not
|
|
7
|
+
* a Stripo backend call.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useBlankTemplate: () => {
|
|
10
|
+
getBlankTemplate: () => Promise<Template>;
|
|
11
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.9.1-beta.
|
|
3
|
+
"version": "3.9.1-beta.7a75299",
|
|
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",
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const t = `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
|
-
<html>
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta content="width=device-width, initial-scale=1" name="viewport">
|
|
7
|
-
<meta name="x-apple-disable-message-reformatting">
|
|
8
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
9
|
-
<meta content="telephone=no" name="format-detection">
|
|
10
|
-
<title></title>
|
|
11
|
-
<!--[if (mso 16)]><style type="text/css">a{text-decoration:none}</style><![endif]-->
|
|
12
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
13
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
14
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
15
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
16
|
-
<!--[if gte mso 9]><style>sup { font-size: 100% !important; }</style><![endif]-->
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<div class="es-wrapper-color">
|
|
21
|
-
<!--[if gte mso 9]>
|
|
22
|
-
<v:background xmlns:v="urn:schemas-microsoft-com:vml" fill="t">
|
|
23
|
-
<v:fill type="tile" color="#f6f6f6"></v:fill>
|
|
24
|
-
</v:background>
|
|
25
|
-
<![endif]-->
|
|
26
|
-
<table class="es-wrapper" width="100%" cellspacing="0" cellpadding="0">
|
|
27
|
-
<tbody>
|
|
28
|
-
<tr>
|
|
29
|
-
<td class="esd-email-paddings" valign="top">
|
|
30
|
-
<table class="es-content esd-footer-popover" cellspacing="0" cellpadding="0" align="center">
|
|
31
|
-
<tbody>
|
|
32
|
-
<tr>
|
|
33
|
-
<td class="esd-stripe" align="center">
|
|
34
|
-
<table class="es-content-body" width="600" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center">
|
|
35
|
-
<tbody>
|
|
36
|
-
<tr>
|
|
37
|
-
<td class="esd-structure es-p20" align="left">
|
|
38
|
-
<table cellpadding="0" cellspacing="0" width="100%">
|
|
39
|
-
<tbody>
|
|
40
|
-
<tr>
|
|
41
|
-
<td width="560" class="esd-container-frame" align="center" valign="top">
|
|
42
|
-
<table cellpadding="0" cellspacing="0" width="100%">
|
|
43
|
-
<tbody>
|
|
44
|
-
<tr>
|
|
45
|
-
<td align="center" class="esd-empty-container" style="display: none;"></td>
|
|
46
|
-
</tr>
|
|
47
|
-
</tbody>
|
|
48
|
-
</table>
|
|
49
|
-
</td>
|
|
50
|
-
</tr>
|
|
51
|
-
</tbody>
|
|
52
|
-
</table>
|
|
53
|
-
</td>
|
|
54
|
-
</tr>
|
|
55
|
-
</tbody>
|
|
56
|
-
</table>
|
|
57
|
-
</td>
|
|
58
|
-
</tr>
|
|
59
|
-
</tbody>
|
|
60
|
-
</table>
|
|
61
|
-
</td>
|
|
62
|
-
</tr>
|
|
63
|
-
</tbody>
|
|
64
|
-
</table>
|
|
65
|
-
</div>
|
|
66
|
-
<div style="position: absolute; left: -9999px; top: -9999px; margin: 0px;"></div>
|
|
67
|
-
<div style="position: absolute; left: -9999px; top: -9999px; margin: 0px; padding: 0px; border: 0px none; width: 1px;"></div>
|
|
68
|
-
</body>
|
|
69
|
-
|
|
70
|
-
</html>
|
|
71
|
-
`;
|
|
72
|
-
export {
|
|
73
|
-
t as default
|
|
74
|
-
};
|