@useinsider/guido 1.4.4-beta.9adffb8 → 1.4.4-beta.a48da7f

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 (94) hide show
  1. package/README.md +295 -664
  2. package/dist/@types/config/defaults.js +44 -0
  3. package/dist/@types/config/schemas.js +243 -0
  4. package/dist/@types/config/validator.js +56 -0
  5. package/dist/components/Guido.vue.js +1 -1
  6. package/dist/components/Guido.vue2.js +63 -89
  7. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +13 -13
  8. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +5 -5
  9. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +13 -13
  10. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  11. package/dist/components/organisms/header/LeftSlot.vue2.js +18 -15
  12. package/dist/components/organisms/header/RightSlot.vue.js +10 -10
  13. package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
  14. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +22 -19
  15. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +4 -4
  16. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +8 -8
  17. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
  18. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +17 -17
  19. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -10
  20. package/dist/composables/useBlocksConfig.js +23 -20
  21. package/dist/composables/useConfig.js +53 -5
  22. package/dist/composables/useHtmlCompiler.js +20 -19
  23. package/dist/composables/useHtmlValidator.js +41 -41
  24. package/dist/composables/usePartner.js +19 -9
  25. package/dist/composables/useSave.js +13 -11
  26. package/dist/composables/useStripo.js +11 -11
  27. package/dist/composables/useTranslations.js +3 -2
  28. package/dist/config/compiler/unsubscribeCompilerRules.js +1 -1
  29. package/dist/enums/defaults.js +3 -67
  30. package/dist/enums/unsubscribe.js +23 -20
  31. package/dist/extensions/Blocks/CouponBlock/extension.js +4 -5
  32. package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +14 -20
  33. package/dist/extensions/Blocks/CouponBlock/template.js +11 -22
  34. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +12 -11
  35. package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
  36. package/dist/extensions/Blocks/controlFactories.js +111 -122
  37. package/dist/guido.css +1 -1
  38. package/dist/library.js +12 -2
  39. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +52 -57
  40. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +10 -10
  41. package/dist/node_modules/valibot/dist/index.js +476 -103
  42. package/dist/services/templateLibraryApi.js +18 -18
  43. package/dist/src/@types/config/defaults.d.ts +68 -0
  44. package/dist/src/@types/config/index.d.ts +14 -0
  45. package/dist/src/@types/config/schemas.d.ts +531 -0
  46. package/dist/src/@types/config/types.d.ts +148 -0
  47. package/dist/src/@types/config/validator.d.ts +119 -0
  48. package/dist/src/@types/generic.d.ts +4 -45
  49. package/dist/src/components/Guido.vue.d.ts +13 -12
  50. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  51. package/dist/src/composables/useConfig.d.ts +190 -2
  52. package/dist/src/composables/usePartner.d.ts +8 -0
  53. package/dist/src/enums/defaults.d.ts +4 -6
  54. package/dist/src/enums/unsubscribe.d.ts +5 -1
  55. package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +1 -1
  56. package/dist/src/extensions/Blocks/controlFactories.d.ts +7 -30
  57. package/dist/src/library.d.ts +3 -1
  58. package/dist/src/stores/config.d.ts +1691 -102
  59. package/dist/stores/config.js +148 -9
  60. package/package.json +1 -1
  61. package/dist/extensions/Blocks/CouponBlock/constants.js +0 -4
  62. package/dist/extensions/Blocks/CouponBlock/controls/index.js +0 -29
  63. package/dist/node_modules/lodash-es/_apply.js +0 -16
  64. package/dist/node_modules/lodash-es/_assignMergeValue.js +0 -8
  65. package/dist/node_modules/lodash-es/_assignValue.js +0 -10
  66. package/dist/node_modules/lodash-es/_baseAssignValue.js +0 -12
  67. package/dist/node_modules/lodash-es/_baseCreate.js +0 -17
  68. package/dist/node_modules/lodash-es/_baseKeysIn.js +0 -15
  69. package/dist/node_modules/lodash-es/_baseMerge.js +0 -20
  70. package/dist/node_modules/lodash-es/_baseMergeDeep.js +0 -31
  71. package/dist/node_modules/lodash-es/_baseRest.js +0 -9
  72. package/dist/node_modules/lodash-es/_baseSetToString.js +0 -14
  73. package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  74. package/dist/node_modules/lodash-es/_cloneBuffer.js +0 -9
  75. package/dist/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  76. package/dist/node_modules/lodash-es/_copyArray.js +0 -9
  77. package/dist/node_modules/lodash-es/_copyObject.js +0 -14
  78. package/dist/node_modules/lodash-es/_createAssigner.js +0 -15
  79. package/dist/node_modules/lodash-es/_defineProperty.js +0 -11
  80. package/dist/node_modules/lodash-es/_getPrototype.js +0 -5
  81. package/dist/node_modules/lodash-es/_initCloneObject.js +0 -9
  82. package/dist/node_modules/lodash-es/_nativeKeysIn.js +0 -10
  83. package/dist/node_modules/lodash-es/_overRest.js +0 -15
  84. package/dist/node_modules/lodash-es/_safeGet.js +0 -7
  85. package/dist/node_modules/lodash-es/_setToString.js +0 -6
  86. package/dist/node_modules/lodash-es/_shortOut.js +0 -16
  87. package/dist/node_modules/lodash-es/constant.js +0 -8
  88. package/dist/node_modules/lodash-es/isArrayLikeObject.js +0 -8
  89. package/dist/node_modules/lodash-es/isPlainObject.js +0 -16
  90. package/dist/node_modules/lodash-es/keysIn.js +0 -9
  91. package/dist/node_modules/lodash-es/merge.js +0 -8
  92. package/dist/node_modules/lodash-es/toPlainObject.js +0 -8
  93. package/dist/src/extensions/Blocks/CouponBlock/constants.d.ts +0 -14
  94. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +0 -108
