@useinsider/guido 3.20.1-beta.8dc88d5 → 3.20.1-beta.92564e2

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 (136) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +38 -37
  3. package/dist/@types/display-condition.js +25 -0
  4. package/dist/components/Guido.vue.js +8 -8
  5. package/dist/components/Guido.vue2.js +85 -90
  6. package/dist/components/organisms/AutoSaveController.vue2.js +9 -19
  7. package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +20 -0
  8. package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +30 -0
  9. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +30 -0
  10. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +71 -0
  11. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +34 -0
  12. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +57 -0
  13. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +17 -0
  14. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +22 -0
  15. package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
  16. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
  17. package/dist/components/organisms/header/EditorActions.vue.js +13 -13
  18. package/dist/components/organisms/header/EditorActions.vue2.js +72 -57
  19. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  20. package/dist/components/organisms/header/HeaderWrapper.vue2.js +17 -9
  21. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  22. package/dist/components/organisms/header/LeftSlot.vue2.js +23 -28
  23. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  24. package/dist/components/organisms/header/MiddleSlot.vue2.js +7 -8
  25. package/dist/components/organisms/header/RightSlot.vue.js +8 -9
  26. package/dist/components/organisms/header/RightSlot.vue2.js +18 -13
  27. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
  28. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +38 -56
  29. package/dist/composables/useBlocksConfig.js +32 -24
  30. package/dist/composables/useCustomInterfaceAppearance.js +41 -42
  31. package/dist/composables/useDisplayConditions.js +102 -0
  32. package/dist/composables/useLegacyStrategyConversion.js +16 -16
  33. package/dist/composables/useStripo.js +4 -3
  34. package/dist/config/i18n/en/labels.json.js +4 -36
  35. package/dist/config/i18n/en/tooltips.json.js +1 -2
  36. package/dist/enums/academy.js +1 -0
  37. package/dist/enums/display-condition.js +12 -0
  38. package/dist/extensions/Blocks/Items/block.js +43 -42
  39. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +296 -223
  40. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +219 -205
  41. package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +19 -0
  42. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +51 -36
  43. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +31 -35
  44. package/dist/extensions/DisplayConditions/bridge.js +17 -0
  45. package/dist/extensions/DisplayConditions/constants.js +17 -0
  46. package/dist/extensions/DisplayConditions/control.js +178 -0
  47. package/dist/extensions/DisplayConditions/display-conditions.css.js +201 -0
  48. package/dist/extensions/DisplayConditions/extension.js +28 -0
  49. package/dist/extensions/DisplayConditions/iconsRegistry.js +20 -0
  50. package/dist/extensions/DisplayConditions/library.js +27 -0
  51. package/dist/extensions/DisplayConditions/settingsPanel.js +17 -0
  52. package/dist/guido.css +1 -1
  53. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +272 -192
  54. package/dist/node_modules/valibot/dist/index.js +297 -261
  55. package/dist/package.json.js +1 -1
  56. package/dist/services/displayConditionApi.js +39 -0
  57. package/dist/sprite.svg +0 -10
  58. package/dist/src/@types/config/schemas.d.ts +4 -2
  59. package/dist/src/@types/display-condition.d.ts +59 -0
  60. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +1 -19
  61. package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +43 -0
  62. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +19 -1
  63. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +19 -1
  64. package/dist/src/composables/useActionsApi.d.ts +2 -2
  65. package/dist/src/composables/useConfig.d.ts +2 -2
  66. package/dist/src/composables/useDisplayConditions.d.ts +16 -0
  67. package/dist/src/enums/academy.d.ts +1 -0
  68. package/dist/src/enums/display-condition.d.ts +15 -0
  69. package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +1 -0
  70. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +8 -0
  71. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +40 -0
  72. package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +1 -0
  73. package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +1 -0
  74. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +11 -0
  75. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +7 -0
  76. package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +2 -0
  77. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +18 -3
  78. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +7 -0
  79. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +7 -0
  80. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +7 -0
  81. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +7 -0
  82. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +7 -0
  83. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +7 -0
  84. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +8 -1
  85. package/dist/src/extensions/Blocks/Recommendation/utils/blockRefresh.d.ts +17 -0
  86. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +7 -0
  87. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +1 -0
  88. package/dist/src/extensions/Blocks/controlFactories.d.ts +22 -0
  89. package/dist/src/extensions/DisplayConditions/bridge.d.ts +6 -0
  90. package/dist/src/extensions/DisplayConditions/constants.d.ts +14 -0
  91. package/dist/src/extensions/DisplayConditions/control.d.ts +23 -0
  92. package/dist/src/extensions/DisplayConditions/extension.d.ts +2 -0
  93. package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +4 -0
  94. package/dist/src/extensions/DisplayConditions/library.d.ts +8 -0
  95. package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +5 -0
  96. package/dist/src/mock/api/display-conditions.d.ts +2 -0
  97. package/dist/src/services/displayConditionApi.d.ts +8 -0
  98. package/dist/src/stores/autosave.d.ts +1 -73
  99. package/dist/src/stores/config.d.ts +166 -20
  100. package/dist/src/stores/display-condition.d.ts +81 -0
  101. package/dist/src/stores/editor.d.ts +0 -109
  102. package/dist/src/stores/onboarding.d.ts +21 -952
  103. package/dist/src/stores/version-history.d.ts +1 -1
  104. package/dist/src/utils/displayCondition.d.ts +10 -0
  105. package/dist/src/utils/protectTableText.d.ts +2 -0
  106. package/dist/src/utils/timeUtil.d.ts +0 -5
  107. package/dist/static/styles/components/button.css.js +5 -0
  108. package/dist/static/styles/variables.css.js +0 -2
  109. package/dist/stores/autosave.js +7 -12
  110. package/dist/stores/config.js +7 -0
  111. package/dist/stores/display-condition.js +28 -0
  112. package/dist/stores/editor.js +4 -7
  113. package/dist/stores/onboarding.js +21 -43
  114. package/dist/utils/displayCondition.js +26 -0
  115. package/dist/utils/pairProductVariables.js +15 -14
  116. package/dist/utils/protectTableText.js +22 -0
  117. package/dist/utils/timeUtil.js +17 -6
  118. package/package.json +3 -3
  119. package/dist/components/organisms/header/AutoSaveStatus.vue.js +0 -17
  120. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +0 -25
  121. package/dist/components/organisms/header/EditorActionsMenu.vue.js +0 -20
  122. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +0 -98
  123. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +0 -18
  124. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +0 -37
  125. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +0 -22
  126. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +0 -48
  127. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +0 -19
  128. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +0 -90
  129. package/dist/composables/useAccessibilityApi.js +0 -45
  130. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +0 -2
  131. package/dist/src/composables/useAccessibilityApi.d.ts +0 -13
  132. package/dist/static/styles/components/accessibility.css.js +0 -234
  133. /package/dist/src/components/organisms/{header/AutoSaveStatus.vue.d.ts → display-conditions/DisplayConditionCreateDrawer.vue.d.ts} +0 -0
  134. /package/dist/src/components/organisms/{header/EditorActionsMenu.vue.d.ts → display-conditions/DisplayConditionSelectDrawer.vue.d.ts} +0 -0
  135. /package/dist/src/components/organisms/{header/accessibility/AccessibilityToolbar.vue.d.ts → display-conditions/DisplayConditionsHost.vue.d.ts} +0 -0
  136. /package/dist/src/components/organisms/header/{accessibility/ColorVisionSelect.vue.d.ts → AutoSaveToggle.vue.d.ts} +0 -0
