@useinsider/guido 3.18.2-beta.8ef3138 → 3.18.2-beta.eedafd2

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 (50) 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 +53 -51
  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 +86 -56
  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/useHtmlCompiler.js +37 -26
  15. package/dist/composables/useHtmlValidator.js +2 -0
  16. package/dist/composables/useSave.js +90 -45
  17. package/dist/composables/useSaveValidation.js +279 -0
  18. package/dist/composables/useSaveValidationRollout.js +9 -0
  19. package/dist/composables/validators/useCouponBlockValidator.js +24 -21
  20. package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
  21. package/dist/enums/save-validation.js +4 -0
  22. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +43 -36
  23. package/dist/guido.css +1 -1
  24. package/dist/src/@types/config/schemas.d.ts +4 -0
  25. package/dist/src/@types/save-validation.d.ts +19 -0
  26. package/dist/src/components/Guido.vue.d.ts +17 -1
  27. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
  28. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
  29. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
  30. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
  31. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
  32. package/dist/src/composables/useConfig.d.ts +2 -0
  33. package/dist/src/composables/useHtmlValidator.d.ts +21 -0
  34. package/dist/src/composables/useSave.d.ts +6 -1
  35. package/dist/src/composables/useSaveValidation.d.ts +6 -0
  36. package/dist/src/composables/useSaveValidationRollout.d.ts +3 -0
  37. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  38. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
  39. package/dist/src/enums/save-validation.d.ts +27 -0
  40. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +5 -0
  41. package/dist/src/stores/config.d.ts +30 -0
  42. package/dist/src/stores/save-validation.d.ts +22 -0
  43. package/dist/src/utils/liquidDynamicContent.d.ts +20 -0
  44. package/dist/src/utils/templatePreparation.d.ts +30 -0
  45. package/dist/stores/config.js +39 -22
  46. package/dist/stores/save-validation.js +30 -0
  47. package/dist/utils/genericUtil.js +64 -61
  48. package/dist/utils/liquidDynamicContent.js +15 -0
  49. package/dist/utils/templatePreparation.js +28 -25
  50. package/package.json +1 -1
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
+ "584fdf72"
16
16
  );
17
- const f = n.exports;
17
+ const v = n.exports;
18
18
  export {
19
- f as default
19
+ v as default
20
20
  };
@@ -1,55 +1,57 @@
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";
1
+ import { defineComponent as re, defineAsyncComponent as l, ref as O, computed as u, watch as P, onMounted as se, onUnmounted as ae } from "vue";
2
+ import { useCortexBlueprintBridge as ie } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useEditorLock as ce } from "../composables/useEditorLock.js";
4
+ import { provideGuidoActions as de } from "../composables/useGuidoActions.js";
5
+ import { useGuidoStateBridge as me } from "../composables/useGuidoStateBridge.js";
6
+ import { usePartner as le } from "../composables/usePartner.js";
7
+ import { useSaveValidationRollout as ue } from "../composables/useSaveValidationRollout.js";
8
+ import { useStripo as pe } from "../composables/useStripo.js";
9
+ import { useTimerClone as fe } from "../composables/useTimerClone.js";
9
10
  import { migrate as x } from "../config/migrator/index.js";
10
11
  import { ModuleFolderDefaults as W } from "../enums/defaults.js";
11
- import { RIBBON_SELECTOR as pe } from "../enums/onboarding.js";
12
+ import { RIBBON_SELECTOR as ye } from "../enums/onboarding.js";
12
13
  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";
