@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.
- package/README.md +3 -144
- package/dist/components/Guido.vue.js +10 -12
- package/dist/components/Guido.vue2.js +101 -84
- package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
- package/dist/components/organisms/header/LeftSlot.vue2.js +15 -16
- package/dist/components/organisms/header/RightSlot.vue.js +11 -11
- package/dist/components/organisms/header/RightSlot.vue2.js +22 -23
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +17 -30
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +10 -12
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -19
- package/dist/composables/useApiErrorTracking.js +120 -0
- package/dist/composables/useErrorTracking.js +98 -0
- package/dist/composables/useGuidoActions.js +9 -19
- package/dist/composables/useHttp.js +89 -52
- package/dist/composables/useStripo.js +163 -66
- package/dist/composables/useStripoErrorCategory.js +86 -0
- package/dist/composables/useStripoSlackNotifier.js +47 -0
- package/dist/config/compiler/unsubscribeCompilerRules.js +28 -33
- package/dist/config/migrator/index.js +6 -7
- package/dist/enums/defaults.js +8 -16
- package/dist/enums/onboarding.js +1 -2
- package/dist/enums/unsubscribe.js +25 -27
- package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
- package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
- package/dist/extensions/Blocks/Recommendation/block.js +3 -6
- package/dist/extensions/Blocks/Recommendation/control.js +65 -109
- package/dist/extensions/Blocks/Recommendation/extension.js +7 -18
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +21 -159
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
- package/dist/extensions/Blocks/Recommendation/template.js +200 -0
- package/dist/extensions/Blocks/common-control.js +43 -125
- package/dist/extensions/DynamicContent/dynamic-content-modal.js +19 -25
- package/dist/extensions/DynamicContent/dynamic-content.js +33 -128
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +100 -312
- package/dist/package.json.js +1 -1
- package/dist/services/slackNotificationService.js +167 -0
- package/dist/services/stripoApi.js +49 -19
- package/dist/services/stripoErrorDeduplicationService.js +91 -0
- package/dist/src/@types/generic.d.ts +6 -42
- package/dist/src/components/Guido.vue.d.ts +3 -4
- package/dist/src/components/organisms/onboarding/NewVersionPopup.vue.d.ts +1 -3
- package/dist/src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +1 -3
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useApiErrorTracking.d.ts +26 -0
- package/dist/src/composables/useErrorTracking.d.ts +30 -0
- package/dist/src/composables/useGuidoActions.d.ts +0 -9
- package/dist/src/composables/useStripoErrorCategory.d.ts +26 -0
- package/dist/src/composables/useStripoSlackNotifier.d.ts +8 -0
- package/dist/src/enums/onboarding.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +2 -11
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/template.d.ts +6 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +0 -21
- package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +2 -9
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +2 -52
- package/dist/src/services/slackNotificationService.d.ts +110 -0
- package/dist/src/services/stripoErrorDeduplicationService.d.ts +75 -0
- package/dist/src/stores/config.d.ts +2 -10
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/src/stores/editor.d.ts +1 -1
- package/dist/src/stores/onboarding.d.ts +1 -1
- package/dist/src/stores/preview.d.ts +1 -1
- package/dist/src/stores/recommendation.d.ts +1 -1
- package/dist/src/stores/save-as-template.d.ts +1 -1
- package/dist/src/stores/toaster.d.ts +1 -1
- package/dist/src/stores/unsubscribe.d.ts +1 -1
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/dateUtil.d.ts +0 -21
- package/dist/src/utils/genericUtil.d.ts +0 -1
- package/dist/static/styles/components/narrow-panel.css.js +0 -10
- package/dist/static/styles/components/wide-panel.css.js +4 -0
- package/dist/static/styles/customEditorStyle.css.js +0 -19
- package/dist/stores/config.js +5 -5
- package/dist/stores/dynamic-content.js +2 -2
- package/dist/stores/editor.js +1 -1
- package/dist/stores/onboarding.js +27 -27
- package/dist/stores/preview.js +1 -1
- package/dist/stores/recommendation.js +3 -3
- package/dist/stores/save-as-template.js +2 -2
- package/dist/stores/toaster.js +1 -1
- package/dist/stores/unsubscribe.js +1 -1
- package/dist/stores/version-history.js +4 -4
- package/dist/utils/dateUtil.js +3 -24
- package/dist/utils/genericUtil.js +9 -20
- package/package.json +3 -3
- package/dist/composables/useBlocksConfig.js +0 -49
- package/dist/config/migrator/recommendationMigrator.js +0 -293
- package/dist/enums/date.js +0 -6
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -193
- package/dist/extensions/Blocks/Recommendation/constants.js +0 -14
- package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +0 -68
- package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -272
- package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +0 -74
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.js +0 -71
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.js +0 -71
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.js +0 -71
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.js +0 -71
- package/dist/extensions/Blocks/Recommendation/controls/priceHideControl.js +0 -60
- package/dist/extensions/Blocks/Recommendation/controls/priceInlineLayoutControl.js +0 -160
- package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +0 -188
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -184
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -189
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -209
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +0 -25
- package/dist/extensions/Blocks/controlFactories.js +0 -234
- package/dist/src/composables/useBlocksConfig.d.ts +0 -11
- package/dist/src/config/migrator/recommendationMigrator.d.ts +0 -1
- package/dist/src/enums/date.d.ts +0 -4
- package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +0 -79
- package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +0 -91
- package/dist/src/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.d.ts +0 -25
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +0 -71
- package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/priceHideControl.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/controls/priceInlineLayoutControl.d.ts +0 -50
- package/dist/src/extensions/Blocks/Recommendation/controls/spacingControl.d.ts +0 -60
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -52
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -19
- package/dist/src/extensions/Blocks/controlFactories.d.ts +0 -95
- package/dist/src/utils/environmentUtil.d.ts +0 -5
- package/dist/utils/environmentUtil.js +0 -4
|
@@ -1,26 +1,42 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useStripoEventHandler as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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:
|
|
21
|
-
html:
|
|
22
|
-
css:
|
|
23
|
-
forceRecreate:
|
|
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:
|
|
34
|
-
conditionsEnabled:
|
|
35
|
-
customConditionsEnabled:
|
|
36
|
-
conditionCategories:
|
|
49
|
+
customViewStyles: O,
|
|
50
|
+
conditionsEnabled: !0,
|
|
51
|
+
customConditionsEnabled: !0,
|
|
52
|
+
conditionCategories: A,
|
|
37
53
|
enableXSSSecurity: !0,
|
|
38
|
-
messageSettingsEnabled: !
|
|
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:
|
|
59
|
+
customFonts: n
|
|
49
60
|
},
|
|
50
61
|
mergeTags: [
|
|
51
62
|
{
|
|
52
|
-
entries:
|
|
63
|
+
entries: q(o.preselectedDynamicContentList)
|
|
53
64
|
}
|
|
54
65
|
],
|
|
55
|
-
async onTokenRefreshRequest(
|
|
66
|
+
async onTokenRefreshRequest(e) {
|
|
56
67
|
try {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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:
|
|
66
|
-
|
|
67
|
-
|
|
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 (
|
|
70
|
-
|
|
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(
|
|
74
|
-
|
|
106
|
+
onCodeEditorVisibilityChanged(e) {
|
|
107
|
+
r.isCodeEditorOpen = e;
|
|
75
108
|
},
|
|
76
|
-
onEditorVisualModeChanged(
|
|
77
|
-
|
|
109
|
+
onEditorVisualModeChanged(e) {
|
|
110
|
+
r.editorVisualMode = e.toLowerCase();
|
|
78
111
|
},
|
|
79
|
-
onVersionHistoryVisibilityChanged(
|
|
80
|
-
|
|
112
|
+
onVersionHistoryVisibilityChanged(e) {
|
|
113
|
+
r.isVersionHistoryOpen = e;
|
|
81
114
|
},
|
|
82
115
|
onDataChanged() {
|
|
83
|
-
|
|
116
|
+
r.hasChanges = !0;
|
|
84
117
|
},
|
|
85
|
-
onEvent:
|
|
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:
|
|
126
|
+
extensions: [
|
|
127
|
+
z,
|
|
128
|
+
U,
|
|
129
|
+
D,
|
|
130
|
+
P,
|
|
131
|
+
R,
|
|
132
|
+
M
|
|
133
|
+
]
|
|
92
134
|
}
|
|
93
135
|
);
|
|
94
|
-
},
|
|
95
|
-
var
|
|
136
|
+
}, _ = (m) => new Promise((n, r) => {
|
|
137
|
+
var t;
|
|
96
138
|
if (document.getElementById("UiEditorScript")) {
|
|
97
|
-
|
|
139
|
+
m(), n();
|
|
98
140
|
return;
|
|
99
141
|
}
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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 (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
import { LINK_REGEXES as l, LINK_TYPES as
|
|
3
|
-
import { parsePageList as
|
|
4
|
-
import { useConfigStore as
|
|
5
|
-
import {
|
|
6
|
-
|
|
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 } =
|
|
14
|
-
if (!
|
|
12
|
+
const { getPartnerName: i } = U(), a = N(), n = I(), u = a.getVariationId;
|
|
13
|
+
if (!u)
|
|
15
14
|
return t;
|
|
16
|
-
let
|
|
17
|
-
const
|
|
18
|
-
return new DOMParser().parseFromString(
|
|
19
|
-
var
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
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
|
|
24
|
-
(
|
|
25
|
-
)) ?? [],
|
|
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
|
-
|
|
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
|
-
|
|
34
|
-
)),
|
|
28
|
+
f.UNSUBSCRIBE_URL + e
|
|
29
|
+
)), _ && (s = s.replace(
|
|
35
30
|
l.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
|
|
36
|
-
|
|
37
|
-
)), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""),
|
|
38
|
-
}),
|
|
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
|
|
65
|
-
return
|
|
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
|
|
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,
|
|
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
|
-
|
|
76
|
+
T as unsubscribeCompilerRules
|
|
82
77
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { migrateCheckbox as
|
|
2
|
-
import { migrateCouponBlock as
|
|
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 {
|
|
5
|
-
|
|
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 =
|
|
7
|
+
return r = o(r), r = i(r), r = await e(r), r = m(r), r;
|
|
9
8
|
};
|
|
10
9
|
export {
|
|
11
|
-
|
|
10
|
+
c as migrate
|
|
12
11
|
};
|
package/dist/enums/defaults.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
const
|
|
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
|
-
},
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
a as DefaultGuidoConfig,
|
|
56
|
+
n as DefaultMessageType,
|
|
57
|
+
e as DefaultProductType,
|
|
66
58
|
o as DefaultUsername,
|
|
67
|
-
|
|
59
|
+
s as EditorType,
|
|
68
60
|
i as ProductIds,
|
|
69
61
|
u as TEST_PARTNER_LIST,
|
|
70
62
|
t as TemplateTypes
|
package/dist/enums/onboarding.js
CHANGED
|
@@ -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
|
-
]
|
|
5
|
+
];
|
|
6
6
|
export {
|
|
7
|
-
t as ACADEMY_LINK,
|
|
8
7
|
e as SERVICE_HOVER_SELECTORS
|
|
9
8
|
};
|