@useinsider/guido 2.0.0-beta.ac3cd4d → 2.0.0-beta.afc5689

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 (57) hide show
  1. package/README.md +2 -0
  2. package/dist/@types/config/schemas.js +38 -50
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +15 -17
  5. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +2 -2
  6. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
  7. package/dist/components/organisms/header/LeftSlot.vue.js +12 -12
  8. package/dist/components/organisms/header/LeftSlot.vue2.js +6 -6
  9. package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
  10. package/dist/composables/useConfig.js +27 -29
  11. package/dist/composables/useSave.js +11 -13
  12. package/dist/composables/useStripo.js +40 -40
  13. package/dist/config/migrator/index.js +9 -8
  14. package/dist/config/migrator/itemsBlockMigrator.js +283 -0
  15. package/dist/extensions/Blocks/Items/block.js +39 -40
  16. package/dist/extensions/Blocks/Items/controls/button/link.js +22 -29
  17. package/dist/extensions/Blocks/Items/controls/cardComposition.js +46 -49
  18. package/dist/extensions/Blocks/Items/controls/image/link.js +23 -30
  19. package/dist/extensions/Blocks/Items/controls/name/trimming.js +13 -15
  20. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +1 -1
  21. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +1 -1
  22. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +15 -17
  23. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +15 -15
  24. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +29 -27
  25. package/dist/extensions/Blocks/Items/controls/settingsControl.js +145 -136
  26. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -2
  27. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +58 -48
  28. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +48 -58
  29. package/dist/extensions/Blocks/Items/settingsPanel.js +4 -4
  30. package/dist/extensions/Blocks/Items/store/items-block.js +2 -2
  31. package/dist/extensions/Blocks/Items/template.js +312 -125
  32. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +172 -0
  33. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +17 -44
  34. package/dist/extensions/Blocks/Recommendation/control.js +1 -1
  35. package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
  36. package/dist/extensions/Blocks/common-control.js +64 -53
  37. package/dist/extensions/Blocks/controlFactories.js +55 -45
  38. package/dist/guido.css +1 -1
  39. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +364 -285
  40. package/dist/package.json.js +1 -1
  41. package/dist/services/stripoApi.js +6 -10
  42. package/dist/src/@types/config/index.d.ts +2 -2
  43. package/dist/src/@types/config/schemas.d.ts +4 -26
  44. package/dist/src/@types/config/types.d.ts +1 -7
  45. package/dist/src/composables/useConfig.d.ts +2 -6
  46. package/dist/src/config/migrator/itemsBlockMigrator.d.ts +6 -0
  47. package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +0 -2
  48. package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +0 -2
  49. package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
  50. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -4
  51. package/dist/src/extensions/Blocks/Items/template.d.ts +20 -1
  52. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +71 -0
  53. package/dist/src/extensions/Blocks/common-control.d.ts +13 -8
  54. package/dist/src/stores/config.d.ts +18 -146
  55. package/dist/static/styles/components/button.css.js +1 -1
  56. package/dist/stores/config.js +0 -7
  57. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig, CallbacksConfig } from '@@/Types/config';
1
+ import type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig } from '@@/Types/config';
2
2
  interface ConfigStoreState {
3
3
  /** Whether the config has been initialized */
4
4
  initialized: boolean;
@@ -36,6 +36,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
36
36
  } | undefined;
37
37
  }[];
38
38
  selectedUnsubscribePages: number[];
39
+ forceRecreate: boolean;
39
40
  };
40
41
  editor: {
41
42
  locale: string;
@@ -95,9 +96,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
95
96
  })[];
96
97
  ignoreDefaultRules: boolean;
97
98
  };
98
- callbacks: {
99
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
100
- };
101
99
  } | null;