package/README.md CHANGED
@@ -150,6 +150,7 @@ const config: GuidoConfigInput = {
150
150
  ui?: {
151
151
  showHeader?: boolean, // Default: true
152
152
  backButtonLabel?: string,
153
+ externalDisplayConditions?: boolean, // Default: false - Replace Stripo's display-condition UI with a Conditions tab in the settings panel and create/select drawers for reusable Liquid/Pongo display conditions.
153
154
  },
154
155
 
155
156
  // Optional: Feature toggles (defaults apply once initialized — see `ready` prop below)
@@ -1,5 +1,5 @@
1
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 T, union as h, lazy as I } from "../../node_modules/valibot/dist/index.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 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,
@@ -76,30 +76,30 @@ const p = {
76
76
  value: t()
77
77
  })
78
78
  )
79
- }), f = I(() => C({
79
+ }), f = T(() => 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(c(f)),
84
+ children: e(n(f)),
85
85
  // eslint-disable-next-line camelcase -- backend field name
86
- select_items: e(c(f))
87
- })), N = g(
86
+ select_items: e(n(f))
87
+ })), x = g(
88
88
  t(),
89
- R(c(f), [])
90
- ), P = C({
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(c(r())),
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(c(r())),
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(c(r())),
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
- }), v = a({
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(), P),
143
+ g(t(), D),
144
144
  {}
145
145
  )
