@useinsider/guido 1.0.3-beta.c6f7a60 → 1.0.3-beta.c8da346
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 +79 -75
- package/dist/extensions/DynamicContent/dynamic-content-modal.js +20 -13
- package/dist/extensions/DynamicContent/dynamic-content.js +145 -33
- package/dist/guido.css +1 -1
- package/dist/src/@types/generic.d.ts +26 -6
- package/dist/src/components/Guido.vue.d.ts +2 -2
- package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +8 -2
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +50 -2
- package/dist/src/stores/config.d.ts +2 -2
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/src/stores/editor.d.ts +1 -1
- package/dist/src/stores/onboarding.d.ts +1 -1
- package/dist/src/stores/preview.d.ts +1 -1
- package/dist/src/stores/recommendation.d.ts +1 -1
- package/dist/src/stores/save-as-template.d.ts +1 -1
- package/dist/src/stores/toaster.d.ts +1 -1
- package/dist/src/stores/unsubscribe.d.ts +1 -1
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/stores/config.js +5 -5
- package/dist/stores/dynamic-content.js +1 -1
- package/dist/stores/editor.js +1 -1
- package/dist/stores/onboarding.js +27 -27
- package/dist/stores/preview.js +1 -1
- package/dist/stores/recommendation.js +3 -3
- package/dist/stores/save-as-template.js +2 -2
- package/dist/stores/toaster.js +1 -1
- package/dist/stores/unsubscribe.js +1 -1
- package/dist/stores/version-history.js +4 -4
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import { migrate as
|
|
6
|
-
import { DefaultUsername as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { useStripoApi as
|
|
14
|
-
import { useConfigStore as
|
|
15
|
-
import { useDynamicContentStore as
|
|
16
|
-
import { useEditorStore as
|
|
17
|
-
import { usePreviewStore as
|
|
18
|
-
import { useUnsubscribeStore as
|
|
19
|
-
import
|
|
20
|
-
const
|
|
1
|
+
import { defineComponent as z, defineAsyncComponent as L, ref as B, computed as k, watch as K, onMounted as j, onUnmounted as q } from "vue";
|
|
2
|
+
import { provideGuidoActions as J } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as Q } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as V } from "../composables/useStripo.js";
|
|
5
|
+
import { migrate as A } from "../config/migrator/index.js";
|
|
6
|
+
import { DefaultUsername as X, DefaultMessageType as Y, DefaultGuidoConfig as Z } from "../enums/defaults.js";
|
|
7
|
+
import $ from "./organisms/base/Toaster.vue.js";
|
|
8
|
+
import ee from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
9
|
+
import te from "./organisms/header/HeaderWrapper.vue.js";
|
|
10
|
+
import oe from "./organisms/LoadingWrapper.vue.js";
|
|
11
|
+
import ne from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
12
|
+
import re from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
13
|
+
import { useStripoApi as ie } from "../services/stripoApi.js";
|
|
14
|
+
import { useConfigStore as ae } from "../stores/config.js";
|
|
15
|
+
import { useDynamicContentStore as se } from "../stores/dynamic-content.js";
|
|
16
|
+
import { useEditorStore as ce } from "../stores/editor.js";
|
|
17
|
+
import { usePreviewStore as me } from "../stores/preview.js";
|
|
18
|
+
import { useUnsubscribeStore as de } from "../stores/unsubscribe.js";
|
|
19
|
+
import ue from "../node_modules/lodash-es/merge.js";
|
|
20
|
+
const _e = /* @__PURE__ */ z({
|
|
21
21
|
__name: "Guido",
|
|
22
22
|
props: {
|
|
23
23
|
templateId: null,
|
|
@@ -32,97 +32,101 @@ const Ge = /* @__PURE__ */ R({
|
|
|
32
32
|
templateConfig: null
|
|
33
33
|
},
|
|
34
34
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished"],
|
|
35
|
-
setup(
|
|
36
|
-
const
|
|
35
|
+
setup(N, { expose: F, emit: n }) {
|
|
36
|
+
const f = N, H = L(
|
|
37
37
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
38
|
-
),
|
|
38
|
+
), R = L(
|
|
39
39
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
40
|
-
),
|
|
40
|
+
), g = B(), a = se(), y = de(), v = ae(), s = ce(), x = me(), r = k(() => s.hasChanges), { getPartnerName: C, getProductType: b, isTestPartner: M } = Q(), h = () => {
|
|
41
41
|
var e;
|
|
42
|
-
return (e =
|
|
42
|
+
return (e = g.value) == null ? void 0 : e.handleSave(!0);
|
|
43
43
|
}, {
|
|
44
|
-
templateId:
|
|
45
|
-
userId:
|
|
46
|
-
guidoConfig:
|
|
44
|
+
templateId: c,
|
|
45
|
+
userId: S,
|
|
46
|
+
guidoConfig: w,
|
|
47
47
|
templateConfig: o,
|
|
48
|
-
html:
|
|
49
|
-
css:
|
|
50
|
-
partnerName:
|
|
51
|
-
productType: d =
|
|
52
|
-
messageType:
|
|
53
|
-
username:
|
|
54
|
-
} =
|
|
55
|
-
|
|
56
|
-
partnerName:
|
|
48
|
+
html: i = "",
|
|
49
|
+
css: D = "",
|
|
50
|
+
partnerName: m = C(),
|
|
51
|
+
productType: d = b(),
|
|
52
|
+
messageType: E = Y,
|
|
53
|
+
username: P = X
|
|
54
|
+
} = f, u = (o == null ? void 0 : o.preselectedDynamicContentList) || [];
|
|
55
|
+
s.templateId = c, window.GuidoConfig = ue(Z, w), window.GuidoConfig.partner = {
|
|
56
|
+
partnerName: m,
|
|
57
57
|
productType: d,
|
|
58
|
-
messageType:
|
|
59
|
-
},
|
|
60
|
-
const { initPlugin:
|
|
61
|
-
emailId:
|
|
62
|
-
userId:
|
|
63
|
-
username:
|
|
64
|
-
partnerName:
|
|
58
|
+
messageType: E
|
|
59
|
+
}, v.templateConfig = o;
|
|
60
|
+
const { initPlugin: T } = V({
|
|
61
|
+
emailId: c,
|
|
62
|
+
userId: S,
|
|
63
|
+
username: P,
|
|
64
|
+
partnerName: m,
|
|
65
65
|
productType: d,
|
|
66
|
-
preselectedDynamicContentList:
|
|
66
|
+
preselectedDynamicContentList: u,
|
|
67
67
|
onReady: () => {
|
|
68
|
-
console.debug("guido:ready"),
|
|
68
|
+
console.debug("guido:ready"), n("ready");
|
|
69
69
|
}
|
|
70
|
-
}), { getDefaultTemplate:
|
|
70
|
+
}), { getDefaultTemplate: G } = ie(), O = k(() => {
|
|
71
71
|
var e;
|
|
72
72
|
return !((e = window.GuidoConfig) != null && e.useHeader);
|
|
73
73
|
});
|
|
74
|
-
|
|
74
|
+
J({
|
|
75
75
|
onBack: () => {
|
|
76
|
-
console.debug("guido:back"),
|
|
76
|
+
console.debug("guido:back"), n("back");
|
|
77
77
|
},
|
|
78
78
|
onSaveStart: () => {
|
|
79
|
-
console.debug("guido:save:start"),
|
|
79
|
+
console.debug("guido:save:start"), n("save:start");
|
|
80
80
|
},
|
|
81
81
|
onSaveComplete: (e) => {
|
|
82
|
-
console.debug("guido:save:complete", e),
|
|
82
|
+
console.debug("guido:save:complete", e), n("save:complete", e);
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
},
|
|
85
|
+
const I = (e) => {
|
|
86
|
+
a.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
87
|
+
}, U = () => {
|
|
88
88
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
89
89
|
};
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
}),
|
|
90
|
+
return K(() => r.value, () => {
|
|
91
|
+
n("on-change", r.value);
|
|
92
|
+
}), j(async () => {
|
|
93
93
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
94
94
|
try {
|
|
95
|
-
|
|
96
|
-
let
|
|
97
|
-
html:
|
|
98
|
-
css:
|
|
95
|
+
y.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
96
|
+
let t = {
|
|
97
|
+
html: i && await A(i),
|
|
98
|
+
css: D,
|
|
99
99
|
forceRecreate: !0
|
|
100
100
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
101
101
|
};
|
|
102
|
-
|
|
103
|
-
} catch (
|
|
104
|
-
console.error("Failed to initialize Stripo editor:",
|
|
102
|
+
t.html || (t = await G(), t.html = await A(t.html)), await T(t), a.selectedDynamicContentList = u;
|
|
103
|
+
} catch (t) {
|
|
104
|
+
console.error("Failed to initialize Stripo editor:", t);
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
console.
|
|
106
|
+
const e = (t, l) => {
|
|
107
|
+
const p = t, { attribute: W, position: _ } = p.detail;
|
|
108
|
+
return console.log(l, W, "Position:", _), { attribute: W, position: _ };
|
|
109
|
+
};
|
|
110
|
+
document.addEventListener("dynamic-content:open", (t) => {
|
|
111
|
+
const { attribute: l, position: p } = e(t, "📥 Dynamic Content Open Event - Data:");
|
|
112
|
+
n("dynamic-content:open", l, p);
|
|
109
113
|
});
|
|
110
|
-
}),
|
|
114
|
+
}), q(() => {
|
|
111
115
|
try {
|
|
112
116
|
window.UIEditor.removeEditor();
|
|
113
117
|
} catch {
|
|
114
118
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
115
119
|
}
|
|
116
|
-
}),
|
|
120
|
+
}), F({
|
|
117
121
|
dynamicContent: {
|
|
118
|
-
insert:
|
|
119
|
-
close:
|
|
122
|
+
insert: I,
|
|
123
|
+
close: U
|
|
120
124
|
},
|
|
121
|
-
hasChanges:
|
|
122
|
-
saveSilent:
|
|
123
|
-
}), { __sfc: !0, PreviewContainer:
|
|
125
|
+
hasChanges: r,
|
|
126
|
+
saveSilent: h
|
|
127
|
+
}), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: R, headerWrapperRef: g, dynamicContentStore: a, unsubscribeStore: y, props: f, configStore: v, editorStore: s, previewStore: x, hasChanges: r, getPartnerName: C, getProductType: b, isTestPartner: M, saveSilent: h, templateId: c, userId: S, guidoConfig: w, templateConfig: o, html: i, css: D, partnerName: m, productType: d, messageType: E, username: P, preselectedDynamicContentList: u, emit: n, initPlugin: T, getDefaultTemplate: G, noHeader: O, insertDynamicContent: I, closeDynamicContent: U, Toaster: $, FilterSelectionDrawer: ee, HeaderWrapper: te, LoadingWrapper: oe, SaveAsTemplateDrawer: ne, UnsubscribeWrapper: re };
|
|
124
128
|
}
|
|
125
129
|
});
|
|
126
130
|
export {
|
|
127
|
-
|
|
131
|
+
_e as default
|
|
128
132
|
};
|
|
@@ -1,27 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var a = (t, e, n) =>
|
|
4
|
-
class
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var r = (t, e, n) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var a = (t, e, n) => r(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
class v {
|
|
5
5
|
constructor() {
|
|
6
6
|
a(this, "selectedDynamicContent", null);
|
|
7
7
|
a(this, "dataSelectCallback", () => {
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Opens the merge tags library modal
|
|
12
|
+
* @param dynamicContent - Currently selected dynamic content (if any)
|
|
13
|
+
* @param onDataSelectCallback - Callback invoked when user selects a merge tag
|
|
14
|
+
* @param position - Optional position data to place the modal
|
|
15
|
+
*/
|
|
16
|
+
openMergeTagsLibrary(e, n, s) {
|
|
11
17
|
this.dataSelectCallback = n, this.selectedDynamicContent = e;
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
const l = {
|
|
19
|
+
attribute: e,
|
|
20
|
+
position: s
|
|
21
|
+
}, i = new CustomEvent("dynamic-content:open", {
|
|
22
|
+
detail: l
|
|
16
23
|
});
|
|
17
|
-
document.dispatchEvent(
|
|
18
|
-
const o = (
|
|
19
|
-
const c =
|
|
24
|
+
document.dispatchEvent(i);
|
|
25
|
+
const o = (d) => {
|
|
26
|
+
const c = d.detail;
|
|
20
27
|
this.selectedDynamicContent = c, c.text && c.value && this.dataSelectCallback(c), document.removeEventListener("dynamic-content:close", o);
|
|
21
28
|
};
|
|
22
29
|
document.addEventListener("dynamic-content:close", o);
|
|
23
30
|
}
|
|
24
31
|
}
|
|
25
32
|
export {
|
|
26
|
-
|
|
33
|
+
v as ExternalMergeTagsLibrary
|
|
27
34
|
};
|
|
@@ -1,61 +1,173 @@
|
|
|
1
|
-
var
|
|
2
|
-
var g = (
|
|
3
|
-
var
|
|
4
|
-
import { dynamicContentToMergeTags as
|
|
5
|
-
import { UIElement as
|
|
1
|
+
var l = Object.defineProperty;
|
|
2
|
+
var g = (r, o, t) => o in r ? l(r, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[o] = t;
|
|
3
|
+
var s = (r, o, t) => g(r, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { dynamicContentToMergeTags as d } from "../../utils/genericUtil.js";
|
|
5
|
+
import { UIElement as u, UIElementType as a, UEAttr as m, UIElementTagRegistry as h } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
6
|
import { ExternalMergeTagsLibrary as T } from "./dynamic-content-modal.js";
|
|
7
|
-
const
|
|
8
|
-
class
|
|
9
|
-
registerUiElements(
|
|
10
|
-
|
|
7
|
+
const c = "external-dynamic-content-ui-element", y = "button-add-dynamic-content";
|
|
8
|
+
class C extends h {
|
|
9
|
+
registerUiElements(o) {
|
|
10
|
+
o[a.MERGETAGS] = c;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
class
|
|
13
|
+
class E extends u {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
s(this, "mergeTagsButton", null);
|
|
17
|
+
s(this, "mergeTagsLibrary", null);
|
|
18
|
+
s(this, "clickListener", null);
|
|
19
|
+
s(this, "lastClickedPosition");
|
|
20
|
+
s(this, "mousedownListener", null);
|
|
21
21
|
}
|
|
22
22
|
getId() {
|
|
23
|
-
return
|
|
23
|
+
return c;
|
|
24
24
|
}
|
|
25
|
-
onRender(
|
|
26
|
-
var
|
|
27
|
-
this.
|
|
25
|
+
onRender(t) {
|
|
26
|
+
var e;
|
|
27
|
+
this.mergeTagsButton = t.querySelector("#guido__btn-add-dynamic-content"), this.clickListener = this._onClick.bind(this), (e = this.mergeTagsButton) == null || e.addEventListener("click", this.clickListener), this._setupCoordinateTracking();
|
|
28
28
|
}
|
|
29
29
|
onDestroy() {
|
|
30
|
-
var
|
|
31
|
-
(
|
|
30
|
+
var t;
|
|
31
|
+
this.clickListener && ((t = this.mergeTagsButton) == null || t.removeEventListener("click", this.clickListener)), this._cleanupCoordinateTracking(), this.mergeTagsButton = null, this.clickListener = null, this.lastClickedPosition = void 0;
|
|
32
32
|
}
|
|
33
33
|
_onClick() {
|
|
34
34
|
this.openMergeTagLibrary();
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Called when Stripo detects merge tag interactions
|
|
38
|
+
* This is the key method that receives notifications about merge tag clicks
|
|
39
|
+
* @param name - Attribute name (e.g., 'mergeTag')
|
|
40
|
+
* @param value - MergeTag object with label, value, selStart, selEnd, etc.
|
|
41
|
+
*/
|
|
42
|
+
onAttributeUpdated(t, e) {
|
|
43
|
+
if (t !== "mergeTag" || !e)
|
|
44
|
+
return;
|
|
45
|
+
const n = {
|
|
46
|
+
text: e.label,
|
|
47
|
+
value: e.value
|
|
48
|
+
}, i = this.lastClickedPosition;
|
|
49
|
+
this.lastClickedPosition = void 0, this._openDynamicContentLibrary(n, i);
|
|
50
|
+
}
|
|
36
51
|
openMergeTagLibrary() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
52
|
+
const t = this._getButtonPosition(), e = { value: "", text: "" };
|
|
53
|
+
this._openDynamicContentLibrary(e, t);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Opens the dynamic content library for external apps
|
|
57
|
+
* Dispatches event with dynamic content data and position
|
|
58
|
+
*/
|
|
59
|
+
_openDynamicContentLibrary(t, e) {
|
|
60
|
+
this._ensureMergeTagsLibrary(), this.mergeTagsLibrary.openMergeTagsLibrary(
|
|
61
|
+
t,
|
|
62
|
+
(n) => {
|
|
63
|
+
this.api.triggerValueChange(d([n])[0]);
|
|
64
|
+
},
|
|
65
|
+
e
|
|
42
66
|
);
|
|
43
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Ensures merge tags library is initialized
|
|
70
|
+
*/
|
|
71
|
+
_ensureMergeTagsLibrary() {
|
|
72
|
+
this.mergeTagsLibrary || (this.mergeTagsLibrary = new T());
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Gets the button's position on the screen
|
|
76
|
+
* Used to position the modal near the button
|
|
77
|
+
*/
|
|
78
|
+
_getButtonPosition() {
|
|
79
|
+
const t = this.mergeTagsButton.getBoundingClientRect();
|
|
80
|
+
return {
|
|
81
|
+
x: t.left,
|
|
82
|
+
y: t.top,
|
|
83
|
+
width: t.width,
|
|
84
|
+
height: t.height
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Sets up coordinate tracking for merge tag clicks in the iframe
|
|
89
|
+
* Workaround for Stripo intercepting click events - tracks mousedown events instead
|
|
90
|
+
*/
|
|
91
|
+
// TODO: Check possibilities with baseApi to get the position of the merge tag and its values
|
|
92
|
+
_setupCoordinateTracking() {
|
|
93
|
+
const t = () => {
|
|
94
|
+
const e = this._getEditorFrame();
|
|
95
|
+
if (!e) {
|
|
96
|
+
setTimeout(t, 100);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
this.mousedownListener = (n) => {
|
|
100
|
+
const i = this._findMergeTagElement(n.target);
|
|
101
|
+
i && (this.lastClickedPosition = this._calculateAbsolutePosition(e, i));
|
|
102
|
+
}, e.contentWindow.document.addEventListener("mousedown", this.mousedownListener);
|
|
103
|
+
};
|
|
104
|
+
t();
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Gets the editor iframe element
|
|
108
|
+
*/
|
|
109
|
+
_getEditorFrame() {
|
|
110
|
+
var n;
|
|
111
|
+
const t = document.querySelector("ui-editor");
|
|
112
|
+
if (!(t != null && t.shadowRoot))
|
|
113
|
+
return null;
|
|
114
|
+
const e = t.shadowRoot.querySelector("iframe");
|
|
115
|
+
return (n = e == null ? void 0 : e.contentWindow) != null && n.document ? e : null;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Finds merge tag element in the element tree
|
|
119
|
+
*/
|
|
120
|
+
_findMergeTagElement(t) {
|
|
121
|
+
var n, i;
|
|
122
|
+
let e = t;
|
|
123
|
+
for (; e; ) {
|
|
124
|
+
if ((n = e.classList) != null && n.contains("target") || (i = e.classList) != null && i.contains("esd-merge-tag"))
|
|
125
|
+
return e;
|
|
126
|
+
e = e.parentElement;
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Calculates absolute position of element relative to page
|
|
132
|
+
*/
|
|
133
|
+
_calculateAbsolutePosition(t, e) {
|
|
134
|
+
const n = t.getBoundingClientRect(), i = e.getBoundingClientRect();
|
|
135
|
+
return {
|
|
136
|
+
x: n.x + i.x,
|
|
137
|
+
y: n.y + i.y,
|
|
138
|
+
width: i.width,
|
|
139
|
+
height: i.height
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Cleans up the coordinate tracking event listener
|
|
144
|
+
*/
|
|
145
|
+
_cleanupCoordinateTracking() {
|
|
146
|
+
var e;
|
|
147
|
+
if (!this.mousedownListener)
|
|
148
|
+
return;
|
|
149
|
+
const t = this._getEditorFrame();
|
|
150
|
+
(e = t == null ? void 0 : t.contentWindow) != null && e.document && t.contentWindow.document.removeEventListener("mousedown", this.mousedownListener), this.mousedownListener = null;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Returns the HTML template for the "Add Dynamic Content" button
|
|
154
|
+
* This button is placed in the merge tags selector UI
|
|
155
|
+
*/
|
|
44
156
|
getTemplate() {
|
|
45
157
|
return `
|
|
46
158
|
<div>
|
|
47
|
-
<${
|
|
159
|
+
<${a.BUTTON}
|
|
48
160
|
id="guido__btn-add-dynamic-content"
|
|
49
161
|
class="btn btn-primary"
|
|
50
|
-
${
|
|
51
|
-
<${
|
|
52
|
-
</${
|
|
162
|
+
${m.BUTTON.name}="${y}">
|
|
163
|
+
<${a.ICON} src="plus" class="icon icon-button color-primary">
|
|
164
|
+
</${a.ICON}>
|
|
53
165
|
${this.api.translate("Add Dynamic Content")}
|
|
54
|
-
</${
|
|
166
|
+
</${a.BUTTON}>
|
|
55
167
|
</div>`;
|
|
56
168
|
}
|
|
57
169
|
}
|
|
58
170
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
171
|
+
C as DynamicContentTagRegistry,
|
|
172
|
+
E as DynamicContentUiElementExtension
|
|
61
173
|
};
|
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-9fb62152],.guido-editor__container[data-v-9fb62152]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-9fb62152]{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-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -37,15 +37,39 @@ export type TemplateConfig = {
|
|
|
37
37
|
selectedUnsubscribePages?: number[];
|
|
38
38
|
variationId?: string;
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
type BaseDynamicContent = {
|
|
41
41
|
value: string;
|
|
42
|
-
text: string;
|
|
43
42
|
fallback?: string;
|
|
44
43
|
format?: {
|
|
45
44
|
key: string;
|
|
46
45
|
value: string;
|
|
47
46
|
};
|
|
48
47
|
};
|
|
48
|
+
export type DynamicContent = BaseDynamicContent & {
|
|
49
|
+
text: string;
|
|
50
|
+
};
|
|
51
|
+
export type MergeTag = BaseDynamicContent & {
|
|
52
|
+
label: string;
|
|
53
|
+
selStart?: number;
|
|
54
|
+
selEnd?: number;
|
|
55
|
+
hidden?: boolean;
|
|
56
|
+
};
|
|
57
|
+
export type PositionData = {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
width?: number;
|
|
61
|
+
height?: number;
|
|
62
|
+
};
|
|
63
|
+
export type DynamicContentEvent = {
|
|
64
|
+
attribute: DynamicContent;
|
|
65
|
+
position?: PositionData;
|
|
66
|
+
};
|
|
67
|
+
export type MergeTagClickEvent = {
|
|
68
|
+
position: PositionData;
|
|
69
|
+
element: HTMLElement;
|
|
70
|
+
tagValue: string | null;
|
|
71
|
+
tagLabel: string | null;
|
|
72
|
+
};
|
|
49
73
|
export interface EmailHeader {
|
|
50
74
|
senderName: string;
|
|
51
75
|
subject: string;
|
|
@@ -61,10 +85,6 @@ export interface TooltipOptions {
|
|
|
61
85
|
};
|
|
62
86
|
preventXss?: boolean;
|
|
63
87
|
}
|
|
64
|
-
export type MergeTag = {
|
|
65
|
-
label: string;
|
|
66
|
-
value: string;
|
|
67
|
-
};
|
|
68
88
|
export type TextValueObject = {
|
|
69
89
|
text: string;
|
|
70
90
|
value: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DynamicContent, GuidoConfig, TemplateConfig } from '@@/Types/generic';
|
|
1
|
+
import type { DynamicContent, GuidoConfig, PositionData, TemplateConfig } from '@@/Types/generic';
|
|
2
2
|
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
templateId: string;
|
|
@@ -20,7 +20,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
|
|
|
20
20
|
hasChanges: import("vue").ComputedRef<boolean>;
|
|
21
21
|
saveSilent: () => Promise<SavedTemplateDetails | undefined> | undefined;
|
|
22
22
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
23
|
-
"dynamic-content:open": (detail: DynamicContent | null) => void;
|
|
23
|
+
"dynamic-content:open": (detail: DynamicContent | null, position?: PositionData | undefined) => void;
|
|
24
24
|
back: () => void;
|
|
25
25
|
"save:start": () => void;
|
|
26
26
|
"save:complete": (data: Omit<SavedTemplateDetails, "forceRecreate">) => void;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import type { DynamicContent } from '@@/Types/generic';
|
|
1
|
+
import type { DynamicContent, PositionData } from '@@/Types/generic';
|
|
2
2
|
export declare class ExternalMergeTagsLibrary {
|
|
3
3
|
selectedDynamicContent: DynamicContent | null;
|
|
4
4
|
dataSelectCallback: (data: DynamicContent) => void;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Opens the merge tags library modal
|
|
7
|
+
* @param dynamicContent - Currently selected dynamic content (if any)
|
|
8
|
+
* @param onDataSelectCallback - Callback invoked when user selects a merge tag
|
|
9
|
+
* @param position - Optional position data to place the modal
|
|
10
|
+
*/
|
|
11
|
+
openMergeTagsLibrary(dynamicContent: DynamicContent, onDataSelectCallback: (data: DynamicContent) => void, position?: PositionData): void;
|
|
6
12
|
}
|
|
@@ -1,16 +1,64 @@
|
|
|
1
|
+
import type { MergeTag } from '@@/Types/generic';
|
|
1
2
|
import { UIElementType, UIElement, UIElementTagRegistry } from '@stripoinc/ui-editor-extensions';
|
|
2
3
|
export declare class DynamicContentTagRegistry extends UIElementTagRegistry {
|
|
3
4
|
registerUiElements(uiElementsTagsMap: Record<UIElementType, string>): void;
|
|
4
5
|
}
|
|
5
6
|
export declare class DynamicContentUiElementExtension extends UIElement {
|
|
6
7
|
private mergeTagsButton;
|
|
7
|
-
private listener;
|
|
8
8
|
private mergeTagsLibrary;
|
|
9
|
-
private
|
|
9
|
+
private clickListener;
|
|
10
|
+
private lastClickedPosition;
|
|
11
|
+
private mousedownListener;
|
|
10
12
|
getId(): string;
|
|
11
13
|
onRender(container: HTMLElement): void;
|
|
12
14
|
onDestroy(): void;
|
|
13
15
|
_onClick(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Called when Stripo detects merge tag interactions
|
|
18
|
+
* This is the key method that receives notifications about merge tag clicks
|
|
19
|
+
* @param name - Attribute name (e.g., 'mergeTag')
|
|
20
|
+
* @param value - MergeTag object with label, value, selStart, selEnd, etc.
|
|
21
|
+
*/
|
|
22
|
+
onAttributeUpdated(name: string, value: MergeTag | null | undefined): void;
|
|
14
23
|
openMergeTagLibrary(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Opens the dynamic content library for external apps
|
|
26
|
+
* Dispatches event with dynamic content data and position
|
|
27
|
+
*/
|
|
28
|
+
private _openDynamicContentLibrary;
|
|
29
|
+
/**
|
|
30
|
+
* Ensures merge tags library is initialized
|
|
31
|
+
*/
|
|
32
|
+
private _ensureMergeTagsLibrary;
|
|
33
|
+
/**
|
|
34
|
+
* Gets the button's position on the screen
|
|
35
|
+
* Used to position the modal near the button
|
|
36
|
+
*/
|
|
37
|
+
private _getButtonPosition;
|
|
38
|
+
/**
|
|
39
|
+
* Sets up coordinate tracking for merge tag clicks in the iframe
|
|
40
|
+
* Workaround for Stripo intercepting click events - tracks mousedown events instead
|
|
41
|
+
*/
|
|
42
|
+
private _setupCoordinateTracking;
|
|
43
|
+
/**
|
|
44
|
+
* Gets the editor iframe element
|
|
45
|
+
*/
|
|
46
|
+
private _getEditorFrame;
|
|
47
|
+
/**
|
|
48
|
+
* Finds merge tag element in the element tree
|
|
49
|
+
*/
|
|
50
|
+
private _findMergeTagElement;
|
|
51
|
+
/**
|
|
52
|
+
* Calculates absolute position of element relative to page
|
|
53
|
+
*/
|
|
54
|
+
private _calculateAbsolutePosition;
|
|
55
|
+
/**
|
|
56
|
+
* Cleans up the coordinate tracking event listener
|
|
57
|
+
*/
|
|
58
|
+
private _cleanupCoordinateTracking;
|
|
59
|
+
/**
|
|
60
|
+
* Returns the HTML template for the "Add Dynamic Content" button
|
|
61
|
+
* This button is placed in the merge tags selector UI
|
|
62
|
+
*/
|
|
15
63
|
getTemplate(): string;
|
|
16
64
|
}
|
|
@@ -3,7 +3,7 @@ interface StoreState {
|
|
|
3
3
|
guidoConfig: GuidoConfig;
|
|
4
4
|
templateConfig?: TemplateConfig;
|
|
5
5
|
}
|
|
6
|
-
export declare const useConfigStore: import("pinia").StoreDefinition<"
|
|
6
|
+
export declare const useConfigStore: import("pinia").StoreDefinition<"config", StoreState, {
|
|
7
7
|
getVariationId: (state: {
|
|
8
8
|
guidoConfig: {
|
|
9
9
|
translationsPath: string;
|
|
@@ -88,12 +88,12 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guidoConfi
|
|
|
88
88
|
templateConfig?: {
|
|
89
89
|
preselectedDynamicContentList?: {
|
|
90
90
|
value: string;
|
|
91
|
-
text: string;
|
|
92
91
|
fallback?: string | undefined;
|
|
93
92
|
format?: {
|
|
94
93
|
key: string;
|
|
95
94
|
value: string;
|
|
96
95
|
} | undefined;
|
|
96
|
+
text: string;
|
|
97
97
|
}[] | undefined;
|
|
98
98
|
selectedUnsubscribePages?: number[] | undefined;
|
|
99
99
|
variationId?: string | undefined;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import type { DynamicContent } from '@@/Types/generic';
|
|
2
|
-
export declare const useDynamicContentStore: import("pinia").StoreDefinition<"
|
|
2
|
+
export declare const useDynamicContentStore: import("pinia").StoreDefinition<"dynamicContent", {
|
|
3
3
|
selectedDynamicContent: DynamicContent;
|
|
4
4
|
selectedDynamicContentList: DynamicContent[];
|
|
5
5
|
}, {
|
|
6
6
|
getSelectedDynamicContentList: (state: {
|
|
7
7
|
selectedDynamicContent: {
|
|
8
8
|
value: string;
|
|
9
|
-
text: string;
|
|
10
9
|
fallback?: string | undefined;
|
|
11
10
|
format?: {
|
|
12
11
|
key: string;
|
|
13
12
|
value: string;
|
|
14
13
|
} | undefined;
|
|
14
|
+
text: string;
|
|
15
15
|
};
|
|
16
16
|
selectedDynamicContentList: {
|
|
17
17
|
value: string;
|
|
18
|
-
text: string;
|
|
19
18
|
fallback?: string | undefined;
|
|
20
19
|
format?: {
|
|
21
20
|
key: string;
|
|
22
21
|
value: string;
|
|
23
22
|
} | undefined;
|
|
23
|
+
text: string;
|
|
24
24
|
}[];
|
|
25
25
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
26
26
|
selectedDynamicContent: DynamicContent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OnboardingCardConfig, OnboardingType, OnboardingStoreState } from '@@/Types/onboarding';
|
|
2
|
-
export declare const useOnboardingStore: import("pinia").StoreDefinition<"
|
|
2
|
+
export declare const useOnboardingStore: import("pinia").StoreDefinition<"onboarding", OnboardingStoreState, {
|
|
3
3
|
getOnboarding: (state: {
|
|
4
4
|
onboardings: {
|
|
5
5
|
newVersionPopup: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PreviewState, EmailFormat } from '@@/Types/preview';
|
|
2
|
-
export declare const usePreviewStore: import("pinia").StoreDefinition<"
|
|
2
|
+
export declare const usePreviewStore: import("pinia").StoreDefinition<"preview", PreviewState, {
|
|
3
3
|
isAMPModeEnabled: (state: {
|
|
4
4
|
emailFormat: EmailFormat;
|
|
5
5
|
ampHtml: string;
|
|
@@ -6,5 +6,5 @@ type RecommendationConfig = {
|
|
|
6
6
|
interface StoreState {
|
|
7
7
|
recommendationConfigs: RecommendationConfig[];
|
|
8
8
|
}
|
|
9
|
-
export declare const useRecommendationStore: import("pinia").StoreDefinition<"
|
|
9
|
+
export declare const useRecommendationStore: import("pinia").StoreDefinition<"recommendation", StoreState, {}, {}>;
|
|
10
10
|
export {};
|
|
@@ -17,7 +17,7 @@ interface StoreState {
|
|
|
17
17
|
message: number;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
export declare const useSaveAsTemplateStore: import("pinia").StoreDefinition<"
|
|
20
|
+
export declare const useSaveAsTemplateStore: import("pinia").StoreDefinition<"saveAsTemplate", StoreState, {
|
|
21
21
|
getTemplateName: (state: {
|
|
22
22
|
templateName: string;
|
|
23
23
|
categories: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ToasterState, ToasterOptions } from '@@/Types/toaster';
|
|
2
|
-
export declare const useToasterStore: import("pinia").StoreDefinition<"
|
|
2
|
+
export declare const useToasterStore: import("pinia").StoreDefinition<"toaster", ToasterState, {
|
|
3
3
|
shouldAutoHide: (s: {
|
|
4
4
|
status: boolean;
|
|
5
5
|
type: import("@@/Types/toaster").ToasterType;
|
|
@@ -11,7 +11,7 @@ interface StoreState {
|
|
|
11
11
|
isGlobalUnsubscribeDisabled: boolean;
|
|
12
12
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
13
13
|
}
|
|
14
|
-
export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"
|
|
14
|
+
export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"unsubscribe", StoreState, {
|
|
15
15
|
getSelectedCollection: (state: {
|
|
16
16
|
templates: {
|
|
17
17
|
id: number;
|
|
@@ -2,7 +2,7 @@ import type { VersionHistoryState } from '@@/Types/version-history-api';
|
|
|
2
2
|
export interface StoreState extends VersionHistoryState {
|
|
3
3
|
editorVisualMode: 'desktop' | 'mobile';
|
|
4
4
|
}
|
|
5
|
-
export declare const useVersionHistoryStore: import("pinia").StoreDefinition<"
|
|
5
|
+
export declare const useVersionHistoryStore: import("pinia").StoreDefinition<"versionHistory", StoreState, {
|
|
6
6
|
hasPreviousPatch: (state: {
|
|
7
7
|
editorVisualMode: "desktop" | "mobile";
|
|
8
8
|
previousPatch: {
|
package/dist/stores/config.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DefaultGuidoConfig as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
const
|
|
1
|
+
import { DefaultGuidoConfig as e } from "../enums/defaults.js";
|
|
2
|
+
import { defineStore as i } from "pinia";
|
|
3
|
+
const r = i("config", {
|
|
4
4
|
state: () => ({
|
|
5
|
-
guidoConfig:
|
|
5
|
+
guidoConfig: e,
|
|
6
6
|
templateConfig: {}
|
|
7
7
|
}),
|
|
8
8
|
getters: {
|
|
@@ -13,5 +13,5 @@ const n = e("guidoConfig", {
|
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
r as useConfigStore
|
|
17
17
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { removeDuplicatesFromArray as n } from "../utils/arrayUtil.js";
|
|
2
2
|
import { defineStore as a } from "pinia";
|
|
3
|
-
const s = a("
|
|
3
|
+
const s = a("dynamicContent", {
|
|
4
4
|
state: () => ({
|
|
5
5
|
selectedDynamicContent: { text: "", value: "", fallback: "" },
|
|
6
6
|
selectedDynamicContentList: []
|
package/dist/stores/editor.js
CHANGED
|
@@ -14,41 +14,41 @@ const e = () => ({
|
|
|
14
14
|
},
|
|
15
15
|
userModalState: {},
|
|
16
16
|
isFetched: !1
|
|
17
|
-
}),
|
|
17
|
+
}), g = s("onboarding", {
|
|
18
18
|
state: () => a(),
|
|
19
19
|
getters: {
|
|
20
|
-
getOnboarding: (n) => (
|
|
21
|
-
isActive: (n) => (
|
|
22
|
-
getCurrentCard: (n) => (
|
|
23
|
-
const
|
|
24
|
-
return
|
|
20
|
+
getOnboarding: (n) => (o) => n.onboardings[o],
|
|
21
|
+
isActive: (n) => (o) => n.onboardings[o].isActive,
|
|
22
|
+
getCurrentCard: (n) => (o) => {
|
|
23
|
+
const i = n.onboardings[o];
|
|
24
|
+
return i.config[i.cardIndex];
|
|
25
25
|
},
|
|
26
26
|
getGenericCurrentCard: (n) => {
|
|
27
|
-
const { genericOnboarding:
|
|
28
|
-
return
|
|
27
|
+
const { genericOnboarding: o } = n.onboardings;
|
|
28
|
+
return o.config[o.cardIndex];
|
|
29
29
|
},
|
|
30
30
|
getTextBlockCurrentCard: (n) => {
|
|
31
|
-
const { textBlockOnboarding:
|
|
32
|
-
return
|
|
31
|
+
const { textBlockOnboarding: o } = n.onboardings;
|
|
32
|
+
return o.config[o.cardIndex];
|
|
33
33
|
},
|
|
34
34
|
getVersionHistoryCurrentCard: (n) => {
|
|
35
|
-
const { versionHistoryOnboarding:
|
|
36
|
-
return
|
|
35
|
+
const { versionHistoryOnboarding: o } = n.onboardings;
|
|
36
|
+
return o.config[o.cardIndex];
|
|
37
37
|
},
|
|
38
38
|
getAmpCurrentCard: (n) => {
|
|
39
|
-
const { ampOnboarding:
|
|
40
|
-
return
|
|
39
|
+
const { ampOnboarding: o } = n.onboardings;
|
|
40
|
+
return o.config[o.cardIndex];
|
|
41
41
|
},
|
|
42
|
-
shouldShowOnboarding: (n) => (
|
|
43
|
-
const
|
|
44
|
-
return
|
|
42
|
+
shouldShowOnboarding: (n) => (o) => {
|
|
43
|
+
const i = n.userModalState.Guido;
|
|
44
|
+
return o === "newVersionPopup" && (i != null && i.genericOnboarding) ? !1 : i ? !i[o] : !0;
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
actions: {
|
|
48
48
|
closeOtherOnboardings(n) {
|
|
49
|
-
Object.keys(this.onboardings).forEach((
|
|
50
|
-
const
|
|
51
|
-
|
|
49
|
+
Object.keys(this.onboardings).forEach((o) => {
|
|
50
|
+
const i = o;
|
|
51
|
+
i !== n && this.onboardings[i].isActive && (this.onboardings[i].isActive = !1, this.onboardings[i].cardIndex = 0, this.onboardings[i].config = []);
|
|
52
52
|
});
|
|
53
53
|
},
|
|
54
54
|
start(n) {
|
|
@@ -63,8 +63,8 @@ const e = () => ({
|
|
|
63
63
|
previous(n) {
|
|
64
64
|
this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
|
|
65
65
|
},
|
|
66
|
-
setConfig(n,
|
|
67
|
-
this.onboardings[n].config =
|
|
66
|
+
setConfig(n, o) {
|
|
67
|
+
this.onboardings[n].config = o ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
|
|
68
68
|
},
|
|
69
69
|
async onDiscoverNowClicked() {
|
|
70
70
|
await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido"), this.start("genericOnboarding");
|
|
@@ -81,15 +81,15 @@ const e = () => ({
|
|
|
81
81
|
async fetchUserModalState() {
|
|
82
82
|
if (this.isFetched)
|
|
83
83
|
return;
|
|
84
|
-
const { fetchUserModalState: n } = t(),
|
|
85
|
-
this.userModalState =
|
|
84
|
+
const { fetchUserModalState: n } = t(), o = await n();
|
|
85
|
+
this.userModalState = o, this.isFetched = !0;
|
|
86
86
|
},
|
|
87
|
-
async setUserModalState(n,
|
|
87
|
+
async setUserModalState(n, o, i) {
|
|
88
88
|
const { setUserModalState: r } = t();
|
|
89
|
-
await r(n,
|
|
89
|
+
await r(n, o, i), this.isFetched = !1, await this.fetchUserModalState();
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
export {
|
|
94
|
-
|
|
94
|
+
g as useOnboardingStore
|
|
95
95
|
};
|
package/dist/stores/preview.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineStore as e } from "pinia";
|
|
2
|
-
const
|
|
2
|
+
const t = () => ({
|
|
3
3
|
recommendationConfigs: []
|
|
4
|
-
}), n = e("
|
|
5
|
-
state: () =>
|
|
4
|
+
}), n = e("recommendation", {
|
|
5
|
+
state: () => t()
|
|
6
6
|
});
|
|
7
7
|
export {
|
|
8
8
|
n as useRecommendationStore
|
|
@@ -17,7 +17,7 @@ const r = () => ({
|
|
|
17
17
|
editor: 2,
|
|
18
18
|
message: 1
|
|
19
19
|
}
|
|
20
|
-
}),
|
|
20
|
+
}), n = i("saveAsTemplate", {
|
|
21
21
|
state: () => r(),
|
|
22
22
|
getters: {
|
|
23
23
|
getTemplateName: (e) => e.templateName.trim(),
|
|
@@ -44,5 +44,5 @@ const r = () => ({
|
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
export {
|
|
47
|
-
|
|
47
|
+
n as useSaveAsTemplateStore
|
|
48
48
|
};
|
package/dist/stores/toaster.js
CHANGED
|
@@ -12,7 +12,7 @@ const p = () => ({
|
|
|
12
12
|
typeSelectionDrawerStatus: !1,
|
|
13
13
|
isGlobalUnsubscribeDisabled: !1,
|
|
14
14
|
isSubscriptionPreferencesCenterDisabled: !1
|
|
15
|
-
}), g = d("
|
|
15
|
+
}), g = d("unsubscribe", {
|
|
16
16
|
state: () => p(),
|
|
17
17
|
getters: {
|
|
18
18
|
getSelectedCollection: (e) => i[e.selectedCollectionType],
|
|
@@ -5,13 +5,13 @@ const e = () => ({
|
|
|
5
5
|
description: "",
|
|
6
6
|
authorId: "",
|
|
7
7
|
authorName: ""
|
|
8
|
-
}),
|
|
8
|
+
}), r = () => ({
|
|
9
9
|
previousPatch: e(),
|
|
10
10
|
currentPatch: e(),
|
|
11
11
|
nextPatch: e(),
|
|
12
12
|
editorVisualMode: "desktop"
|
|
13
|
-
}),
|
|
14
|
-
state: () =>
|
|
13
|
+
}), o = a("versionHistory", {
|
|
14
|
+
state: () => r(),
|
|
15
15
|
getters: {
|
|
16
16
|
hasPreviousPatch: (t) => !!t.previousPatch.id,
|
|
17
17
|
hasCurrentPatch: (t) => !!t.currentPatch.id,
|
|
@@ -24,5 +24,5 @@ const e = () => ({
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
export {
|
|
27
|
-
|
|
27
|
+
o as useVersionHistoryStore
|
|
28
28
|
};
|
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.c8da346",
|
|
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",
|