@useinsider/guido 3.1.1-beta.71f5a8c → 3.1.1-beta.759a302
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 +4 -4
- package/dist/components/Guido.vue2.js +91 -81
- package/dist/components/organisms/header/EditorActions.vue.js +1 -1
- package/dist/components/organisms/header/EditorActions.vue2.js +20 -15
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +18 -17
- package/dist/composables/useRecommendation.js +2 -2
- package/dist/composables/useStripo.js +6 -6
- package/dist/composables/validators/useLiquidValidator.js +31 -25
- package/dist/config/compiler/recommendationCompilerRules.js +158 -44
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +49 -46
- package/dist/enums/displayConditions.js +82 -78
- package/dist/enums/extensions/recommendationBlock.js +96 -39
- package/dist/enums/recommendation.js +2 -2
- package/dist/enums/unsubscribe.js +17 -16
- package/dist/extensions/Blocks/Checkbox/control.js +23 -23
- package/dist/extensions/Blocks/RadioButton/control.js +15 -15
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +3 -3
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +15 -15
- package/dist/services/templateLibraryApi.js +48 -46
- package/dist/src/@types/generic.d.ts +0 -1
- package/dist/src/@types/save-as-template.d.ts +1 -0
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
- package/dist/src/enums/displayConditions.d.ts +5 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +8 -1
- package/dist/src/enums/unsubscribe.d.ts +8 -3
- package/dist/src/services/templateLibraryApi.d.ts +1 -1
- package/dist/static/styles/base.css.js +7 -2
- package/dist/utils/templatePreparation.js +34 -25
- package/dist/utils/tooltipUtils.js +4 -5
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ import i from "./Guido.vue2.js";
|
|
|
3
3
|
import a from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
5
|
var o = this, r = o._self._c, e = o._self._setupProxy;
|
|
6
|
-
return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._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), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._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" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._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), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
9
|
}, n = [], s = /* @__PURE__ */ a(
|
|
@@ -12,9 +12,9 @@ var t = function() {
|
|
|
12
12
|
n,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"25780af6"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const u = s.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
u as default
|
|
20
20
|
};
|
|
@@ -1,121 +1,131 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import { useTimerClone as
|
|
6
|
-
import { migrate as
|
|
7
|
-
import { ModuleFolderDefaults as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
1
|
+
import { defineComponent as j, defineAsyncComponent as R, ref as A, computed as I, watch as J, onMounted as Q, onUnmounted as X } from "vue";
|
|
2
|
+
import { provideGuidoActions as Y } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as Z } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as ee } from "../composables/useStripo.js";
|
|
5
|
+
import { useTimerClone as te } from "../composables/useTimerClone.js";
|
|
6
|
+
import { migrate as W } from "../config/migrator/index.js";
|
|
7
|
+
import { ModuleFolderDefaults as B } from "../enums/defaults.js";
|
|
8
|
+
import { RIBBON_SELECTOR as oe } from "../enums/onboarding.js";
|
|
9
|
+
import ne from "./organisms/base/Toaster.vue.js";
|
|
10
|
+
import se from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
11
|
+
import re from "./organisms/header/HeaderWrapper.vue.js";
|
|
12
|
+
import ce from "./organisms/LoadingWrapper.vue.js";
|
|
13
|
+
import ae from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
14
|
+
import ie from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
15
|
+
import { useStripoApi as me } from "../services/stripoApi.js";
|
|
16
|
+
import { useConfigStore as de } from "../stores/config.js";
|
|
17
|
+
import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
|
|
18
|
+
import { useEditorStore as ue } from "../stores/editor.js";
|
|
19
|
+
import { usePreviewStore as pe } from "../stores/preview.js";
|
|
20
|
+
import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
|
|
21
|
+
const Re = /* @__PURE__ */ j({
|
|
21
22
|
__name: "Guido",
|
|
22
23
|
props: {
|
|
23
24
|
config: null
|
|
24
25
|
},
|
|
25
26
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
26
|
-
setup(
|
|
27
|
-
const
|
|
27
|
+
setup(H, { expose: x, emit: s }) {
|
|
28
|
+
const b = H, G = R(
|
|
28
29
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
29
|
-
),
|
|
30
|
+
), z = R(
|
|
30
31
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
31
|
-
),
|
|
32
|
-
|
|
33
|
-
const
|
|
32
|
+
), S = A(), d = A(), l = le(), g = fe(), a = de();
|
|
33
|
+
a.init(b.config);
|
|
34
|
+
const u = ue(), q = pe(), i = I(() => u.hasChanges), { isTestPartner: K } = Z(), w = () => {
|
|
34
35
|
var e;
|
|
35
|
-
return (e =
|
|
36
|
+
return (e = S.value) == null ? void 0 : e.handleSave(!0);
|
|
36
37
|
}, {
|
|
37
|
-
templateId:
|
|
38
|
-
userId:
|
|
39
|
-
partnerName:
|
|
40
|
-
username:
|
|
41
|
-
template:
|
|
42
|
-
editor:
|
|
43
|
-
} =
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
emailId:
|
|
47
|
-
userId:
|
|
48
|
-
username:
|
|
49
|
-
partnerName:
|
|
50
|
-
savedModulesFolderName:
|
|
51
|
-
defaultModulesFolderName:
|
|
52
|
-
},
|
|
53
|
-
preselectedDynamicContentList:
|
|
38
|
+
templateId: p,
|
|
39
|
+
userId: E,
|
|
40
|
+
partnerName: D,
|
|
41
|
+
username: C,
|
|
42
|
+
template: t,
|
|
43
|
+
editor: r
|
|
44
|
+
} = a, m = (t == null ? void 0 : t.html) || "", T = (t == null ? void 0 : t.css) || "", f = (t == null ? void 0 : t.preselectedDynamicContent) || [], k = (r == null ? void 0 : r.savedModulesFolderName) || B.SAVED_MODULES, F = (r == null ? void 0 : r.defaultModulesFolderName) || B.DEFAULT_MODULES;
|
|
45
|
+
u.templateId = p;
|
|
46
|
+
const v = {
|
|
47
|
+
emailId: p,
|
|
48
|
+
userId: E,
|
|
49
|
+
username: C,
|
|
50
|
+
partnerName: D,
|
|
51
|
+
savedModulesFolderName: k,
|
|
52
|
+
defaultModulesFolderName: F
|
|
53
|
+
}, L = {
|
|
54
|
+
preselectedDynamicContentList: f,
|
|
54
55
|
onReady: () => {
|
|
55
|
-
console.debug("guido:ready"),
|
|
56
|
+
console.debug("guido:ready"), s("ready");
|
|
56
57
|
}
|
|
57
|
-
}, { initPlugin:
|
|
58
|
+
}, { initPlugin: U } = ee(v, L), { getDefaultTemplate: _ } = me(), { cloneTimersOnSave: M, hasTimerBlocks: O } = te(), V = I(() => {
|
|
58
59
|
var e;
|
|
59
|
-
return !((e =
|
|
60
|
+
return !((e = a.ui) != null && e.showHeader);
|
|
60
61
|
});
|
|
61
|
-
|
|
62
|
+
Y({
|
|
62
63
|
onBack: () => {
|
|
63
|
-
console.debug("guido:back"),
|
|
64
|
+
console.debug("guido:back"), s("back");
|
|
64
65
|
},
|
|
65
66
|
onSaveStart: () => {
|
|
66
|
-
console.debug("guido:save:start"),
|
|
67
|
+
console.debug("guido:save:start"), s("save:start");
|
|
67
68
|
},
|
|
68
69
|
onSaveComplete: (e) => {
|
|
69
|
-
const
|
|
70
|
-
console.debug("guido:save:complete",
|
|
70
|
+
const n = { ...e, metadata: v };
|
|
71
|
+
console.debug("guido:save:complete", n), s("save:complete", n);
|
|
71
72
|
},
|
|
72
73
|
onTestEmailClick: () => {
|
|
73
|
-
console.debug("guido:test-email:click"),
|
|
74
|
+
console.debug("guido:test-email:click"), s("test-email:click");
|
|
74
75
|
}
|
|
75
76
|
});
|
|
76
|
-
const
|
|
77
|
-
console.debug("dynamic-content:close", e),
|
|
78
|
-
},
|
|
77
|
+
const P = (e) => {
|
|
78
|
+
console.debug("dynamic-content:close", e), l.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
79
|
+
}, N = () => {
|
|
79
80
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
80
81
|
};
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
J(() => i.value, () => {
|
|
83
|
+
s("on-change", i.value);
|
|
83
84
|
});
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
console.debug("dynamic-content:open",
|
|
85
|
+
const y = (e) => {
|
|
86
|
+
const n = e, { attribute: o, position: $ } = n.detail;
|
|
87
|
+
console.debug("dynamic-content:open", n.detail), s("dynamic-content:open", o, $);
|
|
87
88
|
};
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
let c = null;
|
|
90
|
+
const h = () => {
|
|
91
|
+
var n;
|
|
92
|
+
const e = document.querySelector(oe);
|
|
93
|
+
(n = d.value) == null || n.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
|
|
94
|
+
};
|
|
95
|
+
return Q(async () => {
|
|
96
|
+
var n;
|
|
97
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h();
|
|
98
|
+
const e = (n = d.value) == null ? void 0 : n.parentElement;
|
|
99
|
+
e && (c = new ResizeObserver(h), c.observe(e));
|
|
90
100
|
try {
|
|
91
|
-
|
|
92
|
-
let
|
|
93
|
-
html:
|
|
94
|
-
css:
|
|
101
|
+
g.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
|
|
102
|
+
let o = {
|
|
103
|
+
html: m && await W(m),
|
|
104
|
+
css: T
|
|
95
105
|
};
|
|
96
|
-
|
|
97
|
-
} catch (
|
|
98
|
-
console.error("Failed to initialize Stripo editor:",
|
|
106
|
+
o.html || (o = await _(), o.html = await W(o.html)), O(o.html) && (o.html = await M(o.html)), await U(o), l.selectedDynamicContentList = f;
|
|
107
|
+
} catch (o) {
|
|
108
|
+
console.error("Failed to initialize Stripo editor:", o);
|
|
99
109
|
}
|
|
100
|
-
document.addEventListener("dynamic-content:open",
|
|
101
|
-
}),
|
|
102
|
-
document.removeEventListener("dynamic-content:open",
|
|
110
|
+
document.addEventListener("dynamic-content:open", y);
|
|
111
|
+
}), X(() => {
|
|
112
|
+
c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", y);
|
|
103
113
|
try {
|
|
104
114
|
window.UIEditor.removeEditor();
|
|
105
115
|
} catch {
|
|
106
116
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
107
117
|
}
|
|
108
|
-
|
|
109
|
-
}),
|
|
118
|
+
a.reset();
|
|
119
|
+
}), x({
|
|
110
120
|
dynamicContent: {
|
|
111
|
-
insert:
|
|
112
|
-
close:
|
|
121
|
+
insert: P,
|
|
122
|
+
close: N
|
|
113
123
|
},
|
|
114
|
-
hasChanges:
|
|
115
|
-
saveSilent:
|
|
116
|
-
}), { __sfc: !0, PreviewContainer:
|
|
124
|
+
hasChanges: i,
|
|
125
|
+
saveSilent: w
|
|
126
|
+
}), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: z, headerWrapperRef: S, wrapperRef: d, dynamicContentStore: l, unsubscribeStore: g, props: b, configStore: a, editorStore: u, previewStore: q, hasChanges: i, isTestPartner: K, saveSilent: w, templateId: p, userId: E, partnerName: D, username: C, templateConfig: t, editorConfig: r, html: m, css: T, preselectedDynamicContentList: f, savedModulesFolderName: k, defaultModulesFolderName: F, emit: s, metadata: v, options: L, initPlugin: U, getDefaultTemplate: _, cloneTimersOnSave: M, hasTimerBlocks: O, noHeader: V, insertDynamicContent: P, closeDynamicContent: N, handleDynamicContentOpen: y, ribbonObserver: c, updateRibbonOffset: h, Toaster: ne, FilterSelectionDrawer: se, HeaderWrapper: re, LoadingWrapper: ce, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ie };
|
|
117
127
|
}
|
|
118
128
|
});
|
|
119
129
|
export {
|
|
120
|
-
|
|
130
|
+
Re as default
|
|
121
131
|
};
|
|
@@ -14,17 +14,17 @@ import { getTooltipOptions as j } from "../../../utils/tooltipUtils.js";
|
|
|
14
14
|
import { InButtonV2 as G } from "@useinsider/design-system-vue";
|
|
15
15
|
import { storeToRefs as J } from "pinia";
|
|
16
16
|
import K from "./MigrationConfirmModal.vue.js";
|
|
17
|
-
const
|
|
17
|
+
const ut = /* @__PURE__ */ O({
|
|
18
18
|
__name: "EditorActions",
|
|
19
19
|
setup(N, { expose: x }) {
|
|
20
|
-
const { config: a, isFeatureEnabled:
|
|
20
|
+
const { config: a, isFeatureEnabled: l } = b(), { exportHtml: m } = k(), { save: u } = F(), { openVersionHistory: c, closeVersionHistory: p } = R(), { getCompiledEmail: f } = q(), { compileHtml: d } = D(), { validateLiquidSyntax: v } = z(), e = I(), y = P(), { hasMigrations: S } = J(y), s = L(), i = n(!1), r = n(!1), g = n(), H = B(), T = () => {
|
|
21
21
|
if (e.isVersionHistoryOpen) {
|
|
22
|
-
|
|
22
|
+
p();
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
c();
|
|
26
26
|
}, w = async () => {
|
|
27
|
-
i.value = !0, await
|
|
27
|
+
i.value = !0, await m(), i.value = !1;
|
|
28
28
|
}, _ = () => {
|
|
29
29
|
e.isSaveAsTemplateDrawerOpen = !0;
|
|
30
30
|
}, C = h(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), A = h(
|
|
@@ -34,28 +34,33 @@ const ct = /* @__PURE__ */ O({
|
|
|
34
34
|
}
|
|
35
35
|
), V = async (t) => {
|
|
36
36
|
r.value = !0, e.loadingStatus = !0;
|
|
37
|
-
const o = await
|
|
37
|
+
const o = await u(t);
|
|
38
38
|
return r.value = !1, (t || !o) && (e.loadingStatus = !1), o;
|
|
39
39
|
}, E = (t) => {
|
|
40
40
|
var o;
|
|
41
|
-
if (!t &&
|
|
42
|
-
(o =
|
|
41
|
+
if (!t && S.value) {
|
|
42
|
+
(o = g.value) == null || o.open();
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
return V(t);
|
|
46
46
|
}, M = async () => {
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
if (l("liquidSyntax")) {
|
|
48
|
+
e.loadingStatus = !0;
|
|
49
|
+
try {
|
|
50
|
+
const { html: t } = await f({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = d(t);
|
|
51
|
+
if (!await v(o))
|
|
52
|
+
return;
|
|
53
|
+
} finally {
|
|
54
|
+
e.loadingStatus = !1;
|
|
55
|
+
}
|
|
51
56
|
}
|
|
52
|
-
|
|
57
|
+
H();
|
|
53
58
|
};
|
|
54
59
|
return x({
|
|
55
60
|
handleSave: E
|
|
56
|
-
}), { __sfc: !0, config: a, isFeatureEnabled:
|
|
61
|
+
}), { __sfc: !0, config: a, isFeatureEnabled: l, exportHtml: m, save: u, openVersionHistory: c, closeVersionHistory: p, getCompiledEmail: f, compileHtml: d, validateLiquidSyntax: v, editorStore: e, templateStore: y, hasMigrations: S, trans: s, isExporting: i, isSaving: r, migrationModalRef: g, testEmailClick: H, handleVersionHistory: T, handleExport: w, handleSaveAs: _, versionHistoryTooltipText: C, isVersionHistoryButtonVisible: A, executeSave: V, handleSave: E, handleTestEmail: M, getTooltipOptions: j, InButtonV2: G, MigrationConfirmModal: K };
|
|
57
62
|
}
|
|
58
63
|
});
|
|
59
64
|
export {
|
|
60
|
-
|
|
65
|
+
ut as default
|
|
61
66
|
};
|
|
@@ -10,29 +10,29 @@ import { useDebounceFn as V } from "../../../node_modules/@vueuse/shared/index.j
|
|
|
10
10
|
const H = /* @__PURE__ */ A({
|
|
11
11
|
__name: "SaveAsTemplateDrawer",
|
|
12
12
|
setup(E) {
|
|
13
|
-
const
|
|
13
|
+
const o = O(), n = D(), t = k(), { createTemplate: m } = B(), a = c(!1), r = c(!1), l = c(""), f = b(() => ({
|
|
14
14
|
primaryButton: {
|
|
15
15
|
styling: "solid",
|
|
16
16
|
type: "primary",
|
|
17
|
-
labelText:
|
|
17
|
+
labelText: o(a.value ? "newsletter.saving" : "products.save"),
|
|
18
18
|
loadingStatus: a.value,
|
|
19
19
|
disabledStatus: t.skeletonStatus
|
|
20
20
|
},
|
|
21
21
|
cancelOrBackButton: {
|
|
22
22
|
styling: "ghost",
|
|
23
23
|
type: "secondary",
|
|
24
|
-
labelText:
|
|
24
|
+
labelText: o("products.cancel"),
|
|
25
25
|
disabledStatus: a.value
|
|
26
26
|
}
|
|
27
|
-
})),
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
const e = h(t, "templateName"), { success:
|
|
31
|
-
return
|
|
27
|
+
})), u = () => {
|
|
28
|
+
l.value = "", n.isSaveAsTemplateDrawerOpen = !1;
|
|
29
|
+
}, i = async () => {
|
|
30
|
+
const e = h(t, "templateName"), { success: s, errorMessage: _ } = await x(e).validate();
|
|
31
|
+
return l.value = _, s;
|
|
32
32
|
}, v = V(async (e) => {
|
|
33
|
-
t.templateName = e, await
|
|
33
|
+
t.templateName = e, await i();
|
|
34
34
|
}, 500), g = async (e) => {
|
|
35
|
-
|
|
35
|
+
r.value = !0, await t.addCategory(e), r.value = !1;
|
|
36
36
|
}, y = (e) => {
|
|
37
37
|
t.selectedCategories = e;
|
|
38
38
|
}, S = (e) => {
|
|
@@ -40,22 +40,23 @@ const H = /* @__PURE__ */ A({
|
|
|
40
40
|
}, T = () => {
|
|
41
41
|
t.selectedCategories = [];
|
|
42
42
|
}, w = async () => {
|
|
43
|
-
if (a.value = !0, !await
|
|
43
|
+
if (a.value = !0, !await i()) {
|
|
44
44
|
a.value = !1;
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
const s = await m();
|
|
48
|
+
a.value = !1, s && u();
|
|
49
|
+
}, p = () => {
|
|
49
50
|
C(() => {
|
|
50
51
|
const e = document.querySelector("input#guido__template-name-input");
|
|
51
52
|
e == null || e.focus();
|
|
52
53
|
});
|
|
53
54
|
}, d = async () => {
|
|
54
|
-
t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1,
|
|
55
|
+
t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1, p();
|
|
55
56
|
};
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
}), { __sfc: !0, trans:
|
|
57
|
+
return n.$subscribe((e, { isSaveAsTemplateDrawerOpen: s }) => {
|
|
58
|
+
s && d();
|
|
59
|
+
}), { __sfc: !0, trans: o, editorStore: n, saveAsTemplateStore: t, createTemplate: m, isSaving: a, isAddingOption: r, templateNameError: l, footerButtonGroupOptions: f, closeModal: u, validateTemplateName: i, handleTemplateName: v, handleAddOption: g, handleCategoryChange: y, handleSelectAllOptions: S, handleResetAllOptions: T, saveTemplate: w, focusToInput: p, initializeDrawer: d, WpDrawer: N, InBasicTextInput: M, InMultiSelect: I };
|
|
59
60
|
}
|
|
60
61
|
});
|
|
61
62
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getRecommendationFeedSourceMaps as g, URLS as p } from "../enums/extensions/recommendationBlock.js";
|
|
2
2
|
import { MinDeviceViewport as R, DefaultPadding as b } from "../enums/recommendation.js";
|
|
3
3
|
import { useRecommendationExtensionStore as u } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
4
|
import { generateCompleteFilterQuery as x } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
@@ -47,7 +47,7 @@ const N = () => ({
|
|
|
47
47
|
const n = u(), o = I(), a = Number(i), r = n.blockStates[a];
|
|
48
48
|
if (!r)
|
|
49
49
|
return "";
|
|
50
|
-
const { recommendationConfigs: e } = r, l = ((m = g.find((s) => s.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
|
|
50
|
+
const { recommendationConfigs: e } = r, l = ((m = g().find((s) => s.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
|
|
51
51
|
t.set("locale", e.language), t.set("currency", e.currencySettings.value), t.set("partnerName", o.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", o.variationId), e.strategy === "manualMerchandising" ? t.set("productId", e.productIds.join(",")) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
52
52
|
const f = e.filters.filter((s) => s.isValid), c = x(f);
|
|
53
53
|
c && t.set("filter", c), e.shuffleProducts && t.set("shuffle", "true");
|
|
@@ -5,7 +5,7 @@ import { useCustomInterfaceAppearance as P } from "./useCustomInterfaceAppearanc
|
|
|
5
5
|
import { useStripoEventHandler as U } from "./useStripoEventHandler.js";
|
|
6
6
|
import { useToaster as R } from "./useToaster.js";
|
|
7
7
|
import { localePatch as q } from "../config/i18n/index.js";
|
|
8
|
-
import {
|
|
8
|
+
import { getDisplayConditions as x } from "../enums/displayConditions.js";
|
|
9
9
|
import { useStripoApi as H } from "../services/stripoApi.js";
|
|
10
10
|
import O from "../static/styles/customEditorStyle.css.js";
|
|
11
11
|
import { useEditorStore as C } from "../stores/editor.js";
|
|
@@ -13,8 +13,8 @@ import { dynamicContentToMergeTags as L } from "../utils/genericUtil.js";
|
|
|
13
13
|
import $ from "../package.json.js";
|
|
14
14
|
const ie = (E, c) => {
|
|
15
15
|
const { features: l, template: h, isFeatureEnabled: u } = I(), { handleError: m } = R(), { getToken: b, getCustomFonts: w, getSyncModulesStatus: k } = H(), { handleEvent: T } = U(), { getStripoBlocksConfig: V } = D(), _ = async (i, n = [], r = !1) => {
|
|
16
|
-
var
|
|
17
|
-
const e = C(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await V(),
|
|
16
|
+
var f, y, S;
|
|
17
|
+
const e = C(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await V(), g = ((f = l.value) == null ? void 0 : f.displayConditions) ?? !0, v = ((y = l.value) == null ? void 0 : y.modulesDisabled) ?? !1, M = ((S = h.value) == null ? void 0 : S.forceRecreate) ?? !1;
|
|
18
18
|
window.UIEditor.initEditor(
|
|
19
19
|
document.querySelector("#guido-editor"),
|
|
20
20
|
{
|
|
@@ -32,9 +32,9 @@ const ie = (E, c) => {
|
|
|
32
32
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
33
33
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
34
34
|
customViewStyles: O,
|
|
35
|
-
conditionsEnabled:
|
|
36
|
-
customConditionsEnabled:
|
|
37
|
-
conditionCategories: x,
|
|
35
|
+
conditionsEnabled: g,
|
|
36
|
+
customConditionsEnabled: g,
|
|
37
|
+
conditionCategories: x(),
|
|
38
38
|
enableXSSSecurity: !0,
|
|
39
39
|
modulesDisabled: v,
|
|
40
40
|
syncModulesEnabled: r,
|
|
@@ -1,34 +1,40 @@
|
|
|
1
|
-
import { ToasterTypeOptions as
|
|
2
|
-
import { base64EncodeWithSpecialChars as
|
|
3
|
-
import { useHttp as
|
|
4
|
-
import { useToaster as
|
|
1
|
+
import { ToasterTypeOptions as a } from "../../enums/toaster.js";
|
|
2
|
+
import { base64EncodeWithSpecialChars as u } from "../../utils/base64.js";
|
|
3
|
+
import { useHttp as d } from "../useHttp.js";
|
|
4
|
+
import { useToaster as c } from "../useToaster.js";
|
|
5
5
|
import { useTranslations as p } from "../useTranslations.js";
|
|
6
6
|
const v = () => {
|
|
7
|
-
const { post:
|
|
7
|
+
const { post: i } = d(), { showToaster: e } = c(), s = p();
|
|
8
8
|
return { validateLiquidSyntax: async (o) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
try {
|
|
10
|
+
const t = await i("/newsletter/contents/validate-syntax", [{
|
|
11
|
+
identifier: "default",
|
|
12
|
+
syntax: "liquid",
|
|
13
|
+
contents: {
|
|
14
|
+
subject: null,
|
|
15
|
+
preheader: null,
|
|
16
|
+
html: u(o),
|
|
17
|
+
ampHtml: null
|
|
18
|
+
}
|
|
19
|
+
}]);
|
|
20
|
+
if (!Array.isArray(t.data)) {
|
|
21
|
+
const l = t.data;
|
|
22
|
+
return e({
|
|
23
|
+
type: a.Warning,
|
|
24
|
+
message: l.message ?? s("journey-builder.liquid-validation-failed")
|
|
25
|
+
}), !1;
|
|
18
26
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
const [r] = t.data, n = Object.values((r == null ? void 0 : r.errors) ?? {});
|
|
28
|
+
return n.length ? (e({
|
|
29
|
+
type: a.Warning,
|
|
30
|
+
message: n[0].replace(/^line \d+:\s*/, "")
|
|
31
|
+
}), !1) : !0;
|
|
32
|
+
} catch {
|
|
33
|
+
return e({
|
|
34
|
+
type: a.Alert,
|
|
35
|
+
message: s("journey-builder.liquid-validation-failed")
|
|
25
36
|
}), !1;
|
|
26
37
|
}
|
|
27
|
-
const [t] = e.data;
|
|
28
|
-
return t != null && t.success ? !0 : (a({
|
|
29
|
-
type: i.Warning,
|
|
30
|
-
message: ((s = t == null ? void 0 : t.errors) == null ? void 0 : s.html) ?? r("journey-builder.liquid-validation-failed")
|
|
31
|
-
}), !1);
|
|
32
38
|
} };
|
|
33
39
|
};
|
|
34
40
|
export {
|