@useinsider/guido 2.0.0-beta.9b144a9 → 2.0.0-beta.a4f9fa2

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 (77) hide show
  1. package/README.md +2 -0
  2. package/dist/@types/config/schemas.js +9 -5
  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/composables/useStripo.js +57 -56
  10. package/dist/config/migrator/index.js +9 -8
  11. package/dist/config/migrator/itemsBlockMigrator.js +342 -0
  12. package/dist/extensions/Blocks/CouponBlock/constants.js +4 -0
  13. package/dist/extensions/Blocks/CouponBlock/controls/index.js +29 -0
  14. package/dist/extensions/Blocks/CouponBlock/extension.js +5 -4
  15. package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +20 -14
  16. package/dist/extensions/Blocks/CouponBlock/template.js +22 -11
  17. package/dist/extensions/Blocks/Items/block.js +39 -40
  18. package/dist/extensions/Blocks/Items/controls/button/link.js +22 -29
  19. package/dist/extensions/Blocks/Items/controls/cardComposition.js +66 -46
  20. package/dist/extensions/Blocks/Items/controls/image/link.js +23 -30
  21. package/dist/extensions/Blocks/Items/controls/name/trimming.js +25 -25
  22. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +19 -17
  23. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +31 -29
  24. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +36 -36
  25. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +21 -19
  26. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +29 -27
  27. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +93 -0
  28. package/dist/extensions/Blocks/Items/controls/settingsControl.js +152 -143
  29. package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
  30. package/dist/extensions/Blocks/Items/enums/productEnums.js +43 -45
  31. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +4 -3
  32. package/dist/extensions/Blocks/Items/extension.js +7 -6
  33. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +58 -49
  34. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +48 -59
  35. package/dist/extensions/Blocks/Items/settingsPanel.js +27 -26
  36. package/dist/extensions/Blocks/Items/store/items-block.js +11 -7
  37. package/dist/extensions/Blocks/Items/template.js +366 -129
  38. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +184 -0
  39. package/dist/extensions/Blocks/Recommendation/control.js +1 -1
  40. package/dist/extensions/Blocks/common-control.js +29 -30
  41. package/dist/extensions/Blocks/controlFactories.js +139 -118
  42. package/dist/guido.css +1 -1
  43. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +370 -286
  44. package/dist/package.json.js +1 -1
  45. package/dist/services/stripoApi.js +6 -10
  46. package/dist/src/@types/config/schemas.d.ts +8 -0
  47. package/dist/src/composables/useConfig.d.ts +4 -0
  48. package/dist/src/config/migrator/itemsBlockMigrator.d.ts +6 -0
  49. package/dist/src/extensions/Blocks/CouponBlock/constants.d.ts +14 -0
  50. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +108 -0
  51. package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +1 -1
  52. package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +0 -2
  53. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +9 -0
  54. package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +0 -2
  55. package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
  56. package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +18 -0
  57. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -4
  58. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
  59. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +24 -26
  60. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +1 -0
  61. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +2 -0
  62. package/dist/src/extensions/Blocks/Items/template.d.ts +22 -1
  63. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +73 -0
  64. package/dist/src/extensions/Blocks/common-control.d.ts +9 -10
  65. package/dist/src/extensions/Blocks/controlFactories.d.ts +30 -7
  66. package/dist/src/stores/config.d.ts +34 -0
  67. package/dist/static/styles/components/narrow-panel.css.js +0 -10
  68. package/dist/utils/pairProductVariables.js +61 -58
  69. package/package.json +3 -3
  70. package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +0 -17
  71. package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +0 -28
  72. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +0 -76
  73. package/dist/extensions/Blocks/Items/utils/updateAttributes.js +0 -46
  74. package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +0 -23
  75. package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +0 -32
  76. package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +0 -50
  77. package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +0 -8
@@ -12,8 +12,9 @@
12
12
  import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
13
13
  /**
14
14
  * Factory function to create text align controls for different block elements
15
+ * When targetBlockId and containerSelector are not provided, applies directly to root
15
16
  */