@@ -23,12 +23,12 @@ ${s.map((E) => ` - ${E}`).join(`
23
23
  validateImplementation(e, r) {
24
24
  var I;
25
25
  const s = [], E = r.name, T = Object.getPrototypeOf(this);
26
- e.forEach((d) => {
27
- if (typeof this[d] != "function") {
28
- s.push(`Method ${d}() is not defined`);
26
+ e.forEach((l) => {
27
+ if (typeof this[l] != "function") {
28
+ s.push(`Method ${l}() is not defined`);
29
29
  return;
30
30
  }
31
- T[d] === r.prototype[d] && s.push(`Method ${d}() must be implemented (currently using base class error-throwing implementation)`);
31
+ T[l] === r.prototype[l] && s.push(`Method ${l}() must be implemented (currently using base class error-throwing implementation)`);
32
32
  }), u.validatedClasses.add(r), s.length > 0 ? (u.validationErrors.set(r, s), console.error(`[${E} Validation] ${E} validation failed:`, s)) : typeof process < "u" && ((I = process.env) == null ? void 0 : I.NODE_ENV) === "development" && console.log(`[${E} Validation] ✅ ${E} validated successfully`);
33
33
  }
34
34
  };
@@ -254,10 +254,10 @@ var st = {
254
254
  ...o,
255
255
  caption: "caption",
256
256
  icon: "icon"
257
- }, gt = {
257
+ }, mt = {
258
258
  ...o,
259
259
  caption: "caption"
260
- }, mt = {
260
+ }, gt = {
261
261
  ...o,
262
262
  minValue: "min-value",
263
263
  maxValue: "max-value",
@@ -265,7 +265,7 @@ var st = {
265
265
  }, bt = {
266
266
  ...o,
267
267
  text: "text"
268
- }, Nt = {
268
+ }, At = {
269
269
  ...o
270
270
  }, X = {
271
271
  ...o,
@@ -273,7 +273,7 @@ var st = {
273
273
  multiSelect: "multi-select",
274
274
  placeholder: "placeholder",
275
275
  items: "items"
276
- }, At = {
276
+ }, Nt = {
277
277
  ...X
278
278
  }, Dt = {
279
279
  text: "text",
@@ -292,15 +292,15 @@ var st = {
292
292
  position: "position"
293
293
  }, vt = {
294
294
  ...o
295
- }, Gt = {
295
+ }, Vt = {
296
296
  BUTTON: Ct,
297
- CHECKBOX: gt,
297
+ CHECKBOX: mt,
298
298
  COLOR: o,
299
- COUNTER: mt,
299
+ COUNTER: gt,
300
300
  LABEL: bt,
301
- RADIO_BUTTONS: Nt,
301
+ RADIO_BUTTONS: At,
302
302
  SELECTPICKER: X,
303
- FONT_FAMILY_SELECT: At,
303
+ FONT_FAMILY_SELECT: Nt,
304
304
  SWITCHER: o,
305
305
  TEXT: Bt,
306
306
  SELECT_ITEM: Dt,
@@ -344,7 +344,7 @@ var st = {
344
344
  const e = t.querySelectorAll(O.BUTTON), r = t.asElement().hasClass(U) ? [t] : [];
345
345
  return e.length ? e : r;
346
346
  }
347
- }, Vt = class extends i {
347
+ }, Gt = class extends i {
348
348
  getParentControlId() {
349
349
  return n.BLOCK_BUTTON.BORDER_RADIUS;
350
350
  }
@@ -454,20 +454,20 @@ var st = {
454
454
  }
455
455
  };
456
456
  k.REQUIRED_METHODS = ["getId", "getTemplate"];
457
- var ee = k, G = class extends x {
457
+ var ee = k, V = class extends x {
458
458
  getTargetNodes(t) {
459
459
  const e = t.querySelectorAll(O.IMAGE), r = t.asElement().hasClass(K) ? [t] : [];
460
460
  return e.length ? e : r;
461
461
  }
462
- }, re = class extends G {
462
+ }, re = class extends V {
463
463
  getParentControlId() {
464
464
  return n.BLOCK_IMAGE.EXTERNAL_INDENTS;
465
465
  }
466
- }, ne = class extends G {
466
+ }, ne = class extends V {
467
467
  getParentControlId() {
468
468
  return n.BLOCK_IMAGE.SIZE;
469
469
  }
470
- }, V = class L extends a {
470
+ }, G = class L extends a {
471
471
  constructor() {
472
472
  super(L.REQUIRED_METHODS, L);
473
473
  }
@@ -475,8 +475,8 @@ var ee = k, G = class extends x {
475
475
  throw new Error("Method registerBlockControls() must be implemented by the subclass");
476
476
  }
477
477
  };
478
- V.REQUIRED_METHODS = ["registerBlockControls"];
479
- var se = V, ae = class {
478
+ G.REQUIRED_METHODS = ["registerBlockControls"];
479
+ var se = G, ae = class {
480
480
  constructor(t, e) {
481
481
  this.tabId = t, this.controlsIds = e;
482
482
  }
@@ -499,46 +499,42 @@ var se = V, ae = class {
499
499
  const e = this.controlsIds.indexOf(t);
500
500
  e !== -1 && this.controlsIds.splice(e, 1);
501
501
  }
502
- }, l = class extends x {
502
+ }, d = class extends x {
503
503
  getTargetNodes(t) {
504
504
  const e = t.querySelectorAll(O.TEXT), r = t.asElement().hasClass(p) ? [t] : [];
505
505
  return e.length ? e : r;
506
506
  }
507
- }, ie = class extends l {
507
+ }, ie = class extends d {
508
508
  getParentControlId() {
509
509
  return n.GENERAL.TEXT_ALIGN;
510
510
  }
511
- }, oe = class extends l {
511
+ }, oe = class extends d {
512
512
  getParentControlId() {
513
513
  return n.BLOCK_TEXT.TEXT_BLOCK_BACKGROUND_COLOR;
514
514
  }
515
- }, Ee = class extends l {
515
+ }, Ee = class extends d {
516
516
  getParentControlId() {
517
517
  return n.GENERAL.TEXT_COLOR;
518
518
  }
519
- }, le = class extends l {
519
+ }, le = class extends d {
520
520
  getParentControlId() {
521
521
  return n.BLOCK_TEXT.FONT_FAMILY;
522
522
  }
523
- }, de = class extends l {
524
- getParentControlId() {
525
- return n.GENERAL.TEXT_LINE_SPACING;
526
- }
527
- }, ue = class extends l {
523
+ }, de = class extends d {
528
524
  getParentControlId() {
529
525
  return n.BLOCK_TEXT.INTERNAL_INDENTS;
530
526
  }
531
- }, Ie = class extends l {
527
+ }, ue = class extends d {
532
528
  getParentControlId() {
533
529
  return n.GENERAL.TEXT_SIZE;
534
530
  }
535
- }, Oe = class extends l {
531
+ }, Ie = class extends d {
536
532
  getParentControlId() {
537
533
  return n.GENERAL.TEXT_STYLE;
538
534
  }
539
535
  }, Ut = class {
540
- constructor(t, e, r = [], s, E = [], T, I = [], d = [], v, $, W, z, Z, j, q, J, tt) {
541
- this.uiElements = [], this.controls = [], this.contextActions = [], this.blocks = [], this.i18n = t, this.styles = e, this.previewStyles = W, this.uiElements = r, this.uiElementTagRegistry = s, this.controls = E, this.settingsPanelRegistry = T, this.contextActions = I, this.blocks = d, this.externalSmartElementsLibrary = v, this.externalImageLibrary = $, this.externalImageLibraryTab = tt, this.externalAiAssistant = z, this.externalDisplayConditionsLibrary = Z, this.externalVideoLibrary = j, this.blocksPanel = q, this.iconsRegistry = J, this.id = Math.random().toString(36).substring(2);
536
+ constructor(t, e, r = [], s, E = [], T, I = [], l = [], v, $, W, z, Z, j, q, J, tt) {
537
+ this.uiElements = [], this.controls = [], this.contextActions = [], this.blocks = [], this.i18n = t, this.styles = e, this.previewStyles = W, this.uiElements = r, this.uiElementTagRegistry = s, this.controls = E, this.settingsPanelRegistry = T, this.contextActions = I, this.blocks = l, this.externalSmartElementsLibrary = v, this.externalImageLibrary = $, this.externalImageLibraryTab = tt, this.externalAiAssistant = z, this.externalDisplayConditionsLibrary = Z, this.externalVideoLibrary = j, this.blocksPanel = q, this.iconsRegistry = J, this.id = Math.random().toString(36).substring(2);
542
538
  }
543
539
  getI18n() {
544
540
  return this.i18n;
@@ -594,7 +590,7 @@ var se = V, ae = class {
594
590
  getIconsRegistry() {
595
591
  return this.iconsRegistry;
596
592
  }
597
- }, Te = class {
593
+ }, Oe = class {
598
594
  constructor() {
599
595
  this.styles = [], this.uiElements = [], this.controls = [], this.contextActions = [], this.blocks = [];
600
596
  }
@@ -689,9 +685,9 @@ var se = V, ae = class {
689
685
  }
690
686
  };
691
687
  pt.REQUIRED_METHODS = ["openAiAssistant"];
692
- var Kt = class g extends a {
688
+ var Kt = class m extends a {
693
689
  constructor() {
694
- super(g.REQUIRED_METHODS, g);
690
+ super(m.REQUIRED_METHODS, m);
695
691
  }
696
692
  /**
697
693
  * Retrieves the name of the category.
@@ -730,9 +726,9 @@ var Kt = class g extends a {
730
726
  }
731
727
  };
732
728
  Kt.REQUIRED_METHODS = ["getCategoryName", "openExternalDisplayConditionsDialog"];
733
- var Ft = class m extends a {
729
+ var Ft = class g extends a {
734
730
  constructor() {
735
- super(m.REQUIRED_METHODS, m);
731
+ super(g.REQUIRED_METHODS, g);
736
732
  }
737
733
  openImageLibrary(e, r, s) {
738
734
  throw new Error("Method openImageLibrary() must be implemented by the subclass");
@@ -760,18 +756,18 @@ var wt = class b extends a {
760
756
  }
761
757
  };
762
758
  wt.REQUIRED_METHODS = ["getName", "openImageLibraryTab"];
763
- var Pt = class N extends a {
759
+ var Pt = class A extends a {
764
760
  constructor() {
765
- super(N.REQUIRED_METHODS, N);
761
+ super(A.REQUIRED_METHODS, A);
766
762
  }
767
763
  openSmartElementsLibrary(e, r) {
768
764
  throw new Error("Method openSmartElementsLibrary() must be implemented by the subclass");
769
765
  }
770
766
  };
771
767
  Pt.REQUIRED_METHODS = ["openSmartElementsLibrary"];
772
- var Ht = class A extends a {
768
+ var Ht = class N extends a {
773
769
  constructor() {
774
- super(A.REQUIRED_METHODS, A);
770
+ super(N.REQUIRED_METHODS, N);
775
771
  }
776
772
  openExternalVideosLibraryDialog(e, r, s) {
777
773
  throw new Error("Method openExternalVideosLibraryDialog() must be implemented by the subclass");
@@ -787,7 +783,7 @@ var Q = class D extends a {
787
783
  }
788
784
  };
789
785
  Q.REQUIRED_METHODS = ["registerIconsSvg"];
790
- var ce = Q, _e = class {
786
+ var Te = Q, ce = class {
791
787
  constructor(t) {
792
788
  this.key = t;
793
789
  }
@@ -856,7 +852,7 @@ var ce = Q, _e = class {
856
852
  }
857
853
  };
858
854
  f.REQUIRED_METHODS = ["onRender", "getId", "getTemplate"];
859
- var he = f, Y = class B extends a {
855
+ var _e = f, Y = class B extends a {
860
856
  constructor() {
861
857
  super(B.REQUIRED_METHODS, B);
862
858
  }
@@ -865,7 +861,7 @@ var he = f, Y = class B extends a {
865
861
  }
866
862
  };
867
863
  Y.REQUIRED_METHODS = ["registerUiElements"];
868
- var Re = Y;
864
+ var he = Y;
869
865
  export {
870
866
  Xt as Block,
871
867
  kt as BlockAttr,
@@ -877,7 +873,7 @@ export {
877
873
  Qt as ButtonAlignBuiltInControl,
878
874
  ft as ButtonBackgroundColorBuiltInControl,
879
875
  Yt as ButtonBorderBuiltInControl,
880
- Vt as ButtonBorderRadiusBuiltInControl,
876
+ Gt as ButtonBorderRadiusBuiltInControl,
881
877
  $t as ButtonColorBuiltInControl,
882
878
  w as ButtonControls,
883
879
  Wt as ButtonFitToContainerBuiltInControl,
@@ -890,13 +886,13 @@ export {
890
886
  Rt as ContainerControls,
891
887
  ee as Control,
892
888
  Ut as Extension,
893
- Te as ExtensionBuilder,
889
+ Oe as ExtensionBuilder,
894
890
  F as GeneralControls,
895
- ce as IconsRegistry,
891
+ Te as IconsRegistry,
896
892
  H as ImageControls,
897
893
  re as ImageMarginsBuiltInControl,
898
894
  ne as ImageSizeBuiltInControl,
899
- _e as ModificationDescription,
895
+ ce as ModificationDescription,
900
896
  se as SettingsPanelRegistry,
901
897
  ae as SettingsPanelTab,
902
898
  Lt as SettingsTab,
@@ -905,12 +901,11 @@ export {
905
901
  Ee as TextColorBuiltInControl,
906
902
  P as TextControls,
907
903
  le as TextFontFamilyBuiltInControl,
908
- de as TextLineSpacingBuiltInControl,
909
- ue as TextPaddingsBuiltInControl,
910
- Ie as TextSizeBuiltInControl,
911
- Oe as TextStyleBuiltInControl,
912
- Gt as UEAttr,
913
- he as UIElement,
914
- Re as UIElementTagRegistry,
904
+ de as TextPaddingsBuiltInControl,
905
+ ue as TextSizeBuiltInControl,
906
+ Ie as TextStyleBuiltInControl,
907
+ Vt as UEAttr,
908
+ _e as UIElement,
909
+ he as UIElementTagRegistry,
915
910
  yt as UIElementType
916
911
  };
@@ -1,18 +1,18 @@
1
- import a from "./_baseTimes.js";
2
- import g from "./isArguments.js";
1
+ import m from "./_baseTimes.js";
2
+ import a from "./isArguments.js";
3
3
  import h from "./isArray.js";
4
- import b from "./isBuffer.js";
5
- import A from "./_isIndex.js";
6
- import c from "./isTypedArray.js";
7
- var d = Object.prototype, O = d.hasOwnProperty;
8
- function l(t, p) {
9
- var o = h(t), i = !o && g(t), s = !o && !i && b(t), e = !o && !i && !s && c(t), n = o || i || s || e, f = n ? a(t.length, String) : [], m = f.length;
4
+ import g from "./isBuffer.js";
5
+ import b from "./_isIndex.js";
6
+ import d from "./isTypedArray.js";
7
+ var A = Object.prototype, c = A.hasOwnProperty;
8
+ function l(t, O) {
9
+ var i = h(t), o = !i && a(t), s = !i && !o && g(t), e = !i && !o && !s && d(t), n = i || o || s || e, f = n ? m(t.length, String) : [], p = f.length;
10
10
  for (var r in t)
11
- (p || O.call(t, r)) && !(n && // Safari 9 has enumerable `arguments.length` in strict mode.
11
+ c.call(t, r) && !(n && // Safari 9 has enumerable `arguments.length` in strict mode.
12
12
  (r == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
13
13
  s && (r == "offset" || r == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
14
14
  e && (r == "buffer" || r == "byteLength" || r == "byteOffset") || // Skip index properties.
15
- A(r, m))) && f.push(r);
15
+ b(r, p))) && f.push(r);
16
16
  return f;
17
17
  }
18
18
  export {