@useinsider/guido 1.0.3-beta.ce4cdcb → 1.0.3-beta.cedc8cb

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 (115) hide show
  1. package/dist/@types/generic.d.ts +13 -0
  2. package/dist/components/Guido.vue.d.ts +3 -2
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +99 -70
  5. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +19 -0
  6. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +28 -0
  7. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +38 -0
  8. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts +2 -0
  9. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +17 -0
  10. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +37 -0
  11. package/dist/components/organisms/extensions/recommendation/Filters.vue.d.ts +2 -0
  12. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +20 -0
  13. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +44 -0
  14. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +16 -0
  15. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +17 -0
  16. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +27 -0
  17. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +2 -0
  18. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +18 -0
  19. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +16 -0
  20. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +2 -0
  21. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +24 -0
  22. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +64 -0
  23. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +2 -0
  24. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +18 -0
  25. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +107 -0
  26. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +2 -0
  27. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +18 -0
  28. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +12 -0
  29. package/dist/components/wrappers/WpDrawer.vue.d.ts +6 -4
  30. package/dist/components/wrappers/WpDrawer.vue.js +6 -4
  31. package/dist/composables/useApiErrorTracking.d.ts +26 -0
  32. package/dist/composables/useApiErrorTracking.js +120 -0
  33. package/dist/composables/useErrorTracking.d.ts +30 -0
  34. package/dist/composables/useErrorTracking.js +98 -0
  35. package/dist/composables/useHttp.js +89 -52
  36. package/dist/composables/useStripo.js +160 -61
  37. package/dist/composables/useStripoErrorCategory.d.ts +26 -0
  38. package/dist/composables/useStripoErrorCategory.js +86 -0
  39. package/dist/composables/useStripoSlackNotifier.d.ts +8 -0
  40. package/dist/composables/useStripoSlackNotifier.js +47 -0
  41. package/dist/config/compiler/unsubscribeCompilerRules.js +42 -29
  42. package/dist/config/migrator/index.d.ts +1 -1
  43. package/dist/config/migrator/index.js +7 -6
  44. package/dist/config/migrator/unsubscribeMigrator.d.ts +1 -0
  45. package/dist/config/migrator/unsubscribeMigrator.js +124 -0
  46. package/dist/enums/defaults.js +6 -3
  47. package/dist/enums/extensions/recommendationBlock.d.ts +16 -0
  48. package/dist/enums/extensions/recommendationBlock.js +80 -0
  49. package/dist/enums/unsubscribe.d.ts +19 -0
  50. package/dist/enums/unsubscribe.js +39 -6
  51. package/dist/extensions/Blocks/Checkbox/control.js +35 -39
  52. package/dist/extensions/Blocks/RadioButton/control.js +33 -37
  53. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  54. package/dist/extensions/Blocks/Recommendation/block.d.ts +10 -0
  55. package/dist/extensions/Blocks/Recommendation/block.js +27 -0
  56. package/dist/extensions/Blocks/Recommendation/control.d.ts +29 -0
  57. package/dist/extensions/Blocks/Recommendation/control.js +277 -0
  58. package/dist/extensions/Blocks/Recommendation/extension.d.ts +2 -0
  59. package/dist/extensions/Blocks/Recommendation/extension.js +10 -0
  60. package/dist/extensions/Blocks/Recommendation/iconsRegistry.d.ts +4 -0
  61. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +51 -0
  62. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +19 -0
  63. package/dist/extensions/Blocks/Recommendation/settingsPanel.d.ts +4 -0
  64. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +32 -0
  65. package/dist/extensions/Blocks/Recommendation/store/recommendation.d.ts +555 -0
  66. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +266 -0
  67. package/dist/extensions/Blocks/Recommendation/template.d.ts +6 -0
  68. package/dist/extensions/Blocks/Recommendation/template.js +200 -0
  69. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +7 -0
  70. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +28 -0
  71. package/dist/extensions/Blocks/Unsubscribe/block.d.ts +32 -0
  72. package/dist/extensions/Blocks/Unsubscribe/block.js +131 -0
  73. package/dist/extensions/Blocks/Unsubscribe/control.d.ts +29 -0
  74. package/dist/extensions/Blocks/Unsubscribe/control.js +167 -0
  75. package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +11 -0
  76. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +42 -0
  77. package/dist/extensions/Blocks/Unsubscribe/extension.d.ts +2 -0
  78. package/dist/extensions/Blocks/Unsubscribe/extension.js +21 -0
  79. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +4 -0
  80. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +21 -0
  81. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +4 -0
  82. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +35 -0
  83. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +42 -0
  84. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +4 -0
  85. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +10 -0
  86. package/dist/extensions/Blocks/Unsubscribe/template.d.ts +12 -0
  87. package/dist/extensions/Blocks/Unsubscribe/template.js +22 -0
  88. package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +9 -0
  89. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +11 -0
  90. package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +7 -0
  91. package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +6 -0
  92. package/dist/extensions/Blocks/common-control.d.ts +66 -0
  93. package/dist/extensions/Blocks/common-control.js +102 -0
  94. package/dist/guido.css +1 -1
  95. package/dist/mock/api/recommendation.d.ts +2 -0
  96. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +83 -71
  97. package/dist/services/recommendationApi.d.ts +6 -0
  98. package/dist/services/recommendationApi.js +43 -0
  99. package/dist/services/slackNotificationService.d.ts +110 -0
  100. package/dist/services/slackNotificationService.js +167 -0
  101. package/dist/services/stripoApi.js +49 -19
  102. package/dist/services/stripoErrorDeduplicationService.d.ts +75 -0
  103. package/dist/services/stripoErrorDeduplicationService.js +91 -0
  104. package/dist/services/unsubscribeApi.d.ts +4 -0
  105. package/dist/services/unsubscribeApi.js +16 -0
  106. package/dist/stores/config.d.ts +96 -0
  107. package/dist/stores/config.js +17 -0
  108. package/dist/stores/editor.d.ts +21 -0
  109. package/dist/stores/editor.js +2 -1
  110. package/dist/stores/unsubscribe.d.ts +253 -5
  111. package/dist/stores/unsubscribe.js +126 -6
  112. package/dist/utils/genericUtil.d.ts +1 -0
  113. package/dist/utils/genericUtil.js +8 -7
  114. package/dist/utils/templatePreparation.js +17 -16
  115. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- var F = /* @__PURE__ */ ((t) => (t.BLOCK = "BLOCK", t.STRUCTURE = "STRUCTURE", t.CONTAINER = "CONTAINER", t))(F || {}), A = class o {
1
+ var F = /* @__PURE__ */ ((t) => (t.BLOCK = "BLOCK", t.STRUCTURE = "STRUCTURE", t.CONTAINER = "CONTAINER", t))(F || {}), D = class o {
2
2
  /**
3
3
  * Validates that all required methods are properly implemented in the subclass.
4
4
  * @param requiredMethods - Array of method names that must be implemented
@@ -21,22 +21,22 @@ ${s.map((i) => ` - ${i}`).join(`
21
21
  * This validation runs only once per class type and results are cached.
22
22
  */
23
23
  validateImplementation(e, r) {
24
- var E;
25
- const s = [], i = r.name, l = Object.getPrototypeOf(this);
24
+ var l;
25
+ const s = [], i = r.name, d = Object.getPrototypeOf(this);
26
26
  e.forEach((a) => {
27
27
  if (typeof this[a] != "function") {
28
28
  s.push(`Method ${a}() is not defined`);
29
29
  return;
30
30
  }
31
- l[a] === r.prototype[a] && s.push(`Method ${a}() must be implemented (currently using base class error-throwing implementation)`);
32
- }), o.validatedClasses.add(r), s.length > 0 ? (o.validationErrors.set(r, s), console.error(`[${i} Validation] ${i} validation failed:`, s)) : typeof process < "u" && ((E = process.env) == null ? void 0 : E.NODE_ENV) === "development" && console.log(`[${i} Validation] ✅ ${i} validated successfully`);
31
+ d[a] === r.prototype[a] && s.push(`Method ${a}() must be implemented (currently using base class error-throwing implementation)`);
32
+ }), o.validatedClasses.add(r), s.length > 0 ? (o.validationErrors.set(r, s), console.error(`[${i} Validation] ${i} validation failed:`, s)) : typeof process < "u" && ((l = process.env) == null ? void 0 : l.NODE_ENV) === "development" && console.log(`[${i} Validation] ✅ ${i} validated successfully`);
33
33
  }
