@useinsider/guido 1.0.0-beta.637a8ae → 1.0.0-beta.63d99fe
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/generic.d.ts +4 -5
- package/dist/@types/save-as-template.d.ts +11 -0
- package/dist/components/Guido.vue.d.ts +6 -1
- package/dist/components/Guido.vue.js +11 -11
- package/dist/components/Guido.vue2.js +58 -41
- package/dist/components/organisms/header/MiddleSlot.vue.js +6 -6
- package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -16
- package/dist/components/organisms/header/RightSlot.vue.js +3 -3
- package/dist/components/organisms/header/RightSlot.vue2.js +23 -22
- package/dist/components/organisms/header/ViewOptions.vue.js +7 -7
- package/dist/components/organisms/header/ViewOptions.vue2.js +8 -10
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +20 -0
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +58 -0
- package/dist/components/wrappers/{BaseModal.vue.d.ts → WpDrawer.vue.d.ts} +27 -40
- package/dist/components/wrappers/WpDrawer.vue.js +25 -0
- package/dist/components/wrappers/WpDrawer.vue2.js +23 -0
- package/dist/composables/useActionsApi.d.ts +0 -2
- package/dist/composables/useActionsApi.js +36 -47
- package/dist/composables/useStripo.js +25 -15
- package/dist/composables/useValidation.d.ts +30 -0
- package/dist/composables/useValidation.js +19 -0
- package/dist/composables/validators/saveAsTemplate.d.ts +26 -0
- package/dist/composables/validators/saveAsTemplate.js +21 -0
- package/dist/enums/defaults.js +6 -10
- package/dist/extensions/DynamicContent/dynamic-content.js +13 -15
- package/dist/guido.css +1 -1
- package/dist/mock/api/template-library.d.ts +2 -0
- package/dist/node_modules/valibot/dist/index.js +157 -0
- package/dist/stores/dynamic-content.d.ts +27 -0
- package/dist/stores/dynamic-content.js +23 -0
- package/dist/stores/editor.d.ts +2 -1
- package/dist/stores/editor.js +5 -4
- package/dist/stores/save-as-template.d.ts +25 -0
- package/dist/stores/save-as-template.js +44 -0
- package/dist/utils/arrayUtil.d.ts +1 -0
- package/dist/utils/arrayUtil.js +10 -0
- package/dist/utils/genericUtil.d.ts +2 -0
- package/dist/utils/genericUtil.js +7 -0
- package/package.json +2 -1
- package/dist/components/organisms/email-preview/EmailPreviewContainer.vue.d.ts +0 -15
- package/dist/components/organisms/email-preview/EmailPreviewContainer.vue.js +0 -17
- package/dist/components/organisms/email-preview/EmailPreviewContainer.vue2.js +0 -32
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +0 -16
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +0 -19
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +0 -37
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +0 -17
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +0 -57
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +0 -16
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +0 -22
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +0 -39
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -15
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -15
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -19
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +0 -17
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +0 -17
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +0 -17
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +0 -19
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +0 -23
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +0 -17
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +0 -17
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +0 -27
- package/dist/components/organisms/email-preview/mobile-preview/OpenedEmailView.vue.d.ts +0 -17
- package/dist/components/organisms/email-preview/mobile-preview/OpenedEmailView.vue.js +0 -19
- package/dist/components/organisms/email-preview/mobile-preview/OpenedEmailView.vue2.js +0 -26
- package/dist/components/wrappers/BaseModal.vue.js +0 -19
- package/dist/components/wrappers/BaseModal.vue2.js +0 -22
- package/dist/composables/useCodeEditorApi.d.ts +0 -5
- package/dist/composables/useCodeEditorApi.js +0 -17
- package/dist/composables/useDebounce.d.ts +0 -4
- package/dist/composables/useDebounce.js +0 -12
- package/dist/composables/useEmailResponsiveFit.d.ts +0 -5
- package/dist/composables/useEmailResponsiveFit.js +0 -72
- package/dist/composables/usePreviewMode.d.ts +0 -6
- package/dist/composables/usePreviewMode.js +0 -21
- package/dist/enums/gmailMobilePreview.d.ts +0 -7
- package/dist/enums/gmailMobilePreview.js +0 -17
- package/dist/static/assets/inbox-mockup.svg.js +0 -4
- package/dist/static/assets/phone-mockup.svg.js +0 -4
- package/dist/stores/preview.d.ts +0 -56
- package/dist/stores/preview.js +0 -23
- /package/dist/components/organisms/{email-preview/amp/AmpToggle.vue.d.ts → save-as-template/SaveAsTemplateDrawer.vue.d.ts} +0 -0
package/dist/@types/generic.d.ts
CHANGED
|
@@ -3,14 +3,13 @@ export type GuidoConfig = {
|
|
|
3
3
|
translationsPath: string;
|
|
4
4
|
htmlCompilerRules?: CompilerRule[];
|
|
5
5
|
ignoreDefaultHtmlCompilerRules?: boolean;
|
|
6
|
-
emailHeader: EmailHeader;
|
|
7
6
|
};
|
|
8
7
|
export type DynamicContent = {
|
|
9
8
|
value: string;
|
|
10
9
|
text: string;
|
|
11
10
|
fallback?: string;
|
|
12
11
|
};
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
12
|
+
export type MergeTag = {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
};
|
|
@@ -8,6 +8,7 @@ type __VLS_Props = {
|
|
|
8
8
|
username?: string;
|
|
9
9
|
html?: string;
|
|
10
10
|
css?: string;
|
|
11
|
+
preselectedDynamicContentList: DynamicContent[];
|
|
11
12
|
guidoConfig: GuidoConfig;
|
|
12
13
|
};
|
|
13
14
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
@@ -15,11 +16,15 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
|
|
|
15
16
|
insert: (data: DynamicContent) => void;
|
|
16
17
|
close: () => void;
|
|
17
18
|
};
|
|
19
|
+
hasChanges: import("vue").ComputedRef<boolean>;
|
|
18
20
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
19
21
|
"dynamic-content:open": (detail: DynamicContent | null) => void;
|
|
20
22
|
back: () => void;
|
|
21
23
|
"save:start": () => void;
|
|
22
|
-
"save:complete": (
|
|
24
|
+
"save:complete": (data: {
|
|
25
|
+
template: Omit<Template, "forceRecreate">;
|
|
26
|
+
dynamicContentList: DynamicContent[];
|
|
27
|
+
}) => void;
|
|
23
28
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
24
29
|
export default _default;
|
|
25
30
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
return r("div", { staticClass: "guido-editor__wrapper" }, [r(
|
|
7
|
-
},
|
|
8
|
-
o,
|
|
3
|
+
import o from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var s = function() {
|
|
5
|
+
var e = this, r = e._self._c, t = e._self._setupProxy;
|
|
6
|
+
return r("div", { staticClass: "guido-editor__wrapper" }, [r(t.HeaderWrapper), r("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } }), r(t.SaveAsTemplateDrawer)], 1);
|
|
7
|
+
}, i = [], _ = /* @__PURE__ */ o(
|
|
9
8
|
a,
|
|
10
|
-
|
|
9
|
+
s,
|
|
10
|
+
i,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"ac2711fd"
|
|
14
14
|
);
|
|
15
|
-
const
|
|
15
|
+
const f = _.exports;
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
f as default
|
|
18
18
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { DefaultUsername as k, DefaultGuidoConfig as T } from "../enums/defaults.js";
|
|
1
|
+
import { defineComponent as w, computed as E, onMounted as _ } from "vue";
|
|
2
|
+
import { provideGuidoActions as G } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as I } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as T } from "../composables/useStripo.js";
|
|
5
|
+
import { DefaultUsername as k, DefaultGuidoConfig as P } from "../enums/defaults.js";
|
|
7
6
|
import A from "./organisms/header/HeaderWrapper.vue.js";
|
|
8
|
-
import
|
|
9
|
-
|
|
7
|
+
import N from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
8
|
+
import { useStripoApi as x } from "../services/stripoApi.js";
|
|
9
|
+
import { useDynamicContentStore as W } from "../stores/dynamic-content.js";
|
|
10
|
+
import { useEditorStore as z } from "../stores/editor.js";
|
|
11
|
+
const O = /* @__PURE__ */ w({
|
|
10
12
|
__name: "Guido",
|
|
11
13
|
props: {
|
|
12
14
|
templateId: null,
|
|
@@ -16,66 +18,81 @@ const L = /* @__PURE__ */ E({
|
|
|
16
18
|
username: null,
|
|
17
19
|
html: null,
|
|
18
20
|
css: null,
|
|
21
|
+
preselectedDynamicContentList: null,
|
|
19
22
|
guidoConfig: null
|
|
20
23
|
},
|
|
21
24
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
-
templateId:
|
|
25
|
-
userId:
|
|
26
|
-
guidoConfig:
|
|
27
|
-
html:
|
|
28
|
-
css:
|
|
29
|
-
partnerName:
|
|
30
|
-
productType:
|
|
31
|
-
username:
|
|
32
|
-
} =
|
|
25
|
+
setup(b, { expose: L, emit: t }) {
|
|
26
|
+
const o = b, n = W(), s = z(), a = E(() => s.hasChanges), c = o.preselectedDynamicContentList || [], { getPartnerName: i, getProductType: r } = I(), {
|
|
27
|
+
templateId: m,
|
|
28
|
+
userId: d,
|
|
29
|
+
guidoConfig: l,
|
|
30
|
+
html: u = "",
|
|
31
|
+
css: p = "",
|
|
32
|
+
partnerName: y = i(),
|
|
33
|
+
productType: g = r(),
|
|
34
|
+
username: C = k
|
|
35
|
+
} = o;
|
|
33
36
|
window.GuidoConfig = {
|
|
34
|
-
...
|
|
35
|
-
...
|
|
37
|
+
...P,
|
|
38
|
+
...l
|
|
36
39
|
};
|
|
37
|
-
const { initPlugin:
|
|
38
|
-
|
|
40
|
+
const { initPlugin: f } = T({
|
|
41
|
+
emailId: m,
|
|
42
|
+
userId: d,
|
|
43
|
+
username: C,
|
|
44
|
+
partnerName: y,
|
|
45
|
+
productType: g,
|
|
46
|
+
preselectedDynamicContentList: c
|
|
47
|
+
}), { getDefaultTemplate: v } = x();
|
|
48
|
+
G({
|
|
39
49
|
onBack: () => {
|
|
40
|
-
console.debug("guido:back"),
|
|
50
|
+
console.debug("guido:back"), t("back");
|
|
41
51
|
},
|
|
42
52
|
onSaveStart: () => {
|
|
43
|
-
console.debug("guido:save:start"),
|
|
53
|
+
console.debug("guido:save:start"), t("save:start");
|
|
44
54
|
},
|
|
45
55
|
onSaveComplete: (e) => {
|
|
46
|
-
console.debug("guido:save:complete",
|
|
56
|
+
console.debug("guido:save:complete", {
|
|
57
|
+
template: e,
|
|
58
|
+
dynamicContentList: n.getSelectedDynamicContentList
|
|
59
|
+
}), t("save:complete", {
|
|
60
|
+
template: e,
|
|
61
|
+
dynamicContentList: n.getSelectedDynamicContentList
|
|
62
|
+
});
|
|
47
63
|
}
|
|
48
64
|
});
|
|
49
|
-
const
|
|
50
|
-
console.debug("dynamic-content:close", e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
51
|
-
},
|
|
65
|
+
const D = (e) => {
|
|
66
|
+
console.debug("dynamic-content:close", e), n.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
67
|
+
}, S = () => {
|
|
52
68
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
53
69
|
};
|
|
54
|
-
return
|
|
70
|
+
return _(async () => {
|
|
55
71
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
56
72
|
try {
|
|
57
73
|
let e = {
|
|
58
|
-
html:
|
|
59
|
-
css:
|
|
74
|
+
html: u,
|
|
75
|
+
css: p,
|
|
60
76
|
forceRecreate: !0
|
|
61
77
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
62
78
|
};
|
|
63
|
-
e.html || (e = await
|
|
79
|
+
e.html || (e = await v()), await f(e), n.selectedDynamicContentList = c;
|
|
64
80
|
} catch (e) {
|
|
65
81
|
console.error("Failed to initialize Stripo editor:", e);
|
|
66
82
|
}
|
|
67
83
|
document.addEventListener("dynamic-content:open", (e) => {
|
|
68
|
-
const
|
|
69
|
-
console.debug("dynamic-content:open",
|
|
84
|
+
const h = e;
|
|
85
|
+
console.debug("dynamic-content:open", h.detail), t("dynamic-content:open", h.detail);
|
|
70
86
|
});
|
|
71
|
-
}),
|
|
87
|
+
}), L({
|
|
72
88
|
dynamicContent: {
|
|
73
|
-
insert:
|
|
74
|
-
close:
|
|
75
|
-
}
|
|
76
|
-
|
|
89
|
+
insert: D,
|
|
90
|
+
close: S
|
|
91
|
+
},
|
|
92
|
+
hasChanges: a
|
|
93
|
+
}), { __sfc: !0, dynamicContentStore: n, props: o, editorStore: s, hasChanges: a, preselectedDynamicContentList: c, getPartnerName: i, getProductType: r, templateId: m, userId: d, guidoConfig: l, html: u, css: p, partnerName: y, productType: g, username: C, emit: t, initPlugin: f, getDefaultTemplate: v, insertDynamicContent: D, closeDynamicContent: S, HeaderWrapper: A, SaveAsTemplateDrawer: N };
|
|
77
94
|
}
|
|
78
95
|
});
|
|
79
96
|
export {
|
|
80
|
-
|
|
97
|
+
O as default
|
|
81
98
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import s from "./MiddleSlot.vue2.js";
|
|
2
2
|
import i from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var n = function() {
|
|
4
|
-
var
|
|
5
|
-
return t.editorStore.isVersionHistoryOpen ?
|
|
6
|
-
},
|
|
4
|
+
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
5
|
+
return t.editorStore.isVersionHistoryOpen ? o("div", { staticClass: "d-f" }, [o(t.VersionHistory), o(t.VersionHistoryViewOptions)], 1) : o("div", { staticClass: "d-f" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), o(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.trans("newsletter.email-preview") } }), o(t.ViewOptions, { staticClass: "ml-3" })], 1);
|
|
6
|
+
}, l = [], r = /* @__PURE__ */ i(
|
|
7
7
|
s,
|
|
8
8
|
n,
|
|
9
|
-
|
|
9
|
+
l,
|
|
10
10
|
!1,
|
|
11
11
|
null,
|
|
12
12
|
null
|
|
13
13
|
);
|
|
14
|
-
const
|
|
14
|
+
const p = r.exports;
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
p as default
|
|
17
17
|
};
|
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import w from "./ViewOptions.vue.js";
|
|
10
|
-
const H = /* @__PURE__ */ n({
|
|
1
|
+
import { defineComponent as r } from "vue";
|
|
2
|
+
import { useTranslations as s } from "../../../composables/useTranslations.js";
|
|
3
|
+
import { useEditorStore as n } from "../../../stores/editor.js";
|
|
4
|
+
import { InButtonV2 as e } from "@useinsider/design-system-vue";
|
|
5
|
+
import m from "./version-history/VersionHistory.vue.js";
|
|
6
|
+
import p from "./version-history/ViewOptions.vue.js";
|
|
7
|
+
import f from "./ViewOptions.vue.js";
|
|
8
|
+
const y = /* @__PURE__ */ r({
|
|
11
9
|
__name: "MiddleSlot",
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
return { __sfc: !0, editorStore:
|
|
15
|
-
id: `${
|
|
10
|
+
setup(a) {
|
|
11
|
+
const o = n(), t = s();
|
|
12
|
+
return { __sfc: !0, editorStore: o, trans: t, getTooltipOptions: (i) => ({
|
|
13
|
+
id: `${i}-tooltip`,
|
|
16
14
|
dynamicPosition: !1,
|
|
17
15
|
staticPosition: "bottom center",
|
|
18
16
|
iconStatus: !1
|
|
19
|
-
}),
|
|
17
|
+
}), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
|
|
20
18
|
}
|
|
21
19
|
});
|
|
22
20
|
export {
|
|
23
|
-
|
|
21
|
+
y as default
|
|
24
22
|
};
|
|
@@ -2,7 +2,7 @@ import o from "./RightSlot.vue2.js";
|
|
|
2
2
|
import i from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var n = function() {
|
|
4
4
|
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
5
|
-
return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "
|
|
5
|
+
return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.exportHtml } }), e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.handleSaveAs } }), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleSave } })], 1);
|
|
6
6
|
}, r = [], a = /* @__PURE__ */ i(
|
|
7
7
|
o,
|
|
8
8
|
n,
|
|
@@ -11,7 +11,7 @@ var n = function() {
|
|
|
11
11
|
null,
|
|
12
12
|
null
|
|
13
13
|
);
|
|
14
|
-
const
|
|
14
|
+
const u = a.exports;
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
u as default
|
|
17
17
|
};
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActionsApi as
|
|
3
|
-
import { useExport as
|
|
4
|
-
import { useSaveStart as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
const O = /* @__PURE__ */ p({
|
|
1
|
+
import { defineComponent as m } from "vue";
|
|
2
|
+
import { useActionsApi as p } from "../../../composables/useActionsApi.js";
|
|
3
|
+
import { useExport as c } from "../../../composables/useExport.js";
|
|
4
|
+
import { useSaveStart as l, useSaveComplete as d } from "../../../composables/useGuidoActions.js";
|
|
5
|
+
import { useVersionHistoryApi as f } from "../../../composables/useVersionHistoryApi.js";
|
|
6
|
+
import { useEditorStore as u } from "../../../stores/editor.js";
|
|
7
|
+
import { InButtonV2 as S } from "@useinsider/design-system-vue";
|
|
8
|
+
const w = /* @__PURE__ */ m({
|
|
10
9
|
__name: "RightSlot",
|
|
11
|
-
setup(
|
|
12
|
-
const { exportHtml:
|
|
13
|
-
return { __sfc: !0, exportHtml:
|
|
14
|
-
if (
|
|
10
|
+
setup(h) {
|
|
11
|
+
const { exportHtml: a } = c(), { getCompiledEmail: o } = p(), r = l(), s = d(), { openVersionHistory: n, closeVersionHistory: i } = f(), e = u();
|
|
12
|
+
return { __sfc: !0, exportHtml: a, getCompiledEmail: o, saveStart: r, saveComplete: s, openVersionHistory: n, closeVersionHistory: i, editorStore: e, handleVersionHistory: () => {
|
|
13
|
+
if (e.isVersionHistoryOpen) {
|
|
15
14
|
i();
|
|
16
15
|
return;
|
|
17
16
|
}
|
|
18
|
-
|
|
17
|
+
n();
|
|
18
|
+
}, handleSaveAs: () => {
|
|
19
|
+
e.isSaveAsTemplateDrawerOpen = !0;
|
|
19
20
|
}, handleSave: async () => {
|
|
20
|
-
|
|
21
|
+
r();
|
|
21
22
|
try {
|
|
22
|
-
const { html:
|
|
23
|
-
|
|
24
|
-
html:
|
|
23
|
+
const { html: t } = await o();
|
|
24
|
+
s({
|
|
25
|
+
html: t || "",
|
|
25
26
|
css: ""
|
|
26
27
|
// CSS is embedded in HTML from Stripo
|
|
27
28
|
});
|
|
28
|
-
} catch (
|
|
29
|
-
console.error("Failed to get template data for save:",
|
|
29
|
+
} catch (t) {
|
|
30
|
+
console.error("Failed to get template data for save:", t);
|
|
30
31
|
}
|
|
31
|
-
}, InButtonV2:
|
|
32
|
+
}, InButtonV2: S };
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
+
w as default
|
|
36
37
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from "./ViewOptions.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var n = function() {
|
|
5
5
|
var t = this, o = t._self._c, e = t._self._setupProxy;
|
|
6
|
-
return o(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "",
|
|
7
|
-
},
|
|
8
|
-
s,
|
|
6
|
+
return o(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "", "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } });
|
|
7
|
+
}, i = [], _ = /* @__PURE__ */ s(
|
|
9
8
|
r,
|
|
10
9
|
n,
|
|
10
|
+
i,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"0fff376c"
|
|
14
14
|
);
|
|
15
15
|
const l = _.exports;
|
|
16
16
|
export {
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const f = /* @__PURE__ */ i({
|
|
1
|
+
import { defineComponent as e } from "vue";
|
|
2
|
+
import { useEditorStore as t } from "../../../stores/editor.js";
|
|
3
|
+
import { InSegments as o } from "@useinsider/design-system-vue";
|
|
4
|
+
const u = /* @__PURE__ */ e({
|
|
6
5
|
__name: "ViewOptions",
|
|
7
|
-
setup(
|
|
8
|
-
|
|
6
|
+
setup(n) {
|
|
7
|
+
return { __sfc: !0, editorStore: t(), segmentList: [
|
|
9
8
|
{ text: "", icon: "line-desktop", value: "desktop" },
|
|
10
9
|
{ text: "", icon: "line-menu-mobileapp", value: "mobile" }
|
|
11
|
-
],
|
|
12
|
-
return { __sfc: !0, editorStore: e, segmentList: o, isPreviewModeOpen: t, InSegments: s };
|
|
10
|
+
], InSegments: o };
|
|
13
11
|
}
|
|
14
12
|
});
|
|
15
13
|
export {
|
|
16
|
-
|
|
14
|
+
u as default
|
|
17
15
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import s from "./SaveAsTemplateDrawer.vue2.js";
|
|
2
|
+
import l from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var r = function() {
|
|
4
|
+
var a = this, e = a._self._c, t = a._self._setupProxy;
|
|
5
|
+
return e(t.WpDrawer, { attrs: { id: "save-as-template-modal", "description-status": "", "description-text": t.trans("newsletter.save-template-description"), "footer-button-group-options": t.footerButtonGroupOptions, status: t.editorStore.isSaveAsTemplateDrawerOpen, "title-text": t.trans("products.save-template") }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.saveTemplate } }, [e(t.InBasicTextInput, { staticClass: "mb-5 w-1", attrs: { id: "template-name-input", name: "templateName", "character-counter-status": !1, "disabled-status": t.isSaving, "label-text": t.trans("products.template-name"), "placeholder-text": t.trans("newsletter.enter-template-name"), "skeleton-sizing": { width: 495, height: 44 }, "skeleton-status": t.saveAsTemplateStore.skeletonStatus, "state-message": t.templateNameError, states: t.templateNameError ? "error" : "default", "tooltip-status": !1, value: t.saveAsTemplateStore.templateName }, on: { input: t.handleTemplateName } }), e(t.InMultiSelect, { staticClass: "template-category-dropdown mb-5 w-1", attrs: { "create-option-status": "", "search-status": "", "button-status": !1, "character-limit-validation-text": t.trans("validation-v2.duration-value", {
|
|
6
|
+
min: 1,
|
|
7
|
+
max: 25
|
|
8
|
+
}), "create-button-label": t.trans("products.create-new-category"), "disabled-status": t.isSaving, "label-text": t.trans("products.template-category"), "loading-state": t.isAddingOption, "max-character-limit": 25, options: t.saveAsTemplateStore.categories, "placeholder-text": t.trans("products.select-template-category"), "skeleton-sizing": { width: 495, height: 44 }, "skeleton-status": t.saveAsTemplateStore.skeletonStatus, value: t.saveAsTemplateStore.selectedCategories }, on: { addOption: t.handleAddOption, change: t.handleCategoryChange, resetAllOptions: t.handleResetAllOptions, selectAllOptions: t.handleSelectAllOptions } })], 1);
|
|
9
|
+
}, o = [], n = /* @__PURE__ */ l(
|
|
10
|
+
s,
|
|
11
|
+
r,
|
|
12
|
+
o,
|
|
13
|
+
!1,
|
|
14
|
+
null,
|
|
15
|
+
null
|
|
16
|
+
);
|
|
17
|
+
const c = n.exports;
|
|
18
|
+
export {
|
|
19
|
+
c as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineComponent as N, ref as i, computed as _, toRef as h } from "vue";
|
|
2
|
+
import A from "../../wrappers/WpDrawer.vue.js";
|
|
3
|
+
import { useTranslations as C } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { useTemplateNameValidator as b } from "../../../composables/validators/saveAsTemplate.js";
|
|
5
|
+
import { useEditorStore as w } from "../../../stores/editor.js";
|
|
6
|
+
import { useSaveAsTemplateStore as O } from "../../../stores/save-as-template.js";
|
|
7
|
+
import { InMultiSelect as B, InBasicTextInput as x } from "@useinsider/design-system-vue";
|
|
8
|
+
const z = /* @__PURE__ */ N({
|
|
9
|
+
__name: "SaveAsTemplateDrawer",
|
|
10
|
+
setup(D) {
|
|
11
|
+
const s = C(), o = w(), t = O(), a = i(!1), l = i(!1), u = _(() => ({
|
|
12
|
+
primaryButton: {
|
|
13
|
+
styling: "solid",
|
|
14
|
+
type: "primary",
|
|
15
|
+
labelText: s(a.value ? "newsletter.saving" : "products.save"),
|
|
16
|
+
loadingStatus: a.value,
|
|
17
|
+
disabledStatus: t.skeletonStatus
|
|
18
|
+
},
|
|
19
|
+
cancelOrBackButton: {
|
|
20
|
+
styling: "ghost",
|
|
21
|
+
type: "secondary",
|
|
22
|
+
labelText: s("products.cancel"),
|
|
23
|
+
disabledStatus: a.value
|
|
24
|
+
}
|
|
25
|
+
})), r = i(""), c = b(h(t, "templateName")), n = () => {
|
|
26
|
+
const e = c.validate();
|
|
27
|
+
return r.value = e.errorMessage, e.success;
|
|
28
|
+
}, m = () => {
|
|
29
|
+
o.isSaveAsTemplateDrawerOpen = !1;
|
|
30
|
+
}, d = (e) => {
|
|
31
|
+
t.templateName = e, r.value && n();
|
|
32
|
+
}, f = async (e) => {
|
|
33
|
+
l.value = !0, await t.createCategory(e), l.value = !1;
|
|
34
|
+
}, v = (e) => {
|
|
35
|
+
t.selectedCategories = [...e];
|
|
36
|
+
}, g = (e) => {
|
|
37
|
+
e && (t.selectedCategories = [...e]);
|
|
38
|
+
}, S = () => {
|
|
39
|
+
t.selectedCategories = [];
|
|
40
|
+
}, T = () => {
|
|
41
|
+
if (a.value = !0, !n()) {
|
|
42
|
+
a.value = !1;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
setTimeout(() => {
|
|
46
|
+
console.debug("💾 Saved", t.getTemplateName), a.value = !1, m();
|
|
47
|
+
}, 3e3);
|
|
48
|
+
}, p = async () => {
|
|
49
|
+
t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1;
|
|
50
|
+
};
|
|
51
|
+
return o.$subscribe((e, { isSaveAsTemplateDrawerOpen: y }) => {
|
|
52
|
+
y && p();
|
|
53
|
+
}), { __sfc: !0, trans: s, editorStore: o, saveAsTemplateStore: t, isSaving: a, isAddingOption: l, footerButtonGroupOptions: u, templateNameError: r, nameValidator: c, validateTemplateName: n, closeModal: m, handleTemplateName: d, handleAddOption: f, handleCategoryChange: v, handleSelectAllOptions: g, handleResetAllOptions: S, saveTemplate: T, initializeDrawer: p, WpDrawer: A, InBasicTextInput: x, InMultiSelect: B };
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
export {
|
|
57
|
+
z as default
|
|
58
|
+
};
|
|
@@ -1,54 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
type: 'primary';
|
|
4
|
-
labelText: string;
|
|
5
|
-
disabledStatus?: boolean;
|
|
6
|
-
};
|
|
7
|
-
cancelOrBackButton?: {
|
|
8
|
-
type: 'secondary';
|
|
9
|
-
labelText: string;
|
|
10
|
-
styling: 'ghost';
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
type __VLS_Props = {
|
|
1
|
+
import type { FooterButtonGroupOptions } from '@@/Types/wrappers/wp-drawer';
|
|
2
|
+
interface Props {
|
|
14
3
|
id: string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
size?: 'small' | 'medium' | 'large';
|
|
18
|
-
footerButtonOptions?: FooterButtonGroup;
|
|
19
|
-
closeButtonStatus?: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
size?: string;
|
|
20
6
|
closeOnOutsideClick?: boolean;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
descriptionStatus?: boolean;
|
|
8
|
+
descriptionText?: string;
|
|
9
|
+
footerButtonGroupOptions: FooterButtonGroupOptions;
|
|
10
|
+
status: boolean;
|
|
11
|
+
titleText: string;
|
|
12
|
+
}
|
|
13
|
+
declare var __VLS_12: {};
|
|
24
14
|
type __VLS_Slots = {} & {
|
|
25
|
-
default?: (props: typeof
|
|
15
|
+
default?: (props: typeof __VLS_12) => any;
|
|
26
16
|
};
|
|
27
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<
|
|
28
|
-
|
|
17
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
18
|
+
className: string;
|
|
29
19
|
size: string;
|
|
30
|
-
footerButtonOptions: undefined;
|
|
31
|
-
closeButtonStatus: boolean;
|
|
32
20
|
closeOnOutsideClick: boolean;
|
|
33
|
-
|
|
21
|
+
descriptionStatus: boolean;
|
|
22
|
+
descriptionText: string;
|
|
34
23
|
}>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<
|
|
39
|
-
|
|
24
|
+
cancelOrBackButtonEvent: () => void;
|
|
25
|
+
onCloseEvent: () => void;
|
|
26
|
+
primaryButtonEvent: () => void;
|
|
27
|
+
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
28
|
+
className: string;
|
|
40
29
|
size: string;
|
|
41
|
-
footerButtonOptions: undefined;
|
|
42
|
-
closeButtonStatus: boolean;
|
|
43
30
|
closeOnOutsideClick: boolean;
|
|
44
|
-
|
|
31
|
+
descriptionStatus: boolean;
|
|
32
|
+
descriptionText: string;
|
|
45
33
|
}>>>, {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
footerButtonOptions: FooterButtonGroup;
|
|
49
|
-
closeButtonStatus: boolean;
|
|
34
|
+
className: string;
|
|
35
|
+
size: string;
|
|
50
36
|
closeOnOutsideClick: boolean;
|
|
51
|
-
|
|
37
|
+
descriptionStatus: boolean;
|
|
38
|
+
descriptionText: string;
|
|
52
39
|
}>;
|
|
53
40
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
54
41
|
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import r from "./WpDrawer.vue2.js";
|
|
2
|
+
import s from "../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var i = function() {
|
|
4
|
+
var t = this, n = t._self._c, e = t._self._setupProxy;
|
|
5
|
+
return n(e.InDrawer, { class: t.className, attrs: { id: t.id, "footer-status": "", "close-on-outside-click": t.closeOnOutsideClick, "description-status": t.descriptionStatus, "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, size: t.size, status: t.status, "title-text": t.titleText }, on: { cancelOrBackButtonEvent: function(o) {
|
|
6
|
+
return e.emit("cancelOrBackButtonEvent");
|
|
7
|
+
}, onCloseEvent: function(o) {
|
|
8
|
+
return e.emit("onCloseEvent");
|
|
9
|
+
}, primaryButtonEvent: function(o) {
|
|
10
|
+
return e.emit("primaryButtonEvent");
|
|
11
|
+
} }, scopedSlots: t._u([{ key: "contentSlot", fn: function() {
|
|
12
|
+
return [n("div", [t._t("default")], 2)];
|
|
13
|
+
}, proxy: !0 }], null, !0) });
|
|
14
|
+
}, u = [], c = /* @__PURE__ */ s(
|
|
15
|
+
r,
|
|
16
|
+
i,
|
|
17
|
+
u,
|
|
18
|
+
!1,
|
|
19
|
+
null,
|
|
20
|
+
null
|
|
21
|
+
);
|
|
22
|
+
const f = c.exports;
|
|
23
|
+
export {
|
|
24
|
+
f as default
|
|
25
|
+
};
|