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