@useinsider/guido 3.12.0-beta.4e0547f → 3.12.0-beta.66af948
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 -0
- package/dist/@types/config/schemas.js +27 -25
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +101 -110
- package/dist/composables/useAllowlist.js +50 -0
- package/dist/composables/useSave.js +42 -23
- package/dist/composables/useStripo.js +69 -72
- package/dist/composables/useUserRole.js +12 -0
- package/dist/enums/roles.js +4 -0
- package/dist/guido.css +1 -1
- package/dist/services/allowlistApi.js +15 -0
- package/dist/services/stripoApi.js +18 -18
- package/dist/src/@types/config/schemas.d.ts +15 -0
- package/dist/src/components/Guido.vue.d.ts +2 -18
- package/dist/src/composables/useAllowlist.d.ts +18 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useStripo.d.ts +2 -3
- package/dist/src/composables/useUserRole.d.ts +9 -0
- package/dist/src/enums/roles.d.ts +9 -0
- package/dist/src/services/allowlistApi.d.ts +10 -0
- package/dist/src/stores/config.d.ts +19 -3
- package/dist/static/styles/components/base-input.css.js +6 -7
- package/dist/stores/config.js +19 -21
- package/package.json +1 -1
|
@@ -1,44 +1,31 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
1
|
+
import { useActionsApi as x } from "./useActionsApi.js";
|
|
2
2
|
import { useBlocksConfig as O } from "./useBlocksConfig.js";
|
|
3
3
|
import { useConfig as q } from "./useConfig.js";
|
|
4
4
|
import { useCustomInterfaceAppearance as H } from "./useCustomInterfaceAppearance.js";
|
|
5
|
-
import { useFullStoryBridge as
|
|
6
|
-
import { useModuleDynamicContentRepair as
|
|
5
|
+
import { useFullStoryBridge as L } from "./useFullStoryBridge.js";
|
|
6
|
+
import { useModuleDynamicContentRepair as N } from "./useModuleDynamicContentRepair.js";
|
|
7
7
|
import { useStripoEventHandler as z } from "./useStripoEventHandler.js";
|
|
8
8
|
import { useStripoNotifications as $ } from "./useStripoNotifications.js";
|
|
9
9
|
import { useToaster as G } from "./useToaster.js";
|
|
10
10
|
import { localePatch as J } from "../config/i18n/index.js";
|
|
11
|
-
import { en as
|
|
11
|
+
import { en as E } from "../config/i18n/en/index.js";
|
|
12
12
|
import { ToasterTypeOptions as X } from "../enums/toaster.js";
|
|
13
|
-
import { useStripoApi as
|
|
14
|
-
import
|
|
15
|
-
import { useEditorStore as
|
|
16
|
-
import { buildMergeTagEntries as
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (document.getElementById("UiEditorScript")) {
|
|
23
|
-
i();
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const o = Z.guido, r = `https://email-static.useinsider.com/guido/${(l = o == null ? void 0 : o.stripo) == null ? void 0 : l.version}/UIEditor.js`, t = document.createElement("script");
|
|
27
|
-
t.id = "UiEditorScript", t.type = "module", t.src = r, t.onload = () => i(), t.onerror = () => {
|
|
28
|
-
t.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${r}`));
|
|
29
|
-
}, document.body.appendChild(t);
|
|
30
|
-
}), n.catch(() => {
|
|
31
|
-
n = null;
|
|
32
|
-
}), n), _ = async (i, s, o, a = [], r = !1) => {
|
|
33
|
-
var y, E, h, C;
|
|
34
|
-
const t = b(), { html: l, css: D } = i, { baseBlocks: g, extensions: R } = await A(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, P = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, U = ((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1;
|
|
13
|
+
import { useStripoApi as j } from "../services/stripoApi.js";
|
|
14
|
+
import K from "../static/styles/customEditorStyle.css.js";
|
|
15
|
+
import { useEditorStore as w } from "../stores/editor.js";
|
|
16
|
+
import { buildMergeTagEntries as Q, flattenDynamicContentList as W } from "../utils/genericUtil.js";
|
|
17
|
+
import Y from "../package.json.js";
|
|
18
|
+
const he = (b, l) => {
|
|
19
|
+
const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: T, getCustomFonts: v, getSyncModulesStatus: B } = j(), { handleEvent: F } = z(), { handleModuleAdd: M } = N(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), _ = async (n, i = [], r = !1) => {
|
|
20
|
+
var S, y, h, C;
|
|
21
|
+
const e = w(), { html: f, css: a } = n, { baseBlocks: o, extensions: d } = await A(), g = ((S = c.value) == null ? void 0 : S.displayConditions) ?? !0, P = ((y = c.value) == null ? void 0 : y.modulesDisabled) ?? !1, I = ((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1;
|
|
35
22
|
await window.UIEditor.initEditor(
|
|
36
23
|
document.querySelector("#guido-editor"),
|
|
37
24
|
{
|
|
38
|
-
metadata:
|
|
39
|
-
html:
|
|
40
|
-
css:
|
|
41
|
-
forceRecreate:
|
|
25
|
+
metadata: b,
|
|
26
|
+
html: f,
|
|
27
|
+
css: a,
|
|
28
|
+
forceRecreate: I,
|
|
42
29
|
locale: "en",
|
|
43
30
|
undoButtonSelector: "#guido__undo-button",
|
|
44
31
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -48,9 +35,9 @@ const Ct = () => {
|
|
|
48
35
|
customAppearanceMergetags: !m("liquidSyntax"),
|
|
49
36
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
50
37
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
51
|
-
customViewStyles:
|
|
52
|
-
conditionsEnabled:
|
|
53
|
-
customConditionsEnabled:
|
|
38
|
+
customViewStyles: K,
|
|
39
|
+
conditionsEnabled: g,
|
|
40
|
+
customConditionsEnabled: g,
|
|
54
41
|
enableXSSSecurity: !0,
|
|
55
42
|
modulesDisabled: P,
|
|
56
43
|
syncModulesEnabled: r,
|
|
@@ -62,50 +49,50 @@ const Ct = () => {
|
|
|
62
49
|
selectElementAfterDrop: !0,
|
|
63
50
|
sameFontSizeForOutlook: !0,
|
|
64
51
|
allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
|
|
65
|
-
...
|
|
52
|
+
...o ? { baseBlocks: o } : {},
|
|
66
53
|
editorFonts: {
|
|
67
54
|
showDefaultStandardFonts: !0,
|
|
68
55
|
showDefaultNotStandardFonts: !0,
|
|
69
|
-
customFonts:
|
|
56
|
+
customFonts: i
|
|
70
57
|
},
|
|
71
58
|
mergeTags: [
|
|
72
59
|
{
|
|
73
|
-
entries:
|
|
74
|
-
|
|
75
|
-
|
|
60
|
+
entries: Q(
|
|
61
|
+
l.preselectedDynamicContentList,
|
|
62
|
+
W((C = u.value) == null ? void 0 : C.dynamicContentList),
|
|
76
63
|
m("liquidSyntax")
|
|
77
64
|
)
|
|
78
65
|
}
|
|
79
66
|
],
|
|
80
|
-
async onTokenRefreshRequest(
|
|
67
|
+
async onTokenRefreshRequest(t) {
|
|
81
68
|
try {
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
} catch (
|
|
85
|
-
p(
|
|
69
|
+
const s = await T();
|
|
70
|
+
t(s);
|
|
71
|
+
} catch (s) {
|
|
72
|
+
p(s, "Failed to refresh token");
|
|
86
73
|
}
|
|
87
74
|
},
|
|
88
75
|
onTemplateLoaded() {
|
|
89
76
|
try {
|
|
90
|
-
const { importCss:
|
|
91
|
-
|
|
92
|
-
|
|
77
|
+
const { importCss: t } = H(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: R } = x(), { injectFullStory: U } = L();
|
|
78
|
+
t(), s(), U(), R(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
79
|
+
e.hasChanges = !1;
|
|
93
80
|
}, 1e3);
|
|
94
|
-
} catch (
|
|
95
|
-
p(
|
|
81
|
+
} catch (t) {
|
|
82
|
+
p(t, "Failed to load custom interface appearance");
|
|
96
83
|
}
|
|
97
84
|
},
|
|
98
|
-
onCodeEditorVisibilityChanged(
|
|
99
|
-
|
|
85
|
+
onCodeEditorVisibilityChanged(t) {
|
|
86
|
+
e.isCodeEditorOpen = t;
|
|
100
87
|
},
|
|
101
|
-
onEditorVisualModeChanged(
|
|
102
|
-
|
|
88
|
+
onEditorVisualModeChanged(t) {
|
|
89
|
+
e.editorVisualMode = t.toLowerCase();
|
|
103
90
|
},
|
|
104
|
-
onVersionHistoryVisibilityChanged(
|
|
105
|
-
|
|
91
|
+
onVersionHistoryVisibilityChanged(t) {
|
|
92
|
+
e.isVersionHistoryOpen = t;
|
|
106
93
|
},
|
|
107
94
|
onDataChanged() {
|
|
108
|
-
|
|
95
|
+
e.hasChanges = !0;
|
|
109
96
|
},
|
|
110
97
|
onEvent: F,
|
|
111
98
|
onModuleAdd: M,
|
|
@@ -115,35 +102,45 @@ const Ct = () => {
|
|
|
115
102
|
".in-on-board-wrapper",
|
|
116
103
|
".in-drawer__container"
|
|
117
104
|
],
|
|
118
|
-
extensions:
|
|
105
|
+
extensions: d,
|
|
119
106
|
localePatch: J
|
|
120
107
|
}
|
|
121
108
|
);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
109
|
+
}, D = (n) => new Promise((i, r) => {
|
|
110
|
+
var d;
|
|
111
|
+
if (document.getElementById("UiEditorScript")) {
|
|
112
|
+
Promise.resolve(n()).then(i, r);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const e = Y.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
|
|
116
|
+
o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
|
|
117
|
+
Promise.resolve(n()).then(i, r);
|
|
118
|
+
}, o.onerror = () => {
|
|
119
|
+
r(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
120
|
+
}, document.body.appendChild(o);
|
|
121
|
+
});
|
|
122
|
+
return { initPlugin: async (n) => {
|
|
123
|
+
const i = w();
|
|
125
124
|
try {
|
|
126
|
-
await
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
125
|
+
await D(async () => {
|
|
126
|
+
const [r, e] = await Promise.all([
|
|
127
|
+
v(),
|
|
128
|
+
B()
|
|
129
|
+
]);
|
|
130
|
+
i.syncModulesEnabled = e, await _(n, r, e);
|
|
131
|
+
});
|
|
132
132
|
} catch {
|
|
133
|
-
|
|
133
|
+
i.loadingStatus = !1, k({
|
|
134
134
|
type: X.Error,
|
|
135
|
-
message:
|
|
135
|
+
message: E["An error has occurred. Please report the error code to support."],
|
|
136
136
|
actionButton: {
|
|
137
|
-
text:
|
|
137
|
+
text: E["Reload page"],
|
|
138
138
|
onClick: () => window.location.reload()
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
}, preloadRuntime: () => {
|
|
143
|
-
f().catch(() => {
|
|
144
|
-
});
|
|
145
142
|
} };
|
|
146
143
|
};
|
|
147
144
|
export {
|
|
148
|
-
|
|
145
|
+
he as useStripo
|
|
149
146
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RoleEnums as t } from "../enums/roles.js";
|
|
2
|
+
import { useAllowlistApi as s } from "../services/allowlistApi.js";
|
|
3
|
+
let e = null, l = null;
|
|
4
|
+
const c = () => {
|
|
5
|
+
const { getUserRole: n } = s();
|
|
6
|
+
return { getIsManageUser: async () => e !== null ? e : (l || (l = n().then((r) => (e = r === t.MANAGE_USERS, e)).catch((r) => (console.error("[GUIDO_ALLOWLIST] role fetch failed", r), !1)).finally(() => {
|
|
7
|
+
l = null;
|
|
8
|
+
})), l) };
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
c as useUserRole
|
|
12
|
+
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .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-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__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-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__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-6e711fd7]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-
|
|
1
|
+
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .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-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__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-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__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-6e711fd7]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{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-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}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useHttp as n } from "../composables/useHttp.js";
|
|
2
|
+
import { base64EncodeWithSpecialChars as c } from "../utils/base64.js";
|
|
3
|
+
const i = "/allowlist/check-single-item", r = "/get-user-role-and-email", u = () => {
|
|
4
|
+
const { get: t } = n();
|
|
5
|
+
return { checkDomain: async (e) => {
|
|
6
|
+
const o = encodeURIComponent(c(`https://${e}`)), { data: s } = await t(`${i}?item=${o}&type=domain`);
|
|
7
|
+
return s.type === "success";
|
|
8
|
+
}, getUserRole: async () => {
|
|
9
|
+
const { data: e } = await t(r);
|
|
10
|
+
return e == null ? void 0 : e.role;
|
|
11
|
+
} };
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
u as useAllowlistApi
|
|
15
|
+
};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { MAX_DEFAULT_TEMPLATE_ID as
|
|
4
|
-
import { useBlankTemplate as
|
|
5
|
-
const
|
|
6
|
-
|
|
1
|
+
import { useHttp as m } from "../composables/useHttp.js";
|
|
2
|
+
import { useToaster as y } from "../composables/useToaster.js";
|
|
3
|
+
import { MAX_DEFAULT_TEMPLATE_ID as f } from "../enums/defaults.js";
|
|
4
|
+
import { useBlankTemplate as g } from "./blankTemplate.js";
|
|
5
|
+
const l = () => ({
|
|
6
|
+
id: 0,
|
|
7
|
+
stripoId: 0,
|
|
8
|
+
unsubscriptionPreferencePages: []
|
|
9
|
+
}), D = () => {
|
|
10
|
+
const { get: s, post: u } = m(), { handleError: r } = y(), { getBlankTemplate: n } = g();
|
|
7
11
|
return {
|
|
8
12
|
getToken: async () => {
|
|
9
13
|
try {
|
|
@@ -26,13 +30,13 @@ const D = () => {
|
|
|
26
30
|
},
|
|
27
31
|
getDefaultTemplate: async () => {
|
|
28
32
|
try {
|
|
29
|
-
const t = new URLSearchParams(window.location.search), e = t.get("default-template"),
|
|
30
|
-
if (!i && !
|
|
31
|
-
return await
|
|
32
|
-
const
|
|
33
|
-
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? await
|
|
33
|
+
const t = new URLSearchParams(window.location.search), e = t.get("default-template"), p = t.get("master"), o = e ? parseInt(e) : 0, i = o >= 1 && o <= f ? o : 0;
|
|
34
|
+
if (!i && !p)
|
|
35
|
+
return await n();
|
|
36
|
+
const d = `/stripo/default-template/${i}`, { data: c } = await s(d), a = typeof c == "string" ? JSON.parse(c) : c;
|
|
37
|
+
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? await n() : a;
|
|
34
38
|
} catch (t) {
|
|
35
|
-
return r(t, "Failed to fetch default template"),
|
|
39
|
+
return r(t, "Failed to fetch default template"), n();
|
|
36
40
|
}
|
|
37
41
|
},
|
|
38
42
|
getSyncModulesStatus: async () => {
|
|
@@ -53,13 +57,9 @@ const D = () => {
|
|
|
53
57
|
getSyncModule: async (t) => {
|
|
54
58
|
try {
|
|
55
59
|
const { data: e } = await s(`/stripo/stripo-modules/${t}/get`);
|
|
56
|
-
return e;
|
|
60
|
+
return Array.isArray(e == null ? void 0 : e.unsubscriptionPreferencePages) ? e : l();
|
|
57
61
|
} catch (e) {
|
|
58
|
-
return r(e, "Failed to get sync module"),
|
|
59
|
-
id: 0,
|
|
60
|
-
stripoId: 0,
|
|
61
|
-
unsubscriptionPreferencePages: []
|
|
62
|
-
};
|
|
62
|
+
return r(e, "Failed to get sync module"), l();
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
setSyncModuleUnsubscriptionPages: async (t) => {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { DynamicContentNode } from '../generic';
|
|
9
9
|
import type { SavedTemplateDetails } from '../stripo';
|
|
10
|
+
import type { ActionButton } from '../toaster';
|
|
10
11
|
import * as v from 'valibot';
|
|
11
12
|
/**
|
|
12
13
|
* Handler function for external validation before save
|
|
@@ -14,6 +15,16 @@ import * as v from 'valibot';
|
|
|
14
15
|
* @returns Promise<boolean> - true if valid, false to cancel save
|
|
15
16
|
*/
|
|
16
17
|
export type ExternalValidationHandler = (data: Omit<SavedTemplateDetails, 'metadata'>) => Promise<boolean>;
|
|
18
|
+
/**
|
|
19
|
+
* Content for the domain-allowlist block toaster. Guido self-serves this (see
|
|
20
|
+
* useAllowlist): it resolves the user role via /get-user-role-and-email, builds the
|
|
21
|
+
* settings deep-link, and pulls copy from window.trans. `actionButton.onClick` runs the
|
|
22
|
+
* action (e.g. the "Add to allowlist" deep-link).
|
|
23
|
+
*/
|
|
24
|
+
export interface AllowlistToastContent {
|
|
25
|
+
message: string;
|
|
26
|
+
actionButton?: ActionButton;
|
|
27
|
+
}
|
|
17
28
|
/**
|
|
18
29
|
* Message type constants for email templates
|
|
19
30
|
*/
|
|
@@ -377,6 +388,8 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
377
388
|
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
378
389
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
379
390
|
readonly autosave: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
391
|
+
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
392
|
+
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
380
393
|
}, undefined>;
|
|
381
394
|
/**
|
|
382
395
|
* Default block types available in Stripo
|
|
@@ -764,6 +777,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
764
777
|
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
765
778
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
766
779
|
readonly autosave: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
780
|
+
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
781
|
+
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
767
782
|
}, undefined>, {}>;
|
|
768
783
|
/** Block configuration */
|
|
769
784
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -4,12 +4,8 @@ import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
|
4
4
|
type __VLS_Props = {
|
|
5
5
|
/** Guido configuration object */
|
|
6
6
|
config: GuidoConfigInput;
|
|
7
|
-
/** Host data readiness. Runtime still preloads on mount; only config init waits. Defaults true for v-if-gated call sites. */
|
|
8
|
-
ready?: boolean;
|
|
9
7
|
};
|
|
10
|
-
declare const _default: import("vue").DefineComponent<
|
|
11
|
-
ready: boolean;
|
|
12
|
-
}>, {
|
|
8
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
13
9
|
dynamicContent: {
|
|
14
10
|
insert: (data: DynamicContent) => void;
|
|
15
11
|
close: () => void;
|
|
@@ -34,17 +30,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
34
30
|
ready: () => void;
|
|
35
31
|
"onboarding:finished": () => void;
|
|
36
32
|
"test-email:click": () => void;
|
|
37
|
-
}, string, Readonly<import("vue").ExtractPropTypes<
|
|
38
|
-
ready: boolean;
|
|
39
|
-
}>>>, {
|
|
40
|
-
ready: boolean;
|
|
41
|
-
}>;
|
|
33
|
+
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
42
34
|
export default _default;
|
|
43
|
-
type __VLS_WithDefaults<P, D> = {
|
|
44
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
45
|
-
default: D[K];
|
|
46
|
-
}> : P[K];
|
|
47
|
-
};
|
|
48
35
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
49
36
|
type __VLS_TypePropsToOption<T> = {
|
|
50
37
|
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
@@ -54,6 +41,3 @@ type __VLS_TypePropsToOption<T> = {
|
|
|
54
41
|
required: true;
|
|
55
42
|
};
|
|
56
43
|
};
|
|
57
|
-
type __VLS_PrettifyLocal<T> = {
|
|
58
|
-
[K in keyof T]: T[K];
|
|
59
|
-
} & {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AllowlistToastContent } from '@@/Types/config/schemas';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the "Add to allowlist" InOne Settings deep-link (Security tab, add-domain modal
|
|
4
|
+
* prefilled). The route is identical across InOne products, so Guido builds it generically.
|
|
5
|
+
* @param value - domain(s) to prefill; base64-encoded into the `values` query param.
|
|
6
|
+
*/
|
|
7
|
+
export declare const buildAllowlistSettingsUrl: (value: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Domain-allowlist feature composable. Extracts every external domain from the compiled
|
|
10
|
+
* HTML/CSS and asks the backend (via allowlistApi) whether each is allowlisted, so an
|
|
11
|
+
* un-allowlisted link can block the save BEFORE anything is persisted; and builds the
|
|
12
|
+
* role-gated block-toaster content Guido renders. Gated by `features.allowlistEnabled` in
|
|
13
|
+
* useSave — consumers only flip the flag. SD-143197.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useAllowlist: () => {
|
|
16
|
+
getBlockedDomains: (html: string, css: string) => Promise<string[]>;
|
|
17
|
+
resolveToast: (blockedDomains: string[]) => Promise<AllowlistToastContent>;
|
|
18
|
+
};
|
|
@@ -96,6 +96,7 @@ export declare const useConfig: () => {
|
|
|
96
96
|
modulesDisabled: boolean;
|
|
97
97
|
liquidSyntax: boolean;
|
|
98
98
|
autosave: boolean;
|
|
99
|
+
allowlistEnabled: boolean;
|
|
99
100
|
};
|
|
100
101
|
blocks: {
|
|
101
102
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -227,6 +228,7 @@ export declare const useConfig: () => {
|
|
|
227
228
|
modulesDisabled: boolean;
|
|
228
229
|
liquidSyntax: boolean;
|
|
229
230
|
autosave: boolean;
|
|
231
|
+
allowlistEnabled: boolean;
|
|
230
232
|
} | null>;
|
|
231
233
|
blocks: import("vue").ComputedRef<{
|
|
232
234
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Metadata, Options, Template } from '@@/Types/stripo';
|
|
2
|
-
export declare const useStripo: () => {
|
|
3
|
-
initPlugin: (template: Template
|
|
4
|
-
preloadRuntime: () => void;
|
|
2
|
+
export declare const useStripo: (metadata: Metadata, options: Options) => {
|
|
3
|
+
initPlugin: (template: Template) => Promise<void>;
|
|
5
4
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves whether the current user may manage the partner's domain allowlist, via the shared
|
|
3
|
+
* InOne endpoint GET /get-user-role-and-email (allowlistApi.getUserRole). Fail-open: on any
|
|
4
|
+
* error the user is treated as non-manage (message-only toaster, no "Add to allowlist" deep-link
|
|
5
|
+
* they may not be able to use).
|
|
6
|
+
*/
|
|
7
|
+
export declare const useUserRole: () => {
|
|
8
|
+
getIsManageUser: () => Promise<boolean>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Insider user-role aliases — the kebab-case wire values returned by
|
|
3
|
+
* GET /get-user-role-and-email (the same set honey-badger's RoleEnums defines).
|
|
4
|
+
* Only the manage-user role is needed in Guido: it gates the "Add to allowlist"
|
|
5
|
+
* action in the domain-allowlist block toaster. SD-143197.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum RoleEnums {
|
|
8
|
+
MANAGE_USERS = "manage-users"
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backend calls behind the domain-allowlist feature. Thin transport layer: it owns the
|
|
3
|
+
* endpoints, encoding, and response shape, and lets callers (useAllowlist / useUserRole) apply
|
|
4
|
+
* the caching + fail-open policy — mirroring how validators/saveAsTemplate delegates its check
|
|
5
|
+
* to templateLibraryApi.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useAllowlistApi: () => {
|
|
8
|
+
checkDomain: (domain: string) => Promise<boolean>;
|
|
9
|
+
getUserRole: () => Promise<string | undefined>;
|
|
10
|
+
};
|