@useinsider/guido 3.21.2 → 3.22.0-beta.0523ffa
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 +36 -4
- package/dist/@types/config/schemas.js +41 -39
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +118 -108
- package/dist/composables/useActionsApi.js +22 -21
- package/dist/composables/useEditorOpenMetrics.js +167 -0
- package/dist/composables/useFullStoryBridge.js +10 -9
- package/dist/composables/useSave.js +75 -68
- package/dist/composables/useStripo.js +94 -82
- package/dist/composables/validators/useHtmlDocumentCountValidator.js +22 -0
- package/dist/config/migrator/fullStoryScriptMigrator.js +5 -0
- package/dist/config/migrator/index.js +11 -10
- 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/services/templateLibraryApi.js +36 -31
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useEditorOpenMetrics.d.ts +27 -0
- package/dist/src/composables/useStripo.d.ts +2 -1
- package/dist/src/composables/validators/useHtmlDocumentCountValidator.d.ts +3 -0
- package/dist/src/config/migrator/fullStoryScriptMigrator.d.ts +1 -0
- package/dist/src/library.d.ts +1 -0
- package/dist/src/public/prefetchRuntime.d.ts +1 -0
- package/dist/src/stores/config.d.ts +20 -0
- package/dist/src/utils/fullStoryScripts.d.ts +6 -0
- package/dist/src/utils/runtimePrefetch.d.ts +4 -0
- package/dist/src/utils/stripoRuntime.d.ts +3 -0
- package/dist/src/utils/templatePreparation.d.ts +2 -1
- package/dist/static/stripo-runtime-manifest.json.js +9 -0
- package/dist/utils/fullStoryScripts.js +8 -0
- package/dist/utils/pairProductVariables.js +98 -90
- package/dist/utils/runtimePrefetch.js +26 -0
- package/dist/utils/stripoRuntime.js +13 -0
- package/dist/utils/templatePreparation.js +30 -30
- package/package.json +6 -1
|
@@ -1,44 +1,54 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import { useFullStoryBridge as
|
|
6
|
-
import { useModuleRepair as
|
|
7
|
-
import { useStripoEventHandler as
|
|
8
|
-
import { useStripoNotifications as
|
|
9
|
-
import { useToaster as
|
|
10
|
-
import { localePatch as
|
|
11
|
-
import { en as
|
|
12
|
-
import { ToasterTypeOptions as
|
|
13
|
-
import { useStripoApi as
|
|
14
|
-
import
|
|
15
|
-
import { useEditorStore as
|
|
16
|
-
import { buildMergeTagEntries as
|
|
17
|
-
import
|
|
18
|
-
let
|
|
19
|
-
const
|
|
20
|
-
const { features: c, template:
|
|
21
|
-
var d;
|
|
1
|
+
import { useActionsApi as j } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as z } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as $ } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as T } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useFullStoryBridge as G } from "./useFullStoryBridge.js";
|
|
6
|
+
import { useModuleRepair as X } from "./useModuleRepair.js";
|
|
7
|
+
import { useStripoEventHandler as J } from "./useStripoEventHandler.js";
|
|
8
|
+
import { useStripoNotifications as K } from "./useStripoNotifications.js";
|
|
9
|
+
import { useToaster as Q } from "./useToaster.js";
|
|
10
|
+
import { localePatch as W } from "../config/i18n/index.js";
|
|
11
|
+
import { en as v } from "../config/i18n/en/index.js";
|
|
12
|
+
import { ToasterTypeOptions as Y } from "../enums/toaster.js";
|
|
13
|
+
import { useStripoApi as Z } from "../services/stripoApi.js";
|
|
14
|
+
import ee from "../static/styles/customEditorStyle.css.js";
|
|
15
|
+
import { useEditorStore as B } from "../stores/editor.js";
|
|
16
|
+
import { buildMergeTagEntries as te, flattenDynamicContentList as oe } from "../utils/genericUtil.js";
|
|
17
|
+
import { getStripoRuntimeBaseUrl as re } from "../utils/stripoRuntime.js";
|
|
18
|
+
let d = null, F = !1;
|
|
19
|
+
const ke = (e) => {
|
|
20
|
+
const { features: c, template: m, isFeatureEnabled: p } = $(), { handleError: f, showToaster: A } = Q(), { getToken: D, getCustomFonts: P, getSyncModulesStatus: R } = Z(), { handleEvent: U } = J(), { handleModuleAdd: V } = X(), { getStripoBlocksConfig: x } = z(), { getStripoNotifications: I } = K(), g = () => d || (d = new Promise((a, s) => {
|
|
22
21
|
if (document.getElementById("UiEditorScript")) {
|
|
23
|
-
|
|
22
|
+
a();
|
|
24
23
|
return;
|
|
25
24
|
}
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
const i = re();
|
|
26
|
+
if (!i) {
|
|
27
|
+
s(
|
|
28
|
+
new Error("guido.stripo.version is not set in package.json. Please configure the Stripo version.")
|
|
29
|
+
);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const n = `${i}UIEditor.js`, t = document.createElement("script");
|
|
33
|
+
t.id = "UiEditorScript", t.type = "module", t.src = n, t.onload = () => {
|
|
34
|
+
F = !0, a();
|
|
35
|
+
}, t.onerror = () => {
|
|
36
|
+
t.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${n}`));
|
|
37
|
+
}, document.body.appendChild(t);
|
|
38
|
+
}), d.catch(() => {
|
|
39
|
+
d = null;
|
|
40
|
+
}), d), L = async (a, s, i, n = [], t = !1) => {
|
|
41
|
+
var C, b, w, k, _;
|
|
42
|
+
const o = B(), { html: u, css: S } = a, { baseBlocks: y, extensions: q } = await x();
|
|
43
|
+
e.mark("blocks_config_ready");
|
|
44
|
+
const E = ((C = c.value) == null ? void 0 : C.displayConditions) ?? !0, O = ((b = c.value) == null ? void 0 : b.modulesDisabled) ?? !1, H = ((w = c.value) == null ? void 0 : w.buttonTextDecorationsEnabled) ?? !1, h = !!u || (((k = m.value) == null ? void 0 : k.forceRecreate) ?? !1), M = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
|
|
45
|
+
e.setTemplate({ html: u, css: S, forceRecreate: h }), T().importCss(), e.mark("init_editor"), await window.UIEditor.initEditor(
|
|
36
46
|
document.querySelector("#guido-editor"),
|
|
37
47
|
{
|
|
38
48
|
metadata: s,
|
|
39
|
-
html:
|
|
40
|
-
css:
|
|
41
|
-
forceRecreate:
|
|
49
|
+
html: u,
|
|
50
|
+
css: S,
|
|
51
|
+
forceRecreate: h,
|
|
42
52
|
locale: "en",
|
|
43
53
|
undoButtonSelector: "#guido__undo-button",
|
|
44
54
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -48,12 +58,13 @@ const he = () => {
|
|
|
48
58
|
customAppearanceMergetags: !p("liquidSyntax"),
|
|
49
59
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
50
60
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
51
|
-
customViewStyles:
|
|
52
|
-
conditionsEnabled:
|
|
53
|
-
customConditionsEnabled:
|
|
61
|
+
customViewStyles: ee,
|
|
62
|
+
conditionsEnabled: E,
|
|
63
|
+
customConditionsEnabled: E,
|
|
54
64
|
enableXSSSecurity: !0,
|
|
55
|
-
modulesDisabled:
|
|
56
|
-
|
|
65
|
+
modulesDisabled: O,
|
|
66
|
+
buttonTextDecorationsEnabled: H,
|
|
67
|
+
syncModulesEnabled: t,
|
|
57
68
|
messageSettingsEnabled: !0,
|
|
58
69
|
displayGmailAnnotations: !0,
|
|
59
70
|
displayHiddenPreheader: !1,
|
|
@@ -63,55 +74,56 @@ const he = () => {
|
|
|
63
74
|
copyPasteEnabled: !1,
|
|
64
75
|
selectElementAfterDrop: !0,
|
|
65
76
|
sameFontSizeForOutlook: !0,
|
|
66
|
-
allowedScriptSourceDomains:
|
|
67
|
-
...
|
|
77
|
+
allowedScriptSourceDomains: M,
|
|
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: te(
|
|
87
|
+
i.preselectedDynamicContentList,
|
|
88
|
+
oe((_ = m.value) == null ? void 0 : _.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 D();
|
|
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 } = j(), { injectFullStory: N } = G();
|
|
105
|
+
T().importCss(), r(), N(), 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: U,
|
|
125
|
+
onModuleAdd: V,
|
|
126
|
+
notifications: I(),
|
|
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: q,
|
|
137
|
+
localePatch: W
|
|
126
138
|
}
|
|
127
139
|
);
|
|
128
140
|
};
|
|
129
|
-
return { initPlugin: async (
|
|
130
|
-
const
|
|
141
|
+
return { initPlugin: async (a, s, i) => {
|
|
142
|
+
const n = B();
|
|
131
143
|
try {
|
|
132
|
-
await
|
|
133
|
-
const [
|
|
134
|
-
|
|
135
|
-
|
|
144
|
+
e.mark("plugin_start"), e.setScriptPreloaded(F), await g(), e.mark("script_ready");
|
|
145
|
+
const [t, o] = await Promise.all([
|
|
146
|
+
P(),
|
|
147
|
+
R()
|
|
136
148
|
]);
|
|
137
|
-
|
|
149
|
+
e.mark("fonts_sync_ready"), n.syncModulesEnabled = o, await L(a, s, i, t, o);
|
|
138
150
|
} catch {
|
|
139
|
-
|
|
140
|
-
type:
|
|
141
|
-
message:
|
|
151
|
+
n.loadingStatus = !1, A({
|
|
152
|
+
type: Y.Error,
|
|
153
|
+
message: v["An error has occurred. Please report the error code to support."],
|
|
142
154
|
actionButton: {
|
|
143
|
-
text:
|
|
155
|
+
text: v["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
|
+
ke as useStripo
|
|
155
167
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useToaster as i } from "../useToaster.js";
|
|
2
|
+
import { useTranslations as m } from "../useTranslations.js";
|
|
3
|
+
import { ToasterTypeOptions as c } from "../../enums/toaster.js";
|
|
4
|
+
const u = "newsletter.multiple-html-designs-detected", r = `(?:[^>"']|"[^"]*"|'[^']*')*`, a = "style|script|noscript|xmp|iframe|noembed|noframes|textarea|title", T = /<html(?=[\s>/])/gi, A = new RegExp(
|
|
5
|
+
`<!--[\\s\\S]*?-->|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>|<(${a})(?=[\\s/>])${r}>[\\s\\S]*?</\\1\\s*>|<([a-zA-Z][\\w:-]*)${r}>`,
|
|
6
|
+
"gi"
|
|
7
|
+
), p = (e) => Array.from(e.matchAll(A)).filter(([, , t]) => (t == null ? void 0 : t.toLowerCase()) === "html").length, g = () => {
|
|
8
|
+
const { showToaster: e } = i(), t = m();
|
|
9
|
+
return { validateSingleHtmlDocument: (o, l = !1) => {
|
|
10
|
+
var n;
|
|
11
|
+
if ((((n = o.match(T)) == null ? void 0 : n.length) ?? 0) < 2)
|
|
12
|
+
return !0;
|
|
13
|
+
const s = p(o);
|
|
14
|
+
return s <= 1 ? !0 : (console.debug("guido:save:blocked", { reason: "multiple-html-documents", htmlRootCount: s }), l || e({
|
|
15
|
+
type: c.Warning,
|
|
16
|
+
message: t(u)
|
|
17
|
+
}), !1);
|
|
18
|
+
} };
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
g as useHtmlDocumentCountValidator
|
|
22
|
+
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { migrateCheckbox as i } from "./checkboxMigrator.js";
|
|
2
2
|
import { migrateCouponBlock as e } from "./couponBlockMigrator.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { migrateFullStoryScripts as a } from "./fullStoryScriptMigrator.js";
|
|
4
|
+
import { migrateItemsBlock as n } from "./itemsBlockMigrator.js";
|
|
5
|
+
import { migrateProductNameLink as c } from "./productNameLinkMigrator.js";
|
|
6
|
+
import { migrateRadioButton as g } from "./radioButtonMigrator.js";
|
|
7
|
+
import { migrateRecommendation as p } from "./recommendationMigrator.js";
|
|
7
8
|
import { migrateRecommendationPartnerScope as f } from "./recommendationPartnerMigrator.js";
|
|
8
|
-
import { migrateRecommendationTitle as
|
|
9
|
-
import { migrateSocialIcons as
|
|
10
|
-
import { migrateUnsubscribe as
|
|
11
|
-
const h = async (
|
|
12
|
-
let m =
|
|
13
|
-
return m = i(m), m =
|
|
9
|
+
import { migrateRecommendationTitle as l } from "./recommendationTitleMigrator.js";
|
|
10
|
+
import { migrateSocialIcons as s } from "./socialIconMigrator.js";
|
|
11
|
+
import { migrateUnsubscribe as d } from "./unsubscribeMigrator.js";
|
|
12
|
+
const h = async (o, t = {}, r) => {
|
|
13
|
+
let m = o;
|
|
14
|
+
return m = i(m), m = g(m), m = await d(m), m = e(m), m = p(m, t), r && (m = f(m, r)), m = l(m), m = n(m), m = c(m), m = s(m), m = a(m), m;
|
|
14
15
|
};
|
|
15
16
|
export {
|
|
16
17
|
h as migrate
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-
|
|
1
|
+
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-f2154cb6]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-f2154cb6]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-f2154cb6]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
|
package/dist/library.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { default as a } from "./components/Guido.vue.js";
|
|
2
|
-
import { MessageType as t, ProductType as
|
|
2
|
+
import { MessageType as t, ProductType as f } from "./@types/config/schemas.js";
|
|
3
3
|
import "./@types/config/defaults.js";
|
|
4
|
-
import { getValidationErrors as
|
|
5
|
-
import { assignTrackingIds as
|
|
4
|
+
import { getValidationErrors as p, isValidConfig as s, parseConfig as m, parseConfigSafe as g, validateConfig as n } from "./@types/config/validator.js";
|
|
5
|
+
import { assignTrackingIds as l, readTrackFloor as x, readTrackSeq as c } from "./utils/linkTrackingIds.js";
|
|
6
6
|
import { useGuidoEmailEditorStore as C } from "./stores/guido-email-editor.js";
|
|
7
|
+
import { prefetchGuidoRuntime as E } from "./utils/runtimePrefetch.js";
|
|
7
8
|
export {
|
|
8
9
|
a as Guido,
|
|
9
10
|
t as MessageType,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
f as ProductType,
|
|
12
|
+
l as assignTrackingIds,
|
|
13
|
+
p as getValidationErrors,
|
|
14
|
+
s as isValidConfig,
|
|
15
|
+
m as parseConfig,
|
|
16
|
+
g as parseConfigSafe,
|
|
17
|
+
E as prefetchGuidoRuntime,
|
|
16
18
|
x as readTrackFloor,
|
|
17
|
-
|
|
19
|
+
c as readTrackSeq,
|
|
18
20
|
C as useGuidoEmailEditorStore,
|
|
19
21
|
n as validateConfig
|
|
20
22
|
};
|
package/dist/package.json.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
const o = { stripo: { version: "2.81.1" } },
|
|
2
|
-
|
|
1
|
+
const o = "3.22.0-beta.0523ffa", s = { stripo: { version: "2.81.1" } }, t = {
|
|
2
|
+
version: o,
|
|
3
|
+
guido: s
|
|
3
4
|
};
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
t as default,
|
|
7
|
+
s as guido,
|
|
8
|
+
o as version
|
|
7
9
|
};
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { useActionsApi as h } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useConfig as S } from "../composables/useConfig.js";
|
|
3
|
+
import { useHttp as v } from "../composables/useHttp.js";
|
|
4
|
+
import { useToaster as x } from "../composables/useToaster.js";
|
|
5
|
+
import { useTranslations as A } from "../composables/useTranslations.js";
|
|
6
|
+
import { useHtmlDocumentCountValidator as E } from "../composables/validators/useHtmlDocumentCountValidator.js";
|
|
7
|
+
import { useLiquidValidator as N } from "../composables/validators/useLiquidValidator.js";
|
|
8
|
+
import { EditorType as H } from "../enums/defaults.js";
|
|
9
|
+
import { ToasterTypeOptions as P } from "../enums/toaster.js";
|
|
10
|
+
import { useRecommendationExtensionStore as D } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
11
|
+
import { useSaveAsTemplateStore as L } from "../stores/save-as-template.js";
|
|
10
12
|
import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
|
|
11
|
-
import { isPlainObject as
|
|
12
|
-
import { useTemplatePreparation as
|
|
13
|
-
const
|
|
14
|
-
const { get: n, post: m } =
|
|
13
|
+
import { isPlainObject as q } from "../utils/genericUtil.js";
|
|
14
|
+
import { useTemplatePreparation as F } from "../utils/templatePreparation.js";
|
|
15
|
+
const Z = () => {
|
|
16
|
+
const { get: n, post: m } = v(), { handleError: s, showToaster: l } = x(), { config: c, isFeatureEnabled: p } = S(), { validateLiquidSyntax: T } = N(), { validateSingleHtmlDocument: w } = E(), { getTemplateData: b } = h(), u = A();
|
|
15
17
|
return {
|
|
16
18
|
getCategories: async () => {
|
|
17
19
|
try {
|
|
18
20
|
const { data: e = [] } = await n("/newsletter/template-library/get-template-categories");
|
|
19
21
|
return e;
|
|
20
22
|
} catch (e) {
|
|
21
|
-
return
|
|
23
|
+
return s(e, "Failed to fetch template categories"), [];
|
|
22
24
|
}
|
|
23
25
|
},
|
|
24
26
|
checkTemplateNameAvailability: async (e) => {
|
|
@@ -35,27 +37,30 @@ const B = () => {
|
|
|
35
37
|
);
|
|
36
38
|
return t.toString();
|
|
37
39
|
} catch (t) {
|
|
38
|
-
return
|
|
40
|
+
return s(t, "Failed to create category"), "";
|
|
39
41
|
}
|
|
40
42
|
},
|
|
41
43
|
createTemplate: async () => {
|
|
42
44
|
var e, t, d, y;
|
|
43
45
|
try {
|
|
44
|
-
const { prepareTemplateDetails: i } =
|
|
45
|
-
if (
|
|
46
|
+
const { prepareTemplateDetails: i } = F(), o = L(), g = await b();
|
|
47
|
+
if (!w(g.html))
|
|
46
48
|
return !1;
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
const a = await i(g);
|
|
50
|
+
if (p("liquidSyntax") && !await T(a.compiledHtml))
|
|
51
|
+
return !1;
|
|
52
|
+
const C = {
|
|
53
|
+
name: o.getTemplateName,
|
|
54
|
+
categories: o.getSelectedCategoryIds,
|
|
50
55
|
productId: ((t = (e = c.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
|
|
51
|
-
editorType:
|
|
56
|
+
editorType: H,
|
|
52
57
|
messageType: ((y = (d = c.value) == null ? void 0 : d.partner) == null ? void 0 : y.messageType) || 0,
|
|
53
58
|
content: r(a.compiledHtml),
|
|
54
59
|
css: r(a.css),
|
|
55
60
|
unsubscriptionPreferencePageStatus: !1,
|
|
56
61
|
unsubscriptionPreferencePages: [],
|
|
57
62
|
recommendationCampaignUrls: r(
|
|
58
|
-
|
|
63
|
+
D().recommendationCampaignUrls
|
|
59
64
|
),
|
|
60
65
|
recommendationConfigs: r({}),
|
|
61
66
|
isGuido: !0,
|
|
@@ -67,31 +72,31 @@ const B = () => {
|
|
|
67
72
|
css: a.css,
|
|
68
73
|
dynamicContentList: a.dynamicContentList
|
|
69
74
|
})
|
|
70
|
-
}, { data:
|
|
75
|
+
}, { data: f } = await m(
|
|
71
76
|
"/newsletter/template-library/create-template",
|
|
72
|
-
|
|
77
|
+
C
|
|
73
78
|
);
|
|
74
|
-
if (!
|
|
79
|
+
if (!q(f))
|
|
75
80
|
throw new Error("Unexpected create-template response");
|
|
76
|
-
return
|
|
81
|
+
return f.type === "alert" ? (l({
|
|
77
82
|
message: u(
|
|
78
83
|
"newsletter.template-library-save-alert",
|
|
79
|
-
{ templateName:
|
|
84
|
+
{ templateName: o.getTemplateName }
|
|
80
85
|
),
|
|
81
|
-
type:
|
|
86
|
+
type: P.Error
|
|
82
87
|
}), !1) : (l({
|
|
83
88
|
message: u(
|
|
84
89
|
"newsletter.template-library-save-success",
|
|
85
|
-
{ templateName:
|
|
90
|
+
{ templateName: o.getTemplateName }
|
|
86
91
|
),
|
|
87
92
|
type: "success"
|
|
88
93
|
}), !0);
|
|
89
94
|
} catch (i) {
|
|
90
|
-
return
|
|
95
|
+
return s(i, "Failed to create template"), !1;
|
|
91
96
|
}
|
|
92
97
|
}
|
|
93
98
|
};
|
|
94
99
|
};
|
|
95
100
|
export {
|
|
96
|
-
|
|
101
|
+
Z as useTemplateLibraryApi
|
|
97
102
|
};
|
|
@@ -403,6 +403,8 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
403
403
|
readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
404
404
|
/** Disable modules panel in the editor */
|
|
405
405
|
readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
406
|
+
/** Show Underline and Strikethrough in the Button block's Text Style settings */
|
|
407
|
+
readonly buttonTextDecorationsEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
406
408
|
/** Enable Liquid template syntax */
|
|
407
409
|
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
408
410
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
@@ -821,6 +823,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
821
823
|
readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
822
824
|
/** Disable modules panel in the editor */
|
|
823
825
|
readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
826
|
+
/** Show Underline and Strikethrough in the Button block's Text Style settings */
|
|
827
|
+
readonly buttonTextDecorationsEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
824
828
|
/** Enable Liquid template syntax */
|
|
825
829
|
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
826
830
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
@@ -98,6 +98,7 @@ export declare const useConfig: () => {
|
|
|
98
98
|
displayConditions: boolean;
|
|
99
99
|
unsubscribe: boolean;
|
|
100
100
|
modulesDisabled: boolean;
|
|
101
|
+
buttonTextDecorationsEnabled: boolean;
|
|
101
102
|
liquidSyntax: boolean;
|
|
102
103
|
autosave: boolean;
|
|
103
104
|
allowlistEnabled: boolean;
|
|
@@ -237,6 +238,7 @@ export declare const useConfig: () => {
|
|
|
237
238
|
displayConditions: boolean;
|
|
238
239
|
unsubscribe: boolean;
|
|
239
240
|
modulesDisabled: boolean;
|
|
241
|
+
buttonTextDecorationsEnabled: boolean;
|
|
240
242
|
liquidSyntax: boolean;
|
|
241
243
|
autosave: boolean;
|
|
242
244
|
allowlistEnabled: boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type TimedOpenPhase = 'migration' | 'default_template' | 'timer_clone';
|
|
2
|
+
declare const PHASES: readonly ["setup", "host_ready", "migration_start", "migration_end", "default_template_start", "default_template_end", "timer_clone_start", "timer_clone_end", "plugin_start", "script_ready", "fonts_sync_ready", "blocks_config_ready", "init_editor", "token_start", "token_end", "ready"];
|
|
3
|
+
export type OpenPhase = typeof PHASES[number];
|
|
4
|
+
export type OpenOutcome = 'ready' | 'error' | 'abandoned';
|
|
5
|
+
export interface OpenContext {
|
|
6
|
+
partnerName: string;
|
|
7
|
+
productType: number;
|
|
8
|
+
templateId: string;
|
|
9
|
+
variationId: string;
|
|
10
|
+
}
|
|
11
|
+
export interface OpenTemplate {
|
|
12
|
+
html: string;
|
|
13
|
+
css: string;
|
|
14
|
+
forceRecreate: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface EditorOpenMetrics {
|
|
17
|
+
mark: (phase: OpenPhase) => void;
|
|
18
|
+
timed: <T>(phase: TimedOpenPhase, task: () => Promise<T>) => Promise<T>;
|
|
19
|
+
setContext: (context: OpenContext) => void;
|
|
20
|
+
setTemplate: (template: OpenTemplate) => void;
|
|
21
|
+
setScriptPreloaded: (preloaded: boolean) => void;
|
|
22
|
+
markReady: () => void;
|
|
23
|
+
markFailed: () => void;
|
|
24
|
+
dispose: () => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const startEditorOpenMetrics: () => EditorOpenMetrics;
|
|
27
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { EditorOpenMetrics } from '@@/Composables/useEditorOpenMetrics';
|
|
1
2
|
import type { Metadata, Options, Template } from '@@/Types/stripo';
|
|
2
|
-
export declare const useStripo: () => {
|
|
3
|
+
export declare const useStripo: (openMetrics: EditorOpenMetrics) => {
|
|
3
4
|
initPlugin: (template: Template, metadata: Metadata, options: Options) => Promise<void>;
|
|
4
5
|
preloadRuntime: () => void;
|
|
5
6
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const migrateFullStoryScripts: (html: string) => string;
|
package/dist/src/library.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ export { validateConfig, parseConfig, parseConfigSafe, isValidConfig, getValidat
|
|
|
4
4
|
export { assignTrackingIds, readTrackFloor, readTrackSeq } from './public/trackingIds';
|
|
5
5
|
export { useGuidoEmailEditorStore } from './public/editorState';
|
|
6
6
|
export type { GuidoEmailEditorState } from './public/editorState';
|
|
7
|
+
export { prefetchGuidoRuntime } from './public/prefetchRuntime';
|
|
7
8
|
export type { StripoEventType } from './@types/events';
|
|
8
9
|
export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { prefetchGuidoRuntime } from '../utils/runtimePrefetch';
|