@useinsider/guido 3.21.0-beta.f049776 → 3.21.0-beta.ff98fc3
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/dist/components/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +118 -108
- package/dist/composables/useEditorOpenMetrics.js +159 -0
- package/dist/composables/useStripo.js +86 -80
- package/dist/config/migrator/index.js +9 -10
- package/dist/extensions/Blocks/Recommendation/block.js +209 -139
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +52 -31
- package/dist/guido.css +1 -1
- package/dist/package.json.js +6 -4
- package/dist/src/composables/useEditorOpenMetrics.d.ts +27 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +23 -7
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +11 -0
- package/package.json +1 -1
- package/dist/config/migrator/couponBlockAlignmentMigrator.js +0 -43
- package/dist/src/config/migrator/couponBlockAlignmentMigrator.d.ts +0 -1
|
@@ -1,44 +1,49 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { useActionsApi as H } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as N } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as j } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as _ } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useEditorOpenMetrics as z } from "./useEditorOpenMetrics.js";
|
|
6
|
+
import { useFullStoryBridge as $ } from "./useFullStoryBridge.js";
|
|
7
|
+
import { useModuleRepair as G } from "./useModuleRepair.js";
|
|
8
|
+
import { useStripoEventHandler as J } from "./useStripoEventHandler.js";
|
|
9
|
+
import { useStripoNotifications as X } from "./useStripoNotifications.js";
|
|
10
|
+
import { useToaster as K } from "./useToaster.js";
|
|
11
|
+
import { localePatch as Q } from "../config/i18n/index.js";
|
|
12
|
+
import { en as M } from "../config/i18n/en/index.js";
|
|
13
|
+
import { ToasterTypeOptions as W } from "../enums/toaster.js";
|
|
14
|
+
import { useStripoApi as Y } from "../services/stripoApi.js";
|
|
15
|
+
import Z from "../static/styles/customEditorStyle.css.js";
|
|
16
|
+
import { useEditorStore as T } from "../stores/editor.js";
|
|
17
|
+
import { buildMergeTagEntries as ee, flattenDynamicContentList as te } from "../utils/genericUtil.js";
|
|
18
|
+
import oe from "../package.json.js";
|
|
19
|
+
let a = null, v = !1;
|
|
20
|
+
const be = () => {
|
|
21
|
+
const { features: u, template: m, isFeatureEnabled: p } = j(), { handleError: f, showToaster: B } = K(), { getToken: F, getCustomFonts: A, getSyncModulesStatus: V } = Y(), { handleEvent: P } = J(), { handleModuleAdd: R } = G(), { getStripoBlocksConfig: D } = N(), { getStripoNotifications: U } = X(), t = z(), g = () => a || (a = new Promise((i, d) => {
|
|
22
|
+
var s;
|
|
22
23
|
if (document.getElementById("UiEditorScript")) {
|
|
23
|
-
|
|
24
|
+
i();
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
|
-
const
|
|
27
|
-
e.id = "UiEditorScript", e.type = "module", e.src =
|
|
28
|
-
|
|
27
|
+
const r = oe.guido, n = `https://email-static.useinsider.com/guido/${(s = r == null ? void 0 : r.stripo) == null ? void 0 : s.version}/UIEditor.js`, e = document.createElement("script");
|
|
28
|
+
e.id = "UiEditorScript", e.type = "module", e.src = n, e.onload = () => {
|
|
29
|
+
v = !0, i();
|
|
30
|
+
}, e.onerror = () => {
|
|
31
|
+
e.remove(), d(new Error(`Failed to load Stripo UIEditor script from S3: ${n}`));
|
|
29
32
|
}, document.body.appendChild(e);
|
|
30
|
-
}),
|
|
31
|
-
|
|
32
|
-
}),
|
|
33
|
-
var
|
|
34
|
-
const e =
|
|
35
|
-
|
|
33
|
+
}), a.catch(() => {
|
|
34
|
+
a = null;
|
|
35
|
+
}), a), I = async (i, d, r, l = [], n = !1) => {
|
|
36
|
+
var C, k, w, b;
|
|
37
|
+
const e = T(), { html: s, css: y } = i, { baseBlocks: S, extensions: L } = await D();
|
|
38
|
+
t.mark("blocks_config_ready");
|
|
39
|
+
const E = ((C = u.value) == null ? void 0 : C.displayConditions) ?? !0, O = ((k = u.value) == null ? void 0 : k.modulesDisabled) ?? !1, h = !!s || (((w = m.value) == null ? void 0 : w.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
|
|
40
|
+
t.setTemplate({ html: s, css: y, forceRecreate: h }), _().importCss(), t.mark("init_editor"), await window.UIEditor.initEditor(
|
|
36
41
|
document.querySelector("#guido-editor"),
|
|
37
42
|
{
|
|
38
|
-
metadata:
|
|
39
|
-
html:
|
|
40
|
-
css:
|
|
41
|
-
forceRecreate:
|
|
43
|
+
metadata: d,
|
|
44
|
+
html: s,
|
|
45
|
+
css: y,
|
|
46
|
+
forceRecreate: h,
|
|
42
47
|
locale: "en",
|
|
43
48
|
undoButtonSelector: "#guido__undo-button",
|
|
44
49
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -48,12 +53,12 @@ const he = () => {
|
|
|
48
53
|
customAppearanceMergetags: !p("liquidSyntax"),
|
|
49
54
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
50
55
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
51
|
-
customViewStyles:
|
|
52
|
-
conditionsEnabled:
|
|
53
|
-
customConditionsEnabled:
|
|
56
|
+
customViewStyles: Z,
|
|
57
|
+
conditionsEnabled: E,
|
|
58
|
+
customConditionsEnabled: E,
|
|
54
59
|
enableXSSSecurity: !0,
|
|
55
|
-
modulesDisabled:
|
|
56
|
-
syncModulesEnabled:
|
|
60
|
+
modulesDisabled: O,
|
|
61
|
+
syncModulesEnabled: n,
|
|
57
62
|
messageSettingsEnabled: !0,
|
|
58
63
|
displayGmailAnnotations: !0,
|
|
59
64
|
displayHiddenPreheader: !1,
|
|
@@ -64,54 +69,55 @@ const he = () => {
|
|
|
64
69
|
selectElementAfterDrop: !0,
|
|
65
70
|
sameFontSizeForOutlook: !0,
|
|
66
71
|
allowedScriptSourceDomains: q,
|
|
67
|
-
...
|
|
72
|
+
...S ? { baseBlocks: S } : {},
|
|
68
73
|
editorFonts: {
|
|
69
74
|
showDefaultStandardFonts: !0,
|
|
70
75
|
showDefaultNotStandardFonts: !0,
|
|
71
|
-
customFonts:
|
|
76
|
+
customFonts: l
|
|
72
77
|
},
|
|
73
78
|
mergeTags: [
|
|
74
79
|
{
|
|
75
|
-
entries:
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
entries: ee(
|
|
81
|
+
r.preselectedDynamicContentList,
|
|
82
|
+
te((b = m.value) == null ? void 0 : b.dynamicContentList),
|
|
78
83
|
p("liquidSyntax")
|
|
79
84
|
)
|
|
80
85
|
}
|
|
81
86
|
],
|
|
82
|
-
async onTokenRefreshRequest(
|
|
87
|
+
async onTokenRefreshRequest(o) {
|
|
83
88
|
try {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
t.mark("token_start");
|
|
90
|
+
const c = await F();
|
|
91
|
+
t.mark("token_end"), o(c);
|
|
92
|
+
} catch (c) {
|
|
93
|
+
f(c, "Failed to refresh token");
|
|
88
94
|
}
|
|
89
95
|
},
|
|
90
96
|
onTemplateLoaded() {
|
|
91
97
|
try {
|
|
92
|
-
const { activateCustomViewStyles:
|
|
93
|
-
|
|
98
|
+
const { activateCustomViewStyles: o, updateTimerInClonedTemplate: c } = H(), { injectFullStory: x } = $();
|
|
99
|
+
_().importCss(), o(), x(), c(), r.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
94
100
|
e.hasChanges = !1;
|
|
95
|
-
}, 1e3);
|
|
96
|
-
} catch (
|
|
97
|
-
|
|
101
|
+
}, 1e3), t.markReady();
|
|
102
|
+
} catch (o) {
|
|
103
|
+
f(o, "Failed to load custom interface appearance");
|
|
98
104
|
}
|
|
99
105
|
},
|
|
100
|
-
onCodeEditorVisibilityChanged(
|
|
101
|
-
e.isCodeEditorOpen =
|
|
106
|
+
onCodeEditorVisibilityChanged(o) {
|
|
107
|
+
e.isCodeEditorOpen = o;
|
|
102
108
|
},
|
|
103
|
-
onEditorVisualModeChanged(
|
|
104
|
-
e.editorVisualMode =
|
|
109
|
+
onEditorVisualModeChanged(o) {
|
|
110
|
+
e.editorVisualMode = o.toLowerCase();
|
|
105
111
|
},
|
|
106
|
-
onVersionHistoryVisibilityChanged(
|
|
107
|
-
e.isVersionHistoryOpen =
|
|
112
|
+
onVersionHistoryVisibilityChanged(o) {
|
|
113
|
+
e.isVersionHistoryOpen = o;
|
|
108
114
|
},
|
|
109
115
|
onDataChanged() {
|
|
110
116
|
e.hasChanges = !0, e.changeSeq += 1;
|
|
111
117
|
},
|
|
112
|
-
onEvent:
|
|
113
|
-
onModuleAdd:
|
|
114
|
-
notifications:
|
|
118
|
+
onEvent: P,
|
|
119
|
+
onModuleAdd: R,
|
|
120
|
+
notifications: U(),
|
|
115
121
|
// Stripo deselects the block on any click outside the canvas, so every surface
|
|
116
122
|
// that belongs to the block's own flow has to be listed here (SD-153273).
|
|
117
123
|
ignoreClickOutsideSelectors: [
|
|
@@ -121,35 +127,35 @@ const he = () => {
|
|
|
121
127
|
".in-modal-v2-wrapper",
|
|
122
128
|
".in-toasts-wrapper"
|
|
123
129
|
],
|
|
124
|
-
extensions:
|
|
125
|
-
localePatch:
|
|
130
|
+
extensions: L,
|
|
131
|
+
localePatch: Q
|
|
126
132
|
}
|
|
127
133
|
);
|
|
128
134
|
};
|
|
129
|
-
return { initPlugin: async (
|
|
130
|
-
const
|
|
135
|
+
return { initPlugin: async (i, d, r) => {
|
|
136
|
+
const l = T();
|
|
131
137
|
try {
|
|
132
|
-
await
|
|
133
|
-
const [
|
|
134
|
-
|
|
135
|
-
|
|
138
|
+
t.mark("plugin_start"), t.setScriptPreloaded(v), await g(), t.mark("script_ready");
|
|
139
|
+
const [n, e] = await Promise.all([
|
|
140
|
+
A(),
|
|
141
|
+
V()
|
|
136
142
|
]);
|
|
137
|
-
|
|
143
|
+
t.mark("fonts_sync_ready"), l.syncModulesEnabled = e, await I(i, d, r, n, e);
|
|
138
144
|
} catch {
|
|
139
|
-
|
|
140
|
-
type:
|
|
141
|
-
message:
|
|
145
|
+
l.loadingStatus = !1, B({
|
|
146
|
+
type: W.Error,
|
|
147
|
+
message: M["An error has occurred. Please report the error code to support."],
|
|
142
148
|
actionButton: {
|
|
143
|
-
text:
|
|
149
|
+
text: M["Reload page"],
|
|
144
150
|
onClick: () => window.location.reload()
|
|
145
151
|
}
|
|
146
|
-
});
|
|
152
|
+
}), t.markFailed();
|
|
147
153
|
}
|
|
148
154
|
}, preloadRuntime: () => {
|
|
149
|
-
|
|
155
|
+
g().catch(() => {
|
|
150
156
|
});
|
|
151
157
|
} };
|
|
152
158
|
};
|
|
153
159
|
export {
|
|
154
|
-
|
|
160
|
+
be as useStripo
|
|
155
161
|
};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { migrateCheckbox as i } from "./checkboxMigrator.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { migrateProductNameLink as g } from "./productNameLinkMigrator.js";
|
|
2
|
+
import { migrateCouponBlock as e } from "./couponBlockMigrator.js";
|
|
3
|
+
import { migrateItemsBlock as a } from "./itemsBlockMigrator.js";
|
|
4
|
+
import { migrateProductNameLink as n } from "./productNameLinkMigrator.js";
|
|
6
5
|
import { migrateRadioButton as c } from "./radioButtonMigrator.js";
|
|
7
|
-
import { migrateRecommendation as
|
|
6
|
+
import { migrateRecommendation as g } from "./recommendationMigrator.js";
|
|
8
7
|
import { migrateRecommendationPartnerScope as f } from "./recommendationPartnerMigrator.js";
|
|
9
|
-
import { migrateRecommendationTitle as
|
|
8
|
+
import { migrateRecommendationTitle as p } from "./recommendationTitleMigrator.js";
|
|
10
9
|
import { migrateSocialIcons as d } from "./socialIconMigrator.js";
|
|
11
|
-
import { migrateUnsubscribe as
|
|
12
|
-
const
|
|
10
|
+
import { migrateUnsubscribe as l } from "./unsubscribeMigrator.js";
|
|
11
|
+
const h = async (r, t = {}, o) => {
|
|
13
12
|
let m = r;
|
|
14
|
-
return m = i(m), m = c(m), m = await
|
|
13
|
+
return m = i(m), m = c(m), m = await l(m), m = e(m), m = g(m, t), o && (m = f(m, o)), m = p(m), m = a(m), m = n(m), m = d(m), m;
|
|
15
14
|
};
|
|
16
15
|
export {
|
|
17
|
-
|
|
16
|
+
h as migrate
|
|
18
17
|
};
|