@useinsider/guido 3.18.2-beta.eedafd2 → 3.18.2-beta.fc246a7

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 (65) hide show
  1. package/README.md +0 -1
  2. package/dist/@types/config/schemas.js +26 -28
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +51 -53
  5. package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
  6. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  7. package/dist/components/organisms/header/EditorActions.vue2.js +56 -86
  8. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  9. package/dist/components/organisms/header/LeftSlot.vue2.js +12 -16
  10. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +34 -34
  11. package/dist/components/wrappers/WpDrawer.vue.js +7 -9
  12. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  13. package/dist/composables/useHtmlCompiler.js +26 -37
  14. package/dist/composables/useHtmlValidator.js +0 -2
  15. package/dist/composables/useHttp.js +22 -24
  16. package/dist/composables/useSave.js +45 -90
  17. package/dist/composables/validators/useCouponBlockValidator.js +21 -24
  18. package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
  19. package/dist/config/migrator/itemsBlockMigrator.js +257 -167
  20. package/dist/extensions/Blocks/Items/constants/cardLayout.js +20 -0
  21. package/dist/extensions/Blocks/Items/controls/name/trimming.js +18 -17
  22. package/dist/extensions/Blocks/Items/controls/settingsControl.js +114 -105
  23. package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
  24. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +11 -9
  25. package/dist/extensions/Blocks/Items/template.js +219 -204
  26. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +36 -43
  27. package/dist/guido.css +1 -1
  28. package/dist/services/templateLibraryApi.js +14 -17
  29. package/dist/src/@types/config/schemas.d.ts +0 -4
  30. package/dist/src/components/Guido.vue.d.ts +1 -17
  31. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
  32. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
  33. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
  34. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
  35. package/dist/src/composables/useConfig.d.ts +0 -2
  36. package/dist/src/composables/useHtmlValidator.d.ts +0 -21
  37. package/dist/src/composables/useSave.d.ts +1 -6
  38. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  39. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
  40. package/dist/src/extensions/Blocks/Items/constants/cardLayout.d.ts +44 -0
  41. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +3 -0
  42. package/dist/src/extensions/Blocks/Items/template.d.ts +19 -0
  43. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
  44. package/dist/src/stores/config.d.ts +0 -30
  45. package/dist/src/utils/genericUtil.d.ts +0 -6
  46. package/dist/src/utils/templatePreparation.d.ts +0 -30
  47. package/dist/stores/config.js +22 -39
  48. package/dist/utils/genericUtil.js +54 -63
  49. package/dist/utils/pairProductVariables.js +71 -71
  50. package/dist/utils/templatePreparation.js +45 -49
  51. package/package.json +1 -1
  52. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
  53. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
  54. package/dist/composables/useSaveValidation.js +0 -279
  55. package/dist/composables/useSaveValidationRollout.js +0 -9
  56. package/dist/enums/save-validation.js +0 -4
  57. package/dist/src/@types/save-validation.d.ts +0 -19
  58. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +0 -2
  59. package/dist/src/composables/useSaveValidation.d.ts +0 -6
  60. package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
  61. package/dist/src/enums/save-validation.d.ts +0 -27
  62. package/dist/src/stores/save-validation.d.ts +0 -22
  63. package/dist/src/utils/liquidDynamicContent.d.ts +0 -20
  64. package/dist/stores/save-validation.js +0 -30
  65. package/dist/utils/liquidDynamicContent.js +0 -15
package/README.md CHANGED
@@ -162,7 +162,6 @@ 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).
166
165
  reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
167
166
  },
168
167
 
