@useinsider/guido 3.20.1-beta.dfc8426 → 3.20.1-beta.f34075e

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