146
- }), x = a({
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
- c(M),
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(N, {}),
162
+ dynamicContentList: e(x, {}),
163
163
  /** Valid custom field attribute names from the partner's categorized fields */
164
- customFieldAttributes: e(c(t()), []),
164
+ customFieldAttributes: e(n(t()), []),
165
165
  /** Selected unsubscribe page IDs */
166
- selectedUnsubscribePages: e(c(s()), []),
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((n) => Number.isFinite(n) ? Math.max(0, Math.floor(n)) : 0)
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((n) => n && typeof n == "object" ? { ...n } : void 0)
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(v, {})
198
- }), D = a({
197
+ migration: e(N, {})
198
+ }), v = a({
199
199
  /** Sender display name */
200
200
  senderName: e(t(), ""),
201
201
  /** Email subject line */
@@ -208,7 +208,7 @@ const p = {
208
208
  /** Migration date for template compatibility */
209
209
  migrationDate: e(s(), 1759696858),
210
210
  /** Email header settings */
211
- emailHeader: e(D, { senderName: "", subject: "" }),
211
+ emailHeader: e(v, { senderName: "", subject: "" }),
212
212
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
213
213
  savedModulesFolderName: e(t(), S.SAVED_MODULES),
214
214
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
@@ -217,7 +217,9 @@ const p = {
217
217
  /** Whether to show the header bar */
218
218
  showHeader: e(o(), !0),
219
219
  /** Custom label for back button (if shown) */
220
- backButtonLabel: e(t())
220
+ backButtonLabel: e(t()),
221
+ /** Replace Stripo's display-condition UI with the Conditions tab and create/select drawers */
222
+ externalDisplayConditions: e(o(), !1)
221
223
  }), U = a({
222
224
  /** Enable dynamic content insertion */
223
225
  dynamicContent: e(o(), !0),
@@ -237,7 +239,6 @@ const p = {
237
239
  liquidSyntax: e(o(), !1),
238
240
  /** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
239
241
  autosave: e(o(), !1),
240
- accessibilityTesting: e(o(), !1),
241
242
  /** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
242
243
  allowlistEnabled: e(o(), !1),
243
244
  /** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
@@ -270,12 +271,12 @@ const p = {
270
271
  ]), j = a({
271
272
  /** Default blocks to exclude from the editor */
272
273
  excludeDefaults: e(
273
- c(w),
274
+ n(w),
274
275
  []
275
276
  ),
276
277
  /** Custom blocks to include in the editor */
277
278
  includeCustoms: e(
278
- c(B),
279
+ n(B),
279
280
  []
280
281
  )
281
282
  }), d = a({
@@ -307,23 +308,23 @@ const p = {
307
308
  ...d.entries,
308
309
  type: u("remove"),
309
310
  /** Strings or patterns to remove */
310
- targets: c(t())
311
+ targets: n(t())
311
312
  }), G = a({
312
313
  ...d.entries,
313
314
  type: u("custom"),
314
315
  /** Custom processor function */
315
316
  processor: k(
316
- (n) => typeof n == "function",
317
+ (c) => typeof c == "function",
317
318
  "processor must be a function"
318
319
  )
319
- }), V = T("type", [
320
+ }), V = I("type", [
320
321
  H,
321
322
  _,
322
323
  q,
323
324
  G
324
325
  ]), z = a({
325
326
  /** Custom compiler rules to apply */
326
- customRules: e(c(V), []),
327
+ customRules: e(n(V), []),
327
328
  /** Skip default compiler rules */
328
329
  ignoreDefaultRules: e(o(), !1)
329
330
  }), W = a({
@@ -333,7 +334,7 @@ const p = {
333
334
  */
334
335
  externalValidation: e(
335
336
  k(
336
- (n) => typeof n == "function",
337
+ (c) => typeof c == "function",
337
338
  "externalValidation must be a function"
338
339
  )
339
340
  )
@@ -345,7 +346,7 @@ const p = {
345
346
  partner: E,
346
347
  // Optional sections (with defaults)
347
348
  /** Template content and presets */
348
- template: e(x, {}),
349
+ template: e(P, {}),
349
350
  /** Editor settings */
350
351
  editor: e(O, {}),
351
352
  /** UI configuration */
@@ -367,23 +368,23 @@ export {
367
368
  B as CustomBlockTypeSchema,
368
369
  G as CustomRuleSchema,
369
370
  w as DefaultBlockTypeSchema,
370
- N as DynamicContentListSchema,
371
+ x as DynamicContentListSchema,
371
372
  f as DynamicContentNodeSchema,
372
373
  M as DynamicContentSchema,
373
374
  O as EditorSchema,
374
- D as EmailHeaderSchema,
375
+ v as EmailHeaderSchema,
375
376
  L as FallbackFontSchema,
376
377
  U as FeaturesSchema,
377
378
  K as GuidoConfigSchema,
378
379
  A as IdentitySchema,
379
- P as LegacyRecommendationConfigSchema,
380
+ D as LegacyRecommendationConfigSchema,
380
381
  p as MessageType,
381
382
  E as PartnerSchema,
382
383
  l as ProductType,
383
384
  _ as RegexRuleSchema,
384
385
  q as RemoveRuleSchema,
385
386
  H as ReplaceRuleSchema,
386
- v as TemplateMigrationSchema,
387
- x as TemplateSchema,
387
+ N as TemplateMigrationSchema,
388
+ P as TemplateSchema,
388
389
  F as UISchema
389
390
  };
@@ -0,0 +1,25 @@
1
+ import { object as e, optional as a, string as o, nullish as i, number as t, picklist as n, array as c } from "../node_modules/valibot/dist/index.js";
2
+ const s = n(["liquid", "pongo"]), d = n(["codeOnly", "logicBuilder"]), r = e({
3
+ id: t(),
4
+ name: o(),
5
+ description: i(o(), ""),
6
+ syntax: s,
7
+ method: d,
8
+ codeBefore: o(),
9
+ codeAfter: i(o(), ""),
10
+ createdAt: a(o())
11
+ }), p = e({
12
+ data: c(r),
13
+ meta: e({
14
+ totalCount: t(),
15
+ perPage: t(),
16
+ currentPage: t(),
17
+ lastPage: t()
18
+ })
19
+ });
20
+ export {
21
+ p as DisplayConditionListResponseSchema,
22
+ d as DisplayConditionMethodSchema,
23
+ s as DisplayConditionSyntaxSchema,
24
+ r as SavedDisplayConditionSchema
25
+ };
@@ -1,20 +1,20 @@
1
- import o from "./Guido.vue2.js";
1
+ import i from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import i from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import o 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), r(e.AutoSaveController, { ref: "autoSaveControllerRef" }), 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.AuthErrorModal), 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.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), 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.AuthErrorModal), 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.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), e.isExternalDisplayConditionsEnabled ? r(e.DisplayConditionsHost) : a._e(), 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
- }, s = [], n = /* @__PURE__ */ i(
10
- o,
9
+ }, s = [], n = /* @__PURE__ */ o(
10
+ i,
11
11
  t,
12
12
  s,
13
13
  !1,
14
14
  null,
15
- "6a54dbe6"
15
+ "22e84203"
16
16
  );
17
- const c = n.exports;
17
+ const v = n.exports;
18
18
  export {
19
- c as default
19
+ v as default
20
20
  };
@@ -1,35 +1,35 @@
1
- import { defineComponent as ie, defineAsyncComponent as m, ref as V, computed as p, watch as H, onMounted as ae, onUnmounted as ce } from "vue";
2
- import { useCortexBlueprintBridge as de } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as me } from "../composables/useEditorLock.js";
4
- import { provideGuidoActions as le } from "../composables/useGuidoActions.js";
5
- import { useGuidoStateBridge as ue } from "../composables/useGuidoStateBridge.js";
6
- import { usePartner as pe } from "../composables/usePartner.js";
7
- import { useSaveValidationRollout as fe } from "../composables/useSaveValidationRollout.js";
8
- import { useStripo as ye } from "../composables/useStripo.js";
9
- import { useTimerClone as ge } from "../composables/useTimerClone.js";
10
- import { migrate as W } from "../config/migrator/index.js";
11
- import { ModuleFolderDefaults as G } from "../enums/defaults.js";
12
- import { RIBBON_SELECTOR as Se } from "../enums/onboarding.js";
1
+ import { defineComponent as ce, defineAsyncComponent as c, ref as W, computed as l, watch as G, onMounted as de, onUnmounted as me } from "vue";
2
+ import { useCortexBlueprintBridge as le } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useEditorLock as ue } from "../composables/useEditorLock.js";
4
+ import { provideGuidoActions as pe } from "../composables/useGuidoActions.js";
5
+ import { useGuidoStateBridge as fe } from "../composables/useGuidoStateBridge.js";
6
+ import { usePartner as ye } from "../composables/usePartner.js";
7
+ import { useSaveValidationRollout as ge } from "../composables/useSaveValidationRollout.js";
8
+ import { useStripo as Se } from "../composables/useStripo.js";
9
+ import { useTimerClone as ve } from "../composables/useTimerClone.js";
10
+ import { migrate as H } from "../config/migrator/index.js";
11
+ import { ModuleFolderDefaults as V } from "../enums/defaults.js";
12
+ import { RIBBON_SELECTOR as be } from "../enums/onboarding.js";
13
13
  import { useRecommendationExtensionStore as E } from "../extensions/Blocks/Recommendation/store/recommendation.js";