@@ -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
- }), E = a({
33
+ }), M = 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
- }), M = a({
57
+ }), E = 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
- })), v = k(
79
+ })), N = k(
80
80
  t(),
81
81
  R(c(S), [])
82
- ), N = g({
82
+ ), P = 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
- }), P = a({
127
+ }), v = 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(), N),
135
+ k(t(), P),
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(M),
145
+ c(E),
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(v, {}),
154
+ dynamicContentList: e(N, {}),
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(P, {})
176
+ migration: e(v, {})
177
177
  }), D = a({
178
178
  /** Sender display name */
179
179
  senderName: e(t(), ""),
@@ -220,10 +220,8 @@ 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),
225
223
  reusableRecommendationStrategy: e(o(), !1)
226
- }), w = i([
224
+ }), B = i([
227
225
  "amp-accordion",
228
226
  "amp-carousel",
229
227
  "amp-form-controls",
@@ -237,7 +235,7 @@ const p = {
237
235
  "text-block",
238
236
  "timer-block",
239
237
  "video-block"
240
- ]), B = i([
238
+ ]), w = i([
241
239
  "dynamic-content",
242
240
  "checkbox-block",
243
241
  "radio-button-block",
@@ -248,12 +246,12 @@ const p = {
248
246
  ]), H = a({
249
247
  /** Default blocks to exclude from the editor */
250
248
  excludeDefaults: e(
251
- c(w),
249
+ c(B),
252
250
  []
253
251
  ),
254
252
  /** Custom blocks to include in the editor */
255
253
  includeCustoms: e(
256
- c(B),
254
+ c(w),
257
255
  []
258
256
  )
259
257
  }), d = a({
@@ -304,7 +302,7 @@ const p = {
304
302
  customRules: e(c(V), []),
305
303
  /** Skip default compiler rules */
306
304
  ignoreDefaultRules: e(o(), !1)
307
- }), W = a({
305
+ }), Z = a({
308
306
  /**
309
307
  * External validation handler called before save completes.
310
308
  * Return false to cancel the save operation.
@@ -315,12 +313,12 @@ const p = {
315
313
  "externalValidation must be a function"
316
314
  )
317
315
  )
318
- }), K = a({
316
+ }), Q = a({
319
317
  // Required sections
320
318
  /** Identity configuration (required) */
321
319
  identity: A,
322
320
  /** Partner configuration (required) */
323
- partner: E,
321
+ partner: M,
324
322
  // Optional sections (with defaults)
325
323
  /** Template content and presets */
326
324
  template: e(x, {}),
@@ -335,33 +333,33 @@ const p = {
335
333
  /** Compiler configuration */
336
334
  compiler: e(z, {}),
337
335
  /** Callbacks and event handlers */
338
- callbacks: e(W, {})
336
+ callbacks: e(Z, {})
339
337
  });
340
338
  export {
341
339
  H as BlocksSchema,
342
- W as CallbacksSchema,
340
+ Z as CallbacksSchema,
343
341
  V as CompilerRuleSchema,
344
342
  z as CompilerSchema,
345
- B as CustomBlockTypeSchema,
343
+ w as CustomBlockTypeSchema,
346
344
  G as CustomRuleSchema,
347
- w as DefaultBlockTypeSchema,
348
- v as DynamicContentListSchema,
345
+ B as DefaultBlockTypeSchema,
346
+ N as DynamicContentListSchema,
349
347
  S as DynamicContentNodeSchema,
350
- M as DynamicContentSchema,
348
+ E as DynamicContentSchema,
351
349
  O as EditorSchema,
352
350
  D as EmailHeaderSchema,
353
351
  L as FallbackFontSchema,
354
352
  U as FeaturesSchema,
355
- K as GuidoConfigSchema,
353
+ Q as GuidoConfigSchema,
356
354
  A as IdentitySchema,
357
- N as LegacyRecommendationConfigSchema,
355
+ P as LegacyRecommendationConfigSchema,
358
356
  p as MessageType,
359
- E as PartnerSchema,
357
+ M as PartnerSchema,
360
358
  l as ProductType,
361
359
  j as RegexRuleSchema,
362
360
  q as RemoveRuleSchema,
363
361
  _ as ReplaceRuleSchema,
364
- P as TemplateMigrationSchema,
362
+ v as TemplateMigrationSchema,
365
363
  x as TemplateSchema,
366
364
  F as UISchema
367
365
  };
@@ -1,20 +1,20 @@
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.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(_) {
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(_) {
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
- "584fdf72"
15
+ "050dfa52"
16
16
  );
17
- const v = n.exports;
17
+ const f = n.exports;
18
18
  export {
19
- v as default
19
+ f as default
20
20
  };
@@ -1,57 +1,55 @@
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";
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";
10
9
  import { migrate as x } from "../config/migrator/index.js";
11
10
  import { ModuleFolderDefaults as W } from "../enums/defaults.js";
12
- import { RIBBON_SELECTOR as ye } from "../enums/onboarding.js";
11
+ import { RIBBON_SELECTOR as pe } from "../enums/onboarding.js";
13
12
  import { useRecommendationExtensionStore as G } from "../extensions/Blocks/Recommendation/store/recommendation.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";
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";
25
23
  import { useEditorStore as H } from "../stores/editor.js";
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({
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({
31
29
  __name: "Guido",
32
30
  props: {
33
31
  config: null,
34
32
  ready: { type: Boolean, default: !0 }
35
33
  },
36
34
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
37
- setup($, { expose: z, emit: r }) {
38
- const a = $, q = l(
35
+ setup(z, { expose: q, emit: r }) {
36
+ const a = z, K = l(
39
37
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
40
- ), K = l(
38
+ ), V = l(
41
39
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
42
40
  ), j = l(
43
41
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
44
42
  ), J = l(
45
43
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
46
- ), h = O(), p = O(), f = Te(), E = Ie(), o = ke();
44
+ ), h = O(), p = O(), f = Ce(), E = Te(), o = we();
47
45
  a.ready && o.init(a.config);
48
- const c = H(), Q = Fe(), m = u(() => c.hasChanges), { isTestPartner: X } = le(), { isEnabled: Y } = ue(), w = () => {
46
+ const c = H(), Q = De(), m = u(() => c.hasChanges), { isTestPartner: X } = me(), w = () => {
49
47
  var t;
50
48
  return (t = h.value) == null ? void 0 : t.handleSave(!0);
51
49
  }, C = (t) => {
52
50
  c.loadingStatus = t;
53
51
  };
54
- ie(), me();
52
+ ae(), de();
55
53
  const y = () => {
56
54
  var t, e;
57
55
  return {
@@ -62,15 +60,15 @@ const st = /* @__PURE__ */ re({
62
60
  savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || W.SAVED_MODULES,
63
61
  defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || W.DEFAULT_MODULES
64
62
  };
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(() => {
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(() => {
68
66
  var t;
69
67
  return !((t = o.ui) != null && t.showHeader);
70
- }), ee = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), te = u(
68
+ }), Z = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ee = u(
71
69
  () => !!G().recommendationConfigs.strategyId
72
70
  );
73
- de({
71
+ ce({
74
72
  onBack: () => {
75
73
  console.debug("guido:back"), r("back");
76
74
  },
@@ -93,14 +91,14 @@ const st = /* @__PURE__ */ re({
93
91
  P(() => m.value, () => {
94
92
  r("on-change", m.value);
95
93
  });
96
- const g = (t) => {
94
+ const v = (t) => {
97
95
  const e = t, { attribute: s, position: d } = e.detail;
98
96
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
99
97
  };
100
98
  let i = null;
101
99
  const S = () => {
102
100
  var e;
103
- const t = document.querySelector(ye);
101
+ const t = document.querySelector(pe);
104
102
  (e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
105
103
  }, b = async () => {
106
104
  var t;
@@ -113,23 +111,23 @@ const st = /* @__PURE__ */ re({
113
111
  html: s && await x(s, _),
114
112
  css: d
115
113
  };
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 = {
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 = {
120
118
  preselectedDynamicContentList: U,
121
119
  onReady: () => {
122
120
  console.debug("guido:ready"), r("ready");
123
121
  }
124
122
  };
125
- v = F(), await D(n, y(), ne), f.selectedDynamicContentList = U;
123
+ g = F(), await D(n, y(), oe), f.selectedDynamicContentList = U;
126
124
  } catch (e) {
127
125
  console.error("Failed to initialize Stripo editor:", e);
128
126
  }
129
127
  };
130
- return se(async () => {
128
+ return re(async () => {
131
129
  var e;
132
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), G().$reset(), H().$reset(), Re().$reset(), S();
130
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), G().$reset(), H().$reset(), ke().$reset(), S();
133
131
  const t = (e = p.value) == null ? void 0 : e.parentElement;
134
132
  if (t && (i = new ResizeObserver(S), i.observe(t)), k(), a.ready)
135
133
  await b();
@@ -138,17 +136,17 @@ const st = /* @__PURE__ */ re({
138
136
  d && (s(), b());
139
137
  });
140
138
  }
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))
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))
145
143
  try {
146
144
  window.UIEditor.removeEditor();
147
145
  } catch {
148
146
  console.debug("Failed to remove Stripo editor: No editor found");
149
147
  }
150
148
  }), o.reset();
151
- }), z({
149
+ }), q({
152
150
  dynamicContent: {
153
151
  insert: B,
154
152
  close: A
@@ -156,9 +154,9 @@ const st = /* @__PURE__ */ re({
156
154
  hasChanges: m,
157
155
  saveSilent: w,
158
156
  setLoading: C
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 };
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 };
160
158
  }
161
159
  });
162
160
  export {
163
- st as default
161
+ et as default
164
162
  };
@@ -1,14 +1,13 @@
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 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({
6
5
  __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 };
6
+ setup(a) {
7
+ const { save: e } = s(), o = () => e(!1, !0);
8
+ return r(o), { __sfc: !0, save: e, backgroundSave: o };
10
9
  }
11
10
  });
12
11
  export {
13
- v as default
12
+ f as default
14
13
  };
@@ -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", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "label-text": t.saveLabel, "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", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "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
- "f938f128"
18
+ "1ca6baf0"
19
19
  );
20
20
  const v = c.exports;
21
21
  export {
@@ -1,109 +1,79 @@
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({
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({
24
19
  __name: "EditorActions",
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();
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();
29
24
  return;
30
25
  }
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(
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(
37
32
  () => {
38
- var t, e;
39
- return ((e = (t = p.value) == null ? void 0 : t.features) == null ? void 0 : e.versionHistory) && !o.isPreviewModeOpen;
33
+ var t, o;
34
+ return ((o = (t = m.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
40
35
  }
41
- ), A = async (t) => {
42
- n.value = !0, t || (o.loadingStatus = !0);
43
- let e;
36
+ ), E = async (t) => {
37
+ a.value = !0, t || (e.loadingStatus = !0);
38
+ let o;
44
39
  try {
45
- e = await v(t);
46
- } catch (m) {
40
+ o = await u(t);
41
+ } catch (n) {
47
42
  if (t)
48
- throw m;
49
- a(m, "Failed to save template");
43
+ throw n;
44
+ r(n, "Failed to save template");
50
45
  } finally {
51
- n.value = !1, !t && !e && (o.loadingStatus = !1);
46
+ a.value = !1, !t && !o && (e.loadingStatus = !1);
52
47
  }
53
- return e;
54
- }, O = (t) => {
55
- var e;
56
- if (!t && C.value) {
57
- (e = _.value) == null || e.open();
48
+ return o;
49
+ }, T = (t) => {
50
+ var o;
51
+ if (!t && H.value) {
52
+ (o = S.value) == null || o.open();
58
53
  return;
59
54
  }
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;
55
+ return E(t);
56
+ }, F = async () => {
57
+ if (c("liquidSyntax")) {
58
+ e.loadingStatus = !0;
89
59
  try {
90
- const { html: t } = await V({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: e } = w(t);
91
- if (!await T(e))
60
+ const { html: t } = await v({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = y(t);
61
+ if (!await g(o))
92
62
  return;
93
63
  } catch (t) {
94
- a(t, "Failed to prepare test email");
64
+ r(t, "Failed to prepare test email");
95
65
  return;
96
66
  } finally {
97
- o.loadingStatus = !1;
67
+ e.loadingStatus = !1;
98
68
  }
99
69
  }
100
- l();
70
+ V();
101
71
  };
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 };
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 };
105
75
  }
106
76
  });
107
77
  export {
108
- Ot as default
78
+ ft as default
109
79
  };