34
34
  };
35
- A.validatedClasses = /* @__PURE__ */ new Set();
36
- A.validationErrors = /* @__PURE__ */ new Map();
37
- var n = A, M = class d extends n {
35
+ D.validatedClasses = /* @__PURE__ */ new Set();
36
+ D.validationErrors = /* @__PURE__ */ new Map();
37
+ var n = D, M = class h extends n {
38
38
  constructor() {
39
- super(d.REQUIRED_METHODS, d);
39
+ super(h.REQUIRED_METHODS, h);
40
40
  }
41
41
  /**
42
42
  * Determines if the block should be available for use in the editor.
@@ -186,9 +186,9 @@ var n = A, M = class d extends n {
186
186
  }
187
187
  };
188
188
  M.REQUIRED_METHODS = ["getId", "getTemplate", "getIcon", "getName", "getDescription"];
189
- var Ct = M, k = class h extends n {
189
+ var It = M, k = class u extends n {
190
190
  constructor() {
191
- super(h.REQUIRED_METHODS, h);
191
+ super(u.REQUIRED_METHODS, u);
192
192
  }
193
193
  /**
194
194
  * @deprecated - use {@link getPreviewInnerHtml} instead
@@ -204,9 +204,9 @@ var Ct = M, k = class h extends n {
204
204
  }
205
205
  };
206
206
  k.REQUIRED_METHODS = ["getPreviewInnerHtml"];
207
- var Q = class u extends n {
207
+ var V = class c extends n {
208
208
  constructor() {
209
- super(u.REQUIRED_METHODS, u);
209
+ super(c.REQUIRED_METHODS, c);
210
210
  }
211
211
  getId() {
212
212
  throw new Error("Method getId() must be implemented by the subclass");
@@ -221,30 +221,42 @@ var Q = class u extends n {
221
221
  throw new Error("Method onClick() must be implemented by the subclass");
222
222
  }
223
223
  };
224
- Q.REQUIRED_METHODS = ["getId", "getIcon", "getLabel", "onClick"];
225
- var V = "esd-block-button", $ = "esd-block-text", X = "esd-block-image", G = "esd-structure", f = "esd-block-video", Y = "esd-block-social", W = "esd-block-banner", j = "esd-block-timer", z = "esd-block-menu", q = "esd-block-html", Z = "esd-block-spacer", J = "esd-container-frame", tt = "esd-stripe", et = "esd-amp-form", rt = ((t) => (t.BUTTON = `.${V}`, t.TEXT = `.${$}`, t.IMAGE = `.${X}`, t.STRUCTURE = `.${G}`, t.VIDEO = `.${f}`, t.SOCIAL = `.${Y}`, t.BANNER = `.${W}`, t.TIMER = `.${j}`, t.MENU = `.${z}`, t.HTML = `.${q}`, t.SPACER = `.${Z}`, t.CONTAINER = `.${J}`, t.STRIPE = `.${tt}`, t.FORM = `.${et}`, t))(rt || {}), st = /* @__PURE__ */ ((t) => (t.BLOCK_IMAGE = "BLOCK_IMAGE", t.BLOCK_TEXT = "BLOCK_TEXT", t.BLOCK_BUTTON = "BLOCK_BUTTON", t.BLOCK_SPACER = "BLOCK_SPACER", t.BLOCK_VIDEO = "BLOCK_VIDEO", t.BLOCK_SOCIAL = "BLOCK_SOCIAL", t.BLOCK_BANNER = "BLOCK_BANNER", t.BLOCK_TIMER = "BLOCK_TIMER", t.BLOCK_MENU = "BLOCK_MENU", t.BLOCK_MENU_ITEM = "BLOCK_MENU_ITEM", t.BLOCK_HTML = "BLOCK_HTML", t.BLOCK_AMP_CAROUSEL = "BLOCK_AMP_CAROUSEL", t.BLOCK_AMP_ACCORDION = "BLOCK_AMP_ACCORDION", t.BLOCK_AMP_FORM = "BLOCK_AMP_FORM", t.CONTAINER = "CONTAINER", t.FORM_CONTAINER = "FORM_CONTAINER", t.STRUCTURE = "STRUCTURE", t.STRIPE = "STRIPE", t.EMPTY_CONTAINER = "EMPTY_CONTAINER", t.CUSTOM_BLOCK_LINK = "CUSTOM_BLOCK_LINK", t.CUSTOM_BLOCK_IMAGE = "CUSTOM_BLOCK_IMAGE", t.CUSTOM_BLOCK_TEXT = "CUSTOM_BLOCK_TEXT", t))(st || {}), nt = /* @__PURE__ */ ((t) => (t.HIDDEN_NODE = "hiddenNodeText", t.PARAGRAPH_STYLE = "paragraphStyleForm", t.ALIGN = "textAlignmentForm", t.ANCHOR_CONTAINER = "textAnchorForm", t.FONT_BACKGROUND_COLOR = "textBlockFontBackgroundColor", t.TEXT_BLOCK_BACKGROUND_COLOR = "textBlockBackgroundColor", t.FONT_COLOR = "textBlockFontColor", t.TEXT_BLOCK_FONT_FAMILY = "textBlockFontFamily", t.FONT_FAMILY = "textFontFamily", t.FONT_SIZE = "textBlockFontSize", t.DIRECTION = "textBlockDirectionForm", t.INSERT_FORM = "textBlockInsertForm", t.LINK_DATA = "textBlockLinkDataForm", t.FORMAT = "textBlockTextFormatForm", t.FIXED_HEIGHT_CONTAINER = "textFixedHeightContainerForm", t.INTERNAL_INDENTS = "textInternalIndents", t.LINE_HEIGHT = "textLineHeightForm", t.LINKS_COLOR = "textLinksFontColorForm", t.MIME_TYPE = "textMimeTypeForm", t.NO_LINE_WRAPS = "textNoLineWrapsForm", t))(nt || {}), it = /* @__PURE__ */ ((t) => (t.BACKGROUND_COLOR = "containerBackgroundColorForm", t.BORDER_FORM = "containerBorderForm", t.BORDER_RADIUS = "containerBorderRadiusForm", t.EXTERNAL_INDENTS = "containerExternalIndentsForm", t.IMAGE_CONTAINER = "containerImageContainerForm", t.MIME_TYPE = "containerMimeTypeForm", t.DISPLAY_CONDITIONS = "displayConditions", t.HIDDEN_NODE = "containerHiddenNodeForm", t))(it || {}), at = /* @__PURE__ */ ((t) => (t.SETTINGS = "settings", t.STYLES = "styles", t.DATA = "data", t))(at || {}), D = {
224
+ V.REQUIRED_METHODS = ["getId", "getIcon", "getLabel", "onClick"];
225
+ var Q = "esd-block-button", $ = "esd-block-text", X = "esd-block-image", G = "esd-structure", f = "esd-block-video", Y = "esd-block-social", W = "esd-block-banner", j = "esd-block-timer", z = "esd-block-menu", q = "esd-block-html", Z = "esd-block-spacer", J = "esd-container-frame", tt = "esd-stripe", et = "esd-amp-form", rt = ((t) => (t.BUTTON = `.${Q}`, t.TEXT = `.${$}`, t.IMAGE = `.${X}`, t.STRUCTURE = `.${G}`, t.VIDEO = `.${f}`, t.SOCIAL = `.${Y}`, t.BANNER = `.${W}`, t.TIMER = `.${j}`, t.MENU = `.${z}`, t.HTML = `.${q}`, t.SPACER = `.${Z}`, t.CONTAINER = `.${J}`, t.STRIPE = `.${tt}`, t.FORM = `.${et}`, t))(rt || {}), st = /* @__PURE__ */ ((t) => (t.BLOCK_IMAGE = "BLOCK_IMAGE", t.BLOCK_TEXT = "BLOCK_TEXT", t.BLOCK_BUTTON = "BLOCK_BUTTON", t.BLOCK_SPACER = "BLOCK_SPACER", t.BLOCK_VIDEO = "BLOCK_VIDEO", t.BLOCK_SOCIAL = "BLOCK_SOCIAL", t.BLOCK_BANNER = "BLOCK_BANNER", t.BLOCK_TIMER = "BLOCK_TIMER", t.BLOCK_MENU = "BLOCK_MENU", t.BLOCK_MENU_ITEM = "BLOCK_MENU_ITEM", t.BLOCK_HTML = "BLOCK_HTML", t.BLOCK_AMP_CAROUSEL = "BLOCK_AMP_CAROUSEL", t.BLOCK_AMP_ACCORDION = "BLOCK_AMP_ACCORDION", t.BLOCK_AMP_FORM = "BLOCK_AMP_FORM", t.CONTAINER = "CONTAINER", t.FORM_CONTAINER = "FORM_CONTAINER", t.STRUCTURE = "STRUCTURE", t.STRIPE = "STRIPE", t.EMPTY_CONTAINER = "EMPTY_CONTAINER", t.CUSTOM_BLOCK_LINK = "CUSTOM_BLOCK_LINK", t.CUSTOM_BLOCK_IMAGE = "CUSTOM_BLOCK_IMAGE", t.CUSTOM_BLOCK_TEXT = "CUSTOM_BLOCK_TEXT", t))(st || {}), nt = /* @__PURE__ */ ((t) => (t.HIDDEN_NODE = "hiddenNodeText", t.PARAGRAPH_STYLE = "paragraphStyleForm", t.ALIGN = "textAlignmentForm", t.ANCHOR_CONTAINER = "textAnchorForm", t.FONT_BACKGROUND_COLOR = "textBlockFontBackgroundColor", t.TEXT_BLOCK_BACKGROUND_COLOR = "textBlockBackgroundColor", t.FONT_COLOR = "textBlockFontColor", t.TEXT_BLOCK_FONT_FAMILY = "textBlockFontFamily", t.FONT_FAMILY = "textFontFamily", t.FONT_SIZE = "textBlockFontSize", t.DIRECTION = "textBlockDirectionForm", t.INSERT_FORM = "textBlockInsertForm", t.LINK_DATA = "textBlockLinkDataForm", t.FORMAT = "textBlockTextFormatForm", t.FIXED_HEIGHT_CONTAINER = "textFixedHeightContainerForm", t.INTERNAL_INDENTS = "textInternalIndents", t.LINE_HEIGHT = "textLineHeightForm", t.LINKS_COLOR = "textLinksFontColorForm", t.MIME_TYPE = "textMimeTypeForm", t.NO_LINE_WRAPS = "textNoLineWrapsForm", t))(nt || {}), it = /* @__PURE__ */ ((t) => (t.BACKGROUND_COLOR = "containerBackgroundColorForm", t.BORDER_FORM = "containerBorderForm", t.BORDER_RADIUS = "containerBorderRadiusForm", t.EXTERNAL_INDENTS = "containerExternalIndentsForm", t.IMAGE_CONTAINER = "containerImageContainerForm", t.MIME_TYPE = "containerMimeTypeForm", t.DISPLAY_CONDITIONS = "displayConditions", t.HIDDEN_NODE = "containerHiddenNodeForm", t))(it || {}), at = /* @__PURE__ */ ((t) => (t.SETTINGS = "settings", t.STYLES = "styles", t.DATA = "data", t))(at || {}), E = {
226
226
  name: "name",
227
227
  disabled: "disabled"
228
228
  }, ot = {
229
- ...D
229
+ ...E,
230
+ caption: "caption",
231
+ icon: "icon"
230
232
  }, Et = {
231
- ...D,
232
- text: "text"
233
+ ...E,
234
+ minValue: "min-value",
235
+ maxValue: "max-value",
236
+ step: "step"
233
237
  }, lt = {
234
- ...D,
238
+ ...E,
239
+ text: "text"
240
+ }, dt = {
241
+ ...E,
235
242
  placeholder: "placeholder",
236
243
  items: "items"
237
- }, dt = {
244
+ }, ht = {
238
245
  text: "text",
239
246
  value: "value"
240
- }, gt = {
247
+ }, ut = {
248
+ ...E
249
+ }, _t = {
241
250
  BUTTON: ot,
242
- LABEL: Et,
243
- SELECTPICKER: lt,
244
- SELECT_ITEM: dt
245
- }, ht = /* @__PURE__ */ ((t) => (t.BUTTON = "UE-BUTTON", t.CHECKBOX = "UE-CHECKBOX", t.CHECK_BUTTONS = "UE-CHECK-BUTTONS", t.COLOR = "UE-COLOR", t.COUNTER = "UE-COUNTER", t.DATEPICKER = "UE-DATEPICKER", t.LABEL = "UE-LABEL", t.MESSAGE = "UE-MESSAGE", t.RADIO_BUTTONS = "UE-RADIO-BUTTONS", t.SELECTPICKER = "UE-SELECT", t.SWITCHER = "UE-SWITCHER", t.TEXT = "UE-TEXT", t.TEXTAREA = "UE-TEXTAREA", t.CHECK_ITEM = "UE-CHECK-ITEM", t.RADIO_ITEM = "UE-RADIO-ITEM", t.SELECT_ITEM = "UE-SELECT-ITEM", t.ICON = "UE-ICON", t.MERGETAGS = "UE-MERGETAGS", t.FONT_FAMILY_SELECT = "UE-FONT-FAMILY-SELECT", t.NESTED_CONTROL = "UE-NESTED-CONTROL", t.EXPANDABLE = "UE-EXPANDABLE", t.EXPANDABLE_HEADER = "UE-EXPANDABLE_HEADER", t.EXPANDABLE_CONTENT = "UE-EXPANDABLE_CONTENT", t))(ht || {}), S = class c extends n {
251
+ COUNTER: Et,
252
+ LABEL: lt,
253
+ SELECTPICKER: dt,
254
+ SWITCHER: E,
255
+ TEXT: ut,
256
+ SELECT_ITEM: ht
257
+ }, ct = /* @__PURE__ */ ((t) => (t.BUTTON = "UE-BUTTON", t.CHECKBOX = "UE-CHECKBOX", t.CHECK_BUTTONS = "UE-CHECK-BUTTONS", t.COLOR = "UE-COLOR", t.COUNTER = "UE-COUNTER", t.DATEPICKER = "UE-DATEPICKER", t.LABEL = "UE-LABEL", t.MESSAGE = "UE-MESSAGE", t.RADIO_BUTTONS = "UE-RADIO-BUTTONS", t.SELECTPICKER = "UE-SELECT", t.SWITCHER = "UE-SWITCHER", t.TEXT = "UE-TEXT", t.TEXTAREA = "UE-TEXTAREA", t.CHECK_ITEM = "UE-CHECK-ITEM", t.RADIO_ITEM = "UE-RADIO-ITEM", t.SELECT_ITEM = "UE-SELECT-ITEM", t.ICON = "UE-ICON", t.MERGETAGS = "UE-MERGETAGS", t.FONT_FAMILY_SELECT = "UE-FONT-FAMILY-SELECT", t.NESTED_CONTROL = "UE-NESTED-CONTROL", t.EXPANDABLE = "UE-EXPANDABLE", t.EXPANDABLE_HEADER = "UE-EXPANDABLE_HEADER", t.EXPANDABLE_CONTENT = "UE-EXPANDABLE_CONTENT", t))(ct || {}), S = class m extends n {
246
258
  constructor() {
247
- super(c.REQUIRED_METHODS, c);
259
+ super(m.REQUIRED_METHODS, m);
248
260
  }
249
261
  /**
250
262
  * @description Allows to determine if control should be visible or hidden in control panel.
@@ -291,16 +303,16 @@ var V = "esd-block-button", $ = "esd-block-text", X = "esd-block-image", G = "es
291
303
  }
292
304
  };
293
305
  S.REQUIRED_METHODS = ["getId", "getTemplate"];
294
- var It = S, N = class m extends n {
306
+ var Lt = S, N = class O extends n {
295
307
  constructor() {
296
- super(m.REQUIRED_METHODS, m);
308
+ super(O.REQUIRED_METHODS, O);
297
309
  }
298
310
  registerBlockControls(e) {
299
311
  throw new Error("Method registerBlockControls() must be implemented by the subclass");
300
312
  }
301
313
  };
302
314
  N.REQUIRED_METHODS = ["registerBlockControls"];
303
- var _t = N, Lt = class {
315
+ var At = N, Dt = class {
304
316
  constructor(t, e) {
305
317
  this.tabId = t, this.controlsIds = e;
306
318
  }
@@ -323,9 +335,9 @@ var _t = N, Lt = class {
323
335
  const e = this.controlsIds.indexOf(t);
324
336
  e !== -1 && this.controlsIds.splice(e, 1);
325
337
  }
326
- }, ut = class {
327
- constructor(t, e, r = [], s, i = [], l, E = [], a = [], T, v, p, w, B, K, P, H) {
328
- this.uiElements = [], this.controls = [], this.contextActions = [], this.blocks = [], this.i18n = t, this.styles = e, this.previewStyles = p, this.uiElements = r, this.uiElementTagRegistry = s, this.controls = i, this.settingsPanelRegistry = l, this.contextActions = E, this.blocks = a, this.externalSmartElementsLibrary = T, this.externalImageLibrary = v, this.externalAiAssistant = w, this.externalDisplayConditionsLibrary = B, this.externalVideoLibrary = K, this.blocksPanel = P, this.iconsRegistry = H, this.id = Math.random().toString(36).substring(2);
338
+ }, mt = class {
339
+ constructor(t, e, r = [], s, i = [], d, l = [], a = [], T, U, p, w, B, K, H, P) {
340
+ this.uiElements = [], this.controls = [], this.contextActions = [], this.blocks = [], this.i18n = t, this.styles = e, this.previewStyles = p, this.uiElements = r, this.uiElementTagRegistry = s, this.controls = i, this.settingsPanelRegistry = d, this.contextActions = l, this.blocks = a, this.externalSmartElementsLibrary = T, this.externalImageLibrary = U, this.externalAiAssistant = w, this.externalDisplayConditionsLibrary = B, this.externalVideoLibrary = K, this.blocksPanel = H, this.iconsRegistry = P, this.id = Math.random().toString(36).substring(2);
329
341
  }
330
342
  getI18n() {
331
343
  return this.i18n;
@@ -378,7 +390,7 @@ var _t = N, Lt = class {
378
390
  getIconsRegistry() {
379
391
  return this.iconsRegistry;
380
392
  }
381
- }, At = class {
393
+ }, Tt = class {
382
394
  constructor() {
383
395
  this.styles = [], this.uiElements = [], this.controls = [], this.contextActions = [], this.blocks = [];
384
396
  }
@@ -440,7 +452,7 @@ var _t = N, Lt = class {
440
452
  return this.iconsRegistry = t, this;
441
453
  }
442
454
  build() {
443
- return new ut(
455
+ return new mt(
444
456
  this.i18n,
445
457
  (this.styles || []).map((t) => t.trim()).join(`
446
458
  `),
@@ -460,18 +472,18 @@ var _t = N, Lt = class {
460
472
  this.iconsRegistry
461
473
  );
462
474
  }
463
- }, ct = class O extends n {
475
+ }, Ot = class b extends n {
464
476
  constructor() {
465
- super(O.REQUIRED_METHODS, O);
477
+ super(b.REQUIRED_METHODS, b);
466
478
  }
467
479
  openAiAssistant({ value: e, onDataSelectCallback: r, onCancelCallback: s, type: i }) {
468
480
  throw new Error("Method openAiAssistant() must be implemented by the subclass");
469
481
  }
470
482
  };
471
- ct.REQUIRED_METHODS = ["openAiAssistant"];
472
- var mt = class b extends n {
483
+ Ot.REQUIRED_METHODS = ["openAiAssistant"];
484
+ var bt = class R extends n {
473
485
  constructor() {
474
- super(b.REQUIRED_METHODS, b);
486
+ super(R.REQUIRED_METHODS, R);
475
487
  }
476
488
  /**
477
489
  * Retrieves the name of the category.
@@ -509,44 +521,44 @@ var mt = class b extends n {
509
521
  throw new Error("Method getContextActionIndex() must be implemented by the subclass");
510
522
  }
511
523
  };
512
- mt.REQUIRED_METHODS = ["getCategoryName", "openExternalDisplayConditionsDialog"];
513
- var Ot = class R extends n {
524
+ bt.REQUIRED_METHODS = ["getCategoryName", "openExternalDisplayConditionsDialog"];
525
+ var Rt = class C extends n {
514
526
  constructor() {
515
- super(R.REQUIRED_METHODS, R);
527
+ super(C.REQUIRED_METHODS, C);
516
528
  }
517
529
  openImageLibrary(e, r, s) {
518
530
  throw new Error("Method openImageLibrary() must be implemented by the subclass");
519
531
  }
520
532
  };
521
- Ot.REQUIRED_METHODS = ["openImageLibrary"];
522
- var bt = class C extends n {
533
+ Rt.REQUIRED_METHODS = ["openImageLibrary"];
534
+ var Ct = class g extends n {
523
535
  constructor() {
524
- super(C.REQUIRED_METHODS, C);
536
+ super(g.REQUIRED_METHODS, g);
525
537
  }
526
538
  openSmartElementsLibrary(e, r) {
527
539
  throw new Error("Method openSmartElementsLibrary() must be implemented by the subclass");
528
540
  }
529
541
  };
530
- bt.REQUIRED_METHODS = ["openSmartElementsLibrary"];
531
- var Rt = class g extends n {
542
+ Ct.REQUIRED_METHODS = ["openSmartElementsLibrary"];
543
+ var gt = class I extends n {
532
544
  constructor() {
533
- super(g.REQUIRED_METHODS, g);
545
+ super(I.REQUIRED_METHODS, I);
534
546
  }
535
547
  openExternalVideosLibraryDialog(e, r, s) {
536
548
  throw new Error("Method openExternalVideosLibraryDialog() must be implemented by the subclass");
537
549
  }
538
550
  };
539
- Rt.REQUIRED_METHODS = ["openExternalVideosLibraryDialog"];
540
- var y = class I extends n {
551
+ gt.REQUIRED_METHODS = ["openExternalVideosLibraryDialog"];
552
+ var y = class _ extends n {
541
553
  constructor() {
542
- super(I.REQUIRED_METHODS, I);
554
+ super(_.REQUIRED_METHODS, _);
543
555
  }
544
556
  registerIconsSvg(e) {
545
557
  throw new Error("Method registerIconsSvg() must be implemented by the subclass");
546
558
  }
547
559
  };
548
560
  y.REQUIRED_METHODS = ["registerIconsSvg"];
549
- var Dt = y, Tt = class {
561
+ var Mt = y, St = class {
550
562
  constructor(t) {
551
563
  this.key = t;
552
564
  }
@@ -559,9 +571,9 @@ var Dt = y, Tt = class {
559
571
  params: this.params
560
572
  };
561
573
  }
562
- }, x = class _ extends n {
574
+ }, v = class L extends n {
563
575
  constructor() {
564
- super(_.REQUIRED_METHODS, _);
576
+ super(L.REQUIRED_METHODS, L);
565
577
  }
566
578
  /**
567
579
  * Called when the UI element should render its content into the provided container.
@@ -614,34 +626,34 @@ var Dt = y, Tt = class {
614
626
  throw new Error("Method getTemplate() must be implemented by the subclass");
615
627
  }
616
628
  };
617
- x.REQUIRED_METHODS = ["onRender", "getId", "getTemplate"];
618
- var Mt = x, U = class L extends n {
629
+ v.REQUIRED_METHODS = ["onRender", "getId", "getTemplate"];
630
+ var Nt = v, x = class A extends n {
619
631
  constructor() {
620
- super(L.REQUIRED_METHODS, L);
632
+ super(A.REQUIRED_METHODS, A);
621
633
  }
622
634
  registerUiElements(e) {
623
635
  throw new Error("Method registerUiElements() must be implemented by the subclass");
624
636
  }
625
637
  };
626
- U.REQUIRED_METHODS = ["registerUiElements"];
627
- var St = U;
638
+ x.REQUIRED_METHODS = ["registerUiElements"];
639
+ var yt = x;
628
640
  export {
629
- Ct as Block,
641
+ It as Block,
630
642
  F as BlockCompositionType,
631
643
  rt as BlockSelector,
632
644
  st as BlockType,
633
645
  it as ContainerControls,
634
- It as Control,
635
- ut as Extension,
636
- At as ExtensionBuilder,
637
- Dt as IconsRegistry,
638
- Tt as ModificationDescription,
639
- _t as SettingsPanelRegistry,
640
- Lt as SettingsPanelTab,
646
+ Lt as Control,
647
+ mt as Extension,
648
+ Tt as ExtensionBuilder,
649
+ Mt as IconsRegistry,
650
+ St as ModificationDescription,
651
+ At as SettingsPanelRegistry,
652
+ Dt as SettingsPanelTab,
641
653
  at as SettingsTab,
642
654
  nt as TextControls,
643
- gt as UEAttr,
644
- Mt as UIElement,
645
- St as UIElementTagRegistry,
646
- ht as UIElementType
655
+ _t as UEAttr,
656
+ Nt as UIElement,
657
+ yt as UIElementTagRegistry,
658
+ ct as UIElementType
647
659
  };
@@ -0,0 +1,6 @@
1
+ import type { InitialResponse, FiltersResponse, RecommendationProduct, RecommendationProductsParams } from '@@/Types/recommendation';
2
+ export declare const useRecommendationApi: () => {
3
+ fetchRecommendationCreateData: () => Promise<InitialResponse>;
4
+ fetchRecommendationFilters: () => Promise<FiltersResponse>;
5
+ fetchRecommendationProducts: (strategy: string, params: RecommendationProductsParams) => Promise<RecommendationProduct[]>;
6
+ };
@@ -0,0 +1,43 @@
1
+ import { useHttp as c } from "../composables/useHttp.js";
2
+ import { URLS as a } from "../enums/extensions/recommendationBlock.js";
3
+ import { useEditorStore as m } from "../stores/editor.js";
4
+ import { replaceString as s } from "../utils/genericUtil.js";
5
+ const l = () => {
6
+ const { get: o } = c();
7
+ return {
8
+ fetchRecommendationCreateData: async () => {
9
+ const e = m();
10
+ try {
11
+ return (await o(s(
12
+ "/newsletter/{id}/recommendations/get-campaign-create-data",
13
+ { id: e.templateId }
14
+ ))).data;
15
+ } catch (t) {
16
+ throw console.error("fetchUserModalState error:", t), t;
17
+ }
18
+ },
19
+ fetchRecommendationFilters: async () => {
20
+ try {
21
+ const { data: e } = await o("/stripo/email-recommendation-attributes");
22
+ return e;
23
+ } catch (e) {
24
+ throw console.error("fetchRecommendationFilters error:", e), e;
25
+ }
26
+ },
27
+ fetchRecommendationProducts: async (e, t) => {
28
+ try {
29
+ const r = decodeURIComponent(new URLSearchParams(Object.entries(t)).toString());
30
+ console.debug("🏁 Recommendation API Query:", r);
31
+ const n = await o(
32
+ `${a.RECOMMENDATION_API_URL}/v2/${e}?${r}`
33
+ );
34
+ return (n == null ? void 0 : n.data) ?? [];
35
+ } catch (r) {
36
+ throw console.error("fetchRecommendationProducts error:", r), r;
37
+ }
38
+ }
39
+ };
40
+ };
41
+ export {
42
+ l as useRecommendationApi
43
+ };
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Slack notification payload structure
3
+ */
4
+ export interface SlackNotificationPayload {
5
+ channel?: string;
6
+ username?: string;
7
+ icon_emoji?: string;
8
+ text?: string;
9
+ attachments?: SlackAttachment[];
10
+ }
11
+ /**
12
+ * Slack attachment for formatted messages
13
+ */
14
+ export interface SlackAttachment {
15
+ color?: string;
16
+ title?: string;
17
+ title_link?: string;
18
+ text?: string;
19
+ fields?: SlackField[];
20
+ footer?: string;
21
+ ts?: number;
22
+ }
23
+ /**
24
+ * Slack field for structured data
25
+ */
26
+ export interface SlackField {
27
+ title: string;
28
+ value: string;
29
+ short?: boolean;
30
+ }
31
+ /**
32
+ * Slack error notification content
33
+ */
34
+ export interface SlackErrorNotification {
35
+ title: string;
36
+ message: string;
37
+ errorType: string;
38
+ severity: 'low' | 'medium' | 'high' | 'critical';
39
+ context?: Record<string, unknown>;
40
+ stackTrace?: string;
41
+ timestamp?: number;
42
+ }
43
+ /**
44
+ * Service for sending error notifications to Slack
45
+ * Used to alert team members about critical Stripo errors
46
+ */
47
+ export declare class SlackNotificationService {
48
+ private webhookUrl;
49
+ private channel;
50
+ private defaultUsername;
51
+ private enabled;
52
+ constructor(webhookUrl?: string, options?: {
53
+ channel?: string;
54
+ username?: string;
55
+ enabled?: boolean;
56
+ });
57
+ /**
58
+ * Send an error notification to Slack
59
+ */
60
+ sendErrorNotification(notification: SlackErrorNotification): Promise<boolean>;
61
+ /**
62
+ * Send a critical error that requires immediate attention
63
+ */
64
+ sendCriticalError(title: string, message: string, context?: Record<string, unknown>): Promise<boolean>;
65
+ /**
66
+ * Send a CORS error notification
67
+ */
68
+ sendCorsErrorNotification(resourceUrl?: string, additionalContext?: Record<string, unknown>): Promise<boolean>;
69
+ /**
70
+ * Send a plugin load error notification
71
+ */
72
+ sendPluginLoadErrorNotification(reason: string, additionalContext?: Record<string, unknown>): Promise<boolean>;
73
+ /**
74
+ * Build Slack message payload from error notification
75
+ */
76
+ private buildErrorPayload;
77
+ /**
78
+ * Format field title for Slack (e.g., emailId -> Email ID)
79
+ */
80
+ private formatFieldTitle;
81
+ /**
82
+ * Format field value for Slack display
83
+ */
84
+ private formatFieldValue;
85
+ /**
86
+ * Check if notifications are enabled
87
+ */
88
+ isEnabled(): boolean;
89
+ /**
90
+ * Update webhook URL
91
+ */
92
+ setWebhookUrl(url: string): void;
93
+ /**
94
+ * Update channel
95
+ */
96
+ setChannel(channel: string): void;
97
+ /**
98
+ * Enable/disable notifications
99
+ */
100
+ setEnabled(enabled: boolean): void;
101
+ }
102
+ export declare const getSlackNotificationService: () => SlackNotificationService;
103
+ /**
104
+ * Initialize or reinitialize Slack notification service
105
+ */
106
+ export declare const initializeSlackNotificationService: (webhookUrl?: string, options?: {
107
+ channel?: string;
108
+ username?: string;
109
+ enabled?: boolean;
110
+ }) => SlackNotificationService;
@@ -0,0 +1,167 @@
1
+ var d = Object.defineProperty;
2
+ var h = (t, e, r) => e in t ? d(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var i = (t, e, r) => h(t, typeof e != "symbol" ? e + "" : e, r);
4
+ class u {
5
+ constructor(e, r) {
6
+ i(this, "webhookUrl");
7
+ i(this, "channel");
8
+ i(this, "defaultUsername");
9
+ i(this, "enabled");
10
+ this.webhookUrl = e || void 0 || "", this.channel = (r == null ? void 0 : r.channel) || "#errors", this.defaultUsername = (r == null ? void 0 : r.username) || "Guido Error Bot", this.enabled = (r == null ? void 0 : r.enabled) !== !1, this.webhookUrl || (console.warn("[SlackNotificationService] Webhook URL not configured, Slack notifications disabled"), this.enabled = !1);
11
+ }
12
+ /**
13
+ * Send an error notification to Slack
14
+ */
15
+ async sendErrorNotification(e) {
16
+ if (!this.enabled || !this.webhookUrl)
17
+ return !1;
18
+ try {
19
+ const r = this.buildErrorPayload(e), a = await fetch(this.webhookUrl, {
20
+ method: "POST",
21
+ headers: {
22
+ "Content-Type": "application/json"
23
+ },
24
+ body: JSON.stringify(r)
25
+ });
26
+ return a.ok ? !0 : (console.error("[SlackNotificationService] Failed to send Slack notification:", a.statusText), !1);
27
+ } catch (r) {
28
+ return console.error("[SlackNotificationService] Error sending Slack notification:", r), !1;
29
+ }
30
+ }
31
+ /**
32
+ * Send a critical error that requires immediate attention
33
+ */
34
+ async sendCriticalError(e, r, a) {
35
+ return this.sendErrorNotification({
36
+ title: e,
37
+ message: r,
38
+ errorType: "critical",
39
+ severity: "critical",
40
+ context: a,
41
+ timestamp: Date.now()
42
+ });
43
+ }
44
+ /**
45
+ * Send a CORS error notification
46
+ */
47
+ async sendCorsErrorNotification(e, r) {
48
+ return this.sendCriticalError(
49
+ "CORS Error in Stripo Email Editor",
50
+ "Failed to load Stripo resources due to CORS restrictions",
51
+ {
52
+ resourceUrl: e,
53
+ ...r,
54
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
55
+ }
56
+ );
57
+ }
58
+ /**
59
+ * Send a plugin load error notification
60
+ */
61
+ async sendPluginLoadErrorNotification(e, r) {
62
+ return this.sendCriticalError(
63
+ "Stripo Plugin Failed to Load",
64
+ `Email editor initialization failed: ${e}`,
65
+ {
66
+ ...r,
67
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
68
+ }
69
+ );
70
+ }
71
+ /**
72
+ * Build Slack message payload from error notification
73
+ */
74
+ buildErrorPayload(e) {
75
+ const a = {
76
+ critical: "#E74C3C",
77
+ // Red
78
+ high: "#E67E22",
79
+ // Orange
80
+ medium: "#F39C12",
81
+ // Yellow
82
+ low: "#3498DB"
83
+ // Blue
84
+ }[e.severity] || "#95A5A6", l = [
85
+ {
86
+ title: "Error Type",
87
+ value: e.errorType,
88
+ short: !0
89
+ },
90
+ {
91
+ title: "Severity",
92
+ value: e.severity.toUpperCase(),
93
+ short: !0
94
+ },
95
+ {
96
+ title: "Timestamp",
97
+ value: e.timestamp ? new Date(e.timestamp).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
98
+ short: !0
99
+ }
100
+ ];
101
+ e.context && Object.entries(e.context).forEach(([n, c]) => {
102
+ l.length < 20 && l.push({
103
+ title: this.formatFieldTitle(n),
104
+ value: this.formatFieldValue(c),
105
+ short: !0
106
+ });
107
+ });
108
+ const s = {
109
+ color: a,
110
+ title: e.title,
111
+ text: e.message,
112
+ fields: l,
113
+ footer: "Guido Error Tracking",
114
+ ts: Math.floor((e.timestamp || Date.now()) / 1e3)
115
+ };
116
+ return e.stackTrace && (s.text = `${e.message}
117
+ \`\`\`${e.stackTrace}\`\`\``), {
118
+ channel: this.channel,
119
+ username: this.defaultUsername,
120
+ // eslint-disable-next-line camelcase
121
+ icon_emoji: ":warning:",
122
+ attachments: [s]
123
+ };
124
+ }
125
+ /**
126
+ * Format field title for Slack (e.g., emailId -> Email ID)
127
+ */
128
+ formatFieldTitle(e) {
129
+ return e.replace(/([A-Z])/g, " $1").replace(/^./, (r) => r.toUpperCase()).trim();
130
+ }
131
+ /**
132
+ * Format field value for Slack display
133
+ */
134
+ formatFieldValue(e) {
135
+ return e == null ? "(empty)" : typeof e == "object" ? JSON.stringify(e).slice(0, 500) : String(e).slice(0, 500);
136
+ }
137
+ /**
138
+ * Check if notifications are enabled
139
+ */
140
+ isEnabled() {
141
+ return this.enabled;
142
+ }
143
+ /**
144
+ * Update webhook URL
145
+ */
146
+ setWebhookUrl(e) {
147
+ this.webhookUrl = e, this.enabled = !!e;
148
+ }
149
+ /**
150
+ * Update channel
151
+ */
152
+ setChannel(e) {
153
+ this.channel = e;
154
+ }
155
+ /**
156
+ * Enable/disable notifications
157
+ */
158
+ setEnabled(e) {
159
+ this.enabled = e && !!this.webhookUrl;
160
+ }
161
+ }
162
+ let o = null;
163
+ const S = () => (o || (o = new u()), o);
164
+ export {
165
+ u as SlackNotificationService,
166
+ S as getSlackNotificationService
167
+ };