@useinsider/guido 3.1.1-beta.cdcd41d → 3.1.1-beta.d3c42de
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 +1 -0
- package/dist/@types/config/schemas.js +69 -61
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
- package/dist/components/organisms/header/RightSlot.vue.js +10 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +16 -13
- package/dist/composables/useHtmlCompiler.js +23 -21
- package/dist/composables/usePreviewMode.js +20 -16
- package/dist/composables/useSave.js +23 -15
- package/dist/composables/useStripo.js +32 -32
- package/dist/composables/validators/useLiquidValidator.js +36 -0
- package/dist/config/compiler/liquidCompilerRules.js +15 -0
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +53 -55
- package/dist/config/migrator/checkboxMigrator.js +5 -3
- package/dist/config/migrator/radioButtonMigrator.js +14 -12
- package/dist/enums/recommendation.js +2 -2
- package/dist/extensions/Blocks/CouponBlock/template.js +24 -13
- package/dist/extensions/Blocks/Recommendation/block.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +185 -172
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +95 -93
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +75 -73
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +7 -5
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -29
- package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +3 -1
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +20 -20
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -50
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +16 -17
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/index.d.ts +1 -1
- package/dist/src/@types/config/schemas.d.ts +20 -0
- package/dist/src/@types/config/types.d.ts +3 -1
- package/dist/src/composables/useConfig.d.ts +8 -0
- package/dist/src/composables/validators/useLiquidValidator.d.ts +3 -0
- package/dist/src/config/compiler/liquidCompilerRules.d.ts +2 -0
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
- package/dist/src/stores/config.d.ts +72 -0
- package/dist/src/stores/preview.d.ts +3 -0
- package/dist/src/utils/htmlCompiler.d.ts +2 -1
- package/dist/stores/preview.js +4 -3
- package/dist/utils/htmlCompiler.js +48 -41
- package/dist/utils/templatePreparation.js +20 -20
- package/package.json +1 -1
|
@@ -22,6 +22,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
22
22
|
productType: 60 | 49 | 97;
|
|
23
23
|
messageType: 1 | 2;
|
|
24
24
|
username: string;
|
|
25
|
+
fallbackFont?: {
|
|
26
|
+
name: string;
|
|
27
|
+
family: string;
|
|
28
|
+
} | undefined;
|
|
25
29
|
};
|
|
26
30
|
template: {
|
|
27
31
|
html: string;
|
|
@@ -121,6 +125,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
121
125
|
productType: 60 | 49 | 97;
|
|
122
126
|
messageType: 1 | 2;
|
|
123
127
|
username: string;
|
|
128
|
+
fallbackFont?: {
|
|
129
|
+
name: string;
|
|
130
|
+
family: string;
|
|
131
|
+
} | undefined;
|
|
124
132
|
};
|
|
125
133
|
template: {
|
|
126
134
|
html: string;
|
|
@@ -220,6 +228,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
220
228
|
productType: 60 | 49 | 97;
|
|
221
229
|
messageType: 1 | 2;
|
|
222
230
|
username: string;
|
|
231
|
+
fallbackFont?: {
|
|
232
|
+
name: string;
|
|
233
|
+
family: string;
|
|
234
|
+
} | undefined;
|
|
223
235
|
};
|
|
224
236
|
template: {
|
|
225
237
|
html: string;
|
|
@@ -319,6 +331,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
319
331
|
productType: 60 | 49 | 97;
|
|
320
332
|
messageType: 1 | 2;
|
|
321
333
|
username: string;
|
|
334
|
+
fallbackFont?: {
|
|
335
|
+
name: string;
|
|
336
|
+
family: string;
|
|
337
|
+
} | undefined;
|
|
322
338
|
};
|
|
323
339
|
template: {
|
|
324
340
|
html: string;
|
|
@@ -418,6 +434,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
418
434
|
productType: 60 | 49 | 97;
|
|
419
435
|
messageType: 1 | 2;
|
|
420
436
|
username: string;
|
|
437
|
+
fallbackFont?: {
|
|
438
|
+
name: string;
|
|
439
|
+
family: string;
|
|
440
|
+
} | undefined;
|
|
421
441
|
};
|
|
422
442
|
template: {
|
|
423
443
|
html: string;
|
|
@@ -517,6 +537,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
517
537
|
productType: 60 | 49 | 97;
|
|
518
538
|
messageType: 1 | 2;
|
|
519
539
|
username: string;
|
|
540
|
+
fallbackFont?: {
|
|
541
|
+
name: string;
|
|
542
|
+
family: string;
|
|
543
|
+
} | undefined;
|
|
520
544
|
};
|
|
521
545
|
template: {
|
|
522
546
|
html: string;
|
|
@@ -616,6 +640,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
616
640
|
productType: 60 | 49 | 97;
|
|
617
641
|
messageType: 1 | 2;
|
|
618
642
|
username: string;
|
|
643
|
+
fallbackFont?: {
|
|
644
|
+
name: string;
|
|
645
|
+
family: string;
|
|
646
|
+
} | undefined;
|
|
619
647
|
};
|
|
620
648
|
template: {
|
|
621
649
|
html: string;
|
|
@@ -715,6 +743,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
715
743
|
productType: 60 | 49 | 97;
|
|
716
744
|
messageType: 1 | 2;
|
|
717
745
|
username: string;
|
|
746
|
+
fallbackFont?: {
|
|
747
|
+
name: string;
|
|
748
|
+
family: string;
|
|
749
|
+
} | undefined;
|
|
718
750
|
};
|
|
719
751
|
template: {
|
|
720
752
|
html: string;
|
|
@@ -814,6 +846,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
814
846
|
productType: 60 | 49 | 97;
|
|
815
847
|
messageType: 1 | 2;
|
|
816
848
|
username: string;
|
|
849
|
+
fallbackFont?: {
|
|
850
|
+
name: string;
|
|
851
|
+
family: string;
|
|
852
|
+
} | undefined;
|
|
817
853
|
};
|
|
818
854
|
template: {
|
|
819
855
|
html: string;
|
|
@@ -913,6 +949,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
913
949
|
productType: 60 | 49 | 97;
|
|
914
950
|
messageType: 1 | 2;
|
|
915
951
|
username: string;
|
|
952
|
+
fallbackFont?: {
|
|
953
|
+
name: string;
|
|
954
|
+
family: string;
|
|
955
|
+
} | undefined;
|
|
916
956
|
};
|
|
917
957
|
template: {
|
|
918
958
|
html: string;
|
|
@@ -1012,6 +1052,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1012
1052
|
productType: 60 | 49 | 97;
|
|
1013
1053
|
messageType: 1 | 2;
|
|
1014
1054
|
username: string;
|
|
1055
|
+
fallbackFont?: {
|
|
1056
|
+
name: string;
|
|
1057
|
+
family: string;
|
|
1058
|
+
} | undefined;
|
|
1015
1059
|
};
|
|
1016
1060
|
template: {
|
|
1017
1061
|
html: string;
|
|
@@ -1111,6 +1155,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1111
1155
|
productType: 60 | 49 | 97;
|
|
1112
1156
|
messageType: 1 | 2;
|
|
1113
1157
|
username: string;
|
|
1158
|
+
fallbackFont?: {
|
|
1159
|
+
name: string;
|
|
1160
|
+
family: string;
|
|
1161
|
+
} | undefined;
|
|
1114
1162
|
};
|
|
1115
1163
|
template: {
|
|
1116
1164
|
html: string;
|
|
@@ -1210,6 +1258,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1210
1258
|
productType: 60 | 49 | 97;
|
|
1211
1259
|
messageType: 1 | 2;
|
|
1212
1260
|
username: string;
|
|
1261
|
+
fallbackFont?: {
|
|
1262
|
+
name: string;
|
|
1263
|
+
family: string;
|
|
1264
|
+
} | undefined;
|
|
1213
1265
|
};
|
|
1214
1266
|
template: {
|
|
1215
1267
|
html: string;
|
|
@@ -1309,6 +1361,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1309
1361
|
productType: 60 | 49 | 97;
|
|
1310
1362
|
messageType: 1 | 2;
|
|
1311
1363
|
username: string;
|
|
1364
|
+
fallbackFont?: {
|
|
1365
|
+
name: string;
|
|
1366
|
+
family: string;
|
|
1367
|
+
} | undefined;
|
|
1312
1368
|
};
|
|
1313
1369
|
template: {
|
|
1314
1370
|
html: string;
|
|
@@ -1408,6 +1464,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1408
1464
|
productType: 60 | 49 | 97;
|
|
1409
1465
|
messageType: 1 | 2;
|
|
1410
1466
|
username: string;
|
|
1467
|
+
fallbackFont?: {
|
|
1468
|
+
name: string;
|
|
1469
|
+
family: string;
|
|
1470
|
+
} | undefined;
|
|
1411
1471
|
};
|
|
1412
1472
|
template: {
|
|
1413
1473
|
html: string;
|
|
@@ -1507,6 +1567,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1507
1567
|
productType: 60 | 49 | 97;
|
|
1508
1568
|
messageType: 1 | 2;
|
|
1509
1569
|
username: string;
|
|
1570
|
+
fallbackFont?: {
|
|
1571
|
+
name: string;
|
|
1572
|
+
family: string;
|
|
1573
|
+
} | undefined;
|
|
1510
1574
|
};
|
|
1511
1575
|
template: {
|
|
1512
1576
|
html: string;
|
|
@@ -1606,6 +1670,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1606
1670
|
productType: 60 | 49 | 97;
|
|
1607
1671
|
messageType: 1 | 2;
|
|
1608
1672
|
username: string;
|
|
1673
|
+
fallbackFont?: {
|
|
1674
|
+
name: string;
|
|
1675
|
+
family: string;
|
|
1676
|
+
} | undefined;
|
|
1609
1677
|
};
|
|
1610
1678
|
template: {
|
|
1611
1679
|
html: string;
|
|
@@ -1705,6 +1773,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1705
1773
|
productType: 60 | 49 | 97;
|
|
1706
1774
|
messageType: 1 | 2;
|
|
1707
1775
|
username: string;
|
|
1776
|
+
fallbackFont?: {
|
|
1777
|
+
name: string;
|
|
1778
|
+
family: string;
|
|
1779
|
+
} | undefined;
|
|
1708
1780
|
};
|
|
1709
1781
|
template: {
|
|
1710
1782
|
html: string;
|
|
@@ -7,6 +7,7 @@ export declare const usePreviewStore: import("pinia").StoreDefinition<"guidoPrev
|
|
|
7
7
|
templateHtml: string;
|
|
8
8
|
isLoaded: boolean;
|
|
9
9
|
isAMPErrorModalVisible: boolean;
|
|
10
|
+
emailSizeKB: number;
|
|
10
11
|
} & import("pinia").PiniaCustomStateProperties<PreviewState>) => boolean;
|
|
11
12
|
previewHtml(): string;
|
|
12
13
|
hasAMP: (state: {
|
|
@@ -16,6 +17,7 @@ export declare const usePreviewStore: import("pinia").StoreDefinition<"guidoPrev
|
|
|
16
17
|
templateHtml: string;
|
|
17
18
|
isLoaded: boolean;
|
|
18
19
|
isAMPErrorModalVisible: boolean;
|
|
20
|
+
emailSizeKB: number;
|
|
19
21
|
} & import("pinia").PiniaCustomStateProperties<PreviewState>) => boolean;
|
|
20
22
|
hasAMPErrors: (state: {
|
|
21
23
|
emailFormat: EmailFormat;
|
|
@@ -24,6 +26,7 @@ export declare const usePreviewStore: import("pinia").StoreDefinition<"guidoPrev
|
|
|
24
26
|
templateHtml: string;
|
|
25
27
|
isLoaded: boolean;
|
|
26
28
|
isAMPErrorModalVisible: boolean;
|
|
29
|
+
emailSizeKB: number;
|
|
27
30
|
} & import("pinia").PiniaCustomStateProperties<PreviewState>) => boolean;
|
|
28
31
|
showAMPErrorButton(): boolean;
|
|
29
32
|
isAMPResponsive(): boolean;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { FallbackFont } from '@@/Types/config';
|
|
1
2
|
import type { CompilerRule, CompilationResult, HtmlCompiler } from '@@/Types/html-compiler';
|
|
2
3
|
export declare class HtmlCompilerEngine implements HtmlCompiler {
|
|
3
4
|
private rules;
|
|
4
5
|
constructor(rules?: CompilerRule[]);
|
|
5
|
-
compile(html: string, rules?: CompilerRule[]): CompilationResult;
|
|
6
|
+
compile(html: string, rules?: CompilerRule[], fallbackFont?: FallbackFont): CompilationResult;
|
|
6
7
|
private applyRule;
|
|
7
8
|
private applyReplaceRule;
|
|
8
9
|
private applyRegexRule;
|
package/dist/stores/preview.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { defineStore as e } from "pinia";
|
|
2
|
-
const
|
|
2
|
+
const i = () => ({
|
|
3
3
|
emailFormat: "html",
|
|
4
4
|
ampHtml: "",
|
|
5
5
|
ampErrors: [],
|
|
6
6
|
templateHtml: "",
|
|
7
7
|
isLoaded: !1,
|
|
8
|
-
isAMPErrorModalVisible: !1
|
|
8
|
+
isAMPErrorModalVisible: !1,
|
|
9
|
+
emailSizeKB: 0
|
|
9
10
|
}), a = e("guidoPreview", {
|
|
10
|
-
state: () =>
|
|
11
|
+
state: () => i(),
|
|
11
12
|
getters: {
|
|
12
13
|
isAMPModeEnabled: (t) => t.emailFormat === "AMP",
|
|
13
14
|
previewHtml() {
|
|
@@ -1,70 +1,77 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useToaster as
|
|
5
|
-
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var f = (o, e, t) => e in o ? h(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var m = (o, e, t) => f(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { useToaster as x } from "../composables/useToaster.js";
|
|
5
|
+
const E = /font-family\s*:[^;}"']+/gi;
|
|
6
|
+
class T {
|
|
6
7
|
constructor(e = []) {
|
|
7
|
-
|
|
8
|
+
m(this, "rules");
|
|
8
9
|
this.rules = e;
|
|
9
10
|
}
|
|
10
|
-
compile(e, r) {
|
|
11
|
-
const
|
|
11
|
+
compile(e, t, r) {
|
|
12
|
+
const n = performance.now(), l = e, c = e.length;
|
|
12
13
|
let s = e;
|
|
13
|
-
const
|
|
14
|
-
(
|
|
15
|
-
const
|
|
16
|
-
s = this.applyRule(s,
|
|
14
|
+
const i = [];
|
|
15
|
+
(t || this.rules).sort((p, a) => p.priority - a.priority).forEach((p) => {
|
|
16
|
+
const a = s.length;
|
|
17
|
+
s = this.applyRule(s, p), s.length !== a && i.push(p.id);
|
|
17
18
|
});
|
|
18
|
-
const
|
|
19
|
+
const u = s.length, R = c > 0 ? (c - u) / c * 100 : 0, d = new TextEncoder().encode(s).byteLength;
|
|
20
|
+
let y = 0;
|
|
21
|
+
if (r && r.name && r.family) {
|
|
22
|
+
const p = (s.match(E) || []).length, a = `, ${r.name}, ${r.family}`;
|
|
23
|
+
y = p * new TextEncoder().encode(a).byteLength;
|
|
24
|
+
}
|
|
25
|
+
const g = Math.round((d + y) / 1024);
|
|
19
26
|
return {
|
|
20
|
-
originalHtml:
|
|
27
|
+
originalHtml: l,
|
|
21
28
|
compiledHtml: s,
|
|
22
|
-
appliedRules:
|
|
23
|
-
|
|
29
|
+
appliedRules: i,
|
|
30
|
+
estimatedSizeKB: g,
|
|
24
31
|
stats: {
|
|
25
|
-
originalSize:
|
|
26
|
-
compiledSize:
|
|
32
|
+
originalSize: c,
|
|
33
|
+
compiledSize: u,
|
|
27
34
|
reductionPercentage: R,
|
|
28
|
-
executionTime: performance.now() -
|
|
35
|
+
executionTime: performance.now() - n
|
|
29
36
|
}
|
|
30
37
|
};
|
|
31
38
|
}
|
|
32
|
-
applyRule(e,
|
|
39
|
+
applyRule(e, t) {
|
|
33
40
|
try {
|
|
34
|
-
switch (
|
|
41
|
+
switch (t.type) {
|
|
35
42
|
case "replace":
|
|
36
|
-
return this.applyReplaceRule(e,
|
|
43
|
+
return this.applyReplaceRule(e, t);
|
|
37
44
|
case "regex":
|
|
38
|
-
return this.applyRegexRule(e,
|
|
45
|
+
return this.applyRegexRule(e, t);
|
|
39
46
|
case "remove":
|
|
40
|
-
return this.applyRemoveRule(e,
|
|
47
|
+
return this.applyRemoveRule(e, t);
|
|
41
48
|
case "custom":
|
|
42
|
-
return this.applyCustomRule(e,
|
|
49
|
+
return this.applyCustomRule(e, t);
|
|
43
50
|
default:
|
|
44
51
|
return e;
|
|
45
52
|
}
|
|
46
|
-
} catch (
|
|
47
|
-
const { handleError:
|
|
48
|
-
return
|
|
53
|
+
} catch (r) {
|
|
54
|
+
const { handleError: n } = x();
|
|
55
|
+
return n(r, `Failed to apply rule ${t.id}:`), e;
|
|
49
56
|
}
|
|
50
57
|
}
|
|
51
|
-
applyReplaceRule(e,
|
|
52
|
-
const { search:
|
|
53
|
-
return
|
|
58
|
+
applyReplaceRule(e, t) {
|
|
59
|
+
const { search: r, replacement: n, replaceAll: l = !0 } = t;
|
|
60
|
+
return l ? e.replaceAll(r, n) : e.replace(r, n);
|
|
54
61
|
}
|
|
55
|
-
applyRegexRule(e,
|
|
56
|
-
const { pattern:
|
|
57
|
-
return e.replace(
|
|
62
|
+
applyRegexRule(e, t) {
|
|
63
|
+
const { pattern: r, replacement: n, flags: l = "g" } = t, c = new RegExp(r, l);
|
|
64
|
+
return e.replace(c, n);
|
|
58
65
|
}
|
|
59
|
-
applyRemoveRule(e,
|
|
60
|
-
return
|
|
66
|
+
applyRemoveRule(e, t) {
|
|
67
|
+
return t.targets.reduce((r, n) => n instanceof RegExp ? r.replace(n, "") : r.replaceAll(n, ""), e);
|
|
61
68
|
}
|
|
62
|
-
applyCustomRule(e,
|
|
63
|
-
return
|
|
69
|
+
applyCustomRule(e, t) {
|
|
70
|
+
return t.processor(e);
|
|
64
71
|
}
|
|
65
72
|
}
|
|
66
|
-
const
|
|
73
|
+
const H = (o = []) => new T(o);
|
|
67
74
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
T as HtmlCompilerEngine,
|
|
76
|
+
H as createHtmlCompiler
|
|
70
77
|
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useHtmlCompiler as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
4
|
-
import { useDynamicContentStore as
|
|
5
|
-
import { useUnsubscribeStore as
|
|
6
|
-
const
|
|
7
|
-
const o =
|
|
1
|
+
import { useActionsApi as S } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useHtmlCompiler as f } from "../composables/useHtmlCompiler.js";
|
|
3
|
+
import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
|
+
import { useDynamicContentStore as T } from "../stores/dynamic-content.js";
|
|
5
|
+
import { useUnsubscribeStore as x } from "../stores/unsubscribe.js";
|
|
6
|
+
const h = () => {
|
|
7
|
+
const o = T(), e = x(), { getCompiledEmail: i, getTemplateData: s } = S(), { compileHtml: n } = f();
|
|
8
8
|
return {
|
|
9
9
|
prepareTemplateDetails: async () => {
|
|
10
|
-
const { html:
|
|
10
|
+
const { html: a, ampHtml: m = "", ampErrors: r = [] } = await i({
|
|
11
11
|
minimize: !0,
|
|
12
12
|
resetDataSavedFlag: !1
|
|
13
|
-
}), { html:
|
|
13
|
+
}), { html: c, css: l, syncModulesIds: p = [] } = await s();
|
|
14
14
|
e.selectedUnsubscribePages.length && await e.fetchTemplates();
|
|
15
|
-
const { compiledHtml:
|
|
16
|
-
return
|
|
15
|
+
const { compiledHtml: u, stats: t, appliedRules: d } = n(a), g = o.getSelectedDynamicContentList, b = C();
|
|
16
|
+
return console.debug("HTML Compilation Stats:", {
|
|
17
17
|
originalSize: t.originalSize,
|
|
18
18
|
compiledSize: t.compiledSize,
|
|
19
19
|
reduction: `${t.reductionPercentage.toFixed(2)}%`,
|
|
20
|
-
appliedRules:
|
|
20
|
+
appliedRules: d,
|
|
21
21
|
executionTime: `${t.executionTime.toFixed(2)}ms`
|
|
22
22
|
}), {
|
|
23
|
-
dynamicContentList:
|
|
24
|
-
compiledHtml:
|
|
25
|
-
rawHtml:
|
|
26
|
-
css:
|
|
27
|
-
ampHtml:
|
|
28
|
-
ampErrors:
|
|
29
|
-
modules:
|
|
23
|
+
dynamicContentList: g,
|
|
24
|
+
compiledHtml: u,
|
|
25
|
+
rawHtml: c,
|
|
26
|
+
css: l,
|
|
27
|
+
ampHtml: m,
|
|
28
|
+
ampErrors: r,
|
|
29
|
+
modules: p.map(Number),
|
|
30
30
|
recommendation: {
|
|
31
31
|
campaignUrls: b.recommendationCampaignUrls,
|
|
32
32
|
configs: {}
|
|
@@ -40,5 +40,5 @@ const w = () => {
|
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
export {
|
|
43
|
-
|
|
43
|
+
h as useTemplatePreparation
|
|
44
44
|
};
|
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.d3c42de",
|
|
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",
|