@useinsider/guido 3.1.1-beta.cdcd41d → 3.1.1-beta.d27d19c

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.
Files changed (45) hide show
  1. package/dist/@types/config/schemas.js +67 -61
  2. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
  3. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
  4. package/dist/composables/useHtmlCompiler.js +20 -20
  5. package/dist/composables/usePreviewMode.js +20 -16
  6. package/dist/composables/useSave.js +15 -13
  7. package/dist/config/compiler/utils/recommendationCompilerUtils.js +53 -55
  8. package/dist/config/migrator/checkboxMigrator.js +5 -3
  9. package/dist/config/migrator/radioButtonMigrator.js +14 -12
  10. package/dist/enums/recommendation.js +2 -2
  11. package/dist/extensions/Blocks/Recommendation/block.js +1 -1
  12. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
  13. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +185 -172
  14. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +95 -93
  15. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +75 -73
  16. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +7 -5
  17. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -29
  18. package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
  19. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +3 -1
  20. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +20 -20
  21. package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -50
  22. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
  23. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +16 -17
  24. package/dist/guido.css +1 -1
  25. package/dist/services/recommendationApi.js +9 -22
  26. package/dist/src/@types/config/index.d.ts +1 -1
  27. package/dist/src/@types/config/schemas.d.ts +20 -4
  28. package/dist/src/@types/config/types.d.ts +3 -1
  29. package/dist/src/@types/generic.d.ts +0 -1
  30. package/dist/src/composables/useConfig.d.ts +8 -2
  31. package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
  32. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  33. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
  34. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
  35. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  36. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
  37. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
  38. package/dist/src/stores/config.d.ts +72 -18
  39. package/dist/src/stores/preview.d.ts +3 -0
  40. package/dist/src/utils/htmlCompiler.d.ts +2 -1
  41. package/dist/stores/preview.js +4 -3
  42. package/dist/utils/htmlCompiler.js +48 -41
  43. package/dist/utils/templatePreparation.js +20 -20
  44. package/dist/utils/tooltipUtils.js +4 -5
  45. package/package.json +2 -2
@@ -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;
@@ -62,7 +66,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
62
66
  displayConditions: boolean;
63
67
  unsubscribe: boolean;
64
68
  modulesDisabled: boolean;
65
- liquidSyntax: boolean;
66
69
  };
67
70
  blocks: {
68
71
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -121,6 +124,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
121
124
  productType: 60 | 49 | 97;
122
125
  messageType: 1 | 2;
123
126
  username: string;
127
+ fallbackFont?: {
128
+ name: string;
129
+ family: string;
130
+ } | undefined;
124
131
  };
125
132
  template: {
126
133
  html: string;
@@ -161,7 +168,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
161
168
  displayConditions: boolean;
162
169
  unsubscribe: boolean;
163
170
  modulesDisabled: boolean;
164
- liquidSyntax: boolean;
165
171
  };
166
172
  blocks: {
167
173
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -220,6 +226,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
220
226
  productType: 60 | 49 | 97;
221
227
  messageType: 1 | 2;
222
228
  username: string;
229
+ fallbackFont?: {
230
+ name: string;
231
+ family: string;
232
+ } | undefined;
223
233
  };
224
234
  template: {
225
235
  html: string;
@@ -260,7 +270,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
260
270
  displayConditions: boolean;
261
271
  unsubscribe: boolean;
262
272
  modulesDisabled: boolean;
263
- liquidSyntax: boolean;
264
273
  };
265
274
  blocks: {
266
275
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -319,6 +328,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
319
328
  productType: 60 | 49 | 97;
320
329
  messageType: 1 | 2;
321
330
  username: string;
331
+ fallbackFont?: {
332
+ name: string;
333
+ family: string;
334
+ } | undefined;
322
335
  };
