@useinsider/guido 3.11.0-beta.88cf651 → 3.11.0-beta.ad6af17
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 +84 -104
- package/dist/composables/useStripo.js +67 -70
- package/dist/node_modules/valibot/dist/index.js +112 -148
- package/dist/src/@types/config/schemas.d.ts +0 -30
- package/dist/src/@types/generic.d.ts +0 -18
- package/dist/src/composables/useConfig.d.ts +0 -6
- package/dist/src/library.d.ts +1 -1
- package/dist/src/stores/config.d.ts +0 -54
- package/dist/src/utils/genericUtil.d.ts +1 -18
- package/dist/utils/genericUtil.js +21 -42
- package/package.json +1 -1
- package/dist/composables/useModuleDynamicContentRepair.js +0 -37
- package/dist/src/composables/useModuleDynamicContentRepair.d.ts +0 -18
- package/dist/src/utils/dynamicContentConverter.d.ts +0 -27
- package/dist/utils/dynamicContentConverter.js +0 -31
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ModuleFolderDefaults as
|
|
2
|
-
import { object as a, number as
|
|
1
|
+
import { ModuleFolderDefaults as S } from "../../enums/defaults.js";
|
|
2
|
+
import { object as a, number as s, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as h, boolean as o, array as c, record as k, literal as i, looseObject as y, variant as g, union as f, unknown as n } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const d = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -12,7 +12,7 @@ const d = {
|
|
|
12
12
|
ARCHITECT: 49,
|
|
13
13
|
/** Unsubscribe page builder */
|
|
14
14
|
UNSUBSCRIBE_PAGES: 97
|
|
15
|
-
},
|
|
15
|
+
}, R = a({
|
|
16
16
|
/** Unique identifier for the template being edited */
|
|
17
17
|
templateId: p(
|
|
18
18
|
t(),
|
|
@@ -25,12 +25,12 @@ const d = {
|
|
|
25
25
|
),
|
|
26
26
|
/** Optional variation ID for A/B testing */
|
|
27
27
|
variationId: e(t())
|
|
28
|
-
}),
|
|
28
|
+
}), T = 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
|
+
}), C = a({
|
|
34
34
|
/** Partner/organization name (required) */
|
|
35
35
|
name: p(
|
|
36
36
|
t(),
|
|
@@ -53,8 +53,8 @@ const d = {
|
|
|
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(T)
|
|
57
|
+
}), A = a({
|
|
58
58
|
/** Display text for the dynamic content */
|
|
59
59
|
text: t(),
|
|
60
60
|
/** Template variable value (e.g., {{username}}) */
|
|
@@ -68,46 +68,35 @@ const d = {
|
|
|
68
68
|
value: t()
|
|
69
69
|
})
|
|
70
70
|
)
|
|
71
|
-
}),
|
|
72
|
-
text: e(t()),
|
|
73
|
-
// eslint-disable-next-line camelcase -- backend field name
|
|
74
|
-
tag_text: e(t()),
|
|
75
|
-
value: e(t()),
|
|
76
|
-
children: e(c(S)),
|
|
77
|
-
// eslint-disable-next-line camelcase -- backend field name
|
|
78
|
-
select_items: e(c(S))
|
|
79
|
-
})), P = k(
|
|
80
|
-
t(),
|
|
81
|
-
C(c(S), [])
|
|
82
|
-
), D = g({
|
|
71
|
+
}), I = y({
|
|
83
72
|
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
84
|
-
id: e(
|
|
73
|
+
id: e(s()),
|
|
85
74
|
/** Decimal places for price display (legacy data may use string or number) */
|
|
86
|
-
decimalCount: e(
|
|
75
|
+
decimalCount: e(f([t(), s()])),
|
|
87
76
|
/** Pinned product IDs (empty array when filter-driven) */
|
|
88
|
-
productIds: e(c(
|
|
77
|
+
productIds: e(c(n())),
|
|
89
78
|
/** Whether the block requested live products at send time */
|
|
90
79
|
sendProductRequestFlag: e(o()),
|
|
91
80
|
/** Whether to randomize product order */
|
|
92
81
|
shuffleProducts: e(o()),
|
|
93
82
|
/** Filter rules driving product selection */
|
|
94
|
-
filters: e(c(
|
|
83
|
+
filters: e(c(n())),
|
|
95
84
|
/** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
|
|
96
85
|
currency: e(t()),
|
|
97
86
|
/** Currency display settings (separators, alignment, decimals) */
|
|
98
|
-
currencySettings: e(
|
|
87
|
+
currencySettings: e(n()),
|
|
99
88
|
/** Locale (e.g. 'nl_NL') */
|
|
100
89
|
language: e(t()),
|
|
101
90
|
/** Recommendation strategy key (e.g. 'newArrivals') */
|
|
102
91
|
strategy: e(t()),
|
|
103
92
|
/** Snapshot of products as rendered by the legacy block */
|
|
104
|
-
recommendedProducts: e(c(
|
|
93
|
+
recommendedProducts: e(c(n())),
|
|
105
94
|
/** Number of product cards per row */
|
|
106
|
-
cardsInRow: e(
|
|
95
|
+
cardsInRow: e(s()),
|
|
107
96
|
/** Mobile-only padding (right) */
|
|
108
|
-
mobileRightPadding: e(
|
|
97
|
+
mobileRightPadding: e(s()),
|
|
109
98
|
/** Mobile-only padding (left) */
|
|
110
|
-
mobileLeftPadding: e(
|
|
99
|
+
mobileLeftPadding: e(s()),
|
|
111
100
|
/** Disable responsive scaling */
|
|
112
101
|
unresponsive: e(o()),
|
|
113
102
|
/** Layout orientation ('vertical' | 'horizontal') */
|
|
@@ -117,14 +106,14 @@ const d = {
|
|
|
117
106
|
/** Block type marker used by some legacy variants */
|
|
118
107
|
blockType: e(t()),
|
|
119
108
|
/** Size variant marker (legacy data may use string or number) */
|
|
120
|
-
size: e(
|
|
109
|
+
size: e(f([t(), s()])),
|
|
121
110
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
122
111
|
verticalResponsiveness: e(o()),
|
|
123
112
|
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
124
113
|
isPriceMovedToNextLine: e(o()),
|
|
125
114
|
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
126
115
|
isPriceDeletedForZeroSale: e(o())
|
|
127
|
-
}),
|
|
116
|
+
}), L = a({
|
|
128
117
|
/**
|
|
129
118
|
* Legacy recommendation block configs keyed by block ID.
|
|
130
119
|
* Pass this when loading a template authored with the v1
|
|
@@ -132,58 +121,51 @@ const d = {
|
|
|
132
121
|
* strategy, currency, locale, and layout data.
|
|
133
122
|
*/
|
|
134
123
|
recommendationConfigs: e(
|
|
135
|
-
k(t(),
|
|
124
|
+
k(t(), I),
|
|
136
125
|
{}
|
|
137
126
|
)
|
|
138
|
-
}),
|
|
127
|
+
}), P = a({
|
|
139
128
|
/** Initial HTML content */
|
|
140
129
|
html: e(t(), ""),
|
|
141
130
|
/** Initial CSS content */
|
|
142
131
|
css: e(t(), ""),
|
|
143
132
|
/** Preselected dynamic content items */
|
|
144
133
|
preselectedDynamicContent: e(
|
|
145
|
-
c(
|
|
134
|
+
c(A),
|
|
146
135
|
[]
|
|
147
136
|
),
|
|
148
|
-
/**
|
|
149
|
-
* Partner-keyed set of dynamic-content items the account offers, e.g.
|
|
150
|
-
* `{ [partnerName]: [{ text, value, children }] }`. Guido flattens the active
|
|
151
|
-
* (first) partner's leaf attributes into the label→token map that repairs
|
|
152
|
-
* label-form placeholders (`{{ Phone Number }}`) in dropped saved modules.
|
|
153
|
-
*/
|
|
154
|
-
dynamicContentList: e(P, {}),
|
|
155
137
|
/** Valid custom field attribute names from the partner's categorized fields */
|
|
156
138
|
customFieldAttributes: e(c(t()), []),
|
|
157
139
|
/** Selected unsubscribe page IDs */
|
|
158
|
-
selectedUnsubscribePages: e(c(
|
|
140
|
+
selectedUnsubscribePages: e(c(s()), []),
|
|
159
141
|
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
160
142
|
forceRecreate: e(o(), !1),
|
|
161
143
|
/** Migration-only inputs (legacy block configs) */
|
|
162
|
-
migration: e(
|
|
163
|
-
}),
|
|
144
|
+
migration: e(L, {})
|
|
145
|
+
}), v = a({
|
|
164
146
|
/** Sender display name */
|
|
165
147
|
senderName: e(t(), ""),
|
|
166
148
|
/** Email subject line */
|
|
167
149
|
subject: e(t(), "")
|
|
168
|
-
}),
|
|
150
|
+
}), E = a({
|
|
169
151
|
/** Locale for the editor UI */
|
|
170
152
|
locale: e(t(), "en"),
|
|
171
153
|
/** Path to translations object */
|
|
172
154
|
translationsPath: e(t(), "window.trans[Object.keys(window.trans)[0]]"),
|
|
173
155
|
/** Migration date for template compatibility */
|
|
174
|
-
migrationDate: e(
|
|
156
|
+
migrationDate: e(s(), 1759696858),
|
|
175
157
|
/** Email header settings */
|
|
176
|
-
emailHeader: e(
|
|
158
|
+
emailHeader: e(v, { senderName: "", subject: "" }),
|
|
177
159
|
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
178
|
-
savedModulesFolderName: e(t(),
|
|
160
|
+
savedModulesFolderName: e(t(), S.SAVED_MODULES),
|
|
179
161
|
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
180
|
-
defaultModulesFolderName: e(t(),
|
|
181
|
-
}),
|
|
162
|
+
defaultModulesFolderName: e(t(), S.DEFAULT_MODULES)
|
|
163
|
+
}), M = a({
|
|
182
164
|
/** Whether to show the header bar */
|
|
183
165
|
showHeader: e(o(), !0),
|
|
184
166
|
/** Custom label for back button (if shown) */
|
|
185
167
|
backButtonLabel: e(t())
|
|
186
|
-
}),
|
|
168
|
+
}), O = a({
|
|
187
169
|
/** Enable dynamic content insertion */
|
|
188
170
|
dynamicContent: e(o(), !0),
|
|
189
171
|
/** Enable save as template functionality */
|
|
@@ -202,7 +184,7 @@ const d = {
|
|
|
202
184
|
liquidSyntax: e(o(), !1),
|
|
203
185
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
204
186
|
autosave: e(o(), !1)
|
|
205
|
-
}),
|
|
187
|
+
}), N = l([
|
|
206
188
|
"amp-accordion",
|
|
207
189
|
"amp-carousel",
|
|
208
190
|
"amp-form-controls",
|
|
@@ -216,7 +198,7 @@ const d = {
|
|
|
216
198
|
"text-block",
|
|
217
199
|
"timer-block",
|
|
218
200
|
"video-block"
|
|
219
|
-
]),
|
|
201
|
+
]), D = l([
|
|
220
202
|
"dynamic-content",
|
|
221
203
|
"checkbox-block",
|
|
222
204
|
"radio-button-block",
|
|
@@ -224,15 +206,15 @@ const d = {
|
|
|
224
206
|
"unsubscribe-block",
|
|
225
207
|
"coupon-block",
|
|
226
208
|
"items-block"
|
|
227
|
-
]),
|
|
209
|
+
]), x = a({
|
|
228
210
|
/** Default blocks to exclude from the editor */
|
|
229
211
|
excludeDefaults: e(
|
|
230
|
-
c(
|
|
212
|
+
c(N),
|
|
231
213
|
[]
|
|
232
214
|
),
|
|
233
215
|
/** Custom blocks to include in the editor */
|
|
234
216
|
includeCustoms: e(
|
|
235
|
-
c(
|
|
217
|
+
c(D),
|
|
236
218
|
[]
|
|
237
219
|
)
|
|
238
220
|
}), m = a({
|
|
@@ -241,8 +223,8 @@ const d = {
|
|
|
241
223
|
/** Human-readable description */
|
|
242
224
|
description: e(t()),
|
|
243
225
|
/** Priority for rule ordering (lower = earlier) */
|
|
244
|
-
priority:
|
|
245
|
-
}),
|
|
226
|
+
priority: s()
|
|
227
|
+
}), F = a({
|
|
246
228
|
...m.entries,
|
|
247
229
|
type: i("replace"),
|
|
248
230
|
/** String to search for */
|
|
@@ -251,7 +233,7 @@ const d = {
|
|
|
251
233
|
replacement: t(),
|
|
252
234
|
/** Replace all occurrences (default: false) */
|
|
253
235
|
replaceAll: e(o())
|
|
254
|
-
}),
|
|
236
|
+
}), U = a({
|
|
255
237
|
...m.entries,
|
|
256
238
|
type: i("regex"),
|
|
257
239
|
/** Regex pattern string */
|
|
@@ -260,87 +242,85 @@ const d = {
|
|
|
260
242
|
replacement: t(),
|
|
261
243
|
/** Regex flags (e.g., 'gi') */
|
|
262
244
|
flags: e(t())
|
|
263
|
-
}),
|
|
245
|
+
}), B = a({
|
|
264
246
|
...m.entries,
|
|
265
247
|
type: i("remove"),
|
|
266
248
|
/** Strings or patterns to remove */
|
|
267
249
|
targets: c(t())
|
|
268
|
-
}),
|
|
250
|
+
}), w = a({
|
|
269
251
|
...m.entries,
|
|
270
252
|
type: i("custom"),
|
|
271
253
|
/** Custom processor function */
|
|
272
|
-
processor:
|
|
254
|
+
processor: h(
|
|
273
255
|
(u) => typeof u == "function",
|
|
274
256
|
"processor must be a function"
|
|
275
257
|
)
|
|
276
|
-
}),
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
]),
|
|
258
|
+
}), H = g("type", [
|
|
259
|
+
F,
|
|
260
|
+
U,
|
|
261
|
+
B,
|
|
262
|
+
w
|
|
263
|
+
]), j = a({
|
|
282
264
|
/** Custom compiler rules to apply */
|
|
283
|
-
customRules: e(c(
|
|
265
|
+
customRules: e(c(H), []),
|
|
284
266
|
/** Skip default compiler rules */
|
|
285
267
|
ignoreDefaultRules: e(o(), !1)
|
|
286
|
-
}),
|
|
268
|
+
}), q = a({
|
|
287
269
|
/**
|
|
288
270
|
* External validation handler called before save completes.
|
|
289
271
|
* Return false to cancel the save operation.
|
|
290
272
|
*/
|
|
291
273
|
externalValidation: e(
|
|
292
|
-
|
|
274
|
+
h(
|
|
293
275
|
(u) => typeof u == "function",
|
|
294
276
|
"externalValidation must be a function"
|
|
295
277
|
)
|
|
296
278
|
)
|
|
297
|
-
}),
|
|
279
|
+
}), V = a({
|
|
298
280
|
// Required sections
|
|
299
281
|
/** Identity configuration (required) */
|
|
300
|
-
identity:
|
|
282
|
+
identity: R,
|
|
301
283
|
/** Partner configuration (required) */
|
|
302
|
-
partner:
|
|
284
|
+
partner: C,
|
|
303
285
|
// Optional sections (with defaults)
|
|
304
286
|
/** Template content and presets */
|
|
305
|
-
template: e(
|
|
287
|
+
template: e(P, {}),
|
|
306
288
|
/** Editor settings */
|
|
307
|
-
editor: e(
|
|
289
|
+
editor: e(E, {}),
|
|
308
290
|
/** UI configuration */
|
|
309
|
-
ui: e(
|
|
291
|
+
ui: e(M, {}),
|
|
310
292
|
/** Feature toggles */
|
|
311
|
-
features: e(
|
|
293
|
+
features: e(O, {}),
|
|
312
294
|
/** Block configuration */
|
|
313
|
-
blocks: e(
|
|
295
|
+
blocks: e(x, {}),
|
|
314
296
|
/** Compiler configuration */
|
|
315
|
-
compiler: e(
|
|
297
|
+
compiler: e(j, {}),
|
|
316
298
|
/** Callbacks and event handlers */
|
|
317
|
-
callbacks: e(
|
|
299
|
+
callbacks: e(q, {})
|
|
318
300
|
});
|
|
319
301
|
export {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
v as
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
A as IdentitySchema,
|
|
336
|
-
D as LegacyRecommendationConfigSchema,
|
|
302
|
+
x as BlocksSchema,
|
|
303
|
+
q as CallbacksSchema,
|
|
304
|
+
H as CompilerRuleSchema,
|
|
305
|
+
j as CompilerSchema,
|
|
306
|
+
D as CustomBlockTypeSchema,
|
|
307
|
+
w as CustomRuleSchema,
|
|
308
|
+
N as DefaultBlockTypeSchema,
|
|
309
|
+
A as DynamicContentSchema,
|
|
310
|
+
E as EditorSchema,
|
|
311
|
+
v as EmailHeaderSchema,
|
|
312
|
+
T as FallbackFontSchema,
|
|
313
|
+
O as FeaturesSchema,
|
|
314
|
+
V as GuidoConfigSchema,
|
|
315
|
+
R as IdentitySchema,
|
|
316
|
+
I as LegacyRecommendationConfigSchema,
|
|
337
317
|
d as MessageType,
|
|
338
|
-
|
|
318
|
+
C as PartnerSchema,
|
|
339
319
|
r as ProductType,
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
320
|
+
U as RegexRuleSchema,
|
|
321
|
+
B as RemoveRuleSchema,
|
|
322
|
+
F as ReplaceRuleSchema,
|
|
323
|
+
L as TemplateMigrationSchema,
|
|
324
|
+
P as TemplateSchema,
|
|
325
|
+
M as UISchema
|
|
346
326
|
};
|
|
@@ -1,45 +1,44 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import { useFullStoryBridge as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const e = w(), { html: f, css: a } = n, { baseBlocks: o, extensions: d } = await A(), g = ((S = c.value) == null ? void 0 : S.displayConditions) ?? !0, P = ((y = c.value) == null ? void 0 : y.modulesDisabled) ?? !1, I = ((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1;
|
|
1
|
+
import { useActionsApi as U } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as R } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as x } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as O } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useFullStoryBridge as q } from "./useFullStoryBridge.js";
|
|
6
|
+
import { useStripoEventHandler as H } from "./useStripoEventHandler.js";
|
|
7
|
+
import { useStripoNotifications as N } from "./useStripoNotifications.js";
|
|
8
|
+
import { useToaster as z } from "./useToaster.js";
|
|
9
|
+
import { localePatch as L } from "../config/i18n/index.js";
|
|
10
|
+
import { en as h } from "../config/i18n/en/index.js";
|
|
11
|
+
import { ToasterTypeOptions as $ } from "../enums/toaster.js";
|
|
12
|
+
import { useStripoApi as G } from "../services/stripoApi.js";
|
|
13
|
+
import J from "../static/styles/customEditorStyle.css.js";
|
|
14
|
+
import { useEditorStore as E } from "../stores/editor.js";
|
|
15
|
+
import { dynamicContentToMergeTags as X } from "../utils/genericUtil.js";
|
|
16
|
+
import j from "../package.json.js";
|
|
17
|
+
const fo = (C, l) => {
|
|
18
|
+
const { features: c, template: w, isFeatureEnabled: u } = x(), { handleError: m, showToaster: b } = z(), { getToken: T, getCustomFonts: k, getSyncModulesStatus: B } = G(), { handleEvent: F } = H(), { getStripoBlocksConfig: v } = R(), { getStripoNotifications: V } = N(), _ = async (s, i = [], r = !1) => {
|
|
19
|
+
var g, S, y;
|
|
20
|
+
const o = E(), { html: p, css: a } = s, { baseBlocks: t, extensions: d } = await v(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, M = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, P = ((y = w.value) == null ? void 0 : y.forceRecreate) ?? !1;
|
|
22
21
|
await window.UIEditor.initEditor(
|
|
23
22
|
document.querySelector("#guido-editor"),
|
|
24
23
|
{
|
|
25
|
-
metadata:
|
|
26
|
-
html:
|
|
24
|
+
metadata: C,
|
|
25
|
+
html: p,
|
|
27
26
|
css: a,
|
|
28
|
-
forceRecreate:
|
|
27
|
+
forceRecreate: P,
|
|
29
28
|
locale: "en",
|
|
30
29
|
undoButtonSelector: "#guido__undo-button",
|
|
31
30
|
redoButtonSelector: "#guido__redo-button",
|
|
32
31
|
mobileViewButtonSelector: ".guido__view-option-selection-mobile",
|
|
33
32
|
desktopViewButtonSelector: ".guido__view-option-selection-desktop",
|
|
34
33
|
codeEditorButtonSelector: "#guido__code-button",
|
|
35
|
-
customAppearanceMergetags: !
|
|
34
|
+
customAppearanceMergetags: !u("liquidSyntax"),
|
|
36
35
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
37
36
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
38
|
-
customViewStyles:
|
|
39
|
-
conditionsEnabled:
|
|
40
|
-
customConditionsEnabled:
|
|
37
|
+
customViewStyles: J,
|
|
38
|
+
conditionsEnabled: f,
|
|
39
|
+
customConditionsEnabled: f,
|
|
41
40
|
enableXSSSecurity: !0,
|
|
42
|
-
modulesDisabled:
|
|
41
|
+
modulesDisabled: M,
|
|
43
42
|
syncModulesEnabled: r,
|
|
44
43
|
messageSettingsEnabled: !0,
|
|
45
44
|
displayGmailAnnotations: !0,
|
|
@@ -49,7 +48,7 @@ const he = (b, l) => {
|
|
|
49
48
|
selectElementAfterDrop: !0,
|
|
50
49
|
sameFontSizeForOutlook: !0,
|
|
51
50
|
allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
|
|
52
|
-
...
|
|
51
|
+
...t ? { baseBlocks: t } : {},
|
|
53
52
|
editorFonts: {
|
|
54
53
|
showDefaultStandardFonts: !0,
|
|
55
54
|
showDefaultNotStandardFonts: !0,
|
|
@@ -57,45 +56,43 @@ const he = (b, l) => {
|
|
|
57
56
|
},
|
|
58
57
|
mergeTags: [
|
|
59
58
|
{
|
|
60
|
-
entries:
|
|
59
|
+
entries: X(
|
|
61
60
|
l.preselectedDynamicContentList,
|
|
62
|
-
|
|
63
|
-
m("liquidSyntax")
|
|
61
|
+
u("liquidSyntax")
|
|
64
62
|
)
|
|
65
63
|
}
|
|
66
64
|
],
|
|
67
|
-
async onTokenRefreshRequest(
|
|
65
|
+
async onTokenRefreshRequest(e) {
|
|
68
66
|
try {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
} catch (
|
|
72
|
-
|
|
67
|
+
const n = await T();
|
|
68
|
+
e(n);
|
|
69
|
+
} catch (n) {
|
|
70
|
+
m(n, "Failed to refresh token");
|
|
73
71
|
}
|
|
74
72
|
},
|
|
75
73
|
onTemplateLoaded() {
|
|
76
74
|
try {
|
|
77
|
-
const { importCss:
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
const { importCss: e } = O(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: D } = U(), { injectFullStory: I } = q();
|
|
76
|
+
e(), n(), I(), D(), l.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
|
|
77
|
+
o.hasChanges = !1;
|
|
80
78
|
}, 1e3);
|
|
81
|
-
} catch (
|
|
82
|
-
|
|
79
|
+
} catch (e) {
|
|
80
|
+
m(e, "Failed to load custom interface appearance");
|
|
83
81
|
}
|
|
84
82
|
},
|
|
85
|
-
onCodeEditorVisibilityChanged(
|
|
86
|
-
|
|
83
|
+
onCodeEditorVisibilityChanged(e) {
|
|
84
|
+
o.isCodeEditorOpen = e;
|
|
87
85
|
},
|
|
88
|
-
onEditorVisualModeChanged(
|
|
89
|
-
|
|
86
|
+
onEditorVisualModeChanged(e) {
|
|
87
|
+
o.editorVisualMode = e.toLowerCase();
|
|
90
88
|
},
|
|
91
|
-
onVersionHistoryVisibilityChanged(
|
|
92
|
-
|
|
89
|
+
onVersionHistoryVisibilityChanged(e) {
|
|
90
|
+
o.isVersionHistoryOpen = e;
|
|
93
91
|
},
|
|
94
92
|
onDataChanged() {
|
|
95
|
-
|
|
93
|
+
o.hasChanges = !0;
|
|
96
94
|
},
|
|
97
95
|
onEvent: F,
|
|
98
|
-
onModuleAdd: M,
|
|
99
96
|
notifications: V(),
|
|
100
97
|
ignoreClickOutsideSelectors: [
|
|
101
98
|
"#guido-dynamic-content-modal",
|
|
@@ -103,38 +100,38 @@ const he = (b, l) => {
|
|
|
103
100
|
".in-drawer__container"
|
|
104
101
|
],
|
|
105
102
|
extensions: d,
|
|
106
|
-
localePatch:
|
|
103
|
+
localePatch: L
|
|
107
104
|
}
|
|
108
105
|
);
|
|
109
|
-
},
|
|
106
|
+
}, A = (s) => new Promise((i, r) => {
|
|
110
107
|
var d;
|
|
111
108
|
if (document.getElementById("UiEditorScript")) {
|
|
112
|
-
Promise.resolve(
|
|
109
|
+
Promise.resolve(s()).then(i, r);
|
|
113
110
|
return;
|
|
114
111
|
}
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
Promise.resolve(
|
|
118
|
-
},
|
|
112
|
+
const o = j.guido, a = `https://email-static.useinsider.com/guido/${(d = o == null ? void 0 : o.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
|
|
113
|
+
t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
|
|
114
|
+
Promise.resolve(s()).then(i, r);
|
|
115
|
+
}, t.onerror = () => {
|
|
119
116
|
r(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
120
|
-
}, document.body.appendChild(
|
|
117
|
+
}, document.body.appendChild(t);
|
|
121
118
|
});
|
|
122
|
-
return { initPlugin: async (
|
|
123
|
-
const i =
|
|
119
|
+
return { initPlugin: async (s) => {
|
|
120
|
+
const i = E();
|
|
124
121
|
try {
|
|
125
|
-
await
|
|
126
|
-
const [r,
|
|
127
|
-
|
|
122
|
+
await A(async () => {
|
|
123
|
+
const [r, o] = await Promise.all([
|
|
124
|
+
k(),
|
|
128
125
|
B()
|
|
129
126
|
]);
|
|
130
|
-
i.syncModulesEnabled =
|
|
127
|
+
i.syncModulesEnabled = o, await _(s, r, o);
|
|
131
128
|
});
|
|
132
129
|
} catch {
|
|
133
|
-
i.loadingStatus = !1,
|
|
134
|
-
type:
|
|
135
|
-
message:
|
|
130
|
+
i.loadingStatus = !1, b({
|
|
131
|
+
type: $.Error,
|
|
132
|
+
message: h["An error has occurred. Please report the error code to support."],
|
|
136
133
|
actionButton: {
|
|
137
|
-
text:
|
|
134
|
+
text: h["Reload page"],
|
|
138
135
|
onClick: () => window.location.reload()
|
|
139
136
|
}
|
|
140
137
|
});
|
|
@@ -142,5 +139,5 @@ const he = (b, l) => {
|
|
|
142
139
|
} };
|
|
143
140
|
};
|
|
144
141
|
export {
|
|
145
|
-
|
|
142
|
+
fo as useStripo
|
|
146
143
|
};
|