14
- import ve from "./organisms/AutoSaveController.vue.js";
15
- import be from "./organisms/base/AuthErrorModal.vue.js";
16
- import he from "./organisms/base/Toaster.vue.js";
17
- import Ee from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
18
- import we from "./organisms/header/HeaderWrapper.vue.js";
19
- import Ce from "./organisms/LoadingWrapper.vue.js";
20
- import De from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
21
- import ke from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
22
- import Te from "./organisms/validation/ValidationErrorDrawer.vue.js";
23
- import { useStripoApi as Fe } from "../services/stripoApi.js";
24
- import { useConfigStore as Me } from "../stores/config.js";
25
- import { useDynamicContentStore as Re } from "../stores/dynamic-content.js";
26
- import { useEditorStore as w } from "../stores/editor.js";
27
- import { usePreviewStore as Ie } from "../stores/preview.js";
28
- import { useSaveValidationStore as Le } from "../stores/save-validation.js";
29
- import { useTemplateStore as Ae } from "../stores/template.js";
30
- import { useUnsubscribeStore as Oe } from "../stores/unsubscribe.js";
14
+ import he from "./organisms/AutoSaveController.vue.js";
15
+ import Ee from "./organisms/base/AuthErrorModal.vue.js";
16
+ import De from "./organisms/base/Toaster.vue.js";
17
+ import we from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
18
+ import Ce from "./organisms/header/HeaderWrapper.vue.js";
19
+ import ke from "./organisms/LoadingWrapper.vue.js";
20
+ import Fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
21
+ import Re from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
22
+ import Me from "./organisms/validation/ValidationErrorDrawer.vue.js";
23
+ import { useStripoApi as Te } from "../services/stripoApi.js";
24
+ import { useConfigStore as Ie } from "../stores/config.js";
25
+ import { useDynamicContentStore as Le } from "../stores/dynamic-content.js";
26
+ import { useEditorStore as D } from "../stores/editor.js";
27
+ import { usePreviewStore as Ue } from "../stores/preview.js";
28
+ import { useSaveValidationStore as Ae } from "../stores/save-validation.js";
29
+ import { useTemplateStore as Be } from "../stores/template.js";
30
+ import { useUnsubscribeStore as Ne } from "../stores/unsubscribe.js";
31
31
  import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
