@useinsider/guido 1.0.2-beta.3996a64 → 1.0.2-beta.3acb77d
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/@types/events.d.ts +0 -6
- package/dist/@types/generic.d.ts +4 -0
- package/dist/components/Guido.vue.js +2 -2
- package/dist/components/Guido.vue2.js +25 -27
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -15
- package/dist/components/organisms/header/RightSlot.vue.js +1 -1
- package/dist/components/organisms/header/RightSlot.vue2.js +20 -25
- package/dist/components/organisms/header/ViewOptions.vue.js +9 -9
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +11 -11
- package/dist/composables/useHtmlCompiler.js +17 -9
- package/dist/composables/useHtmlValidator.d.ts +3 -0
- package/dist/composables/useHtmlValidator.js +120 -0
- package/dist/composables/usePartner.d.ts +0 -1
- package/dist/composables/usePartner.js +9 -16
- package/dist/composables/usePreviewMode.js +14 -15
- package/dist/composables/useRecommendation.d.ts +19 -0
- package/dist/composables/useRecommendation.js +27 -0
- package/dist/composables/useSave.d.ts +3 -0
- package/dist/composables/useSave.js +14 -0
- package/dist/composables/useStripo.js +35 -37
- package/dist/config/compiler/outlookCompilerRules.d.ts +2 -0
- package/dist/config/compiler/outlookCompilerRules.js +36 -0
- package/dist/config/compiler/recommendationCompilerRules.d.ts +2 -0
- package/dist/config/compiler/recommendationCompilerRules.js +83 -0
- package/dist/config/compiler/socialCompilerRules.d.ts +2 -0
- package/dist/config/compiler/socialCompilerRules.js +21 -0
- package/dist/config/compiler/unsubscribeCompilerRules.d.ts +2 -0
- package/dist/config/compiler/unsubscribeCompilerRules.js +64 -0
- package/dist/enums/defaults.d.ts +5 -2
- package/dist/enums/defaults.js +9 -37
- package/dist/enums/html-validator.d.ts +6 -0
- package/dist/enums/html-validator.js +7 -0
- package/dist/enums/recommendation.d.ts +54 -0
- package/dist/enums/recommendation.js +56 -0
- package/dist/enums/unsubscribe.d.ts +15 -0
- package/dist/enums/unsubscribe.js +17 -0
- package/dist/guido.css +1 -1
- package/dist/stores/dynamic-content.d.ts +12 -0
- package/dist/stores/dynamic-content.js +7 -6
- package/dist/stores/editor.d.ts +0 -21
- package/dist/stores/editor.js +1 -2
- package/dist/stores/preview.js +1 -3
- package/dist/stores/recommendation.d.ts +10 -0
- package/dist/stores/recommendation.js +9 -0
- package/dist/stores/unsubscribe.d.ts +8 -0
- package/dist/stores/unsubscribe.js +9 -0
- package/dist/utils/genericUtil.js +9 -6
- package/dist/utils/templatePreparation.js +21 -14
- package/package.json +1 -1
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +0 -20
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +0 -37
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +0 -83
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +0 -17
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +0 -30
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +0 -19
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +0 -38
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +0 -62
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +0 -20
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +0 -37
- package/dist/composables/useStripoEventHandler.d.ts +0 -3
- package/dist/composables/useStripoEventHandler.js +0 -20
- package/dist/enums/onboarding.d.ts +0 -1
- package/dist/enums/onboarding.js +0 -8
- package/dist/services/onboardingApi.d.ts +0 -4
- package/dist/services/onboardingApi.js +0 -23
- package/dist/static/assets/onboarding-img.svg.js +0 -4
- package/dist/stores/onboarding.d.ts +0 -1004
- package/dist/stores/onboarding.js +0 -95
- /package/dist/mock/api/{user-modal-state.d.ts → validator.d.ts} +0 -0
package/dist/@types/events.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
1
|
export type StripoEventType = 'save' | 'export' | 'close' | 'autosave' | 'publish' | 'export:requested' | 'export:ready';
|
|
2
|
-
export interface EventHandler {
|
|
3
|
-
(params: Record<string, string>): void | Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
export interface EventHandlers {
|
|
6
|
-
[eventType: string]: EventHandler;
|
|
7
|
-
}
|
package/dist/@types/generic.d.ts
CHANGED
|
@@ -3,14 +3,14 @@ import a from "./Guido.vue2.js";
|
|
|
3
3
|
import i 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), 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.SaveAsTemplateDrawer), r(e.
|
|
6
|
+
return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper), 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.SaveAsTemplateDrawer), r(e.LoadingWrapper)], 1);
|
|
7
7
|
}, s = [], d = /* @__PURE__ */ i(
|
|
8
8
|
a,
|
|
9
9
|
t,
|
|
10
10
|
s,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"aef3bfa0"
|
|
14
14
|
);
|
|
15
15
|
const v = d.exports;
|
|
16
16
|
export {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as P, defineAsyncComponent as _, computed as b, watch as k, onMounted as A, onUnmounted as H } from "vue";
|
|
2
2
|
import { provideGuidoActions as N } from "../composables/useGuidoActions.js";
|
|
3
3
|
import { usePartner as U } from "../composables/usePartner.js";
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import { DefaultUsername as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
4
|
+
import { useStripo as W } from "../composables/useStripo.js";
|
|
5
|
+
import { DefaultUsername as x, DefaultMessageType as M, DefaultGuidoConfig as z } from "../enums/defaults.js";
|
|
6
|
+
import B from "./organisms/base/Toaster.vue.js";
|
|
7
|
+
import F from "./organisms/header/HeaderWrapper.vue.js";
|
|
8
|
+
import K from "./organisms/LoadingWrapper.vue.js";
|
|
9
9
|
import R from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
10
10
|
import { useStripoApi as j } from "../services/stripoApi.js";
|
|
11
11
|
import { useDynamicContentStore as q } from "../stores/dynamic-content.js";
|
|
12
12
|
import { useEditorStore as J } from "../stores/editor.js";
|
|
13
|
-
import { usePreviewStore as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
13
|
+
import { usePreviewStore as O } from "../stores/preview.js";
|
|
14
|
+
import Q from "../node_modules/lodash-es/merge.js";
|
|
15
|
+
const me = /* @__PURE__ */ P({
|
|
16
16
|
__name: "Guido",
|
|
17
17
|
props: {
|
|
18
18
|
templateId: null,
|
|
@@ -27,35 +27,33 @@ const de = /* @__PURE__ */ k({
|
|
|
27
27
|
guidoConfig: null
|
|
28
28
|
},
|
|
29
29
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change"],
|
|
30
|
-
setup(
|
|
31
|
-
const t =
|
|
30
|
+
setup(E, { expose: T, emit: o }) {
|
|
31
|
+
const t = E, G = _(
|
|
32
32
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
33
|
-
),
|
|
34
|
-
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
35
|
-
), n = q(), c = J(), P = Q(), r = E(() => c.hasChanges), a = t.preselectedDynamicContentList || [], { getPartnerName: m, getProductType: d } = U(), {
|
|
33
|
+
), n = q(), c = J(), I = O(), r = b(() => c.hasChanges), a = t.preselectedDynamicContentList || [], { getPartnerName: m, getProductType: d } = U(), {
|
|
36
34
|
templateId: l,
|
|
37
|
-
userId:
|
|
38
|
-
guidoConfig:
|
|
35
|
+
userId: u,
|
|
36
|
+
guidoConfig: p,
|
|
39
37
|
html: g = "",
|
|
40
38
|
css: f = "",
|
|
41
39
|
partnerName: i = m(),
|
|
42
40
|
productType: s = d(),
|
|
43
|
-
messageType: y =
|
|
44
|
-
username: C =
|
|
41
|
+
messageType: y = M,
|
|
42
|
+
username: C = x
|
|
45
43
|
} = t;
|
|
46
|
-
window.GuidoConfig =
|
|
44
|
+
window.GuidoConfig = Q(z, p), window.GuidoConfig.partner = {
|
|
47
45
|
partnerName: i,
|
|
48
46
|
productType: s,
|
|
49
47
|
messageType: y
|
|
50
48
|
};
|
|
51
|
-
const { initPlugin: v } =
|
|
49
|
+
const { initPlugin: v } = W({
|
|
52
50
|
emailId: l,
|
|
53
|
-
userId:
|
|
51
|
+
userId: u,
|
|
54
52
|
username: C,
|
|
55
53
|
partnerName: i,
|
|
56
54
|
productType: s,
|
|
57
55
|
preselectedDynamicContentList: a
|
|
58
|
-
}), { getDefaultTemplate: w } = j(),
|
|
56
|
+
}), { getDefaultTemplate: w } = j(), L = b(() => {
|
|
59
57
|
var e;
|
|
60
58
|
return !((e = window.GuidoConfig) != null && e.useHeader);
|
|
61
59
|
});
|
|
@@ -75,9 +73,9 @@ const de = /* @__PURE__ */ k({
|
|
|
75
73
|
}, D = () => {
|
|
76
74
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
77
75
|
};
|
|
78
|
-
return
|
|
76
|
+
return k(() => r.value, () => {
|
|
79
77
|
o("on-change");
|
|
80
|
-
}),
|
|
78
|
+
}), A(async () => {
|
|
81
79
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
82
80
|
try {
|
|
83
81
|
let e = {
|
|
@@ -96,15 +94,15 @@ const de = /* @__PURE__ */ k({
|
|
|
96
94
|
});
|
|
97
95
|
}), H(() => {
|
|
98
96
|
window.UIEditor.removeEditor();
|
|
99
|
-
}),
|
|
97
|
+
}), T({
|
|
100
98
|
dynamicContent: {
|
|
101
99
|
insert: h,
|
|
102
100
|
close: D
|
|
103
101
|
},
|
|
104
102
|
hasChanges: r
|
|
105
|
-
}), { __sfc: !0, PreviewContainer:
|
|
103
|
+
}), { __sfc: !0, PreviewContainer: G, dynamicContentStore: n, props: t, editorStore: c, previewStore: I, hasChanges: r, preselectedDynamicContentList: a, getPartnerName: m, getProductType: d, templateId: l, userId: u, guidoConfig: p, html: g, css: f, partnerName: i, productType: s, messageType: y, username: C, emit: o, initPlugin: v, getDefaultTemplate: w, noHeader: L, insertDynamicContent: h, closeDynamicContent: D, Toaster: B, HeaderWrapper: F, LoadingWrapper: K, SaveAsTemplateDrawer: R };
|
|
106
104
|
}
|
|
107
105
|
});
|
|
108
106
|
export {
|
|
109
|
-
|
|
107
|
+
me as default
|
|
110
108
|
};
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const v = /* @__PURE__ */ r({
|
|
1
|
+
import { defineComponent as m, computed as n } from "vue";
|
|
2
|
+
import { useTranslations as r } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { usePreviewStore as i } from "../../../../stores/preview.js";
|
|
4
|
+
import { InButtonV2 as s, InSegments as l } from "@useinsider/design-system-vue";
|
|
5
|
+
const _ = /* @__PURE__ */ m({
|
|
7
6
|
__name: "AmpToggle",
|
|
8
|
-
setup(
|
|
9
|
-
const t =
|
|
7
|
+
setup(p) {
|
|
8
|
+
const t = i(), e = r(), o = n(() => [
|
|
10
9
|
{
|
|
11
|
-
text:
|
|
10
|
+
text: e("dynamic-creatives.html"),
|
|
12
11
|
value: "html"
|
|
13
12
|
},
|
|
14
13
|
{
|
|
15
|
-
text:
|
|
14
|
+
text: e("email-editor.amp-html"),
|
|
16
15
|
value: "AMP",
|
|
17
|
-
tooltipText: t.hasAMP ? "" :
|
|
16
|
+
tooltipText: t.hasAMP ? "" : e("email-editor.preview-amp-unavailable-tooltip"),
|
|
18
17
|
position: "bottom",
|
|
19
18
|
align: "center",
|
|
20
19
|
disable: !t.hasAMP
|
|
21
20
|
}
|
|
22
21
|
]);
|
|
23
|
-
return { __sfc: !0, previewStore: t,
|
|
24
|
-
t.setEmailFormat(
|
|
25
|
-
}, InSegments:
|
|
22
|
+
return { __sfc: !0, previewStore: t, trans: e, segmentList: o, handleFormatChange: (a) => {
|
|
23
|
+
t.setEmailFormat(a);
|
|
24
|
+
}, InSegments: l, InButtonV2: s };
|
|
26
25
|
}
|
|
27
26
|
});
|
|
28
27
|
export {
|
|
29
|
-
|
|
28
|
+
_ as default
|
|
30
29
|
};
|
|
@@ -3,7 +3,7 @@ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
|
3
3
|
var l = function() {
|
|
4
4
|
var s, i;
|
|
5
5
|
var o = this, e = o._self._c, t = o._self._setupProxy;
|
|
6
|
-
return e("div", { staticClass: "d-f" }, [(s = t.config.features) != null && s.versionHistory ? 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, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.
|
|
6
|
+
return e("div", { staticClass: "d-f" }, [(s = t.config.features) != null && s.versionHistory ? 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 = t.config.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(), 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"), "tooltip-text": t.trans("newsletter.test-email") } }), 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: t.handleSave } })], 1);
|
|
7
7
|
}, r = [], d = /* @__PURE__ */ a(
|
|
8
8
|
n,
|
|
9
9
|
l,
|
|
@@ -1,36 +1,31 @@
|
|
|
1
|
-
import { defineComponent as v, ref as
|
|
1
|
+
import { defineComponent as v, ref as p, computed as d } from "vue";
|
|
2
2
|
import { useConfig as y } from "../../../composables/useConfig.js";
|
|
3
|
-
import { useExport as
|
|
4
|
-
import {
|
|
5
|
-
import { useTranslations as
|
|
6
|
-
import { useVersionHistoryApi as
|
|
7
|
-
import { useEditorStore as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
const q = /* @__PURE__ */ v({
|
|
3
|
+
import { useExport as S } from "../../../composables/useExport.js";
|
|
4
|
+
import { useSave as g } from "../../../composables/useSave.js";
|
|
5
|
+
import { useTranslations as h } from "../../../composables/useTranslations.js";
|
|
6
|
+
import { useVersionHistoryApi as H } from "../../../composables/useVersionHistoryApi.js";
|
|
7
|
+
import { useEditorStore as _ } from "../../../stores/editor.js";
|
|
8
|
+
import { getTooltipOptions as V } from "../../../utils/tooltipUtils.js";
|
|
9
|
+
import { InButtonV2 as x } from "@useinsider/design-system-vue";
|
|
10
|
+
const j = /* @__PURE__ */ v({
|
|
12
11
|
__name: "RightSlot",
|
|
13
|
-
setup(
|
|
14
|
-
const { config:
|
|
15
|
-
if (
|
|
12
|
+
setup(w) {
|
|
13
|
+
const { config: l } = y(), { exportHtml: r } = S(), { save: n } = g(), { openVersionHistory: i, closeVersionHistory: a } = H(), o = _(), t = h(), e = p(!1), s = p(!1), m = () => {
|
|
14
|
+
if (o.isVersionHistoryOpen) {
|
|
16
15
|
a();
|
|
17
16
|
return;
|
|
18
17
|
}
|
|
19
18
|
i();
|
|
19
|
+
}, u = async () => {
|
|
20
|
+
e.value = !0, await r(), e.value = !1;
|
|
20
21
|
}, c = () => {
|
|
21
|
-
|
|
22
|
-
}, f = d(() =>
|
|
23
|
-
return { __sfc: !0, config:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const { prepareTemplateDetails: r } = w(), u = await r();
|
|
27
|
-
n(u), o.value = !1, t.loadingStatus = !1;
|
|
28
|
-
} catch (r) {
|
|
29
|
-
console.error("Failed to get template data for save:", r);
|
|
30
|
-
}
|
|
31
|
-
}, getTooltipOptions: x, InButtonV2: C };
|
|
22
|
+
o.isSaveAsTemplateDrawerOpen = !0;
|
|
23
|
+
}, f = d(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history"));
|
|
24
|
+
return { __sfc: !0, config: l, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, handleVersionHistory: m, handleExport: u, handleSaveAs: c, versionHistoryTooltipText: f, handleSave: async () => {
|
|
25
|
+
s.value = !0, o.loadingStatus = !0, await n(), s.value = !1, o.loadingStatus = !1;
|
|
26
|
+
}, getTooltipOptions: V, InButtonV2: x };
|
|
32
27
|
}
|
|
33
28
|
});
|
|
34
29
|
export {
|
|
35
|
-
|
|
30
|
+
j as default
|
|
36
31
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./ViewOptions.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
3
|
+
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var r = function() {
|
|
5
|
-
var t = this,
|
|
6
|
-
return
|
|
7
|
-
}, n = [],
|
|
8
|
-
|
|
5
|
+
var t = this, i = t._self._c, e = t._self._setupProxy;
|
|
6
|
+
return i(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "", disable: e.editorStore.isViewOptionsDisabled, "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } });
|
|
7
|
+
}, n = [], _ = /* @__PURE__ */ s(
|
|
8
|
+
o,
|
|
9
9
|
r,
|
|
10
10
|
n,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"ad3cf7cc"
|
|
14
14
|
);
|
|
15
|
-
const
|
|
15
|
+
const m = _.exports;
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
m as default
|
|
18
18
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import s from "./ViewOptions.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
5
|
-
var t = this,
|
|
6
|
-
return
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
n,
|
|
3
|
+
import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var r = function() {
|
|
5
|
+
var t = this, o = t._self._c, e = t._self._setupProxy;
|
|
6
|
+
return o(e.InSegments, { attrs: { id: "guido__verion-history-view-option-selection", "with-icon": "", "segment-list": e.segmentList, selected: e.versionHistoryStore.editorVisualMode }, on: { click: e.changeVisualMode } });
|
|
7
|
+
}, n = [], _ = /* @__PURE__ */ i(
|
|
8
|
+
s,
|
|
10
9
|
r,
|
|
10
|
+
n,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"421ffc13"
|
|
14
14
|
);
|
|
15
|
-
const
|
|
15
|
+
const f = _.exports;
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
f as default
|
|
18
18
|
};
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import { defaultHtmlCompilerRules as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { defaultHtmlCompilerRules as t } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
+
import { outlookCompilerRules as p } from "../config/compiler/outlookCompilerRules.js";
|
|
3
|
+
import { recommendationCompilerRules as s } from "../config/compiler/recommendationCompilerRules.js";
|
|
4
|
+
import { socialCompilerRules as u } from "../config/compiler/socialCompilerRules.js";
|
|
5
|
+
import { unsubscribeCompilerRules as n } from "../config/compiler/unsubscribeCompilerRules.js";
|
|
6
|
+
import { createHtmlCompiler as c } from "../utils/htmlCompiler.js";
|
|
7
|
+
import { useConfig as f } from "./useConfig.js";
|
|
8
|
+
const h = () => {
|
|
9
|
+
const { config: e } = f(), l = e.htmlCompilerRules || [], m = [
|
|
10
|
+
...!!e.ignoreDefaultHtmlCompilerRules ? [] : t,
|
|
11
|
+
...s,
|
|
12
|
+
...n,
|
|
13
|
+
...p,
|
|
14
|
+
...u,
|
|
7
15
|
...l.map((o, i) => ({
|
|
8
16
|
...o,
|
|
9
17
|
priority: o.priority + 1e3 + i
|
|
10
18
|
// Ensure additional rules run after default rules
|
|
11
19
|
}))
|
|
12
|
-
],
|
|
13
|
-
return { compileHtml: (o) =>
|
|
20
|
+
], r = c(m);
|
|
21
|
+
return { compileHtml: (o) => r.compile(o) };
|
|
14
22
|
};
|
|
15
23
|
export {
|
|
16
|
-
|
|
24
|
+
h as useHtmlCompiler
|
|
17
25
|
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { useConfig as V } from "./useConfig.js";
|
|
2
|
+
import { TemplateTypes as H } from "../enums/defaults.js";
|
|
3
|
+
import { DISPLAY_CONDITIONS_REGEX as O, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as B, CampaignCouldNotBeSavedKey as _, CanNotMakeAnyChangesForRunningKey as R } from "../enums/html-validator.js";
|
|
4
|
+
import { ToasterTypeOptions as r } from "../enums/toaster.js";
|
|
5
|
+
import { useRecommendationStore as D } from "../stores/recommendation.js";
|
|
6
|
+
import { base64EncodeWithSpecialChars as P } from "../utils/base64.js";
|
|
7
|
+
import { useHttp as X } from "./useHttp.js";
|
|
8
|
+
import { useToaster as j } from "./useToaster.js";
|
|
9
|
+
import { useTranslations as z } from "./useTranslations.js";
|
|
10
|
+
const tt = () => {
|
|
11
|
+
var d;
|
|
12
|
+
const { showToaster: a } = j(), { post: y } = X(), { config: C } = V(), i = z(), m = D(), f = ((d = C.partner) == null ? void 0 : d.messageType) === H.transactional, h = async (t) => {
|
|
13
|
+
const e = await y(
|
|
14
|
+
"/newsletter/template-library/check-template-html-body",
|
|
15
|
+
{ html: P(t) }
|
|
16
|
+
), { status: n, message: c } = e.data;
|
|
17
|
+
return n || a({
|
|
18
|
+
type: r.Alert,
|
|
19
|
+
message: n === void 0 ? c : i("newsletter.invalid-url-link-for-toaster")
|
|
20
|
+
}), i(_), c === i(R) && a({
|
|
21
|
+
type: r.Alert,
|
|
22
|
+
message: i("newsletter.already-in-progress")
|
|
23
|
+
}), n;
|
|
24
|
+
}, v = (t) => !["if", "endif", "else", "elif", "now"].includes(t.toLowerCase()), w = (t) => ["if", "endif"].includes(t.toLowerCase()), S = (t, s) => {
|
|
25
|
+
const e = t.match(/({%(.*?)%})/g);
|
|
26
|
+
let n = !0;
|
|
27
|
+
return e !== null && !f && e.forEach((c) => {
|
|
28
|
+
const o = c.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
29
|
+
if (o && o.length > 0) {
|
|
30
|
+
const [l] = o;
|
|
31
|
+
v(l) && !s.includes(l) && (a({
|
|
32
|
+
type: r.Warning,
|
|
33
|
+
message: i("custom-fields.invalid-custom-fields")
|
|
34
|
+
}), n = !1);
|
|
35
|
+
}
|
|
36
|
+
}), n;
|
|
37
|
+
}, E = async (t, s, e) => {
|
|
38
|
+
const n = e ? await h(t) : !0;
|
|
39
|
+
return S(t, s) && n;
|
|
40
|
+
}, T = (t) => t.length > 0 ? !0 : (a({
|
|
41
|
+
type: r.Warning,
|
|
42
|
+
message: i("newsletter.html-content-is-empty")
|
|
43
|
+
}), !1), I = (t) => {
|
|
44
|
+
const s = (t.match(/{/gm) || []).length, e = (t.match(/}/gm) || []).length;
|
|
45
|
+
return s > e && a({
|
|
46
|
+
type: r.Warning,
|
|
47
|
+
message: i("custom-fields.missing-closing-braces")
|
|
48
|
+
}), s < e && a({
|
|
49
|
+
type: r.Warning,
|
|
50
|
+
message: i("custom-fields.missing-opening-braces")
|
|
51
|
+
}), s === e;
|
|
52
|
+
}, A = (t) => {
|
|
53
|
+
const s = t.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
|
|
54
|
+
return s || a({
|
|
55
|
+
type: r.Warning,
|
|
56
|
+
message: i("custom-fields.invalid-custom-fields")
|
|
57
|
+
}), s;
|
|
58
|
+
}, W = (t, s) => {
|
|
59
|
+
const e = t.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
|
|
60
|
+
if (e && !f) {
|
|
61
|
+
const n = s.map((o) => o.toLowerCase()), c = e.some((o) => {
|
|
62
|
+
const l = o.replace("{{", "").replace("}}", "").trim().toLowerCase();
|
|
63
|
+
return !n.includes(l) || l === "";
|
|
64
|
+
});
|
|
65
|
+
return c && a({
|
|
66
|
+
type: r.Warning,
|
|
67
|
+
message: i("custom-fields.invalid-custom-fields")
|
|
68
|
+
}), !c;
|
|
69
|
+
}
|
|
70
|
+
return !0;
|
|
71
|
+
}, x = (t) => {
|
|
72
|
+
const s = t.match(/{%(.*?)%}/g), e = [];
|
|
73
|
+
let n = !0;
|
|
74
|
+
if (s && s.forEach((c) => {
|
|
75
|
+
const o = c.match(O), l = c.match(B), L = (o == null ? void 0 : o.join("")) || "";
|
|
76
|
+
(!o || c !== L) && !l && (a({
|
|
77
|
+
type: r.Alert,
|
|
78
|
+
message: i("newsletter.display-conditions-invalid-syntax")
|
|
79
|
+
}), n = !1), o && o.forEach((u) => {
|
|
80
|
+
u.trim() === "=" && (a({
|
|
81
|
+
type: r.Alert,
|
|
82
|
+
message: i("custom-conditions.wrong-equality-operators")
|
|
83
|
+
}), n = !1);
|
|
84
|
+
const g = u.match(/^[a-zA-Z]*$/g);
|
|
85
|
+
g && g.forEach((p) => {
|
|
86
|
+
w(p) && e.push(p);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}), e.length) {
|
|
90
|
+
const c = e.filter((l) => l === "if"), o = e.filter((l) => l === "endif");
|
|
91
|
+
c.length !== o.length && (a({
|
|
92
|
+
type: r.Alert,
|
|
93
|
+
message: i("custom-conditions.missing-if-endif-tag")
|
|
94
|
+
}), n = !1);
|
|
95
|
+
}
|
|
96
|
+
return n;
|
|
97
|
+
}, b = (t) => {
|
|
98
|
+
const s = (t.match(/{% /gm) || []).length, e = (t.match(/ %}/gm) || []).length, n = s === e;
|
|
99
|
+
return n || a({
|
|
100
|
+
type: r.Warning,
|
|
101
|
+
message: i("custom-conditions.no-space-after-braces")
|
|
102
|
+
}), n;
|
|
103
|
+
}, N = (t) => (t.match(/({%(.*?)%})/g) || []).filter((e) => e.includes("if")).map((e) => (e.match(/{{.*}}/gm) || []).length).reduce((e, n) => e + n, 0) > 0 ? (a({
|
|
104
|
+
type: r.Warning,
|
|
105
|
+
message: i("custom-conditions.no-braces-inside-if-tag")
|
|
106
|
+
}), !1) : !0, k = () => m.recommendationConfigs && Object.values(m.recommendationConfigs).find((s) => s.filters.find((e) => e.value === "")) !== void 0 ? (a({
|
|
107
|
+
type: r.Alert,
|
|
108
|
+
message: i("newsletter.fill-all-necessary-fields")
|
|
109
|
+
}), !1) : !0, F = (t) => {
|
|
110
|
+
const s = /src="[^"]*\.(svg|pst)"/gm;
|
|
111
|
+
return t.match(s) === null ? !0 : (a({
|
|
112
|
+
type: r.Alert,
|
|
113
|
+
message: i("newsletter.invalid-image-type")
|
|
114
|
+
}), !1);
|
|
115
|
+
};
|
|
116
|
+
return { validateHtml: async (t, s, e = !1) => await E(t, s, e) && T(t) && I(t) && A(t) && W(t, s) && x(t) && b(t) && N(t) && k() && F(t) };
|
|
117
|
+
};
|
|
118
|
+
export {
|
|
119
|
+
tt as useHtmlValidator
|
|
120
|
+
};
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
isTestPartner: () => {
|
|
11
|
-
const t = e();
|
|
12
|
-
return r.includes(t);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
};
|
|
1
|
+
import { DefaultProductType as e, ProductIds as o } from "../enums/defaults.js";
|
|
2
|
+
const c = () => ({
|
|
3
|
+
getPartnerName: () => window.location.hostname.split(".")[0] || "",
|
|
4
|
+
getProductType: () => {
|
|
5
|
+
const t = window.location.pathname.split("/").filter(Boolean)[0] || e;
|
|
6
|
+
return o[t] || 0;
|
|
7
|
+
}
|
|
8
|
+
});
|
|
16
9
|
export {
|
|
17
|
-
|
|
10
|
+
c as usePartner
|
|
18
11
|
};
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { useEditorStore as
|
|
2
|
-
import { useOnboardingStore as m } from "../stores/onboarding.js";
|
|
1
|
+
import { useEditorStore as n } from "../stores/editor.js";
|
|
3
2
|
import { usePreviewStore as l } from "../stores/preview.js";
|
|
4
|
-
import { useActionsApi as
|
|
5
|
-
import { useCodeEditorApi as
|
|
3
|
+
import { useActionsApi as m } from "./useActionsApi.js";
|
|
4
|
+
import { useCodeEditorApi as p } from "./useCodeEditorApi.js";
|
|
6
5
|
const E = () => {
|
|
7
|
-
const
|
|
8
|
-
|
|
6
|
+
const o = n(), e = l(), { closeCodeEditor: a } = p(), { getPreviewData: s } = m(), r = () => {
|
|
7
|
+
o.isPreviewModeOpen = !1, e.$reset();
|
|
9
8
|
};
|
|
10
9
|
return {
|
|
11
|
-
closePreviewMode:
|
|
10
|
+
closePreviewMode: r,
|
|
12
11
|
openPreviewMode: () => {
|
|
13
|
-
|
|
12
|
+
o.isCodeEditorOpen && a(), o.isPreviewModeOpen = !0;
|
|
14
13
|
},
|
|
15
14
|
loadPreviewData: async () => {
|
|
16
|
-
if (!(
|
|
17
|
-
|
|
15
|
+
if (!(o.loadingStatus || e.isLoaded)) {
|
|
16
|
+
o.loadingStatus = !0;
|
|
18
17
|
try {
|
|
19
|
-
const { html:
|
|
20
|
-
|
|
21
|
-
} catch (
|
|
22
|
-
console.error("Failed to load preview data:",
|
|
18
|
+
const { html: t, ampHtml: i, ampErrors: d } = await s();
|
|
19
|
+
e.templateHtml = t || "", e.ampHtml = i || "", e.ampErrors = d || [], e.setEmailFormat(i ? "AMP" : "html"), e.isLoaded = !0;
|
|
20
|
+
} catch (t) {
|
|
21
|
+
console.error("Failed to load preview data:", t), r();
|
|
23
22
|
} finally {
|
|
24
|
-
|
|
23
|
+
o.loadingStatus = !1;
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type CardWidthParams = {
|
|
2
|
+
mobileLeftPadding: number;
|
|
3
|
+
mobileRightPadding: number;
|
|
4
|
+
cardsInRow: number;
|
|
5
|
+
unresponsive: boolean;
|
|
6
|
+
};
|
|
7
|
+
interface CampaignData extends CardWidthParams {
|
|
8
|
+
textTrimming: boolean;
|
|
9
|
+
orientation: string;
|
|
10
|
+
priceBeforeTextValue: string;
|
|
11
|
+
priceAfterTextValue: string;
|
|
12
|
+
discountBeforeTextValue: string;
|
|
13
|
+
discountAfterTextValue: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const useRecommendation: () => {
|
|
16
|
+
calculateCardWidth: ({ mobileLeftPadding, mobileRightPadding, cardsInRow, unresponsive, }: CardWidthParams) => number;
|
|
17
|
+
getRecommendationCampaignData: (id: string) => CampaignData;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { MinDeviceViewport as r, DefaultPadding as c } from "../enums/recommendation.js";
|
|
2
|
+
const m = () => ({
|
|
3
|
+
calculateCardWidth: ({
|
|
4
|
+
mobileLeftPadding: e,
|
|
5
|
+
mobileRightPadding: a,
|
|
6
|
+
cardsInRow: n,
|
|
7
|
+
unresponsive: i
|
|
8
|
+
}) => {
|
|
9
|
+
const t = i ? n : 1, o = e + a + (t - 1) * c;
|
|
10
|
+
return (r - o) / t;
|
|
11
|
+
},
|
|
12
|
+
getRecommendationCampaignData: (e) => (console.debug(e), {
|
|
13
|
+
textTrimming: !1,
|
|
14
|
+
orientation: "vertical",
|
|
15
|
+
mobileLeftPadding: 0,
|
|
16
|
+
mobileRightPadding: 0,
|
|
17
|
+
cardsInRow: 2,
|
|
18
|
+
unresponsive: !1,
|
|
19
|
+
priceBeforeTextValue: "",
|
|
20
|
+
priceAfterTextValue: "",
|
|
21
|
+
discountBeforeTextValue: "",
|
|
22
|
+
discountAfterTextValue: ""
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
m as useRecommendation
|
|
27
|
+
};
|