14
+ import ve from "./organisms/AutoSaveController.vue.js";
15
+ import ge from "./organisms/base/Toaster.vue.js";
16
+ import Se from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
17
+ import be from "./organisms/header/HeaderWrapper.vue.js";
18
+ import he from "./organisms/LoadingWrapper.vue.js";
19
+ import Ee from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
20
+ import we from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
21
+ import Ce from "./organisms/validation/ValidationErrorDrawer.vue.js";
22
+ import { useStripoApi as De } from "../services/stripoApi.js";
23
+ import { useConfigStore as ke } from "../stores/config.js";
24
+ import { useDynamicContentStore as Te } from "../stores/dynamic-content.js";
23
25
  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({
26
+ import { usePreviewStore as Fe } from "../stores/preview.js";
27
+ import { useTemplateStore as Re } from "../stores/template.js";
28
+ import { useUnsubscribeStore as Ie } from "../stores/unsubscribe.js";
29
+ import { readTrackFloor as V } from "../utils/linkTrackingIds.js";
30
+ const st = /* @__PURE__ */ re({
29
31
  __name: "Guido",
30
32
  props: {
31
33
  config: null,
32
34
  ready: { type: Boolean, default: !0 }
33
35
  },
34
36
  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(
37
+ setup($, { expose: z, emit: r }) {
38
+ const a = $, q = l(
37
39
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
38
- ), V = l(
40
+ ), K = l(
39
41
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
40
42
  ), j = l(
41
43
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
42
44
  ), J = l(
43
45
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
44
- ), h = O(), p = O(), f = Ce(), E = Te(), o = we();
46
+ ), h = O(), p = O(), f = Te(), E = Ie(), o = ke();
45
47
  a.ready && o.init(a.config);
46
- const c = H(), Q = De(), m = u(() => c.hasChanges), { isTestPartner: X } = me(), w = () => {
48
+ const c = H(), Q = Fe(), m = u(() => c.hasChanges), { isTestPartner: X } = le(), { isEnabled: Y } = ue(), w = () => {
47
49
  var t;
48
50
  return (t = h.value) == null ? void 0 : t.handleSave(!0);
49
51
  }, C = (t) => {
50
52
  c.loadingStatus = t;
51
53
  };
52
- ae(), de();
54
+ ie(), me();
53
55
  const y = () => {
54
56
  var t, e;
55
57
  return {
@@ -60,15 +62,15 @@ const et = /* @__PURE__ */ ne({
60
62
  savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || W.SAVED_MODULES,
61
63
  defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || W.DEFAULT_MODULES
62
64
  };
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(() => {
65
+ }, { initPlugin: D, preloadRuntime: k } = pe(), { runExclusive: T, beginMount: F, isCurrentMount: R } = ce();
66
+ let v = 0;
67
+ const { getDefaultTemplate: I } = De(), { cloneTimersOnSave: M, hasTimerBlocks: L } = fe(), Z = u(() => {
66
68
  var t;
67
69
  return !((t = o.ui) != null && t.showHeader);
68
- }), Z = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ee = u(
70
+ }), ee = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), te = u(
69
71
  () => !!G().recommendationConfigs.strategyId
70
72
  );
71
- ce({
73
+ de({
72
74
  onBack: () => {
73
75
  console.debug("guido:back"), r("back");
74
76
  },
@@ -91,14 +93,14 @@ const et = /* @__PURE__ */ ne({
91
93
  P(() => m.value, () => {
92
94
  r("on-change", m.value);
93
95
  });
94
- const v = (t) => {
96
+ const g = (t) => {
95
97
  const e = t, { attribute: s, position: d } = e.detail;
96
98
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
97
99
  };
98
100
  let i = null;
99
101
  const S = () => {
100
102
  var e;
101
- const t = document.querySelector(pe);
103
+ const t = document.querySelector(ye);
102
104
  (e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
103
105
  }, b = async () => {
104
106
  var t;
@@ -111,23 +113,23 @@ const et = /* @__PURE__ */ ne({
111
113
  html: s && await x(s, _),
112
114
  css: d
113
115
  };
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 = {
116
+ n.html || (n = await I(), n.html = await x(n.html, _));
117
+ const oe = N ? V(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
118
+ L(n.html) && (n.html = await M(n.html)), N && (c.trackIdSessionFloor = Math.max(oe, V(n.html)));
119
+ const ne = {
118
120
  preselectedDynamicContentList: U,
119
121
  onReady: () => {
120
122
  console.debug("guido:ready"), r("ready");
121
123
  }
122
124
  };
123
- g = F(), await D(n, y(), oe), f.selectedDynamicContentList = U;
125
+ v = F(), await D(n, y(), ne), f.selectedDynamicContentList = U;
124
126
  } catch (e) {
125
127
  console.error("Failed to initialize Stripo editor:", e);
126
128
  }
127
129
  };
128
- return re(async () => {
130
+ return se(async () => {
129
131
  var e;
130
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), G().$reset(), H().$reset(), ke().$reset(), S();
132
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), G().$reset(), H().$reset(), Re().$reset(), S();
131
133
  const t = (e = p.value) == null ? void 0 : e.parentElement;
132
134
  if (t && (i = new ResizeObserver(S), i.observe(t)), k(), a.ready)
133
135
  await b();
@@ -136,17 +138,17 @@ const et = /* @__PURE__ */ ne({
136
138
  d && (s(), b());
137
139
  });
138
140
  }
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))
141
+ document.addEventListener("dynamic-content:open", g);
142
+ }), ae(() => {
143
+ i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", g), T(async () => {
144
+ if (R(v))
143
145
  try {
144
146
  window.UIEditor.removeEditor();
145
147
  } catch {
146
148
  console.debug("Failed to remove Stripo editor: No editor found");
147
149
  }
148
150
  }), o.reset();
149
- }), q({
151
+ }), z({
150
152
  dynamicContent: {
151
153
  insert: B,
152
154
  close: A
@@ -154,9 +156,9 @@ const et = /* @__PURE__ */ ne({
154
156
  hasChanges: m,
155
157
  saveSilent: w,
156
158
  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 };
159
+ }), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, AssignStrategyDrawer: j, RemoveStrategyModal: J, headerWrapperRef: h, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: E, props: a, configStore: o, editorStore: c, previewStore: Q, hasChanges: m, isTestPartner: X, isSaveValidationEnabled: Y, saveSilent: w, setLoading: C, emit: r, buildMetadata: y, initPlugin: D, preloadRuntime: k, runExclusive: T, beginMount: F, isCurrentMount: R, mountGeneration: v, getDefaultTemplate: I, cloneTimersOnSave: M, hasTimerBlocks: L, noHeader: Z, isRrsEnabled: ee, hasAssignedStrategy: te, insertDynamicContent: B, closeDynamicContent: A, handleDynamicContentOpen: g, ribbonObserver: i, updateRibbonOffset: S, startEditor: b, AutoSaveController: ve, Toaster: ge, FilterSelectionDrawer: Se, HeaderWrapper: be, LoadingWrapper: he, SaveAsTemplateDrawer: Ee, UnsubscribeWrapper: we, ValidationErrorDrawer: Ce };
158
160
  }
159
161
  });
160
162
  export {
161
- et as default
163
+ st as default
162
164
  };
@@ -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
+ "f938f128"
19
19
  );
20
20
  const v = c.exports;
21
21
  export {
@@ -1,79 +1,109 @@
1
- import { defineComponent as q, ref as l, computed as w } from "vue";
2
- import { useActionsApi as b } from "../../../composables/useActionsApi.js";
3
- import { useConfig as k } from "../../../composables/useConfig.js";
4
- import { useExport as B } from "../../../composables/useExport.js";
5
- import { useTestEmailClick as D } from "../../../composables/useGuidoActions.js";
6
- import { useHtmlCompiler as L } from "../../../composables/useHtmlCompiler.js";
7
- import { useSave as R } from "../../../composables/useSave.js";
8
- import { useToaster as z } from "../../../composables/useToaster.js";
9
- import { useTranslations as I } from "../../../composables/useTranslations.js";
10
- import { useVersionHistoryApi as P } from "../../../composables/useVersionHistoryApi.js";
11
- import { useLiquidValidator as j } from "../../../composables/validators/useLiquidValidator.js";
12
- import { useEditorStore as G } from "../../../stores/editor.js";
13
- import { useTemplateStore as J } from "../../../stores/template.js";
14
- import { getTooltipOptions as K } from "../../../utils/tooltipUtils.js";
15
- import { InButtonV2 as N } from "@useinsider/design-system-vue";
16
- import { storeToRefs as Q } from "pinia";
17
- import U from "./MigrationConfirmModal.vue.js";
18
- const ft = /* @__PURE__ */ q({
1
+ import { defineComponent as D, computed as u, ref as c } from "vue";
2
+ import { useActionsApi as z } from "../../../composables/useActionsApi.js";
3
+ import { useConfig as I } from "../../../composables/useConfig.js";
4
+ import { useExport as P } from "../../../composables/useExport.js";
5
+ import { useTestEmailClick as W } from "../../../composables/useGuidoActions.js";
6
+ import { useHtmlCompiler as j } from "../../../composables/useHtmlCompiler.js";
7
+ import { useSave as G } from "../../../composables/useSave.js";
8
+ import { useSaveValidation as J } from "../../../composables/useSaveValidation.js";
9
+ import { useSaveValidationRollout as K } from "../../../composables/useSaveValidationRollout.js";
10
+ import { useToaster as N } from "../../../composables/useToaster.js";
11
+ import { useTranslations as Q } from "../../../composables/useTranslations.js";
12
+ import { useVersionHistoryApi as U } from "../../../composables/useVersionHistoryApi.js";
13
+ import { useLiquidValidator as X } from "../../../composables/validators/useLiquidValidator.js";
14
+ import { ToasterTypeOptions as Y } from "../../../enums/toaster.js";
15
+ import { useConfigStore as Z } from "../../../stores/config.js";
16
+ import { useEditorStore as $ } from "../../../stores/editor.js";
17
+ import { useSaveValidationStore as tt } from "../../../stores/save-validation.js";
18
+ import { useTemplateStore as et } from "../../../stores/template.js";
19
+ import { getTooltipOptions as ot } from "../../../utils/tooltipUtils.js";
20
+ import { InButtonV2 as rt } from "@useinsider/design-system-vue";
21
+ import { storeToRefs as it } from "pinia";
22
+ import at from "./MigrationConfirmModal.vue.js";
23
+ const Ot = /* @__PURE__ */ D({
19
24
  __name: "EditorActions",
20
- setup(W, { expose: x }) {
21
- const { config: m, isFeatureEnabled: c } = k(), { exportHtml: p } = B(), { save: u } = R(), { openVersionHistory: f, closeVersionHistory: d } = P(), { getCompiledEmail: v } = b(), { compileHtml: y } = L(), { validateLiquidSyntax: g } = j(), { handleError: r } = z(), e = G(), h = J(), { hasMigrations: H } = Q(h), s = I(), i = l(!1), a = l(!1), S = l(), V = D(), _ = () => {
22
- if (e.isVersionHistoryOpen) {
23
- d();
25
+ setup(st, { expose: M }) {
26
+ const { config: p, isFeatureEnabled: f } = I(), { exportHtml: d } = P(), { save: v } = G(), { validateCurrentTemplate: y } = J(), { isEnabled: i } = K(), { showToaster: S, handleError: a } = N(), { openVersionHistory: g, closeVersionHistory: h } = U(), { getCompiledEmail: V } = z(), { compileHtml: w } = j(), { validateLiquidSyntax: T } = X(), E = Z(), o = $(), H = tt(), x = et(), { hasMigrations: C } = it(x), r = Q(), b = u(() => i.value && E.allowSaveWithErrors ? r("email-editor.save-and-continue") : "Save"), s = c(!1), n = c(!1), _ = c(), l = W(), k = () => {
27
+ if (o.isVersionHistoryOpen) {
28
+ h();
24
29
  return;
25
30
  }
26
- f();
27
- }, C = async () => {
28
- i.value = !0, await p(), i.value = !1;
29
- }, A = () => {
30
- e.isSaveAsTemplateDrawerOpen = !0;
31
- }, M = w(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), O = w(
31
+ g();
32
+ }, F = async () => {
33
+ s.value = !0, await d(), s.value = !1;
34
+ }, q = () => {
35
+ o.isSaveAsTemplateDrawerOpen = !0;
36
+ }, B = u(() => o.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), L = u(
32
37
  () => {
33
- var t, o;
34
- return ((o = (t = m.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
38
+ var t, e;
39
+ return ((e = (t = p.value) == null ? void 0 : t.features) == null ? void 0 : e.versionHistory) && !o.isPreviewModeOpen;
35
40
  }
36
- ), E = async (t) => {
37
- a.value = !0, t || (e.loadingStatus = !0);
38
- let o;
41
+ ), A = async (t) => {
42
+ n.value = !0, t || (o.loadingStatus = !0);
43
+ let e;
39
44
  try {
40
- o = await u(t);
41
- } catch (n) {
45
+ e = await v(t);
46
+ } catch (m) {
42
47
  if (t)
43
- throw n;
44
- r(n, "Failed to save template");
48
+ throw m;
49
+ a(m, "Failed to save template");
45
50
  } finally {
46
- a.value = !1, !t && !o && (e.loadingStatus = !1);
51
+ n.value = !1, !t && !e && (o.loadingStatus = !1);
47
52
  }
48
- return o;
49
- }, T = (t) => {
50
- var o;
51
- if (!t && H.value) {
52
- (o = S.value) == null || o.open();
53
+ return e;
54
+ }, O = (t) => {
55
+ var e;
56
+ if (!t && C.value) {
57
+ (e = _.value) == null || e.open();
53
58
  return;
54
59
  }
55
- return E(t);
56
- }, F = async () => {
57
- if (c("liquidSyntax")) {
58
- e.loadingStatus = !0;
60
+ return A(t);
61
+ }, R = async () => {
62
+ if (i.value) {
63
+ o.loadingStatus = !0;
64
+ let t = [];
65
+ try {
66
+ t = await y();
67
+ } catch (e) {
68
+ console.warn("Test-path validation failed; sending without the drawer.", e);
69
+ } finally {
70
+ o.loadingStatus = !1;
71
+ }
72
+ if (t.length) {
73
+ S({
74
+ type: Y.Error,
75
+ message: r("email-editor.validation-errors-found"),
76
+ actionButton: {
77
+ text: r("email-editor.check-errors"),
78
+ onClick: () => H.open(t, "test")
79
+ },
80
+ autoHide: !1
81
+ });
82
+ return;
83
+ }
84
+ l();
85
+ return;
86
+ }
87
+ if (f("liquidSyntax")) {
88
+ o.loadingStatus = !0;
59
89
  try {
60
- const { html: t } = await v({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = y(t);
61
- if (!await g(o))
90
+ const { html: t } = await V({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: e } = w(t);
91
+ if (!await T(e))
62
92
  return;
63
93
  } catch (t) {
64
- r(t, "Failed to prepare test email");
94
+ a(t, "Failed to prepare test email");
65
95
  return;
66
96
  } finally {
67
- e.loadingStatus = !1;
97
+ o.loadingStatus = !1;
68
98
  }
69
99
  }
70
- V();
100
+ l();
71
101
  };
72
- return x({
73
- handleSave: T
74
- }), { __sfc: !0, config: m, isFeatureEnabled: c, exportHtml: p, save: u, openVersionHistory: f, closeVersionHistory: d, getCompiledEmail: v, compileHtml: y, validateLiquidSyntax: g, handleError: r, editorStore: e, templateStore: h, hasMigrations: H, trans: s, isExporting: i, isSaving: a, migrationModalRef: S, testEmailClick: V, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: E, handleSave: T, handleTestEmail: F, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
102
+ return M({
103
+ handleSave: O
104
+ }), { __sfc: !0, config: p, isFeatureEnabled: f, exportHtml: d, save: v, validateCurrentTemplate: y, isEnabled: i, showToaster: S, handleError: a, openVersionHistory: g, closeVersionHistory: h, getCompiledEmail: V, compileHtml: w, validateLiquidSyntax: T, configStore: E, editorStore: o, saveValidationStore: H, templateStore: x, hasMigrations: C, trans: r, saveLabel: b, isExporting: s, isSaving: n, migrationModalRef: _, testEmailClick: l, handleVersionHistory: k, handleExport: F, handleSaveAs: q, versionHistoryTooltipText: B, isVersionHistoryButtonVisible: L, executeSave: A, handleSave: O, handleTestEmail: R, getTooltipOptions: ot, InButtonV2: rt, MigrationConfirmModal: at };
75
105
  }
76
106
  });
77
107
  export {
78
- ft as default
108
+ Ot as default
79
109
  };