@useinsider/guido 3.19.0-beta.6f88fb4 → 3.19.0-beta.80b64cf

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.
Files changed (80) hide show
  1. package/README.md +21 -3
  2. package/dist/@types/config/schemas.js +78 -57
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +81 -85
  5. package/dist/components/organisms/base/Toaster.vue2.js +13 -12
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
  7. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +78 -57
  8. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
  9. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
  10. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +28 -42
  11. package/dist/components/organisms/header/EditorActions.vue.js +4 -4
  12. package/dist/components/organisms/header/EditorActions.vue2.js +23 -25
  13. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +28 -24
  14. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +21 -0
  15. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +46 -0
  16. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
  17. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +47 -0
  18. package/dist/composables/useActionsApi.js +44 -43
  19. package/dist/composables/useCodeEditorApi.js +23 -9
  20. package/dist/composables/useCortexBlueprintBridge.js +54 -122
  21. package/dist/composables/useCustomInterfaceAppearance.js +65 -51
  22. package/dist/composables/useEmailTemplateApplier.js +52 -108
  23. package/dist/composables/useHtmlValidator.js +87 -82
  24. package/dist/composables/useLegacyStrategyConversion.js +61 -0
  25. package/dist/composables/useRecommendation.js +40 -35
  26. package/dist/composables/useStripo.js +30 -30
  27. package/dist/composables/useToaster.js +14 -20
  28. package/dist/composables/useTranslations.js +3 -2
  29. package/dist/composables/useVersionHistoryApi.js +33 -24
  30. package/dist/enums/extensions/recommendationBlock.js +49 -33
  31. package/dist/extensions/Blocks/Recommendation/block.js +109 -55
  32. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
  33. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +103 -90
  34. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +150 -52
  35. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
  36. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +293 -92
  37. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +42 -0
  38. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +26 -16
  39. package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +26 -0
  40. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +24 -0
  41. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
  42. package/dist/guido.css +1 -1
  43. package/dist/services/recommendationApi.js +46 -37
  44. package/dist/src/@types/config/schemas.d.ts +32 -0
  45. package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
  46. package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +2 -0
  47. package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
  48. package/dist/src/composables/useConfig.d.ts +6 -0
  49. package/dist/src/composables/useCortexBlueprintBridge.d.ts +3 -2
  50. package/dist/src/composables/useEmailTemplateApplier.d.ts +5 -18
  51. package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
  52. package/dist/src/enums/extensions/recommendationBlock.d.ts +7 -1
  53. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +16 -0
  54. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
  55. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  56. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
  57. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +10 -0
  58. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +7 -2
  59. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +167 -1
  60. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  61. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +32 -0
  62. package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +27 -0
  63. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +14 -0
  64. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
  65. package/dist/src/services/recommendationApi.d.ts +2 -1
  66. package/dist/src/stores/config.d.ts +342 -0
  67. package/dist/src/stores/guido-email-editor.d.ts +10 -20
  68. package/dist/src/stores/onboarding.d.ts +808 -10
  69. package/dist/src/utils/stripoEditorApi.d.ts +4 -0
  70. package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
  71. package/dist/static/assets/icons/line-info.svg.js +5 -0
  72. package/dist/static/styles/components/recommendation-strategy.css.js +113 -9
  73. package/dist/static/styles/components/skeleton.css.js +23 -0
  74. package/dist/stores/config.js +74 -60
  75. package/dist/stores/guido-email-editor.js +1 -3
  76. package/dist/stores/onboarding.js +46 -36
  77. package/dist/stores/unsubscribe.js +3 -3
  78. package/dist/utils/stripoEditorApi.js +11 -0
  79. package/dist/utils/templatePreparation.js +55 -55
  80. package/package.json +1 -1
