@useinsider/guido 2.1.0-beta.ff1bc98 → 2.1.0-beta.ff20f87
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 +36 -0
- package/dist/@types/config/schemas.js +70 -65
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +69 -58
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +19 -19
- package/dist/composables/useBlocksConfig.js +26 -16
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +22 -17
- package/dist/config/migrator/itemsBlockMigrator.js +101 -97
- package/dist/enums/defaults.js +8 -4
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +25 -30
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +20 -25
- package/dist/extensions/Blocks/Unsubscribe/block.js +29 -29
- package/dist/extensions/Blocks/Unsubscribe/control.js +12 -9
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +13 -11
- package/dist/extensions/Blocks/Unsubscribe/styles.css.js +31 -1
- package/dist/extensions/ModulesTabIcons/extension.js +17 -0
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +204 -136
- package/dist/services/stripoApi.js +20 -17
- package/dist/src/@types/config/schemas.d.ts +8 -0
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/enums/defaults.d.ts +4 -0
- package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
- package/dist/src/extensions/ModulesTabIcons/extension.d.ts +2 -0
- package/dist/src/stores/config.d.ts +36 -0
- package/dist/static/templates/empty/index.html.js +74 -0
- package/dist/static/templates/empty/style.css.js +779 -0
- package/dist/stores/unsubscribe.js +37 -34
- package/package.json +1 -1
|
@@ -1,44 +1,47 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { MAX_DEFAULT_TEMPLATE_ID as
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { useHttp as l } from "../composables/useHttp.js";
|
|
2
|
+
import { useToaster as u } from "../composables/useToaster.js";
|
|
3
|
+
import { MAX_DEFAULT_TEMPLATE_ID as d } from "../enums/defaults.js";
|
|
4
|
+
import f from "../static/templates/empty/index.html.js";
|
|
5
|
+
import g from "../static/templates/empty/style.css.js";
|
|
6
|
+
const D = () => {
|
|
7
|
+
const { get: o } = l(), { handleError: a } = u();
|
|
6
8
|
return {
|
|
7
9
|
getToken: async () => {
|
|
8
10
|
try {
|
|
9
|
-
const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await
|
|
11
|
+
const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await o(`/stripo/get-user-token?test=${t}`);
|
|
10
12
|
return e.body.token;
|
|
11
13
|
} catch (t) {
|
|
12
|
-
return
|
|
14
|
+
return a(t, "Failed to fetch token"), "";
|
|
13
15
|
}
|
|
14
16
|
},
|
|
15
17
|
getCustomFonts: async () => {
|
|
16
18
|
try {
|
|
17
|
-
const { data: t = [] } = await
|
|
19
|
+
const { data: t = [] } = await o("/stripo/get-partner-custom-fonts");
|
|
18
20
|
return t.map((e) => ({
|
|
19
21
|
...e,
|
|
20
22
|
active: !0
|
|
21
23
|
}));
|
|
22
24
|
} catch (t) {
|
|
23
|
-
return
|
|
25
|
+
return a(t, "Failed to fetch custom fonts"), [];
|
|
24
26
|
}
|
|
25
27
|
},
|
|
26
28
|
getDefaultTemplate: async () => {
|
|
27
29
|
const t = {
|
|
28
|
-
html:
|
|
29
|
-
css:
|
|
30
|
+
html: f,
|
|
31
|
+
css: g
|
|
30
32
|
};
|
|
31
33
|
try {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const e = new URLSearchParams(window.location.search), c = e.get("default-template"), p = e.get("master"), s = c ? parseInt(c) : 0, m = s >= 1 && s <= d ? s : 0;
|
|
35
|
+
if (!m && !p)
|
|
36
|
+
return t;
|
|
37
|
+
const i = `/stripo/default-template/${m}`, { data: n } = await o(i), r = typeof n == "string" ? JSON.parse(n) : n;
|
|
38
|
+
return !r || typeof r != "object" || !("html" in r) || !("css" in r) ? t : r;
|
|
36
39
|
} catch (e) {
|
|
37
|
-
return
|
|
40
|
+
return a(e, "Failed to fetch default template"), t;
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
};
|
|
41
44
|
};
|
|
42
45
|
export {
|
|
43
|
-
|
|
46
|
+
D as useStripoApi
|
|
44
47
|
};
|
|
@@ -129,6 +129,10 @@ export declare const EditorSchema: v.ObjectSchema<{
|
|
|
129
129
|
readonly senderName: "";
|
|
130
130
|
readonly subject: "";
|
|
131
131
|
}>;
|
|
132
|
+
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
133
|
+
readonly savedModulesFolderName: v.OptionalSchema<v.StringSchema<undefined>, "savedModules">;
|
|
134
|
+
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
135
|
+
readonly defaultModulesFolderName: v.OptionalSchema<v.StringSchema<undefined>, "defaultModules">;
|
|
132
136
|
}, undefined>;
|
|
133
137
|
/**
|
|
134
138
|
* UI configuration - visual elements and layout
|
|
@@ -441,6 +445,10 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
441
445
|
readonly senderName: "";
|
|
442
446
|
readonly subject: "";
|
|
443
447
|
}>;
|
|
448
|
+
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
449
|
+
readonly savedModulesFolderName: v.OptionalSchema<v.StringSchema<undefined>, "savedModules">;
|
|
450
|
+
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
451
|
+
readonly defaultModulesFolderName: v.OptionalSchema<v.StringSchema<undefined>, "defaultModules">;
|
|
444
452
|
}, undefined>, {}>;
|
|
445
453
|
/** UI configuration */
|
|
446
454
|
readonly ui: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -41,6 +41,8 @@ export declare const useConfig: () => {
|
|
|
41
41
|
senderName: string;
|
|
42
42
|
subject: string;
|
|
43
43
|
};
|
|
44
|
+
savedModulesFolderName: string;
|
|
45
|
+
defaultModulesFolderName: string;
|
|
44
46
|
};
|
|
45
47
|
ui: {
|
|
46
48
|
showHeader: boolean;
|
|
@@ -130,6 +132,8 @@ export declare const useConfig: () => {
|
|
|
130
132
|
senderName: string;
|
|
131
133
|
subject: string;
|
|
132
134
|
};
|
|
135
|
+
savedModulesFolderName: string;
|
|
136
|
+
defaultModulesFolderName: string;
|
|
133
137
|
} | null>;
|
|
134
138
|
ui: import("vue").ComputedRef<{
|
|
135
139
|
showHeader: boolean;
|
|
@@ -9,3 +9,7 @@ export declare const TemplateTypes: {
|
|
|
9
9
|
export declare const EditorType: number;
|
|
10
10
|
export declare const MAX_DEFAULT_TEMPLATE_ID = 13;
|
|
11
11
|
export declare const ProductIds: Record<string, number>;
|
|
12
|
+
export declare const ModuleFolderDefaults: {
|
|
13
|
+
readonly SAVED_MODULES: "savedModules";
|
|
14
|
+
readonly DEFAULT_MODULES: "defaultModules";
|
|
15
|
+
};
|
|
@@ -46,6 +46,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
46
46
|
senderName: string;
|
|
47
47
|
subject: string;
|
|
48
48
|
};
|
|
49
|
+
savedModulesFolderName: string;
|
|
50
|
+
defaultModulesFolderName: string;
|
|
49
51
|
};
|
|
50
52
|
ui: {
|
|
51
53
|
showHeader: boolean;
|
|
@@ -141,6 +143,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
141
143
|
senderName: string;
|
|
142
144
|
subject: string;
|
|
143
145
|
};
|
|
146
|
+
savedModulesFolderName: string;
|
|
147
|
+
defaultModulesFolderName: string;
|
|
144
148
|
};
|
|
145
149
|
ui: {
|
|
146
150
|
showHeader: boolean;
|
|
@@ -236,6 +240,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
236
240
|
senderName: string;
|
|
237
241
|
subject: string;
|
|
238
242
|
};
|
|
243
|
+
savedModulesFolderName: string;
|
|
244
|
+
defaultModulesFolderName: string;
|
|
239
245
|
};
|
|
240
246
|
ui: {
|
|
241
247
|
showHeader: boolean;
|
|
@@ -331,6 +337,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
331
337
|
senderName: string;
|
|
332
338
|
subject: string;
|
|
333
339
|
};
|
|
340
|
+
savedModulesFolderName: string;
|
|
341
|
+
defaultModulesFolderName: string;
|
|
334
342
|
};
|
|
335
343
|
ui: {
|
|
336
344
|
showHeader: boolean;
|
|
@@ -426,6 +434,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
426
434
|
senderName: string;
|
|
427
435
|
subject: string;
|
|
428
436
|
};
|
|
437
|
+
savedModulesFolderName: string;
|
|
438
|
+
defaultModulesFolderName: string;
|
|
429
439
|
};
|
|
430
440
|
ui: {
|
|
431
441
|
showHeader: boolean;
|
|
@@ -521,6 +531,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
521
531
|
senderName: string;
|
|
522
532
|
subject: string;
|
|
523
533
|
};
|
|
534
|
+
savedModulesFolderName: string;
|
|
535
|
+
defaultModulesFolderName: string;
|
|
524
536
|
};
|
|
525
537
|
ui: {
|
|
526
538
|
showHeader: boolean;
|
|
@@ -616,6 +628,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
616
628
|
senderName: string;
|
|
617
629
|
subject: string;
|
|
618
630
|
};
|
|
631
|
+
savedModulesFolderName: string;
|
|
632
|
+
defaultModulesFolderName: string;
|
|
619
633
|
};
|
|
620
634
|
ui: {
|
|
621
635
|
showHeader: boolean;
|
|
@@ -711,6 +725,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
711
725
|
senderName: string;
|
|
712
726
|
subject: string;
|
|
713
727
|
};
|
|
728
|
+
savedModulesFolderName: string;
|
|
729
|
+
defaultModulesFolderName: string;
|
|
714
730
|
};
|
|
715
731
|
ui: {
|
|
716
732
|
showHeader: boolean;
|
|
@@ -806,6 +822,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
806
822
|
senderName: string;
|
|
807
823
|
subject: string;
|
|
808
824
|
};
|
|
825
|
+
savedModulesFolderName: string;
|
|
826
|
+
defaultModulesFolderName: string;
|
|
809
827
|
};
|
|
810
828
|
ui: {
|
|
811
829
|
showHeader: boolean;
|
|
@@ -901,6 +919,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
901
919
|
senderName: string;
|
|
902
920
|
subject: string;
|
|
903
921
|
};
|
|
922
|
+
savedModulesFolderName: string;
|
|
923
|
+
defaultModulesFolderName: string;
|
|
904
924
|
};
|
|
905
925
|
ui: {
|
|
906
926
|
showHeader: boolean;
|
|
@@ -996,6 +1016,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
996
1016
|
senderName: string;
|
|
997
1017
|
subject: string;
|
|
998
1018
|
};
|
|
1019
|
+
savedModulesFolderName: string;
|
|
1020
|
+
defaultModulesFolderName: string;
|
|
999
1021
|
};
|
|
1000
1022
|
ui: {
|
|
1001
1023
|
showHeader: boolean;
|
|
@@ -1091,6 +1113,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1091
1113
|
senderName: string;
|
|
1092
1114
|
subject: string;
|
|
1093
1115
|
};
|
|
1116
|
+
savedModulesFolderName: string;
|
|
1117
|
+
defaultModulesFolderName: string;
|
|
1094
1118
|
};
|
|
1095
1119
|
ui: {
|
|
1096
1120
|
showHeader: boolean;
|
|
@@ -1186,6 +1210,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1186
1210
|
senderName: string;
|
|
1187
1211
|
subject: string;
|
|
1188
1212
|
};
|
|
1213
|
+
savedModulesFolderName: string;
|
|
1214
|
+
defaultModulesFolderName: string;
|
|
1189
1215
|
};
|
|
1190
1216
|
ui: {
|
|
1191
1217
|
showHeader: boolean;
|
|
@@ -1281,6 +1307,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1281
1307
|
senderName: string;
|
|
1282
1308
|
subject: string;
|
|
1283
1309
|
};
|
|
1310
|
+
savedModulesFolderName: string;
|
|
1311
|
+
defaultModulesFolderName: string;
|
|
1284
1312
|
};
|
|
1285
1313
|
ui: {
|
|
1286
1314
|
showHeader: boolean;
|
|
@@ -1376,6 +1404,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1376
1404
|
senderName: string;
|
|
1377
1405
|
subject: string;
|
|
1378
1406
|
};
|
|
1407
|
+
savedModulesFolderName: string;
|
|
1408
|
+
defaultModulesFolderName: string;
|
|
1379
1409
|
};
|
|
1380
1410
|
ui: {
|
|
1381
1411
|
showHeader: boolean;
|
|
@@ -1471,6 +1501,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1471
1501
|
senderName: string;
|
|
1472
1502
|
subject: string;
|
|
1473
1503
|
};
|
|
1504
|
+
savedModulesFolderName: string;
|
|
1505
|
+
defaultModulesFolderName: string;
|
|
1474
1506
|
};
|
|
1475
1507
|
ui: {
|
|
1476
1508
|
showHeader: boolean;
|
|
@@ -1566,6 +1598,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1566
1598
|
senderName: string;
|
|
1567
1599
|
subject: string;
|
|
1568
1600
|
};
|
|
1601
|
+
savedModulesFolderName: string;
|
|
1602
|
+
defaultModulesFolderName: string;
|
|
1569
1603
|
};
|
|
1570
1604
|
ui: {
|
|
1571
1605
|
showHeader: boolean;
|
|
@@ -1661,6 +1695,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1661
1695
|
senderName: string;
|
|
1662
1696
|
subject: string;
|
|
1663
1697
|
};
|
|
1698
|
+
savedModulesFolderName: string;
|
|
1699
|
+
defaultModulesFolderName: string;
|
|
1664
1700
|
};
|
|
1665
1701
|
ui: {
|
|
1666
1702
|
showHeader: boolean;
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
};
|