102
100
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => IdentityConfig | null;
103
101
  /**
@@ -130,6 +128,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
130
128
  } | undefined;
131
129
  }[];
132
130
  selectedUnsubscribePages: number[];
131
+ forceRecreate: boolean;
133
132
  };
134
133
  editor: {
135
134
  locale: string;
@@ -189,9 +188,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
189
188
  })[];
190
189
  ignoreDefaultRules: boolean;
191
190
  };
192
- callbacks: {
193
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
194
- };
195
191
  } | null;
196
192
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => PartnerConfig | null;
197
193
  /**
@@ -224,6 +220,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
224
220
  } | undefined;
225
221
  }[];
226
222
  selectedUnsubscribePages: number[];
223
+ forceRecreate: boolean;
227
224
  };
228
225
  editor: {
229
226
  locale: string;
@@ -283,9 +280,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
283
280
  })[];
284
281
  ignoreDefaultRules: boolean;
285
282
  };
286
- callbacks: {
287
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
288
- };
289
283
  } | null;
290
284
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => TemplateConfig | null;
291
285
  /**
@@ -318,6 +312,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
318
312
  } | undefined;
319
313
  }[];
320
314
  selectedUnsubscribePages: number[];
315
+ forceRecreate: boolean;
321
316
  };
322
317
  editor: {
323
318
  locale: string;
@@ -377,9 +372,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
377
372
  })[];
378
373
  ignoreDefaultRules: boolean;
379
374
  };
380
- callbacks: {
381
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
382
- };
383
375
  } | null;
384
376
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => EditorConfig | null;
385
377
  /**
@@ -412,6 +404,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
412
404
  } | undefined;
413
405
  }[];
414
406
  selectedUnsubscribePages: number[];
407
+ forceRecreate: boolean;
415
408
  };
416
409
  editor: {
417
410
  locale: string;
@@ -471,9 +464,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
471
464
  })[];
472
465
  ignoreDefaultRules: boolean;
473
466
  };
474
- callbacks: {
475
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
476
- };
477
467
  } | null;
478
468
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => UIConfig | null;
479
469
  /**
@@ -506,6 +496,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
506
496
  } | undefined;
507
497
  }[];
508
498
  selectedUnsubscribePages: number[];
499
+ forceRecreate: boolean;
509
500
  };
510
501
  editor: {
511
502
  locale: string;
@@ -565,9 +556,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
565
556
  })[];
566
557
  ignoreDefaultRules: boolean;
567
558
  };
568
- callbacks: {
569
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
570
- };
571
559
  } | null;
572
560
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => FeaturesConfig | null;
573
561
  /**
@@ -600,6 +588,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
600
588
  } | undefined;
601
589
  }[];
602
590
  selectedUnsubscribePages: number[];
591
+ forceRecreate: boolean;
603
592
  };
604
593
  editor: {
605
594
  locale: string;
@@ -659,9 +648,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
659
648
  })[];
660
649
  ignoreDefaultRules: boolean;
661
650
  };
662
- callbacks: {
663
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
664
- };
665
651
  } | null;
666
652
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => BlocksConfig | null;
667
653
  /**
@@ -694,6 +680,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
694
680
  } | undefined;
695
681
  }[];
696
682
  selectedUnsubscribePages: number[];
683
+ forceRecreate: boolean;
697
684
  };
698
685
  editor: {
699
686
  locale: string;
@@ -753,105 +740,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
753
740
  })[];
754
741
  ignoreDefaultRules: boolean;
755
742
  };
756
- callbacks: {
757
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
758
- };
759
743
  } | null;
760
744
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => CompilerConfig | null;
761
- /**
762
- * Get the callbacks configuration
763
- */
764
- callbacks: (state: {
765
- initialized: boolean;
766
- config: {
767
- identity: {
768
- templateId: string;
769
- userId: string;
770
- variationId?: string | undefined;
771
- };
772
- partner: {
773
- name: string;
774
- productType: 60 | 49 | 97;
775
- messageType: 1 | 2;
776
- username: string;
777
- };
778
- template: {
779
- html: string;
780
- css: string;
781
- preselectedDynamicContent: {
782
- text: string;
783
- value: string;
784
- fallback?: string | undefined;
785
- format?: {
786
- key: string;
787
- value: string;
788
- } | undefined;
789
- }[];
790
- selectedUnsubscribePages: number[];
791
- };
792
- editor: {
793
- locale: string;
794
- translationsPath: string;
795
- migrationDate: number;
796
- emailHeader: {
797
- senderName: string;
798
- subject: string;
799
- };
800
- };
801
- ui: {
802
- showHeader: boolean;
803
- backButtonLabel?: string | undefined;
804
- };
805
- features: {
806
- dynamicContent: boolean;
807
- saveAsTemplate: boolean;
808
- versionHistory: boolean;
809
- testMessage: boolean;
810
- displayConditions: boolean;
811
- unsubscribe: boolean;
812
- modulesDisabled: boolean;
813
- };
814
- blocks: {
815
- 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")[];
816
- includeCustoms: ("dynamic-content" | "checkbox-block" | "radio-button-block" | "recommendation-block" | "unsubscribe-block" | "coupon-block" | "items-block")[];
817
- };
818
- compiler: {
819
- customRules: ({
820
- type: "replace";
821
- search: string;
822
- replacement: string;
823
- replaceAll?: boolean | undefined;
824
- id: string;
825
- description?: string | undefined;
826
- priority: number;
827
- } | {
828
- type: "regex";
829
- pattern: string;
830
- replacement: string;
831
- flags?: string | undefined;
832
- id: string;
833
- description?: string | undefined;
834
- priority: number;
835
- } | {
836
- type: "remove";
837
- targets: string[];
838
- id: string;
839
- description?: string | undefined;
840
- priority: number;
841
- } | {
842
- type: "custom";
843
- processor: (html: string) => string;
844
- id: string;
845
- description?: string | undefined;
846
- priority: number;
847
- })[];
848
- ignoreDefaultRules: boolean;
849
- };
850
- callbacks: {
851
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
852
- };
853
- } | null;
854
- } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => CallbacksConfig | null;
855
745
  /**
856
746
  * Get the template ID
857
747
  */
@@ -882,6 +772,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
882
772
  } | undefined;