package/README.md CHANGED
@@ -95,9 +95,11 @@ import type { GuidoConfigInput } from '@useinsider/guido';
95
95
  const config: GuidoConfigInput = {
96
96
  // Required: Identity
97
97
  identity: {
98
- templateId: string, // Required - Template identifier
99
- userId: string, // Required - User identifier
100
- variationId?: string, // Optional - A/B test variation
98
+ templateId: string, // Required - Template identifier
99
+ userId: string, // Required - User identifier
100
+ variationId?: string, // Optional - A/B test variation
101
+ campaignId?: string, // Optional - Numeric campaign id; absent for templates/modules
102
+ templateLibraryId?: string, // Optional - Numeric template-library id; absent for campaigns/modules
101
103
  },
102
104
 
103
105
  // Required: Partner
@@ -184,6 +186,22 @@ const config: GuidoConfigInput = {
184
186
  };
185
187
  ```
186
188
 
189
+ ### `identity` ids
190
+
191
+ `templateId` is the editor's **document** identity (a uuid / Stripo doc id) and never addresses a
192
+ backend resource. `campaignId` and `templateLibraryId` are the **numeric** ids of the surface the
193
+ editor was opened on, and they are what Guido uses to resolve host-scoped endpoints — most visibly
194
+ when converting a legacy recommendation block into a reusable strategy.
195
+
196
+ | Surface | `campaignId` | `templateLibraryId` |
197
+ |---------|--------------|---------------------|
198
+ | Campaign editor | the campaign id | absent |
199
+ | Saved template editor | absent | the template-library id |
200
+ | Module editor / unsaved template | absent | absent |
201
+
202
+ Pass only the one that applies. A campaign id takes precedence when both are present, and when
203
+ neither is supplied Guido falls back to campaign scope — so a module keeps working unchanged.
204
+
187
205
  ### `ready` prop
188
206
 
189
207
  ```vue
@@ -1,5 +1,5 @@
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 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";
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 c, transform as y, unknown as r, record as g, fallback as R, literal as u, looseObject as C, variant as I, union as h, lazy as T } from "../../node_modules/valibot/dist/index.js";
3
3
  const p = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -14,17 +14,25 @@ const p = {
14
14
  UNSUBSCRIBE_PAGES: 97
15
15
  }, A = a({
16
16
  /** Unique identifier for the template being edited */
17
- templateId: m(
17
+ templateId: i(
18
18
  t(),
19
19
  b(1, "templateId is required")
20
20
  ),
21
21
  /** Unique identifier for the user editing the template */
22
- userId: m(
22
+ userId: i(
23
23
  t(),
24
24
  b(1, "userId is required")
25
25
  ),
26
26
  /** Optional variation ID for A/B testing */
27
- variationId: e(t())
27
+ variationId: e(t()),
28
+ /** Optional numeric campaign ID of the host campaign; absent for templates and modules */
29
+ campaignId: e(t()),
30
+ /**
31
+ * Optional numeric template-library id of the host template; absent for campaigns and
32
+ * modules. Distinct from `templateId`, which is the editor's document identity (a uuid /
33
+ * Stripo doc id) and is never an endpoint id.
34
+ */
35
+ templateLibraryId: e(t())
28
36
  }), L = a({
29
37
  /** Fallback font name (e.g., "Georgia") */
30
38
  name: t(),
@@ -32,13 +40,13 @@ const p = {
32
40
  family: t()
33
41
  }), M = a({
34
42
  /** Partner/organization name (required) */
35
- name: m(
43
+ name: i(
36
44
  t(),
37
45
  b(1, "partner.name is required")
38
46
  ),
39
47
  /** Product type identifier */
40
48
  productType: e(
41
- i([
49
+ m([
42
50
  l.EMAIL,
43
51
  l.ARCHITECT,
44
52
  l.UNSUBSCRIBE_PAGES
@@ -47,7 +55,7 @@ const p = {
47
55
  ),
48
56
  /** Message type (promotional or transactional) */
49
57
  messageType: e(
50
- i([p.PROMOTIONAL, p.TRANSACTIONAL]),
58
+ m([p.PROMOTIONAL, p.TRANSACTIONAL]),
51
59
  p.PROMOTIONAL
52
60
  ),
53
61
  /** Display name for the current user */
@@ -68,22 +76,22 @@ const p = {
68
76
  value: t()
69
77
  })
70
78
  )
71
- }), S = I(() => g({
79
+ }), f = T(() => C({
72
80
  text: e(t()),
73
81
  // eslint-disable-next-line camelcase -- backend field name
74
82
  tag_text: e(t()),
75
83
  value: e(t()),
76
- children: e(c(S)),
84
+ children: e(c(f)),
77
85
  // eslint-disable-next-line camelcase -- backend field name
78
- select_items: e(c(S))
79
- })), N = k(
86
+ select_items: e(c(f))
87
+ })), N = g(
80
88
  t(),
81
- R(c(S), [])
82
- ), P = g({
89
+ R(c(f), [])
90
+ ), P = C({
83
91
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
84
- id: e(n()),
92
+ id: e(s()),
85
93
  /** Decimal places for price display (legacy data may use string or number) */
86
- decimalCount: e(h([t(), n()])),
94
+ decimalCount: e(h([t(), s()])),
87
95
  /** Pinned product IDs (empty array when filter-driven) */
88
96
  productIds: e(c(r())),
89
97
  /** Whether the block requested live products at send time */
@@ -103,11 +111,11 @@ const p = {
103
111
  /** Snapshot of products as rendered by the legacy block */
104
112
  recommendedProducts: e(c(r())),
105
113
  /** Number of product cards per row */
106
- cardsInRow: e(n()),
114
+ cardsInRow: e(s()),
107
115
  /** Mobile-only padding (right) */
108
- mobileRightPadding: e(n()),
116
+ mobileRightPadding: e(s()),
109
117
  /** Mobile-only padding (left) */
110
- mobileLeftPadding: e(n()),
118
+ mobileLeftPadding: e(s()),
111
119
  /** Disable responsive scaling */
112
120
  unresponsive: e(o()),
113
121
  /** Layout orientation ('vertical' | 'horizontal') */
@@ -117,14 +125,14 @@ const p = {
117
125
  /** Block type marker used by some legacy variants */
118
126
  blockType: e(t()),
119
127
  /** Size variant marker (legacy data may use string or number) */
120
- size: e(h([t(), n()])),
128
+ size: e(h([t(), s()])),
121
129
  /** Vertical responsiveness flag (legacy size=1 variants) */
122
130
  verticalResponsiveness: e(o()),
123
131
  /** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
124
132
  isPriceMovedToNextLine: e(o()),
125
133
  /** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
126
134
  isPriceDeletedForZeroSale: e(o())
127
- }), v = a({
135
+ }), x = a({
128
136
  /**
129
137
  * Legacy recommendation block configs keyed by block ID.
130
138
  * Pass this when loading a template authored with the v1
@@ -132,10 +140,10 @@ const p = {
132
140
  * strategy, currency, locale, and layout data.
133
141
  */
134
142
  recommendationConfigs: e(
135
- k(t(), P),
143
+ g(t(), P),
136
144
  {}
137
145
  )
138
- }), x = a({
146
+ }), D = a({
139
147
  /** Initial HTML content */
140
148
  html: e(t(), ""),
141
149
  /** Initial CSS content */
@@ -155,7 +163,7 @@ const p = {
155
163
  /** Valid custom field attribute names from the partner's categorized fields */
156
164
  customFieldAttributes: e(c(t()), []),
157
165
  /** Selected unsubscribe page IDs */
158
- selectedUnsubscribePages: e(c(n()), []),
166
+ selectedUnsubscribePages: e(c(s()), []),
159
167
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
160
168
  forceRecreate: e(o(), !1),
161
169
  /**
@@ -166,32 +174,45 @@ const p = {
166
174
  * mount. Non-numbers still fail, like every other field in this schema.
167
175
  */
168
176
  trackIdCounter: e(
169
- m(
170
- n(),
171
- C((s) => Number.isFinite(s) ? Math.max(0, Math.floor(s)) : 0)
177
+ i(
178
+ s(),
179
+ y((n) => Number.isFinite(n) ? Math.max(0, Math.floor(n)) : 0)
172
180
  ),
173
181
  0
174
182
  ),
183
+ /**
184
+ * The variation's saved `recommendationCampaignUrls`, keyed by block id. A block
185
+ * that still names a strategy but has no entry here had it dropped by a
186
+ * cross-account duplicate, so Guido resets it on load (SD-151945). Omit it and
187
+ * that check is off, and so is any non-object value such as `null`, because a reset
188
+ * cannot be undone. Hosts send `[]` for an empty map.
189
+ */
190
+ recommendationCampaignUrls: e(
191
+ i(
192
+ r(),
193
+ y((n) => n && typeof n == "object" ? { ...n } : void 0)
194
+ )
195
+ ),
175
196
  /** Migration-only inputs (legacy block configs) */
176
- migration: e(v, {})
177
- }), D = a({
197
+ migration: e(x, {})
198
+ }), O = a({
178
199
  /** Sender display name */
179
200
  senderName: e(t(), ""),
180
201
  /** Email subject line */
181
202
  subject: e(t(), "")
182
- }), O = a({
203
+ }), v = a({
183
204
  /** Locale for the editor UI */
184
205
  locale: e(t(), "en"),
185
206
  /** Path to translations object */
186
207
  translationsPath: e(t(), "window.trans[Object.keys(window.trans)[0]]"),
187
208
  /** Migration date for template compatibility */
188
- migrationDate: e(n(), 1759696858),
209
+ migrationDate: e(s(), 1759696858),
189
210
  /** Email header settings */
190
- emailHeader: e(D, { senderName: "", subject: "" }),
211
+ emailHeader: e(O, { senderName: "", subject: "" }),
191
212
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
192
- savedModulesFolderName: e(t(), f.SAVED_MODULES),
213
+ savedModulesFolderName: e(t(), S.SAVED_MODULES),
193
214
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
194
- defaultModulesFolderName: e(t(), f.DEFAULT_MODULES)
215
+ defaultModulesFolderName: e(t(), S.DEFAULT_MODULES)
195
216
  }), F = a({
196
217
  /** Whether to show the header bar */
197
218
  showHeader: e(o(), !0),
@@ -221,7 +242,7 @@ const p = {
221
242
  /** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
222
243
  linkTrackingIds: e(o(), !1),
223
244
  reusableRecommendationStrategy: e(o(), !1)
224
- }), B = i([
245
+ }), B = m([
225
246
  "amp-accordion",
226
247
  "amp-carousel",
227
248
  "amp-form-controls",
@@ -235,7 +256,7 @@ const p = {
235
256
  "text-block",
236
257
  "timer-block",
237
258
  "video-block"
238
- ]), w = i([
259
+ ]), w = m([
239
260
  "dynamic-content",
240
261
  "checkbox-block",
241
262
  "radio-button-block",
@@ -243,7 +264,7 @@ const p = {
243
264
  "unsubscribe-block",
244
265
  "coupon-block",
245
266
  "items-block"
246
- ]), H = a({
267
+ ]), j = a({
247
268
  /** Default blocks to exclude from the editor */
248
269
  excludeDefaults: e(
249
270
  c(B),
@@ -260,8 +281,8 @@ const p = {
260
281
  /** Human-readable description */
261
282
  description: e(t()),
262
283
  /** Priority for rule ordering (lower = earlier) */
263
- priority: n()
264
- }), _ = a({
284
+ priority: s()
285
+ }), H = a({
265
286
  ...d.entries,
266
287
  type: u("replace"),
267
288
  /** String to search for */
@@ -270,7 +291,7 @@ const p = {
270
291
  replacement: t(),
271
292
  /** Replace all occurrences (default: false) */
272
293
  replaceAll: e(o())
273
- }), j = a({
294
+ }), _ = a({
274
295
  ...d.entries,
275
296
  type: u("regex"),
276
297
  /** Regex pattern string */
@@ -288,13 +309,13 @@ const p = {
288
309
  ...d.entries,
289
310
  type: u("custom"),
290
311
  /** Custom processor function */
291
- processor: y(
292
- (s) => typeof s == "function",
312
+ processor: k(
313
+ (n) => typeof n == "function",
293
314
  "processor must be a function"
294
315
  )
295
- }), V = T("type", [
316
+ }), V = I("type", [
317
+ H,
296
318
  _,
297
- j,
298
319
  q,
299
320
  G
300
321
  ]), z = a({
@@ -308,8 +329,8 @@ const p = {
308
329
  * Return false to cancel the save operation.
309
330
  */
310
331
  externalValidation: e(
311
- y(
312
- (s) => typeof s == "function",
332
+ k(
333
+ (n) => typeof n == "function",
313
334
  "externalValidation must be a function"
314
335
  )
315
336
  )
@@ -321,22 +342,22 @@ const p = {
321
342
  partner: M,
322
343
  // Optional sections (with defaults)
323
344
  /** Template content and presets */
324
- template: e(x, {}),
345
+ template: e(D, {}),
325
346
  /** Editor settings */
326
- editor: e(O, {}),
347
+ editor: e(v, {}),
327
348
  /** UI configuration */
328
349
  ui: e(F, {}),
329
350
  /** Feature toggles */
330
351
  features: e(U, {}),
331
352
  /** Block configuration */
332
- blocks: e(H, {}),
353
+ blocks: e(j, {}),
333
354
  /** Compiler configuration */
334
355
  compiler: e(z, {}),
335
356
  /** Callbacks and event handlers */
336
357
  callbacks: e(Z, {})
337
358
  });
338
359
  export {
339
- H as BlocksSchema,
360
+ j as BlocksSchema,
340
361
  Z as CallbacksSchema,
341
362
  V as CompilerRuleSchema,
342
363
  z as CompilerSchema,
@@ -344,10 +365,10 @@ export {
344
365
  G as CustomRuleSchema,
345
366
  B as DefaultBlockTypeSchema,
346
367
  N as DynamicContentListSchema,
347
- S as DynamicContentNodeSchema,
368
+ f as DynamicContentNodeSchema,
348
369
  E as DynamicContentSchema,
349
- O as EditorSchema,
350
- D as EmailHeaderSchema,
370
+ v as EditorSchema,
371
+ O as EmailHeaderSchema,
351
372
  L as FallbackFontSchema,
352
373
  U as FeaturesSchema,
353
374
  Q as GuidoConfigSchema,
@@ -356,10 +377,10 @@ export {
356
377
  p as MessageType,
357
378
  M as PartnerSchema,
358
379
  l as ProductType,
359
- j as RegexRuleSchema,
380
+ _ as RegexRuleSchema,
360
381
  q as RemoveRuleSchema,
361
- _ as ReplaceRuleSchema,
362
- v as TemplateMigrationSchema,
363
- x as TemplateSchema,
382
+ H as ReplaceRuleSchema,
383
+ x as TemplateMigrationSchema,
384
+ D as TemplateSchema,
364
385
  F as UISchema
365
386
  };
@@ -3,7 +3,7 @@ import o from "./Guido.vue2.js";
3
3
  import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
5
5
  var a = this, r = a._self._c, e = a._self._setupProxy;
6
- return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
6
+ return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
9
  }, s = [], n = /* @__PURE__ */ i(
@@ -12,9 +12,9 @@ var t = function() {
12
12
  s,
13
13
  !1,
14
14
  null,
15
- "bb2a5f2c"
15
+ "36867e2e"
16
16
  );
17
- const f = n.exports;
17
+ const g = n.exports;
18
18
  export {
19
- f as default
19
+ g as default
20
20
  };
@@ -1,56 +1,58 @@
1
- import { defineComponent as ne, defineAsyncComponent as u, ref as P, computed as p, watch as x, onMounted as re, onUnmounted as se } from "vue";
1
+ import { defineComponent as re, defineAsyncComponent as m, ref as O, computed as u, watch as x, onMounted as se, onUnmounted as ae } from "vue";
2
2
  import { useCortexBlueprintBridge as ie } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as ae } from "../composables/useEditorLock.js";
4
- import { provideGuidoActions as ce } from "../composables/useGuidoActions.js";
5
- import { useGuidoStateBridge as de } from "../composables/useGuidoStateBridge.js";
6
- import { usePartner as me } from "../composables/usePartner.js";
7
- import { useStripo as le } from "../composables/useStripo.js";
8
- import { useTimerClone as ue } from "../composables/useTimerClone.js";
3
+ import { useEditorLock as ce } from "../composables/useEditorLock.js";
4
+ import { provideGuidoActions as de } from "../composables/useGuidoActions.js";
5
+ import { useGuidoStateBridge as me } from "../composables/useGuidoStateBridge.js";
6
+ import { usePartner as le } from "../composables/usePartner.js";
7
+ import { useStripo as ue } from "../composables/useStripo.js";
8
+ import { useTimerClone as pe } from "../composables/useTimerClone.js";
9
9
  import { migrate as W } from "../config/migrator/index.js";
10
10
  import { ModuleFolderDefaults as G } from "../enums/defaults.js";
11
- import { RIBBON_SELECTOR as pe } from "../enums/onboarding.js";
12
- import { useRecommendationExtensionStore as z } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
- import fe from "./organisms/AutoSaveController.vue.js";
14
- import ye from "./organisms/base/Toaster.vue.js";
15
- import ge from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
- import ve from "./organisms/header/HeaderWrapper.vue.js";
17
- import Se from "./organisms/LoadingWrapper.vue.js";
11
+ import { RIBBON_SELECTOR as fe } from "../enums/onboarding.js";
12
+ import { useRecommendationExtensionStore as h } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
+ import ye from "./organisms/AutoSaveController.vue.js";
14
+ import ge from "./organisms/base/Toaster.vue.js";
15
+ import ve from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
+ import Se from "./organisms/header/HeaderWrapper.vue.js";
17
+ import be from "./organisms/LoadingWrapper.vue.js";
18
18
  import he from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
- import be from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
- import { useStripoApi as Ee } from "../services/stripoApi.js";
21
- import { useConfigStore as we } from "../stores/config.js";
22
- import { useDynamicContentStore as Ce } from "../stores/dynamic-content.js";
23
- import { useEditorStore as E } from "../stores/editor.js";
24
- import { usePreviewStore as De } from "../stores/preview.js";
25
- import { useTemplateStore as ke } from "../stores/template.js";
19
+ import Ee from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
+ import { useStripoApi as we } from "../services/stripoApi.js";
21
+ import { useConfigStore as Ce } from "../stores/config.js";
22
+ import { useDynamicContentStore as De } from "../stores/dynamic-content.js";
23
+ import { useEditorStore as H } from "../stores/editor.js";
24
+ import { usePreviewStore as ke } from "../stores/preview.js";
25
+ import { useTemplateStore as Te } from "../stores/template.js";
26
26
  import { useUnsubscribeStore as Fe } from "../stores/unsubscribe.js";
27
- import { readTrackFloor as H } from "../utils/linkTrackingIds.js";
28
- const et = /* @__PURE__ */ ne({
27
+ import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
28
+ const tt = /* @__PURE__ */ re({
29
29
  __name: "Guido",
30
30
  props: {
31
31
  config: null,
32
32
  ready: { type: Boolean, default: !0 }
33
33
  },
34
34
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
35
- setup($, { expose: q, emit: r }) {
36
- const i = $, K = u(
35
+ setup(z, { expose: q, emit: r }) {
36
+ const a = z, K = m(
37
37
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
38
- ), V = u(
38
+ ), V = m(
39
39
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
40
- ), j = u(
40
+ ), j = m(
41
41
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
42
- ), J = u(
42
+ ), J = m(
43
43
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
44
- ), w = P(), f = P(), y = Ce(), C = Fe(), o = we();
45
- i.ready && o.init(i.config);
46
- const c = E(), Q = De(), m = p(() => c.hasChanges), { isTestPartner: X } = me(), D = () => {
44
+ ), Q = m(
45
+ () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
46
+ ), E = O(), p = O(), f = De(), w = Fe(), o = Ce();
47
+ a.ready && o.init(a.config);
48
+ const c = H(), X = ke(), l = u(() => c.hasChanges), { isTestPartner: Y } = le(), C = () => {
47
49
  var t;
48
- return (t = w.value) == null ? void 0 : t.handleSave(!0);
49
- }, k = (t) => {
50
+ return (t = E.value) == null ? void 0 : t.handleSave(!0);
51
+ }, D = (t) => {
50
52
  c.loadingStatus = t;
51
53
  };
52
- ie(), de();
53
- const g = () => {
54
+ ie(), me();
55
+ const y = () => {
54
56
  var t, e;
55
57
  return {
56
58
  emailId: o.templateId,
@@ -60,15 +62,15 @@ const et = /* @__PURE__ */ ne({
60
62
  savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
61
63
  defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
62
64
  };
63
- }, { initPlugin: F, preloadRuntime: T } = le(), { runExclusive: I, beginMount: M, isCurrentMount: v } = ae();
64
- let l = 0;
65
- const { getDefaultTemplate: R } = Ee(), { cloneTimersOnSave: L, hasTimerBlocks: B } = ue(), Y = p(() => {
65
+ }, { initPlugin: k, preloadRuntime: T } = ue(), { runExclusive: F, beginMount: M, isCurrentMount: R } = ce();
66
+ let g = 0;
67
+ const { getDefaultTemplate: I } = we(), { cloneTimersOnSave: L, hasTimerBlocks: B } = pe(), Z = u(() => {
66
68
  var t;
67
69
  return !((t = o.ui) != null && t.showHeader);
68
- }), Z = p(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ee = p(
69
- () => !!z().recommendationConfigs.strategyId
70
+ }), ee = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), te = u(
71
+ () => !!h().recommendationConfigs.strategyId
70
72
  );
71
- ce({
73
+ de({
72
74
  onBack: () => {
73
75
  console.debug("guido:back"), r("back");
74
76
  },
@@ -76,76 +78,70 @@ const et = /* @__PURE__ */ ne({
76
78
  console.debug("guido:save:start"), r("save:start");
77
79
  },
78
80
  onSaveComplete: (t) => {
79
- const e = { ...t, metadata: g() };
81
+ const e = { ...t, metadata: y() };
80
82
  console.debug("guido:save:complete", e), r("save:complete", e);
81
83
  },
82
84
  onTestEmailClick: () => {
83
85
  console.debug("guido:test-email:click"), r("test-email:click");
84
86
  }
85
87
  });
86
- const A = (t) => {
87
- console.debug("dynamic-content:close", t), y.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
88
- }, U = () => {
88
+ const U = (t) => {
89
+ console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
90
+ }, A = () => {
89
91
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
90
92
  };
91
- x(() => m.value, () => {
92
- r("on-change", m.value);
93
+ x(() => l.value, () => {
94
+ r("on-change", l.value);
93
95
  });
94
- const S = (t) => {
96
+ const v = (t) => {
95
97
  const e = t, { attribute: s, position: d } = e.detail;
96
98
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
97
99
  };
98
- let a = null;
99
- const h = () => {
100
+ let i = null;
101
+ const S = () => {
100
102
  var e;
101
- const t = document.querySelector(pe);
102
- (e = f.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
103
+ const t = document.querySelector(fe);
104
+ (e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
103
105
  }, b = async () => {
104
106
  var t;
105
107
  try {
106
- o.initialized || o.init(i.config), c.templateId = o.templateId;
107
- const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", _ = (e == null ? void 0 : e.preselectedDynamicContent) || [];
108
- C.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
109
- const N = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, O = o.isFeatureEnabled("linkTrackingIds");
108
+ o.initialized || o.init(a.config), c.templateId = o.templateId;
109
+ const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", P = (e == null ? void 0 : e.preselectedDynamicContent) || [];
110
+ w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
111
+ const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, N = o.isFeatureEnabled("linkTrackingIds");
110
112
  let n = {
111
- html: s && await W(s, N),
113
+ html: s && await W(s, _),
112
114
  css: d
113
115
  };
114
- n.html || (n = await R(), n.html = await W(n.html, N));
115
- const te = O ? H(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
116
- B(n.html) && (n.html = await L(n.html)), O && (c.trackIdSessionFloor = Math.max(te, H(n.html)));
117
- const oe = {
118
- preselectedDynamicContentList: _,
116
+ n.html || (n = await I(), n.html = await W(n.html, _));
117
+ const oe = N ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
118
+ B(n.html) && (n.html = await L(n.html)), N && (c.trackIdSessionFloor = Math.max(oe, $(n.html)));
119
+ const ne = {
120
+ preselectedDynamicContentList: P,
119
121
  onReady: () => {
120
122
  console.debug("guido:ready"), r("ready");
121
123
  }
122
124
  };
123
- l = M(), await F(n, g(), oe), y.selectedDynamicContentList = _;
125
+ g = M(), await k(n, y(), ne), f.selectedDynamicContentList = P;
124
126
  } catch (e) {
125
127
  console.error("Failed to initialize Stripo editor:", e);
126
128
  }
127
129
  };
128
- return re(async () => {
130
+ return se(async () => {
129
131
  var e;
130
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), E().$reset(), ke().$reset(), h();
131
- const t = (e = f.value) == null ? void 0 : e.parentElement;
132
- if (t && (a = new ResizeObserver(h), a.observe(t)), T(), i.ready)
132
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h().$reset(), H().$reset(), Te().$reset(), S();
133
+ const t = (e = p.value) == null ? void 0 : e.parentElement;
134
+ if (t && (i = new ResizeObserver(S), i.observe(t)), T(), a.ready)
133
135
  await b();
134
136
  else {
135
- const s = x(() => i.ready, (d) => {
137
+ const s = x(() => a.ready, (d) => {
136
138
  d && (s(), b());
137
139
  });
138
140
  }
139
- document.addEventListener("dynamic-content:open", S);
140
- }), se(() => {
141
- if (a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", S), v(l))
142
- try {
143
- E().isStripoInitialized = !1;
144
- } catch (t) {
145
- console.debug("Failed to close the editor readiness gate on unmount", t);
146
- }
147
- I(async () => {
148
- if (v(l))
141
+ document.addEventListener("dynamic-content:open", v);
142
+ }), ae(() => {
143
+ i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), h().disposeStrategyPageReturn(), F(async () => {
144
+ if (R(g))
149
145
  try {
150
146
  window.UIEditor.removeEditor();
151
147
  } catch {
@@ -154,15 +150,15 @@ const et = /* @__PURE__ */ ne({
154
150
  }), o.reset();
155
151
  }), q({
156
152
  dynamicContent: {
157
- insert: A,
158
- close: U
153
+ insert: U,
154
+ close: A
159
155
  },
160
- hasChanges: m,
161
- saveSilent: D,
162
- setLoading: k
163
- }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, headerWrapperRef: w, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: C, props: i, configStore: o, editorStore: c, previewStore: Q, hasChanges: m, isTestPartner: X, saveSilent: D, setLoading: k, emit: r, buildMetadata: g, initPlugin: F, preloadRuntime: T, runExclusive: I, beginMount: M, isCurrentMount: v, mountGeneration: l, getDefaultTemplate: R, cloneTimersOnSave: L, hasTimerBlocks: B, noHeader: Y, isRrsEnabled: Z, hasAssignedStrategy: ee, insertDynamicContent: A, closeDynamicContent: U, handleDynamicContentOpen: S, ribbonObserver: a, updateRibbonOffset: h, startEditor: b, AutoSaveController: fe, Toaster: ye, FilterSelectionDrawer: ge, HeaderWrapper: ve, LoadingWrapper: Se, SaveAsTemplateDrawer: he, UnsubscribeWrapper: be };
156
+ hasChanges: l,
157
+ saveSilent: C,
158
+ setLoading: D
159
+ }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, LegacyStrategyUpdatedModal: Q, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: a, configStore: o, editorStore: c, previewStore: X, hasChanges: l, isTestPartner: Y, saveSilent: C, setLoading: D, emit: r, buildMetadata: y, initPlugin: k, preloadRuntime: T, runExclusive: F, beginMount: M, isCurrentMount: R, mountGeneration: g, getDefaultTemplate: I, cloneTimersOnSave: L, hasTimerBlocks: B, noHeader: Z, isRrsEnabled: ee, hasAssignedStrategy: te, insertDynamicContent: U, closeDynamicContent: A, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: S, startEditor: b, AutoSaveController: ye, Toaster: ge, FilterSelectionDrawer: ve, HeaderWrapper: Se, LoadingWrapper: be, SaveAsTemplateDrawer: he, UnsubscribeWrapper: Ee };
164
160
  }
165
161
  });
166
162
  export {
167
- et as default
163
+ tt as default
168
164
  };