@useinsider/guido 1.0.1-beta.61557b9 → 1.0.1-beta.fce60db
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 +1 -0
- package/dist/components/Guido.vue.d.ts +1 -0
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +42 -40
- package/dist/guido.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -131,6 +131,7 @@ export default {
|
|
|
131
131
|
| `back` | - | Fired when user clicks the back button |
|
|
132
132
|
| `save:start` | - | Fired when the save process begins |
|
|
133
133
|
| `save:complete` | `Omit<Template, 'forceRecreate'>` | Fired when template is successfully saved |
|
|
134
|
+
| `on-change` | void | It Fires once for managing leave modal etc. |
|
|
134
135
|
|
|
135
136
|
### Guido Exposed Methods
|
|
136
137
|
```typescript
|
|
@@ -23,6 +23,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
|
|
|
23
23
|
back: () => void;
|
|
24
24
|
"save:start": () => void;
|
|
25
25
|
"save:complete": (data: Omit<SavedTemplateDetails, "forceRecreate">) => void;
|
|
26
|
+
"on-change": () => void;
|
|
26
27
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
27
28
|
export default _default;
|
|
28
29
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import i from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import a from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var s = function() {
|
|
5
5
|
var o = this, r = o._self._c, e = o._self._setupProxy;
|
|
6
6
|
return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper), e.previewStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isPreviewModeOpen, expression: "!previewStore.isPreviewModeOpen" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.SaveAsTemplateDrawer)], 1);
|
|
7
|
-
},
|
|
7
|
+
}, t = [], n = /* @__PURE__ */ a(
|
|
8
8
|
i,
|
|
9
|
+
s,
|
|
9
10
|
t,
|
|
10
|
-
a,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"19ef8aa2"
|
|
14
14
|
);
|
|
15
|
-
const c =
|
|
15
|
+
const c = n.exports;
|
|
16
16
|
export {
|
|
17
17
|
c as default
|
|
18
18
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as _, defineAsyncComponent as L, computed as b,
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import { DefaultUsername as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useStripoApi as
|
|
10
|
-
import { useDynamicContentStore as
|
|
11
|
-
import { useEditorStore as
|
|
12
|
-
import { usePreviewStore as
|
|
13
|
-
import
|
|
1
|
+
import { defineComponent as _, defineAsyncComponent as L, computed as b, watch as k, onMounted as A, onUnmounted as H } from "vue";
|
|
2
|
+
import { provideGuidoActions as N } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as U } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as x } from "../composables/useStripo.js";
|
|
5
|
+
import { DefaultUsername as M, DefaultMessageType as W, 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/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
9
|
+
import { useStripoApi as R } from "../services/stripoApi.js";
|
|
10
|
+
import { useDynamicContentStore as j } from "../stores/dynamic-content.js";
|
|
11
|
+
import { useEditorStore as q } from "../stores/editor.js";
|
|
12
|
+
import { usePreviewStore as J } from "../stores/preview.js";
|
|
13
|
+
import O from "../node_modules/lodash-es/merge.js";
|
|
14
14
|
const ie = /* @__PURE__ */ _({
|
|
15
15
|
__name: "Guido",
|
|
16
16
|
props: {
|
|
@@ -25,38 +25,38 @@ const ie = /* @__PURE__ */ _({
|
|
|
25
25
|
preselectedDynamicContentList: null,
|
|
26
26
|
guidoConfig: null
|
|
27
27
|
},
|
|
28
|
-
emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
|
|
28
|
+
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change"],
|
|
29
29
|
setup(E, { expose: T, emit: t }) {
|
|
30
30
|
const o = E, G = L(
|
|
31
31
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
32
|
-
), n =
|
|
32
|
+
), n = j(), c = q(), r = b(() => c.hasChanges), s = o.preselectedDynamicContentList || [], { getPartnerName: m, getProductType: d } = U(), I = J(), {
|
|
33
33
|
templateId: l,
|
|
34
34
|
userId: u,
|
|
35
35
|
guidoConfig: p,
|
|
36
|
-
html:
|
|
37
|
-
css:
|
|
38
|
-
partnerName:
|
|
36
|
+
html: g = "",
|
|
37
|
+
css: f = "",
|
|
38
|
+
partnerName: a = m(),
|
|
39
39
|
productType: i = d(),
|
|
40
|
-
messageType: y =
|
|
41
|
-
username: C =
|
|
40
|
+
messageType: y = W,
|
|
41
|
+
username: C = M
|
|
42
42
|
} = o;
|
|
43
|
-
window.GuidoConfig =
|
|
44
|
-
partnerName:
|
|
43
|
+
window.GuidoConfig = O(z, p), window.GuidoConfig.partner = {
|
|
44
|
+
partnerName: a,
|
|
45
45
|
productType: i,
|
|
46
46
|
messageType: y
|
|
47
47
|
};
|
|
48
|
-
const { initPlugin: v } =
|
|
48
|
+
const { initPlugin: v } = x({
|
|
49
49
|
emailId: l,
|
|
50
50
|
userId: u,
|
|
51
51
|
username: C,
|
|
52
|
-
partnerName:
|
|
52
|
+
partnerName: a,
|
|
53
53
|
productType: i,
|
|
54
|
-
preselectedDynamicContentList:
|
|
55
|
-
}), { getDefaultTemplate: w } =
|
|
54
|
+
preselectedDynamicContentList: s
|
|
55
|
+
}), { getDefaultTemplate: w } = R(), P = b(() => {
|
|
56
56
|
var e;
|
|
57
57
|
return !((e = window.GuidoConfig) != null && e.useHeader);
|
|
58
58
|
});
|
|
59
|
-
|
|
59
|
+
N({
|
|
60
60
|
onBack: () => {
|
|
61
61
|
console.debug("guido:back"), t("back");
|
|
62
62
|
},
|
|
@@ -67,37 +67,39 @@ const ie = /* @__PURE__ */ _({
|
|
|
67
67
|
console.debug("guido:save:complete", e), t("save:complete", e);
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
|
-
const
|
|
70
|
+
const h = (e) => {
|
|
71
71
|
console.debug("dynamic-content:close", e), n.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
72
|
-
},
|
|
72
|
+
}, D = () => {
|
|
73
73
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
74
74
|
};
|
|
75
|
-
return k(
|
|
75
|
+
return k(() => r.value, () => {
|
|
76
|
+
t("on-change");
|
|
77
|
+
}), A(async () => {
|
|
76
78
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
77
79
|
try {
|
|
78
80
|
let e = {
|
|
79
|
-
html:
|
|
80
|
-
css:
|
|
81
|
+
html: g,
|
|
82
|
+
css: f,
|
|
81
83
|
forceRecreate: !0
|
|
82
84
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
83
85
|
};
|
|
84
|
-
e.html || (e = await w()), await v(e), n.selectedDynamicContentList =
|
|
86
|
+
e.html || (e = await w()), await v(e), n.selectedDynamicContentList = s;
|
|
85
87
|
} catch (e) {
|
|
86
88
|
console.error("Failed to initialize Stripo editor:", e);
|
|
87
89
|
}
|
|
88
90
|
document.addEventListener("dynamic-content:open", (e) => {
|
|
89
|
-
const
|
|
90
|
-
console.debug("dynamic-content:open",
|
|
91
|
+
const S = e;
|
|
92
|
+
console.debug("dynamic-content:open", S.detail), t("dynamic-content:open", S.detail);
|
|
91
93
|
});
|
|
92
|
-
}),
|
|
94
|
+
}), H(() => {
|
|
93
95
|
window.UIEditor.removeEditor();
|
|
94
96
|
}), T({
|
|
95
97
|
dynamicContent: {
|
|
96
|
-
insert:
|
|
97
|
-
close:
|
|
98
|
+
insert: h,
|
|
99
|
+
close: D
|
|
98
100
|
},
|
|
99
|
-
hasChanges:
|
|
100
|
-
}), { __sfc: !0, PreviewContainer: G, dynamicContentStore: n, props: o, editorStore:
|
|
101
|
+
hasChanges: r
|
|
102
|
+
}), { __sfc: !0, PreviewContainer: G, dynamicContentStore: n, props: o, editorStore: c, hasChanges: r, preselectedDynamicContentList: s, getPartnerName: m, getProductType: d, previewStore: I, templateId: l, userId: u, guidoConfig: p, html: g, css: f, partnerName: a, productType: i, messageType: y, username: C, emit: t, initPlugin: v, getDefaultTemplate: w, noHeader: P, insertDynamicContent: h, closeDynamicContent: D, Toaster: B, HeaderWrapper: F, SaveAsTemplateDrawer: K };
|
|
101
103
|
}
|
|
102
104
|
});
|
|
103
105
|
export {
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.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-aad05c54] .guido__view-option-selection-desktop svg,[data-v-aad05c54] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-aad05c54] .in-segments-wrapper__button_selected,[data-v-aad05c54] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-aad05c54] .in-tooltip-wrapper__icon{cursor:pointer}.guido-editor__wrapper[data-v-
|
|
1
|
+
.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-aad05c54] .guido__view-option-selection-desktop svg,[data-v-aad05c54] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-aad05c54] .in-segments-wrapper__button_selected,[data-v-aad05c54] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-aad05c54] .in-tooltip-wrapper__icon{cursor:pointer}.guido-editor__wrapper[data-v-19ef8aa2],.guido-editor__container[data-v-19ef8aa2]{width:100%;height:calc(100vh - 122px)}.guido-editor__no-header[data-v-19ef8aa2]{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.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.fce60db",
|
|
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",
|