@useinsider/guido 1.0.3-beta.e0403cf → 1.0.3-beta.e1adf59

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 (139) hide show
  1. package/README.md +3 -141
  2. package/dist/components/Guido.vue.js +10 -12
  3. package/dist/components/Guido.vue2.js +90 -67
  4. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  5. package/dist/components/organisms/header/LeftSlot.vue2.js +15 -16
  6. package/dist/components/organisms/header/RightSlot.vue.js +11 -11
  7. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
  8. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +17 -30
  9. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +10 -12
  10. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -19
  11. package/dist/composables/useApiErrorTracking.js +120 -0
  12. package/dist/composables/useErrorTracking.js +98 -0
  13. package/dist/composables/useHttp.js +89 -52
  14. package/dist/composables/useStripo.js +160 -57
  15. package/dist/composables/useStripoErrorCategory.js +86 -0
  16. package/dist/composables/useStripoSlackNotifier.js +47 -0
  17. package/dist/config/migrator/index.js +6 -7
  18. package/dist/enums/defaults.js +8 -15
  19. package/dist/enums/onboarding.js +1 -2
  20. package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
  21. package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
  22. package/dist/extensions/Blocks/Recommendation/block.js +3 -6
  23. package/dist/extensions/Blocks/Recommendation/control.js +40 -69
  24. package/dist/extensions/Blocks/Recommendation/extension.js +7 -42
  25. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +22 -107
  26. package/dist/extensions/Blocks/Recommendation/template.js +200 -0
  27. package/dist/extensions/Blocks/common-control.js +43 -125
  28. package/dist/guido.css +1 -1
  29. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +100 -307
  30. package/dist/package.json.js +1 -1
  31. package/dist/services/slackNotificationService.js +167 -0
  32. package/dist/services/stripoApi.js +49 -19
  33. package/dist/services/stripoErrorDeduplicationService.js +91 -0
  34. package/dist/src/@types/generic.d.ts +0 -15
  35. package/dist/src/components/Guido.vue.d.ts +1 -1
  36. package/dist/src/components/organisms/onboarding/NewVersionPopup.vue.d.ts +1 -3
  37. package/dist/src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +1 -3
  38. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  39. package/dist/src/composables/useApiErrorTracking.d.ts +26 -0
  40. package/dist/src/composables/useErrorTracking.d.ts +30 -0
  41. package/dist/src/composables/useStripoErrorCategory.d.ts +26 -0
  42. package/dist/src/composables/useStripoSlackNotifier.d.ts +8 -0
  43. package/dist/src/enums/onboarding.d.ts +0 -1
  44. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -1
  45. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +0 -6
  46. package/dist/src/extensions/Blocks/Recommendation/template.d.ts +6 -0
  47. package/dist/src/extensions/Blocks/common-control.d.ts +0 -21
  48. package/dist/src/services/slackNotificationService.d.ts +110 -0
  49. package/dist/src/services/stripoErrorDeduplicationService.d.ts +75 -0
  50. package/dist/src/stores/config.d.ts +0 -7
  51. package/dist/src/utils/dateUtil.d.ts +0 -21
  52. package/dist/static/styles/components/narrow-panel.css.js +0 -10
  53. package/dist/static/styles/customEditorStyle.css.js +0 -5
  54. package/dist/utils/dateUtil.js +3 -24
  55. package/package.json +3 -3
  56. package/dist/composables/useBlocksConfig.js +0 -49
  57. package/dist/config/migrator/recommendationMigrator.js +0 -293
  58. package/dist/enums/date.js +0 -6
  59. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -103
  60. package/dist/extensions/Blocks/Recommendation/constants.js +0 -5
  61. package/dist/extensions/Blocks/Recommendation/controls/button/align.js +0 -13
  62. package/dist/extensions/Blocks/Recommendation/controls/button/border.js +0 -13
  63. package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +0 -13
  64. package/dist/extensions/Blocks/Recommendation/controls/button/color.js +0 -13
  65. package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +0 -13
  66. package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +0 -13
  67. package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +0 -13
  68. package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +0 -13
  69. package/dist/extensions/Blocks/Recommendation/controls/button/text.js +0 -13
  70. package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +0 -13
  71. package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +0 -13
  72. package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +0 -13
  73. package/dist/extensions/Blocks/Recommendation/controls/image/size.js +0 -13
  74. package/dist/extensions/Blocks/Recommendation/controls/name/align.js +0 -13
  75. package/dist/extensions/Blocks/Recommendation/controls/name/background.js +0 -13
  76. package/dist/extensions/Blocks/Recommendation/controls/name/color.js +0 -13
  77. package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +0 -13
  78. package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +0 -13
  79. package/dist/extensions/Blocks/Recommendation/controls/name/size.js +0 -13
  80. package/dist/extensions/Blocks/Recommendation/controls/name/style.js +0 -13
  81. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +0 -13
  82. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +0 -13
  83. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +0 -13
  84. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +0 -13
  85. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +0 -13
  86. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +0 -13
  87. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +0 -13
  88. package/dist/extensions/Blocks/Recommendation/controls/price/align.js +0 -13
  89. package/dist/extensions/Blocks/Recommendation/controls/price/background.js +0 -13
  90. package/dist/extensions/Blocks/Recommendation/controls/price/color.js +0 -13
  91. package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +0 -13
  92. package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +0 -13
  93. package/dist/extensions/Blocks/Recommendation/controls/price/size.js +0 -13
  94. package/dist/extensions/Blocks/Recommendation/controls/price/style.js +0 -13
  95. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -160
  96. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -152
  97. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -180
  98. package/dist/src/composables/useBlocksConfig.d.ts +0 -11
  99. package/dist/src/config/migrator/recommendationMigrator.d.ts +0 -1
  100. package/dist/src/enums/date.d.ts +0 -4
  101. package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +0 -28
  102. package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +0 -51
  103. package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +0 -5
  104. package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +0 -5
  105. package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +0 -5
  106. package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +0 -5
  107. package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +0 -5
  108. package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +0 -5
  109. package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +0 -5
  110. package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +0 -5
  111. package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +0 -5
  112. package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +0 -5
  113. package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +0 -5
  114. package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +0 -5
  115. package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +0 -5
  116. package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +0 -5
  117. package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +0 -5
  118. package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +0 -5
  119. package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +0 -5
  120. package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +0 -5
  121. package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +0 -5
  122. package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +0 -5
  123. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +0 -5
  124. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +0 -5
  125. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +0 -5
  126. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +0 -5
  127. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +0 -5
  128. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +0 -5
  129. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +0 -5
  130. package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +0 -5
  131. package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +0 -5
  132. package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +0 -5
  133. package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +0 -5
  134. package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +0 -5
  135. package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +0 -5
  136. package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +0 -5
  137. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
  138. package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +0 -16
  139. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -44