323
336
  template: {
324
337
  html: string;
@@ -359,7 +372,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
359
372
  displayConditions: boolean;
360
373
  unsubscribe: boolean;
361
374
  modulesDisabled: boolean;
362
- liquidSyntax: boolean;
363
375
  };
364
376
  blocks: {
365
377
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -418,6 +430,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
418
430
  productType: 60 | 49 | 97;
419
431
  messageType: 1 | 2;
420
432
  username: string;
433
+ fallbackFont?: {
434
+ name: string;
435
+ family: string;
436
+ } | undefined;
421
437
  };
422
438
  template: {
423
439
  html: string;
@@ -458,7 +474,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
458
474
  displayConditions: boolean;
459
475
  unsubscribe: boolean;
460
476
  modulesDisabled: boolean;
461
- liquidSyntax: boolean;
462
477
  };
463
478
  blocks: {
464
479
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -517,6 +532,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
517
532
  productType: 60 | 49 | 97;
518
533
  messageType: 1 | 2;
519
534
  username: string;
535
+ fallbackFont?: {
536
+ name: string;
537
+ family: string;
538
+ } | undefined;
520
539
  };
521
540
  template: {
522
541
  html: string;
@@ -557,7 +576,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
557
576
  displayConditions: boolean;
558
577
  unsubscribe: boolean;
559
578
  modulesDisabled: boolean;
560
- liquidSyntax: boolean;
561
579
  };
562
580
  blocks: {
563
581
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -616,6 +634,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
616
634
  productType: 60 | 49 | 97;
617
635
  messageType: 1 | 2;
618
636
  username: string;
637
+ fallbackFont?: {
638
+ name: string;
639
+ family: string;
640
+ } | undefined;
619
641
  };
620
642
  template: {
621
643
  html: string;
@@ -656,7 +678,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
656
678
  displayConditions: boolean;
657
679
  unsubscribe: boolean;
658
680
  modulesDisabled: boolean;
659
- liquidSyntax: boolean;
660
681
  };
661
682
  blocks: {
662
683
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -715,6 +736,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
715
736
  productType: 60 | 49 | 97;
716
737
  messageType: 1 | 2;
717
738
  username: string;
739
+ fallbackFont?: {
740
+ name: string;
741
+ family: string;
742
+ } | undefined;
718
743
  };
719
744
  template: {
720
745
  html: string;
@@ -755,7 +780,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
755
780
  displayConditions: boolean;
756
781
  unsubscribe: boolean;
757
782
  modulesDisabled: boolean;
758
- liquidSyntax: boolean;
759
783
  };
760
784
  blocks: {
761
785
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -814,6 +838,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
814
838
  productType: 60 | 49 | 97;
815
839
  messageType: 1 | 2;
816
840
  username: string;
841
+ fallbackFont?: {
842
+ name: string;
843
+ family: string;
844
+ } | undefined;
817
845
  };
818
846
  template: {
819
847
  html: string;
@@ -854,7 +882,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
854
882
  displayConditions: boolean;
855
883
  unsubscribe: boolean;
856
884
  modulesDisabled: boolean;
857
- liquidSyntax: boolean;
858
885
  };
859
886
  blocks: {
860
887
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -913,6 +940,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
913
940
  productType: 60 | 49 | 97;
914
941
  messageType: 1 | 2;
915
942
  username: string;
943
+ fallbackFont?: {
944
+ name: string;
945
+ family: string;
946
+ } | undefined;
916
947
  };
917
948
  template: {
918
949
  html: string;
@@ -953,7 +984,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
953
984
  displayConditions: boolean;
954
985
  unsubscribe: boolean;
955
986
  modulesDisabled: boolean;
956
- liquidSyntax: boolean;
957
987
  };
958
988
  blocks: {
959
989
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1012,6 +1042,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1012
1042
  productType: 60 | 49 | 97;
1013
1043
  messageType: 1 | 2;
1014
1044
  username: string;
1045
+ fallbackFont?: {
1046
+ name: string;
1047
+ family: string;
1048
+ } | undefined;
1015
1049
  };
