@useinsider/guido 1.0.3-beta.001f60f → 1.0.3-beta.03ebd23
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 +144 -3
- package/dist/components/Guido.vue.js +12 -10
- package/dist/components/Guido.vue2.js +84 -101
- package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -15
- package/dist/components/organisms/header/RightSlot.vue.js +11 -11
- package/dist/components/organisms/header/RightSlot.vue2.js +23 -22
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +30 -17
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -10
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +19 -18
- package/dist/composables/useBlocksConfig.js +49 -0
- package/dist/composables/useGuidoActions.js +19 -9
- package/dist/composables/useHttp.js +60 -127
- package/dist/composables/useStripo.js +62 -203
- package/dist/config/compiler/unsubscribeCompilerRules.js +33 -28
- package/dist/config/migrator/index.js +7 -6
- package/dist/config/migrator/recommendationMigrator.js +293 -0
- package/dist/enums/date.js +6 -0
- package/dist/enums/defaults.js +16 -8
- package/dist/enums/onboarding.js +2 -1
- package/dist/enums/unsubscribe.js +27 -25
- package/dist/extensions/Blocks/Checkbox/control.js +15 -14
- package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
- package/dist/extensions/Blocks/Checkbox/template.js +14 -9
- package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
- package/dist/extensions/Blocks/RadioButton/control.js +18 -17
- package/dist/extensions/Blocks/RadioButton/template.js +18 -9
- package/dist/extensions/Blocks/Recommendation/block.js +6 -3
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +103 -0
- package/dist/extensions/Blocks/Recommendation/constants.js +5 -0
- package/dist/extensions/Blocks/Recommendation/control.js +69 -40
- package/dist/extensions/Blocks/Recommendation/controls/button/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/border.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/text.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +42 -7
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +107 -22
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +160 -0
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +152 -0
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +180 -0
- package/dist/extensions/Blocks/common-control.js +125 -43
- package/dist/extensions/DynamicContent/dynamic-content-modal.js +25 -19
- package/dist/extensions/DynamicContent/dynamic-content.js +128 -33
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +307 -100
- package/dist/package.json.js +1 -1
- package/dist/services/stripoApi.js +19 -51
- package/dist/src/@types/generic.d.ts +42 -6
- package/dist/src/components/Guido.vue.d.ts +4 -3
- package/dist/src/components/organisms/onboarding/NewVersionPopup.vue.d.ts +3 -1
- package/dist/src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +3 -1
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useBlocksConfig.d.ts +11 -0
- package/dist/src/composables/useGuidoActions.d.ts +9 -0
- package/dist/src/composables/useHttp.d.ts +0 -2
- package/dist/src/composables/useStripo.d.ts +0 -1
- package/dist/src/config/migrator/recommendationMigrator.d.ts +1 -0
- package/dist/src/enums/date.d.ts +4 -0
- package/dist/src/enums/onboarding.d.ts +1 -0
- package/dist/src/extensions/Blocks/Checkbox/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +28 -0
- package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +51 -0
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +44 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +21 -0
- package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +9 -2
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +52 -2
- package/dist/src/services/stripoApi.d.ts +1 -1
- package/dist/src/stores/config.d.ts +10 -2
- 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 +21 -0
- package/dist/src/utils/environmentUtil.d.ts +5 -0
- package/dist/src/utils/genericUtil.d.ts +1 -0
- package/dist/static/styles/components/narrow-panel.css.js +10 -0
- package/dist/static/styles/customEditorStyle.css.js +5 -0
- 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 +24 -3
- package/dist/utils/environmentUtil.js +4 -0
- package/dist/utils/genericUtil.js +20 -9
- package/package.json +3 -3
- package/dist/composables/useApiErrorTracking.js +0 -137
- package/dist/composables/useErrorTracking.js +0 -98
- package/dist/composables/useStripoErrorCategory.js +0 -138
- package/dist/composables/useStripoSlackNotifier.js +0 -47
- package/dist/extensions/Blocks/Recommendation/template.js +0 -200
- package/dist/services/slackNotificationService.js +0 -167
- package/dist/services/stripoErrorDeduplicationService.js +0 -91
- package/dist/src/composables/useApiErrorTracking.d.ts +0 -28
- package/dist/src/composables/useErrorTracking.d.ts +0 -30
- package/dist/src/composables/useStripoErrorCategory.d.ts +0 -29
- package/dist/src/composables/useStripoSlackNotifier.d.ts +0 -8
- package/dist/src/extensions/Blocks/Recommendation/template.d.ts +0 -6
- package/dist/src/services/slackNotificationService.d.ts +0 -110
- package/dist/src/services/stripoErrorDeduplicationService.d.ts +0 -75
|
@@ -1,82 +1,26 @@
|
|
|
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
|
-
|
|
17
|
-
import { useEditorStore as _ } from "../stores/editor.js";
|
|
18
|
-
import { dynamicContentToMergeTags as K } from "../utils/genericUtil.js";
|
|
19
|
-
import X from "../package.json.js";
|
|
20
|
-
const j = 1500 * 1e3;
|
|
21
|
-
let m = null;
|
|
22
|
-
const fe = (e) => {
|
|
23
|
-
const { handleError: y } = M(), k = async () => {
|
|
24
|
-
try {
|
|
25
|
-
const { getToken: s } = T();
|
|
26
|
-
return await s();
|
|
27
|
-
} catch {
|
|
28
|
-
return "";
|
|
29
|
-
}
|
|
30
|
-
}, { getToken: E, getCustomFonts: C } = T(k), { handleEvent: w } = U(), { captureStripoError: p, withTimeout: f } = A(), { shouldCaptureSentry: I } = P(), { notifySlack: c } = D(), v = () => {
|
|
31
|
-
m && clearInterval(m), m = setInterval(async () => {
|
|
32
|
-
try {
|
|
33
|
-
await f(
|
|
34
|
-
E(),
|
|
35
|
-
1e4,
|
|
36
|
-
"idle_token_refresh",
|
|
37
|
-
{ emailId: e.emailId, userId: e.userId }
|
|
38
|
-
) && _().isStripoInitialized && c(
|
|
39
|
-
"Proactive token refresh completed successfully",
|
|
40
|
-
"idle_token_refresh",
|
|
41
|
-
{
|
|
42
|
-
emailId: e.emailId,
|
|
43
|
-
userId: e.userId,
|
|
44
|
-
reason: "scheduled_refresh"
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
} catch (s) {
|
|
48
|
-
const i = "idle_token_refresh", o = I(i);
|
|
49
|
-
p(s, i, {
|
|
50
|
-
emailId: e.emailId,
|
|
51
|
-
userId: e.userId
|
|
52
|
-
}, o), c(
|
|
53
|
-
"Proactive token refresh failed",
|
|
54
|
-
i,
|
|
55
|
-
{ emailId: e.emailId, userId: e.userId }
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
}, j);
|
|
59
|
-
}, b = () => {
|
|
60
|
-
m && (clearInterval(m), m = null);
|
|
61
|
-
}, V = (s, i = []) => {
|
|
62
|
-
const o = _(), { html: u, css: h, forceRecreate: g } = s, d = (r) => {
|
|
63
|
-
const t = r instanceof Error ? r : new Error(String(r)), n = "stripo_runtime_error", l = I(n);
|
|
64
|
-
p(t, n, {
|
|
65
|
-
emailId: e.emailId,
|
|
66
|
-
userId: e.userId
|
|
67
|
-
}, l), c(
|
|
68
|
-
t.message,
|
|
69
|
-
n,
|
|
70
|
-
{ emailId: e.emailId, userId: e.userId }
|
|
71
|
-
);
|
|
72
|
-
};
|
|
1
|
+
import { useActionsApi as h } 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 F } from "../enums/displayConditions.js";
|
|
8
|
+
import { useStripoApi as A } from "../services/stripoApi.js";
|
|
9
|
+
import T from "../static/styles/customEditorStyle.css.js";
|
|
10
|
+
import { useEditorStore as v } from "../stores/editor.js";
|
|
11
|
+
import { dynamicContentToMergeTags as I } from "../utils/genericUtil.js";
|
|
12
|
+
import M from "../package.json.js";
|
|
13
|
+
const N = (d) => {
|
|
14
|
+
const { config: u } = k(), { handleError: l } = _(), { getToken: f, getCustomFonts: S } = A(), { handleEvent: C } = V(), { getStripoBlocksConfig: y } = b(), E = async (i, r = []) => {
|
|
15
|
+
var m, g;
|
|
16
|
+
const t = v(), { html: n, css: p, forceRecreate: a } = i, { baseBlocks: e, extensions: c } = await y();
|
|
73
17
|
window.UIEditor.initEditor(
|
|
74
18
|
document.querySelector("#guido-editor"),
|
|
75
19
|
{
|
|
76
|
-
metadata:
|
|
77
|
-
html:
|
|
78
|
-
css:
|
|
79
|
-
forceRecreate:
|
|
20
|
+
metadata: d,
|
|
21
|
+
html: n,
|
|
22
|
+
css: p,
|
|
23
|
+
forceRecreate: a,
|
|
80
24
|
locale: "en",
|
|
81
25
|
undoButtonSelector: "#guido__undo-button",
|
|
82
26
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -86,168 +30,83 @@ const fe = (e) => {
|
|
|
86
30
|
customAppearanceMergetags: !0,
|
|
87
31
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
88
32
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
89
|
-
customViewStyles:
|
|
90
|
-
conditionsEnabled: !0,
|
|
91
|
-
customConditionsEnabled: !0,
|
|
92
|
-
conditionCategories:
|
|
33
|
+
customViewStyles: T,
|
|
34
|
+
conditionsEnabled: ((m = u.features) == null ? void 0 : m.displayConditions) ?? !0,
|
|
35
|
+
customConditionsEnabled: ((g = u.features) == null ? void 0 : g.displayConditions) ?? !0,
|
|
36
|
+
conditionCategories: F,
|
|
93
37
|
enableXSSSecurity: !0,
|
|
94
38
|
messageSettingsEnabled: !1,
|
|
95
39
|
selectBlockAfterDropFromSettingsPanel: !0,
|
|
40
|
+
...e ? { baseBlocks: e } : {},
|
|
96
41
|
editorFonts: {
|
|
97
42
|
showDefaultStandardFonts: !0,
|
|
98
43
|
showDefaultNotStandardFonts: !0,
|
|
99
|
-
customFonts:
|
|
44
|
+
customFonts: r
|
|
100
45
|
},
|
|
101
46
|
mergeTags: [
|
|
102
47
|
{
|
|
103
|
-
entries:
|
|
48
|
+
entries: I(d.preselectedDynamicContentList)
|
|
104
49
|
}
|
|
105
50
|
],
|
|
106
|
-
async onTokenRefreshRequest(
|
|
51
|
+
async onTokenRefreshRequest(o) {
|
|
107
52
|
try {
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"token_refresh",
|
|
113
|
-
{ emailId: e.emailId, userId: e.userId }
|
|
114
|
-
);
|
|
115
|
-
r(t);
|
|
116
|
-
} catch (t) {
|
|
117
|
-
const n = "token_refresh", l = I(n);
|
|
118
|
-
p(t, n, {
|
|
119
|
-
templateId: e.emailId,
|
|
120
|
-
userId: e.userId
|
|
121
|
-
}, l), c(
|
|
122
|
-
"Token refresh operation failed",
|
|
123
|
-
n,
|
|
124
|
-
{ emailId: e.emailId, userId: e.userId }
|
|
125
|
-
), y(t, "Failed to refresh token");
|
|
53
|
+
const s = await f();
|
|
54
|
+
o(s);
|
|
55
|
+
} catch (s) {
|
|
56
|
+
l(s, "Failed to refresh token");
|
|
126
57
|
}
|
|
127
58
|
},
|
|
128
59
|
onTemplateLoaded() {
|
|
129
60
|
try {
|
|
130
|
-
const { importCss:
|
|
131
|
-
|
|
132
|
-
|
|
61
|
+
const { importCss: o } = B(), { activateCustomViewStyles: s } = h();
|
|
62
|
+
o(), s(), d.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
|
|
63
|
+
t.hasChanges = !1;
|
|
133
64
|
}, 1e3);
|
|
134
|
-
} catch (
|
|
135
|
-
|
|
136
|
-
p(r, t, {
|
|
137
|
-
templateId: e.emailId,
|
|
138
|
-
userId: e.userId
|
|
139
|
-
}, n), c(
|
|
140
|
-
"Template loading operation failed",
|
|
141
|
-
t,
|
|
142
|
-
{ emailId: e.emailId, userId: e.userId }
|
|
143
|
-
), y(r, "Failed to load custom interface appearance");
|
|
65
|
+
} catch (o) {
|
|
66
|
+
l(o, "Failed to load custom interface appearance");
|
|
144
67
|
}
|
|
145
68
|
},
|
|
146
|
-
onCodeEditorVisibilityChanged(
|
|
147
|
-
|
|
69
|
+
onCodeEditorVisibilityChanged(o) {
|
|
70
|
+
t.isCodeEditorOpen = o;
|
|
148
71
|
},
|
|
149
|
-
onEditorVisualModeChanged(
|
|
150
|
-
|
|
72
|
+
onEditorVisualModeChanged(o) {
|
|
73
|
+
t.editorVisualMode = o.toLowerCase();
|
|
151
74
|
},
|
|
152
|
-
onVersionHistoryVisibilityChanged(
|
|
153
|
-
|
|
75
|
+
onVersionHistoryVisibilityChanged(o) {
|
|
76
|
+
t.isVersionHistoryOpen = o;
|
|
154
77
|
},
|
|
155
78
|
onDataChanged() {
|
|
156
|
-
|
|
79
|
+
t.hasChanges = !0;
|
|
157
80
|
},
|
|
158
|
-
onEvent:
|
|
159
|
-
// Error handler for Stripo runtime errors (CORS, plugin issues, etc.)
|
|
160
|
-
onError: d,
|
|
81
|
+
onEvent: C,
|
|
161
82
|
ignoreClickOutsideSelectors: [
|
|
162
83
|
"#guido-dynamic-content-modal",
|
|
163
84
|
".in-on-board-wrapper",
|
|
164
85
|
".in-drawer__container"
|
|
165
86
|
],
|
|
166
|
-
extensions:
|
|
167
|
-
q,
|
|
168
|
-
H,
|
|
169
|
-
N,
|
|
170
|
-
O,
|
|
171
|
-
$,
|
|
172
|
-
L
|
|
173
|
-
]
|
|
87
|
+
extensions: c
|
|
174
88
|
}
|
|
175
89
|
);
|
|
176
|
-
},
|
|
177
|
-
var
|
|
90
|
+
}, w = (i) => new Promise((r, t) => {
|
|
91
|
+
var c;
|
|
178
92
|
if (document.getElementById("UiEditorScript")) {
|
|
179
|
-
|
|
93
|
+
i(), r();
|
|
180
94
|
return;
|
|
181
95
|
}
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
emailId: e.emailId,
|
|
189
|
-
userId: e.userId
|
|
190
|
-
}, a), c(
|
|
191
|
-
`Stripo plugin failed to load (timeout): ${d.src}`,
|
|
192
|
-
l,
|
|
193
|
-
{ emailId: e.emailId, userId: e.userId, reason: "timeout" }
|
|
194
|
-
), o(n);
|
|
195
|
-
}, 3e4);
|
|
196
|
-
d.onload = () => {
|
|
197
|
-
clearTimeout(r), s(), i();
|
|
198
|
-
}, d.onerror = (n) => {
|
|
199
|
-
clearTimeout(r);
|
|
200
|
-
const l = new Error("Failed to load Stripo UIEditor script"), a = n instanceof Event ? n.type : String(n), S = "plugin_load_error", B = I(S);
|
|
201
|
-
p(l, S, {
|
|
202
|
-
scriptSrc: d.src,
|
|
203
|
-
event: a,
|
|
204
|
-
emailId: e.emailId,
|
|
205
|
-
userId: e.userId
|
|
206
|
-
}, B), c(
|
|
207
|
-
`Stripo plugin failed to load: ${a}`,
|
|
208
|
-
S,
|
|
209
|
-
{ emailId: e.emailId, userId: e.userId, scriptSrc: d.src }
|
|
210
|
-
), o(l);
|
|
211
|
-
}, document.body.appendChild(d);
|
|
96
|
+
const n = M.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");
|
|
97
|
+
e.id = "UiEditorScript", e.type = "module", e.src = a, e.onload = () => {
|
|
98
|
+
i(), r();
|
|
99
|
+
}, e.onerror = () => {
|
|
100
|
+
t(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
101
|
+
}, document.body.appendChild(e);
|
|
212
102
|
});
|
|
213
|
-
return { initPlugin: async (
|
|
214
|
-
|
|
215
|
-
await
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
5e3,
|
|
220
|
-
// 5 second timeout for fonts
|
|
221
|
-
"load_custom_fonts",
|
|
222
|
-
{ emailId: e.emailId }
|
|
223
|
-
);
|
|
224
|
-
V(s, i);
|
|
225
|
-
} catch (i) {
|
|
226
|
-
const o = "init_editor", u = I(o);
|
|
227
|
-
throw p(i, o, {
|
|
228
|
-
templateId: e.emailId,
|
|
229
|
-
userId: e.userId,
|
|
230
|
-
hasTemplate: !!s.html
|
|
231
|
-
}, u), c(
|
|
232
|
-
"Editor initialization failed",
|
|
233
|
-
o,
|
|
234
|
-
{ emailId: e.emailId, userId: e.userId }
|
|
235
|
-
), i;
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
} catch (i) {
|
|
239
|
-
const o = "init_plugin", u = I(o);
|
|
240
|
-
throw p(i, o, {
|
|
241
|
-
templateId: e.emailId,
|
|
242
|
-
userId: e.userId
|
|
243
|
-
}, u), c(
|
|
244
|
-
"Plugin initialization failed",
|
|
245
|
-
o,
|
|
246
|
-
{ emailId: e.emailId, userId: e.userId }
|
|
247
|
-
), i;
|
|
248
|
-
}
|
|
249
|
-
}, stopIdleTokenRefresh: b };
|
|
103
|
+
return { initPlugin: async (i) => {
|
|
104
|
+
await w(async () => {
|
|
105
|
+
const r = await S();
|
|
106
|
+
await E(i, r);
|
|
107
|
+
});
|
|
108
|
+
} };
|
|
250
109
|
};
|
|
251
110
|
export {
|
|
252
|
-
|
|
111
|
+
N as useStripo
|
|
253
112
|
};
|
|
@@ -1,36 +1,41 @@
|
|
|
1
|
-
import { usePartner as
|
|
2
|
-
import { LINK_REGEXES as l, LINK_TYPES as
|
|
3
|
-
import { parsePageList as
|
|
4
|
-
import { useConfigStore as
|
|
5
|
-
import {
|
|
6
|
-
|
|
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 = [
|
|
7
8
|
{
|
|
8
9
|
id: "add-unsubscribe-link-values",
|
|
9
10
|
description: "Adding unsubscribe link values",
|
|
10
11
|
type: "custom",
|
|
11
12
|
processor: (t) => {
|
|
12
|
-
const { getPartnerName: i } =
|
|
13
|
-
if (!
|
|
13
|
+
const { getPartnerName: i } = N(), c = B(), n = y(), u = L(), a = c.getVariationId;
|
|
14
|
+
if (!a)
|
|
14
15
|
return t;
|
|
15
|
-
let
|
|
16
|
-
const
|
|
17
|
-
return new DOMParser().parseFromString(
|
|
18
|
-
var
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
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)
|
|
21
22
|
return;
|
|
22
|
-
const
|
|
23
|
-
(
|
|
24
|
-
)) ?? [],
|
|
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;
|
|
25
26
|
let s = E;
|
|
26
|
-
|
|
27
|
+
_ && (n.selectedDynamicContentList.push({
|
|
28
|
+
text: f,
|
|
29
|
+
value: f,
|
|
30
|
+
fallback: ""
|
|
31
|
+
}), s = s.replace(
|
|
27
32
|
l.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
|
|
28
|
-
|
|
29
|
-
)),
|
|
33
|
+
S.UNSUBSCRIBE_URL + r
|
|
34
|
+
)), I && (s = s.replace(
|
|
30
35
|
l.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
|
|
31
|
-
|
|
32
|
-
)), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""),
|
|
33
|
-
}),
|
|
36
|
+
S.PREFERENCES_URL + r
|
|
37
|
+
)), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), e = e.replace(E, s);
|
|
38
|
+
}), e;
|
|
34
39
|
},
|
|
35
40
|
priority: 60
|
|
36
41
|
},
|
|
@@ -56,16 +61,16 @@ const T = [
|
|
|
56
61
|
type: "custom",
|
|
57
62
|
processor: (t) => {
|
|
58
63
|
let i = t;
|
|
59
|
-
const
|
|
60
|
-
return
|
|
64
|
+
const c = i.match(/<a[^>]+>(.*?)<\/a>/gm);
|
|
65
|
+
return c && c.forEach((n) => {
|
|
61
66
|
if (n.includes("insEmail=1"))
|
|
62
67
|
return;
|
|
63
68
|
if (n.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
|
|
64
|
-
const
|
|
69
|
+
const a = n.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
|
|
65
70
|
const r = e.slice(6, e.length - 1).trim();
|
|
66
71
|
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`);
|
|
67
72
|
});
|
|
68
|
-
i = i.replace(n,
|
|
73
|
+
i = i.replace(n, a);
|
|
69
74
|
}
|
|
70
75
|
}), i;
|
|
71
76
|
},
|
|
@@ -73,5 +78,5 @@ const T = [
|
|
|
73
78
|
}
|
|
74
79
|
];
|
|
75
80
|
export {
|
|
76
|
-
|
|
81
|
+
D as unsubscribeCompilerRules
|
|
77
82
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { migrateCheckbox as
|
|
2
|
-
import { migrateCouponBlock as
|
|
1
|
+
import { migrateCheckbox as m } from "./checkboxMigrator.js";
|
|
2
|
+
import { migrateCouponBlock as o } from "./couponBlockMigrator.js";
|
|
3
3
|
import { migrateRadioButton as i } from "./radioButtonMigrator.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { migrateRecommendation as e } from "./recommendationMigrator.js";
|
|
5
|
+
import { migrateUnsubscribe as a } from "./unsubscribeMigrator.js";
|
|
6
|
+
const s = async (t) => {
|
|
6
7
|
let r = t;
|
|
7
|
-
return r =
|
|
8
|
+
return r = m(r), r = i(r), r = await a(r), r = o(r), r = e(r), r;
|
|
8
9
|
};
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
s as migrate
|
|
11
12
|
};
|