32
- const lt = /* @__PURE__ */ ie({
32
+ const pt = /* @__PURE__ */ ce({
33
33
  __name: "Guido",
34
34
  props: {
35
35
  config: null,
@@ -37,32 +37,27 @@ const lt = /* @__PURE__ */ ie({
37
37
  },
38
38
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
39
39
  setup(z, { expose: q, emit: r }) {
40
- const a = z, K = m(
40
+ const s = z, K = c(
41
41
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
42
- ), j = m(
42
+ ), j = c(
43
43
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
44
- ), J = m(
44
+ ), J = c(
45
45
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
46
- ), Q = m(
46
+ ), Q = c(
47
47
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
48
- ), C = V(), X = m(
48
+ ), X = c(
49
+ () => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
50
+ ), Y = c(
49
51
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
50
- ), f = V(), y = Re(), D = Oe(), o = Me();
51
- a.ready && o.init(a.config);
52
- const s = w(), Y = Ie(), l = p(() => s.hasChanges), { isTestPartner: Z } = pe(), { isEnabled: ee } = fe(), k = () => {
52
+ ), w = W(), f = W(), y = Le(), C = Ne(), o = Ie();
53
+ s.ready && o.init(s.config);
54
+ const d = D(), Z = Ue(), u = l(() => d.hasChanges), { isTestPartner: ee } = ye(), { isEnabled: te } = ge(), k = () => {
53
55
  var t;
54
- if (!s.isNormalMode) {
55
- console.debug("guido:save:silent:blocked", {
56
- isVersionHistoryOpen: s.isVersionHistoryOpen,
57
- isAccessibilityTestingOpen: s.isAccessibilityTestingOpen
58
- });
59
- return;
60
- }
61
- return (t = C.value) == null ? void 0 : t.saveSilent();
62
- }, T = (t) => {
63
- s.loadingStatus = t;
56
+ return (t = w.value) == null ? void 0 : t.handleSave(!0);
57
+ }, F = (t) => {
58
+ d.loadingStatus = t;
64
59
  };
65
- de(), ue();
60
+ le(), fe();
66
61
  const g = () => {
67
62
  var t, e;
68
63
  return {
@@ -70,18 +65,18 @@ const lt = /* @__PURE__ */ ie({
70
65
  userId: o.userId,
71
66
  username: o.username,
72
67
  partnerName: o.partnerName,
73
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
74
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
68
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || V.SAVED_MODULES,
69
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || V.DEFAULT_MODULES
75
70
  };
76
- }, { initPlugin: F, preloadRuntime: M } = ye(), { runExclusive: R, beginMount: I, isCurrentMount: S } = me();
77
- let u = 0;
78
- const { getDefaultTemplate: L } = Fe(), { cloneTimersOnSave: A, hasTimerBlocks: O } = ge(), te = p(() => {
71
+ }, { initPlugin: R, preloadRuntime: M } = Se(), { runExclusive: T, beginMount: I, isCurrentMount: S } = ue();
72
+ let p = 0;
73
+ const { getDefaultTemplate: L } = Te(), { cloneTimersOnSave: U, hasTimerBlocks: A } = ve(), oe = l(() => {
79
74
  var t;
80
75
  return !((t = o.ui) != null && t.showHeader);
81
- }), oe = p(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ne = p(
76
+ }), ne = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), re = l(() => o.externalDisplayConditions), ae = l(
82
77
  () => !!E().recommendationConfigs.strategyId
83
78
  );
84
- le({
79
+ pe({
85
80
  onBack: () => {
86
81
  console.debug("guido:back"), r("back");
87
82
  },
@@ -96,73 +91,73 @@ const lt = /* @__PURE__ */ ie({
96
91
  console.debug("guido:test-email:click"), r("test-email:click");
97
92
  }
98
93
  });
99
- const U = (t) => {
94
+ const B = (t) => {
100
95
  console.debug("dynamic-content:close", t), y.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
101
96
  }, N = () => {
102
97
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
103
98
  };
104
- H(() => l.value, () => {
105
- r("on-change", l.value);
99
+ G(() => u.value, () => {
100
+ r("on-change", u.value);
106
101
  });
107
102
  const v = (t) => {
108
- const e = t, { attribute: i, position: d } = e.detail;
109
- console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", i, d);
103
+ const e = t, { attribute: a, position: m } = e.detail;
104
+ console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", a, m);
110
105
  };
111
- let c = null;
106
+ let i = null;
112
107
  const b = () => {
113
108
  var e;
114
- const t = document.querySelector(Se);
109
+ const t = document.querySelector(be);
115
110
  (e = f.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
116
111
  }, h = async () => {
117
112
  var t;
118
113
  try {
119
- o.initialized || o.init(a.config), s.templateId = o.templateId;
120
- const e = o.template, i = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
121
- D.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
122
- const P = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, _ = o.isFeatureEnabled("linkTrackingIds"), x = {
114
+ o.initialized || o.init(s.config), d.templateId = o.templateId;
115
+ const e = o.template, a = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "", x = (e == null ? void 0 : e.preselectedDynamicContent) || [];
116
+ C.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
117
+ const P = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, _ = o.isFeatureEnabled("linkTrackingIds"), O = {
123
118
  partnerName: o.partnerName,
124
119
  campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
125
120
  rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
126
121
  };
127
122
  let n = {
128
- html: i && await W(i, P, x),
129
- css: d
123
+ html: a && await H(a, P, O),
124
+ css: m
130
125
  };
131
- n.html || (n = await L(), n.html = await W(n.html, P, x));
132
- const re = _ ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
133
- O(n.html) && (n.html = await A(n.html)), _ && (s.trackIdSessionFloor = Math.max(re, $(n.html)));
134
- const se = {
135
- preselectedDynamicContentList: B,
126
+ n.html || (n = await L(), n.html = await H(n.html, P, O));
127
+ const se = _ ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
128
+ A(n.html) && (n.html = await U(n.html)), _ && (d.trackIdSessionFloor = Math.max(se, $(n.html)));
129
+ const ie = {
130
+ preselectedDynamicContentList: x,
136
131
  onReady: () => {
137
132
  console.debug("guido:ready"), r("ready");
138
133
  }
139
134
  };
140
- u = I(), await F(n, g(), se), y.selectedDynamicContentList = B;
135
+ p = I(), await R(n, g(), ie), y.selectedDynamicContentList = x;
141
136
  } catch (e) {
142
137
  console.error("Failed to initialize Stripo editor:", e);
143
138
  }
144
139
  };
145
- return ae(async () => {
140
+ return de(async () => {
146
141
  var e;
147
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), E().$reset(), w().$reset(), Ae().$reset(), Le().$reset(), b();
142
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), E().$reset(), D().$reset(), Be().$reset(), Ae().$reset(), b();
148
143
  const t = (e = f.value) == null ? void 0 : e.parentElement;
149
- if (t && (c = new ResizeObserver(b), c.observe(t)), M(), a.ready)
144
+ if (t && (i = new ResizeObserver(b), i.observe(t)), M(), s.ready)
150
145
  await h();
151
146
  else {
152
- const i = H(() => a.ready, (d) => {
153
- d && (i(), h());
147
+ const a = G(() => s.ready, (m) => {
148
+ m && (a(), h());
154
149
  });
155
150
  }
156
151
  document.addEventListener("dynamic-content:open", v);
157
- }), ce(() => {
158
- if (c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", v), E().disposeStrategyPageReturn(), S(u))
152
+ }), me(() => {
153
+ if (i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), E().disposeStrategyPageReturn(), S(p))
159
154
  try {
160
- w().isStripoInitialized = !1;
155
+ D().isStripoInitialized = !1;
161
156
  } catch (t) {
162
157
  console.debug("Failed to close the editor readiness gate on unmount", t);
163
158
  }
164
- R(async () => {
165
- if (S(u))
159
+ T(async () => {
160
+ if (S(p))
166
161
  try {
167
162
  window.UIEditor.removeEditor();
168
163
  } catch {
@@ -171,15 +166,15 @@ const lt = /* @__PURE__ */ ie({
171
166
  }), o.reset();
172
167
  }), q({
173
168
  dynamicContent: {
174
- insert: U,
169
+ insert: B,
175
170
  close: N
176
171
  },
177
- hasChanges: l,
172
+ hasChanges: u,
178
173
  saveSilent: k,
179
- setLoading: T
180
- }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, autoSaveControllerRef: C, LegacyStrategyUpdatedModal: X, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: D, props: a, configStore: o, editorStore: s, previewStore: Y, hasChanges: l, isTestPartner: Z, isSaveValidationEnabled: ee, saveSilent: k, setLoading: T, emit: r, buildMetadata: g, initPlugin: F, preloadRuntime: M, runExclusive: R, beginMount: I, isCurrentMount: S, mountGeneration: u, getDefaultTemplate: L, cloneTimersOnSave: A, hasTimerBlocks: O, noHeader: te, isRrsEnabled: oe, hasAssignedStrategy: ne, insertDynamicContent: U, closeDynamicContent: N, handleDynamicContentOpen: v, ribbonObserver: c, updateRibbonOffset: b, startEditor: h, AutoSaveController: ve, AuthErrorModal: be, Toaster: he, FilterSelectionDrawer: Ee, HeaderWrapper: we, LoadingWrapper: Ce, SaveAsTemplateDrawer: De, UnsubscribeWrapper: ke, ValidationErrorDrawer: Te };
174
+ setLoading: F
175
+ }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, DisplayConditionsHost: X, LegacyStrategyUpdatedModal: Y, headerWrapperRef: w, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: C, props: s, configStore: o, editorStore: d, previewStore: Z, hasChanges: u, isTestPartner: ee, isSaveValidationEnabled: te, saveSilent: k, setLoading: F, emit: r, buildMetadata: g, initPlugin: R, preloadRuntime: M, runExclusive: T, beginMount: I, isCurrentMount: S, mountGeneration: p, getDefaultTemplate: L, cloneTimersOnSave: U, hasTimerBlocks: A, noHeader: oe, isRrsEnabled: ne, isExternalDisplayConditionsEnabled: re, hasAssignedStrategy: ae, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: b, startEditor: h, AutoSaveController: he, AuthErrorModal: Ee, Toaster: De, FilterSelectionDrawer: we, HeaderWrapper: Ce, LoadingWrapper: ke, SaveAsTemplateDrawer: Fe, UnsubscribeWrapper: Re, ValidationErrorDrawer: Me };
181
176
  }
182
177
  });
183
178
  export {
184
- lt as default
179
+ pt as default
185
180
  };
@@ -1,24 +1,14 @@
1
- import { defineComponent as i } from "vue";
2
- import { useAutoSave as l } from "../../composables/useAutoSave.js";
3
- import { useSave as m } from "../../composables/useSave.js";
4
- import { useSaveValidationRollout as c } from "../../composables/useSaveValidationRollout.js";
5
- import { useToaster as p } from "../../composables/useToaster.js";
6
- const b = /* @__PURE__ */ i({
1
+ import { defineComponent as r } from "vue";
2
+ import { useAutoSave as s } from "../../composables/useAutoSave.js";
3
+ import { useSave as n } from "../../composables/useSave.js";
4
+ import { useSaveValidationRollout as u } from "../../composables/useSaveValidationRollout.js";
5
+ const v = /* @__PURE__ */ r({
7
6
  __name: "AutoSaveController",
8
- setup(v, { expose: n }) {
9
- const { save: e, saveRawOnly: t } = m(), { isEnabled: o } = c(), { handleError: r } = p(), a = () => o.value ? t() : e(!1, !0);
10
- l(a);
11
- const s = async () => {
12
- try {
13
- return await e(!0);
14
- } catch (u) {
15
- r(u, "Failed to save template");
16
- return;
17
- }
18
- };
19
- return n({ saveSilent: s }), { __sfc: !0, save: e, saveRawOnly: t, isEnabled: o, handleError: r, backgroundSave: a, saveSilent: s };
7
+ setup(m) {
8
+ const { save: e, saveRawOnly: o } = n(), { isEnabled: t } = u(), a = () => t.value ? o() : e(!1, !0);
9
+ return s(a), { __sfc: !0, save: e, saveRawOnly: o, isEnabled: t, backgroundSave: a };
20
10
  }
21
11
  });
22
12
  export {
23
- b as default
13
+ v as default
24
14
  };
@@ -0,0 +1,20 @@
1
+ import i from "./CodeEditorField.vue2.js";
2
+ /* empty css */
3
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = function() {
5
+ var e = this, r = e._self._c, o = e._self._setupProxy;
6
+ return r("div", { staticClass: "guido-code-editor-field", attrs: { id: e.id } }, [r("p", { staticClass: "guido-code-editor-field__label" }, [e._v(" " + e._s(e.label) + " ")]), r(o.InCodeSnippet, { attrs: { code: e.value, disable: e.disabled, "focus-editor": !1, invalid: !!e.error, "invalid-message": e.error, options: o.options, size: { height: e.error ? 196 : 216 }, "syntax-check": !1 }, on: { input: function(t) {
7
+ return o.emit("input", t);
8
+ }, ready: o.onReady } })], 1);
9
+ }, n = [], d = /* @__PURE__ */ s(
10
+ i,
11
+ a,
12
+ n,
13
+ !1,
14
+ null,
15
+ "e96c7aa3"
16
+ );
17
+ const p = d.exports;
18
+ export {
19
+ p as default
20
+ };