16
- export declare function createTextAlignControl(controlId: string, targetBlockId: string, containerSelector: string): {
17
+ export declare function createTextAlignControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
17
18
  new (): {
18
19
  getId(): string;
19
20
  getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
@@ -27,8 +28,9 @@ export declare function createTextAlignControl(controlId: string, targetBlockId:
27
28
  };
28
29
  /**
29
30
  * Factory function to create text color controls for different block elements
31
+ * When targetBlockId and containerSelector are not provided, applies directly to root
30
32
  */
31
- export declare function createTextColorControl(controlId: string, targetBlockId: string, containerSelector?: string): {
33
+ export declare function createTextColorControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
32
34
  new (): {
33
35
  getId(): string;
34
36
  getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
@@ -42,8 +44,9 @@ export declare function createTextColorControl(controlId: string, targetBlockId:
42
44
  };
43
45
  /**
44
46
  * Factory function to create text size controls for different block elements
47
+ * When targetBlockId and containerSelector are not provided, applies directly to root
45
48
  */
46
- export declare function createTextSizeControl(controlId: string, targetBlockId: string, containerSelector?: string): {
49
+ export declare function createTextSizeControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
47
50
  new (): {
48
51
  getId(): string;
49
52
  getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
@@ -57,8 +60,9 @@ export declare function createTextSizeControl(controlId: string, targetBlockId:
57
60
  };
58
61
  /**
59
62
  * Factory function to create text style controls for different block elements
63
+ * When targetBlockId and containerSelector are not provided, applies directly to root
60
64
  */
61
- export declare function createTextStyleControl(controlId: string, targetBlockId: string, containerSelector?: string): {
65
+ export declare function createTextStyleControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
62
66
  new (): {
63
67
  getId(): string;
64
68
  getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
@@ -72,8 +76,9 @@ export declare function createTextStyleControl(controlId: string, targetBlockId:
72
76
  };
73
77
  /**
74
78
  * Factory function to create text font family controls for different block elements
79
+ * When targetBlockId and containerSelector are not provided, applies directly to root
75
80
  */
76
- export declare function createTextFontFamilyControl(controlId: string, targetBlockId: string, containerSelector?: string): {
81
+ export declare function createTextFontFamilyControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
77
82
  new (): {
78
83
  getId(): string;
79
84
  getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
@@ -87,8 +92,9 @@ export declare function createTextFontFamilyControl(controlId: string, targetBlo
87
92
  };
88
93
  /**
89
94
  * Factory function to create text background color controls for different block elements
95
+ * When targetBlockId and containerSelector are not provided, applies directly to root
90
96
  */
91
- export declare function createTextBackgroundColorControl(controlId: string, targetBlockId: string, containerSelector?: string): {
97
+ export declare function createTextBackgroundColorControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
92
98
  new (): {
93
99
  getId(): string;
94
100
  getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
@@ -102,8 +108,25 @@ export declare function createTextBackgroundColorControl(controlId: string, targ
102
108
  };
103
109
  /**
104
110
  * Factory function to create paddings controls for different block elements
111
+ * When targetBlockId and containerSelector are not provided, applies directly to root
105
112
  */
106
- export declare function createPaddingsControl(controlId: string, targetBlockId: string, containerSelector?: string): {
113
+ export declare function createPaddingsControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
114
+ new (): {
115
+ getId(): string;
116
+ getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
117
+ getParentControlId(): string;
118
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
119
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
120
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
121
+ getAdditionalModifications(_root: ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
122
+ isVisible(_node: ImmutableHtmlNode): boolean;
123
+ };
124
+ };
125
+ /**
126
+ * Factory function to create text line spacing controls for different block elements
127
+ * When targetBlockId and containerSelector are not provided, applies directly to root
128
+ */
129
+ export declare function createTextLineSpacingControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
107
130
  new (): {
108
131
  getId(): string;
109
132
  getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
@@ -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;
@@ -57,6 +58,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
57
58
  testMessage: boolean;
58
59
  displayConditions: boolean;
59
60
  unsubscribe: boolean;
61
+ modulesDisabled: boolean;
60
62
  };
61
63
  blocks: {
62
64
  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")[];
@@ -126,6 +128,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
126
128
  } | undefined;
127
129
  }[];
128
130
  selectedUnsubscribePages: number[];
131
+ forceRecreate: boolean;
129
132
  };
130
133
  editor: {
131
134
  locale: string;
@@ -147,6 +150,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
147
150
  testMessage: boolean;
148
151
  displayConditions: boolean;
149
152
  unsubscribe: boolean;
153
+ modulesDisabled: boolean;
150
154
  };
151
155
  blocks: {
152
156
  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")[];
@@ -216,6 +220,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
216
220
  } | undefined;
217
221
  }[];
218
222
  selectedUnsubscribePages: number[];
223
+ forceRecreate: boolean;
219
224
  };
220
225
  editor: {
221
226
  locale: string;
@@ -237,6 +242,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
237
242
  testMessage: boolean;
238
243
  displayConditions: boolean;
239
244
  unsubscribe: boolean;
245
+ modulesDisabled: boolean;
240
246
  };
241
247
  blocks: {
242
248
  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")[];
@@ -306,6 +312,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
306
312
  } | undefined;
307
313
  }[];
308
314
  selectedUnsubscribePages: number[];
315
+ forceRecreate: boolean;
309
316
  };
310
317
  editor: {
311
318
  locale: string;
@@ -327,6 +334,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
327
334
  testMessage: boolean;
328
335
  displayConditions: boolean;
329
336
  unsubscribe: boolean;
337
+ modulesDisabled: boolean;
330
338
  };
331
339
  blocks: {
332
340
  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")[];
@@ -396,6 +404,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
396
404
  } | undefined;
397
405
  }[];
398
406
  selectedUnsubscribePages: number[];
407
+ forceRecreate: boolean;
399
408
  };
400
409
  editor: {
401
410
  locale: string;
@@ -417,6 +426,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
417
426
  testMessage: boolean;
418
427
  displayConditions: boolean;
419
428
  unsubscribe: boolean;
429
+ modulesDisabled: boolean;
420
430
  };
421
431
  blocks: {
422
432
  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")[];
@@ -486,6 +496,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
486
496
  } | undefined;
487
497
  }[];
488
498
  selectedUnsubscribePages: number[];
499
+ forceRecreate: boolean;
489
500
  };
490
501
  editor: {
491
502
  locale: string;
@@ -507,6 +518,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
507
518
  testMessage: boolean;
508
519
  displayConditions: boolean;
509
520
  unsubscribe: boolean;
521
+ modulesDisabled: boolean;
510
522
  };
511
523
  blocks: {
512
524
  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")[];
@@ -576,6 +588,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
576
588
  } | undefined;
577
589
  }[];
578
590
  selectedUnsubscribePages: number[];
591
+ forceRecreate: boolean;
579
592
  };
580
593
  editor: {
581
594
  locale: string;
@@ -597,6 +610,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
597
610
  testMessage: boolean;
598
611
  displayConditions: boolean;
599
612
  unsubscribe: boolean;
613
+ modulesDisabled: boolean;
600
614
  };
601
615
  blocks: {
602
616
  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")[];
@@ -666,6 +680,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
666
680
  } | undefined;
667
681
  }[];