1016
1050
  template: {
1017
1051
  html: string;
@@ -1052,7 +1086,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1052
1086
  displayConditions: boolean;
1053
1087
  unsubscribe: boolean;
1054
1088
  modulesDisabled: boolean;
1055
- liquidSyntax: boolean;
1056
1089
  };
1057
1090
  blocks: {
1058
1091
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1111,6 +1144,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1111
1144
  productType: 60 | 49 | 97;
1112
1145
  messageType: 1 | 2;
1113
1146
  username: string;
1147
+ fallbackFont?: {
1148
+ name: string;
1149
+ family: string;
1150
+ } | undefined;
1114
1151
  };
1115
1152
  template: {
1116
1153
  html: string;
@@ -1151,7 +1188,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1151
1188
  displayConditions: boolean;
1152
1189
  unsubscribe: boolean;
1153
1190
  modulesDisabled: boolean;
1154
- liquidSyntax: boolean;
1155
1191
  };
1156
1192
  blocks: {
1157
1193
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1210,6 +1246,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1210
1246
  productType: 60 | 49 | 97;
1211
1247
  messageType: 1 | 2;
1212
1248
  username: string;
1249
+ fallbackFont?: {
1250
+ name: string;
1251
+ family: string;
1252
+ } | undefined;
1213
1253
  };
1214
1254
  template: {
1215
1255
  html: string;
@@ -1250,7 +1290,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1250
1290
  displayConditions: boolean;
1251
1291
  unsubscribe: boolean;
1252
1292
  modulesDisabled: boolean;
1253
- liquidSyntax: boolean;
1254
1293
  };
1255
1294
  blocks: {
1256
1295
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1309,6 +1348,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1309
1348
  productType: 60 | 49 | 97;
1310
1349
  messageType: 1 | 2;
1311
1350
  username: string;
1351
+ fallbackFont?: {
1352
+ name: string;
1353
+ family: string;
1354
+ } | undefined;
1312
1355
  };
1313
1356
  template: {
1314
1357
  html: string;
@@ -1349,7 +1392,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1349
1392
  displayConditions: boolean;
1350
1393
  unsubscribe: boolean;
1351
1394
  modulesDisabled: boolean;
1352
- liquidSyntax: boolean;
1353
1395
  };
1354
1396
  blocks: {
1355
1397
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1408,6 +1450,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1408
1450
  productType: 60 | 49 | 97;
1409
1451
  messageType: 1 | 2;
1410
1452
  username: string;
1453
+ fallbackFont?: {
1454
+ name: string;
1455
+ family: string;
1456
+ } | undefined;
1411
1457
  };
1412
1458
  template: {
1413
1459
  html: string;
@@ -1448,7 +1494,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1448
1494
  displayConditions: boolean;
1449
1495
  unsubscribe: boolean;
1450
1496
  modulesDisabled: boolean;
1451
- liquidSyntax: boolean;
1452
1497
  };
1453
1498
  blocks: {
1454
1499
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1507,6 +1552,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1507
1552
  productType: 60 | 49 | 97;
1508
1553
  messageType: 1 | 2;
1509
1554
  username: string;
1555
+ fallbackFont?: {
1556
+ name: string;
1557
+ family: string;
1558
+ } | undefined;
1510
1559
  };
1511
1560
  template: {
1512
1561
  html: string;
@@ -1547,7 +1596,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1547
1596
  displayConditions: boolean;
1548
1597
  unsubscribe: boolean;
1549
1598
  modulesDisabled: boolean;
1550
- liquidSyntax: boolean;
1551
1599
  };
1552
1600
  blocks: {
1553
1601
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1606,6 +1654,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1606
1654
  productType: 60 | 49 | 97;
1607
1655
  messageType: 1 | 2;
1608
1656
  username: string;
1657
+ fallbackFont?: {
1658
+ name: string;
1659
+ family: string;
1660
+ } | undefined;
1609
1661
  };
