@useinsider/guido 1.4.4-beta.eb9b460 → 2.0.0-beta.143201d
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 +295 -664
- package/dist/@types/config/defaults.js +44 -0
- package/dist/@types/config/schemas.js +231 -0
- package/dist/@types/config/validator.js +56 -0
- package/dist/components/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +68 -92
- package/dist/components/organisms/base/Toaster.vue.js +6 -6
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +13 -13
- 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/email-preview/mobile-preview/InboxView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +13 -13
- package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
- package/dist/components/organisms/header/LeftSlot.vue2.js +18 -15
- package/dist/components/organisms/header/RightSlot.vue.js +10 -10
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +22 -19
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +4 -4
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +8 -8
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +17 -17
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -10
- package/dist/composables/useActionsApi.js +42 -25
- package/dist/composables/useBlocksConfig.js +23 -20
- package/dist/composables/useConfig.js +51 -5
- package/dist/composables/useHtmlCompiler.js +20 -19
- package/dist/composables/useHtmlValidator.js +41 -41
- package/dist/composables/usePartner.js +19 -9
- package/dist/composables/useStripo.js +51 -50
- package/dist/composables/useTimerClone.js +53 -0
- package/dist/composables/useTranslations.js +3 -2
- package/dist/config/compiler/unsubscribeCompilerRules.js +1 -1
- package/dist/enums/defaults.js +4 -67
- package/dist/enums/unsubscribe.js +23 -20
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +12 -11
- package/dist/guido.css +1 -1
- package/dist/library.js +12 -2
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +10 -10
- package/dist/node_modules/valibot/dist/index.js +476 -103
- package/dist/services/stripoApi.js +13 -14
- package/dist/services/templateLibraryApi.js +18 -18
- package/dist/src/@types/config/defaults.d.ts +68 -0
- package/dist/src/@types/config/index.d.ts +14 -0
- package/dist/src/@types/config/schemas.d.ts +509 -0
- package/dist/src/@types/config/types.d.ts +142 -0
- package/dist/src/@types/config/validator.d.ts +119 -0
- package/dist/src/@types/generic.d.ts +4 -45
- package/dist/src/components/Guido.vue.d.ts +13 -12
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useActionsApi.d.ts +2 -0
- package/dist/src/composables/useConfig.d.ts +186 -2
- package/dist/src/composables/usePartner.d.ts +8 -0
- package/dist/src/composables/useTimerClone.d.ts +6 -0
- package/dist/src/enums/defaults.d.ts +5 -6
- package/dist/src/enums/unsubscribe.d.ts +5 -1
- package/dist/src/library.d.ts +3 -1
- package/dist/src/stores/config.d.ts +1564 -102
- package/dist/static/styles/components/narrow-panel.css.js +0 -10
- package/dist/stores/config.js +141 -9
- package/package.json +1 -1
- package/dist/node_modules/lodash-es/_apply.js +0 -16
- package/dist/node_modules/lodash-es/_assignMergeValue.js +0 -8
- package/dist/node_modules/lodash-es/_assignValue.js +0 -10
- package/dist/node_modules/lodash-es/_baseAssignValue.js +0 -12
- package/dist/node_modules/lodash-es/_baseCreate.js +0 -17
- package/dist/node_modules/lodash-es/_baseKeysIn.js +0 -15
- package/dist/node_modules/lodash-es/_baseMerge.js +0 -20
- package/dist/node_modules/lodash-es/_baseMergeDeep.js +0 -31
- package/dist/node_modules/lodash-es/_baseRest.js +0 -9
- package/dist/node_modules/lodash-es/_baseSetToString.js +0 -14
- package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
- package/dist/node_modules/lodash-es/_cloneBuffer.js +0 -9
- package/dist/node_modules/lodash-es/_cloneTypedArray.js +0 -8
- package/dist/node_modules/lodash-es/_copyArray.js +0 -9
- package/dist/node_modules/lodash-es/_copyObject.js +0 -14
- package/dist/node_modules/lodash-es/_createAssigner.js +0 -15
- package/dist/node_modules/lodash-es/_defineProperty.js +0 -11
- package/dist/node_modules/lodash-es/_getPrototype.js +0 -5
- package/dist/node_modules/lodash-es/_initCloneObject.js +0 -9
- package/dist/node_modules/lodash-es/_nativeKeysIn.js +0 -10
- package/dist/node_modules/lodash-es/_overRest.js +0 -15
- package/dist/node_modules/lodash-es/_safeGet.js +0 -7
- package/dist/node_modules/lodash-es/_setToString.js +0 -6
- package/dist/node_modules/lodash-es/_shortOut.js +0 -16
- package/dist/node_modules/lodash-es/constant.js +0 -8
- package/dist/node_modules/lodash-es/isArrayLikeObject.js +0 -8
- package/dist/node_modules/lodash-es/isPlainObject.js +0 -16
- package/dist/node_modules/lodash-es/keysIn.js +0 -9
- package/dist/node_modules/lodash-es/merge.js +0 -8
- package/dist/node_modules/lodash-es/toPlainObject.js +0 -8
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ProductType as a, MessageType as o } from "./schemas.js";
|
|
2
|
+
a.EMAIL;
|
|
3
|
+
o.PROMOTIONAL;
|
|
4
|
+
const e = [
|
|
5
|
+
"alfredtesting",
|
|
6
|
+
"electio",
|
|
7
|
+
"eurekatest",
|
|
8
|
+
"gachapontestpart",
|
|
9
|
+
"gluautomation1",
|
|
10
|
+
"gluautomation2",
|
|
11
|
+
"gluautomation3",
|
|
12
|
+
"gluautomation4",
|
|
13
|
+
"inone",
|
|
14
|
+
"inshoppingcart",
|
|
15
|
+
"krakentest",
|
|
16
|
+
"leeroy",
|
|
17
|
+
"newsletteruat",
|
|
18
|
+
"ozaspava",
|
|
19
|
+
"piratesquad",
|
|
20
|
+
"qaautomation1",
|
|
21
|
+
"qaautomation2",
|
|
22
|
+
"qaautomation3",
|
|
23
|
+
"qaautomation4",
|
|
24
|
+
"roiautomation",
|
|
25
|
+
"seleniumautomation",
|
|
26
|
+
"seleniumautomation1",
|
|
27
|
+
"seleniumautomation2",
|
|
28
|
+
"seleniumautomation3",
|
|
29
|
+
"shopbagg",
|
|
30
|
+
"shopifytest",
|
|
31
|
+
"singlepageqa",
|
|
32
|
+
"testqa",
|
|
33
|
+
"vikingsankara",
|
|
34
|
+
"stripoeditorlivetest"
|
|
35
|
+
];
|
|
36
|
+
function n(t) {
|
|
37
|
+
return e.includes(t);
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
o as MessageType,
|
|
41
|
+
a as ProductType,
|
|
42
|
+
e as TEST_PARTNERS,
|
|
43
|
+
n as isTestPartner
|
|
44
|
+
};
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { object as o, number as p, optional as e, string as t, pipe as m, picklist as n, boolean as c, array as a, minLength as u, literal as r, custom as b, variant as S } from "../../node_modules/valibot/dist/index.js";
|
|
2
|
+
const i = {
|
|
3
|
+
/** Promotional/marketing emails */
|
|
4
|
+
PROMOTIONAL: 1,
|
|
5
|
+
/** Transactional/system emails */
|
|
6
|
+
TRANSACTIONAL: 2
|
|
7
|
+
}, s = {
|
|
8
|
+
/** Standard email campaigns */
|
|
9
|
+
EMAIL: 60,
|
|
10
|
+
/** Architect journey builder */
|
|
11
|
+
ARCHITECT: 49,
|
|
12
|
+
/** Unsubscribe page builder */
|
|
13
|
+
UNSUBSCRIBE_PAGES: 97
|
|
14
|
+
}, h = o({
|
|
15
|
+
/** Unique identifier for the template being edited */
|
|
16
|
+
templateId: m(
|
|
17
|
+
t(),
|
|
18
|
+
u(1, "templateId is required")
|
|
19
|
+
),
|
|
20
|
+
/** Unique identifier for the user editing the template */
|
|
21
|
+
userId: m(
|
|
22
|
+
t(),
|
|
23
|
+
u(1, "userId is required")
|
|
24
|
+
),
|
|
25
|
+
/** Optional variation ID for A/B testing */
|
|
26
|
+
variationId: e(t())
|
|
27
|
+
}), k = o({
|
|
28
|
+
/** Partner/organization name (required) */
|
|
29
|
+
name: m(
|
|
30
|
+
t(),
|
|
31
|
+
u(1, "partner.name is required")
|
|
32
|
+
),
|
|
33
|
+
/** Product type identifier */
|
|
34
|
+
productType: e(
|
|
35
|
+
n([
|
|
36
|
+
s.EMAIL,
|
|
37
|
+
s.ARCHITECT,
|
|
38
|
+
s.UNSUBSCRIBE_PAGES
|
|
39
|
+
]),
|
|
40
|
+
s.EMAIL
|
|
41
|
+
),
|
|
42
|
+
/** Message type (promotional or transactional) */
|
|
43
|
+
messageType: e(
|
|
44
|
+
n([i.PROMOTIONAL, i.TRANSACTIONAL]),
|
|
45
|
+
i.PROMOTIONAL
|
|
46
|
+
),
|
|
47
|
+
/** Display name for the current user */
|
|
48
|
+
username: e(t(), "Guido User")
|
|
49
|
+
}), y = o({
|
|
50
|
+
/** Display text for the dynamic content */
|
|
51
|
+
text: t(),
|
|
52
|
+
/** Template variable value (e.g., {{username}}) */
|
|
53
|
+
value: t(),
|
|
54
|
+
/** Fallback value if variable is empty */
|
|
55
|
+
fallback: e(t()),
|
|
56
|
+
/** Optional formatting options */
|
|
57
|
+
format: e(
|
|
58
|
+
o({
|
|
59
|
+
key: t(),
|
|
60
|
+
value: t()
|
|
61
|
+
})
|
|
62
|
+
)
|
|
63
|
+
}), R = o({
|
|
64
|
+
/** Initial HTML content */
|
|
65
|
+
html: e(t(), ""),
|
|
66
|
+
/** Initial CSS content */
|
|
67
|
+
css: e(t(), ""),
|
|
68
|
+
/** Preselected dynamic content items */
|
|
69
|
+
preselectedDynamicContent: e(
|
|
70
|
+
a(y),
|
|
71
|
+
[]
|
|
72
|
+
),
|
|
73
|
+
/** Selected unsubscribe page IDs */
|
|
74
|
+
selectedUnsubscribePages: e(a(p()), [])
|
|
75
|
+
}), C = o({
|
|
76
|
+
/** Sender display name */
|
|
77
|
+
senderName: e(t(), ""),
|
|
78
|
+
/** Email subject line */
|
|
79
|
+
subject: e(t(), "")
|
|
80
|
+
}), I = o({
|
|
81
|
+
/** Locale for the editor UI */
|
|
82
|
+
locale: e(t(), "en"),
|
|
83
|
+
/** Path to translations object */
|
|
84
|
+
translationsPath: e(t(), "window.trans.en"),
|
|
85
|
+
/** Migration date for template compatibility */
|
|
86
|
+
migrationDate: e(p(), 1759696858),
|
|
87
|
+
/** Email header settings */
|
|
88
|
+
emailHeader: e(C, { senderName: "", subject: "" })
|
|
89
|
+
}), T = o({
|
|
90
|
+
/** Whether to show the header bar */
|
|
91
|
+
showHeader: e(c(), !0),
|
|
92
|
+
/** Custom label for back button (if shown) */
|
|
93
|
+
backButtonLabel: e(t())
|
|
94
|
+
}), A = o({
|
|
95
|
+
/** Enable dynamic content insertion */
|
|
96
|
+
dynamicContent: e(c(), !0),
|
|
97
|
+
/** Enable save as template functionality */
|
|
98
|
+
saveAsTemplate: e(c(), !0),
|
|
99
|
+
/** Enable version history */
|
|
100
|
+
versionHistory: e(c(), !0),
|
|
101
|
+
/** Enable test message sending */
|
|
102
|
+
testMessage: e(c(), !0),
|
|
103
|
+
/** Enable display conditions */
|
|
104
|
+
displayConditions: e(c(), !0),
|
|
105
|
+
/** Enable unsubscribe block */
|
|
106
|
+
unsubscribe: e(c(), !0),
|
|
107
|
+
/** Disable modules panel in the editor */
|
|
108
|
+
modulesDisabled: e(c(), !1)
|
|
109
|
+
}), f = n([
|
|
110
|
+
"amp-accordion",
|
|
111
|
+
"amp-carousel",
|
|
112
|
+
"amp-form-controls",
|
|
113
|
+
"banner-block",
|
|
114
|
+
"button-block",
|
|
115
|
+
"html-block",
|
|
116
|
+
"image-block",
|
|
117
|
+
"menu-block",
|
|
118
|
+
"social-block",
|
|
119
|
+
"spacer-block",
|
|
120
|
+
"text-block",
|
|
121
|
+
"timer-block",
|
|
122
|
+
"video-block"
|
|
123
|
+
]), g = n([
|
|
124
|
+
"dynamic-content",
|
|
125
|
+
"checkbox-block",
|
|
126
|
+
"radio-button-block",
|
|
127
|
+
"recommendation-block",
|
|
128
|
+
"unsubscribe-block",
|
|
129
|
+
"coupon-block",
|
|
130
|
+
"items-block"
|
|
131
|
+
]), E = o({
|
|
132
|
+
/** Default blocks to exclude from the editor */
|
|
133
|
+
excludeDefaults: e(
|
|
134
|
+
a(f),
|
|
135
|
+
[]
|
|
136
|
+
),
|
|
137
|
+
/** Custom blocks to include in the editor */
|
|
138
|
+
includeCustoms: e(
|
|
139
|
+
a(g),
|
|
140
|
+
[]
|
|
141
|
+
)
|
|
142
|
+
}), l = o({
|
|
143
|
+
/** Unique identifier for the rule */
|
|
144
|
+
id: t(),
|
|
145
|
+
/** Human-readable description */
|
|
146
|
+
description: e(t()),
|
|
147
|
+
/** Priority for rule ordering (lower = earlier) */
|
|
148
|
+
priority: p()
|
|
149
|
+
}), N = o({
|
|
150
|
+
...l.entries,
|
|
151
|
+
type: r("replace"),
|
|
152
|
+
/** String to search for */
|
|
153
|
+
search: t(),
|
|
154
|
+
/** Replacement string */
|
|
155
|
+
replacement: t(),
|
|
156
|
+
/** Replace all occurrences (default: false) */
|
|
157
|
+
replaceAll: e(c())
|
|
158
|
+
}), O = o({
|
|
159
|
+
...l.entries,
|
|
160
|
+
type: r("regex"),
|
|
161
|
+
/** Regex pattern string */
|
|
162
|
+
pattern: t(),
|
|
163
|
+
/** Replacement string (supports $1, $2, etc.) */
|
|
164
|
+
replacement: t(),
|
|
165
|
+
/** Regex flags (e.g., 'gi') */
|
|
166
|
+
flags: e(t())
|
|
167
|
+
}), L = o({
|
|
168
|
+
...l.entries,
|
|
169
|
+
type: r("remove"),
|
|
170
|
+
/** Strings or patterns to remove */
|
|
171
|
+
targets: a(t())
|
|
172
|
+
}), v = o({
|
|
173
|
+
...l.entries,
|
|
174
|
+
type: r("custom"),
|
|
175
|
+
/** Custom processor function */
|
|
176
|
+
processor: b(
|
|
177
|
+
(d) => typeof d == "function",
|
|
178
|
+
"processor must be a function"
|
|
179
|
+
)
|
|
180
|
+
}), B = S("type", [
|
|
181
|
+
N,
|
|
182
|
+
O,
|
|
183
|
+
L,
|
|
184
|
+
v
|
|
185
|
+
]), P = o({
|
|
186
|
+
/** Custom compiler rules to apply */
|
|
187
|
+
customRules: e(a(B), []),
|
|
188
|
+
/** Skip default compiler rules */
|
|
189
|
+
ignoreDefaultRules: e(c(), !1)
|
|
190
|
+
}), x = o({
|
|
191
|
+
// Required sections
|
|
192
|
+
/** Identity configuration (required) */
|
|
193
|
+
identity: h,
|
|
194
|
+
/** Partner configuration (required) */
|
|
195
|
+
partner: k,
|
|
196
|
+
// Optional sections (with defaults)
|
|
197
|
+
/** Template content and presets */
|
|
198
|
+
template: e(R, {}),
|
|
199
|
+
/** Editor settings */
|
|
200
|
+
editor: e(I, {}),
|
|
201
|
+
/** UI configuration */
|
|
202
|
+
ui: e(T, {}),
|
|
203
|
+
/** Feature toggles */
|
|
204
|
+
features: e(A, {}),
|
|
205
|
+
/** Block configuration */
|
|
206
|
+
blocks: e(E, {}),
|
|
207
|
+
/** Compiler configuration */
|
|
208
|
+
compiler: e(P, {})
|
|
209
|
+
});
|
|
210
|
+
export {
|
|
211
|
+
E as BlocksSchema,
|
|
212
|
+
B as CompilerRuleSchema,
|
|
213
|
+
P as CompilerSchema,
|
|
214
|
+
g as CustomBlockTypeSchema,
|
|
215
|
+
v as CustomRuleSchema,
|
|
216
|
+
f as DefaultBlockTypeSchema,
|
|
217
|
+
y as DynamicContentSchema,
|
|
218
|
+
I as EditorSchema,
|
|
219
|
+
C as EmailHeaderSchema,
|
|
220
|
+
A as FeaturesSchema,
|
|
221
|
+
x as GuidoConfigSchema,
|
|
222
|
+
h as IdentitySchema,
|
|
223
|
+
i as MessageType,
|
|
224
|
+
k as PartnerSchema,
|
|
225
|
+
s as ProductType,
|
|
226
|
+
O as RegexRuleSchema,
|
|
227
|
+
L as RemoveRuleSchema,
|
|
228
|
+
N as ReplaceRuleSchema,
|
|
229
|
+
R as TemplateSchema,
|
|
230
|
+
T as UISchema
|
|
231
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { safeParse as n } from "../../node_modules/valibot/dist/index.js";
|
|
2
|
+
import { GuidoConfigSchema as o } from "./schemas.js";
|
|
3
|
+
function i(s) {
|
|
4
|
+
return s.map((r) => {
|
|
5
|
+
var e;
|
|
6
|
+
return `[${((e = r.path) == null ? void 0 : e.map((a) => a.key).join(".")) || "root"}] ${r.message}`;
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
function c(s) {
|
|
10
|
+
return s.map((r) => {
|
|
11
|
+
var t;
|
|
12
|
+
return {
|
|
13
|
+
path: ((t = r.path) == null ? void 0 : t.map((e) => e.key).join(".")) || "root",
|
|
14
|
+
message: r.message
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function u(s) {
|
|
19
|
+
const r = n(o, s);
|
|
20
|
+
return r.success ? {
|
|
21
|
+
success: !0,
|
|
22
|
+
data: r.output
|
|
23
|
+
} : {
|
|
24
|
+
success: !1,
|
|
25
|
+
errors: i(r.issues)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function p(s) {
|
|
29
|
+
var t;
|
|
30
|
+
const r = u(s);
|
|
31
|
+
if (!r.success)
|
|
32
|
+
throw new Error(
|
|
33
|
+
`Invalid GuidoConfig:
|
|
34
|
+
${(t = r.errors) == null ? void 0 : t.join(`
|
|
35
|
+
`)}`
|
|
36
|
+
);
|
|
37
|
+
return r.data;
|
|
38
|
+
}
|
|
39
|
+
function m(s) {
|
|
40
|
+
const r = u(s);
|
|
41
|
+
return r.success ? r.data : (console.error("[Guido] Invalid configuration:", r.errors), null);
|
|
42
|
+
}
|
|
43
|
+
function d(s) {
|
|
44
|
+
const r = n(o, s);
|
|
45
|
+
return r.success ? [] : c(r.issues);
|
|
46
|
+
}
|
|
47
|
+
function g(s) {
|
|
48
|
+
return n(o, s).success;
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
d as getValidationErrors,
|
|
52
|
+
g as isValidConfig,
|
|
53
|
+
p as parseConfig,
|
|
54
|
+
m as parseConfigSafe,
|
|
55
|
+
u as validateConfig
|
|
56
|
+
};
|
|
@@ -1,136 +1,112 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
-
import pe from "../node_modules/lodash-es/merge.js";
|
|
21
|
-
const Ae = /* @__PURE__ */ B({
|
|
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({
|
|
22
20
|
__name: "Guido",
|
|
23
21
|
props: {
|
|
24
|
-
|
|
25
|
-
userId: null,
|
|
26
|
-
messageType: null,
|
|
27
|
-
partnerName: null,
|
|
28
|
-
productType: null,
|
|
29
|
-
username: null,
|
|
30
|
-
html: null,
|
|
31
|
-
css: null,
|
|
32
|
-
guidoConfig: null,
|
|
33
|
-
templateConfig: null
|
|
22
|
+
config: null
|
|
34
23
|
},
|
|
35
24
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
36
|
-
setup(
|
|
37
|
-
const
|
|
25
|
+
setup(_, { expose: I, emit: t }) {
|
|
26
|
+
const l = _, L = P(
|
|
38
27
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
39
|
-
),
|
|
28
|
+
), A = P(
|
|
40
29
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
41
|
-
),
|
|
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 = () => {
|
|
42
33
|
var e;
|
|
43
|
-
return (e =
|
|
44
|
-
}, {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
messageType: T = Z,
|
|
54
|
-
username: E = Y
|
|
55
|
-
} = p, l = (t == null ? void 0 : t.preselectedDynamicContentList) || [], i = L(!1);
|
|
56
|
-
s.templateId = c, window.GuidoConfig = pe($, w), window.GuidoConfig.partner = {
|
|
57
|
-
partnerName: d,
|
|
58
|
-
productType: m,
|
|
59
|
-
messageType: T
|
|
60
|
-
}, v.templateConfig = t;
|
|
61
|
-
const { initPlugin: P } = X({
|
|
62
|
-
emailId: c,
|
|
63
|
-
userId: S,
|
|
64
|
-
username: E,
|
|
65
|
-
partnerName: d,
|
|
66
|
-
productType: m,
|
|
67
|
-
preselectedDynamicContentList: l,
|
|
34
|
+
return (e = p.value) == null ? void 0 : e.handleSave(!0);
|
|
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,
|
|
68
44
|
onReady: () => {
|
|
69
|
-
console.debug("guido:ready"),
|
|
45
|
+
console.debug("guido:ready"), t("ready");
|
|
70
46
|
}
|
|
71
|
-
}), { getDefaultTemplate:
|
|
47
|
+
}), { getDefaultTemplate: w } = ee(), { cloneTimersOnSave: C, hasTimerBlocks: D } = J(), H = U(() => {
|
|
72
48
|
var e;
|
|
73
|
-
return !((e =
|
|
49
|
+
return !((e = n.ui) != null && e.showHeader);
|
|
74
50
|
});
|
|
75
|
-
|
|
51
|
+
M({
|
|
76
52
|
onBack: () => {
|
|
77
|
-
console.debug("guido:back"),
|
|
53
|
+
console.debug("guido:back"), t("back");
|
|
78
54
|
},
|
|
79
55
|
onSaveStart: () => {
|
|
80
|
-
console.debug("guido:save:start"),
|
|
56
|
+
console.debug("guido:save:start"), t("save:start");
|
|
81
57
|
},
|
|
82
58
|
onSaveComplete: (e) => {
|
|
83
|
-
console.debug("guido:save:complete", e),
|
|
59
|
+
console.debug("guido:save:complete", e), t("save:complete", e);
|
|
84
60
|
},
|
|
85
61
|
onTestEmailClick: () => {
|
|
86
|
-
console.debug("guido:test-email:click"),
|
|
62
|
+
console.debug("guido:test-email:click"), t("test-email:click");
|
|
87
63
|
}
|
|
88
64
|
});
|
|
89
|
-
const
|
|
90
|
-
console.debug("dynamic-content:close", e),
|
|
91
|
-
},
|
|
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 = () => {
|
|
92
68
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
93
69
|
};
|
|
94
|
-
|
|
95
|
-
|
|
70
|
+
N(() => r.value, () => {
|
|
71
|
+
t("on-change", r.value);
|
|
96
72
|
});
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
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);
|
|
100
76
|
};
|
|
101
|
-
return
|
|
77
|
+
return z(async () => {
|
|
102
78
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
103
79
|
try {
|
|
104
|
-
|
|
80
|
+
u.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
105
81
|
let e = {
|
|
106
|
-
html:
|
|
107
|
-
css:
|
|
82
|
+
html: c && await W(c),
|
|
83
|
+
css: g,
|
|
108
84
|
forceRecreate: !0
|
|
109
85
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
110
86
|
};
|
|
111
|
-
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;
|
|
112
88
|
} catch (e) {
|
|
113
89
|
console.error("Failed to initialize Stripo editor:", e);
|
|
114
90
|
}
|
|
115
|
-
document.addEventListener("dynamic-content:open",
|
|
116
|
-
}),
|
|
117
|
-
|
|
118
|
-
i.value && (y.hideToaster(), (e = document.querySelector("#guido__toaster")) == null || e.remove()), i.value = !1, document.removeEventListener("dynamic-content:open", u);
|
|
91
|
+
document.addEventListener("dynamic-content:open", d);
|
|
92
|
+
}), K(() => {
|
|
93
|
+
document.removeEventListener("dynamic-content:open", d);
|
|
119
94
|
try {
|
|
120
95
|
window.UIEditor.removeEditor();
|
|
121
96
|
} catch {
|
|
122
97
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
123
98
|
}
|
|
124
|
-
|
|
99
|
+
n.reset();
|
|
100
|
+
}), I({
|
|
125
101
|
dynamicContent: {
|
|
126
|
-
insert:
|
|
127
|
-
close:
|
|
102
|
+
insert: E,
|
|
103
|
+
close: k
|
|
128
104
|
},
|
|
129
|
-
hasChanges:
|
|
130
|
-
saveSilent:
|
|
131
|
-
}), { __sfc: !0, PreviewContainer:
|
|
105
|
+
hasChanges: r,
|
|
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: $ };
|
|
132
108
|
}
|
|
133
109
|
});
|
|
134
110
|
export {
|
|
135
|
-
|
|
111
|
+
Ee as default
|
|
136
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,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useTranslations as
|
|
4
|
-
import { InIcons as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as i, computed as s } from "vue";
|
|
2
|
+
import { useConfig as c } from "../../../../composables/useConfig.js";
|
|
3
|
+
import { useTranslations as d } from "../../../../composables/useTranslations.js";
|
|
4
|
+
import { InIcons as u } from "@useinsider/design-system-vue";
|
|
5
|
+
const g = /* @__PURE__ */ i({
|
|
6
6
|
__name: "EmailHeaderInfo",
|
|
7
7
|
setup(f) {
|
|
8
|
-
const { config:
|
|
9
|
-
var e;
|
|
10
|
-
return ((e = t.emailHeader) == null ? void 0 :
|
|
11
|
-
}),
|
|
12
|
-
var e;
|
|
13
|
-
return ((e = t.emailHeader) == null ? void 0 :
|
|
8
|
+
const { config: n } = c(), r = d(), a = s(() => {
|
|
9
|
+
var e, t, o;
|
|
10
|
+
return ((o = (t = (e = n.value) == null ? void 0 : e.editor) == null ? void 0 : t.emailHeader) == null ? void 0 : o.senderName) || r("settings.sender-name");
|
|
11
|
+
}), m = s(() => {
|
|
12
|
+
var e, t, o;
|
|
13
|
+
return ((o = (t = (e = n.value) == null ? void 0 : e.editor) == null ? void 0 : t.emailHeader) == null ? void 0 : o.subject) || r("email-editor.default-subject");
|
|
14
14
|
});
|
|
15
|
-
return { __sfc: !0, config:
|
|
15
|
+
return { __sfc: !0, config: n, trans: r, senderName: a, subject: m, InIcons: u };
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
g as default
|
|
20
20
|
};
|
|
@@ -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 {
|