@useinsider/guido 3.18.0-beta.599df29 → 3.18.0-beta.6817b07

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 (52) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +28 -26
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +83 -85
  5. package/dist/components/organisms/AutoSaveController.vue2.js +9 -8
  6. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  7. package/dist/components/organisms/header/EditorActions.vue2.js +72 -54
  8. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  9. package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
  10. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
  11. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +48 -0
  12. package/dist/components/wrappers/WpDrawer.vue.js +9 -7
  13. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  14. package/dist/composables/useActionsApi.js +67 -82
  15. package/dist/composables/useAutoSave.js +26 -31
  16. package/dist/composables/useGuidoStateBridge.js +31 -37
  17. package/dist/composables/useHtmlCompiler.js +37 -26
  18. package/dist/composables/useHtmlValidator.js +2 -0
  19. package/dist/composables/useSave.js +89 -47
  20. package/dist/composables/useSaveValidation.js +279 -0
  21. package/dist/composables/useSaveValidationRollout.js +9 -0
  22. package/dist/composables/validators/useCouponBlockValidator.js +24 -21
  23. package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
  24. package/dist/enums/save-validation.js +4 -0
  25. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +41 -34
  26. package/dist/guido.css +1 -1
  27. package/dist/src/@types/config/schemas.d.ts +4 -0
  28. package/dist/src/@types/save-validation.d.ts +19 -0
  29. package/dist/src/components/Guido.vue.d.ts +17 -1
  30. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
  31. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
  32. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
  33. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
  34. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
  35. package/dist/src/composables/useConfig.d.ts +2 -0
  36. package/dist/src/composables/useHtmlValidator.d.ts +21 -0
  37. package/dist/src/composables/useSave.d.ts +6 -1
  38. package/dist/src/composables/useSaveValidation.d.ts +6 -0
  39. package/dist/src/composables/useSaveValidationRollout.d.ts +3 -0
  40. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  41. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
  42. package/dist/src/enums/save-validation.d.ts +27 -0
  43. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +5 -0
  44. package/dist/src/stores/config.d.ts +30 -0
  45. package/dist/src/stores/save-validation.d.ts +22 -0
  46. package/dist/src/utils/templatePreparation.d.ts +30 -0
  47. package/dist/stores/config.js +39 -22
  48. package/dist/stores/save-validation.js +30 -0
  49. package/dist/utils/templatePreparation.js +28 -25
  50. package/package.json +1 -1
  51. package/dist/composables/useEditorLock.js +0 -20
  52. package/dist/src/composables/useEditorLock.d.ts +0 -10
package/README.md CHANGED
@@ -162,6 +162,7 @@ const config: GuidoConfigInput = {
162
162
  liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
163
163
  autosave?: boolean, // Default: false - Show the Auto Save toggle in the header. See wiki/AUTOSAVE.md.
164
164
  allowlistEnabled?: boolean, // Default: false - Pre-save domain-allowlist check (opt-in). Guido self-serves the block toaster (role lookup, deep-link, copy from window.trans).
165
+ allowSaveWithErrors?: boolean, // Default: true - Allow the validation drawer's "Save and Continue" soft-save. Set false to hard-block invalid saves (transactional + unsubscribe pages).
165
166
  reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
166
167
  },
167
168
 
