@useinsider/guido 3.27.0-beta.ee85b86 → 3.27.1-beta.07db3f3
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 +5 -10
- package/dist/components/Guido.vue.js +7 -7
- package/dist/components/Guido.vue2.js +83 -86
- package/dist/composables/useHtmlCompiler.js +8 -9
- package/dist/composables/useModuleRepair.js +32 -63
- package/dist/composables/useStripo.js +43 -44
- package/dist/config/compiler/htmlCompilerRules.js +6 -16
- package/dist/config/migrator/itemsBlockMigrator.js +152 -152
- package/dist/config/migrator/unsubscribeMigrator.js +112 -100
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +58 -40
- package/dist/extensions/Blocks/Unsubscribe/block.js +104 -96
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +4 -3
- package/dist/extensions/Blocks/Unsubscribe/utils/swapMergeTagInHref.js +5 -0
- package/dist/guido.css +1 -1
- package/dist/package.json.js +4 -4
- package/dist/src/@types/generic.d.ts +0 -7
- package/dist/src/composables/useModuleRepair.d.ts +0 -6
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
- package/dist/src/extensions/Blocks/Unsubscribe/utils/swapMergeTagInHref.d.ts +1 -0
- package/dist/src/utils/dynamicContentConverter.d.ts +18 -20
- package/dist/src/utils/genericUtil.d.ts +8 -4
- package/dist/static/stripo-runtime-manifest.json.js +2 -2
- package/dist/utils/dynamicContentConverter.js +27 -41
- package/dist/utils/genericUtil.js +39 -39
- package/package.json +2 -2
- package/dist/components/organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js +0 -24
- package/dist/components/organisms/dynamic-content/AmbiguousDynamicContentModal.vue2.js +0 -59
- package/dist/composables/useAmbiguousDynamicContent.js +0 -72
- package/dist/enums/dynamic-content.js +0 -4
- package/dist/src/components/organisms/dynamic-content/AmbiguousDynamicContentModal.vue.d.ts +0 -2
- package/dist/src/composables/useAmbiguousDynamicContent.d.ts +0 -7
- package/dist/src/enums/dynamic-content.d.ts +0 -3
- package/dist/src/stores/module-dynamic-content.d.ts +0 -30
- package/dist/src/utils/dynamicContentPendingMarker.d.ts +0 -2
- package/dist/stores/module-dynamic-content.js +0 -20
- package/dist/utils/dynamicContentPendingMarker.js +0 -6
|
@@ -1,52 +1,51 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useConfig as G } from "./useConfig.js";
|
|
1
|
+
import { useActionsApi as N } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as j } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as z } from "./useConfig.js";
|
|
5
4
|
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
|
|
5
|
+
import { useFullStoryBridge as $ } from "./useFullStoryBridge.js";
|
|
6
|
+
import { useModuleRepair as G } from "./useModuleRepair.js";
|
|
7
|
+
import { useStripoEventHandler as X } from "./useStripoEventHandler.js";
|
|
8
|
+
import { useStripoNotifications as J } from "./useStripoNotifications.js";
|
|
9
|
+
import { useToaster as K } from "./useToaster.js";
|
|
10
|
+
import { localePatch as Q } from "../config/i18n/index.js";
|
|
12
11
|
import { en as B } from "../config/i18n/en/index.js";
|
|
13
|
-
import { ToasterTypeOptions as
|
|
14
|
-
import { useStripoApi as
|
|
15
|
-
import
|
|
12
|
+
import { ToasterTypeOptions as W } from "../enums/toaster.js";
|
|
13
|
+
import { useStripoApi as Y } from "../services/stripoApi.js";
|
|
14
|
+
import Z from "../static/styles/customEditorStyle.css.js";
|
|
16
15
|
import { useEditorStore as T } from "../stores/editor.js";
|
|
17
|
-
import { buildMergeTagEntries as
|
|
18
|
-
import { getStripoRuntimeBaseUrl as
|
|
16
|
+
import { buildMergeTagEntries as ee, flattenDynamicContentList as te } from "../utils/genericUtil.js";
|
|
17
|
+
import { getStripoRuntimeBaseUrl as oe } from "../utils/stripoRuntime.js";
|
|
19
18
|
let d = null, F = !1;
|
|
20
|
-
const
|
|
21
|
-
const { features: u, template: m, isFeatureEnabled: p } =
|
|
19
|
+
const ke = (t) => {
|
|
20
|
+
const { features: u, template: m, isFeatureEnabled: p } = z(), { handleError: f, showToaster: A } = K(), { getToken: P, getCustomFonts: R, getSyncModulesStatus: U } = Y(), { handleEvent: V } = X(), { handleModuleAdd: D } = G(), { getStripoBlocksConfig: I } = j(), { getStripoNotifications: L } = J(), g = () => d || (d = new Promise((n, a) => {
|
|
22
21
|
if (document.getElementById("UiEditorScript")) {
|
|
23
22
|
n();
|
|
24
23
|
return;
|
|
25
24
|
}
|
|
26
|
-
const i =
|
|
25
|
+
const i = oe();
|
|
27
26
|
if (!i) {
|
|
28
|
-
|
|
27
|
+
a(
|
|
29
28
|
new Error("guido.stripo.version is not set in package.json. Please configure the Stripo version.")
|
|
30
29
|
);
|
|
31
30
|
return;
|
|
32
31
|
}
|
|
33
|
-
const
|
|
34
|
-
e.id = "UiEditorScript", e.type = "module", e.src =
|
|
32
|
+
const s = `${i}UIEditor.js`, e = document.createElement("script");
|
|
33
|
+
e.id = "UiEditorScript", e.type = "module", e.src = s, e.onload = () => {
|
|
35
34
|
F = !0, n();
|
|
36
35
|
}, e.onerror = () => {
|
|
37
|
-
e.remove(),
|
|
36
|
+
e.remove(), a(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
|
|
38
37
|
}, document.body.appendChild(e);
|
|
39
38
|
}), d.catch(() => {
|
|
40
39
|
d = null;
|
|
41
|
-
}), d),
|
|
40
|
+
}), d), q = async (n, a, i, s = [], e = !1, c = !1) => {
|
|
42
41
|
var w, k, b, _;
|
|
43
|
-
const o = T(), { html: S, css: y } = n, { baseBlocks: E, extensions:
|
|
42
|
+
const o = T(), { html: S, css: y } = n, { baseBlocks: E, extensions: x } = await I();
|
|
44
43
|
t.mark("blocks_config_ready");
|
|
45
|
-
const h = ((w = u.value) == null ? void 0 : w.displayConditions) ?? !0,
|
|
44
|
+
const h = ((w = u.value) == null ? void 0 : w.displayConditions) ?? !0, O = ((k = u.value) == null ? void 0 : k.modulesDisabled) ?? !1, C = c || (((b = m.value) == null ? void 0 : b.forceRecreate) ?? !1), H = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
|
|
46
45
|
t.setTemplate({ html: S, css: y, forceRecreate: C }), v().importCss(), t.mark("init_editor"), await window.UIEditor.initEditor(
|
|
47
46
|
document.querySelector("#guido-editor"),
|
|
48
47
|
{
|
|
49
|
-
metadata:
|
|
48
|
+
metadata: a,
|
|
50
49
|
html: S,
|
|
51
50
|
css: y,
|
|
52
51
|
forceRecreate: C,
|
|
@@ -59,11 +58,11 @@ const ve = (t) => {
|
|
|
59
58
|
customAppearanceMergetags: !p("liquidSyntax"),
|
|
60
59
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
61
60
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
62
|
-
customViewStyles:
|
|
61
|
+
customViewStyles: Z,
|
|
63
62
|
conditionsEnabled: h,
|
|
64
63
|
customConditionsEnabled: h,
|
|
65
64
|
enableXSSSecurity: !0,
|
|
66
|
-
modulesDisabled:
|
|
65
|
+
modulesDisabled: O,
|
|
67
66
|
syncModulesEnabled: e,
|
|
68
67
|
messageSettingsEnabled: !0,
|
|
69
68
|
displayGmailAnnotations: !0,
|
|
@@ -74,18 +73,18 @@ const ve = (t) => {
|
|
|
74
73
|
copyPasteEnabled: !1,
|
|
75
74
|
selectElementAfterDrop: !0,
|
|
76
75
|
sameFontSizeForOutlook: !0,
|
|
77
|
-
allowedScriptSourceDomains:
|
|
76
|
+
allowedScriptSourceDomains: H,
|
|
78
77
|
...E ? { baseBlocks: E } : {},
|
|
79
78
|
editorFonts: {
|
|
80
79
|
showDefaultStandardFonts: !0,
|
|
81
80
|
showDefaultNotStandardFonts: !0,
|
|
82
|
-
customFonts:
|
|
81
|
+
customFonts: s
|
|
83
82
|
},
|
|
84
83
|
mergeTags: [
|
|
85
84
|
{
|
|
86
|
-
entries:
|
|
85
|
+
entries: ee(
|
|
87
86
|
i.preselectedDynamicContentList,
|
|
88
|
-
|
|
87
|
+
te((_ = m.value) == null ? void 0 : _.dynamicContentList),
|
|
89
88
|
p("liquidSyntax")
|
|
90
89
|
)
|
|
91
90
|
}
|
|
@@ -101,8 +100,8 @@ const ve = (t) => {
|
|
|
101
100
|
},
|
|
102
101
|
onTemplateLoaded() {
|
|
103
102
|
try {
|
|
104
|
-
const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } =
|
|
105
|
-
v().importCss(), r(),
|
|
103
|
+
const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = N(), { injectFullStory: M } = $();
|
|
104
|
+
v().importCss(), r(), M(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
|
|
106
105
|
o.hasChanges = !1;
|
|
107
106
|
}, 1e3), t.markReady();
|
|
108
107
|
} catch (r) {
|
|
@@ -121,9 +120,9 @@ const ve = (t) => {
|
|
|
121
120
|
onDataChanged() {
|
|
122
121
|
o.hasChanges = !0, o.changeSeq += 1;
|
|
123
122
|
},
|
|
124
|
-
onEvent:
|
|
125
|
-
onModuleAdd:
|
|
126
|
-
notifications:
|
|
123
|
+
onEvent: V,
|
|
124
|
+
onModuleAdd: D,
|
|
125
|
+
notifications: L(),
|
|
127
126
|
// Stripo deselects the block on any click outside the canvas, so every surface
|
|
128
127
|
// that belongs to the block's own flow has to be listed here (SD-153273).
|
|
129
128
|
ignoreClickOutsideSelectors: [
|
|
@@ -133,23 +132,23 @@ const ve = (t) => {
|
|
|
133
132
|
".in-modal-v2-wrapper",
|
|
134
133
|
".in-toasts-wrapper"
|
|
135
134
|
],
|
|
136
|
-
extensions:
|
|
137
|
-
localePatch:
|
|
135
|
+
extensions: x,
|
|
136
|
+
localePatch: Q
|
|
138
137
|
}
|
|
139
138
|
);
|
|
140
139
|
};
|
|
141
|
-
return { initPlugin: async (n,
|
|
140
|
+
return { initPlugin: async (n, a, i, s = !1) => {
|
|
142
141
|
const e = T();
|
|
143
142
|
try {
|
|
144
143
|
t.mark("plugin_start"), t.setScriptPreloaded(F), await g(), t.mark("script_ready");
|
|
145
144
|
const [c, o] = await Promise.all([
|
|
146
145
|
R(),
|
|
147
|
-
|
|
146
|
+
U()
|
|
148
147
|
]);
|
|
149
|
-
t.mark("fonts_sync_ready"), e.syncModulesEnabled = o, await
|
|
148
|
+
t.mark("fonts_sync_ready"), e.syncModulesEnabled = o, await q(n, a, i, c, o, s);
|
|
150
149
|
} catch {
|
|
151
150
|
e.loadingStatus = !1, A({
|
|
152
|
-
type:
|
|
151
|
+
type: W.Error,
|
|
153
152
|
message: B["An error has occurred. Please report the error code to support."],
|
|
154
153
|
actionButton: {
|
|
155
154
|
text: B["Reload page"],
|
|
@@ -163,5 +162,5 @@ const ve = (t) => {
|
|
|
163
162
|
} };
|
|
164
163
|
};
|
|
165
164
|
export {
|
|
166
|
-
|
|
165
|
+
ke as useStripo
|
|
167
166
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const y = [
|
|
1
|
+
import { stripFontTags as c } from "../../utils/stripFontTags.js";
|
|
2
|
+
import { trimHrefWhitespace as l } from "../../utils/trimHrefWhitespace.js";
|
|
3
|
+
const f = [
|
|
5
4
|
{
|
|
6
5
|
id: "fix-url-encoding-start",
|
|
7
6
|
description: "Replace {%22 with %7B%22 to fix URL encoding",
|
|
@@ -60,14 +59,14 @@ const y = [
|
|
|
60
59
|
id: "strip-font-tags",
|
|
61
60
|
description: 'Unwrap browser-translate-injected <font dir="auto"> tags, keeping inner content; other <font> elements are left intact.',
|
|
62
61
|
type: "custom",
|
|
63
|
-
processor: (e) =>
|
|
62
|
+
processor: (e) => c(e),
|
|
64
63
|
priority: 15
|
|
65
64
|
},
|
|
66
65
|
{
|
|
67
66
|
id: "trim-href-whitespace",
|
|
68
67
|
description: "Trim leading/trailing whitespace and from every href value",
|
|
69
68
|
type: "custom",
|
|
70
|
-
processor: (e) =>
|
|
69
|
+
processor: (e) => l(e),
|
|
71
70
|
priority: 16
|
|
72
71
|
},
|
|
73
72
|
{
|
|
@@ -184,15 +183,6 @@ const y = [
|
|
|
184
183
|
flags: "g",
|
|
185
184
|
priority: 45
|
|
186
185
|
},
|
|
187
|
-
{
|
|
188
|
-
id: "remove-dc-pending-marker",
|
|
189
|
-
description: "Strip the editor-only pending dynamic-content choice marker from compiled output",
|
|
190
|
-
type: "regex",
|
|
191
|
-
pattern: c,
|
|
192
|
-
replacement: "",
|
|
193
|
-
flags: "g",
|
|
194
|
-
priority: 46
|
|
195
|
-
},
|
|
196
186
|
{
|
|
197
187
|
id: "remove-script-tags",
|
|
198
188
|
// SD-145051: parity with HB HtmlCleaner.removeUnsafeHtmlTags — strip <script> from
|
|
@@ -218,5 +208,5 @@ const y = [
|
|
|
218
208
|
}
|
|
219
209
|
];
|
|
220
210
|
export {
|
|
221
|
-
|
|
211
|
+
f as defaultHtmlCompilerRules
|
|
222
212
|
};
|