668
682
  selectedUnsubscribePages: number[];
683
+ forceRecreate: boolean;
669
684
  };
670
685
  editor: {
671
686
  locale: string;
@@ -687,6 +702,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
687
702
  testMessage: boolean;
688
703
  displayConditions: boolean;
689
704
  unsubscribe: boolean;
705
+ modulesDisabled: boolean;
690
706
  };
691
707
  blocks: {
692
708
  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")[];
@@ -756,6 +772,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
756
772
  } | undefined;
757
773
  }[];
758
774
  selectedUnsubscribePages: number[];
775
+ forceRecreate: boolean;
759
776
  };
760
777
  editor: {
761
778
  locale: string;
@@ -777,6 +794,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
777
794
  testMessage: boolean;
778
795
  displayConditions: boolean;
779
796
  unsubscribe: boolean;
797
+ modulesDisabled: boolean;
780
798
  };
781
799
  blocks: {
782
800
  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")[];
@@ -846,6 +864,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
846
864
  } | undefined;
847
865
  }[];
848
866
  selectedUnsubscribePages: number[];
867
+ forceRecreate: boolean;
849
868
  };
850
869
  editor: {
851
870
  locale: string;
@@ -867,6 +886,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
867
886
  testMessage: boolean;
868
887
  displayConditions: boolean;
869
888
  unsubscribe: boolean;
889
+ modulesDisabled: boolean;
870
890
  };
871
891
  blocks: {
872
892
  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")[];
@@ -936,6 +956,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
936
956
  } | undefined;
937
957
  }[];
938
958
  selectedUnsubscribePages: number[];
959
+ forceRecreate: boolean;
939
960
  };
