@useinsider/guido 3.15.0-beta.4e52059 → 3.15.0-beta.62e4f60
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 +92 -108
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +72 -75
- package/dist/composables/useActionsApi.js +22 -30
- package/dist/composables/useCortexBlueprintBridge.js +79 -43
- package/dist/composables/useEmailTemplateApplier.js +83 -45
- package/dist/composables/useTimerClone.js +19 -21
- package/dist/guido.css +1 -1
- package/dist/library.js +7 -11
- package/dist/node_modules/valibot/dist/index.js +216 -230
- package/dist/src/@types/config/schemas.d.ts +0 -20
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +0 -4
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +12 -5
- package/dist/src/composables/useEmailTemplateApplier.d.ts +20 -2
- package/dist/src/library.d.ts +0 -1
- package/dist/src/stores/config.d.ts +0 -36
- package/dist/src/stores/editor.d.ts +0 -25
- package/dist/src/stores/guido-email-editor.d.ts +32 -0
- package/dist/stores/editor.js +1 -4
- package/dist/stores/guido-email-editor.js +9 -1
- package/dist/utils/templatePreparation.js +61 -72
- package/package.json +1 -5
- package/dist/public/trackingIds.js +0 -8
- package/dist/src/public/trackingIds.d.ts +0 -9
- package/dist/src/utils/linkTrackingIds.d.ts +0 -30
- package/dist/utils/linkTrackingIds.js +0 -56
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ModuleFolderDefaults as
|
|
2
|
-
import { object as a, number as n, optional as e, string as t, picklist as
|
|
3
|
-
const
|
|
1
|
+
import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
|
|
2
|
+
import { object as a, number as n, optional as e, string as t, picklist as r, pipe as p, minLength as b, custom as h, boolean as o, array as c, record as k, fallback as C, literal as i, looseObject as g, variant as R, union as f, unknown as s, lazy as T } from "../../node_modules/valibot/dist/index.js";
|
|
3
|
+
const d = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
6
6
|
/** Transactional/system emails */
|
|
@@ -14,31 +14,31 @@ const p = {
|
|
|
14
14
|
UNSUBSCRIBE_PAGES: 97
|
|
15
15
|
}, A = a({
|
|
16
16
|
/** Unique identifier for the template being edited */
|
|
17
|
-
templateId:
|
|
17
|
+
templateId: p(
|
|
18
18
|
t(),
|
|
19
19
|
b(1, "templateId is required")
|
|
20
20
|
),
|
|
21
21
|
/** Unique identifier for the user editing the template */
|
|
22
|
-
userId:
|
|
22
|
+
userId: p(
|
|
23
23
|
t(),
|
|
24
24
|
b(1, "userId is required")
|
|
25
25
|
),
|
|
26
26
|
/** Optional variation ID for A/B testing */
|
|
27
27
|
variationId: e(t())
|
|
28
|
-
}),
|
|
28
|
+
}), I = a({
|
|
29
29
|
/** Fallback font name (e.g., "Georgia") */
|
|
30
30
|
name: t(),
|
|
31
31
|
/** Fallback font family (e.g., "serif" or "sans-serif") */
|
|
32
32
|
family: t()
|
|
33
|
-
}),
|
|
33
|
+
}), L = a({
|
|
34
34
|
/** Partner/organization name (required) */
|
|
35
|
-
name:
|
|
35
|
+
name: p(
|
|
36
36
|
t(),
|
|
37
37
|
b(1, "partner.name is required")
|
|
38
38
|
),
|
|
39
39
|
/** Product type identifier */
|
|
40
40
|
productType: e(
|
|
41
|
-
|
|
41
|
+
r([
|
|
42
42
|
l.EMAIL,
|
|
43
43
|
l.ARCHITECT,
|
|
44
44
|
l.UNSUBSCRIBE_PAGES
|
|
@@ -47,14 +47,14 @@ const p = {
|
|
|
47
47
|
),
|
|
48
48
|
/** Message type (promotional or transactional) */
|
|
49
49
|
messageType: e(
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
r([d.PROMOTIONAL, d.TRANSACTIONAL]),
|
|
51
|
+
d.PROMOTIONAL
|
|
52
52
|
),
|
|
53
53
|
/** Display name for the current user */
|
|
54
54
|
username: e(t(), "Guido User"),
|
|
55
55
|
/** Fallback font settings from partner settings — used to match backend size calculation */
|
|
56
|
-
fallbackFont: e(
|
|
57
|
-
}),
|
|
56
|
+
fallbackFont: e(I)
|
|
57
|
+
}), v = a({
|
|
58
58
|
/** Display text for the dynamic content */
|
|
59
59
|
text: t(),
|
|
60
60
|
/** Template variable value (e.g., {{username}}) */
|
|
@@ -68,7 +68,7 @@ const p = {
|
|
|
68
68
|
value: t()
|
|
69
69
|
})
|
|
70
70
|
)
|
|
71
|
-
}), S =
|
|
71
|
+
}), S = T(() => g({
|
|
72
72
|
text: e(t()),
|
|
73
73
|
// eslint-disable-next-line camelcase -- backend field name
|
|
74
74
|
tag_text: e(t()),
|
|
@@ -76,32 +76,32 @@ const p = {
|
|
|
76
76
|
children: e(c(S)),
|
|
77
77
|
// eslint-disable-next-line camelcase -- backend field name
|
|
78
78
|
select_items: e(c(S))
|
|
79
|
-
})),
|
|
79
|
+
})), E = k(
|
|
80
80
|
t(),
|
|
81
|
-
|
|
81
|
+
C(c(S), [])
|
|
82
82
|
), P = g({
|
|
83
83
|
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
84
84
|
id: e(n()),
|
|
85
85
|
/** Decimal places for price display (legacy data may use string or number) */
|
|
86
|
-
decimalCount: e(
|
|
86
|
+
decimalCount: e(f([t(), n()])),
|
|
87
87
|
/** Pinned product IDs (empty array when filter-driven) */
|
|
88
|
-
productIds: e(c(
|
|
88
|
+
productIds: e(c(s())),
|
|
89
89
|
/** Whether the block requested live products at send time */
|
|
90
90
|
sendProductRequestFlag: e(o()),
|
|
91
91
|
/** Whether to randomize product order */
|
|
92
92
|
shuffleProducts: e(o()),
|
|
93
93
|
/** Filter rules driving product selection */
|
|
94
|
-
filters: e(c(
|
|
94
|
+
filters: e(c(s())),
|
|
95
95
|
/** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
|
|
96
96
|
currency: e(t()),
|
|
97
97
|
/** Currency display settings (separators, alignment, decimals) */
|
|
98
|
-
currencySettings: e(
|
|
98
|
+
currencySettings: e(s()),
|
|
99
99
|
/** Locale (e.g. 'nl_NL') */
|
|
100
100
|
language: e(t()),
|
|
101
101
|
/** Recommendation strategy key (e.g. 'newArrivals') */
|
|
102
102
|
strategy: e(t()),
|
|
103
103
|
/** Snapshot of products as rendered by the legacy block */
|
|
104
|
-
recommendedProducts: e(c(
|
|
104
|
+
recommendedProducts: e(c(s())),
|
|
105
105
|
/** Number of product cards per row */
|
|
106
106
|
cardsInRow: e(n()),
|
|
107
107
|
/** Mobile-only padding (right) */
|
|
@@ -117,14 +117,14 @@ const p = {
|
|
|
117
117
|
/** Block type marker used by some legacy variants */
|
|
118
118
|
blockType: e(t()),
|
|
119
119
|
/** Size variant marker (legacy data may use string or number) */
|
|
120
|
-
size: e(
|
|
120
|
+
size: e(f([t(), n()])),
|
|
121
121
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
122
122
|
verticalResponsiveness: e(o()),
|
|
123
123
|
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
124
124
|
isPriceMovedToNextLine: e(o()),
|
|
125
125
|
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
126
126
|
isPriceDeletedForZeroSale: e(o())
|
|
127
|
-
}),
|
|
127
|
+
}), D = a({
|
|
128
128
|
/**
|
|
129
129
|
* Legacy recommendation block configs keyed by block ID.
|
|
130
130
|
* Pass this when loading a template authored with the v1
|
|
@@ -132,17 +132,17 @@ const p = {
|
|
|
132
132
|
* strategy, currency, locale, and layout data.
|
|
133
133
|
*/
|
|
134
134
|
recommendationConfigs: e(
|
|
135
|
-
|
|
135
|
+
k(t(), P),
|
|
136
136
|
{}
|
|
137
137
|
)
|
|
138
|
-
}),
|
|
138
|
+
}), M = a({
|
|
139
139
|
/** Initial HTML content */
|
|
140
140
|
html: e(t(), ""),
|
|
141
141
|
/** Initial CSS content */
|
|
142
142
|
css: e(t(), ""),
|
|
143
143
|
/** Preselected dynamic content items */
|
|
144
144
|
preselectedDynamicContent: e(
|
|
145
|
-
c(
|
|
145
|
+
c(v),
|
|
146
146
|
[]
|
|
147
147
|
),
|
|
148
148
|
/**
|
|
@@ -151,30 +151,16 @@ const p = {
|
|
|
151
151
|
* (first) partner's leaf attributes into the label→token map that repairs
|
|
152
152
|
* label-form placeholders (`{{ Phone Number }}`) in dropped saved modules.
|
|
153
153
|
*/
|
|
154
|
-
dynamicContentList: e(
|
|
154
|
+
dynamicContentList: e(E, {}),
|
|
155
155
|
/** Valid custom field attribute names from the partner's categorized fields */
|
|
156
156
|
customFieldAttributes: e(c(t()), []),
|
|
157
157
|
/** Selected unsubscribe page IDs */
|
|
158
158
|
selectedUnsubscribePages: e(c(n()), []),
|
|
159
159
|
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
160
160
|
forceRecreate: e(o(), !1),
|
|
161
|
-
/**
|
|
162
|
-
* Consumer-persisted tracking-id high-water mark (SD-141414). Used as the id floor
|
|
163
|
-
* during migration so a rolled-back document never re-mints retired tracking ids.
|
|
164
|
-
* Out-of-range numbers are coerced rather than rejected — this value arrives from
|
|
165
|
-
* stored partner data, and rejecting it would fail parseConfig and block the editor
|
|
166
|
-
* mount. Non-numbers still fail, like every other field in this schema.
|
|
167
|
-
*/
|
|
168
|
-
trackIdCounter: e(
|
|
169
|
-
m(
|
|
170
|
-
n(),
|
|
171
|
-
C((s) => Number.isFinite(s) ? Math.max(0, Math.floor(s)) : 0)
|
|
172
|
-
),
|
|
173
|
-
0
|
|
174
|
-
),
|
|
175
161
|
/** Migration-only inputs (legacy block configs) */
|
|
176
|
-
migration: e(
|
|
177
|
-
}),
|
|
162
|
+
migration: e(D, {})
|
|
163
|
+
}), N = a({
|
|
178
164
|
/** Sender display name */
|
|
179
165
|
senderName: e(t(), ""),
|
|
180
166
|
/** Email subject line */
|
|
@@ -187,17 +173,17 @@ const p = {
|
|
|
187
173
|
/** Migration date for template compatibility */
|
|
188
174
|
migrationDate: e(n(), 1759696858),
|
|
189
175
|
/** Email header settings */
|
|
190
|
-
emailHeader: e(
|
|
176
|
+
emailHeader: e(N, { senderName: "", subject: "" }),
|
|
191
177
|
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
192
|
-
savedModulesFolderName: e(t(),
|
|
178
|
+
savedModulesFolderName: e(t(), y.SAVED_MODULES),
|
|
193
179
|
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
194
|
-
defaultModulesFolderName: e(t(),
|
|
195
|
-
}),
|
|
180
|
+
defaultModulesFolderName: e(t(), y.DEFAULT_MODULES)
|
|
181
|
+
}), x = a({
|
|
196
182
|
/** Whether to show the header bar */
|
|
197
183
|
showHeader: e(o(), !0),
|
|
198
184
|
/** Custom label for back button (if shown) */
|
|
199
185
|
backButtonLabel: e(t())
|
|
200
|
-
}),
|
|
186
|
+
}), F = a({
|
|
201
187
|
/** Enable dynamic content insertion */
|
|
202
188
|
dynamicContent: e(o(), !0),
|
|
203
189
|
/** Enable save as template functionality */
|
|
@@ -217,10 +203,8 @@ const p = {
|
|
|
217
203
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
218
204
|
autosave: e(o(), !1),
|
|
219
205
|
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
220
|
-
allowlistEnabled: e(o(), !1)
|
|
221
|
-
|
|
222
|
-
linkTrackingIds: e(o(), !1)
|
|
223
|
-
}), B = i([
|
|
206
|
+
allowlistEnabled: e(o(), !1)
|
|
207
|
+
}), U = r([
|
|
224
208
|
"amp-accordion",
|
|
225
209
|
"amp-carousel",
|
|
226
210
|
"amp-form-controls",
|
|
@@ -234,7 +218,7 @@ const p = {
|
|
|
234
218
|
"text-block",
|
|
235
219
|
"timer-block",
|
|
236
220
|
"video-block"
|
|
237
|
-
]),
|
|
221
|
+
]), B = r([
|
|
238
222
|
"dynamic-content",
|
|
239
223
|
"checkbox-block",
|
|
240
224
|
"radio-button-block",
|
|
@@ -242,123 +226,123 @@ const p = {
|
|
|
242
226
|
"unsubscribe-block",
|
|
243
227
|
"coupon-block",
|
|
244
228
|
"items-block"
|
|
245
|
-
]),
|
|
229
|
+
]), w = a({
|
|
246
230
|
/** Default blocks to exclude from the editor */
|
|
247
231
|
excludeDefaults: e(
|
|
248
|
-
c(
|
|
232
|
+
c(U),
|
|
249
233
|
[]
|
|
250
234
|
),
|
|
251
235
|
/** Custom blocks to include in the editor */
|
|
252
236
|
includeCustoms: e(
|
|
253
|
-
c(
|
|
237
|
+
c(B),
|
|
254
238
|
[]
|
|
255
239
|
)
|
|
256
|
-
}),
|
|
240
|
+
}), m = a({
|
|
257
241
|
/** Unique identifier for the rule */
|
|
258
242
|
id: t(),
|
|
259
243
|
/** Human-readable description */
|
|
260
244
|
description: e(t()),
|
|
261
245
|
/** Priority for rule ordering (lower = earlier) */
|
|
262
246
|
priority: n()
|
|
263
|
-
}),
|
|
264
|
-
...
|
|
265
|
-
type:
|
|
247
|
+
}), H = a({
|
|
248
|
+
...m.entries,
|
|
249
|
+
type: i("replace"),
|
|
266
250
|
/** String to search for */
|
|
267
251
|
search: t(),
|
|
268
252
|
/** Replacement string */
|
|
269
253
|
replacement: t(),
|
|
270
254
|
/** Replace all occurrences (default: false) */
|
|
271
255
|
replaceAll: e(o())
|
|
272
|
-
}),
|
|
273
|
-
...
|
|
274
|
-
type:
|
|
256
|
+
}), _ = a({
|
|
257
|
+
...m.entries,
|
|
258
|
+
type: i("regex"),
|
|
275
259
|
/** Regex pattern string */
|
|
276
260
|
pattern: t(),
|
|
277
261
|
/** Replacement string (supports $1, $2, etc.) */
|
|
278
262
|
replacement: t(),
|
|
279
263
|
/** Regex flags (e.g., 'gi') */
|
|
280
264
|
flags: e(t())
|
|
281
|
-
}),
|
|
282
|
-
...
|
|
283
|
-
type:
|
|
265
|
+
}), j = a({
|
|
266
|
+
...m.entries,
|
|
267
|
+
type: i("remove"),
|
|
284
268
|
/** Strings or patterns to remove */
|
|
285
269
|
targets: c(t())
|
|
286
|
-
}),
|
|
287
|
-
...
|
|
288
|
-
type:
|
|
270
|
+
}), q = a({
|
|
271
|
+
...m.entries,
|
|
272
|
+
type: i("custom"),
|
|
289
273
|
/** Custom processor function */
|
|
290
|
-
processor:
|
|
291
|
-
(
|
|
274
|
+
processor: h(
|
|
275
|
+
(u) => typeof u == "function",
|
|
292
276
|
"processor must be a function"
|
|
293
277
|
)
|
|
294
|
-
}),
|
|
278
|
+
}), G = R("type", [
|
|
279
|
+
H,
|
|
295
280
|
_,
|
|
296
281
|
j,
|
|
297
|
-
q
|
|
298
|
-
|
|
299
|
-
]), z = a({
|
|
282
|
+
q
|
|
283
|
+
]), V = a({
|
|
300
284
|
/** Custom compiler rules to apply */
|
|
301
|
-
customRules: e(c(
|
|
285
|
+
customRules: e(c(G), []),
|
|
302
286
|
/** Skip default compiler rules */
|
|
303
287
|
ignoreDefaultRules: e(o(), !1)
|
|
304
|
-
}),
|
|
288
|
+
}), z = a({
|
|
305
289
|
/**
|
|
306
290
|
* External validation handler called before save completes.
|
|
307
291
|
* Return false to cancel the save operation.
|
|
308
292
|
*/
|
|
309
293
|
externalValidation: e(
|
|
310
|
-
|
|
311
|
-
(
|
|
294
|
+
h(
|
|
295
|
+
(u) => typeof u == "function",
|
|
312
296
|
"externalValidation must be a function"
|
|
313
297
|
)
|
|
314
298
|
)
|
|
315
|
-
}),
|
|
299
|
+
}), K = a({
|
|
316
300
|
// Required sections
|
|
317
301
|
/** Identity configuration (required) */
|
|
318
302
|
identity: A,
|
|
319
303
|
/** Partner configuration (required) */
|
|
320
|
-
partner:
|
|
304
|
+
partner: L,
|
|
321
305
|
// Optional sections (with defaults)
|
|
322
306
|
/** Template content and presets */
|
|
323
|
-
template: e(
|
|
307
|
+
template: e(M, {}),
|
|
324
308
|
/** Editor settings */
|
|
325
309
|
editor: e(O, {}),
|
|
326
310
|
/** UI configuration */
|
|
327
|
-
ui: e(
|
|
311
|
+
ui: e(x, {}),
|
|
328
312
|
/** Feature toggles */
|
|
329
|
-
features: e(
|
|
313
|
+
features: e(F, {}),
|
|
330
314
|
/** Block configuration */
|
|
331
|
-
blocks: e(
|
|
315
|
+
blocks: e(w, {}),
|
|
332
316
|
/** Compiler configuration */
|
|
333
|
-
compiler: e(
|
|
317
|
+
compiler: e(V, {}),
|
|
334
318
|
/** Callbacks and event handlers */
|
|
335
|
-
callbacks: e(
|
|
319
|
+
callbacks: e(z, {})
|
|
336
320
|
});
|
|
337
321
|
export {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
322
|
+
w as BlocksSchema,
|
|
323
|
+
z as CallbacksSchema,
|
|
324
|
+
G as CompilerRuleSchema,
|
|
325
|
+
V as CompilerSchema,
|
|
326
|
+
B as CustomBlockTypeSchema,
|
|
327
|
+
q as CustomRuleSchema,
|
|
328
|
+
U as DefaultBlockTypeSchema,
|
|
329
|
+
E as DynamicContentListSchema,
|
|
346
330
|
S as DynamicContentNodeSchema,
|
|
347
|
-
|
|
331
|
+
v as DynamicContentSchema,
|
|
348
332
|
O as EditorSchema,
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
333
|
+
N as EmailHeaderSchema,
|
|
334
|
+
I as FallbackFontSchema,
|
|
335
|
+
F as FeaturesSchema,
|
|
336
|
+
K as GuidoConfigSchema,
|
|
353
337
|
A as IdentitySchema,
|
|
354
338
|
P as LegacyRecommendationConfigSchema,
|
|
355
|
-
|
|
356
|
-
|
|
339
|
+
d as MessageType,
|
|
340
|
+
L as PartnerSchema,
|
|
357
341
|
l as ProductType,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
342
|
+
_ as RegexRuleSchema,
|
|
343
|
+
j as RemoveRuleSchema,
|
|
344
|
+
H as ReplaceRuleSchema,
|
|
345
|
+
D as TemplateMigrationSchema,
|
|
346
|
+
M as TemplateSchema,
|
|
347
|
+
x as UISchema
|
|
364
348
|
};
|
|
@@ -1,50 +1,49 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { provideGuidoActions as
|
|
4
|
-
import { useGuidoStateBridge as
|
|
5
|
-
import { usePartner as
|
|
6
|
-
import { useStripo as
|
|
7
|
-
import { useTimerClone as
|
|
8
|
-
import { migrate as
|
|
9
|
-
import { ModuleFolderDefaults as
|
|
10
|
-
import { RIBBON_SELECTOR as
|
|
11
|
-
import { useRecommendationExtensionStore as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { useStripoApi as
|
|
20
|
-
import { useConfigStore as
|
|
21
|
-
import { useDynamicContentStore as
|
|
22
|
-
import { useEditorStore as
|
|
23
|
-
import { usePreviewStore as
|
|
24
|
-
import { useTemplateStore as
|
|
25
|
-
import { useUnsubscribeStore as
|
|
26
|
-
|
|
27
|
-
const ze = /* @__PURE__ */ j({
|
|
1
|
+
import { defineComponent as q, defineAsyncComponent as M, ref as U, computed as _, watch as B, onMounted as K, onUnmounted as V } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as j } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as J } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as Q } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as X } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as Y } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as Z } from "../composables/useTimerClone.js";
|
|
8
|
+
import { migrate as I } from "../config/migrator/index.js";
|
|
9
|
+
import { ModuleFolderDefaults as N } from "../enums/defaults.js";
|
|
10
|
+
import { RIBBON_SELECTOR as ee } from "../enums/onboarding.js";
|
|
11
|
+
import { useRecommendationExtensionStore as te } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
|
+
import oe from "./organisms/AutoSaveController.vue.js";
|
|
13
|
+
import ne from "./organisms/base/Toaster.vue.js";
|
|
14
|
+
import re from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
+
import se from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import ie from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import ae from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import ce from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as de } from "../services/stripoApi.js";
|
|
20
|
+
import { useConfigStore as me } from "../stores/config.js";
|
|
21
|
+
import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
|
|
22
|
+
import { useEditorStore as O } from "../stores/editor.js";
|
|
23
|
+
import { usePreviewStore as ue } from "../stores/preview.js";
|
|
24
|
+
import { useTemplateStore as pe } from "../stores/template.js";
|
|
25
|
+
import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
|
|
26
|
+
const xe = /* @__PURE__ */ q({
|
|
28
27
|
__name: "Guido",
|
|
29
28
|
props: {
|
|
30
29
|
config: null,
|
|
31
30
|
ready: { type: Boolean, default: !0 }
|
|
32
31
|
},
|
|
33
32
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
34
|
-
setup(
|
|
35
|
-
const
|
|
33
|
+
setup(P, { expose: A, emit: n }) {
|
|
34
|
+
const i = P, W = M(
|
|
36
35
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
37
|
-
),
|
|
36
|
+
), x = M(
|
|
38
37
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
39
|
-
),
|
|
40
|
-
|
|
41
|
-
const c =
|
|
38
|
+
), g = U(), l = U(), u = le(), S = fe(), o = me();
|
|
39
|
+
i.ready && o.init(i.config);
|
|
40
|
+
const c = O(), $ = ue(), m = _(() => c.hasChanges), { isTestPartner: G } = X(), h = () => {
|
|
42
41
|
var t;
|
|
43
|
-
return (t =
|
|
42
|
+
return (t = g.value) == null ? void 0 : t.handleSave(!0);
|
|
44
43
|
}, b = (t) => {
|
|
45
44
|
c.loadingStatus = t;
|
|
46
45
|
};
|
|
47
|
-
|
|
46
|
+
j(), Q();
|
|
48
47
|
const p = () => {
|
|
49
48
|
var t, e;
|
|
50
49
|
return {
|
|
@@ -52,101 +51,99 @@ const ze = /* @__PURE__ */ j({
|
|
|
52
51
|
userId: o.userId,
|
|
53
52
|
username: o.username,
|
|
54
53
|
partnerName: o.partnerName,
|
|
55
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
56
|
-
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
54
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
|
|
55
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
|
|
57
56
|
};
|
|
58
|
-
}, { initPlugin: E, preloadRuntime: w } =
|
|
57
|
+
}, { initPlugin: E, preloadRuntime: w } = Y(), { getDefaultTemplate: C } = de(), { cloneTimersOnSave: D, hasTimerBlocks: T } = Z(), H = _(() => {
|
|
59
58
|
var t;
|
|
60
59
|
return !((t = o.ui) != null && t.showHeader);
|
|
61
60
|
});
|
|
62
|
-
|
|
61
|
+
J({
|
|
63
62
|
onBack: () => {
|
|
64
|
-
console.debug("guido:back"),
|
|
63
|
+
console.debug("guido:back"), n("back");
|
|
65
64
|
},
|
|
66
65
|
onSaveStart: () => {
|
|
67
|
-
console.debug("guido:save:start"),
|
|
66
|
+
console.debug("guido:save:start"), n("save:start");
|
|
68
67
|
},
|
|
69
68
|
onSaveComplete: (t) => {
|
|
70
69
|
const e = { ...t, metadata: p() };
|
|
71
|
-
console.debug("guido:save:complete", e),
|
|
70
|
+
console.debug("guido:save:complete", e), n("save:complete", e);
|
|
72
71
|
},
|
|
73
72
|
onTestEmailClick: () => {
|
|
74
|
-
console.debug("guido:test-email:click"),
|
|
73
|
+
console.debug("guido:test-email:click"), n("test-email:click");
|
|
75
74
|
}
|
|
76
75
|
});
|
|
77
|
-
const
|
|
76
|
+
const L = (t) => {
|
|
78
77
|
console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
79
|
-
},
|
|
78
|
+
}, R = () => {
|
|
80
79
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
81
80
|
};
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
B(() => m.value, () => {
|
|
82
|
+
n("on-change", m.value);
|
|
84
83
|
});
|
|
85
84
|
const f = (t) => {
|
|
86
85
|
const e = t, { attribute: s, position: d } = e.detail;
|
|
87
|
-
console.debug("dynamic-content:open", e.detail),
|
|
86
|
+
console.debug("dynamic-content:open", e.detail), n("dynamic-content:open", s, d);
|
|
88
87
|
};
|
|
89
|
-
let
|
|
88
|
+
let a = null;
|
|
90
89
|
const y = () => {
|
|
91
90
|
var e;
|
|
92
|
-
const t = document.querySelector(
|
|
91
|
+
const t = document.querySelector(ee);
|
|
93
92
|
(e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
94
93
|
}, v = async () => {
|
|
95
94
|
var t;
|
|
96
95
|
try {
|
|
97
|
-
o.initialized || o.init(
|
|
98
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "",
|
|
96
|
+
o.initialized || o.init(i.config), c.templateId = o.templateId;
|
|
97
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", k = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
99
98
|
S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
100
|
-
const
|
|
101
|
-
let
|
|
102
|
-
html: s && await
|
|
99
|
+
const F = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {};
|
|
100
|
+
let r = {
|
|
101
|
+
html: s && await I(s, F),
|
|
103
102
|
css: d
|
|
104
103
|
};
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
const V = {
|
|
109
|
-
preselectedDynamicContentList: I,
|
|
104
|
+
r.html || (r = await C(), r.html = await I(r.html, F)), T(r.html) && (r.html = await D(r.html));
|
|
105
|
+
const z = {
|
|
106
|
+
preselectedDynamicContentList: k,
|
|
110
107
|
onReady: () => {
|
|
111
|
-
console.debug("guido:ready"),
|
|
108
|
+
console.debug("guido:ready"), n("ready");
|
|
112
109
|
}
|
|
113
110
|
};
|
|
114
|
-
await E(
|
|
111
|
+
await E(r, p(), z), u.selectedDynamicContentList = k;
|
|
115
112
|
} catch (e) {
|
|
116
113
|
console.error("Failed to initialize Stripo editor:", e);
|
|
117
114
|
}
|
|
118
115
|
};
|
|
119
|
-
return
|
|
116
|
+
return K(async () => {
|
|
120
117
|
var e;
|
|
121
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
118
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), te().$reset(), O().$reset(), pe().$reset(), y();
|
|
122
119
|
const t = (e = l.value) == null ? void 0 : e.parentElement;
|
|
123
|
-
if (t && (
|
|
120
|
+
if (t && (a = new ResizeObserver(y), a.observe(t)), w(), i.ready)
|
|
124
121
|
await v();
|
|
125
122
|
else {
|
|
126
|
-
const s =
|
|
123
|
+
const s = B(() => i.ready, (d) => {
|
|
127
124
|
d && (s(), v());
|
|
128
125
|
});
|
|
129
126
|
}
|
|
130
127
|
document.addEventListener("dynamic-content:open", f);
|
|
131
|
-
}),
|
|
132
|
-
|
|
128
|
+
}), V(() => {
|
|
129
|
+
a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", f);
|
|
133
130
|
try {
|
|
134
131
|
window.UIEditor.removeEditor();
|
|
135
132
|
} catch {
|
|
136
133
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
137
134
|
}
|
|
138
|
-
o.reset();
|
|
139
|
-
}),
|
|
135
|
+
c.$reset(), o.reset();
|
|
136
|
+
}), A({
|
|
140
137
|
dynamicContent: {
|
|
141
|
-
insert:
|
|
142
|
-
close:
|
|
138
|
+
insert: L,
|
|
139
|
+
close: R
|
|
143
140
|
},
|
|
144
141
|
hasChanges: m,
|
|
145
|
-
saveSilent:
|
|
142
|
+
saveSilent: h,
|
|
146
143
|
setLoading: b
|
|
147
|
-
}), { __sfc: !0, PreviewContainer:
|
|
144
|
+
}), { __sfc: !0, PreviewContainer: W, OnboardingWrapper: x, headerWrapperRef: g, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: o, editorStore: c, previewStore: $, hasChanges: m, isTestPartner: G, saveSilent: h, setLoading: b, emit: n, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: T, noHeader: H, insertDynamicContent: L, closeDynamicContent: R, handleDynamicContentOpen: f, ribbonObserver: a, updateRibbonOffset: y, startEditor: v, AutoSaveController: oe, Toaster: ne, FilterSelectionDrawer: re, HeaderWrapper: se, LoadingWrapper: ie, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ce };
|
|
148
145
|
}
|
|
149
146
|
});
|
|
150
147
|
export {
|
|
151
|
-
|
|
148
|
+
xe as default
|
|
152
149
|
};
|