@useinsider/guido 1.0.2-beta.efaabbe → 1.0.2-beta.efc8835
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/README.md +0 -6
- package/dist/components/Guido.vue.d.ts +1 -2
- package/dist/components/Guido.vue.js +2 -2
- package/dist/components/Guido.vue2.js +54 -58
- package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
- package/dist/components/organisms/header/HeaderWrapper.vue.d.ts +1 -3
- package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -15
- package/dist/components/organisms/header/RightSlot.vue.d.ts +1 -3
- package/dist/components/organisms/header/RightSlot.vue.js +3 -5
- package/dist/components/organisms/header/RightSlot.vue2.js +19 -23
- package/dist/composables/useSave.d.ts +1 -2
- package/dist/composables/useSave.js +8 -9
- package/dist/composables/useStripo.js +13 -15
- package/dist/guido.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -102,11 +102,6 @@ export default {
|
|
|
102
102
|
// ⚠️ It's mandatory. There is no way to understand if user closes the modal without selection.
|
|
103
103
|
handleDynamicContentClose() {
|
|
104
104
|
this.$refs.guidoEditor?.dynamicContent.close();
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
// If you need to trigger save manually like leave modal cases, you can use this method.
|
|
108
|
-
save () {
|
|
109
|
-
this.$refs.guidoEditor?.saveSilent();
|
|
110
105
|
}
|
|
111
106
|
}
|
|
112
107
|
};
|
|
@@ -143,7 +138,6 @@ export default {
|
|
|
143
138
|
```typescript
|
|
144
139
|
dynamicContent.insert(DynamicContent);
|
|
145
140
|
dynamicContent.close();
|
|
146
|
-
saveSilent();
|
|
147
141
|
```
|
|
148
142
|
|
|
149
143
|
### Guido Interfaces
|
|
@@ -18,13 +18,12 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
|
|
|
18
18
|
close: () => void;
|
|
19
19
|
};
|
|
20
20
|
hasChanges: import("vue").ComputedRef<boolean>;
|
|
21
|
-
saveSilent: () => Promise<SavedTemplateDetails | undefined> | undefined;
|
|
22
21
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
23
22
|
"dynamic-content:open": (detail: DynamicContent | null) => void;
|
|
24
23
|
back: () => void;
|
|
25
24
|
"save:start": () => void;
|
|
26
25
|
"save:complete": (data: Omit<SavedTemplateDetails, "forceRecreate">) => void;
|
|
27
|
-
"on-change": (
|
|
26
|
+
"on-change": () => void;
|
|
28
27
|
ready: () => void;
|
|
29
28
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
30
29
|
export default _default;
|
|
@@ -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
|
|
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
|
+
"e45e9eab"
|
|
14
14
|
);
|
|
15
15
|
const v = d.exports;
|
|
16
16
|
export {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import { DefaultUsername as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useStripoApi as
|
|
11
|
-
import { useDynamicContentStore as
|
|
12
|
-
import { useEditorStore as
|
|
13
|
-
import { usePreviewStore as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
1
|
+
import { defineComponent as P, defineAsyncComponent as _, computed as b, watch as k, onMounted as A, onUnmounted as N } from "vue";
|
|
2
|
+
import { provideGuidoActions as H } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as U } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as W } from "../composables/useStripo.js";
|
|
5
|
+
import { DefaultUsername as x, DefaultMessageType as F, DefaultGuidoConfig as M } from "../enums/defaults.js";
|
|
6
|
+
import R from "./organisms/base/Toaster.vue.js";
|
|
7
|
+
import z from "./organisms/header/HeaderWrapper.vue.js";
|
|
8
|
+
import B from "./organisms/LoadingWrapper.vue.js";
|
|
9
|
+
import K from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
10
|
+
import { useStripoApi as j } from "../services/stripoApi.js";
|
|
11
|
+
import { useDynamicContentStore as q } from "../stores/dynamic-content.js";
|
|
12
|
+
import { useEditorStore as J } from "../stores/editor.js";
|
|
13
|
+
import { usePreviewStore as O } from "../stores/preview.js";
|
|
14
|
+
import Q from "../node_modules/lodash-es/merge.js";
|
|
15
|
+
const de = /* @__PURE__ */ P({
|
|
16
16
|
__name: "Guido",
|
|
17
17
|
props: {
|
|
18
18
|
templateId: null,
|
|
@@ -27,43 +27,40 @@ const ue = /* @__PURE__ */ k({
|
|
|
27
27
|
guidoConfig: null
|
|
28
28
|
},
|
|
29
29
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready"],
|
|
30
|
-
setup(
|
|
31
|
-
const
|
|
30
|
+
setup(E, { expose: T, emit: o }) {
|
|
31
|
+
const t = E, G = _(
|
|
32
32
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
33
|
-
),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
username: h = M
|
|
46
|
-
} = n;
|
|
47
|
-
window.GuidoConfig = Y(B, f), window.GuidoConfig.partner = {
|
|
33
|
+
), n = q(), c = J(), I = O(), r = b(() => c.hasChanges), a = t.preselectedDynamicContentList || [], { getPartnerName: d, getProductType: m } = U(), {
|
|
34
|
+
templateId: l,
|
|
35
|
+
userId: u,
|
|
36
|
+
guidoConfig: p,
|
|
37
|
+
html: g = "",
|
|
38
|
+
css: y = "",
|
|
39
|
+
partnerName: i = d(),
|
|
40
|
+
productType: s = m(),
|
|
41
|
+
messageType: f = F,
|
|
42
|
+
username: C = x
|
|
43
|
+
} = t;
|
|
44
|
+
window.GuidoConfig = Q(M, p), window.GuidoConfig.partner = {
|
|
48
45
|
partnerName: i,
|
|
49
46
|
productType: s,
|
|
50
|
-
messageType:
|
|
47
|
+
messageType: f
|
|
51
48
|
};
|
|
52
|
-
const { initPlugin:
|
|
53
|
-
emailId:
|
|
54
|
-
userId:
|
|
55
|
-
username:
|
|
49
|
+
const { initPlugin: v } = W({
|
|
50
|
+
emailId: l,
|
|
51
|
+
userId: u,
|
|
52
|
+
username: C,
|
|
56
53
|
partnerName: i,
|
|
57
54
|
productType: s,
|
|
58
55
|
preselectedDynamicContentList: a,
|
|
59
56
|
onReady: () => {
|
|
60
57
|
console.debug("guido:ready"), o("ready");
|
|
61
58
|
}
|
|
62
|
-
}), { getDefaultTemplate:
|
|
59
|
+
}), { getDefaultTemplate: w } = j(), L = b(() => {
|
|
63
60
|
var e;
|
|
64
61
|
return !((e = window.GuidoConfig) != null && e.useHeader);
|
|
65
62
|
});
|
|
66
|
-
|
|
63
|
+
H({
|
|
67
64
|
onBack: () => {
|
|
68
65
|
console.debug("guido:back"), o("back");
|
|
69
66
|
},
|
|
@@ -74,46 +71,45 @@ const ue = /* @__PURE__ */ k({
|
|
|
74
71
|
console.debug("guido:save:complete", e), o("save:complete", e);
|
|
75
72
|
}
|
|
76
73
|
});
|
|
77
|
-
const
|
|
78
|
-
console.debug("dynamic-content:close", e),
|
|
79
|
-
},
|
|
74
|
+
const h = (e) => {
|
|
75
|
+
console.debug("dynamic-content:close", e), n.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
76
|
+
}, S = () => {
|
|
80
77
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
81
78
|
};
|
|
82
|
-
return
|
|
83
|
-
o("on-change"
|
|
84
|
-
}),
|
|
79
|
+
return k(() => r.value, () => {
|
|
80
|
+
o("on-change");
|
|
81
|
+
}), A(async () => {
|
|
85
82
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
86
83
|
try {
|
|
87
84
|
let e = {
|
|
88
|
-
html:
|
|
89
|
-
css:
|
|
85
|
+
html: g,
|
|
86
|
+
css: y,
|
|
90
87
|
forceRecreate: !0
|
|
91
88
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
92
89
|
};
|
|
93
|
-
e.html || (e = await
|
|
90
|
+
e.html || (e = await w()), await v(e), n.selectedDynamicContentList = a;
|
|
94
91
|
} catch (e) {
|
|
95
92
|
console.error("Failed to initialize Stripo editor:", e);
|
|
96
93
|
}
|
|
97
94
|
document.addEventListener("dynamic-content:open", (e) => {
|
|
98
|
-
const
|
|
99
|
-
console.debug("dynamic-content:open",
|
|
95
|
+
const D = e;
|
|
96
|
+
console.debug("dynamic-content:open", D.detail), o("dynamic-content:open", D.detail);
|
|
100
97
|
});
|
|
101
|
-
}),
|
|
98
|
+
}), N(() => {
|
|
102
99
|
try {
|
|
103
100
|
window.UIEditor.removeEditor();
|
|
104
101
|
} catch {
|
|
105
102
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
106
103
|
}
|
|
107
|
-
}),
|
|
104
|
+
}), T({
|
|
108
105
|
dynamicContent: {
|
|
109
|
-
insert:
|
|
110
|
-
close:
|
|
106
|
+
insert: h,
|
|
107
|
+
close: S
|
|
111
108
|
},
|
|
112
|
-
hasChanges:
|
|
113
|
-
|
|
114
|
-
}), { __sfc: !0, PreviewContainer: L, headerWrapperRef: c, dynamicContentStore: r, props: n, editorStore: d, previewStore: P, hasChanges: t, preselectedDynamicContentList: a, getPartnerName: m, getProductType: l, saveSilent: u, templateId: p, userId: g, guidoConfig: f, html: y, css: v, partnerName: i, productType: s, messageType: C, username: h, emit: o, initPlugin: w, getDefaultTemplate: S, noHeader: _, insertDynamicContent: D, closeDynamicContent: b, Toaster: K, HeaderWrapper: j, LoadingWrapper: q, SaveAsTemplateDrawer: J };
|
|
109
|
+
hasChanges: r
|
|
110
|
+
}), { __sfc: !0, PreviewContainer: G, dynamicContentStore: n, props: t, editorStore: c, previewStore: I, hasChanges: r, preselectedDynamicContentList: a, getPartnerName: d, getProductType: m, templateId: l, userId: u, guidoConfig: p, html: g, css: y, partnerName: i, productType: s, messageType: f, username: C, emit: o, initPlugin: v, getDefaultTemplate: w, noHeader: L, insertDynamicContent: h, closeDynamicContent: S, Toaster: R, HeaderWrapper: z, LoadingWrapper: B, SaveAsTemplateDrawer: K };
|
|
115
111
|
}
|
|
116
112
|
});
|
|
117
113
|
export {
|
|
118
|
-
|
|
114
|
+
de as default
|
|
119
115
|
};
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<import("../../../@types/stripo.js").SavedTemplateDetails | undefined> | undefined;
|
|
3
|
-
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
2
|
export default _default;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from "./HeaderWrapper.vue2.js";
|
|
2
2
|
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var n = function() {
|
|
4
|
-
var
|
|
5
|
-
return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0" } }, [r("div", { staticClass: "w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.LeftSlot), r(e.MiddleSlot), r(e.RightSlot
|
|
4
|
+
var o = this, r = o._self._c, e = o._self._setupProxy;
|
|
5
|
+
return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0" } }, [r("div", { staticClass: "w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.LeftSlot), r(e.MiddleSlot), r(e.RightSlot)], 1)]);
|
|
6
6
|
}, a = [], _ = /* @__PURE__ */ s(
|
|
7
|
-
|
|
7
|
+
t,
|
|
8
8
|
n,
|
|
9
9
|
a,
|
|
10
10
|
!1,
|
|
11
11
|
null,
|
|
12
12
|
null
|
|
13
13
|
);
|
|
14
|
-
const
|
|
14
|
+
const d = _.exports;
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
d as default
|
|
17
17
|
};
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { InContainer as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as o } from "vue";
|
|
2
|
+
import { InContainer as r } from "@useinsider/design-system-vue";
|
|
3
|
+
import t from "./LeftSlot.vue.js";
|
|
4
|
+
import e from "./MiddleSlot.vue.js";
|
|
5
|
+
import m from "./RightSlot.vue.js";
|
|
6
|
+
const s = /* @__PURE__ */ o({
|
|
7
7
|
__name: "HeaderWrapper",
|
|
8
|
-
setup(
|
|
9
|
-
|
|
10
|
-
return r({
|
|
11
|
-
handleSave: (t) => {
|
|
12
|
-
var o;
|
|
13
|
-
return (o = e.value) == null ? void 0 : o.handleSave(t);
|
|
14
|
-
}
|
|
15
|
-
}), { __sfc: !0, rightSlotRef: e, InContainer: a, LeftSlot: f, MiddleSlot: p, RightSlot: i };
|
|
8
|
+
setup(p) {
|
|
9
|
+
return { __sfc: !0, InContainer: r, LeftSlot: t, MiddleSlot: e, RightSlot: m };
|
|
16
10
|
}
|
|
17
11
|
});
|
|
18
12
|
export {
|
|
19
|
-
|
|
13
|
+
s as default
|
|
20
14
|
};
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<import("../../../@types/stripo").SavedTemplateDetails | undefined>;
|
|
3
|
-
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
2
|
export default _default;
|
|
@@ -3,9 +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, "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:
|
|
7
|
-
return t.handleSave(!1);
|
|
8
|
-
} } })], 1);
|
|
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);
|
|
9
7
|
}, r = [], d = /* @__PURE__ */ a(
|
|
10
8
|
n,
|
|
11
9
|
l,
|
|
@@ -14,7 +12,7 @@ var l = function() {
|
|
|
14
12
|
null,
|
|
15
13
|
null
|
|
16
14
|
);
|
|
17
|
-
const
|
|
15
|
+
const c = d.exports;
|
|
18
16
|
export {
|
|
19
|
-
|
|
17
|
+
c as default
|
|
20
18
|
};
|
|
@@ -1,35 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useExport as
|
|
4
|
-
import { useSave as
|
|
5
|
-
import { useTranslations as
|
|
6
|
-
import { useVersionHistoryApi as
|
|
7
|
-
import { useEditorStore as
|
|
8
|
-
import { getTooltipOptions as
|
|
9
|
-
import { InButtonV2 as
|
|
10
|
-
const
|
|
1
|
+
import { defineComponent as v, ref as p, computed as d } from "vue";
|
|
2
|
+
import { useConfig as y } from "../../../composables/useConfig.js";
|
|
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({
|
|
11
11
|
__name: "RightSlot",
|
|
12
|
-
setup(
|
|
13
|
-
const { config:
|
|
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
14
|
if (o.isVersionHistoryOpen) {
|
|
15
15
|
a();
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
i();
|
|
19
|
-
},
|
|
19
|
+
}, u = async () => {
|
|
20
20
|
e.value = !0, await r(), e.value = !1;
|
|
21
|
-
},
|
|
21
|
+
}, c = () => {
|
|
22
22
|
o.isSaveAsTemplateDrawerOpen = !0;
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
return m({
|
|
29
|
-
handleSave: p
|
|
30
|
-
}), { __sfc: !0, config: u, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, handleVersionHistory: c, handleExport: f, handleSaveAs: v, versionHistoryTooltipText: d, handleSave: p, getTooltipOptions: E, InButtonV2: O };
|
|
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 };
|
|
31
27
|
}
|
|
32
28
|
});
|
|
33
29
|
export {
|
|
34
|
-
|
|
30
|
+
j as default
|
|
35
31
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { useSaveStart as
|
|
1
|
+
import { useSaveStart as r, useSaveComplete as i } from "./useGuidoActions.js";
|
|
2
2
|
import { useTemplatePreparation as m } from "../utils/templatePreparation.js";
|
|
3
|
-
import { useHtmlValidator as
|
|
4
|
-
const
|
|
5
|
-
const e =
|
|
6
|
-
return { save: async (
|
|
3
|
+
import { useHtmlValidator as l } from "./useHtmlValidator.js";
|
|
4
|
+
const d = () => {
|
|
5
|
+
const e = r(), a = i(), { validateHtml: s } = l();
|
|
6
|
+
return { save: async () => {
|
|
7
7
|
e();
|
|
8
|
-
const { prepareTemplateDetails:
|
|
9
|
-
|
|
10
|
-
return o || a(t), t;
|
|
8
|
+
const { prepareTemplateDetails: o } = m(), t = await o();
|
|
9
|
+
await s(t.compiledHtml, [], !0) && a(t);
|
|
11
10
|
} };
|
|
12
11
|
};
|
|
13
12
|
export {
|
|
14
|
-
|
|
13
|
+
d as useSave
|
|
15
14
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { useActionsApi as g } from "./useActionsApi.js";
|
|
2
2
|
import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
|
|
3
3
|
import { useToaster as S } from "./useToaster.js";
|
|
4
|
-
import { displayConditions as
|
|
5
|
-
import
|
|
4
|
+
import { displayConditions as y } from "../enums/displayConditions.js";
|
|
5
|
+
import C from "../extensions/DynamicContent/extension.js";
|
|
6
6
|
import { useStripoApi as E } from "../services/stripoApi.js";
|
|
7
7
|
import h from "../static/styles/customEditorStyle.css.js";
|
|
8
8
|
import { useEditorStore as w } from "../stores/editor.js";
|
|
9
9
|
import { dynamicContentToMergeTags as b } from "../utils/genericUtil.js";
|
|
10
10
|
const P = (s) => {
|
|
11
|
-
const { handleError:
|
|
12
|
-
const e = w(), { html: o, css:
|
|
11
|
+
const { handleError: c } = S(), { getToken: a, getCustomFonts: u } = E(), l = (r, i = []) => {
|
|
12
|
+
const e = w(), { html: o, css: d, forceRecreate: p } = r;
|
|
13
13
|
window.UIEditor.initEditor(
|
|
14
14
|
document.querySelector("#guido-editor"),
|
|
15
15
|
{
|
|
16
16
|
metadata: s,
|
|
17
17
|
html: o,
|
|
18
|
-
css:
|
|
18
|
+
css: d,
|
|
19
19
|
forceRecreate: p,
|
|
20
20
|
locale: "en",
|
|
21
21
|
undoButtonSelector: "#guido__undo-button",
|
|
@@ -29,7 +29,7 @@ const P = (s) => {
|
|
|
29
29
|
customViewStyles: h,
|
|
30
30
|
conditionsEnabled: !0,
|
|
31
31
|
customConditionsEnabled: !0,
|
|
32
|
-
conditionCategories:
|
|
32
|
+
conditionCategories: y,
|
|
33
33
|
enableXSSSecurity: !0,
|
|
34
34
|
messageSettingsEnabled: !1,
|
|
35
35
|
selectBlockAfterDropFromSettingsPanel: !0,
|
|
@@ -45,20 +45,18 @@ const P = (s) => {
|
|
|
45
45
|
],
|
|
46
46
|
async onTokenRefreshRequest(t) {
|
|
47
47
|
try {
|
|
48
|
-
const n = await
|
|
48
|
+
const n = await a();
|
|
49
49
|
t(n);
|
|
50
50
|
} catch (n) {
|
|
51
|
-
|
|
51
|
+
c(n, "Failed to refresh token");
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
onTemplateLoaded() {
|
|
55
55
|
try {
|
|
56
56
|
const { importCss: t } = f(), { activateCustomViewStyles: n } = g();
|
|
57
|
-
t(), n(), s.onReady(), e.loadingStatus = !1
|
|
58
|
-
e.hasChanges = !1;
|
|
59
|
-
}, 1e3);
|
|
57
|
+
t(), n(), s.onReady(), e.loadingStatus = !1;
|
|
60
58
|
} catch (t) {
|
|
61
|
-
|
|
59
|
+
c(t, "Failed to load custom interface appearance");
|
|
62
60
|
}
|
|
63
61
|
},
|
|
64
62
|
onCodeEditorVisibilityChanged(t) {
|
|
@@ -74,7 +72,7 @@ const P = (s) => {
|
|
|
74
72
|
e.hasChanges = !0;
|
|
75
73
|
},
|
|
76
74
|
ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
|
|
77
|
-
extensions: [
|
|
75
|
+
extensions: [C]
|
|
78
76
|
}
|
|
79
77
|
);
|
|
80
78
|
}, m = (r) => new Promise((i, e) => {
|
|
@@ -86,8 +84,8 @@ const P = (s) => {
|
|
|
86
84
|
o.id = "UiEditorScript", o.type = "module", o.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", o.onload = () => {
|
|
87
85
|
r(), i();
|
|
88
86
|
}, o.onerror = () => {
|
|
89
|
-
const
|
|
90
|
-
e(
|
|
87
|
+
const d = new Error("Failed to load Stripo UIEditor script");
|
|
88
|
+
e(d);
|
|
91
89
|
}, document.body.appendChild(o);
|
|
92
90
|
});
|
|
93
91
|
return { initPlugin: async (r) => {
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-v-a18ac2d3] .in-button-v2__wrapper{line-height:0}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-421ffc13] .guido__verion-history-view-option-selection-desktop svg,[data-v-421ffc13] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-421ffc13] .in-segments-wrapper__button_selected,[data-v-421ffc13] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-421ffc13] .in-tooltip-wrapper__icon{cursor:pointer}[data-v-ad3cf7cc] .guido__view-option-selection-desktop svg,[data-v-ad3cf7cc] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-ad3cf7cc] .in-segments-wrapper__button_selected,[data-v-ad3cf7cc] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-ad3cf7cc] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-
|
|
1
|
+
[data-v-a18ac2d3] .in-button-v2__wrapper{line-height:0}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-421ffc13] .guido__verion-history-view-option-selection-desktop svg,[data-v-421ffc13] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-421ffc13] .in-segments-wrapper__button_selected,[data-v-421ffc13] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-421ffc13] .in-tooltip-wrapper__icon{cursor:pointer}[data-v-ad3cf7cc] .guido__view-option-selection-desktop svg,[data-v-ad3cf7cc] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-ad3cf7cc] .in-segments-wrapper__button_selected,[data-v-ad3cf7cc] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-ad3cf7cc] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-2d4cd446]{height:calc(100% - 75px);top:75px}.guido-editor__wrapper[data-v-e45e9eab],.guido-editor__container[data-v-e45e9eab]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-e45e9eab]{height:calc(100vh - 75px)}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-f20b3a9b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "1.0.2-beta.
|
|
3
|
+
"version": "1.0.2-beta.efc8835",
|
|
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",
|