883
773
  }[];
884
774
  selectedUnsubscribePages: number[];
775
+ forceRecreate: boolean;
885
776
  };
886
777
  editor: {
887
778
  locale: string;
@@ -941,9 +832,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
941
832
  })[];
942
833
  ignoreDefaultRules: boolean;
943
834
  };
944
- callbacks: {
945
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
946
- };
947
835
  } | null;
948
836
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
949
837
  /**
@@ -976,6 +864,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
976
864
  } | undefined;
977
865
  }[];
978
866
  selectedUnsubscribePages: number[];
867
+ forceRecreate: boolean;
979
868
  };
980
869
  editor: {
981
870
  locale: string;
@@ -1035,9 +924,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1035
924
  })[];
1036
925
  ignoreDefaultRules: boolean;
1037
926
  };
1038
- callbacks: {
1039
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1040
- };
1041
927
  } | null;
1042
928
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
1043
929
  /**
@@ -1070,6 +956,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1070
956
  } | undefined;
1071
957
  }[];
1072
958
  selectedUnsubscribePages: number[];
959
+ forceRecreate: boolean;
1073
960
  };
1074
961
  editor: {
1075
962
  locale: string;
@@ -1129,9 +1016,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1129
1016
  })[];
1130
1017
  ignoreDefaultRules: boolean;
1131
1018
  };
1132
- callbacks: {
1133
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1134
- };
1135
1019
  } | null;
1136
1020
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
1137
1021
  /**
@@ -1164,6 +1048,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1164
1048
  } | undefined;
1165
1049
  }[];
1166
1050
  selectedUnsubscribePages: number[];
1051
+ forceRecreate: boolean;
1167
1052
  };
1168
1053
  editor: {
1169
1054
  locale: string;
@@ -1223,9 +1108,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1223
1108
  })[];
1224
1109
  ignoreDefaultRules: boolean;
1225
1110
  };
1226
- callbacks: {
1227
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1228
- };
1229
1111
  } | null;
1230
1112
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
1231
1113
  /**
@@ -1258,6 +1140,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1258
1140
  } | undefined;
1259
1141
  }[];
1260
1142
  selectedUnsubscribePages: number[];
1143
+ forceRecreate: boolean;
1261
1144
  };
1262
1145
  editor: {
1263
1146
  locale: string;
@@ -1317,9 +1200,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1317
1200
  })[];
1318
1201
  ignoreDefaultRules: boolean;
1319
1202
  };
1320
- callbacks: {
1321
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1322
- };
1323
1203
  } | null;
1324
1204
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
1325
1205
  /**
@@ -1352,6 +1232,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1352
1232
  } | undefined;
1353
1233
  }[];
1354
1234
  selectedUnsubscribePages: number[];
1235
+ forceRecreate: boolean;
1355
1236
  };
1356
1237
  editor: {
1357
1238
  locale: string;
@@ -1411,9 +1292,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1411
1292
  })[];
1412
1293
  ignoreDefaultRules: boolean;
1413
1294
  };
1414
- callbacks: {
1415
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1416
- };
1417
1295
  } | null;
1418
1296
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
1419
1297
  /**
@@ -1446,6 +1324,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1446
1324
  } | undefined;
1447
1325
  }[];
1448
1326
  selectedUnsubscribePages: number[];
1327
+ forceRecreate: boolean;
1449
1328
  };
1450
1329
  editor: {
1451
1330
  locale: string;
@@ -1505,9 +1384,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1505
1384
  })[];
1506
1385
  ignoreDefaultRules: boolean;
1507
1386
  };
1508
- callbacks: {
1509
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1510
- };
1511
1387
  } | null;
1512
1388
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
1513
1389
  /**
@@ -1540,6 +1416,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1540
1416
  } | undefined;
1541
1417
  }[];
1542
1418
  selectedUnsubscribePages: number[];
1419
+ forceRecreate: boolean;
1543
1420
  };
1544
1421
  editor: {
1545
1422
  locale: string;
@@ -1599,9 +1476,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1599
1476
  })[];
1600
1477
  ignoreDefaultRules: boolean;
1601
1478
  };
1602
- callbacks: {
1603
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1604
- };
1605
1479
  } | null;
1606
1480
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => boolean;
1607
1481
  /**
@@ -1634,6 +1508,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1634
1508
  } | undefined;
1635
1509
  }[];
1636
1510
  selectedUnsubscribePages: number[];
1511
+ forceRecreate: boolean;
1637
1512
  };
1638
1513
  editor: {
1639
1514
  locale: string;
@@ -1693,9 +1568,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1693
1568
  })[];
1694
1569
  ignoreDefaultRules: boolean;
1695
1570
  };
1696
- callbacks: {
1697
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1698
- };
1699
1571
  } | null;
1700
1572
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => (feature: keyof FeaturesConfig) => boolean;
1701
1573
  }, {
@@ -48,7 +48,7 @@ const o = `.control-shadow-wrapper:has(.button) {
48
48
  }
49
49
 
50
50
  .e2e-text-insert-controls .control-shadow-wrapper:not(:last-of-type) {
51
- margin-right: 6px;
51
+ margin-right: 16px;
52
52
  }
53
53
 
54
54
  .flat-white > .button {
@@ -64,13 +64,6 @@ const s = o("guido-config", {
64
64
  var e;
65
65
  return ((e = i.config) == null ? void 0 : e.compiler) ?? null;
66
66
  },
67
- /**
68
- * Get the callbacks configuration
69
- */
70
- callbacks: (i) => {
71
- var e;
72
- return ((e = i.config) == null ? void 0 : e.callbacks) ?? null;
73
- },
74
67
  /**
75
68
  * Get the template ID
76
69
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "2.0.0-beta.ac3cd4d",
3
+ "version": "2.0.0-beta.afc5689",
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",
@@ -31,7 +31,7 @@
31
31
  "author": "",
32
32
  "license": "ISC",
33
33
  "dependencies": {
34
- "@stripoinc/ui-editor-extensions": "3.3.0",
34
+ "@stripoinc/ui-editor-extensions": "3.5.0",
35
35
  "@useinsider/design-system-vue": "0.14.20",
36
36
  "@vueuse/core": "11.3.0",
37
37
  "lodash-es": "4.17.21",
@@ -85,7 +85,7 @@
85
85
  },
86
86
  "guido": {
87
87
  "stripo": {
88
- "version": "2.47.0"
88
+ "version": "2.52.0"
89
89
  }
90
90
  }
91
91
  }