1610
1662
  template: {
1611
1663
  html: string;
@@ -1646,7 +1698,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1646
1698
  displayConditions: boolean;
1647
1699
  unsubscribe: boolean;
1648
1700
  modulesDisabled: boolean;
1649
- liquidSyntax: boolean;
1650
1701
  };
1651
1702
  blocks: {
1652
1703
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1705,6 +1756,10 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1705
1756
  productType: 60 | 49 | 97;
1706
1757
  messageType: 1 | 2;
1707
1758
  username: string;
1759
+ fallbackFont?: {
1760
+ name: string;
1761
+ family: string;
1762
+ } | undefined;
1708
1763
  };
1709
1764
  template: {
1710
1765
  html: string;
@@ -1745,7 +1800,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1745
1800
  displayConditions: boolean;
1746
1801
  unsubscribe: boolean;
1747
1802
  modulesDisabled: boolean;
1748
- liquidSyntax: boolean;
1749
1803
  };
1750
1804
  blocks: {
1751
1805
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -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;
@@ -1,13 +1,14 @@
1
1
  import { defineStore as e } from "pinia";
2
- const s = () => ({
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: () => s(),
11
+ state: () => i(),
11
12
  getters: {
12
13
  isAMPModeEnabled: (t) => t.emailFormat === "AMP",
13
14
  previewHtml() {
@@ -1,70 +1,77 @@
1
- var y = Object.defineProperty;
2
- var g = (p, e, r) => e in p ? y(p, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : p[e] = r;
3
- var u = (p, e, r) => g(p, typeof e != "symbol" ? e + "" : e, r);
4
- import { useToaster as m } from "../composables/useToaster.js";
5
- class d {
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
- u(this, "rules");
8
+ m(this, "rules");
8
9
  this.rules = e;
9
10
  }
10
- compile(e, r) {
11
- const l = performance.now(), t = e, o = e.length;
11
+ compile(e, t, r) {
12
+ const n = performance.now(), l = e, c = e.length;
12
13
  let s = e;
13
- const a = [];
14
- (r || this.rules).sort((n, c) => n.priority - c.priority).forEach((n) => {
15
- const c = s.length;
16
- s = this.applyRule(s, n), s.length !== c && a.push(n.id);
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 i = s.length, R = o > 0 ? (o - i) / o * 100 : 0;
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: t,
27
+ originalHtml: l,
21
28
  compiledHtml: s,
22
- appliedRules: a,
23
- // TODO: We can use stats for monitoring in the future
29
+ appliedRules: i,
30
+ estimatedSizeKB: g,
24
31
  stats: {
25
- originalSize: o,
26
- compiledSize: i,
32
+ originalSize: c,
33
+ compiledSize: u,
27
34
  reductionPercentage: R,
28
- executionTime: performance.now() - l
35
+ executionTime: performance.now() - n
29
36
  }
30
37
  };
31
38
  }
32
- applyRule(e, r) {
39
+ applyRule(e, t) {
33
40
  try {
34
- switch (r.type) {
41
+ switch (t.type) {
35
42
  case "replace":
36
- return this.applyReplaceRule(e, r);
43
+ return this.applyReplaceRule(e, t);
37
44
  case "regex":
38
- return this.applyRegexRule(e, r);
45
+ return this.applyRegexRule(e, t);
39
46
  case "remove":
40
- return this.applyRemoveRule(e, r);
47
+ return this.applyRemoveRule(e, t);
41
48
  case "custom":
42
- return this.applyCustomRule(e, r);
49
+ return this.applyCustomRule(e, t);
43
50
  default:
44
51
  return e;
45
52
  }
46
- } catch (l) {
47
- const { handleError: t } = m();
48
- return t(l, `Failed to apply rule ${r.id}:`), e;
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, r) {
52
- const { search: l, replacement: t, replaceAll: o = !0 } = r;
53
- return o ? e.replaceAll(l, t) : e.replace(l, t);
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, r) {
56
- const { pattern: l, replacement: t, flags: o = "g" } = r, s = new RegExp(l, o);
57
- return e.replace(s, t);
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, r) {
60
- return r.targets.reduce((l, t) => t instanceof RegExp ? l.replace(t, "") : l.replaceAll(t, ""), e);
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, r) {
63
- return r.processor(e);
69
+ applyCustomRule(e, t) {
70
+ return t.processor(e);
64
71
  }
65
72
  }
66
- const A = (p = []) => new d(p);
73
+ const H = (o = []) => new T(o);
67
74
  export {
68
- d as HtmlCompilerEngine,
69
- A as createHtmlCompiler
75
+ T as HtmlCompilerEngine,
76
+ H as createHtmlCompiler
70
77
  };
@@ -1,32 +1,32 @@
1
- import { useActionsApi as f } from "../composables/useActionsApi.js";
2
- import { useHtmlCompiler as C } from "../composables/useHtmlCompiler.js";
3
- import { useRecommendationExtensionStore as T } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
- import { useDynamicContentStore as x } from "../stores/dynamic-content.js";
5
- import { useUnsubscribeStore as y } from "../stores/unsubscribe.js";
6
- const w = () => {
7
- const o = x(), e = y(), { getCompiledEmail: i, getTemplateData: s, editorSave: n } = f(), { compileHtml: a } = C();
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: m, ampHtml: r = "", ampErrors: c = [] } = await i({
10
+ const { html: a, ampHtml: m = "", ampErrors: r = [] } = await i({
11
11
  minimize: !0,
12
12
  resetDataSavedFlag: !1
13
- }), { html: l, css: p, syncModulesIds: u = [] } = await s();
13
+ }), { html: c, css: l, syncModulesIds: p = [] } = await s();
14
14
  e.selectedUnsubscribePages.length && await e.fetchTemplates();
15
- const { compiledHtml: d, stats: t, appliedRules: g } = a(m), S = o.getSelectedDynamicContentList, b = T();
16
- return n(), console.debug("HTML Compilation Stats:", {
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: g,
20
+ appliedRules: d,
21
21
  executionTime: `${t.executionTime.toFixed(2)}ms`
22
22
  }), {
23
- dynamicContentList: S,
24
- compiledHtml: d,
25
- rawHtml: l,
26
- css: p,
27
- ampHtml: r,
28
- ampErrors: c,
29
- modules: u.map(Number),
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
- w as useTemplatePreparation
43
+ h as useTemplatePreparation
44
44
  };
@@ -1,11 +1,10 @@
1
- const e = (s, t = {}) => ({
2
- id: s,
1
+ const o = (i, t = {}) => ({
2
+ id: i,
3
3
  dynamicPosition: t.dynamicPosition ?? !1,
4
4
  staticPosition: t.staticPosition ?? "bottom center",
5
5
  iconStatus: t.iconStatus ?? !1,
6
- offset: t.offset,
7
- preventXss: t.preventXss
6
+ offset: t.offset
8
7
  });
9
8
  export {
10
- e as getTooltipOptions
9
+ o as getTooltipOptions
11
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.1.1-beta.cdcd41d",
3
+ "version": "3.1.1-beta.d27d19c",
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",
@@ -33,7 +33,7 @@
33
33
  "license": "ISC",
34
34
  "dependencies": {
35
35
  "@stripoinc/ui-editor-extensions": "3.5.0",
36
- "@useinsider/design-system-vue": "0.14.28",
36
+ "@useinsider/design-system-vue": "1.1.0-beta.73ec2fa",
37
37
  "@vueuse/core": "11.3.0",
38
38
  "lodash-es": "4.17.21",
39
39
  "pinia": "2.3.1",