940
961
  editor: {
941
962
  locale: string;
@@ -957,6 +978,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
957
978
  testMessage: boolean;
958
979
  displayConditions: boolean;
959
980
  unsubscribe: boolean;
981
+ modulesDisabled: boolean;
960
982
  };
961
983
  blocks: {
962
984
  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")[];
@@ -1026,6 +1048,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1026
1048
  } | undefined;
1027
1049
  }[];
1028
1050
  selectedUnsubscribePages: number[];
1051
+ forceRecreate: boolean;
1029
1052
  };
1030
1053
  editor: {
1031
1054
  locale: string;
@@ -1047,6 +1070,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1047
1070
  testMessage: boolean;
1048
1071
  displayConditions: boolean;
1049
1072
  unsubscribe: boolean;
1073
+ modulesDisabled: boolean;
1050
1074
  };
1051
1075
  blocks: {
1052
1076
  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")[];
@@ -1116,6 +1140,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1116
1140
  } | undefined;
1117
1141
  }[];
1118
1142
  selectedUnsubscribePages: number[];
1143
+ forceRecreate: boolean;
1119
1144
  };
1120
1145
  editor: {
1121
1146
  locale: string;
@@ -1137,6 +1162,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1137
1162
  testMessage: boolean;
1138
1163
  displayConditions: boolean;
1139
1164
  unsubscribe: boolean;
1165
+ modulesDisabled: boolean;
1140
1166
  };
1141
1167
  blocks: {
1142
1168
  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")[];
@@ -1206,6 +1232,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1206
1232
  } | undefined;
1207
1233
  }[];
1208
1234
  selectedUnsubscribePages: number[];
1235
+ forceRecreate: boolean;
1209
1236
  };
1210
1237
  editor: {
1211
1238
  locale: string;
@@ -1227,6 +1254,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1227
1254
  testMessage: boolean;
1228
1255
  displayConditions: boolean;
1229
1256
  unsubscribe: boolean;
1257
+ modulesDisabled: boolean;
1230
1258
  };
1231
1259
  blocks: {
1232
1260
  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")[];
@@ -1296,6 +1324,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1296
1324
  } | undefined;
1297
1325
  }[];
1298
1326
  selectedUnsubscribePages: number[];
1327
+ forceRecreate: boolean;
1299
1328
  };
1300
1329
  editor: {
1301
1330
  locale: string;
@@ -1317,6 +1346,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1317
1346
  testMessage: boolean;
1318
1347
  displayConditions: boolean;
1319
1348
  unsubscribe: boolean;
1349
+ modulesDisabled: boolean;
1320
1350
  };
1321
1351
  blocks: {
1322
1352
  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")[];
@@ -1386,6 +1416,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1386
1416
  } | undefined;
1387
1417
  }[];
1388
1418
  selectedUnsubscribePages: number[];
1419
+ forceRecreate: boolean;
1389
1420
  };
1390
1421
  editor: {
1391
1422
  locale: string;
@@ -1407,6 +1438,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1407
1438
  testMessage: boolean;
1408
1439
  displayConditions: boolean;
1409
1440
  unsubscribe: boolean;
1441
+ modulesDisabled: boolean;
1410
1442
  };
1411
1443
  blocks: {
1412
1444
  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")[];
@@ -1476,6 +1508,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1476
1508
  } | undefined;
1477
1509
  }[];
1478
1510
  selectedUnsubscribePages: number[];
1511
+ forceRecreate: boolean;
1479
1512
  };
1480
1513
  editor: {
1481
1514
  locale: string;
@@ -1497,6 +1530,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1497
1530
  testMessage: boolean;
1498
1531
  displayConditions: boolean;
1499
1532
  unsubscribe: boolean;
1533
+ modulesDisabled: boolean;
1500
1534
  };
1501
1535
  blocks: {
1502
1536
  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")[];
@@ -32,16 +32,6 @@ ue-stripe-thumb:hover:not(.disabled),
32
32
  padding: 0 16px 16px;
33
33
  grid-row-gap: 16px;
34
34
  }