@@ -30,7 +30,7 @@ const p = {
30
30
  name: t(),
31
31
  /** Fallback font family (e.g., "serif" or "sans-serif") */
32
32
  family: t()
33
- }), M = a({
33
+ }), E = a({
34
34
  /** Partner/organization name (required) */
35
35
  name: m(
36
36
  t(),
@@ -54,7 +54,7 @@ const p = {
54
54
  username: e(t(), "Guido User"),
55
55
  /** Fallback font settings from partner settings — used to match backend size calculation */
56
56
  fallbackFont: e(L)
57
- }), E = a({
57
+ }), M = a({
58
58
  /** Display text for the dynamic content */
59
59
  text: t(),
60
60
  /** Template variable value (e.g., {{username}}) */
@@ -76,10 +76,10 @@ const p = {
76
76
  children: e(c(S)),
77
77
  // eslint-disable-next-line camelcase -- backend field name
78
78
  select_items: e(c(S))
79
- })), N = k(
79
+ })), v = k(
80
80
  t(),
81
81
  R(c(S), [])
82
- ), P = g({
82
+ ), N = g({
83
83
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
84
84
  id: e(n()),
85
85
  /** Decimal places for price display (legacy data may use string or number) */
@@ -124,7 +124,7 @@ const p = {
124
124
  isPriceMovedToNextLine: e(o()),
125
125
  /** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
126
126
  isPriceDeletedForZeroSale: e(o())
127
- }), v = a({
127
+ }), P = a({
128
128
  /**
129
129
  * Legacy recommendation block configs keyed by block ID.
130
130
  * Pass this when loading a template authored with the v1
@@ -132,7 +132,7 @@ const p = {
132
132
  * strategy, currency, locale, and layout data.
133
133
  */
134
134
  recommendationConfigs: e(
135
- k(t(), P),
135
+ k(t(), N),
136
136
  {}
137
137
  )
138
138
  }), x = a({
@@ -142,7 +142,7 @@ const p = {
142
142
  css: e(t(), ""),
143
143
  /** Preselected dynamic content items */
144
144
  preselectedDynamicContent: e(
145
- c(E),
145
+ c(M),
146
146
  []
147
147
  ),
148
148
  /**
@@ -151,7 +151,7 @@ const p = {
151
151
  * (first) partner's leaf attributes into the label→token map that repairs
152
152
  * label-form placeholders (`{{ Phone Number }}`) in dropped saved modules.
153
153
  */
154
- dynamicContentList: e(N, {}),
154
+ dynamicContentList: e(v, {}),
155
155
  /** Valid custom field attribute names from the partner's categorized fields */
156
156
  customFieldAttributes: e(c(t()), []),
157
157
  /** Selected unsubscribe page IDs */
@@ -173,7 +173,7 @@ const p = {
173
173
  0
174
174
  ),
175
175
  /** Migration-only inputs (legacy block configs) */
176
- migration: e(v, {})
176
+ migration: e(P, {})
177
177
  }), D = a({
178
178
  /** Sender display name */
179
179
  senderName: e(t(), ""),
@@ -220,8 +220,10 @@ const p = {
220
220
  allowlistEnabled: e(o(), !1),
221
221
  /** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
222
222
  linkTrackingIds: e(o(), !1),
223
+ /** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
224
+ allowSaveWithErrors: e(o(), !0),
223
225
  reusableRecommendationStrategy: e(o(), !1)
224
- }), B = i([
226
+ }), w = i([
225
227
  "amp-accordion",
226
228
  "amp-carousel",
227
229
  "amp-form-controls",
@@ -235,7 +237,7 @@ const p = {
235
237
  "text-block",
236
238
  "timer-block",
237
239
  "video-block"
238
- ]), w = i([
240
+ ]), B = i([
239
241
  "dynamic-content",
240
242
  "checkbox-block",
241
243
  "radio-button-block",
@@ -246,12 +248,12 @@ const p = {
246
248
  ]), H = a({
247
249
  /** Default blocks to exclude from the editor */
248
250
  excludeDefaults: e(
249
- c(B),
251
+ c(w),
250
252
  []
251
253
  ),
252
254
  /** Custom blocks to include in the editor */
253
255
  includeCustoms: e(
254
- c(w),
256
+ c(B),
255
257
  []
256
258
  )
257
259
  }), d = a({
@@ -302,7 +304,7 @@ const p = {
302
304
  customRules: e(c(V), []),
303
305
  /** Skip default compiler rules */
304
306
  ignoreDefaultRules: e(o(), !1)
305
- }), Z = a({
307
+ }), W = a({
306
308
  /**
307
309
  * External validation handler called before save completes.
308
310
  * Return false to cancel the save operation.
@@ -313,12 +315,12 @@ const p = {
313
315
  "externalValidation must be a function"
314
316
  )
315
317
  )
316
- }), Q = a({
318
+ }), K = a({
317
319
  // Required sections
318
320
  /** Identity configuration (required) */
319
321
  identity: A,
320
322
  /** Partner configuration (required) */
321
- partner: M,
323
+ partner: E,
322
324
  // Optional sections (with defaults)
323
325
  /** Template content and presets */
324
326
  template: e(x, {}),
@@ -333,33 +335,33 @@ const p = {
333
335
  /** Compiler configuration */
334
336
  compiler: e(z, {}),
335
337
  /** Callbacks and event handlers */
336
- callbacks: e(Z, {})
338
+ callbacks: e(W, {})
337
339
  });
338
340
  export {
339
341
  H as BlocksSchema,
340
- Z as CallbacksSchema,
342
+ W as CallbacksSchema,
341
343
  V as CompilerRuleSchema,
342
344
  z as CompilerSchema,
343
- w as CustomBlockTypeSchema,
345
+ B as CustomBlockTypeSchema,
344
346
  G as CustomRuleSchema,
345
- B as DefaultBlockTypeSchema,
346
- N as DynamicContentListSchema,
347
+ w as DefaultBlockTypeSchema,
348
+ v as DynamicContentListSchema,
347
349
  S as DynamicContentNodeSchema,
348
- E as DynamicContentSchema,
350
+ M as DynamicContentSchema,
349
351
  O as EditorSchema,
350
352
  D as EmailHeaderSchema,
351
353
  L as FallbackFontSchema,
352
354
  U as FeaturesSchema,
353
- Q as GuidoConfigSchema,
355
+ K as GuidoConfigSchema,
354
356
  A as IdentitySchema,
355
- P as LegacyRecommendationConfigSchema,
357
+ N as LegacyRecommendationConfigSchema,
356
358
  p as MessageType,
357
- M as PartnerSchema,
359
+ E as PartnerSchema,
358
360
  l as ProductType,
359
361
  j as RegexRuleSchema,
360
362
  q as RemoveRuleSchema,
361
363
  _ as ReplaceRuleSchema,
362
- v as TemplateMigrationSchema,
364
+ P as TemplateMigrationSchema,
363
365
  x as TemplateSchema,
364
366
  F as UISchema
365
367
  };
@@ -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, { 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(), 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__ */ i(
10
- o,
9
+ }, s = [], n = /* @__PURE__ */ o(
10
+ i,
11
11
  t,
12
12
  s,
13
13
  !1,
14
14
  null,
15
- "050dfa52"
15
+ "2db79b8f"
16
16
  );
17
- const f = n.exports;
17
+ const c = n.exports;
18
18
  export {
19
- f as default
19
+ c as default
20
20
  };
@@ -1,55 +1,56 @@
1
- import { defineComponent as ne, defineAsyncComponent as l, ref as O, computed as u, watch as P, onMounted as re, onUnmounted as se } from "vue";
2
- import { useCortexBlueprintBridge as ae } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as ie } 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";
9
- import { migrate as x } from "../config/migrator/index.js";
10
- import { ModuleFolderDefaults as W } from "../enums/defaults.js";
11
- import { RIBBON_SELECTOR as pe } from "../enums/onboarding.js";
12
- import { useRecommendationExtensionStore as G } 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";
18
- import be from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
- import he 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 H } from "../stores/editor.js";
24
- import { usePreviewStore as De } from "../stores/preview.js";
25
- import { useTemplateStore as ke } from "../stores/template.js";
26
- import { useUnsubscribeStore as Te } from "../stores/unsubscribe.js";
27
- import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
28
- const et = /* @__PURE__ */ ne({
1
+ import { defineComponent as ee, defineAsyncComponent as l, ref as A, computed as u, watch as U, onMounted as te, onUnmounted as oe } from "vue";
2
+ import { useCortexBlueprintBridge as ne } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as re } from "../composables/useGuidoActions.js";
4
+ import { useGuidoStateBridge as se } from "../composables/useGuidoStateBridge.js";
5
+ import { usePartner as ae } from "../composables/usePartner.js";
6
+ import { useSaveValidationRollout as ie } from "../composables/useSaveValidationRollout.js";
7
+ import { useStripo as ce } from "../composables/useStripo.js";
8
+ import { useTimerClone as de } from "../composables/useTimerClone.js";
9
+ import { migrate as _ } from "../config/migrator/index.js";
10
+ import { ModuleFolderDefaults as N } from "../enums/defaults.js";
11
+ import { RIBBON_SELECTOR as me } from "../enums/onboarding.js";
12
+ import { useRecommendationExtensionStore as O } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
+ import le from "./organisms/AutoSaveController.vue.js";
14
+ import ue from "./organisms/base/Toaster.vue.js";
15
+ import pe from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
+ import fe from "./organisms/header/HeaderWrapper.vue.js";
17
+ import ye from "./organisms/LoadingWrapper.vue.js";
18
+ import ge from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
+ import ve from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
+ import Se from "./organisms/validation/ValidationErrorDrawer.vue.js";
21
+ import { useStripoApi as be } from "../services/stripoApi.js";
22
+ import { useConfigStore as he } from "../stores/config.js";
23
+ import { useDynamicContentStore as Ee } from "../stores/dynamic-content.js";
24
+ import { useEditorStore as P } from "../stores/editor.js";
25
+ import { usePreviewStore as we } from "../stores/preview.js";
26
+ import { useTemplateStore as De } from "../stores/template.js";
27
+ import { useUnsubscribeStore as Ce } from "../stores/unsubscribe.js";
28
+ import { readTrackFloor as W } from "../utils/linkTrackingIds.js";
29
+ const Ze = /* @__PURE__ */ ee({
29
30
  __name: "Guido",
30
31
  props: {
31
32
  config: null,
32
33
  ready: { type: Boolean, default: !0 }
33
34
  },
34
35
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
35
- setup(z, { expose: q, emit: r }) {
36
- const a = z, K = l(
36
+ setup(x, { expose: G, emit: r }) {
37
+ const a = x, H = l(
37
38
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
38
39
  ), V = l(
39
40
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
40
- ), j = l(
41
+ ), $ = l(
41
42
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
42
- ), J = l(
43
+ ), z = l(
43
44
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
44
- ), h = O(), p = O(), f = Ce(), E = Te(), o = we();
45
+ ), b = A(), p = A(), f = Ee(), h = Ce(), o = he();
45
46
  a.ready && o.init(a.config);
46
- const c = H(), Q = De(), m = u(() => c.hasChanges), { isTestPartner: X } = me(), w = () => {
47
+ const c = P(), q = we(), m = u(() => c.hasChanges), { isTestPartner: K } = ae(), { isEnabled: j } = ie(), E = () => {
47
48
  var t;
48
- return (t = h.value) == null ? void 0 : t.handleSave(!0);
49
- }, C = (t) => {
49
+ return (t = b.value) == null ? void 0 : t.handleSave(!0);
50
+ }, w = (t) => {
50
51
  c.loadingStatus = t;
51
52
  };
52
- ae(), de();
53
+ ne(), se();
53
54
  const y = () => {
54
55
  var t, e;
55
56
  return {
@@ -57,18 +58,16 @@ const et = /* @__PURE__ */ ne({
57
58
  userId: o.userId,
58
59
  username: o.username,
59
60
  partnerName: o.partnerName,
60
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || W.SAVED_MODULES,
61
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || W.DEFAULT_MODULES
61
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
62
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
62
63
  };
63
- }, { initPlugin: D, preloadRuntime: k } = le(), { runExclusive: T, beginMount: F, isCurrentMount: I } = ie();
64
- let g = 0;
65
- const { getDefaultTemplate: M } = Ee(), { cloneTimersOnSave: R, hasTimerBlocks: L } = ue(), Y = u(() => {
64
+ }, { initPlugin: D, preloadRuntime: C } = ce(), { getDefaultTemplate: k } = be(), { cloneTimersOnSave: T, hasTimerBlocks: F } = de(), J = u(() => {
66
65
  var t;
67
66
  return !((t = o.ui) != null && t.showHeader);
68
- }), Z = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ee = u(
69
- () => !!G().recommendationConfigs.strategyId
67
+ }), Q = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), X = u(
68
+ () => !!O().recommendationConfigs.strategyId
70
69
  );
71
- ce({
70
+ re({
72
71
  onBack: () => {
73
72
  console.debug("guido:back"), r("back");
74
73
  },
@@ -83,80 +82,79 @@ const et = /* @__PURE__ */ ne({
83
82
  console.debug("guido:test-email:click"), r("test-email:click");
84
83
  }
85
84
  });
86
- const B = (t) => {
85
+ const R = (t) => {
87
86
  console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
88
- }, A = () => {
87
+ }, I = () => {
89
88
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
90
89
  };
91
- P(() => m.value, () => {
90
+ U(() => m.value, () => {
92
91
  r("on-change", m.value);
93
92
  });
94
- const v = (t) => {
93
+ const g = (t) => {
95
94
  const e = t, { attribute: s, position: d } = e.detail;
96
95
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
97
96
  };
98
97
  let i = null;
99
- const S = () => {
98
+ const v = () => {
100
99
  var e;
101
- const t = document.querySelector(pe);
100
+ const t = document.querySelector(me);
102
101
  (e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
103
- }, b = async () => {
102
+ }, S = async () => {
104
103
  var t;
105
104
  try {
106
105
  o.initialized || o.init(a.config), c.templateId = o.templateId;
107
- const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", U = (e == null ? void 0 : e.preselectedDynamicContent) || [];
108
- E.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
109
- const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, N = o.isFeatureEnabled("linkTrackingIds");
106
+ const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", L = (e == null ? void 0 : e.preselectedDynamicContent) || [];
107
+ h.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
108
+ const M = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, B = o.isFeatureEnabled("linkTrackingIds");
110
109
  let n = {
111
- html: s && await x(s, _),
110
+ html: s && await _(s, M),
112
111
  css: d
113
112
  };
114
- n.html || (n = await M(), n.html = await x(n.html, _));
115
- const te = N ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
116
- L(n.html) && (n.html = await R(n.html)), N && (c.trackIdSessionFloor = Math.max(te, $(n.html)));
117
- const oe = {
118
- preselectedDynamicContentList: U,
113
+ n.html || (n = await k(), n.html = await _(n.html, M));
114
+ const Y = B ? W(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
115
+ F(n.html) && (n.html = await T(n.html)), B && (c.trackIdSessionFloor = Math.max(Y, W(n.html)));
116
+ const Z = {
117
+ preselectedDynamicContentList: L,
119
118
  onReady: () => {
120
119
  console.debug("guido:ready"), r("ready");
121
120
  }
122
121
  };
123
- g = F(), await D(n, y(), oe), f.selectedDynamicContentList = U;
122
+ await D(n, y(), Z), f.selectedDynamicContentList = L;
124
123
  } catch (e) {
125
124
  console.error("Failed to initialize Stripo editor:", e);
126
125
  }
127
126
  };
128
- return re(async () => {
127
+ return te(async () => {
129
128
  var e;
130
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), G().$reset(), H().$reset(), ke().$reset(), S();
129
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), O().$reset(), P().$reset(), De().$reset(), v();
131
130
  const t = (e = p.value) == null ? void 0 : e.parentElement;
132
- if (t && (i = new ResizeObserver(S), i.observe(t)), k(), a.ready)
133
- await b();
131
+ if (t && (i = new ResizeObserver(v), i.observe(t)), C(), a.ready)
132
+ await S();
134
133
  else {
135
- const s = P(() => a.ready, (d) => {
136
- d && (s(), b());
134
+ const s = U(() => a.ready, (d) => {
135
+ d && (s(), S());
137
136
  });
138
137
  }
139
- document.addEventListener("dynamic-content:open", v);
140
- }), se(() => {
141
- i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), T(async () => {
142
- if (I(g))
143
- try {
144
- window.UIEditor.removeEditor();
145
- } catch {
146
- console.debug("Failed to remove Stripo editor: No editor found");
147
- }
148
- }), o.reset();
149
- }), q({
138
+ document.addEventListener("dynamic-content:open", g);
139
+ }), oe(() => {
140
+ i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", g);
141
+ try {
142
+ window.UIEditor.removeEditor();
143
+ } catch {
144
+ console.debug("Failed to remove Stripo editor: No editor found");
145
+ }
146
+ o.reset();
147
+ }), G({
150
148
  dynamicContent: {
151
- insert: B,
152
- close: A
149
+ insert: R,
150
+ close: I
153
151
  },
154
152
  hasChanges: m,
155
- saveSilent: w,
156
- setLoading: C
157
- }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, headerWrapperRef: h, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: E, props: a, configStore: o, editorStore: c, previewStore: Q, hasChanges: m, isTestPartner: X, saveSilent: w, setLoading: C, emit: r, buildMetadata: y, initPlugin: D, preloadRuntime: k, runExclusive: T, beginMount: F, isCurrentMount: I, mountGeneration: g, getDefaultTemplate: M, cloneTimersOnSave: R, hasTimerBlocks: L, noHeader: Y, isRrsEnabled: Z, hasAssignedStrategy: ee, insertDynamicContent: B, closeDynamicContent: A, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: S, startEditor: b, AutoSaveController: fe, Toaster: ye, FilterSelectionDrawer: ge, HeaderWrapper: ve, LoadingWrapper: Se, SaveAsTemplateDrawer: be, UnsubscribeWrapper: he };
153
+ saveSilent: E,
154
+ setLoading: w
155
+ }), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: V, AssignStrategyDrawer: $, RemoveStrategyModal: z, headerWrapperRef: b, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: h, props: a, configStore: o, editorStore: c, previewStore: q, hasChanges: m, isTestPartner: K, isSaveValidationEnabled: j, saveSilent: E, setLoading: w, emit: r, buildMetadata: y, initPlugin: D, preloadRuntime: C, getDefaultTemplate: k, cloneTimersOnSave: T, hasTimerBlocks: F, noHeader: J, isRrsEnabled: Q, hasAssignedStrategy: X, insertDynamicContent: R, closeDynamicContent: I, handleDynamicContentOpen: g, ribbonObserver: i, updateRibbonOffset: v, startEditor: S, AutoSaveController: le, Toaster: ue, FilterSelectionDrawer: pe, HeaderWrapper: fe, LoadingWrapper: ye, SaveAsTemplateDrawer: ge, UnsubscribeWrapper: ve, ValidationErrorDrawer: Se };
158
156
  }
159
157
  });
160
158
  export {
161
- et as default
159
+ Ze as default
162
160
  };
@@ -1,13 +1,14 @@
1
- import { defineComponent as t } from "vue";
2
- import { useAutoSave as r } from "../../composables/useAutoSave.js";
3
- import { useSave as s } from "../../composables/useSave.js";
4
- const f = /* @__PURE__ */ t({
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({
5
6
  __name: "AutoSaveController",
6
- setup(a) {
7
- const { save: e } = s(), o = () => e(!1, !0);
8
- return r(o), { __sfc: !0, save: e, backgroundSave: o };
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 };
9
10
  }
10
11
  });
11
12
  export {
12
- f as default
13
+ v as default
13
14
  };
@@ -4,7 +4,7 @@ import d from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var u = function() {
5
5
  var s, i, n, a;
6
6
  var o = this, e = o._self._c, t = o._self._setupProxy;
7
- return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(r) {
7
+ return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "label-text": t.saveLabel, "loading-status": t.isSaving }, on: { click: function(r) {
8
8
  return t.handleSave(!1);
9
9
  } } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
10
10
  return t.executeSave(!1);
@@ -15,7 +15,7 @@ var u = function() {
15
15
  p,
16
16
  !1,
17
17
  null,
18
- "1ca6baf0"
18
+ "eedf7416"
19
19
  );
20
20
  const v = c.exports;
21
21
  export {