@useinsider/guido 1.0.3-beta.dfb1fcf → 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 (130) hide show
  1. package/README.md +3 -144
  2. package/dist/components/Guido.vue.js +10 -12
  3. package/dist/components/Guido.vue2.js +101 -84
  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/header/RightSlot.vue2.js +22 -23
  8. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
  9. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +17 -30
  10. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +10 -12
  11. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -19
  12. package/dist/composables/useApiErrorTracking.js +120 -0
  13. package/dist/composables/useErrorTracking.js +98 -0
  14. package/dist/composables/useGuidoActions.js +9 -19
  15. package/dist/composables/useHttp.js +89 -52
  16. package/dist/composables/useStripo.js +163 -66
  17. package/dist/composables/useStripoErrorCategory.js +86 -0
  18. package/dist/composables/useStripoSlackNotifier.js +47 -0
  19. package/dist/config/compiler/unsubscribeCompilerRules.js +28 -33
  20. package/dist/config/migrator/index.js +6 -7
  21. package/dist/enums/defaults.js +8 -16
  22. package/dist/enums/onboarding.js +1 -2
  23. package/dist/enums/unsubscribe.js +25 -27
  24. package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
  25. package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
  26. package/dist/extensions/Blocks/Recommendation/block.js +3 -6
  27. package/dist/extensions/Blocks/Recommendation/control.js +65 -109
  28. package/dist/extensions/Blocks/Recommendation/extension.js +7 -18
  29. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +21 -159
  30. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
  31. package/dist/extensions/Blocks/Recommendation/template.js +200 -0
  32. package/dist/extensions/Blocks/common-control.js +43 -125
  33. package/dist/extensions/DynamicContent/dynamic-content-modal.js +19 -25
  34. package/dist/extensions/DynamicContent/dynamic-content.js +33 -128
  35. package/dist/guido.css +1 -1
  36. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +100 -312
  37. package/dist/package.json.js +1 -1
  38. package/dist/services/slackNotificationService.js +167 -0
  39. package/dist/services/stripoApi.js +49 -19
  40. package/dist/services/stripoErrorDeduplicationService.js +91 -0
  41. package/dist/src/@types/generic.d.ts +6 -42
  42. package/dist/src/components/Guido.vue.d.ts +3 -4
  43. package/dist/src/components/organisms/onboarding/NewVersionPopup.vue.d.ts +1 -3
  44. package/dist/src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +1 -3
  45. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  46. package/dist/src/composables/useApiErrorTracking.d.ts +26 -0
  47. package/dist/src/composables/useErrorTracking.d.ts +30 -0
  48. package/dist/src/composables/useGuidoActions.d.ts +0 -9
  49. package/dist/src/composables/useStripoErrorCategory.d.ts +26 -0
  50. package/dist/src/composables/useStripoSlackNotifier.d.ts +8 -0
  51. package/dist/src/enums/onboarding.d.ts +0 -1
  52. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -1
  53. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +2 -11
  54. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
  55. package/dist/src/extensions/Blocks/Recommendation/template.d.ts +6 -0
  56. package/dist/src/extensions/Blocks/common-control.d.ts +0 -21
  57. package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +2 -9
  58. package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +2 -52
  59. package/dist/src/services/slackNotificationService.d.ts +110 -0
  60. package/dist/src/services/stripoErrorDeduplicationService.d.ts +75 -0
  61. package/dist/src/stores/config.d.ts +2 -10
  62. package/dist/src/stores/dynamic-content.d.ts +3 -3
  63. package/dist/src/stores/editor.d.ts +1 -1
  64. package/dist/src/stores/onboarding.d.ts +1 -1
  65. package/dist/src/stores/preview.d.ts +1 -1
  66. package/dist/src/stores/recommendation.d.ts +1 -1
  67. package/dist/src/stores/save-as-template.d.ts +1 -1
  68. package/dist/src/stores/toaster.d.ts +1 -1
  69. package/dist/src/stores/unsubscribe.d.ts +1 -1
  70. package/dist/src/stores/version-history.d.ts +1 -1
  71. package/dist/src/utils/dateUtil.d.ts +0 -21
  72. package/dist/src/utils/genericUtil.d.ts +0 -1
  73. package/dist/static/styles/components/narrow-panel.css.js +0 -10
  74. package/dist/static/styles/components/wide-panel.css.js +4 -0
  75. package/dist/static/styles/customEditorStyle.css.js +0 -19
  76. package/dist/stores/config.js +5 -5
  77. package/dist/stores/dynamic-content.js +2 -2
  78. package/dist/stores/editor.js +1 -1
  79. package/dist/stores/onboarding.js +27 -27
  80. package/dist/stores/preview.js +1 -1
  81. package/dist/stores/recommendation.js +3 -3
  82. package/dist/stores/save-as-template.js +2 -2
  83. package/dist/stores/toaster.js +1 -1
  84. package/dist/stores/unsubscribe.js +1 -1
  85. package/dist/stores/version-history.js +4 -4
  86. package/dist/utils/dateUtil.js +3 -24
  87. package/dist/utils/genericUtil.js +9 -20
  88. package/package.json +3 -3
  89. package/dist/composables/useBlocksConfig.js +0 -49
  90. package/dist/config/migrator/recommendationMigrator.js +0 -293
  91. package/dist/enums/date.js +0 -6
  92. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -193
  93. package/dist/extensions/Blocks/Recommendation/constants.js +0 -14
  94. package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +0 -68
  95. package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -272
  96. package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +0 -74
  97. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.js +0 -71
  98. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.js +0 -71
  99. package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.js +0 -71
  100. package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.js +0 -71
  101. package/dist/extensions/Blocks/Recommendation/controls/priceHideControl.js +0 -60
  102. package/dist/extensions/Blocks/Recommendation/controls/priceInlineLayoutControl.js +0 -160
  103. package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +0 -188
  104. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -184
  105. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -189
  106. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -209
  107. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +0 -25
  108. package/dist/extensions/Blocks/controlFactories.js +0 -234
  109. package/dist/src/composables/useBlocksConfig.d.ts +0 -11
  110. package/dist/src/config/migrator/recommendationMigrator.d.ts +0 -1
  111. package/dist/src/enums/date.d.ts +0 -4
  112. package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +0 -79
  113. package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +0 -91
  114. package/dist/src/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.d.ts +0 -25
  115. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +0 -71
  116. package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +0 -16
  117. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.d.ts +0 -15
  118. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.d.ts +0 -15
  119. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.d.ts +0 -15
  120. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.d.ts +0 -15
  121. package/dist/src/extensions/Blocks/Recommendation/controls/priceHideControl.d.ts +0 -16
  122. package/dist/src/extensions/Blocks/Recommendation/controls/priceInlineLayoutControl.d.ts +0 -50
  123. package/dist/src/extensions/Blocks/Recommendation/controls/spacingControl.d.ts +0 -60
  124. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
  125. package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +0 -16
  126. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -52
  127. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -19
  128. package/dist/src/extensions/Blocks/controlFactories.d.ts +0 -95
  129. package/dist/src/utils/environmentUtil.d.ts +0 -5
  130. package/dist/utils/environmentUtil.js +0 -4