35
-
36
- /* TODO: will be removed after we find another way to hide stripo custom modules */
37
- #moduleTab_tab1,
38
- button[aria-label="Default Modules"],
39
- button[aria-controls="moduleTab_tab1_content"],
40
- #moduleTab_tab2,
41
- button[aria-label="Pre-Built AMP"],
42
- button[aria-controls="moduleTab_tab2_content"] {
43
- display: none !important;
44
- }
45
35
  `;
46
36
  export {
47
37
  o as default
@@ -1,74 +1,77 @@
1
1
  import { productPairs as w } from "../extensions/Blocks/Items/enums/productEnums.js";
2
- function M(H) {
3
- const m = H.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), $ = new DOMParser().parseFromString(m, "text/html"), C = w.PAIRS_FOR_EXTENSION;
4
- Object.entries(C).forEach(([n, d]) => {
2
+ function P(k) {
3
+ const m = k.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), $ = new DOMParser().parseFromString(m, "text/html"), R = w.PAIRS_FOR_EXTENSION;
4
+ Object.entries(R).forEach(([n, l]) => {
5
5
  $.querySelectorAll(".ins-product-td").forEach((o) => {
6
- const h = o.getAttribute("data-number") || "1", _ = o.getAttribute("data-type") || "CART_ITEMS";
6
+ const E = o.getAttribute("data-number") || "1", b = o.getAttribute("data-type") || "CART_ITEMS";
7
7
  o.querySelectorAll(`[product-attr="${n}"]`).forEach((e) => {
8
8
  var y;
9
- const b = e.getAttribute("data-type") || _, u = e.getAttribute("data-number") || h, p = d[b];
9
+ const T = e.getAttribute("data-type") || b, u = e.getAttribute("data-number") || E, p = l[T];
10
10
  if (p)
11
11
  switch (n) {
12
12
  case "imageSrc": {
13
- let t = null, i = null;
14
- if (e.tagName === "IMG" ? (t = e, i = t.closest("a")) : (t = e.querySelector("img"), i = e.querySelector("a") || e.closest("a")), !t)
13
+ let t = null, c = null;
14
+ if (e.tagName === "IMG" ? (t = e, c = t.closest("a")) : (t = e.querySelector("img"), c = e.querySelector("a") || e.closest("a")), !t)
15
15
  break;
16
- const c = p.DEFAULT, a = p.ATTR;
17
- if (c && t.src) {
16
+ const i = p.DEFAULT, a = p.ATTR;
17
+ if (i && t.src) {
18
18
  const r = t.src;
19
- c.some((l) => {
20
- const s = l.split("/").pop() || "", F = r.split("/").pop() || "";
21
- return r.includes(l) || r.includes(s) || F === s;
19
+ i.some((d) => {
20
+ const s = d.split("/").pop() || "", _ = r.split("/").pop() || "";
21
+ return r.includes(d) || r.includes(s) || _ === s;
22
22
  }) && (t.src = `{{${a}_${u}}}`);
23
23
  }
24
- if (i) {
25
- const r = (y = C.itemLink) == null ? void 0 : y[b];
24
+ if (c) {
25
+ const r = (y = R.itemLink) == null ? void 0 : y[T];
26
26
  if (r) {
27
- const f = r.HREF, l = r.DEFAULT_HREF || "#!", s = i.href;
28
- (s === "#" || s === "" || s.endsWith("#!") || s.endsWith(l) || s === `${window.location.href}${l}` || !s || s === window.location.href) && (i.href = `{{${f}_${u}}}`);
27
+ const f = r.HREF, d = r.DEFAULT_HREF || "#!", s = c.href;
28
+ (s === "#" || s === "" || s.endsWith("#!") || s.endsWith(d) || s === `${window.location.href}${d}` || !s || s === window.location.href) && (c.href = `{{${f}_${u}}}`);
29
29
  }
30
30
  }
31
31
  break;
32
32
  }
33
33
  case "name": {
34
- const t = p, i = t.ATTR, c = t.DEFAULT_HREF || "#!", a = t.HREF;
35
- e.textContent && (e.textContent = `{{${i}_${u}}}`);
34
+ const t = p, c = t.ATTR, i = t.DEFAULT_HREF || "#!", a = t.HREF;
35
+ e.textContent && (e.textContent = `{{${c}_${u}}}`);
36
36
  const r = e.closest("a") || (e.tagName === "A" ? e : null);
37
37
  if (r && a) {
38
- const f = r.href, l = `${window.location.href}${c}`;
39
- (f === l || f.endsWith(c)) && (r.href = `{{${a}_${u}}}`);
38
+ const f = r.href, d = `${window.location.href}${i}`;
39
+ (f === d || f.endsWith(i)) && (r.href = `{{${a}_${u}}}`);
40
40
  }
41
41
  break;
42
42
  }
43
43
  case "price":
44
44
  case "originalPrice": {
45
- const t = p, c = e.getAttribute("data-formated") === "true", a = e.getAttribute("data-curency") || "before", r = c ? t.PRICE_FORMATTED : t.PRICE, f = t.CURRENCY;
46
- let l = `{{${r}_${u}}}`;
47
- if (f) {
48
- const s = `{{${f}_${u}}}`;
49
- l = a === "after" ? `${l} ${s}` : `${s} ${l}`;
45
+ const t = p, c = e.getAttribute("data-formated"), i = e.getAttribute("data-single_price"), a = c === "true", r = i === "true", f = e.getAttribute("data-curency") || "before";
46
+ let d;
47
+ r ? d = a ? t.SINGLE_PRICE_FORMATTED : t.SINGLE_PRICE : d = a ? t.PRICE_FORMATTED : t.PRICE;
48
+ const s = t.CURRENCY;
49
+ let _ = `{{${d}_${u}}}`;
50
+ if (s) {
51
+ const H = `{{${s}_${u}}}`;
52
+ _ = f === "after" ? `${_} ${H}` : `${H} ${_}`;
50
53
  }
51
- e.textContent = l;
54
+ e.textContent = _;
52
55
  break;
53
56
  }
54
57
  case "quantity": {
55
- const t = p, i = t.ATTR, c = t.DEFAULT;
56
- e.textContent && e.textContent.trim() === c && (e.textContent = `{{${i}_${u}}}`);
58
+ const t = p, c = t.ATTR, i = t.DEFAULT;
59
+ e.textContent && e.textContent.trim() === i && (e.textContent = `{{${c}_${u}}}`);
57
60
  break;
58
61
  }
59
62
  case "button": {
60
- const t = p, i = t.HREF, c = t.DEFAULT_HREF || "#!", a = e.tagName === "A" ? e : e.querySelector("a");
63
+ const t = p, c = t.HREF, i = t.DEFAULT_HREF || "#!", a = e.tagName === "A" ? e : e.querySelector("a");
61
64
  if (a) {
62
- const r = a.href || "", f = `${window.location.href}${c}`;
63
- (r === "" || r === "#" || r === f || r.endsWith(c) || r.endsWith("#!") || r === window.location.href) && (a.href = `{{${i}_${u}}}`);
65
+ const r = a.href || "", f = `${window.location.href}${i}`;
66
+ (r === "" || r === "#" || r === f || r.endsWith(i) || r.endsWith("#!") || r === window.location.href) && (a.href = `{{${c}_${u}}}`);
64
67
  }
65
68
  break;
66
69
  }
67
70
  case "itemLink": {
68
- const t = p, i = t.HREF, c = t.DEFAULT_HREF || "#!", a = e;
71
+ const t = p, c = t.HREF, i = t.DEFAULT_HREF || "#!", a = e;
69
72
  if (a.href) {
70
- const r = a.href, f = `${window.location.href}${c}`;
71
- (r === f || r.endsWith(c)) && (a.href = `{{${i}_${u}}}`);
73
+ const r = a.href, f = `${window.location.href}${i}`;
74
+ (r === f || r.endsWith(i)) && (a.href = `{{${c}_${u}}}`);
72
75
  }
73
76
  break;
74
77
  }
@@ -83,21 +86,21 @@ function M(H) {
83
86
  });
84
87
  });
85
88
  });
86
- const S = $.querySelectorAll(".ins-product-td"), R = [];
87
- S.forEach((n) => {
88
- const d = n.getAttribute("data-type") || "CART_ITEMS", A = n.getAttribute("data-number") || "1", o = n.getAttribute("data-nodup"), h = n.outerHTML;
89
- R.push({
89
+ const F = $.querySelectorAll(".ins-product-td"), S = [];
90
+ F.forEach((n) => {
91
+ const l = n.getAttribute("data-type") || "CART_ITEMS", A = n.getAttribute("data-number") || "1", o = n.getAttribute("data-nodup"), E = n.outerHTML;
92
+ S.push({
90
93
  element: n,
91
- outerHtml: h,
92
- type: d,
94
+ outerHtml: E,
95
+ type: l,
93
96
  number: A,
94
97
  nodup: o || void 0
95
98
  });
96
99
  });
97
- let E = $.body.innerHTML;
98
- R.reverse().forEach(({ outerHtml: n, type: d, number: A }) => {
100
+ let h = $.body.innerHTML;
101
+ S.reverse().forEach(({ outerHtml: n, type: l, number: A }) => {
99
102
  let o = "";
100
- switch (d) {
103
+ switch (l) {
101
104
  case "CART_ITEMS":
102
105
  o = "ins_apr_total_product_kind";
103
106
  break;
@@ -109,28 +112,28 @@ function M(H) {
109
112
  break;
110
113
  }
111
114
  if (o) {
112
- const _ = parseInt(A) - 1, b = `${`{% if ${o} > ${_} %}`}${n}{% endif %}`;
113
- E = E.replace(n, b);
115
+ const b = parseInt(A) - 1, T = `${`{% if ${o} > ${b} %}`}${n}{% endif %}`;
116
+ h = h.replace(n, T);
114
117
  }
115
118
  });
116
- const k = $.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), T = [];
117
- return k.forEach((n) => {
118
- const d = n.getAttribute("data-number"), A = n.getAttribute("data-type");
119
- if (!d || A !== "CART_ITEMS")
119
+ const I = $.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), g = [];
120
+ return I.forEach((n) => {
121
+ const l = n.getAttribute("data-number"), A = n.getAttribute("data-type");
122
+ if (!l || A !== "CART_ITEMS")
120
123
  return;
121
124
  const o = n.closest(".product-original-price-class");
122
125
  if (o) {
123
- const h = o.outerHTML;
124
- T.some((g) => g.tdOuterHtml === h) || T.push({ tdOuterHtml: h, number: d });
126
+ const E = o.outerHTML;
127
+ g.some((C) => C.tdOuterHtml === E) || g.push({ tdOuterHtml: E, number: l });
125
128
  }
126
- }), T.reverse().forEach(({ tdOuterHtml: n, number: d }) => {
127
- const A = `{% if ins_apr_price_${d} != ins_apr_originalprice_${d} %}`;
128
- if (!E.includes(A) && !n.includes("{% if")) {
129
- const h = `${A}${n}{% endif %}`;
130
- E = E.replace(n, h);
129
+ }), g.reverse().forEach(({ tdOuterHtml: n, number: l }) => {
130
+ const A = `{% if ins_apr_price_${l} != ins_apr_originalprice_${l} %}`;
131
+ if (!h.includes(A) && !n.includes("{% if")) {
132
+ const E = `${A}${n}{% endif %}`;
133
+ h = h.replace(n, E);
131
134
  }
132
- }), E.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
135
+ }), h.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
133
136
  }
134
137
  export {
135
- M as pairProductVariables
138
+ P as pairProductVariables
136
139
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "2.0.0-beta.9b144a9",
3
+ "version": "2.0.0-beta.a4f9fa2",
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
  }
@@ -1,17 +0,0 @@
1
- function r(t) {
2
- if (!t)
3
- return null;
4
- const n = t.closest(".items-block-v2");
5
- return n ? n.querySelector("esd-config-block") : null;
6
- }
7
- function o(t, n = !1) {
8
- return t == null ? n : t === "1" || t === "true";
9
- }
10
- function e(t, n = "") {
11
- return t || n;
12
- }
13
- export {
14
- o as attributeToBoolean,
15
- e as attributeToString,
16
- r as getConfigBlock
17
- };
@@ -1,28 +0,0 @@
1
- import { configAttributes as i } from "../enums/productEnums.js";
2
- import { getConfigBlock as c, attributeToBoolean as u, attributeToString as a } from "./configBlockUtils.js";
3
- function l(r, t) {
4
- const e = c(r);
5
- if (!e)
6
- return;
7
- const o = e.getAttribute(i[t.attributeName]), n = t.converter(o);
8
- t.storeSetter(n);
9
- }
10
- function b(r, t, e = !1) {
11
- return {
12
- attributeName: r,
13
- storeSetter: t,
14
- converter: (o) => u(o, e)
15
- };
16
- }
17
- function s(r, t, e = "") {
18
- return {
19
- attributeName: r,
20
- storeSetter: t,
21
- converter: (o) => a(o, e)
22
- };
23
- }
24
- export {
25
- b as createBooleanSyncConfig,
26
- s as createStringSyncConfig,
27
- l as syncAttributeFromConfigBlock
28
- };