@useinsider/guido 3.21.2 → 3.22.0-beta.0523ffa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -4
- package/dist/@types/config/schemas.js +41 -39
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +118 -108
- package/dist/composables/useActionsApi.js +22 -21
- package/dist/composables/useEditorOpenMetrics.js +167 -0
- package/dist/composables/useFullStoryBridge.js +10 -9
- package/dist/composables/useSave.js +75 -68
- package/dist/composables/useStripo.js +94 -82
- package/dist/composables/validators/useHtmlDocumentCountValidator.js +22 -0
- package/dist/config/migrator/fullStoryScriptMigrator.js +5 -0
- package/dist/config/migrator/index.js +11 -10
- package/dist/guido.css +1 -1
- package/dist/library.js +12 -10
- package/dist/package.json.js +6 -4
- package/dist/public/prefetchRuntime.js +4 -0
- package/dist/services/templateLibraryApi.js +36 -31
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useEditorOpenMetrics.d.ts +27 -0
- package/dist/src/composables/useStripo.d.ts +2 -1
- package/dist/src/composables/validators/useHtmlDocumentCountValidator.d.ts +3 -0
- package/dist/src/config/migrator/fullStoryScriptMigrator.d.ts +1 -0
- package/dist/src/library.d.ts +1 -0
- package/dist/src/public/prefetchRuntime.d.ts +1 -0
- package/dist/src/stores/config.d.ts +20 -0
- package/dist/src/utils/fullStoryScripts.d.ts +6 -0
- package/dist/src/utils/runtimePrefetch.d.ts +4 -0
- package/dist/src/utils/stripoRuntime.d.ts +3 -0
- package/dist/src/utils/templatePreparation.d.ts +2 -1
- package/dist/static/stripo-runtime-manifest.json.js +9 -0
- package/dist/utils/fullStoryScripts.js +8 -0
- package/dist/utils/pairProductVariables.js +98 -90
- package/dist/utils/runtimePrefetch.js +26 -0
- package/dist/utils/stripoRuntime.js +13 -0
- package/dist/utils/templatePreparation.js +30 -30
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -161,6 +161,7 @@ const config: GuidoConfigInput = {
|
|
|
161
161
|
displayConditions?: boolean, // Default: true
|
|
162
162
|
unsubscribe?: boolean, // Default: true
|
|
163
163
|
modulesDisabled?: boolean, // Default: false - Disable modules panel
|
|
164
|
+
buttonTextDecorationsEnabled?: boolean, // Default: false - Show Underline and Strikethrough in the Button block's Text Style settings
|
|
164
165
|
liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
|
|
165
166
|
autosave?: boolean, // Default: false - Show the Auto Save toggle in the header. See wiki/AUTOSAVE.md.
|
|
166
167
|
allowlistEnabled?: boolean, // Default: false - Pre-save domain-allowlist check (opt-in). Guido self-serves the block toaster (role lookup, deep-link, copy from window.trans).
|
|
@@ -582,9 +583,9 @@ import '@useinsider/guido/style';
|
|
|
582
583
|
|
|
583
584
|
### Subpath entries
|
|
584
585
|
|
|
585
|
-
|
|
586
|
-
own dependencies, so a consumer that needs the store
|
|
587
|
-
never loads the editor:
|
|
586
|
+
Three surfaces also ship as their own entry points. Importing one pulls in only its
|
|
587
|
+
own dependencies, so a consumer that needs the store, the tracking-id helpers or the
|
|
588
|
+
runtime prefetch never loads the editor:
|
|
588
589
|
|
|
589
590
|
```typescript
|
|
590
591
|
// Live editor state, published by the editor into the host's shared Pinia instance.
|
|
@@ -595,11 +596,42 @@ import type { GuidoEmailEditorState } from '@useinsider/guido/editor-state';
|
|
|
595
596
|
// Persistent link ids for the click heatmap.
|
|
596
597
|
import { assignTrackingIds, TRACK_ID_ATTRIBUTE } from '@useinsider/guido/tracking-ids';
|
|
597
598
|
import type { TrackingIdResult } from '@useinsider/guido/tracking-ids';
|
|
599
|
+
|
|
600
|
+
// Start downloading the Stripo editor runtime before the editor opens.
|
|
601
|
+
import { prefetchGuidoRuntime } from '@useinsider/guido/prefetch';
|
|
598
602
|
```
|
|
599
603
|
|
|
600
|
-
|
|
604
|
+
All three are re-exported from the root barrel as well; the subpath is what keeps the
|
|
601
605
|
editor out of the consumer's module graph.
|
|
602
606
|
|
|
607
|
+
### Runtime prefetch
|
|
608
|
+
|
|
609
|
+
```typescript
|
|
610
|
+
import { prefetchGuidoRuntime } from '@useinsider/guido/prefetch';
|
|
611
|
+
|
|
612
|
+
prefetchGuidoRuntime(); // e.g. when the user lands on the page that opens the editor
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
Call it as early as the host knows an editor is likely to open. It appends one
|
|
616
|
+
`<link rel="prefetch" data-guido-prefetch>` per file of the pinned Stripo runtime
|
|
617
|
+
(`src/static/stripo-runtime-manifest.json`) from
|
|
618
|
+
`https://email-static.useinsider.com/guido/<stripo version>/`, so the files are in the
|
|
619
|
+
HTTP cache when `<Guido>` mounts. It only downloads: no Stripo code runs and the
|
|
620
|
+
editor's startup order does not change.
|
|
621
|
+
|
|
622
|
+
- Returns `void` and never throws.
|
|
623
|
+
- Idempotent: later calls add nothing.
|
|
624
|
+
- Adds nothing when the runtime is already loading or loaded (`#UiEditorScript` exists
|
|
625
|
+
or `window.UIEditor` is defined), when the browser does not support `rel="prefetch"`
|
|
626
|
+
(Safari by default), when `navigator.connection.saveData` is on, or when
|
|
627
|
+
`navigator.connection.effectiveType` is `slow-2g` or `2g`.
|
|
628
|
+
- The `guido_editor_open` metric reports it as `runtime_prefetch`: `none` (not called
|
|
629
|
+
before Guido's setup), `pending` (some files still downloading) or `done`.
|
|
630
|
+
|
|
631
|
+
After bumping `guido.stripo.version`, regenerate the file list with
|
|
632
|
+
`npm run stripo:manifest`; a unit test fails while the manifest's version differs from
|
|
633
|
+
the pinned one.
|
|
634
|
+
|
|
603
635
|
---
|
|
604
636
|
|
|
605
637
|
## Constants
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ModuleFolderDefaults as
|
|
2
|
-
import { object as a, number as s, optional as e, string as t, picklist as m, pipe as i, minLength as b, custom as k, boolean as o, array 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 m, pipe as i, minLength as b, custom as k, boolean as o, array as n, transform as y, unknown as r, record as g, fallback as R, literal as u, looseObject as C, variant as T, union as h, lazy as I } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const p = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -76,30 +76,30 @@ const p = {
|
|
|
76
76
|
value: t()
|
|
77
77
|
})
|
|
78
78
|
)
|
|
79
|
-
}),
|
|
79
|
+
}), f = I(() => C({
|
|
80
80
|
text: e(t()),
|
|
81
81
|
// eslint-disable-next-line camelcase -- backend field name
|
|
82
82
|
tag_text: e(t()),
|
|
83
83
|
value: e(t()),
|
|
84
|
-
children: e(
|
|
84
|
+
children: e(n(f)),
|
|
85
85
|
// eslint-disable-next-line camelcase -- backend field name
|
|
86
|
-
select_items: e(
|
|
87
|
-
})),
|
|
86
|
+
select_items: e(n(f))
|
|
87
|
+
})), x = g(
|
|
88
88
|
t(),
|
|
89
|
-
R(
|
|
90
|
-
),
|
|
89
|
+
R(n(f), [])
|
|
90
|
+
), D = C({
|
|
91
91
|
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
92
92
|
id: e(s()),
|
|
93
93
|
/** Decimal places for price display (legacy data may use string or number) */
|
|
94
94
|
decimalCount: e(h([t(), s()])),
|
|
95
95
|
/** Pinned product IDs (empty array when filter-driven) */
|
|
96
|
-
productIds: e(
|
|
96
|
+
productIds: e(n(r())),
|
|
97
97
|
/** Whether the block requested live products at send time */
|
|
98
98
|
sendProductRequestFlag: e(o()),
|
|
99
99
|
/** Whether to randomize product order */
|
|
100
100
|
shuffleProducts: e(o()),
|
|
101
101
|
/** Filter rules driving product selection */
|
|
102
|
-
filters: e(
|
|
102
|
+
filters: e(n(r())),
|
|
103
103
|
/** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
|
|
104
104
|
currency: e(t()),
|
|
105
105
|
/** Currency display settings (separators, alignment, decimals) */
|
|
@@ -109,7 +109,7 @@ const p = {
|
|
|
109
109
|
/** Recommendation strategy key (e.g. 'newArrivals') */
|
|
110
110
|
strategy: e(t()),
|
|
111
111
|
/** Snapshot of products as rendered by the legacy block */
|
|
112
|
-
recommendedProducts: e(
|
|
112
|
+
recommendedProducts: e(n(r())),
|
|
113
113
|
/** Number of product cards per row */
|
|
114
114
|
cardsInRow: e(s()),
|
|
115
115
|
/** Mobile-only padding (right) */
|
|
@@ -132,7 +132,7 @@ const p = {
|
|
|
132
132
|
isPriceMovedToNextLine: e(o()),
|
|
133
133
|
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
134
134
|
isPriceDeletedForZeroSale: e(o())
|
|
135
|
-
}),
|
|
135
|
+
}), N = a({
|
|
136
136
|
/**
|
|
137
137
|
* Legacy recommendation block configs keyed by block ID.
|
|
138
138
|
* Pass this when loading a template authored with the v1
|
|
@@ -140,17 +140,17 @@ const p = {
|
|
|
140
140
|
* strategy, currency, locale, and layout data.
|
|
141
141
|
*/
|
|
142
142
|
recommendationConfigs: e(
|
|
143
|
-
g(t(),
|
|
143
|
+
g(t(), D),
|
|
144
144
|
{}
|
|
145
145
|
)
|
|
146
|
-
}),
|
|
146
|
+
}), P = a({
|
|
147
147
|
/** Initial HTML content */
|
|
148
148
|
html: e(t(), ""),
|
|
149
149
|
/** Initial CSS content */
|
|
150
150
|
css: e(t(), ""),
|
|
151
151
|
/** Preselected dynamic content items */
|
|
152
152
|
preselectedDynamicContent: e(
|
|
153
|
-
|
|
153
|
+
n(M),
|
|
154
154
|
[]
|
|
155
155
|
),
|
|
156
156
|
/**
|
|
@@ -159,11 +159,11 @@ const p = {
|
|
|
159
159
|
* (first) partner's leaf attributes into the label→token map that repairs
|
|
160
160
|
* label-form placeholders (`{{ Phone Number }}`) in dropped saved modules.
|
|
161
161
|
*/
|
|
162
|
-
dynamicContentList: e(
|
|
162
|
+
dynamicContentList: e(x, {}),
|
|
163
163
|
/** Valid custom field attribute names from the partner's categorized fields */
|
|
164
|
-
customFieldAttributes: e(
|
|
164
|
+
customFieldAttributes: e(n(t()), []),
|
|
165
165
|
/** Selected unsubscribe page IDs */
|
|
166
|
-
selectedUnsubscribePages: e(
|
|
166
|
+
selectedUnsubscribePages: e(n(s()), []),
|
|
167
167
|
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
168
168
|
forceRecreate: e(o(), !1),
|
|
169
169
|
/**
|
|
@@ -176,7 +176,7 @@ const p = {
|
|
|
176
176
|
trackIdCounter: e(
|
|
177
177
|
i(
|
|
178
178
|
s(),
|
|
179
|
-
y((
|
|
179
|
+
y((c) => Number.isFinite(c) ? Math.max(0, Math.floor(c)) : 0)
|
|
180
180
|
),
|
|
181
181
|
0
|
|
182
182
|
),
|
|
@@ -190,12 +190,12 @@ const p = {
|
|
|
190
190
|
recommendationCampaignUrls: e(
|
|
191
191
|
i(
|
|
192
192
|
r(),
|
|
193
|
-
y((
|
|
193
|
+
y((c) => c && typeof c == "object" ? { ...c } : void 0)
|
|
194
194
|
)
|
|
195
195
|
),
|
|
196
196
|
/** Migration-only inputs (legacy block configs) */
|
|
197
|
-
migration: e(
|
|
198
|
-
}),
|
|
197
|
+
migration: e(N, {})
|
|
198
|
+
}), v = a({
|
|
199
199
|
/** Sender display name */
|
|
200
200
|
senderName: e(t(), ""),
|
|
201
201
|
/** Email subject line */
|
|
@@ -208,11 +208,11 @@ const p = {
|
|
|
208
208
|
/** Migration date for template compatibility */
|
|
209
209
|
migrationDate: e(s(), 1759696858),
|
|
210
210
|
/** Email header settings */
|
|
211
|
-
emailHeader: e(
|
|
211
|
+
emailHeader: e(v, { senderName: "", subject: "" }),
|
|
212
212
|
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
213
|
-
savedModulesFolderName: e(t(),
|
|
213
|
+
savedModulesFolderName: e(t(), S.SAVED_MODULES),
|
|
214
214
|
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
215
|
-
defaultModulesFolderName: e(t(),
|
|
215
|
+
defaultModulesFolderName: e(t(), S.DEFAULT_MODULES)
|
|
216
216
|
}), F = a({
|
|
217
217
|
/** Whether to show the header bar */
|
|
218
218
|
showHeader: e(o(), !0),
|
|
@@ -233,6 +233,8 @@ const p = {
|
|
|
233
233
|
unsubscribe: e(o(), !0),
|
|
234
234
|
/** Disable modules panel in the editor */
|
|
235
235
|
modulesDisabled: e(o(), !1),
|
|
236
|
+
/** Show Underline and Strikethrough in the Button block's Text Style settings */
|
|
237
|
+
buttonTextDecorationsEnabled: e(o(), !1),
|
|
236
238
|
/** Enable Liquid template syntax */
|
|
237
239
|
liquidSyntax: e(o(), !1),
|
|
238
240
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
@@ -269,12 +271,12 @@ const p = {
|
|
|
269
271
|
]), j = a({
|
|
270
272
|
/** Default blocks to exclude from the editor */
|
|
271
273
|
excludeDefaults: e(
|
|
272
|
-
|
|
274
|
+
n(w),
|
|
273
275
|
[]
|
|
274
276
|
),
|
|
275
277
|
/** Custom blocks to include in the editor */
|
|
276
278
|
includeCustoms: e(
|
|
277
|
-
|
|
279
|
+
n(B),
|
|
278
280
|
[]
|
|
279
281
|
)
|
|
280
282
|
}), d = a({
|
|
@@ -306,23 +308,23 @@ const p = {
|
|
|
306
308
|
...d.entries,
|
|
307
309
|
type: u("remove"),
|
|
308
310
|
/** Strings or patterns to remove */
|
|
309
|
-
targets:
|
|
311
|
+
targets: n(t())
|
|
310
312
|
}), G = a({
|
|
311
313
|
...d.entries,
|
|
312
314
|
type: u("custom"),
|
|
313
315
|
/** Custom processor function */
|
|
314
316
|
processor: k(
|
|
315
|
-
(
|
|
317
|
+
(c) => typeof c == "function",
|
|
316
318
|
"processor must be a function"
|
|
317
319
|
)
|
|
318
|
-
}), V =
|
|
320
|
+
}), V = T("type", [
|
|
319
321
|
H,
|
|
320
322
|
_,
|
|
321
323
|
q,
|
|
322
324
|
G
|
|
323
325
|
]), z = a({
|
|
324
326
|
/** Custom compiler rules to apply */
|
|
325
|
-
customRules: e(
|
|
327
|
+
customRules: e(n(V), []),
|
|
326
328
|
/** Skip default compiler rules */
|
|
327
329
|
ignoreDefaultRules: e(o(), !1)
|
|
328
330
|
}), W = a({
|
|
@@ -332,7 +334,7 @@ const p = {
|
|
|
332
334
|
*/
|
|
333
335
|
externalValidation: e(
|
|
334
336
|
k(
|
|
335
|
-
(
|
|
337
|
+
(c) => typeof c == "function",
|
|
336
338
|
"externalValidation must be a function"
|
|
337
339
|
)
|
|
338
340
|
)
|
|
@@ -344,7 +346,7 @@ const p = {
|
|
|
344
346
|
partner: E,
|
|
345
347
|
// Optional sections (with defaults)
|
|
346
348
|
/** Template content and presets */
|
|
347
|
-
template: e(
|
|
349
|
+
template: e(P, {}),
|
|
348
350
|
/** Editor settings */
|
|
349
351
|
editor: e(O, {}),
|
|
350
352
|
/** UI configuration */
|
|
@@ -366,23 +368,23 @@ export {
|
|
|
366
368
|
B as CustomBlockTypeSchema,
|
|
367
369
|
G as CustomRuleSchema,
|
|
368
370
|
w as DefaultBlockTypeSchema,
|
|
369
|
-
|
|
370
|
-
|
|
371
|
+
x as DynamicContentListSchema,
|
|
372
|
+
f as DynamicContentNodeSchema,
|
|
371
373
|
M as DynamicContentSchema,
|
|
372
374
|
O as EditorSchema,
|
|
373
|
-
|
|
375
|
+
v as EmailHeaderSchema,
|
|
374
376
|
L as FallbackFontSchema,
|
|
375
377
|
U as FeaturesSchema,
|
|
376
378
|
K as GuidoConfigSchema,
|
|
377
379
|
A as IdentitySchema,
|
|
378
|
-
|
|
380
|
+
D as LegacyRecommendationConfigSchema,
|
|
379
381
|
p as MessageType,
|
|
380
382
|
E as PartnerSchema,
|
|
381
383
|
l as ProductType,
|
|
382
384
|
_ as RegexRuleSchema,
|
|
383
385
|
q as RemoveRuleSchema,
|
|
384
386
|
H as ReplaceRuleSchema,
|
|
385
|
-
|
|
386
|
-
|
|
387
|
+
N as TemplateMigrationSchema,
|
|
388
|
+
P as TemplateSchema,
|
|
387
389
|
F as UISchema
|
|
388
390
|
};
|
|
@@ -1,179 +1,189 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import Re from "./organisms/
|
|
21
|
-
import
|
|
22
|
-
import Le from "./organisms/
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
|
|
1
|
+
import { defineComponent as de, defineAsyncComponent as l, ref as W, computed as f, watch as G, onMounted as me, onUnmounted as le } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as ue } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { useEditorLock as pe } from "../composables/useEditorLock.js";
|
|
4
|
+
import { startEditorOpenMetrics as fe } from "../composables/useEditorOpenMetrics.js";
|
|
5
|
+
import { provideGuidoActions as ye } from "../composables/useGuidoActions.js";
|
|
6
|
+
import { useGuidoStateBridge as ge } from "../composables/useGuidoStateBridge.js";
|
|
7
|
+
import { usePartner as ve } from "../composables/usePartner.js";
|
|
8
|
+
import { useSaveValidationRollout as Se } from "../composables/useSaveValidationRollout.js";
|
|
9
|
+
import { useStripo as be } from "../composables/useStripo.js";
|
|
10
|
+
import { useTimerClone as he } from "../composables/useTimerClone.js";
|
|
11
|
+
import { migrate as Ee } from "../config/migrator/index.js";
|
|
12
|
+
import { ModuleFolderDefaults as H } from "../enums/defaults.js";
|
|
13
|
+
import { RIBBON_SELECTOR as we } from "../enums/onboarding.js";
|
|
14
|
+
import { useRecommendationExtensionStore as V, disposeStrategyPageReturnListeners as ke } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
15
|
+
import { disposeUnsubscribeListeners as Ce } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
16
|
+
import De from "./organisms/AutoSaveController.vue.js";
|
|
17
|
+
import Ie from "./organisms/base/AuthErrorModal.vue.js";
|
|
18
|
+
import Fe from "./organisms/base/Toaster.vue.js";
|
|
19
|
+
import Me from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
20
|
+
import Re from "./organisms/header/HeaderWrapper.vue.js";
|
|
21
|
+
import Te from "./organisms/LoadingWrapper.vue.js";
|
|
22
|
+
import Le from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
23
|
+
import Ue from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
24
|
+
import Ne from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
25
|
+
import { useStripoApi as _e } from "../services/stripoApi.js";
|
|
26
|
+
import { useConfigStore as Ae } from "../stores/config.js";
|
|
27
|
+
import { useDynamicContentStore as Be } from "../stores/dynamic-content.js";
|
|
28
|
+
import { useEditorStore as w } from "../stores/editor.js";
|
|
29
|
+
import { usePreviewStore as Oe } from "../stores/preview.js";
|
|
30
|
+
import { useSaveValidationStore as Pe } from "../stores/save-validation.js";
|
|
31
|
+
import { useTemplateStore as xe } from "../stores/template.js";
|
|
32
|
+
import { useUnsubscribeStore as We } from "../stores/unsubscribe.js";
|
|
33
|
+
import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
|
|
34
|
+
const ht = /* @__PURE__ */ de({
|
|
34
35
|
__name: "Guido",
|
|
35
36
|
props: {
|
|
36
37
|
config: null,
|
|
37
38
|
ready: { type: Boolean, default: !0 }
|
|
38
39
|
},
|
|
39
40
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
40
|
-
setup(
|
|
41
|
-
const s =
|
|
41
|
+
setup(z, { expose: q, emit: a }) {
|
|
42
|
+
const s = z, n = fe(), K = l(
|
|
42
43
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
43
|
-
),
|
|
44
|
+
), j = l(
|
|
44
45
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
45
|
-
),
|
|
46
|
+
), J = l(
|
|
46
47
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
47
|
-
),
|
|
48
|
+
), Q = l(
|
|
48
49
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
49
|
-
),
|
|
50
|
+
), X = l(
|
|
50
51
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
51
|
-
),
|
|
52
|
+
), k = W(), y = W(), g = Be(), C = We(), o = Ae();
|
|
52
53
|
s.ready && o.init(s.config);
|
|
53
|
-
const
|
|
54
|
+
const d = w(), Y = Oe(), u = f(() => d.hasChanges), { isTestPartner: Z } = ve(), { isEnabled: ee, loadRollout: D } = Se(), I = () => {
|
|
54
55
|
var t;
|
|
55
|
-
return (t =
|
|
56
|
-
},
|
|
57
|
-
|
|
56
|
+
return (t = k.value) == null ? void 0 : t.handleSave(!0);
|
|
57
|
+
}, F = (t) => {
|
|
58
|
+
d.loadingStatus = t;
|
|
58
59
|
};
|
|
59
|
-
|
|
60
|
-
const
|
|
60
|
+
ue(), ge();
|
|
61
|
+
const v = () => {
|
|
61
62
|
var t, e;
|
|
62
63
|
return {
|
|
63
64
|
emailId: o.templateId,
|
|
64
65
|
userId: o.userId,
|
|
65
66
|
username: o.username,
|
|
66
67
|
partnerName: o.partnerName,
|
|
67
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
68
|
-
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
68
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || H.SAVED_MODULES,
|
|
69
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || H.DEFAULT_MODULES
|
|
69
70
|
};
|
|
70
|
-
}, { initPlugin:
|
|
71
|
-
let
|
|
72
|
-
const { getDefaultTemplate:
|
|
71
|
+
}, { initPlugin: M, preloadRuntime: R } = be(n), { runExclusive: T, beginMount: L, isCurrentMount: S } = pe();
|
|
72
|
+
let p = 0;
|
|
73
|
+
const { getDefaultTemplate: U } = _e(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = he(), te = f(() => {
|
|
73
74
|
var t;
|
|
74
75
|
return !((t = o.ui) != null && t.showHeader);
|
|
75
|
-
}),
|
|
76
|
-
() => !!
|
|
76
|
+
}), oe = f(() => o.isFeatureEnabled("reusableRecommendationStrategy")), re = f(
|
|
77
|
+
() => !!V().recommendationConfigs.strategyId
|
|
77
78
|
);
|
|
78
|
-
|
|
79
|
+
ye({
|
|
79
80
|
onBack: () => {
|
|
80
|
-
console.debug("guido:back"),
|
|
81
|
+
console.debug("guido:back"), a("back");
|
|
81
82
|
},
|
|
82
83
|
onSaveStart: () => {
|
|
83
|
-
console.debug("guido:save:start"),
|
|
84
|
+
console.debug("guido:save:start"), a("save:start");
|
|
84
85
|
},
|
|
85
86
|
onSaveComplete: (t) => {
|
|
86
|
-
const e = { ...t, metadata:
|
|
87
|
-
console.debug("guido:save:complete", e),
|
|
87
|
+
const e = { ...t, metadata: v() };
|
|
88
|
+
console.debug("guido:save:complete", e), a("save:complete", e);
|
|
88
89
|
},
|
|
89
90
|
onTestEmailClick: () => {
|
|
90
|
-
console.debug("guido:test-email:click"),
|
|
91
|
+
console.debug("guido:test-email:click"), a("test-email:click");
|
|
91
92
|
}
|
|
92
93
|
});
|
|
93
|
-
const
|
|
94
|
-
console.debug("dynamic-content:close", t),
|
|
95
|
-
},
|
|
94
|
+
const A = (t) => {
|
|
95
|
+
console.debug("dynamic-content:close", t), g.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
96
|
+
}, B = () => {
|
|
96
97
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
97
98
|
};
|
|
98
|
-
G(() =>
|
|
99
|
-
|
|
99
|
+
G(() => u.value, () => {
|
|
100
|
+
a("on-change", u.value);
|
|
100
101
|
});
|
|
101
|
-
const
|
|
102
|
-
const e = t, { attribute:
|
|
103
|
-
console.debug("dynamic-content:open", e.detail),
|
|
102
|
+
const b = (t) => {
|
|
103
|
+
const e = t, { attribute: i, position: m } = e.detail;
|
|
104
|
+
console.debug("dynamic-content:open", e.detail), a("dynamic-content:open", i, m);
|
|
104
105
|
};
|
|
105
|
-
let
|
|
106
|
-
const
|
|
106
|
+
let c = null;
|
|
107
|
+
const h = () => {
|
|
107
108
|
var e;
|
|
108
|
-
const t = document.querySelector(
|
|
109
|
-
(e =
|
|
110
|
-
},
|
|
109
|
+
const t = document.querySelector(we);
|
|
110
|
+
(e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
111
|
+
}, E = async () => {
|
|
111
112
|
var t;
|
|
113
|
+
n.mark("host_ready");
|
|
112
114
|
try {
|
|
113
|
-
o.initialized || o.init(s.config),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
o.initialized || o.init(s.config), d.templateId = o.templateId, n.setContext({
|
|
116
|
+
partnerName: o.partnerName,
|
|
117
|
+
productType: o.productType,
|
|
118
|
+
templateId: o.templateId,
|
|
119
|
+
variationId: o.variationId
|
|
120
|
+
});
|
|
121
|
+
const e = o.template, i = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "", O = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
122
|
+
C.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
123
|
+
const ne = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, P = o.isFeatureEnabled("linkTrackingIds"), ae = {
|
|
117
124
|
partnerName: o.partnerName,
|
|
118
125
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
119
126
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
127
|
+
}, x = (ce) => n.timed(
|
|
128
|
+
"migration",
|
|
129
|
+
() => Ee(ce, ne, ae)
|
|
130
|
+
);
|
|
131
|
+
let r = {
|
|
132
|
+
html: i && await x(i),
|
|
133
|
+
css: m
|
|
120
134
|
};
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
};
|
|
125
|
-
n.html || (n = await I(), n.html = await V(n.html, _, x));
|
|
126
|
-
const ae = O ? H(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
127
|
-
A(n.html) && (n.html = await U(n.html)), O && (c.trackIdSessionFloor = Math.max(ae, H(n.html)));
|
|
135
|
+
r.html || (r = await n.timed("default_template", () => U()), r.html = await x(r.html));
|
|
136
|
+
const ie = P ? $(r.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
137
|
+
_(r.html) && (r.html = await n.timed("timer_clone", () => N(r.html))), P && (d.trackIdSessionFloor = Math.max(ie, $(r.html)));
|
|
128
138
|
const se = {
|
|
129
|
-
preselectedDynamicContentList:
|
|
139
|
+
preselectedDynamicContentList: O,
|
|
130
140
|
onReady: () => {
|
|
131
|
-
console.debug("guido:ready"),
|
|
141
|
+
console.debug("guido:ready"), a("ready");
|
|
132
142
|
}
|
|
133
143
|
};
|
|
134
|
-
|
|
144
|
+
p = L(), await M(r, v(), se), g.selectedDynamicContentList = O;
|
|
135
145
|
} catch (e) {
|
|
136
|
-
console.error("Failed to initialize Stripo editor:", e);
|
|
146
|
+
console.error("Failed to initialize Stripo editor:", e), n.markFailed();
|
|
137
147
|
}
|
|
138
148
|
};
|
|
139
|
-
return
|
|
149
|
+
return me(async () => {
|
|
140
150
|
var e;
|
|
141
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
142
|
-
const t = (e =
|
|
143
|
-
if (t && (
|
|
144
|
-
await
|
|
151
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), V().$reset(), w().$reset(), xe().$reset(), Pe().$reset(), D(), h();
|
|
152
|
+
const t = (e = y.value) == null ? void 0 : e.parentElement;
|
|
153
|
+
if (t && (c = new ResizeObserver(h), c.observe(t)), R(), s.ready)
|
|
154
|
+
await E();
|
|
145
155
|
else {
|
|
146
|
-
const
|
|
147
|
-
|
|
156
|
+
const i = G(() => s.ready, (m) => {
|
|
157
|
+
m && (i(), E());
|
|
148
158
|
});
|
|
149
159
|
}
|
|
150
|
-
document.addEventListener("dynamic-content:open",
|
|
151
|
-
}),
|
|
152
|
-
if (
|
|
160
|
+
document.addEventListener("dynamic-content:open", b);
|
|
161
|
+
}), le(() => {
|
|
162
|
+
if (Ce(), ke(), n.dispose(), c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", b), S(p))
|
|
153
163
|
try {
|
|
154
|
-
|
|
164
|
+
w().isStripoInitialized = !1;
|
|
155
165
|
} catch (t) {
|
|
156
166
|
console.debug("Failed to close the editor readiness gate on unmount", t);
|
|
157
167
|
}
|
|
158
|
-
|
|
159
|
-
if (S(
|
|
168
|
+
T(async () => {
|
|
169
|
+
if (S(p))
|
|
160
170
|
try {
|
|
161
171
|
window.UIEditor.removeEditor();
|
|
162
172
|
} catch {
|
|
163
173
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
164
174
|
}
|
|
165
175
|
}), o.reset();
|
|
166
|
-
}),
|
|
176
|
+
}), q({
|
|
167
177
|
dynamicContent: {
|
|
168
|
-
insert:
|
|
169
|
-
close:
|
|
178
|
+
insert: A,
|
|
179
|
+
close: B
|
|
170
180
|
},
|
|
171
|
-
hasChanges:
|
|
172
|
-
saveSilent:
|
|
173
|
-
setLoading:
|
|
174
|
-
}), { __sfc: !0, PreviewContainer:
|
|
181
|
+
hasChanges: u,
|
|
182
|
+
saveSilent: I,
|
|
183
|
+
setLoading: F
|
|
184
|
+
}), { __sfc: !0, openMetrics: n, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, LegacyStrategyUpdatedModal: X, headerWrapperRef: k, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: C, props: s, configStore: o, editorStore: d, previewStore: Y, hasChanges: u, isTestPartner: Z, isSaveValidationEnabled: ee, loadRollout: D, saveSilent: I, setLoading: F, emit: a, buildMetadata: v, initPlugin: M, preloadRuntime: R, runExclusive: T, beginMount: L, isCurrentMount: S, mountGeneration: p, getDefaultTemplate: U, cloneTimersOnSave: N, hasTimerBlocks: _, noHeader: te, isRrsEnabled: oe, hasAssignedStrategy: re, insertDynamicContent: A, closeDynamicContent: B, handleDynamicContentOpen: b, ribbonObserver: c, updateRibbonOffset: h, startEditor: E, AutoSaveController: De, AuthErrorModal: Ie, Toaster: Fe, FilterSelectionDrawer: Me, HeaderWrapper: Re, LoadingWrapper: Te, SaveAsTemplateDrawer: Le, UnsubscribeWrapper: Ue, ValidationErrorDrawer: Ne };
|
|
175
185
|
}
|
|
176
186
|
});
|
|
177
187
|
export {
|
|
178
|
-
|
|
188
|
+
ht as default
|
|
179
189
|
};
|