@useinsider/guido 2.0.0-beta.81f9c55 → 2.0.0-beta.86a694f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/config/schemas.js +45 -33
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +57 -59
- package/dist/components/organisms/base/Toaster.vue.js +6 -6
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +6 -6
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +2 -2
- package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
- package/dist/composables/useConfig.js +29 -27
- package/dist/composables/useSave.js +13 -11
- package/dist/composables/useStripo.js +50 -51
- package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/index.d.ts +2 -2
- package/dist/src/@types/config/schemas.d.ts +26 -4
- package/dist/src/@types/config/types.d.ts +7 -1
- package/dist/src/composables/useConfig.d.ts +6 -2
- package/dist/src/stores/config.d.ts +145 -18
- package/dist/static/styles/components/button.css.js +1 -1
- package/dist/static/styles/components/narrow-panel.css.js +10 -0
- package/dist/stores/config.js +7 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { object as o, number as
|
|
2
|
-
const
|
|
1
|
+
import { object as o, number as b, optional as e, string as t, pipe as u, picklist as n, custom as d, boolean as c, array as a, minLength as p, literal as r, variant as S } from "../../node_modules/valibot/dist/index.js";
|
|
2
|
+
const m = {
|
|
3
3
|
/** Promotional/marketing emails */
|
|
4
4
|
PROMOTIONAL: 1,
|
|
5
5
|
/** Transactional/system emails */
|
|
@@ -13,22 +13,22 @@ const i = {
|
|
|
13
13
|
UNSUBSCRIBE_PAGES: 97
|
|
14
14
|
}, h = o({
|
|
15
15
|
/** Unique identifier for the template being edited */
|
|
16
|
-
templateId:
|
|
16
|
+
templateId: u(
|
|
17
17
|
t(),
|
|
18
|
-
|
|
18
|
+
p(1, "templateId is required")
|
|
19
19
|
),
|
|
20
20
|
/** Unique identifier for the user editing the template */
|
|
21
|
-
userId:
|
|
21
|
+
userId: u(
|
|
22
22
|
t(),
|
|
23
|
-
|
|
23
|
+
p(1, "userId is required")
|
|
24
24
|
),
|
|
25
25
|
/** Optional variation ID for A/B testing */
|
|
26
26
|
variationId: e(t())
|
|
27
27
|
}), k = o({
|
|
28
28
|
/** Partner/organization name (required) */
|
|
29
|
-
name:
|
|
29
|
+
name: u(
|
|
30
30
|
t(),
|
|
31
|
-
|
|
31
|
+
p(1, "partner.name is required")
|
|
32
32
|
),
|
|
33
33
|
/** Product type identifier */
|
|
34
34
|
productType: e(
|
|
@@ -41,8 +41,8 @@ const i = {
|
|
|
41
41
|
),
|
|
42
42
|
/** Message type (promotional or transactional) */
|
|
43
43
|
messageType: e(
|
|
44
|
-
n([
|
|
45
|
-
|
|
44
|
+
n([m.PROMOTIONAL, m.TRANSACTIONAL]),
|
|
45
|
+
m.PROMOTIONAL
|
|
46
46
|
),
|
|
47
47
|
/** Display name for the current user */
|
|
48
48
|
username: e(t(), "Guido User")
|
|
@@ -60,7 +60,7 @@ const i = {
|
|
|
60
60
|
value: t()
|
|
61
61
|
})
|
|
62
62
|
)
|
|
63
|
-
}),
|
|
63
|
+
}), C = o({
|
|
64
64
|
/** Initial HTML content */
|
|
65
65
|
html: e(t(), ""),
|
|
66
66
|
/** Initial CSS content */
|
|
@@ -71,8 +71,8 @@ const i = {
|
|
|
71
71
|
[]
|
|
72
72
|
),
|
|
73
73
|
/** Selected unsubscribe page IDs */
|
|
74
|
-
selectedUnsubscribePages: e(a(
|
|
75
|
-
}),
|
|
74
|
+
selectedUnsubscribePages: e(a(b()), [])
|
|
75
|
+
}), R = o({
|
|
76
76
|
/** Sender display name */
|
|
77
77
|
senderName: e(t(), ""),
|
|
78
78
|
/** Email subject line */
|
|
@@ -83,9 +83,9 @@ const i = {
|
|
|
83
83
|
/** Path to translations object */
|
|
84
84
|
translationsPath: e(t(), "window.trans.en"),
|
|
85
85
|
/** Migration date for template compatibility */
|
|
86
|
-
migrationDate: e(
|
|
86
|
+
migrationDate: e(b(), 1759696858),
|
|
87
87
|
/** Email header settings */
|
|
88
|
-
emailHeader: e(
|
|
88
|
+
emailHeader: e(R, { senderName: "", subject: "" })
|
|
89
89
|
}), T = o({
|
|
90
90
|
/** Whether to show the header bar */
|
|
91
91
|
showHeader: e(c(), !0),
|
|
@@ -103,9 +103,7 @@ const i = {
|
|
|
103
103
|
/** Enable display conditions */
|
|
104
104
|
displayConditions: e(c(), !0),
|
|
105
105
|
/** Enable unsubscribe block */
|
|
106
|
-
unsubscribe: e(c(), !0)
|
|
107
|
-
/** Disable modules panel in the editor */
|
|
108
|
-
modulesDisabled: e(c(), !1)
|
|
106
|
+
unsubscribe: e(c(), !0)
|
|
109
107
|
}), f = n([
|
|
110
108
|
"amp-accordion",
|
|
111
109
|
"amp-carousel",
|
|
@@ -145,7 +143,7 @@ const i = {
|
|
|
145
143
|
/** Human-readable description */
|
|
146
144
|
description: e(t()),
|
|
147
145
|
/** Priority for rule ordering (lower = earlier) */
|
|
148
|
-
priority:
|
|
146
|
+
priority: b()
|
|
149
147
|
}), N = o({
|
|
150
148
|
...l.entries,
|
|
151
149
|
type: r("replace"),
|
|
@@ -173,21 +171,32 @@ const i = {
|
|
|
173
171
|
...l.entries,
|
|
174
172
|
type: r("custom"),
|
|
175
173
|
/** Custom processor function */
|
|
176
|
-
processor:
|
|
177
|
-
(
|
|
174
|
+
processor: d(
|
|
175
|
+
(i) => typeof i == "function",
|
|
178
176
|
"processor must be a function"
|
|
179
177
|
)
|
|
180
|
-
}),
|
|
178
|
+
}), x = S("type", [
|
|
181
179
|
N,
|
|
182
180
|
O,
|
|
183
181
|
L,
|
|
184
182
|
v
|
|
185
|
-
]),
|
|
183
|
+
]), B = o({
|
|
186
184
|
/** Custom compiler rules to apply */
|
|
187
|
-
customRules: e(a(
|
|
185
|
+
customRules: e(a(x), []),
|
|
188
186
|
/** Skip default compiler rules */
|
|
189
187
|
ignoreDefaultRules: e(c(), !1)
|
|
190
|
-
}),
|
|
188
|
+
}), P = o({
|
|
189
|
+
/**
|
|
190
|
+
* External validation handler called before save completes.
|
|
191
|
+
* Return false to cancel the save operation.
|
|
192
|
+
*/
|
|
193
|
+
externalValidation: e(
|
|
194
|
+
d(
|
|
195
|
+
(i) => typeof i == "function",
|
|
196
|
+
"externalValidation must be a function"
|
|
197
|
+
)
|
|
198
|
+
)
|
|
199
|
+
}), U = o({
|
|
191
200
|
// Required sections
|
|
192
201
|
/** Identity configuration (required) */
|
|
193
202
|
identity: h,
|
|
@@ -195,7 +204,7 @@ const i = {
|
|
|
195
204
|
partner: k,
|
|
196
205
|
// Optional sections (with defaults)
|
|
197
206
|
/** Template content and presets */
|
|
198
|
-
template: e(
|
|
207
|
+
template: e(C, {}),
|
|
199
208
|
/** Editor settings */
|
|
200
209
|
editor: e(I, {}),
|
|
201
210
|
/** UI configuration */
|
|
@@ -205,27 +214,30 @@ const i = {
|
|
|
205
214
|
/** Block configuration */
|
|
206
215
|
blocks: e(E, {}),
|
|
207
216
|
/** Compiler configuration */
|
|
208
|
-
compiler: e(
|
|
217
|
+
compiler: e(B, {}),
|
|
218
|
+
/** Callbacks and event handlers */
|
|
219
|
+
callbacks: e(P, {})
|
|
209
220
|
});
|
|
210
221
|
export {
|
|
211
222
|
E as BlocksSchema,
|
|
212
|
-
|
|
213
|
-
|
|
223
|
+
P as CallbacksSchema,
|
|
224
|
+
x as CompilerRuleSchema,
|
|
225
|
+
B as CompilerSchema,
|
|
214
226
|
g as CustomBlockTypeSchema,
|
|
215
227
|
v as CustomRuleSchema,
|
|
216
228
|
f as DefaultBlockTypeSchema,
|
|
217
229
|
y as DynamicContentSchema,
|
|
218
230
|
I as EditorSchema,
|
|
219
|
-
|
|
231
|
+
R as EmailHeaderSchema,
|
|
220
232
|
A as FeaturesSchema,
|
|
221
|
-
|
|
233
|
+
U as GuidoConfigSchema,
|
|
222
234
|
h as IdentitySchema,
|
|
223
|
-
|
|
235
|
+
m as MessageType,
|
|
224
236
|
k as PartnerSchema,
|
|
225
237
|
s as ProductType,
|
|
226
238
|
O as RegexRuleSchema,
|
|
227
239
|
L as RemoveRuleSchema,
|
|
228
240
|
N as ReplaceRuleSchema,
|
|
229
|
-
|
|
241
|
+
C as TemplateSchema,
|
|
230
242
|
T as UISchema
|
|
231
243
|
};
|
|
@@ -1,55 +1,54 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import { useTimerClone as
|
|
6
|
-
import { migrate 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 {
|
|
19
|
-
|
|
20
|
-
const Pe = /* @__PURE__ */ q({
|
|
1
|
+
import { defineComponent as x, defineAsyncComponent as P, ref as B, computed as U, watch as N, onMounted as z, onUnmounted as K } from "vue";
|
|
2
|
+
import { provideGuidoActions as M } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as j } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as q } from "../composables/useStripo.js";
|
|
5
|
+
import { useTimerClone as J } from "../composables/useTimerClone.js";
|
|
6
|
+
import { migrate as W } from "../config/migrator/index.js";
|
|
7
|
+
import Q from "./organisms/base/Toaster.vue.js";
|
|
8
|
+
import V from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
9
|
+
import X from "./organisms/header/HeaderWrapper.vue.js";
|
|
10
|
+
import Y from "./organisms/LoadingWrapper.vue.js";
|
|
11
|
+
import Z from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
12
|
+
import $ from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
13
|
+
import { useStripoApi as ee } from "../services/stripoApi.js";
|
|
14
|
+
import { useConfigStore as oe } from "../stores/config.js";
|
|
15
|
+
import { useDynamicContentStore as te } from "../stores/dynamic-content.js";
|
|
16
|
+
import { useEditorStore as ne } from "../stores/editor.js";
|
|
17
|
+
import { usePreviewStore as re } from "../stores/preview.js";
|
|
18
|
+
import { useUnsubscribeStore as ce } from "../stores/unsubscribe.js";
|
|
19
|
+
const Ee = /* @__PURE__ */ x({
|
|
21
20
|
__name: "Guido",
|
|
22
21
|
props: {
|
|
23
22
|
config: null
|
|
24
23
|
},
|
|
25
24
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
26
|
-
setup(
|
|
27
|
-
const
|
|
25
|
+
setup(_, { expose: I, emit: t }) {
|
|
26
|
+
const l = _, L = P(
|
|
28
27
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
29
|
-
),
|
|
28
|
+
), A = P(
|
|
30
29
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
31
|
-
), p =
|
|
32
|
-
n.init(
|
|
33
|
-
const
|
|
30
|
+
), p = B(), s = te(), u = ce(), n = oe();
|
|
31
|
+
n.init(l.config);
|
|
32
|
+
const i = ne(), F = re(), r = U(() => i.hasChanges), { isTestPartner: G } = j(), v = () => {
|
|
34
33
|
var e;
|
|
35
34
|
return (e = p.value) == null ? void 0 : e.handleSave(!0);
|
|
36
|
-
}, { templateId:
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
emailId:
|
|
40
|
-
userId:
|
|
41
|
-
username:
|
|
42
|
-
partnerName:
|
|
43
|
-
productType:
|
|
44
|
-
preselectedDynamicContentList:
|
|
35
|
+
}, { templateId: a, userId: y, partnerName: h, productType: f, username: b, template: o } = n, c = (o == null ? void 0 : o.html) || "", g = (o == null ? void 0 : o.css) || "", m = (o == null ? void 0 : o.preselectedDynamicContent) || [];
|
|
36
|
+
i.templateId = a;
|
|
37
|
+
const { initPlugin: S } = q({
|
|
38
|
+
emailId: a,
|
|
39
|
+
userId: y,
|
|
40
|
+
username: b,
|
|
41
|
+
partnerName: h,
|
|
42
|
+
productType: f,
|
|
43
|
+
preselectedDynamicContentList: m,
|
|
45
44
|
onReady: () => {
|
|
46
45
|
console.debug("guido:ready"), t("ready");
|
|
47
46
|
}
|
|
48
|
-
}), { getDefaultTemplate:
|
|
47
|
+
}), { getDefaultTemplate: w } = ee(), { cloneTimersOnSave: C, hasTimerBlocks: D } = J(), H = U(() => {
|
|
49
48
|
var e;
|
|
50
49
|
return !((e = n.ui) != null && e.showHeader);
|
|
51
50
|
});
|
|
52
|
-
|
|
51
|
+
M({
|
|
53
52
|
onBack: () => {
|
|
54
53
|
console.debug("guido:back"), t("back");
|
|
55
54
|
},
|
|
@@ -63,52 +62,51 @@ const Pe = /* @__PURE__ */ q({
|
|
|
63
62
|
console.debug("guido:test-email:click"), t("test-email:click");
|
|
64
63
|
}
|
|
65
64
|
});
|
|
66
|
-
const
|
|
67
|
-
console.debug("dynamic-content:close", e),
|
|
68
|
-
},
|
|
65
|
+
const E = (e) => {
|
|
66
|
+
console.debug("dynamic-content:close", e), s.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
67
|
+
}, k = () => {
|
|
69
68
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
70
69
|
};
|
|
71
|
-
|
|
70
|
+
N(() => r.value, () => {
|
|
72
71
|
t("on-change", r.value);
|
|
73
72
|
});
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
console.debug("dynamic-content:open",
|
|
73
|
+
const d = (e) => {
|
|
74
|
+
const T = e, { attribute: O, position: R } = T.detail;
|
|
75
|
+
console.debug("dynamic-content:open", T.detail), t("dynamic-content:open", O, R);
|
|
77
76
|
};
|
|
78
|
-
return
|
|
77
|
+
return z(async () => {
|
|
79
78
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
80
79
|
try {
|
|
81
|
-
|
|
80
|
+
u.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
82
81
|
let e = {
|
|
83
|
-
html:
|
|
84
|
-
css:
|
|
82
|
+
html: c && await W(c),
|
|
83
|
+
css: g,
|
|
85
84
|
forceRecreate: !0
|
|
86
85
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
87
86
|
};
|
|
88
|
-
e.html || (e = await
|
|
87
|
+
e.html || (e = await w(), e.html = await W(e.html)), D(e.html) && (e.html = await C(e.html)), await S(e), s.selectedDynamicContentList = m;
|
|
89
88
|
} catch (e) {
|
|
90
89
|
console.error("Failed to initialize Stripo editor:", e);
|
|
91
90
|
}
|
|
92
|
-
document.addEventListener("dynamic-content:open",
|
|
93
|
-
}),
|
|
94
|
-
|
|
95
|
-
c.value && (f.hideToaster(), (e = document.querySelector("#guido__toaster")) == null || e.remove()), c.value = !1, document.removeEventListener("dynamic-content:open", l);
|
|
91
|
+
document.addEventListener("dynamic-content:open", d);
|
|
92
|
+
}), K(() => {
|
|
93
|
+
document.removeEventListener("dynamic-content:open", d);
|
|
96
94
|
try {
|
|
97
95
|
window.UIEditor.removeEditor();
|
|
98
96
|
} catch {
|
|
99
97
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
100
98
|
}
|
|
101
99
|
n.reset();
|
|
102
|
-
}),
|
|
100
|
+
}), I({
|
|
103
101
|
dynamicContent: {
|
|
104
|
-
insert:
|
|
105
|
-
close:
|
|
102
|
+
insert: E,
|
|
103
|
+
close: k
|
|
106
104
|
},
|
|
107
105
|
hasChanges: r,
|
|
108
|
-
saveSilent:
|
|
109
|
-
}), { __sfc: !0, PreviewContainer:
|
|
106
|
+
saveSilent: v
|
|
107
|
+
}), { __sfc: !0, PreviewContainer: L, OnboardingWrapper: A, headerWrapperRef: p, dynamicContentStore: s, unsubscribeStore: u, props: l, configStore: n, editorStore: i, previewStore: F, hasChanges: r, isTestPartner: G, saveSilent: v, templateId: a, userId: y, partnerName: h, productType: f, username: b, templateConfig: o, html: c, css: g, preselectedDynamicContentList: m, emit: t, initPlugin: S, getDefaultTemplate: w, cloneTimersOnSave: C, hasTimerBlocks: D, noHeader: H, insertDynamicContent: E, closeDynamicContent: k, handleDynamicContentOpen: d, Toaster: Q, FilterSelectionDrawer: V, HeaderWrapper: X, LoadingWrapper: Y, SaveAsTemplateDrawer: Z, UnsubscribeWrapper: $ };
|
|
110
108
|
}
|
|
111
109
|
});
|
|
112
110
|
export {
|
|
113
|
-
|
|
111
|
+
Ee as default
|
|
114
112
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from "./Toaster.vue2.js";
|
|
2
2
|
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var r = function() {
|
|
4
|
-
var o = this,
|
|
5
|
-
return
|
|
4
|
+
var o = this, n = o._self._c, t = o._self._setupProxy;
|
|
5
|
+
return n(t.InToasts, { attrs: { "action-buttons-config": t.actionButtonsConfig, status: t.store.status, text: t.store.text, type: t.store.type }, on: { actionButtonClick0: t.handleActionClick } });
|
|
6
6
|
}, a = [], _ = /* @__PURE__ */ s(
|
|
7
|
-
|
|
7
|
+
e,
|
|
8
8
|
r,
|
|
9
9
|
a,
|
|
10
10
|
!1,
|
|
11
11
|
null,
|
|
12
12
|
null
|
|
13
13
|
);
|
|
14
|
-
const
|
|
14
|
+
const l = _.exports;
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
l as default
|
|
17
17
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import i from "./EmailSizeIndicator.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var o = function() {
|
|
5
5
|
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
6
|
-
return e("div", { staticClass: "d-f a-i-c j-c-c" }, [e(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), e(t.
|
|
7
|
-
}, a = [], n = /* @__PURE__ */
|
|
6
|
+
return e("div", { staticClass: "d-f a-i-c j-c-c" }, [e(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), e(t.InTooltip, { staticClass: "d-f ml-1", attrs: { id: "email-size-tooltip", align: "center", position: "bottom", text: t.trans("email-editor.preview-design-size-tooltip") } })], 1);
|
|
7
|
+
}, a = [], n = /* @__PURE__ */ r(
|
|
8
8
|
i,
|
|
9
|
-
|
|
9
|
+
o,
|
|
10
10
|
a,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"c2adc57d"
|
|
14
14
|
);
|
|
15
15
|
const m = n.exports;
|
|
16
16
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as c, ref as n, computed as l, watch as u } from "vue";
|
|
2
2
|
import { useTranslations as p } from "../../../../composables/useTranslations.js";
|
|
3
3
|
import { usePreviewStore as _ } from "../../../../stores/preview.js";
|
|
4
|
-
import {
|
|
4
|
+
import { InTooltip as v, InProgress as f } from "@useinsider/design-system-vue";
|
|
5
5
|
const S = /* @__PURE__ */ c({
|
|
6
6
|
__name: "EmailSizeIndicator",
|
|
7
7
|
setup(w) {
|
|
@@ -17,7 +17,7 @@ const S = /* @__PURE__ */ c({
|
|
|
17
17
|
}, i = p();
|
|
18
18
|
return u(() => t.previewHtml, () => {
|
|
19
19
|
r();
|
|
20
|
-
}, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f,
|
|
20
|
+
}, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltip: v };
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as H, ref as
|
|
1
|
+
import { defineComponent as H, ref as c, computed as _ } from "vue";
|
|
2
2
|
import { useConfig as h } from "../../../composables/useConfig.js";
|
|
3
3
|
import { useExport as V } from "../../../composables/useExport.js";
|
|
4
4
|
import { useTestEmailClick as x } from "../../../composables/useGuidoActions.js";
|
|
@@ -10,25 +10,25 @@ import { getTooltipOptions as O } from "../../../utils/tooltipUtils.js";
|
|
|
10
10
|
import { InButtonV2 as A } from "@useinsider/design-system-vue";
|
|
11
11
|
const J = /* @__PURE__ */ H({
|
|
12
12
|
__name: "RightSlot",
|
|
13
|
-
setup(k, { expose:
|
|
14
|
-
const { config:
|
|
13
|
+
setup(k, { expose: u }) {
|
|
14
|
+
const { config: f } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = C(), t = T(), e = c(!1), s = c(!1), v = x(), d = () => {
|
|
15
15
|
if (o.isVersionHistoryOpen) {
|
|
16
16
|
a();
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
i();
|
|
20
|
-
},
|
|
20
|
+
}, y = async () => {
|
|
21
21
|
e.value = !0, await r(), e.value = !1;
|
|
22
|
-
},
|
|
22
|
+
}, S = () => {
|
|
23
23
|
o.isSaveAsTemplateDrawerOpen = !0;
|
|
24
|
-
},
|
|
24
|
+
}, g = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), l = async (p) => {
|
|
25
25
|
s.value = !0, o.loadingStatus = !0;
|
|
26
|
-
const
|
|
27
|
-
return s.value = !1, p && (o.loadingStatus = !1),
|
|
26
|
+
const m = await n(p);
|
|
27
|
+
return s.value = !1, (p || !m) && (o.loadingStatus = !1), m;
|
|
28
28
|
};
|
|
29
|
-
return
|
|
29
|
+
return u({
|
|
30
30
|
handleSave: l
|
|
31
|
-
}), { __sfc: !0, config:
|
|
31
|
+
}), { __sfc: !0, config: f, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, testEmailClick: v, handleVersionHistory: d, handleExport: y, handleSaveAs: S, versionHistoryTooltipText: g, handleSave: l, getTooltipOptions: O, InButtonV2: A };
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
export {
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { useConfigStore as
|
|
2
|
-
import { storeToRefs as
|
|
3
|
-
const
|
|
4
|
-
const e =
|
|
1
|
+
import { useConfigStore as I } from "../stores/config.js";
|
|
2
|
+
import { storeToRefs as T } from "pinia";
|
|
3
|
+
const w = () => {
|
|
4
|
+
const e = I(), {
|
|
5
5
|
config: t,
|
|
6
6
|
initialized: o,
|
|
7
7
|
identity: r,
|
|
8
8
|
partner: i,
|
|
9
|
-
template:
|
|
10
|
-
editor:
|
|
9
|
+
template: a,
|
|
10
|
+
editor: n,
|
|
11
11
|
ui: s,
|
|
12
|
-
features:
|
|
13
|
-
blocks:
|
|
14
|
-
compiler:
|
|
15
|
-
|
|
12
|
+
features: c,
|
|
13
|
+
blocks: u,
|
|
14
|
+
compiler: d,
|
|
15
|
+
callbacks: l,
|
|
16
|
+
templateId: p,
|
|
16
17
|
userId: f,
|
|
17
18
|
variationId: m,
|
|
18
19
|
partnerName: g,
|
|
19
|
-
productType:
|
|
20
|
-
messageType:
|
|
21
|
-
username:
|
|
22
|
-
showHeader:
|
|
23
|
-
} =
|
|
20
|
+
productType: b,
|
|
21
|
+
messageType: C,
|
|
22
|
+
username: y,
|
|
23
|
+
showHeader: E
|
|
24
|
+
} = T(e);
|
|
24
25
|
return {
|
|
25
26
|
// State refs
|
|
26
27
|
config: t,
|
|
@@ -28,26 +29,27 @@ const k = () => {
|
|
|
28
29
|
// Section refs
|
|
29
30
|
identity: r,
|
|
30
31
|
partner: i,
|
|
31
|
-
template:
|
|
32
|
-
editor:
|
|
32
|
+
template: a,
|
|
33
|
+
editor: n,
|
|
33
34
|
ui: s,
|
|
34
|
-
features:
|
|
35
|
-
blocks:
|
|
36
|
-
compiler:
|
|
35
|
+
features: c,
|
|
36
|
+
blocks: u,
|
|
37
|
+
compiler: d,
|
|
38
|
+
callbacks: l,
|
|
37
39
|
// Convenience refs
|
|
38
|
-
templateId:
|
|
40
|
+
templateId: p,
|
|
39
41
|
userId: f,
|
|
40
42
|
variationId: m,
|
|
41
43
|
partnerName: g,
|
|
42
|
-
productType:
|
|
43
|
-
messageType:
|
|
44
|
-
username:
|
|
45
|
-
showHeader:
|
|
44
|
+
productType: b,
|
|
45
|
+
messageType: C,
|
|
46
|
+
username: y,
|
|
47
|
+
showHeader: E,
|
|
46
48
|
// Methods
|
|
47
49
|
getConfig: () => t.value,
|
|
48
|
-
isFeatureEnabled: (
|
|
50
|
+
isFeatureEnabled: (F) => e.isFeatureEnabled(F)
|
|
49
51
|
};
|
|
50
52
|
};
|
|
51
53
|
export {
|
|
52
|
-
|
|
54
|
+
w as useConfig
|
|
53
55
|
};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { useConfig as l } from "./useConfig.js";
|
|
2
|
+
import { useSaveStart as m, useSaveComplete as c } from "./useGuidoActions.js";
|
|
3
|
+
import { useTemplatePreparation as d } from "../utils/templatePreparation.js";
|
|
4
|
+
import { useHtmlValidator as p } from "./useHtmlValidator.js";
|
|
5
|
+
const w = () => {
|
|
6
|
+
const i = m(), s = c(), { validateHtml: o } = p(), { callbacks: a } = l();
|
|
7
|
+
return { save: async (r = !1) => {
|
|
8
|
+
var e;
|
|
9
|
+
i();
|
|
10
|
+
const { prepareTemplateDetails: n } = d(), t = await n();
|
|
11
|
+
if (await o(t.compiledHtml, t.dynamicContentList, !0) && !((e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t)))
|
|
12
|
+
return r || s(t), t;
|
|
11
13
|
} };
|
|
12
14
|
};
|
|
13
15
|
export {
|
|
14
|
-
|
|
16
|
+
w as useSave
|
|
15
17
|
};
|