@useinsider/guido 1.0.3-beta.1d07a49 → 1.0.3-beta.1d75236
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +49 -48
- package/dist/composables/useSave.js +14 -10
- package/dist/guido.css +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import Z from "
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
|
|
1
|
+
import { defineComponent as z, defineAsyncComponent as L, ref as K, computed as W, watch as j, onMounted as q, onUnmounted as J } from "vue";
|
|
2
|
+
import { provideGuidoActions as Q } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as V } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as X } from "../composables/useStripo.js";
|
|
5
|
+
import { useTimerClone as Y } from "../composables/useTimerClone.js";
|
|
6
|
+
import { migrate as _ } from "../config/migrator/index.js";
|
|
7
|
+
import { DefaultUsername as Z, DefaultMessageType as $, DefaultGuidoConfig as ee } from "../enums/defaults.js";
|
|
8
|
+
import oe from "./organisms/base/Toaster.vue.js";
|
|
9
|
+
import te from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
10
|
+
import ne from "./organisms/header/HeaderWrapper.vue.js";
|
|
11
|
+
import re from "./organisms/LoadingWrapper.vue.js";
|
|
12
|
+
import ie from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
13
|
+
import se from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
14
|
+
import { useStripoApi as ae } from "../services/stripoApi.js";
|
|
15
|
+
import { useConfigStore as ce } from "../stores/config.js";
|
|
16
|
+
import { useDynamicContentStore as me } from "../stores/dynamic-content.js";
|
|
17
|
+
import { useEditorStore as de } from "../stores/editor.js";
|
|
18
|
+
import { usePreviewStore as le } from "../stores/preview.js";
|
|
19
|
+
import { useUnsubscribeStore as ue } from "../stores/unsubscribe.js";
|
|
20
|
+
import pe from "../node_modules/lodash-es/merge.js";
|
|
21
|
+
const Ae = /* @__PURE__ */ z({
|
|
21
22
|
__name: "Guido",
|
|
22
23
|
props: {
|
|
23
24
|
templateId: null,
|
|
@@ -32,34 +33,34 @@ const Ue = /* @__PURE__ */ O({
|
|
|
32
33
|
templateConfig: null
|
|
33
34
|
},
|
|
34
35
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
35
|
-
setup(
|
|
36
|
-
const u =
|
|
36
|
+
setup(A, { expose: N, emit: o }) {
|
|
37
|
+
const u = A, F = L(
|
|
37
38
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
38
|
-
),
|
|
39
|
+
), H = L(
|
|
39
40
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
40
|
-
), p =
|
|
41
|
+
), p = K(), i = me(), g = ue(), f = ce(), s = de(), O = le(), n = W(() => s.hasChanges), { getPartnerName: y, getProductType: v, isTestPartner: R } = V(), h = () => {
|
|
41
42
|
var e;
|
|
42
43
|
return (e = p.value) == null ? void 0 : e.handleSave(!0);
|
|
43
44
|
}, {
|
|
44
45
|
templateId: a,
|
|
45
|
-
userId:
|
|
46
|
-
guidoConfig:
|
|
46
|
+
userId: b,
|
|
47
|
+
guidoConfig: C,
|
|
47
48
|
templateConfig: t,
|
|
48
49
|
html: r = "",
|
|
49
50
|
css: S = "",
|
|
50
51
|
partnerName: c = y(),
|
|
51
52
|
productType: m = v(),
|
|
52
|
-
messageType: w =
|
|
53
|
-
username: D =
|
|
53
|
+
messageType: w = $,
|
|
54
|
+
username: D = Z
|
|
54
55
|
} = u, d = (t == null ? void 0 : t.preselectedDynamicContentList) || [];
|
|
55
|
-
s.templateId = a, window.GuidoConfig =
|
|
56
|
+
s.templateId = a, window.GuidoConfig = pe(ee, C), window.GuidoConfig.partner = {
|
|
56
57
|
partnerName: c,
|
|
57
58
|
productType: m,
|
|
58
59
|
messageType: w
|
|
59
60
|
}, f.templateConfig = t;
|
|
60
|
-
const { initPlugin:
|
|
61
|
+
const { initPlugin: T } = X({
|
|
61
62
|
emailId: a,
|
|
62
|
-
userId:
|
|
63
|
+
userId: b,
|
|
63
64
|
username: D,
|
|
64
65
|
partnerName: c,
|
|
65
66
|
productType: m,
|
|
@@ -67,11 +68,11 @@ const Ue = /* @__PURE__ */ O({
|
|
|
67
68
|
onReady: () => {
|
|
68
69
|
console.debug("guido:ready"), o("ready");
|
|
69
70
|
}
|
|
70
|
-
}), { getDefaultTemplate:
|
|
71
|
+
}), { getDefaultTemplate: E } = ae(), { cloneTimersOnSave: k, hasTimerBlocks: P } = Y(), x = W(() => {
|
|
71
72
|
var e;
|
|
72
73
|
return !((e = window.GuidoConfig) != null && e.useHeader);
|
|
73
74
|
});
|
|
74
|
-
|
|
75
|
+
Q({
|
|
75
76
|
onBack: () => {
|
|
76
77
|
console.debug("guido:back"), o("back");
|
|
77
78
|
},
|
|
@@ -85,50 +86,50 @@ const Ue = /* @__PURE__ */ O({
|
|
|
85
86
|
console.debug("guido:test-email:click"), o("test-email:click");
|
|
86
87
|
}
|
|
87
88
|
});
|
|
88
|
-
const
|
|
89
|
+
const G = (e) => {
|
|
89
90
|
console.debug("dynamic-content:close", e), i.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
90
|
-
},
|
|
91
|
+
}, I = () => {
|
|
91
92
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
92
93
|
};
|
|
93
|
-
|
|
94
|
+
j(() => n.value, () => {
|
|
94
95
|
o("on-change", n.value);
|
|
95
96
|
});
|
|
96
97
|
const l = (e) => {
|
|
97
|
-
const
|
|
98
|
-
console.debug("dynamic-content:open",
|
|
98
|
+
const U = e, { attribute: B, position: M } = U.detail;
|
|
99
|
+
console.debug("dynamic-content:open", U.detail), o("dynamic-content:open", B, M);
|
|
99
100
|
};
|
|
100
|
-
return
|
|
101
|
+
return q(async () => {
|
|
101
102
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
102
103
|
try {
|
|
103
104
|
g.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
|
|
104
105
|
let e = {
|
|
105
|
-
html: r && await
|
|
106
|
+
html: r && await _(r),
|
|
106
107
|
css: S,
|
|
107
108
|
forceRecreate: !0
|
|
108
109
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
109
110
|
};
|
|
110
|
-
e.html || (e = await
|
|
111
|
+
e.html || (e = await E(), e.html = await _(e.html), P(e.html) && (e.html = await k(e.html))), await T(e), i.selectedDynamicContentList = d;
|
|
111
112
|
} catch (e) {
|
|
112
113
|
console.error("Failed to initialize Stripo editor:", e);
|
|
113
114
|
}
|
|
114
115
|
document.addEventListener("dynamic-content:open", l);
|
|
115
|
-
}),
|
|
116
|
+
}), J(() => {
|
|
116
117
|
document.removeEventListener("dynamic-content:open", l);
|
|
117
118
|
try {
|
|
118
119
|
window.UIEditor.removeEditor();
|
|
119
120
|
} catch {
|
|
120
121
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
121
122
|
}
|
|
122
|
-
}),
|
|
123
|
+
}), N({
|
|
123
124
|
dynamicContent: {
|
|
124
|
-
insert:
|
|
125
|
-
close:
|
|
125
|
+
insert: G,
|
|
126
|
+
close: I
|
|
126
127
|
},
|
|
127
128
|
hasChanges: n,
|
|
128
|
-
saveSilent:
|
|
129
|
-
}), { __sfc: !0, PreviewContainer:
|
|
129
|
+
saveSilent: h
|
|
130
|
+
}), { __sfc: !0, PreviewContainer: F, OnboardingWrapper: H, headerWrapperRef: p, dynamicContentStore: i, unsubscribeStore: g, props: u, configStore: f, editorStore: s, previewStore: O, hasChanges: n, getPartnerName: y, getProductType: v, isTestPartner: R, saveSilent: h, templateId: a, userId: b, guidoConfig: C, templateConfig: t, html: r, css: S, partnerName: c, productType: m, messageType: w, username: D, preselectedDynamicContentList: d, emit: o, initPlugin: T, getDefaultTemplate: E, cloneTimersOnSave: k, hasTimerBlocks: P, noHeader: x, insertDynamicContent: G, closeDynamicContent: I, handleDynamicContentOpen: l, Toaster: oe, FilterSelectionDrawer: te, HeaderWrapper: ne, LoadingWrapper: re, SaveAsTemplateDrawer: ie, UnsubscribeWrapper: se };
|
|
130
131
|
}
|
|
131
132
|
});
|
|
132
133
|
export {
|
|
133
|
-
|
|
134
|
+
Ae as default
|
|
134
135
|
};
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import { useSaveStart as
|
|
2
|
-
import { useTemplatePreparation as
|
|
1
|
+
import { useSaveStart as l, useSaveComplete as c } from "./useGuidoActions.js";
|
|
2
|
+
import { useTemplatePreparation as d } from "../utils/templatePreparation.js";
|
|
3
3
|
import { useHtmlValidator as p } from "./useHtmlValidator.js";
|
|
4
|
-
import { useTimerClone as
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
import { useTimerClone as u } from "./useTimerClone.js";
|
|
5
|
+
const g = () => {
|
|
6
|
+
const t = l(), a = c(), { validateHtml: r } = p(), { cloneTimersOnSave: i } = u();
|
|
7
7
|
return { save: async (s = !1) => {
|
|
8
|
-
|
|
9
|
-
const { prepareTemplateDetails:
|
|
10
|
-
if (await
|
|
11
|
-
return
|
|
8
|
+
t();
|
|
9
|
+
const { prepareTemplateDetails: o } = d(), e = await o();
|
|
10
|
+
if (!await r(e.compiledHtml, e.dynamicContentList, !0))
|
|
11
|
+
return;
|
|
12
|
+
const m = e.rawHtml.match(/esd-timer-id="(\d+)"/g);
|
|
13
|
+
e.rawHtml = await i(e.rawHtml);
|
|
14
|
+
const n = e.rawHtml.match(/esd-timer-id="(\d+)"/g);
|
|
15
|
+
return console.debug("[SAVE] Timer IDs - Original:", m, "New:", n), s || a(e), e;
|
|
12
16
|
} };
|
|
13
17
|
};
|
|
14
18
|
export {
|
|
15
|
-
|
|
19
|
+
g as useSave
|
|
16
20
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-0502bceb] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-
|
|
1
|
+
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-0502bceb] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-d6fe7dd4],.guido-editor__container[data-v-d6fe7dd4]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-d6fe7dd4]{height:calc(100vh - 75px)}[data-v-70835920] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-dd57102d] .guido__verion-history-view-option-selection-desktop svg,[data-v-dd57102d] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-dd57102d] .in-segments-wrapper__button_selected,[data-v-dd57102d] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.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}[data-v-d3c52b44] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "1.0.3-beta.
|
|
3
|
+
"version": "1.0.3-beta.1d75236",
|
|
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",
|