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