@useinsider/guido 3.15.1-beta.6da4177 → 3.16.0-beta.20cd2fe
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 +118 -100
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +78 -75
- package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
- package/dist/components/organisms/header/AutoSaveStatus.vue2.js +21 -0
- package/dist/components/organisms/header/EditorActions.vue.js +11 -11
- package/dist/components/organisms/header/EditorActions.vue2.js +34 -50
- package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
- package/dist/components/organisms/header/EditorActionsMenu.vue2.js +39 -0
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
- package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
- package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
- package/dist/components/organisms/header/RightSlot.vue.js +6 -6
- package/dist/components/organisms/header/RightSlot.vue2.js +17 -15
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +24 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +18 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +74 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +43 -34
- package/dist/composables/useAccessibilityApi.js +31 -0
- package/dist/composables/useActionsApi.js +30 -22
- package/dist/composables/useEmailTemplateApplier.js +25 -23
- package/dist/composables/useHtmlValidator.js +85 -83
- package/dist/composables/useTimerClone.js +21 -19
- package/dist/config/i18n/en/labels.json.js +28 -4
- package/dist/config/migrator/checkboxMigrator.js +20 -19
- package/dist/config/migrator/radioButtonMigrator.js +26 -25
- 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/controls/cardBackground/index.js +5 -9
- 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/controlFactories.js +117 -115
- package/dist/guido.css +1 -1
- package/dist/library.js +11 -7
- package/dist/node_modules/@vueuse/core/index.js +102 -0
- package/dist/node_modules/@vueuse/shared/index.js +40 -28
- 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 +24 -0
- package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
- package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
- package/dist/src/composables/useAccessibilityApi.d.ts +15 -0
- package/dist/src/composables/useActionsApi.d.ts +3 -3
- package/dist/src/composables/useConfig.d.ts +6 -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/controls/spacing/index.d.ts +5 -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/library.d.ts +1 -0
- package/dist/src/public/trackingIds.d.ts +9 -0
- package/dist/src/stores/config.d.ts +54 -0
- package/dist/src/stores/editor.d.ts +132 -0
- package/dist/src/stores/onboarding.d.ts +377 -0
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/linkTrackingIds.d.ts +30 -0
- package/dist/src/utils/timeUtil.d.ts +10 -0
- package/dist/stores/editor.js +9 -2
- package/dist/stores/onboarding.js +23 -14
- package/dist/utils/linkTrackingIds.js +56 -0
- package/dist/utils/pairProductVariables.js +105 -99
- package/dist/utils/templatePreparation.js +72 -61
- package/dist/utils/timeUtil.js +6 -17
- package/package.json +5 -1
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
- /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → AutoSaveStatus.vue.d.ts} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
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 S } from "../../enums/defaults.js";
|
|
2
|
+
import { object as a, number as n, optional as e, string as t, picklist as l, pipe as m, minLength as b, custom as y, boolean as o, array as c, transform as C, record as k, 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 */
|
|
7
7
|
TRANSACTIONAL: 2
|
|
8
|
-
},
|
|
8
|
+
}, i = {
|
|
9
9
|
/** Standard email campaigns */
|
|
10
10
|
EMAIL: 60,
|
|
11
11
|
/** Architect journey builder */
|
|
@@ -14,47 +14,47 @@ 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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
l([
|
|
42
|
+
i.EMAIL,
|
|
43
|
+
i.ARCHITECT,
|
|
44
|
+
i.UNSUBSCRIBE_PAGES
|
|
45
45
|
]),
|
|
46
|
-
|
|
46
|
+
i.EMAIL
|
|
47
47
|
),
|
|
48
48
|
/** Message type (promotional or transactional) */
|
|
49
49
|
messageType: e(
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
l([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,40 +68,40 @@ const d = {
|
|
|
68
68
|
value: t()
|
|
69
69
|
})
|
|
70
70
|
)
|
|
71
|
-
}),
|
|
71
|
+
}), f = I(() => g({
|
|
72
72
|
text: e(t()),
|
|
73
73
|
// eslint-disable-next-line camelcase -- backend field name
|
|
74
74
|
tag_text: e(t()),
|
|
75
75
|
value: e(t()),
|
|
76
|
-
children: e(c(
|
|
76
|
+
children: e(c(f)),
|
|
77
77
|
// eslint-disable-next-line camelcase -- backend field name
|
|
78
|
-
select_items: e(c(
|
|
79
|
-
})),
|
|
78
|
+
select_items: e(c(f))
|
|
79
|
+
})), N = k(
|
|
80
80
|
t(),
|
|
81
|
-
|
|
81
|
+
R(c(f), [])
|
|
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
|
|
@@ -135,14 +135,14 @@ const d = {
|
|
|
135
135
|
k(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(), S.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(), S.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 */
|
|
@@ -202,9 +216,13 @@ const d = {
|
|
|
202
216
|
liquidSyntax: e(o(), !1),
|
|
203
217
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
204
218
|
autosave: e(o(), !1),
|
|
219
|
+
/** Enable the Stripo Accessibility Checker control in the editor toolbar. */
|
|
220
|
+
accessibilityTesting: e(o(), !1),
|
|
205
221
|
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
206
|
-
allowlistEnabled: e(o(), !1)
|
|
207
|
-
|
|
222
|
+
allowlistEnabled: e(o(), !1),
|
|
223
|
+
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
224
|
+
linkTrackingIds: e(o(), !1)
|
|
225
|
+
}), B = l([
|
|
208
226
|
"amp-accordion",
|
|
209
227
|
"amp-carousel",
|
|
210
228
|
"amp-form-controls",
|
|
@@ -218,7 +236,7 @@ const d = {
|
|
|
218
236
|
"text-block",
|
|
219
237
|
"timer-block",
|
|
220
238
|
"video-block"
|
|
221
|
-
]),
|
|
239
|
+
]), w = l([
|
|
222
240
|
"dynamic-content",
|
|
223
241
|
"checkbox-block",
|
|
224
242
|
"radio-button-block",
|
|
@@ -226,123 +244,123 @@ const d = {
|
|
|
226
244
|
"unsubscribe-block",
|
|
227
245
|
"coupon-block",
|
|
228
246
|
"items-block"
|
|
229
|
-
]),
|
|
247
|
+
]), H = a({
|
|
230
248
|
/** Default blocks to exclude from the editor */
|
|
231
249
|
excludeDefaults: e(
|
|
232
|
-
c(
|
|
250
|
+
c(B),
|
|
233
251
|
[]
|
|
234
252
|
),
|
|
235
253
|
/** Custom blocks to include in the editor */
|
|
236
254
|
includeCustoms: e(
|
|
237
|
-
c(
|
|
255
|
+
c(w),
|
|
238
256
|
[]
|
|
239
257
|
)
|
|
240
|
-
}),
|
|
258
|
+
}), d = a({
|
|
241
259
|
/** Unique identifier for the rule */
|
|
242
260
|
id: t(),
|
|
243
261
|
/** Human-readable description */
|
|
244
262
|
description: e(t()),
|
|
245
263
|
/** Priority for rule ordering (lower = earlier) */
|
|
246
264
|
priority: n()
|
|
247
|
-
}),
|
|
248
|
-
...
|
|
249
|
-
type:
|
|
265
|
+
}), _ = a({
|
|
266
|
+
...d.entries,
|
|
267
|
+
type: u("replace"),
|
|
250
268
|
/** String to search for */
|
|
251
269
|
search: t(),
|
|
252
270
|
/** Replacement string */
|
|
253
271
|
replacement: t(),
|
|
254
272
|
/** Replace all occurrences (default: false) */
|
|
255
273
|
replaceAll: e(o())
|
|
256
|
-
}),
|
|
257
|
-
...
|
|
258
|
-
type:
|
|
274
|
+
}), j = a({
|
|
275
|
+
...d.entries,
|
|
276
|
+
type: u("regex"),
|
|
259
277
|
/** Regex pattern string */
|
|
260
278
|
pattern: t(),
|
|
261
279
|
/** Replacement string (supports $1, $2, etc.) */
|
|
262
280
|
replacement: t(),
|
|
263
281
|
/** Regex flags (e.g., 'gi') */
|
|
264
282
|
flags: e(t())
|
|
265
|
-
}),
|
|
266
|
-
...
|
|
267
|
-
type:
|
|
283
|
+
}), q = a({
|
|
284
|
+
...d.entries,
|
|
285
|
+
type: u("remove"),
|
|
268
286
|
/** Strings or patterns to remove */
|
|
269
287
|
targets: c(t())
|
|
270
|
-
}),
|
|
271
|
-
...
|
|
272
|
-
type:
|
|
288
|
+
}), G = a({
|
|
289
|
+
...d.entries,
|
|
290
|
+
type: u("custom"),
|
|
273
291
|
/** Custom processor function */
|
|
274
|
-
processor:
|
|
275
|
-
(
|
|
292
|
+
processor: y(
|
|
293
|
+
(s) => typeof s == "function",
|
|
276
294
|
"processor must be a function"
|
|
277
295
|
)
|
|
278
|
-
}),
|
|
279
|
-
H,
|
|
296
|
+
}), V = T("type", [
|
|
280
297
|
_,
|
|
281
298
|
j,
|
|
282
|
-
q
|
|
283
|
-
|
|
299
|
+
q,
|
|
300
|
+
G
|
|
301
|
+
]), z = a({
|
|
284
302
|
/** Custom compiler rules to apply */
|
|
285
|
-
customRules: e(c(
|
|
303
|
+
customRules: e(c(V), []),
|
|
286
304
|
/** Skip default compiler rules */
|
|
287
305
|
ignoreDefaultRules: e(o(), !1)
|
|
288
|
-
}),
|
|
306
|
+
}), Z = a({
|
|
289
307
|
/**
|
|
290
308
|
* External validation handler called before save completes.
|
|
291
309
|
* Return false to cancel the save operation.
|
|
292
310
|
*/
|
|
293
311
|
externalValidation: e(
|
|
294
|
-
|
|
295
|
-
(
|
|
312
|
+
y(
|
|
313
|
+
(s) => typeof s == "function",
|
|
296
314
|
"externalValidation must be a function"
|
|
297
315
|
)
|
|
298
316
|
)
|
|
299
|
-
}),
|
|
317
|
+
}), Q = a({
|
|
300
318
|
// Required sections
|
|
301
319
|
/** Identity configuration (required) */
|
|
302
320
|
identity: A,
|
|
303
321
|
/** Partner configuration (required) */
|
|
304
|
-
partner:
|
|
322
|
+
partner: M,
|
|
305
323
|
// Optional sections (with defaults)
|
|
306
324
|
/** Template content and presets */
|
|
307
|
-
template: e(
|
|
325
|
+
template: e(x, {}),
|
|
308
326
|
/** Editor settings */
|
|
309
327
|
editor: e(O, {}),
|
|
310
328
|
/** UI configuration */
|
|
311
|
-
ui: e(
|
|
329
|
+
ui: e(F, {}),
|
|
312
330
|
/** Feature toggles */
|
|
313
|
-
features: e(
|
|
331
|
+
features: e(U, {}),
|
|
314
332
|
/** Block configuration */
|
|
315
|
-
blocks: e(
|
|
333
|
+
blocks: e(H, {}),
|
|
316
334
|
/** Compiler configuration */
|
|
317
|
-
compiler: e(
|
|
335
|
+
compiler: e(z, {}),
|
|
318
336
|
/** Callbacks and event handlers */
|
|
319
|
-
callbacks: e(
|
|
337
|
+
callbacks: e(Z, {})
|
|
320
338
|
});
|
|
321
339
|
export {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
340
|
+
H as BlocksSchema,
|
|
341
|
+
Z as CallbacksSchema,
|
|
342
|
+
V as CompilerRuleSchema,
|
|
343
|
+
z as CompilerSchema,
|
|
344
|
+
w as CustomBlockTypeSchema,
|
|
345
|
+
G as CustomRuleSchema,
|
|
346
|
+
B as DefaultBlockTypeSchema,
|
|
347
|
+
N as DynamicContentListSchema,
|
|
348
|
+
f as DynamicContentNodeSchema,
|
|
349
|
+
E as DynamicContentSchema,
|
|
332
350
|
O as EditorSchema,
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
351
|
+
D as EmailHeaderSchema,
|
|
352
|
+
L as FallbackFontSchema,
|
|
353
|
+
U as FeaturesSchema,
|
|
354
|
+
Q as GuidoConfigSchema,
|
|
337
355
|
A as IdentitySchema,
|
|
338
356
|
P as LegacyRecommendationConfigSchema,
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
357
|
+
p as MessageType,
|
|
358
|
+
M as PartnerSchema,
|
|
359
|
+
i as ProductType,
|
|
360
|
+
j as RegexRuleSchema,
|
|
361
|
+
q as RemoveRuleSchema,
|
|
362
|
+
_ as ReplaceRuleSchema,
|
|
363
|
+
v as TemplateMigrationSchema,
|
|
364
|
+
x as TemplateSchema,
|
|
365
|
+
F as UISchema
|
|
348
366
|
};
|
|
@@ -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
|
};
|