@@ -1,26 +1,42 @@
1
- import { useActionsApi as w } from "./useActionsApi.js";
2
- import { useBlocksConfig as b } from "./useBlocksConfig.js";
3
- import { useConfig as k } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as B } from "./useCustomInterfaceAppearance.js";
5
- import { useStripoEventHandler as V } from "./useStripoEventHandler.js";
6
- import { useToaster as _ } from "./useToaster.js";
7
- import { displayConditions as T } from "../enums/displayConditions.js";
8
- import { useStripoApi as A } from "../services/stripoApi.js";
9
- import F from "../static/styles/customEditorStyle.css.js";
10
- import { useEditorStore as M } from "../stores/editor.js";
11
- import { dynamicContentToMergeTags as U } from "../utils/genericUtil.js";
12
- import v from "../package.json.js";
13
- const J = (c) => {
14
- const { config: l } = k(), { handleError: u } = _(), { getToken: f, getCustomFonts: S } = A(), { handleEvent: y } = V(), { getStripoBlocksConfig: C } = b(), E = async (i, r = []) => {
15
- var m, g;
16
- const t = M(), { html: n, css: p, forceRecreate: a } = i, { baseBlocks: e, extensions: d } = await C();
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
+ };
17
33
  window.UIEditor.initEditor(
18
34
  document.querySelector("#guido-editor"),
19
35
  {
20
- metadata: c,
21
- html: n,
22
- css: p,
23
- forceRecreate: a,
36
+ metadata: o,
37
+ html: c,
38
+ css: y,
39
+ forceRecreate: I,
24
40
  locale: "en",
25
41
  undoButtonSelector: "#guido__undo-button",
26
42
  redoButtonSelector: "#guido__redo-button",
@@ -30,87 +46,168 @@ const J = (c) => {
30
46
  customAppearanceMergetags: !0,
31
47
  customAppearanceMergetagsBorderColor: "#f1f3fe",
32
48
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
33
- customViewStyles: F,
34
- conditionsEnabled: ((m = l.features) == null ? void 0 : m.displayConditions) ?? !0,
35
- customConditionsEnabled: ((g = l.features) == null ? void 0 : g.displayConditions) ?? !0,
36
- conditionCategories: T,
49
+ customViewStyles: O,
50
+ conditionsEnabled: !0,
51
+ customConditionsEnabled: !0,
52
+ conditionCategories: A,
37
53
  enableXSSSecurity: !0,
38
- messageSettingsEnabled: !0,
39
- displayGmailAnnotations: !0,
40
- displayHiddenPreheader: !1,
41
- displayTitle: !1,
42
- displayUTM: !1,
54
+ messageSettingsEnabled: !1,
43
55
  selectBlockAfterDropFromSettingsPanel: !0,
44
- ...e ? { baseBlocks: e } : {},
45
56
  editorFonts: {
46
57
  showDefaultStandardFonts: !0,
47
58
  showDefaultNotStandardFonts: !0,
48
- customFonts: r
59
+ customFonts: n
49
60
  },
50
61
  mergeTags: [
51
62
  {
52
- entries: U(c.preselectedDynamicContentList)
63
+ entries: q(o.preselectedDynamicContentList)
53
64
  }
54
65
  ],
55
- async onTokenRefreshRequest(o) {
66
+ async onTokenRefreshRequest(e) {
56
67
  try {
57
- const s = await f();
58
- o(s);
59
- } catch (s) {
60
- 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");
61
86
  }
62
87
  },
63
88
  onTemplateLoaded() {
64
89
  try {
65
- const { importCss: o } = B(), { activateCustomViewStyles: s } = w();
66
- o(), s(), c.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
67
- 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;
68
93
  }, 1e3);
69
- } catch (o) {
70
- 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");
71
104
  }
72
105
  },
73
- onCodeEditorVisibilityChanged(o) {
74
- t.isCodeEditorOpen = o;
106
+ onCodeEditorVisibilityChanged(e) {
107
+ r.isCodeEditorOpen = e;
75
108
  },
76
- onEditorVisualModeChanged(o) {
77
- t.editorVisualMode = o.toLowerCase();
109
+ onEditorVisualModeChanged(e) {
110
+ r.editorVisualMode = e.toLowerCase();
78
111
  },
79
- onVersionHistoryVisibilityChanged(o) {
80
- t.isVersionHistoryOpen = o;
112
+ onVersionHistoryVisibilityChanged(e) {
113
+ r.isVersionHistoryOpen = e;
81
114
  },
82
115
  onDataChanged() {
83
- t.hasChanges = !0;
116
+ r.hasChanges = !0;
84
117
  },
85
- onEvent: y,
118
+ onEvent: T,
119
+ // Error handler for Stripo runtime errors (CORS, plugin issues, etc.)
120
+ onError: s,
86
121
  ignoreClickOutsideSelectors: [
87
122
  "#guido-dynamic-content-modal",
88
123
  ".in-on-board-wrapper",
89
124
  ".in-drawer__container"
90
125
  ],
91
- extensions: d
126
+ extensions: [
127
+ z,
128
+ U,
129
+ D,
130
+ P,
131
+ R,
132
+ M
133
+ ]
92
134
  }
93
135
  );
94
- }, h = (i) => new Promise((r, t) => {
95
- var d;
136
+ }, _ = (m) => new Promise((n, r) => {
137
+ var t;
96
138
  if (document.getElementById("UiEditorScript")) {
97
- i(), r();
139
+ m(), n();
98
140
  return;
99
141
  }
100
- const n = v.guido, a = `https://email-static.useinsider.com/guido/${(d = n == null ? void 0 : n.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
101
- e.id = "UiEditorScript", e.type = "module", e.src = a, e.onload = () => {
102
- i(), r();
103
- }, e.onerror = () => {
104
- t(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
105
- }, 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);
106
172
  });
107
- return { initPlugin: async (i) => {
108
- await h(async () => {
109
- const r = await S();
110
- await E(i, r);
111
- });
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
+ }
112
209
  } };
113
210
  };
114
211
  export {
115
- J as useStripo
212
+ po as useStripo
116
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,41 +1,36 @@
1
- import { usePartner as N } from "../../composables/usePartner.js";
2
- import { LINK_REGEXES as l, LINK_TYPES as g, INSIDER_ID as f, URLS as S } from "../../enums/unsubscribe.js";
3
- import { parsePageList as U } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
4
- import { useConfigStore as B } from "../../stores/config.js";
5
- import { useDynamicContentStore as y } from "../../stores/dynamic-content.js";
6
- import { useUnsubscribeStore as L } from "../../stores/unsubscribe.js";
7
- const D = [
1
+ import { usePartner as U } from "../../composables/usePartner.js";
2
+ import { LINK_REGEXES as l, LINK_TYPES as b, URLS as f } from "../../enums/unsubscribe.js";
3
+ import { parsePageList as B } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
4
+ import { useConfigStore as N } from "../../stores/config.js";
5
+ import { useUnsubscribeStore as I } from "../../stores/unsubscribe.js";
6
+ const T = [
8
7
  {
9
8
  id: "add-unsubscribe-link-values",
10
9
  description: "Adding unsubscribe link values",
11
10
  type: "custom",
12
11
  processor: (t) => {
13
- const { getPartnerName: i } = N(), c = B(), n = y(), u = L(), a = c.getVariationId;
14
- if (!a)
12
+ const { getPartnerName: i } = U(), a = N(), n = I(), u = a.getVariationId;
13
+ if (!u)
15
14
  return t;
16
- let e = t;
17
- const r = `/${i()}/email/${a}?user={{iid}}`;
18
- return new DOMParser().parseFromString(e, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]").forEach((p) => {
19
- var b;
20
- const m = p.getAttribute("data-unsubscribe-page-list");
21
- if (!m)
15
+ let o = t;
16
+ const e = `/${i()}/email/${u}?user={{iid}}`;
17
+ return new DOMParser().parseFromString(o, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]").forEach((p) => {
18
+ var g;
19
+ const d = p.getAttribute("data-unsubscribe-page-list");
20
+ if (!d)
22
21
  return;
23
- const R = U(m), d = ((b = u.templates) == null ? void 0 : b.filter(
24
- (o) => R.includes(o.id)
25
- )) ?? [], _ = d.some((o) => o.type === g.UNSUBSCRIBE_LINK_TYPE), I = d.some((o) => o.type === g.PREFERENCES_LINK_TYPE), E = p.outerHTML;
22
+ const S = B(d), m = ((g = n.templates) == null ? void 0 : g.filter(
23
+ (c) => S.includes(c.id)
24
+ )) ?? [], R = m.some((c) => c.type === b.UNSUBSCRIBE_LINK_TYPE), _ = m.some((c) => c.type === b.PREFERENCES_LINK_TYPE), E = p.outerHTML;
26
25
  let s = E;
27
- _ && (n.selectedDynamicContentList.push({
28
- text: f,
29
- value: f,
30
- fallback: ""
31
- }), s = s.replace(
26
+ R && (s = s.replace(
32
27
  l.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
33
- S.UNSUBSCRIBE_URL + r
34
- )), I && (s = s.replace(
28
+ f.UNSUBSCRIBE_URL + e
29
+ )), _ && (s = s.replace(
35
30
  l.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
36
- S.PREFERENCES_URL + r
37
- )), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), e = e.replace(E, s);
38
- }), e;
31
+ f.PREFERENCES_URL + e
32
+ )), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), o = o.replace(E, s);
33
+ }), o;
39
34
  },
40
35
  priority: 60
41
36
  },
@@ -61,16 +56,16 @@ const D = [
61
56
  type: "custom",
62
57
  processor: (t) => {
63
58
  let i = t;
64
- const c = i.match(/<a[^>]+>(.*?)<\/a>/gm);
65
- return c && c.forEach((n) => {
59
+ const a = i.match(/<a[^>]+>(.*?)<\/a>/gm);
60
+ return a && a.forEach((n) => {
66
61
  if (n.includes("insEmail=1"))
67
62
  return;
68
63
  if (n.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
69
- const a = n.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
64
+ const o = n.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
70
65
  const r = e.slice(6, e.length - 1).trim();
71
66
  return e.includes("?") || e.includes("#") ? r.slice(-1) === "&" ? e.replace(r, `${r}insEmail=1`) : e.replace(r, `${r}&insEmail=1`) : e.replace(r, `${r}?insEmail=1`);
72
67
  });
73
- i = i.replace(n, a);
68
+ i = i.replace(n, o);
74
69
  }
75
70
  }), i;
76
71
  },
@@ -78,5 +73,5 @@ const D = [
78
73
  }
79
74
  ];
80
75
  export {
81
- D as unsubscribeCompilerRules
76
+ T as unsubscribeCompilerRules
82
77
  };
@@ -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,25 +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,
20
- displayConditions: !0
13
+ versionHistory: !0
21
14
  },
22
15
  useHeader: !0
23
16
  }, t = {
24
17
  promotional: 1,
25
18
  transactional: 2
26
- }, a = "email", o = "Guido User", s = t.promotional, n = 2, i = {
19
+ }, e = "email", o = "Guido User", n = t.promotional, s = 2, i = {
27
20
  email: 60,
28
- architect: 49,
29
- unsubscribePages: 97
21
+ architect: 49
30
22
  }, u = [
31
23
  "alfredtesting",
32
24
  "electio",
@@ -60,11 +52,11 @@ const e = {
60
52
  "stripoeditorlivetest"
61
53
  ];
62
54
  export {
63
- e as DefaultGuidoConfig,
64
- s as DefaultMessageType,
65
- a as DefaultProductType,
55
+ a as DefaultGuidoConfig,
56
+ n as DefaultMessageType,
57
+ e as DefaultProductType,
66
58
  o as DefaultUsername,
67
- n as EditorType,
59
+ s as EditorType,
68
60
  i as ProductIds,
69
61
  u as TEST_PARTNER_LIST,
70
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
  };