@useinsider/guido 3.19.0-beta.dcea8c0 → 3.19.0-beta.f66e9de
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/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +31 -30
- package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
- package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
- package/dist/composables/useAuthError.js +54 -0
- package/dist/composables/useHttp.js +54 -44
- package/dist/composables/useLegacyStrategyConversion.js +19 -23
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +0 -1
- package/dist/guido.css +1 -1
- package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useAuthError.d.ts +13 -0
- package/package.json +2 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import o from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import t from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var i = function() {
|
|
5
5
|
var a = this, r = a._self._c, e = a._self._setupProxy;
|
|
6
|
-
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
|
|
6
|
+
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.AuthErrorModal), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
|
-
}, s = [], n = /* @__PURE__ */
|
|
9
|
+
}, s = [], n = /* @__PURE__ */ t(
|
|
10
10
|
o,
|
|
11
|
-
|
|
11
|
+
i,
|
|
12
12
|
s,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"080ff767"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const f = n.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
f as default
|
|
20
20
|
};
|
|
@@ -9,23 +9,24 @@ import { useTimerClone as pe } from "../composables/useTimerClone.js";
|
|
|
9
9
|
import { migrate as W } from "../config/migrator/index.js";
|
|
10
10
|
import { ModuleFolderDefaults as G } from "../enums/defaults.js";
|
|
11
11
|
import { RIBBON_SELECTOR as fe } from "../enums/onboarding.js";
|
|
12
|
-
import { useRecommendationExtensionStore as
|
|
12
|
+
import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
13
13
|
import ye from "./organisms/AutoSaveController.vue.js";
|
|
14
|
-
import ge from "./organisms/base/
|
|
15
|
-
import ve from "./organisms/
|
|
16
|
-
import Se from "./organisms/
|
|
14
|
+
import ge from "./organisms/base/AuthErrorModal.vue.js";
|
|
15
|
+
import ve from "./organisms/base/Toaster.vue.js";
|
|
16
|
+
import Se from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
17
|
+
import he from "./organisms/header/HeaderWrapper.vue.js";
|
|
17
18
|
import be from "./organisms/LoadingWrapper.vue.js";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { useStripoApi as
|
|
21
|
-
import { useConfigStore as
|
|
22
|
-
import { useDynamicContentStore as
|
|
19
|
+
import Ee from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
20
|
+
import we from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
21
|
+
import { useStripoApi as Ce } from "../services/stripoApi.js";
|
|
22
|
+
import { useConfigStore as De } from "../stores/config.js";
|
|
23
|
+
import { useDynamicContentStore as ke } from "../stores/dynamic-content.js";
|
|
23
24
|
import { useEditorStore as H } from "../stores/editor.js";
|
|
24
|
-
import { usePreviewStore as
|
|
25
|
+
import { usePreviewStore as Me } from "../stores/preview.js";
|
|
25
26
|
import { useTemplateStore as Te } from "../stores/template.js";
|
|
26
27
|
import { useUnsubscribeStore as Fe } from "../stores/unsubscribe.js";
|
|
27
28
|
import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
|
|
28
|
-
const
|
|
29
|
+
const nt = /* @__PURE__ */ re({
|
|
29
30
|
__name: "Guido",
|
|
30
31
|
props: {
|
|
31
32
|
config: null,
|
|
@@ -43,9 +44,9 @@ const tt = /* @__PURE__ */ re({
|
|
|
43
44
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
44
45
|
), Q = m(
|
|
45
46
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
46
|
-
), E = O(), p = O(), f =
|
|
47
|
+
), E = O(), p = O(), f = ke(), w = Fe(), o = De();
|
|
47
48
|
a.ready && o.init(a.config);
|
|
48
|
-
const c = H(), X =
|
|
49
|
+
const c = H(), X = Me(), l = u(() => c.hasChanges), { isTestPartner: Y } = le(), C = () => {
|
|
49
50
|
var t;
|
|
50
51
|
return (t = E.value) == null ? void 0 : t.handleSave(!0);
|
|
51
52
|
}, D = (t) => {
|
|
@@ -62,13 +63,13 @@ const tt = /* @__PURE__ */ re({
|
|
|
62
63
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
|
|
63
64
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
|
|
64
65
|
};
|
|
65
|
-
}, { initPlugin: k, preloadRuntime:
|
|
66
|
+
}, { initPlugin: k, preloadRuntime: M } = ue(), { runExclusive: T, beginMount: F, isCurrentMount: R } = ce();
|
|
66
67
|
let g = 0;
|
|
67
|
-
const { getDefaultTemplate: I } =
|
|
68
|
+
const { getDefaultTemplate: I } = Ce(), { cloneTimersOnSave: L, hasTimerBlocks: A } = pe(), Z = u(() => {
|
|
68
69
|
var t;
|
|
69
70
|
return !((t = o.ui) != null && t.showHeader);
|
|
70
71
|
}), ee = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), te = u(
|
|
71
|
-
() => !!
|
|
72
|
+
() => !!b().recommendationConfigs.strategyId
|
|
72
73
|
);
|
|
73
74
|
de({
|
|
74
75
|
onBack: () => {
|
|
@@ -85,9 +86,9 @@ const tt = /* @__PURE__ */ re({
|
|
|
85
86
|
console.debug("guido:test-email:click"), r("test-email:click");
|
|
86
87
|
}
|
|
87
88
|
});
|
|
88
|
-
const
|
|
89
|
+
const B = (t) => {
|
|
89
90
|
console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
90
|
-
},
|
|
91
|
+
}, U = () => {
|
|
91
92
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
92
93
|
};
|
|
93
94
|
x(() => l.value, () => {
|
|
@@ -102,7 +103,7 @@ const tt = /* @__PURE__ */ re({
|
|
|
102
103
|
var e;
|
|
103
104
|
const t = document.querySelector(fe);
|
|
104
105
|
(e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
105
|
-
},
|
|
106
|
+
}, h = async () => {
|
|
106
107
|
var t;
|
|
107
108
|
try {
|
|
108
109
|
o.initialized || o.init(a.config), c.templateId = o.templateId;
|
|
@@ -115,32 +116,32 @@ const tt = /* @__PURE__ */ re({
|
|
|
115
116
|
};
|
|
116
117
|
n.html || (n = await I(), n.html = await W(n.html, _));
|
|
117
118
|
const oe = N ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
118
|
-
|
|
119
|
+
A(n.html) && (n.html = await L(n.html)), N && (c.trackIdSessionFloor = Math.max(oe, $(n.html)));
|
|
119
120
|
const ne = {
|
|
120
121
|
preselectedDynamicContentList: P,
|
|
121
122
|
onReady: () => {
|
|
122
123
|
console.debug("guido:ready"), r("ready");
|
|
123
124
|
}
|
|
124
125
|
};
|
|
125
|
-
g =
|
|
126
|
+
g = F(), await k(n, y(), ne), f.selectedDynamicContentList = P;
|
|
126
127
|
} catch (e) {
|
|
127
128
|
console.error("Failed to initialize Stripo editor:", e);
|
|
128
129
|
}
|
|
129
130
|
};
|
|
130
131
|
return se(async () => {
|
|
131
132
|
var e;
|
|
132
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
133
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), b().$reset(), H().$reset(), Te().$reset(), S();
|
|
133
134
|
const t = (e = p.value) == null ? void 0 : e.parentElement;
|
|
134
|
-
if (t && (i = new ResizeObserver(S), i.observe(t)),
|
|
135
|
-
await
|
|
135
|
+
if (t && (i = new ResizeObserver(S), i.observe(t)), M(), a.ready)
|
|
136
|
+
await h();
|
|
136
137
|
else {
|
|
137
138
|
const s = x(() => a.ready, (d) => {
|
|
138
|
-
d && (s(),
|
|
139
|
+
d && (s(), h());
|
|
139
140
|
});
|
|
140
141
|
}
|
|
141
142
|
document.addEventListener("dynamic-content:open", v);
|
|
142
143
|
}), ae(() => {
|
|
143
|
-
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v),
|
|
144
|
+
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), b().disposeStrategyPageReturn(), T(async () => {
|
|
144
145
|
if (R(g))
|
|
145
146
|
try {
|
|
146
147
|
window.UIEditor.removeEditor();
|
|
@@ -150,15 +151,15 @@ const tt = /* @__PURE__ */ re({
|
|
|
150
151
|
}), o.reset();
|
|
151
152
|
}), q({
|
|
152
153
|
dynamicContent: {
|
|
153
|
-
insert:
|
|
154
|
-
close:
|
|
154
|
+
insert: B,
|
|
155
|
+
close: U
|
|
155
156
|
},
|
|
156
157
|
hasChanges: l,
|
|
157
158
|
saveSilent: C,
|
|
158
159
|
setLoading: D
|
|
159
|
-
}), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, LegacyStrategyUpdatedModal: Q, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: a, configStore: o, editorStore: c, previewStore: X, hasChanges: l, isTestPartner: Y, saveSilent: C, setLoading: D, emit: r, buildMetadata: y, initPlugin: k, preloadRuntime:
|
|
160
|
+
}), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, LegacyStrategyUpdatedModal: Q, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: a, configStore: o, editorStore: c, previewStore: X, hasChanges: l, isTestPartner: Y, saveSilent: C, setLoading: D, emit: r, buildMetadata: y, initPlugin: k, preloadRuntime: M, runExclusive: T, beginMount: F, isCurrentMount: R, mountGeneration: g, getDefaultTemplate: I, cloneTimersOnSave: L, hasTimerBlocks: A, noHeader: Z, isRrsEnabled: ee, hasAssignedStrategy: te, insertDynamicContent: B, closeDynamicContent: U, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: S, startEditor: h, AutoSaveController: ye, AuthErrorModal: ge, Toaster: ve, FilterSelectionDrawer: Se, HeaderWrapper: he, LoadingWrapper: be, SaveAsTemplateDrawer: Ee, UnsubscribeWrapper: we };
|
|
160
161
|
}
|
|
161
162
|
});
|
|
162
163
|
export {
|
|
163
|
-
|
|
164
|
+
nt as default
|
|
164
165
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import e from "./AuthErrorModal.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var a = function() {
|
|
5
|
+
var t = this, r = t._self._c, o = t._self._setupProxy;
|
|
6
|
+
return o.authError ? r("div", { staticClass: "auth-error-modal" }, [r(o.WpModal, { attrs: { id: "guido__auth-error-modal", "close-button-status": !1, "close-on-outside-click": !1, "footer-button-options": o.footerButtonOptions, title: o.title }, on: { close: o.dismiss, "primary-action": o.recover } }, [r("p", [t._v(t._s(o.message))])])], 1) : t._e();
|
|
7
|
+
}, n = [], i = /* @__PURE__ */ s(
|
|
8
|
+
e,
|
|
9
|
+
a,
|
|
10
|
+
n,
|
|
11
|
+
!1,
|
|
12
|
+
null,
|
|
13
|
+
"a6429465"
|
|
14
|
+
);
|
|
15
|
+
const m = i.exports;
|
|
16
|
+
export {
|
|
17
|
+
m as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineComponent as c, computed as o } from "vue";
|
|
2
|
+
import p from "../../wrappers/WpModal.vue.js";
|
|
3
|
+
import { useAuthError as d, releaseAuthFreeze as m } from "../../../composables/useAuthError.js";
|
|
4
|
+
import { useTranslations as f } from "../../../composables/useTranslations.js";
|
|
5
|
+
const x = /* @__PURE__ */ c({
|
|
6
|
+
__name: "AuthErrorModal",
|
|
7
|
+
setup(v) {
|
|
8
|
+
const e = f(), { authError: s } = d(), r = o(() => {
|
|
9
|
+
var t;
|
|
10
|
+
return ((t = s.value) == null ? void 0 : t.status) === 419 && !!s.value.data;
|
|
11
|
+
}), n = o(() => {
|
|
12
|
+
var t;
|
|
13
|
+
return ((t = s.value) == null ? void 0 : t.status) === 419 && !r.value;
|
|
14
|
+
}), i = o(() => r.value ? e("settings.warning") : e("action-builder.session-expired")), u = o(() => r.value ? e("auth.error-occurred-refresh") : n.value ? e("settings.session-on-another-device") : e("journey-builder.login-session-expired")), l = o(() => ({
|
|
15
|
+
primaryButton: {
|
|
16
|
+
type: "primary",
|
|
17
|
+
labelText: r.value ? e("journey-builder.refresh-page") : e("journey-builder.login-popup-button")
|
|
18
|
+
},
|
|
19
|
+
cancelOrBackButton: {
|
|
20
|
+
type: "secondary",
|
|
21
|
+
styling: "ghost",
|
|
22
|
+
labelText: e("settings.cancel")
|
|
23
|
+
}
|
|
24
|
+
})), a = () => {
|
|
25
|
+
if (r.value) {
|
|
26
|
+
window.location.reload();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
window.location.replace("/login");
|
|
30
|
+
};
|
|
31
|
+
return { __sfc: !0, trans: e, authError: s, isPageExpired: r, isTakenOver: n, title: i, message: u, footerButtonOptions: l, recover: a, dismiss: () => {
|
|
32
|
+
if (r.value) {
|
|
33
|
+
m();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
a();
|
|
37
|
+
}, WpModal: p };
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
x as default
|
|
42
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ToasterTypeOptions as u } from "../enums/toaster.js";
|
|
2
|
+
import { ref as f } from "vue";
|
|
3
|
+
import { useToaster as p } from "./useToaster.js";
|
|
4
|
+
import { useTranslations as d } from "./useTranslations.js";
|
|
5
|
+
const a = ["accessExpired", "domainRestricted", "ipRestricted", "insiderAccessRestricted"], n = f(null);
|
|
6
|
+
let t = !1;
|
|
7
|
+
const w = (e) => {
|
|
8
|
+
try {
|
|
9
|
+
return new URL(e, window.location.href).origin === window.location.origin;
|
|
10
|
+
} catch {
|
|
11
|
+
return !0;
|
|
12
|
+
}
|
|
13
|
+
}, g = (e) => {
|
|
14
|
+
try {
|
|
15
|
+
const o = new URL(e, window.location.href);
|
|
16
|
+
return o.origin === window.location.origin ? o.href : "";
|
|
17
|
+
} catch {
|
|
18
|
+
return "";
|
|
19
|
+
}
|
|
20
|
+
}, y = (e) => {
|
|
21
|
+
try {
|
|
22
|
+
const o = JSON.parse(e);
|
|
23
|
+
return o && typeof o == "object" && Object.keys(o).length ? o : null;
|
|
24
|
+
} catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}, h = (e) => typeof (e == null ? void 0 : e.message) == "string" ? e.message : "", c = (e) => h(e) || d()("user-management.collaborate-forbidden-action"), l = (e) => {
|
|
28
|
+
p().showToaster({ type: u.Error, message: e });
|
|
29
|
+
}, m = () => {
|
|
30
|
+
n.value = null, t && (window.isSessionExpired = !1, t = !1);
|
|
31
|
+
}, A = (e, o, i) => {
|
|
32
|
+
if (i && !w(i))
|
|
33
|
+
return;
|
|
34
|
+
const r = y(o);
|
|
35
|
+
if (e === 403) {
|
|
36
|
+
l(c(r));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (e === 401 && (r == null ? void 0 : r.type) === "groupLevelAccess") {
|
|
40
|
+
l(c(r));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (e === 401 && typeof (r == null ? void 0 : r.type) == "string" && a.includes(r.type)) {
|
|
44
|
+
const s = typeof r.redirect == "string" ? g(r.redirect) : "";
|
|
45
|
+
s && window.location.replace(s);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
e !== 401 && e !== 419 || n.value || (t = t || !window.isSessionExpired, window.isSessionExpired = !0, n.value = { status: e, data: r });
|
|
49
|
+
}, O = () => ({ authError: n, releaseAuthFreeze: m });
|
|
50
|
+
export {
|
|
51
|
+
m as releaseAuthFreeze,
|
|
52
|
+
A as reportAuthError,
|
|
53
|
+
O as useAuthError
|
|
54
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getCsrfToken as O } from "../utils/genericUtil.js";
|
|
2
|
-
import { ref as m, computed as
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { ref as m, computed as w } from "vue";
|
|
3
|
+
import { reportAuthError as j } from "./useAuthError.js";
|
|
4
|
+
const M = (g = {}) => {
|
|
5
|
+
const h = m(!1), n = m(null), u = m(null), b = w(() => h.value), y = w(() => n.value !== null), v = {
|
|
5
6
|
baseURL: "",
|
|
6
7
|
timeout: 1e4,
|
|
7
8
|
retry: 0,
|
|
@@ -10,79 +11,88 @@ const X = (b = {}) => {
|
|
|
10
11
|
"Content-Type": "application/json",
|
|
11
12
|
"X-CSRF-TOKEN": O(),
|
|
12
13
|
Accept: "application/json",
|
|
14
|
+
// The panel backend only answers 401/419 to ajax requests; without this a guest
|
|
15
|
+
// fetch gets a 302 to the login page and never sees an auth status.
|
|
13
16
|
"X-Requested-With": "XMLHttpRequest"
|
|
14
17
|
},
|
|
15
|
-
...
|
|
16
|
-
},
|
|
18
|
+
...g
|
|
19
|
+
}, x = (e, r) => {
|
|
17
20
|
if (e.startsWith("http://") || e.startsWith("https://"))
|
|
18
21
|
return e;
|
|
19
|
-
const t =
|
|
22
|
+
const t = r || v.baseURL || "";
|
|
20
23
|
return t.endsWith("/") && e.startsWith("/") ? `${t}${e.slice(1)}` : t.endsWith("/") || e.startsWith("/") ? `${t}${e}` : `${t}/${e}`;
|
|
21
|
-
}, P = (e) => new Promise((
|
|
24
|
+
}, P = (e) => new Promise((r, t) => {
|
|
22
25
|
setTimeout(() => {
|
|
23
26
|
t(new Error("Request timeout"));
|
|
24
27
|
}, e);
|
|
25
|
-
}),
|
|
26
|
-
setTimeout(
|
|
27
|
-
}), i = async (e,
|
|
28
|
-
|
|
29
|
-
const
|
|
28
|
+
}), R = (e) => new Promise((r) => {
|
|
29
|
+
setTimeout(r, e);
|
|
30
|
+
}), i = async (e, r, t, W = {}) => {
|
|
31
|
+
n.value = null, h.value = !0, u.value = new AbortController();
|
|
32
|
+
const a = { ...v, ...W }, E = x(r, a.baseURL), c = {
|
|
30
33
|
method: e,
|
|
31
|
-
headers: { ...
|
|
34
|
+
headers: { ...a.headers },
|
|
32
35
|
signal: u.value.signal,
|
|
33
|
-
...
|
|
36
|
+
...a
|
|
34
37
|
};
|
|
35
38
|
t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete c.headers["Content-Type"], c.body = t) : c.body = JSON.stringify(t));
|
|
36
|
-
const
|
|
39
|
+
const T = async (p = 0) => {
|
|
40
|
+
if (window.isSessionExpired)
|
|
41
|
+
throw n.value = { message: "Session expired" }, new Error("Session expired");
|
|
37
42
|
try {
|
|
38
|
-
const o = [fetch(
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
42
|
-
const
|
|
43
|
-
throw d.status =
|
|
43
|
+
const o = [fetch(E, c)];
|
|
44
|
+
a.timeout && o.push(P(a.timeout));
|
|
45
|
+
const s = await Promise.race(o);
|
|
46
|
+
if (!s.ok) {
|
|
47
|
+
const D = `HTTP Error: ${s.status} ${s.statusText}`, d = new Error(D);
|
|
48
|
+
throw d.status = s.status, d.statusText = s.statusText, d.response = s, [401, 403, 419].includes(s.status) && Promise.resolve().then(() => s.clone().text().catch(() => "")).then((H) => j(
|
|
49
|
+
s.status,
|
|
50
|
+
H,
|
|
51
|
+
new URL(E, window.location.href).href
|
|
52
|
+
)).catch(() => {
|
|
53
|
+
}), d;
|
|
44
54
|
}
|
|
45
55
|
let f;
|
|
46
|
-
const l =
|
|
47
|
-
return l != null && l.includes("application/json") ? f = await
|
|
56
|
+
const l = s.headers.get("content-type");
|
|
57
|
+
return l != null && l.includes("application/json") ? f = await s.json() : l != null && l.includes("text/") ? f = await s.text() : f = await s.blob(), {
|
|
48
58
|
data: f,
|
|
49
|
-
status:
|
|
50
|
-
statusText:
|
|
51
|
-
headers:
|
|
59
|
+
status: s.status,
|
|
60
|
+
statusText: s.statusText,
|
|
61
|
+
headers: s.headers
|
|
52
62
|
};
|
|
53
63
|
} catch (o) {
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
return await
|
|
57
|
-
throw o instanceof Error ? o.name === "AbortError" ?
|
|
64
|
+
const s = o instanceof Error && o.name === "AbortError";
|
|
65
|
+
if (p < (a.retry || 0) && !s)
|
|
66
|
+
return await R(a.retryDelay || 1e3), T(p + 1);
|
|
67
|
+
throw o instanceof Error ? o.name === "AbortError" ? n.value = { message: "Request was cancelled" } : n.value = { message: o.message } : n.value = o, o;
|
|
58
68
|
}
|
|
59
69
|
};
|
|
60
70
|
try {
|
|
61
|
-
return await
|
|
71
|
+
return await T();
|
|
62
72
|
} finally {
|
|
63
|
-
|
|
73
|
+
h.value = !1, u.value = null;
|
|
64
74
|
}
|
|
65
|
-
}, C = (e,
|
|
75
|
+
}, C = (e, r) => i("GET", e, void 0, r), A = (e, r, t) => i("POST", e, r, t), U = (e, r, t) => i("PUT", e, r, t), $ = (e, r, t) => i("PATCH", e, r, t), q = (e, r) => i("DELETE", e, void 0, r), L = (e) => {
|
|
66
76
|
u.value && u.value.abort(e);
|
|
67
|
-
},
|
|
68
|
-
|
|
77
|
+
}, S = () => {
|
|
78
|
+
n.value = null;
|
|
69
79
|
};
|
|
70
80
|
return {
|
|
71
81
|
// State
|
|
72
|
-
loading:
|
|
73
|
-
error:
|
|
82
|
+
loading: b,
|
|
83
|
+
error: w(() => n.value),
|
|
74
84
|
hasError: y,
|
|
75
85
|
// Methods
|
|
76
86
|
request: i,
|
|
77
87
|
get: C,
|
|
78
|
-
post:
|
|
79
|
-
put:
|
|
80
|
-
patch:
|
|
81
|
-
delete:
|
|
82
|
-
cancel:
|
|
83
|
-
clearError:
|
|
88
|
+
post: A,
|
|
89
|
+
put: U,
|
|
90
|
+
patch: $,
|
|
91
|
+
delete: q,
|
|
92
|
+
cancel: L,
|
|
93
|
+
clearError: S
|
|
84
94
|
};
|
|
85
95
|
};
|
|
86
96
|
export {
|
|
87
|
-
|
|
97
|
+
M as useHttp
|
|
88
98
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { useRecommendation as
|
|
2
|
-
import { useToaster as
|
|
1
|
+
import { useRecommendation as I } from "./useRecommendation.js";
|
|
2
|
+
import { useToaster as C } from "./useToaster.js";
|
|
3
3
|
import { useTranslations as v } from "./useTranslations.js";
|
|
4
4
|
import { ToasterTypeOptions as g } from "../enums/toaster.js";
|
|
5
5
|
import "../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
6
6
|
import { CURRENT_CONFIG_VERSION as L } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
7
7
|
import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
8
|
-
import { resolveMigrationTarget as
|
|
9
|
-
import { commitBlockChangeOutsidePanel as
|
|
10
|
-
import { useConfigStore as
|
|
8
|
+
import { resolveMigrationTarget as R, buildLegacyMigrationPayload as T } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js";
|
|
9
|
+
import { commitBlockChangeOutsidePanel as h } from "../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
|
|
10
|
+
import { useConfigStore as k } from "../stores/config.js";
|
|
11
11
|
const F = () => {
|
|
12
|
-
const e = b(), r =
|
|
12
|
+
const e = b(), r = k(), { buildCampaignUrl: m } = I(), { showToaster: i } = C(), c = v();
|
|
13
13
|
return { convertLegacyStrategy: async () => {
|
|
14
14
|
const t = e.currentRecommendationId;
|
|
15
15
|
if (t === null || !e.isLegacyStrategyBlock || e.legacyConversionLoading)
|
|
16
16
|
return "";
|
|
17
|
-
const { strategy: d, productIds: y, size: l, strategyId: p, nodeConfigVersion: u } = e.recommendationConfigs, f = { strategyId: p, size: l, nodeConfigVersion: u }, s =
|
|
17
|
+
const { strategy: d, productIds: y, size: l, strategyId: p, nodeConfigVersion: u } = e.recommendationConfigs, f = { strategyId: p, size: l, nodeConfigVersion: u }, s = R({
|
|
18
18
|
campaignId: r.campaignId,
|
|
19
19
|
templateLibraryId: r.templateLibraryId
|
|
20
|
-
}), S =
|
|
20
|
+
}), S = T({
|
|
21
21
|
blockId: t,
|
|
22
22
|
url: m(String(t)),
|
|
23
23
|
campaignId: r.campaignId,
|
|
@@ -29,34 +29,30 @@ const F = () => {
|
|
|
29
29
|
let o;
|
|
30
30
|
try {
|
|
31
31
|
o = await e.convertLegacyStrategy(S, s);
|
|
32
|
-
} catch (
|
|
33
|
-
return console.error("[useLegacyStrategyConversion] migration failed",
|
|
32
|
+
} catch (n) {
|
|
33
|
+
return console.error("[useLegacyStrategyConversion] migration failed", n), i({
|
|
34
34
|
type: g.Error,
|
|
35
|
-
message:
|
|
36
|
-
actionButton: {
|
|
37
|
-
text: a("ds-steps.create-recommendation-strategy"),
|
|
38
|
-
onClick: () => e.openStrategyCreation()
|
|
39
|
-
}
|
|
35
|
+
message: c("email-editor.legacy-strategy-update-failed")
|
|
40
36
|
}), "";
|
|
41
37
|
}
|
|
42
38
|
try {
|
|
43
39
|
await e.fetchStrategyProductsForBlock(t);
|
|
44
|
-
} catch (
|
|
45
|
-
console.error("[useLegacyStrategyConversion] product refetch failed",
|
|
40
|
+
} catch (n) {
|
|
41
|
+
console.error("[useLegacyStrategyConversion] product refetch failed", n);
|
|
46
42
|
}
|
|
47
|
-
const
|
|
48
|
-
return
|
|
43
|
+
const a = e.blockStates[t];
|
|
44
|
+
return a ? h(
|
|
49
45
|
t,
|
|
50
46
|
{
|
|
51
47
|
strategyId: o,
|
|
52
|
-
size:
|
|
48
|
+
size: a.recommendationConfigs.size,
|
|
53
49
|
configVersion: L
|
|
54
50
|
},
|
|
55
|
-
|
|
51
|
+
a.recommendationProducts,
|
|
56
52
|
"Converted legacy recommendation strategy"
|
|
57
|
-
) ? (e.currentRecommendationId === t && e.openLegacyStrategyUpdatedModal(), o) : (console.error("[useLegacyStrategyConversion] node write failed", t), e.revertLegacyConversion(t, f),
|
|
53
|
+
) ? (e.currentRecommendationId === t && e.openLegacyStrategyUpdatedModal(), o) : (console.error("[useLegacyStrategyConversion] node write failed", t), e.revertLegacyConversion(t, f), i({
|
|
58
54
|
type: g.Error,
|
|
59
|
-
message:
|
|
55
|
+
message: c("email-editor.legacy-strategy-update-failed")
|
|
60
56
|
}), "") : o;
|
|
61
57
|
} };
|
|
62
58
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.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-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-c61cc8ea]{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
|
+
@charset "UTF-8";.auth-error-modal[data-v-a6429465]{position:relative;z-index:145}.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-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-c61cc8ea]{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-080ff767]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-080ff767]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-080ff767]{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}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -34,9 +34,9 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
34
34
|
}>>>, {
|
|
35
35
|
size: "X-small" | "small" | "medium" | "large";
|
|
36
36
|
description: string;
|
|
37
|
-
closeOnOutsideClick: boolean;
|
|
38
37
|
footerButtonOptions: FooterButtonGroup;
|
|
39
38
|
closeButtonStatus: boolean;
|
|
39
|
+
closeOnOutsideClick: boolean;
|
|
40
40
|
footerStatus: boolean;
|
|
41
41
|
}>;
|
|
42
42
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface AuthErrorState {
|
|
2
|
+
status: number;
|
|
3
|
+
data: Record<string, unknown> | null;
|
|
4
|
+
}
|
|
5
|
+
export declare const releaseAuthFreeze: () => void;
|
|
6
|
+
export declare const reportAuthError: (status: number, body: string, url: string) => void;
|
|
7
|
+
export declare const useAuthError: () => {
|
|
8
|
+
authError: import("vue").Ref<{
|
|
9
|
+
status: number;
|
|
10
|
+
data: Record<string, unknown> | null;
|
|
11
|
+
} | null>;
|
|
12
|
+
releaseAuthFreeze: () => void;
|
|
13
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.19.0-beta.
|
|
3
|
+
"version": "3.19.0-beta.f66e9de",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"test:e2e-mutation": "node scripts/e2e-mutation-check.mjs",
|
|
39
39
|
"type-check": "vue-tsc --noEmit --project tsconfig.config.json && vue-tsc --noEmit --project tsconfig.app.json",
|
|
40
40
|
"test": "vitest run --coverage",
|
|
41
|
+
"test:run": "vitest run",
|
|
41
42
|
"test:watch": "vitest",
|
|
42
43
|
"test:visual-update": "npx playwright test --update-snapshots --reporter html",
|
|
43
44
|
"test:e2e:coverage": "E2E_COVERAGE=true playwright test",
|