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