@useinsider/guido 3.1.1-beta.d3c42de → 3.1.1-beta.d77f343
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/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +51 -36
- package/dist/composables/useStripo.js +22 -19
- package/dist/composables/validators/useLiquidValidator.js +34 -28
- package/dist/extensions/DynamicContent/dynamic-content.js +17 -12
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +13 -11
- package/dist/services/templateLibraryApi.js +24 -22
- package/dist/src/@types/generic.d.ts +0 -1
- package/dist/src/@types/save-as-template.d.ts +1 -0
- package/dist/src/utils/genericUtil.d.ts +1 -1
- package/dist/utils/genericUtil.js +42 -20
- package/dist/utils/tooltipUtils.js +4 -5
- package/package.json +3 -2
|
@@ -4,7 +4,7 @@ import d from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
|
4
4
|
var u = function() {
|
|
5
5
|
var s, i, n, a;
|
|
6
6
|
var o = this, e = o._self._c, t = o._self._setupProxy;
|
|
7
|
-
return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.
|
|
7
|
+
return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(r) {
|
|
8
8
|
return t.handleSave(!1);
|
|
9
9
|
} } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
|
|
10
10
|
return t.executeSave(!1);
|
|
@@ -15,7 +15,7 @@ var u = function() {
|
|
|
15
15
|
p,
|
|
16
16
|
!1,
|
|
17
17
|
null,
|
|
18
|
-
"
|
|
18
|
+
"4e2a4adb"
|
|
19
19
|
);
|
|
20
20
|
const v = c.exports;
|
|
21
21
|
export {
|
|
@@ -1,51 +1,66 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
1
|
+
import { defineComponent as O, ref as n, computed as h } from "vue";
|
|
2
|
+
import { useActionsApi as q } from "../../../composables/useActionsApi.js";
|
|
3
|
+
import { useConfig as b } from "../../../composables/useConfig.js";
|
|
4
|
+
import { useExport as k } from "../../../composables/useExport.js";
|
|
5
|
+
import { useTestEmailClick as B } from "../../../composables/useGuidoActions.js";
|
|
6
|
+
import { useHtmlCompiler as D } from "../../../composables/useHtmlCompiler.js";
|
|
7
|
+
import { useSave as F } from "../../../composables/useSave.js";
|
|
8
|
+
import { useTranslations as L } from "../../../composables/useTranslations.js";
|
|
9
|
+
import { useVersionHistoryApi as R } from "../../../composables/useVersionHistoryApi.js";
|
|
10
|
+
import { useLiquidValidator as z } from "../../../composables/validators/useLiquidValidator.js";
|
|
11
|
+
import { useEditorStore as I } from "../../../stores/editor.js";
|
|
12
|
+
import { useTemplateStore as P } from "../../../stores/template.js";
|
|
13
|
+
import { getTooltipOptions as j } from "../../../utils/tooltipUtils.js";
|
|
14
|
+
import { InButtonV2 as G } from "@useinsider/design-system-vue";
|
|
15
|
+
import { storeToRefs as J } from "pinia";
|
|
16
|
+
import K from "./MigrationConfirmModal.vue.js";
|
|
17
|
+
const ut = /* @__PURE__ */ O({
|
|
15
18
|
__name: "EditorActions",
|
|
16
|
-
setup(
|
|
17
|
-
const { config: a } =
|
|
19
|
+
setup(N, { expose: x }) {
|
|
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 = () => {
|
|
18
21
|
if (e.isVersionHistoryOpen) {
|
|
19
|
-
|
|
22
|
+
p();
|
|
20
23
|
return;
|
|
21
24
|
}
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
+
c();
|
|
26
|
+
}, w = async () => {
|
|
27
|
+
i.value = !0, await m(), i.value = !1;
|
|
25
28
|
}, _ = () => {
|
|
26
29
|
e.isSaveAsTemplateDrawerOpen = !0;
|
|
27
|
-
},
|
|
30
|
+
}, C = h(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), A = h(
|
|
28
31
|
() => {
|
|
29
|
-
var
|
|
30
|
-
return ((
|
|
32
|
+
var t, o;
|
|
33
|
+
return ((o = (t = a.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
31
34
|
}
|
|
32
|
-
),
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
return
|
|
36
|
-
},
|
|
37
|
-
var
|
|
38
|
-
if (!
|
|
39
|
-
(
|
|
35
|
+
), V = async (t) => {
|
|
36
|
+
r.value = !0, e.loadingStatus = !0;
|
|
37
|
+
const o = await u(t);
|
|
38
|
+
return r.value = !1, (t || !o) && (e.loadingStatus = !1), o;
|
|
39
|
+
}, E = (t) => {
|
|
40
|
+
var o;
|
|
41
|
+
if (!t && S.value) {
|
|
42
|
+
(o = g.value) == null || o.open();
|
|
40
43
|
return;
|
|
41
44
|
}
|
|
42
|
-
return
|
|
45
|
+
return V(t);
|
|
46
|
+
}, M = async () => {
|
|
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
|
+
}
|
|
56
|
+
}
|
|
57
|
+
H();
|
|
43
58
|
};
|
|
44
|
-
return
|
|
45
|
-
handleSave:
|
|
46
|
-
}), { __sfc: !0, config: a, exportHtml: m, save:
|
|
59
|
+
return x({
|
|
60
|
+
handleSave: E
|
|
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 };
|
|
47
62
|
}
|
|
48
63
|
});
|
|
49
64
|
export {
|
|
50
|
-
|
|
65
|
+
ut as default
|
|
51
66
|
};
|
|
@@ -4,22 +4,22 @@ import { useConfig as I } from "./useConfig.js";
|
|
|
4
4
|
import { useCustomInterfaceAppearance as P } from "./useCustomInterfaceAppearance.js";
|
|
5
5
|
import { useStripoEventHandler as U } from "./useStripoEventHandler.js";
|
|
6
6
|
import { useToaster as R } from "./useToaster.js";
|
|
7
|
-
import { localePatch as
|
|
8
|
-
import { displayConditions as
|
|
9
|
-
import { useStripoApi as
|
|
7
|
+
import { localePatch as q } from "../config/i18n/index.js";
|
|
8
|
+
import { displayConditions as x } from "../enums/displayConditions.js";
|
|
9
|
+
import { useStripoApi as H } from "../services/stripoApi.js";
|
|
10
10
|
import O from "../static/styles/customEditorStyle.css.js";
|
|
11
|
-
import { useEditorStore as
|
|
11
|
+
import { useEditorStore as C } from "../stores/editor.js";
|
|
12
12
|
import { dynamicContentToMergeTags as L } from "../utils/genericUtil.js";
|
|
13
13
|
import $ from "../package.json.js";
|
|
14
|
-
const ie = (
|
|
15
|
-
const { features: l, template:
|
|
16
|
-
var
|
|
17
|
-
const e =
|
|
14
|
+
const ie = (E, c) => {
|
|
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 g, y, S;
|
|
17
|
+
const e = C(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await V(), f = ((g = l.value) == null ? void 0 : g.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
|
{
|
|
21
|
-
metadata:
|
|
22
|
-
html:
|
|
21
|
+
metadata: E,
|
|
22
|
+
html: p,
|
|
23
23
|
css: a,
|
|
24
24
|
forceRecreate: M,
|
|
25
25
|
locale: "en",
|
|
@@ -28,13 +28,13 @@ const ie = (C, c) => {
|
|
|
28
28
|
mobileViewButtonSelector: ".guido__view-option-selection-mobile",
|
|
29
29
|
desktopViewButtonSelector: ".guido__view-option-selection-desktop",
|
|
30
30
|
codeEditorButtonSelector: "#guido__code-button",
|
|
31
|
-
customAppearanceMergetags: !
|
|
31
|
+
customAppearanceMergetags: !u("liquidSyntax"),
|
|
32
32
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
33
33
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
34
34
|
customViewStyles: O,
|
|
35
|
-
conditionsEnabled:
|
|
36
|
-
customConditionsEnabled:
|
|
37
|
-
conditionCategories:
|
|
35
|
+
conditionsEnabled: f,
|
|
36
|
+
customConditionsEnabled: f,
|
|
37
|
+
conditionCategories: x,
|
|
38
38
|
enableXSSSecurity: !0,
|
|
39
39
|
modulesDisabled: v,
|
|
40
40
|
syncModulesEnabled: r,
|
|
@@ -52,7 +52,10 @@ const ie = (C, c) => {
|
|
|
52
52
|
},
|
|
53
53
|
mergeTags: [
|
|
54
54
|
{
|
|
55
|
-
entries: L(
|
|
55
|
+
entries: L(
|
|
56
|
+
c.preselectedDynamicContentList,
|
|
57
|
+
u("liquidSyntax")
|
|
58
|
+
)
|
|
56
59
|
}
|
|
57
60
|
],
|
|
58
61
|
async onTokenRefreshRequest(t) {
|
|
@@ -60,7 +63,7 @@ const ie = (C, c) => {
|
|
|
60
63
|
const s = await b();
|
|
61
64
|
t(s);
|
|
62
65
|
} catch (s) {
|
|
63
|
-
|
|
66
|
+
m(s, "Failed to refresh token");
|
|
64
67
|
}
|
|
65
68
|
},
|
|
66
69
|
onTemplateLoaded() {
|
|
@@ -70,7 +73,7 @@ const ie = (C, c) => {
|
|
|
70
73
|
e.hasChanges = !1;
|
|
71
74
|
}, 1e3);
|
|
72
75
|
} catch (t) {
|
|
73
|
-
|
|
76
|
+
m(t, "Failed to load custom interface appearance");
|
|
74
77
|
}
|
|
75
78
|
},
|
|
76
79
|
onCodeEditorVisibilityChanged(t) {
|
|
@@ -92,7 +95,7 @@ const ie = (C, c) => {
|
|
|
92
95
|
".in-drawer__container"
|
|
93
96
|
],
|
|
94
97
|
extensions: d,
|
|
95
|
-
localePatch:
|
|
98
|
+
localePatch: q
|
|
96
99
|
}
|
|
97
100
|
);
|
|
98
101
|
}, B = (i) => new Promise((n, r) => {
|
|
@@ -110,7 +113,7 @@ const ie = (C, c) => {
|
|
|
110
113
|
});
|
|
111
114
|
return { initPlugin: async (i) => {
|
|
112
115
|
await B(async () => {
|
|
113
|
-
const n =
|
|
116
|
+
const n = C(), [r, e] = await Promise.all([
|
|
114
117
|
w(),
|
|
115
118
|
k()
|
|
116
119
|
]);
|
|
@@ -1,36 +1,42 @@
|
|
|
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
|
-
const
|
|
7
|
-
const { post:
|
|
8
|
-
return { validateLiquidSyntax: async (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
const v = () => {
|
|
7
|
+
const { post: i } = d(), { showToaster: e } = c(), s = p();
|
|
8
|
+
return { validateLiquidSyntax: async (o) => {
|
|
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.Alert,
|
|
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 {
|
|
35
|
-
|
|
41
|
+
v as useLiquidValidator
|
|
36
42
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
var c = Object.defineProperty;
|
|
2
2
|
var g = (o, s, t) => s in o ? c(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
|
|
3
3
|
var r = (o, s, t) => g(o, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { useConfig as d } from "../../composables/useConfig.js";
|
|
5
|
+
import { mergeTagToDynamicContent as m, dynamicContentToMergeTags as u } from "../../utils/genericUtil.js";
|
|
6
|
+
import { UIElement as h, UIElementType as a, UEAttr as T, UIElementTagRegistry as y } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
import { ExternalMergeTagsLibrary as C } from "./dynamic-content-modal.js";
|
|
8
|
+
const l = "external-dynamic-content-ui-element", L = "button-add-dynamic-content";
|
|
9
|
+
class w extends y {
|
|
9
10
|
registerUiElements(s) {
|
|
10
11
|
s[a.MERGETAGS] = l;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
|
-
class
|
|
14
|
+
class f extends h {
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments);
|
|
16
17
|
r(this, "mergeTagsButton", null);
|
|
@@ -43,7 +44,7 @@ class b extends u {
|
|
|
43
44
|
onAttributeUpdated(t, e) {
|
|
44
45
|
if (t !== "mergeTag" || !(e != null && e.value))
|
|
45
46
|
return;
|
|
46
|
-
const n =
|
|
47
|
+
const n = m(e), i = this._getLastClickedPosition();
|
|
47
48
|
this.lastClickedElement = null, this.lastClickedFrame = null, this._openDynamicContentLibrary(n, i);
|
|
48
49
|
}
|
|
49
50
|
openMergeTagLibrary() {
|
|
@@ -55,10 +56,14 @@ class b extends u {
|
|
|
55
56
|
* Dispatches event with dynamic content data and position
|
|
56
57
|
*/
|
|
57
58
|
_openDynamicContentLibrary(t, e) {
|
|
58
|
-
this.mergeTagsLibrary || (this.mergeTagsLibrary = new
|
|
59
|
+
this.mergeTagsLibrary || (this.mergeTagsLibrary = new C()), this.mergeTagsLibrary.openMergeTagsLibrary(
|
|
59
60
|
t,
|
|
60
61
|
(n) => {
|
|
61
|
-
n.text && n.value
|
|
62
|
+
if (n.text && n.value) {
|
|
63
|
+
const { isFeatureEnabled: i } = d();
|
|
64
|
+
this.api.triggerValueChange(u([n], i("liquidSyntax"))[0]);
|
|
65
|
+
} else
|
|
66
|
+
this.api.triggerValueChange(null);
|
|
62
67
|
},
|
|
63
68
|
e
|
|
64
69
|
);
|
|
@@ -142,7 +147,7 @@ class b extends u {
|
|
|
142
147
|
<${a.BUTTON}
|
|
143
148
|
id="guido__btn-add-dynamic-content"
|
|
144
149
|
class="btn btn-primary"
|
|
145
|
-
${
|
|
150
|
+
${T.BUTTON.name}="${L}">
|
|
146
151
|
<${a.ICON} src="plus" class="icon icon-button color-primary">
|
|
147
152
|
</${a.ICON}>
|
|
148
153
|
${this.api.translate("Add Dynamic Content")}
|
|
@@ -151,6 +156,6 @@ class b extends u {
|
|
|
151
156
|
}
|
|
152
157
|
}
|
|
153
158
|
export {
|
|
154
|
-
|
|
155
|
-
|
|
159
|
+
w as DynamicContentTagRegistry,
|
|
160
|
+
f as DynamicContentUiElementExtension
|
|
156
161
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-3b53a736],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-cd76c125] .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-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{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}.editor-actions[data-v-
|
|
1
|
+
.gap-16[data-v-3b53a736],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-cd76c125] .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-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{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}.editor-actions[data-v-4e2a4adb]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-a26d7792]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-a26d7792]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-a26d7792]{height:calc(100vh - 75px)}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-df672485]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-df672485]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-df672485]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-df672485]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-df672485]{object-fit:cover;transform:scale(1)}[data-v-43c617a7] .guido__verion-history-view-option-selection-desktop svg,[data-v-43c617a7] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-43c617a7] .in-segments-wrapper__button_selected,[data-v-43c617a7] .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-988f8da6]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-988f8da6]{min-height:504px}.iframe-wrapper[data-v-e0424e99]{width:258px}.iframe-scaled[data-v-e0424e99]{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-29b9af29] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-d073b1dc] .vueperslides__bullets{pointer-events:none!important}[data-v-d073b1dc] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
import { useHttp as c } from "../composables/useHttp.js";
|
|
2
|
-
import { URLS as
|
|
2
|
+
import { URLS as i } from "../enums/extensions/recommendationBlock.js";
|
|
3
3
|
const f = () => {
|
|
4
|
-
const { get:
|
|
4
|
+
const { get: r } = c(), a = "6KcLM9TwheVB1mgK";
|
|
5
5
|
return {
|
|
6
6
|
fetchRecommendationCreateData: async () => {
|
|
7
7
|
try {
|
|
8
|
-
return (await
|
|
8
|
+
return (await r("/newsletter/recommendations/create-data")).data;
|
|
9
9
|
} catch (e) {
|
|
10
10
|
throw console.error("fetchUserModalState error:", e), e;
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
fetchRecommendationFilters: async () => {
|
|
14
14
|
try {
|
|
15
|
-
const { data: e } = await
|
|
15
|
+
const { data: e } = await r("/stripo/email-recommendation-attributes");
|
|
16
16
|
return e;
|
|
17
17
|
} catch (e) {
|
|
18
18
|
throw console.error("fetchRecommendationFilters error:", e), e;
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
fetchRecommendationProducts: async (e,
|
|
21
|
+
fetchRecommendationProducts: async (e, s) => {
|
|
22
22
|
var n;
|
|
23
23
|
try {
|
|
24
|
-
const t = decodeURIComponent(new URLSearchParams(Object.entries(
|
|
24
|
+
const t = decodeURIComponent(new URLSearchParams(Object.entries(s)).toString());
|
|
25
25
|
console.debug("🏁 Recommendation API Query:", t);
|
|
26
|
-
const { get:
|
|
27
|
-
headers: {
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
const { get: m } = c({
|
|
27
|
+
headers: {
|
|
28
|
+
"X-CLIENT-ID": a
|
|
29
|
+
}
|
|
30
|
+
}), o = await m(
|
|
31
|
+
`${i.RECOMMENDATION_API_URL}/v2/${e}?${t}`
|
|
30
32
|
);
|
|
31
|
-
return ((n =
|
|
33
|
+
return ((n = o == null ? void 0 : o.data) == null ? void 0 : n.data) ?? [];
|
|
32
34
|
} catch (t) {
|
|
33
35
|
throw console.error("fetchRecommendationProducts error:", t), t;
|
|
34
36
|
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { useHttp as
|
|
1
|
+
import { useConfig as f } from "../composables/useConfig.js";
|
|
2
|
+
import { useHttp as b } from "../composables/useHttp.js";
|
|
3
3
|
import { useToaster as w } from "../composables/useToaster.js";
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import { EditorType as
|
|
6
|
-
import { useRecommendationExtensionStore as
|
|
4
|
+
import { useTranslations as h } from "../composables/useTranslations.js";
|
|
5
|
+
import { EditorType as C } from "../enums/defaults.js";
|
|
6
|
+
import { useRecommendationExtensionStore as S } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
7
7
|
import { useSaveAsTemplateStore as v } from "../stores/save-as-template.js";
|
|
8
8
|
import { base64EncodeWithSpecialChars as a } from "../utils/base64.js";
|
|
9
|
-
import { useTemplatePreparation as
|
|
9
|
+
import { useTemplatePreparation as N } from "../utils/templatePreparation.js";
|
|
10
10
|
const R = () => {
|
|
11
|
-
const { get:
|
|
11
|
+
const { get: m, post: i } = b(), { handleError: o, showToaster: c } = w(), { config: l, isFeatureEnabled: y } = f(), p = h();
|
|
12
12
|
return {
|
|
13
13
|
getCategories: async () => {
|
|
14
14
|
try {
|
|
15
|
-
const { data: e = [] } = await
|
|
15
|
+
const { data: e = [] } = await m("/newsletter/template-library/get-template-categories");
|
|
16
16
|
return e;
|
|
17
17
|
} catch (e) {
|
|
18
18
|
return o(e, "Failed to fetch template categories"), [];
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
checkTemplateNameAvailability: async (e) => {
|
|
22
|
-
const { data: { status: t = !1 } } = await
|
|
22
|
+
const { data: { status: t = !1 } } = await m(
|
|
23
23
|
`/newsletter/template-library/template-name-exists?name=${e}`
|
|
24
24
|
);
|
|
25
25
|
return !t;
|
|
26
26
|
},
|
|
27
27
|
createCategory: async (e) => {
|
|
28
28
|
try {
|
|
29
|
-
const { data: { id: t } } = await
|
|
29
|
+
const { data: { id: t } } = await i(
|
|
30
30
|
"/newsletter/template-library/create-category",
|
|
31
31
|
{ name: e }
|
|
32
32
|
);
|
|
@@ -36,34 +36,36 @@ const R = () => {
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
createTemplate: async () => {
|
|
39
|
-
var e, t, g,
|
|
39
|
+
var e, t, g, u;
|
|
40
40
|
try {
|
|
41
|
-
const { prepareTemplateDetails:
|
|
41
|
+
const { prepareTemplateDetails: n } = N(), r = v(), s = await n(), d = {
|
|
42
42
|
name: r.getTemplateName,
|
|
43
43
|
categories: r.getSelectedCategoryIds,
|
|
44
44
|
productId: ((t = (e = l.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
|
|
45
|
-
editorType:
|
|
46
|
-
messageType: ((
|
|
45
|
+
editorType: C,
|
|
46
|
+
messageType: ((u = (g = l.value) == null ? void 0 : g.partner) == null ? void 0 : u.messageType) || 0,
|
|
47
47
|
content: a(s.compiledHtml),
|
|
48
48
|
css: a(s.css),
|
|
49
49
|
unsubscriptionPreferencePageStatus: !1,
|
|
50
50
|
unsubscriptionPreferencePages: [],
|
|
51
51
|
recommendationCampaignUrls: a(
|
|
52
|
-
|
|
52
|
+
S().recommendationCampaignUrls
|
|
53
53
|
),
|
|
54
54
|
recommendationConfigs: a({}),
|
|
55
55
|
isGuido: !0,
|
|
56
|
+
// eslint-disable-next-line camelcase
|
|
57
|
+
template_engine: y("liquidSyntax") ? 1 : 0,
|
|
56
58
|
stripoConfig: a({
|
|
57
59
|
editor: "stripo",
|
|
58
60
|
html: s.rawHtml,
|
|
59
61
|
css: s.css
|
|
60
62
|
})
|
|
61
|
-
}, { data: { type:
|
|
63
|
+
}, { data: { type: T } } = await i(
|
|
62
64
|
"/newsletter/template-library/create-template",
|
|
63
|
-
|
|
65
|
+
d
|
|
64
66
|
);
|
|
65
|
-
if (
|
|
66
|
-
|
|
67
|
+
if (T === "alert") {
|
|
68
|
+
c({
|
|
67
69
|
message: p(
|
|
68
70
|
"newsletter.template-library-save-alert",
|
|
69
71
|
{ templateName: r.getTemplateName }
|
|
@@ -72,15 +74,15 @@ const R = () => {
|
|
|
72
74
|
});
|
|
73
75
|
return;
|
|
74
76
|
}
|
|
75
|
-
|
|
77
|
+
c({
|
|
76
78
|
message: p(
|
|
77
79
|
"newsletter.template-library-save-success",
|
|
78
80
|
{ templateName: r.getTemplateName }
|
|
79
81
|
),
|
|
80
82
|
type: "success"
|
|
81
83
|
});
|
|
82
|
-
} catch (
|
|
83
|
-
o(
|
|
84
|
+
} catch (n) {
|
|
85
|
+
o(n, "Failed to create template");
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DynamicContent, MergeTag } from '@@/Types/generic';
|
|
2
2
|
export declare const mergeTagToDynamicContent: (mergeTag: MergeTag) => DynamicContent;
|
|
3
|
-
export declare const dynamicContentToMergeTags: (dynamicContentList: DynamicContent[]) => MergeTag[];
|
|
3
|
+
export declare const dynamicContentToMergeTags: (dynamicContentList: DynamicContent[], liquidSyntax?: boolean) => MergeTag[];
|
|
4
4
|
export declare const getCsrfToken: () => string;
|
|
5
5
|
/**
|
|
6
6
|
* URL Parameter utilities
|
|
@@ -1,25 +1,47 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
text:
|
|
4
|
-
value:
|
|
1
|
+
const s = (e) => {
|
|
2
|
+
const a = e.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [n] = a, c = {
|
|
3
|
+
text: e.label,
|
|
4
|
+
value: n || ""
|
|
5
5
|
};
|
|
6
|
-
if (
|
|
7
|
-
const [, l,
|
|
8
|
-
|
|
6
|
+
if (a.length >= 2) {
|
|
7
|
+
const [, l, r] = a;
|
|
8
|
+
if (l.startsWith("default:")) {
|
|
9
|
+
let t = l.slice(8).trim();
|
|
10
|
+
t.startsWith('"') && t.endsWith('"') && (t = t.slice(1, -1)), c.fallback = t;
|
|
11
|
+
} else {
|
|
12
|
+
const t = l.includes("=") ? { key: l.split("=")[0].trim(), value: l.split("=")[1].trim() } : null;
|
|
13
|
+
t ? c.format = t : r || (c.fallback = l), r && (c.fallback = r);
|
|
14
|
+
}
|
|
9
15
|
}
|
|
10
|
-
return
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
return c;
|
|
17
|
+
}, u = (e, f = !1) => e.map((a) => {
|
|
18
|
+
if (a.format)
|
|
19
|
+
return {
|
|
20
|
+
label: `${a.text} | ${a.format.key}=${a.format.value}`,
|
|
21
|
+
value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
|
|
22
|
+
};
|
|
23
|
+
if (f) {
|
|
24
|
+
if (!a.fallback)
|
|
25
|
+
return {
|
|
26
|
+
label: a.text,
|
|
27
|
+
value: `{{ ${a.value} }}`
|
|
28
|
+
};
|
|
29
|
+
const c = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
|
|
30
|
+
return {
|
|
31
|
+
label: `${a.text} | ${a.fallback}`,
|
|
32
|
+
value: `{{ ${a.value} | default: ${c} }}`
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
|
|
37
|
+
value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
|
|
38
|
+
};
|
|
39
|
+
}), o = () => {
|
|
40
|
+
var e;
|
|
41
|
+
return ((e = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : e.getAttribute("content")) ?? "";
|
|
20
42
|
};
|
|
21
43
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
44
|
+
u as dynamicContentToMergeTags,
|
|
45
|
+
o as getCsrfToken,
|
|
46
|
+
s as mergeTagToDynamicContent
|
|
25
47
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
id:
|
|
1
|
+
const o = (i, t = {}) => ({
|
|
2
|
+
id: i,
|
|
3
3
|
dynamicPosition: t.dynamicPosition ?? !1,
|
|
4
4
|
staticPosition: t.staticPosition ?? "bottom center",
|
|
5
5
|
iconStatus: t.iconStatus ?? !1,
|
|
6
|
-
offset: t.offset
|
|
7
|
-
preventXss: t.preventXss
|
|
6
|
+
offset: t.offset
|
|
8
7
|
});
|
|
9
8
|
export {
|
|
10
|
-
|
|
9
|
+
o as getTooltipOptions
|
|
11
10
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.1.1-beta.
|
|
3
|
+
"version": "3.1.1-beta.d77f343",
|
|
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",
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"license": "ISC",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@stripoinc/ui-editor-extensions": "3.5.0",
|
|
36
|
-
"@useinsider/design-system-vue": "0.
|
|
36
|
+
"@useinsider/design-system-vue": "1.1.0-beta.73ec2fa",
|
|
37
|
+
"@useinsider/guido": "3.1.1-beta.22d798c",
|
|
37
38
|
"@vueuse/core": "11.3.0",
|
|
38
39
|
"lodash-es": "4.17.21",
|
|
39
40
|
"pinia": "2.3.1",
|