@@ -1,24 +1,42 @@
1
- import { useActionsApi as y } from "./useActionsApi.js";
2
- import { useBlocksConfig as E } from "./useBlocksConfig.js";
3
- import { useCustomInterfaceAppearance as w } from "./useCustomInterfaceAppearance.js";
4
- import { useStripoEventHandler as h } from "./useStripoEventHandler.js";
5
- import { useToaster as b } from "./useToaster.js";
6
- import { displayConditions as k } from "../enums/displayConditions.js";
7
- import { useStripoApi as B } from "../services/stripoApi.js";
8
- import V from "../static/styles/customEditorStyle.css.js";
9
- import { useEditorStore as _ } from "../stores/editor.js";
10
- import { dynamicContentToMergeTags as F } from "../utils/genericUtil.js";
11
- import A from "../package.json.js";
12
- const L = (d) => {
13
- const { handleError: u } = b(), { getToken: p, getCustomFonts: m } = B(), { handleEvent: g } = h(), { getStripoBlocksConfig: f } = E(), S = async (r, i = []) => {
14
- const t = _(), { html: n, css: l, forceRecreate: a } = r, { baseBlocks: e, extensions: c } = await f();
1
+ import { useActionsApi as k } from "./useActionsApi.js";
2
+ import { useCustomInterfaceAppearance as b } from "./useCustomInterfaceAppearance.js";
3
+ import { useErrorTracking as v } from "./useErrorTracking.js";
4
+ import { useStripoErrorCategory as V } from "./useStripoErrorCategory.js";
5
+ import { useStripoEventHandler as B } from "./useStripoEventHandler.js";
6
+ import { useStripoSlackNotifier as x } from "./useStripoSlackNotifier.js";
7
+ import { useToaster as F } from "./useToaster.js";
8
+ import { displayConditions as A } from "../enums/displayConditions.js";
9
+ import U from "../extensions/Blocks/Checkbox/extension.js";
10
+ import M from "../extensions/Blocks/CouponBlock/extension.js";
11
+ import D from "../extensions/Blocks/RadioButton/extension.js";
12
+ import P from "../extensions/Blocks/Recommendation/extension.js";
13
+ import R from "../extensions/Blocks/Unsubscribe/extension.js";
14
+ import z from "../extensions/DynamicContent/extension.js";
15
+ import { useStripoApi as H } from "../services/stripoApi.js";
16
+ import O from "../static/styles/customEditorStyle.css.js";
17
+ import { useEditorStore as $ } from "../stores/editor.js";
18
+ import { dynamicContentToMergeTags as q } from "../utils/genericUtil.js";
19
+ import L from "../package.json.js";
20
+ const po = (o) => {
21
+ const { handleError: f } = F(), { getToken: E, getCustomFonts: h } = H(), { handleEvent: T } = B(), { captureStripoError: l, withTimeout: S } = v(), { shouldCaptureSentry: u } = V(), { notifySlack: p } = x(), C = (m, n = []) => {
22
+ const r = $(), { html: c, css: y, forceRecreate: I } = m, s = (e) => {
23
+ const t = e instanceof Error ? e : new Error(String(e)), i = "stripo_runtime_error", d = u(i);
24
+ l(t, i, {
25
+ emailId: o.emailId,
26
+ userId: o.userId
27
+ }, d), p(
28
+ t.message,
29
+ i,
30
+ { emailId: o.emailId, userId: o.userId }
31
+ );
32
+ };
15
33
  window.UIEditor.initEditor(
16
34
  document.querySelector("#guido-editor"),
17
35
  {
18
- metadata: d,
19
- html: n,
20
- css: l,
21
- forceRecreate: a,
36
+ metadata: o,
37
+ html: c,
38
+ css: y,
39
+ forceRecreate: I,
22
40
  locale: "en",
23
41
  undoButtonSelector: "#guido__undo-button",
24
42
  redoButtonSelector: "#guido__redo-button",
@@ -28,83 +46,168 @@ const L = (d) => {
28
46
  customAppearanceMergetags: !0,
29
47
  customAppearanceMergetagsBorderColor: "#f1f3fe",
30
48
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
31
- customViewStyles: V,
49
+ customViewStyles: O,
32
50
  conditionsEnabled: !0,
33
51
  customConditionsEnabled: !0,
34
- conditionCategories: k,
52
+ conditionCategories: A,
35
53
  enableXSSSecurity: !0,
36
54
  messageSettingsEnabled: !1,
37
55
  selectBlockAfterDropFromSettingsPanel: !0,
38
- ...e ? { baseBlocks: e } : {},
39
56
  editorFonts: {
40
57
  showDefaultStandardFonts: !0,
41
58
  showDefaultNotStandardFonts: !0,
42
- customFonts: i
59
+ customFonts: n
43
60
  },
44
61
  mergeTags: [
45
62
  {
46
- entries: F(d.preselectedDynamicContentList)
63
+ entries: q(o.preselectedDynamicContentList)
47
64
  }
48
65
  ],
49
- async onTokenRefreshRequest(o) {
66
+ async onTokenRefreshRequest(e) {
50
67
  try {
51
- const s = await p();
52
- o(s);
53
- } catch (s) {
54
- u(s, "Failed to refresh token");
68
+ const t = await S(
69
+ E(),
70
+ 1e4,
71
+ // 10 second timeout
72
+ "token_refresh",
73
+ { emailId: o.emailId, userId: o.userId }
74
+ );
75
+ e(t);
76
+ } catch (t) {
77
+ const i = "token_refresh", d = u(i);
78
+ l(t, i, {
79
+ templateId: o.emailId,
80
+ userId: o.userId
81
+ }, d), p(
82
+ "Token refresh operation failed",
83
+ i,
84
+ { emailId: o.emailId, userId: o.userId }
85
+ ), f(t, "Failed to refresh token");
55
86
  }
56
87
  },
57
88
  onTemplateLoaded() {
58
89
  try {
59
- const { importCss: o } = w(), { activateCustomViewStyles: s } = y();
60
- o(), s(), d.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
61
- t.hasChanges = !1;
90
+ const { importCss: e } = b(), { activateCustomViewStyles: t } = k();
91
+ e(), t(), o.onReady(), r.isStripoInitialized = !0, r.loadingStatus = !1, setTimeout(() => {
92
+ r.hasChanges = !1;
62
93
  }, 1e3);
63
- } catch (o) {
64
- u(o, "Failed to load custom interface appearance");
94
+ } catch (e) {
95
+ const t = "template_loaded", i = u(t);
96
+ l(e, t, {
97
+ templateId: o.emailId,
98
+ userId: o.userId
99
+ }, i), p(
100
+ "Template loading operation failed",
101
+ t,
102
+ { emailId: o.emailId, userId: o.userId }
103
+ ), f(e, "Failed to load custom interface appearance");
65
104
  }
66
105
  },
67
- onCodeEditorVisibilityChanged(o) {
68
- t.isCodeEditorOpen = o;
106
+ onCodeEditorVisibilityChanged(e) {
107
+ r.isCodeEditorOpen = e;
69
108
  },
70
- onEditorVisualModeChanged(o) {
71
- t.editorVisualMode = o.toLowerCase();
109
+ onEditorVisualModeChanged(e) {
110
+ r.editorVisualMode = e.toLowerCase();
72
111
  },
73
- onVersionHistoryVisibilityChanged(o) {
74
- t.isVersionHistoryOpen = o;
112
+ onVersionHistoryVisibilityChanged(e) {
113
+ r.isVersionHistoryOpen = e;
75
114
  },
76
115
  onDataChanged() {
77
- t.hasChanges = !0;
116
+ r.hasChanges = !0;
78
117
  },
79
- onEvent: g,
118
+ onEvent: T,
119
+ // Error handler for Stripo runtime errors (CORS, plugin issues, etc.)
120
+ onError: s,
80
121
  ignoreClickOutsideSelectors: [
81
122
  "#guido-dynamic-content-modal",
82
123
  ".in-on-board-wrapper",
83
124
  ".in-drawer__container"
84
125
  ],
85
- extensions: c
126
+ extensions: [
127
+ z,
128
+ U,
129
+ D,
130
+ P,
131
+ R,
132
+ M
133
+ ]
86
134
  }
87
135
  );
88
- }, C = (r) => new Promise((i, t) => {
89
- var c;
136
+ }, _ = (m) => new Promise((n, r) => {
137
+ var t;
90
138
  if (document.getElementById("UiEditorScript")) {
91
- r(), i();
139
+ m(), n();
92
140
  return;
93
141
  }
94
- const n = A.guido, a = `https://email-static.useinsider.com/guido/${(c = n == null ? void 0 : n.stripo) == null ? void 0 : c.version}/UIEditor.js`, e = document.createElement("script");
95
- e.id = "UiEditorScript", e.type = "module", e.src = a, e.onload = () => {
96
- r(), i();
97
- }, e.onerror = () => {
98
- t(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
99
- }, document.body.appendChild(e);
142
+ const c = L.guido, I = `https://email-static.useinsider.com/guido/${(t = c == null ? void 0 : c.stripo) == null ? void 0 : t.version}/UIEditor.js`, s = document.createElement("script");
143
+ s.id = "UiEditorScript", s.type = "module", s.src = I;
144
+ const e = setTimeout(() => {
145
+ const i = new Error("Timeout loading Stripo UIEditor script (30s)"), d = "plugin_load_timeout", a = u(d);
146
+ l(i, d, {
147
+ scriptSrc: s.src,
148
+ emailId: o.emailId,
149
+ userId: o.userId
150
+ }, a), p(
151
+ `Stripo plugin failed to load (timeout): ${s.src}`,
152
+ d,
153
+ { emailId: o.emailId, userId: o.userId, reason: "timeout" }
154
+ ), r(i);
155
+ }, 3e4);
156
+ s.onload = () => {
157
+ clearTimeout(e), m(), n();
158
+ }, s.onerror = (i) => {
159
+ clearTimeout(e);
160
+ const d = new Error("Failed to load Stripo UIEditor script"), a = i instanceof Event ? i.type : String(i), g = "plugin_load_error", w = u(g);
161
+ l(d, g, {
162
+ scriptSrc: s.src,
163
+ event: a,
164
+ emailId: o.emailId,
165
+ userId: o.userId
166
+ }, w), p(
167
+ `Stripo plugin failed to load: ${a}`,
168
+ g,
169
+ { emailId: o.emailId, userId: o.userId, scriptSrc: s.src }
170
+ ), r(d);
171
+ }, document.body.appendChild(s);
100
172
  });
101
- return { initPlugin: async (r) => {
102
- await C(async () => {
103
- const i = await m();
104
- await S(r, i);
105
- });
173
+ return { initPlugin: async (m) => {
174
+ try {
175
+ await _(async () => {
176
+ try {
177
+ const n = await S(
178
+ h(),
179
+ 5e3,
180
+ // 5 second timeout for fonts
181
+ "load_custom_fonts",
182
+ { emailId: o.emailId }
183
+ );
184
+ C(m, n);
185
+ } catch (n) {
186
+ const r = "init_editor", c = u(r);
187
+ throw l(n, r, {
188
+ templateId: o.emailId,
189
+ userId: o.userId,
190
+ hasTemplate: !!m.html
191
+ }, c), p(
192
+ "Editor initialization failed",
193
+ r,
194
+ { emailId: o.emailId, userId: o.userId }
195
+ ), n;
196
+ }
197
+ });
198
+ } catch (n) {
199
+ const r = "init_plugin", c = u(r);
200
+ throw l(n, r, {
201
+ templateId: o.emailId,
202
+ userId: o.userId
203
+ }, c), p(
204
+ "Plugin initialization failed",
205
+ r,
206
+ { emailId: o.emailId, userId: o.userId }
207
+ ), n;
208
+ }
106
209
  } };
107
210
  };
108
211
  export {
109
- L as useStripo
212
+ po as useStripo
110
213
  };
@@ -0,0 +1,86 @@
1
+ const i = {
2
+ // Critical errors: Log to Sentry + Alert Slack
3
+ plugin_load_error: {
4
+ type: "plugin_load_error",
5
+ severity: "critical",
6
+ captureLevel: "sentry_and_slack",
7
+ description: "Stripo UIEditor.js script failed to load"
8
+ },
9
+ plugin_load_timeout: {
10
+ type: "plugin_load_timeout",
11
+ severity: "critical",
12
+ captureLevel: "sentry_and_slack",
13
+ description: "Stripo script loading exceeded timeout threshold"
14
+ },
15
+ authentication_error: {
16
+ type: "authentication_error",
17
+ severity: "critical",
18
+ captureLevel: "sentry_and_slack",
19
+ description: "Token or authentication failure"
20
+ },
21
+ // Handled errors: Alert Slack but DON'T log to Sentry/FullStory
22
+ cors_error: {
23
+ type: "cors_error",
24
+ severity: "warning",
25
+ captureLevel: "slack_only",
26
+ description: "CORS policy blocked resource (can be caught before Sentry)"
27
+ },
28
+ // Runtime errors: Log to Sentry but DON'T alert Slack
29
+ stripo_runtime_error: {
30
+ type: "stripo_runtime_error",
31
+ severity: "warning",
32
+ captureLevel: "sentry_only",
33
+ description: "Runtime error from Stripo editor"
34
+ },
35
+ init_editor: {
36
+ type: "init_editor",
37
+ severity: "warning",
38
+ captureLevel: "sentry_only",
39
+ description: "Editor initialization failure"
40
+ },
41
+ init_plugin: {
42
+ type: "init_plugin",
43
+ severity: "warning",
44
+ captureLevel: "sentry_only",
45
+ description: "Plugin initialization failure"
46
+ },
47
+ token_refresh: {
48
+ type: "token_refresh",
49
+ severity: "warning",
50
+ captureLevel: "sentry_only",
51
+ description: "Token refresh operation failed"
52
+ },
53
+ template_loaded: {
54
+ type: "template_loaded",
55
+ severity: "warning",
56
+ captureLevel: "sentry_only",
57
+ description: "Template loading operation failed"
58
+ }
59
+ }, l = () => {
60
+ const t = (e) => {
61
+ const r = i[e];
62
+ return r || {
63
+ type: e,
64
+ severity: "warning",
65
+ captureLevel: "sentry_only",
66
+ description: "Unknown error type"
67
+ };
68
+ };
69
+ return {
70
+ getErrorCategory: t,
71
+ shouldCaptureSentry: (e) => {
72
+ const r = t(e);
73
+ return ["sentry_and_slack", "sentry_only"].includes(r.captureLevel);
74
+ },
75
+ shouldNotifySlack: (e) => {
76
+ const r = t(e);
77
+ return ["sentry_and_slack", "slack_only"].includes(r.captureLevel);
78
+ },
79
+ addErrorCategory: (e) => {
80
+ i[e.type] = e;
81
+ }
82
+ };
83
+ };
84
+ export {
85
+ l as useStripoErrorCategory
86
+ };
@@ -0,0 +1,47 @@
1
+ import { useStripoErrorCategory as g } from "./useStripoErrorCategory.js";
2
+ import { getSlackNotificationService as f } from "../services/slackNotificationService.js";
3
+ import { getStripoErrorDeduplicationService as u } from "../services/stripoErrorDeduplicationService.js";
4
+ const w = () => {
5
+ const c = f(), s = u(), { shouldNotifySlack: a, getErrorCategory: l } = g();
6
+ return {
7
+ notifySlack: async (o, t, r) => {
8
+ const e = l(t), i = a(t) || e.captureLevel === "sentry_only", S = {
9
+ critical: "critical",
10
+ warning: "high",
11
+ info: "low"
12
+ };
13
+ let n = o;
14
+ i && (n += `
15
+
16
+ _Also logged to Sentry/FullStory for analysis_`);
17
+ const p = {
18
+ title: `Stripo ${t.replace(/_/g, " ").toUpperCase()}`,
19
+ message: n,
20
+ errorType: t,
21
+ severity: S[e.severity] || "high",
22
+ context: {
23
+ ...r,
24
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
25
+ environment: "production",
26
+ captureLevel: e.captureLevel,
27
+ description: e.description,
28
+ loggedToSentry: i
29
+ }
30
+ };
31
+ return s.trackError({
32
+ errorType: t,
33
+ errorMessage: o,
34
+ errorCategory: e.severity,
35
+ context: {
36
+ ...r,
37
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
38
+ environment: "production"
39
+ },
40
+ reportedAt: (/* @__PURE__ */ new Date()).toISOString()
41
+ }) ? c.sendErrorNotification(p) : !1;
42
+ }
43
+ };
44
+ };
45
+ export {
46
+ w as useStripoSlackNotifier
47
+ };
@@ -1,12 +1,11 @@
1
- import { migrateCheckbox as m } from "./checkboxMigrator.js";
2
- import { migrateCouponBlock as o } from "./couponBlockMigrator.js";
1
+ import { migrateCheckbox as o } from "./checkboxMigrator.js";
2
+ import { migrateCouponBlock as m } from "./couponBlockMigrator.js";
3
3
  import { migrateRadioButton as i } from "./radioButtonMigrator.js";
4
- import { migrateRecommendation as e } from "./recommendationMigrator.js";
5
- import { migrateUnsubscribe as a } from "./unsubscribeMigrator.js";
6
- const s = async (t) => {
4
+ import { migrateUnsubscribe as e } from "./unsubscribeMigrator.js";
5
+ const c = async (t) => {
7
6
  let r = t;
8
- return r = m(r), r = i(r), r = await a(r), r = o(r), r = e(r), r;
7
+ return r = o(r), r = i(r), r = await e(r), r = m(r), r;
9
8
  };
10
9
  export {
11
- s as migrate
10
+ c as migrate
12
11
  };
@@ -1,6 +1,5 @@
1
- const e = {
1
+ const a = {
2
2
  translationsPath: "window.trans.en",
3
- migrationDate: 1759696858,
4
3
  emailHeader: {
5
4
  senderName: "",
6
5
  subject: ""
@@ -8,24 +7,18 @@ const e = {
8
7
  extensions: {
9
8
  unsubscribe: !0
10
9
  },
11
- blocks: {
12
- excludeDefaults: [],
13
- includeCustoms: []
14
- },
15
10
  features: {
16
11
  dynamicContent: !0,
17
12
  saveAsTemplate: !0,
18
- versionHistory: !0,
19
- testMessage: !0
13
+ versionHistory: !0
20
14
  },
21
15
  useHeader: !0
22
16
  }, t = {
23
17
  promotional: 1,
24
18
  transactional: 2
25
- }, a = "email", o = "Guido User", s = t.promotional, n = 2, i = {
19
+ }, e = "email", o = "Guido User", n = t.promotional, s = 2, i = {
26
20
  email: 60,
27
- architect: 49,
28
- unsubscribePages: 97
21
+ architect: 49
29
22
  }, u = [
30
23
  "alfredtesting",
31
24
  "electio",
@@ -59,11 +52,11 @@ const e = {
59
52
  "stripoeditorlivetest"
60
53
  ];
61
54
  export {
62
- e as DefaultGuidoConfig,
63
- s as DefaultMessageType,
64
- a as DefaultProductType,
55
+ a as DefaultGuidoConfig,
56
+ n as DefaultMessageType,
57
+ e as DefaultProductType,
65
58
  o as DefaultUsername,
66
- n as EditorType,
59
+ s as EditorType,
67
60
  i as ProductIds,
68
61
  u as TEST_PARTNER_LIST,
69
62
  t as TemplateTypes
@@ -2,8 +2,7 @@ const e = [
2
2
  ".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-0.ng-star-inserted",
3
3
  ".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-1.ng-star-inserted",
4
4
  ".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-2.ng-star-inserted"
5
- ], t = "https://academy.useinsider.com/docs/email-drag-drop-editor";
5
+ ];
6
6
  export {
7
- t as ACADEMY_LINK,
8
7
  e as SERVICE_HOVER_SELECTORS
9
8
  };
@@ -3,7 +3,7 @@ import { CheckboxBlock as t } from "./block.js";
3
3
  import { CheckboxControl as e } from "./control.js";
4
4
  import { CheckboxIconsRegistry as r } from "./iconsRegistry.js";
5
5
  import { CheckboxBlockSettings as i } from "./settingsPanel.js";
6
- const d = new o().addBlock(t).withSettingsPanelRegistry(i).addControl(e).withIconsRegistry(r).build();
6
+ const k = new o().addBlock(t).withSettingsPanelRegistry(i).addControl(e).withIconsRegistry(r).build();
7
7
  export {
8
- d as default
8
+ k as default
9
9
  };
@@ -2,7 +2,7 @@ import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-edito
2
2
  import { CouponBlock as t } from "./block.js";
3
3
  import { CouponIconsRegistry as i } from "./iconsRegistry.js";
4
4
  import { CouponBlockSettings as n } from "./settingsPanel.js";
5
- const p = new o().addBlock(t).withSettingsPanelRegistry(n).withIconsRegistry(i).build();
5
+ const m = new o().addBlock(t).withSettingsPanelRegistry(n).withIconsRegistry(i).build();
6
6
  export {
7
- p as default
7
+ m as default
8
8
  };
@@ -1,10 +1,7 @@
1
1
  import { Block as e, BlockCompositionType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { getDefaultTemplate as o } from "./templates/blockTemplate.js";
2
+ import { getDefaultTemplate as o } from "./template.js";
3
3
  const n = "recommendation-block";
4
- class m extends e {
5
- constructor() {
6
- super();
7
- }
4
+ class c extends e {
8
5
  getId() {
9
6
  return n;
10
7
  }
@@ -26,5 +23,5 @@ class m extends e {
26
23
  }
27
24
  export {
28
25
  n as BLOCK_ID,
29
- m as RecommendationBlock
26
+ c as RecommendationBlock
30
27
  };