@useinsider/guido 3.17.0-beta.ea65303 → 3.17.0-beta.ec8eabb

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 +0 -1
  2. package/dist/@types/config/schemas.js +27 -29
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +59 -60
  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 +51 -74
  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/wrappers/WpDrawer.vue.js +7 -9
  11. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  12. package/dist/composables/useActionsApi.js +82 -67
  13. package/dist/composables/useAutoSave.js +31 -26
  14. package/dist/composables/useEditorLock.js +18 -0
  15. package/dist/composables/useGuidoStateBridge.js +31 -30
  16. package/dist/composables/useHtmlCompiler.js +26 -37
  17. package/dist/composables/useHtmlValidator.js +0 -2
  18. package/dist/composables/useSave.js +47 -86
  19. package/dist/composables/validators/useCouponBlockValidator.js +21 -24
  20. package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
  21. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +26 -33
  22. package/dist/guido.css +1 -1
  23. package/dist/src/@types/config/schemas.d.ts +0 -4
  24. package/dist/src/components/Guido.vue.d.ts +1 -17
  25. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
  26. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
  27. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
  28. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
  29. package/dist/src/composables/useConfig.d.ts +0 -2
  30. package/dist/src/composables/useEditorLock.d.ts +11 -0
  31. package/dist/src/composables/useHtmlValidator.d.ts +0 -21
  32. package/dist/src/composables/useSave.d.ts +1 -6
  33. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  34. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
  35. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
  36. package/dist/src/stores/config.d.ts +0 -30
  37. package/dist/src/utils/templatePreparation.d.ts +0 -30
  38. package/dist/stores/config.js +22 -39
  39. package/dist/utils/templatePreparation.js +25 -28
  40. package/package.json +1 -1
  41. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
  42. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
  43. package/dist/composables/useSaveValidation.js +0 -279
  44. package/dist/composables/useSaveValidationRollout.js +0 -9
  45. package/dist/enums/save-validation.js +0 -4
  46. package/dist/src/@types/save-validation.d.ts +0 -19
  47. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +0 -2
  48. package/dist/src/composables/useSaveValidation.d.ts +0 -6
  49. package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
  50. package/dist/src/enums/save-validation.d.ts +0 -27
  51. package/dist/src/stores/save-validation.d.ts +0 -22
  52. package/dist/stores/save-validation.js +0 -30
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
  },
167
166
 
168
167
  // Optional: Callbacks
@@ -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 = y(
79
+ })), N = y(
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
- y(t(), N),
135
+ y(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(), ""),
@@ -219,10 +219,8 @@ const p = {
219
219
  /** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
220
220
  allowlistEnabled: e(o(), !1),
221
221
  /** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
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
- }), w = i([
222
+ linkTrackingIds: e(o(), !1)
223
+ }), B = i([
226
224
  "amp-accordion",
227
225
  "amp-carousel",
228
226
  "amp-form-controls",
@@ -236,7 +234,7 @@ const p = {
236
234
  "text-block",
237
235
  "timer-block",
238
236
  "video-block"
239
- ]), B = i([
237
+ ]), w = i([
240
238
  "dynamic-content",
241
239
  "checkbox-block",
242
240
  "radio-button-block",
@@ -247,12 +245,12 @@ const p = {
247
245
  ]), H = a({
248
246
  /** Default blocks to exclude from the editor */
249
247
  excludeDefaults: e(
250
- c(w),
248
+ c(B),
251
249
  []
252
250
  ),
253
251
  /** Custom blocks to include in the editor */
254
252
  includeCustoms: e(
255
- c(B),
253
+ c(w),
256
254
  []
257
255
  )
258
256
  }), d = a({
@@ -303,7 +301,7 @@ const p = {
303
301
  customRules: e(c(V), []),
304
302
  /** Skip default compiler rules */
305
303
  ignoreDefaultRules: e(o(), !1)
306
- }), W = a({
304
+ }), Z = a({
307
305
  /**
308
306
  * External validation handler called before save completes.
309
307
  * Return false to cancel the save operation.
@@ -314,12 +312,12 @@ const p = {
314
312
  "externalValidation must be a function"
315
313
  )
316
314
  )
317
- }), K = a({
315
+ }), Q = a({
318
316
  // Required sections
319
317
  /** Identity configuration (required) */
320
318
  identity: A,
321
319
  /** Partner configuration (required) */
322
- partner: E,
320
+ partner: M,
323
321
  // Optional sections (with defaults)
324
322
  /** Template content and presets */
325
323
  template: e(x, {}),
@@ -334,33 +332,33 @@ const p = {
334
332
  /** Compiler configuration */
335
333
  compiler: e(z, {}),
336
334
  /** Callbacks and event handlers */
337
- callbacks: e(W, {})
335
+ callbacks: e(Z, {})
338
336
  });
339
337
  export {
340
338
  H as BlocksSchema,
341
- W as CallbacksSchema,
339
+ Z as CallbacksSchema,
342
340
  V as CompilerRuleSchema,
343
341
  z as CompilerSchema,
344
- B as CustomBlockTypeSchema,
342
+ w as CustomBlockTypeSchema,
345
343
  G as CustomRuleSchema,
346
- w as DefaultBlockTypeSchema,
347
- v as DynamicContentListSchema,
344
+ B as DefaultBlockTypeSchema,
345
+ N as DynamicContentListSchema,
348
346
  S as DynamicContentNodeSchema,
349
- M as DynamicContentSchema,
347
+ E as DynamicContentSchema,
350
348
  O as EditorSchema,
351
349
  D as EmailHeaderSchema,
352
350
  L as FallbackFontSchema,
353
351
  U as FeaturesSchema,
354
- K as GuidoConfigSchema,
352
+ Q as GuidoConfigSchema,
355
353
  A as IdentitySchema,
356
- N as LegacyRecommendationConfigSchema,
354
+ P as LegacyRecommendationConfigSchema,
357
355
  p as MessageType,
358
- E as PartnerSchema,
356
+ M as PartnerSchema,
359
357
  l as ProductType,
360
358
  j as RegexRuleSchema,
361
359
  q as RemoveRuleSchema,
362
360
  _ as ReplaceRuleSchema,
363
- P as TemplateMigrationSchema,
361
+ v as TemplateMigrationSchema,
364
362
  x as TemplateSchema,
365
363
  F as UISchema
366
364
  };
@@ -1,20 +1,20 @@
1
- import a 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 a from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
5
5
  var o = this, r = o._self._c, e = o._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) : o._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), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : o._e(), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
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) : o._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), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
- }, n = [], d = /* @__PURE__ */ i(
10
- a,
9
+ }, n = [], s = /* @__PURE__ */ a(
10
+ i,
11
11
  t,
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "f02fdde0"
15
+ "915d61d5"
16
16
  );
17
- const c = d.exports;
17
+ const l = s.exports;
18
18
  export {
19
- c as default
19
+ l as default
20
20
  };
@@ -1,52 +1,51 @@
1
- import { defineComponent as J, defineAsyncComponent as M, ref as B, computed as U, watch as _, onMounted as Q, onUnmounted as X } from "vue";
1
+ import { defineComponent as J, defineAsyncComponent as B, ref as U, computed as _, watch as N, onMounted as Q, onUnmounted as X } from "vue";
2
2
  import { useCortexBlueprintBridge as Y } from "../composables/useCortexBlueprintBridge.js";
3
- import { provideGuidoActions as Z } from "../composables/useGuidoActions.js";
4
- import { useGuidoStateBridge as ee } from "../composables/useGuidoStateBridge.js";
5
- import { usePartner as oe } from "../composables/usePartner.js";
6
- import { useSaveValidationRollout as te } from "../composables/useSaveValidationRollout.js";
3
+ import { useEditorLock as Z } from "../composables/useEditorLock.js";
4
+ import { provideGuidoActions as ee } from "../composables/useGuidoActions.js";
5
+ import { useGuidoStateBridge as oe } from "../composables/useGuidoStateBridge.js";
6
+ import { usePartner as te } from "../composables/usePartner.js";
7
7
  import { useStripo as ne } from "../composables/useStripo.js";
8
8
  import { useTimerClone as re } from "../composables/useTimerClone.js";
9
- import { migrate as N } from "../config/migrator/index.js";
10
- import { ModuleFolderDefaults as O } from "../enums/defaults.js";
9
+ import { migrate as O } from "../config/migrator/index.js";
10
+ import { ModuleFolderDefaults as P } from "../enums/defaults.js";
11
11
  import { RIBBON_SELECTOR as se } from "../enums/onboarding.js";
12
- import { useRecommendationExtensionStore as ae } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
- import ie from "./organisms/AutoSaveController.vue.js";
12
+ import { useRecommendationExtensionStore as ie } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
+ import ae from "./organisms/AutoSaveController.vue.js";
14
14
  import ce from "./organisms/base/Toaster.vue.js";
15
15
  import de from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
16
  import me from "./organisms/header/HeaderWrapper.vue.js";
17
17
  import le from "./organisms/LoadingWrapper.vue.js";
18
18
  import ue from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
19
  import pe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
- import fe from "./organisms/validation/ValidationErrorDrawer.vue.js";
21
- import { useStripoApi as ve } from "../services/stripoApi.js";
22
- import { useConfigStore as ye } from "../stores/config.js";
23
- import { useDynamicContentStore as Se } from "../stores/dynamic-content.js";
24
- import { useEditorStore as P } from "../stores/editor.js";
20
+ import { useStripoApi as fe } from "../services/stripoApi.js";
21
+ import { useConfigStore as ve } from "../stores/config.js";
22
+ import { useDynamicContentStore as ye } from "../stores/dynamic-content.js";
23
+ import { useEditorStore as x } from "../stores/editor.js";
25
24
  import { usePreviewStore as he } from "../stores/preview.js";
26
- import { useTemplateStore as be } from "../stores/template.js";
25
+ import { useTemplateStore as Se } from "../stores/template.js";
27
26
  import { useUnsubscribeStore as ge } from "../stores/unsubscribe.js";
28
27
  import { readTrackFloor as A } from "../utils/linkTrackingIds.js";
29
- const Je = /* @__PURE__ */ J({
28
+ const Ve = /* @__PURE__ */ J({
30
29
  __name: "Guido",
31
30
  props: {
32
31
  config: null,
33
32
  ready: { type: Boolean, default: !0 }
34
33
  },
35
34
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
36
- setup(W, { expose: x, emit: r }) {
37
- const a = W, G = M(
35
+ setup(W, { expose: G, emit: r }) {
36
+ const i = W, H = B(
38
37
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
39
- ), H = M(
38
+ ), $ = B(
40
39
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
41
- ), S = B(), l = B(), u = Se(), h = ge(), t = ye();
42
- a.ready && t.init(a.config);
43
- const c = P(), V = he(), m = U(() => c.hasChanges), { isTestPartner: $ } = oe(), { isEnabled: z } = te(), b = () => {
40
+ ), h = U(), l = U(), u = ye(), S = ge(), t = ve();
41
+ i.ready && t.init(i.config);
42
+ const c = x(), z = he(), m = _(() => c.hasChanges), { isTestPartner: q } = te(), g = () => {
44
43
  var o;
45
- return (o = S.value) == null ? void 0 : o.handleSave(!0);
46
- }, g = (o) => {
44
+ return (o = h.value) == null ? void 0 : o.handleSave(!0);
45
+ }, b = (o) => {
47
46
  c.loadingStatus = o;
48
47
  };
49
- Y(), ee();
48
+ Y(), oe();
50
49
  const p = () => {
51
50
  var o, e;
52
51
  return {
@@ -54,14 +53,14 @@ const Je = /* @__PURE__ */ J({
54
53
  userId: t.userId,
55
54
  username: t.username,
56
55
  partnerName: t.partnerName,
57
- savedModulesFolderName: ((o = t.editor) == null ? void 0 : o.savedModulesFolderName) || O.SAVED_MODULES,
58
- defaultModulesFolderName: ((e = t.editor) == null ? void 0 : e.defaultModulesFolderName) || O.DEFAULT_MODULES
56
+ savedModulesFolderName: ((o = t.editor) == null ? void 0 : o.savedModulesFolderName) || P.SAVED_MODULES,
57
+ defaultModulesFolderName: ((e = t.editor) == null ? void 0 : e.defaultModulesFolderName) || P.DEFAULT_MODULES
59
58
  };
60
- }, { initPlugin: E, preloadRuntime: w } = ne(), { getDefaultTemplate: D } = ve(), { cloneTimersOnSave: C, hasTimerBlocks: k } = re(), q = U(() => {
59
+ }, { initPlugin: E, preloadRuntime: w } = ne(), { runExclusive: k } = Z(), { getDefaultTemplate: C } = fe(), { cloneTimersOnSave: D, hasTimerBlocks: T } = re(), K = _(() => {
61
60
  var o;
62
61
  return !((o = t.ui) != null && o.showHeader);
63
62
  });
64
- Z({
63
+ ee({
65
64
  onBack: () => {
66
65
  console.debug("guido:back"), r("back");
67
66
  },
@@ -76,19 +75,19 @@ const Je = /* @__PURE__ */ J({
76
75
  console.debug("guido:test-email:click"), r("test-email:click");
77
76
  }
78
77
  });
79
- const T = (o) => {
78
+ const F = (o) => {
80
79
  console.debug("dynamic-content:close", o), u.setSelectedDynamicContent(o), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: o }));
81
- }, F = () => {
80
+ }, I = () => {
82
81
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
83
82
  };
84
- _(() => m.value, () => {
83
+ N(() => m.value, () => {
85
84
  r("on-change", m.value);
86
85
  });
87
86
  const f = (o) => {
88
87
  const e = o, { attribute: s, position: d } = e.detail;
89
88
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
90
89
  };
91
- let i = null;
90
+ let a = null;
92
91
  const v = () => {
93
92
  var e;
94
93
  const o = document.querySelector(se);
@@ -96,59 +95,59 @@ const Je = /* @__PURE__ */ J({
96
95
  }, y = async () => {
97
96
  var o;
98
97
  try {
99
- t.initialized || t.init(a.config), c.templateId = t.templateId;
100
- const e = t.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", I = (e == null ? void 0 : e.preselectedDynamicContent) || [];
101
- h.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
102
- const L = ((o = e == null ? void 0 : e.migration) == null ? void 0 : o.recommendationConfigs) ?? {}, R = t.isFeatureEnabled("linkTrackingIds");
98
+ t.initialized || t.init(i.config), c.templateId = t.templateId;
99
+ const e = t.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", L = (e == null ? void 0 : e.preselectedDynamicContent) || [];
100
+ S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
101
+ const M = ((o = e == null ? void 0 : e.migration) == null ? void 0 : o.recommendationConfigs) ?? {}, R = t.isFeatureEnabled("linkTrackingIds");
103
102
  let n = {
104
- html: s && await N(s, L),
103
+ html: s && await O(s, M),
105
104
  css: d
106
105
  };
107
- n.html || (n = await D(), n.html = await N(n.html, L));
108
- const K = R ? A(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
109
- k(n.html) && (n.html = await C(n.html)), R && (c.trackIdSessionFloor = Math.max(K, A(n.html)));
106
+ n.html || (n = await C(), n.html = await O(n.html, M));
107
+ const V = R ? A(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
108
+ T(n.html) && (n.html = await D(n.html)), R && (c.trackIdSessionFloor = Math.max(V, A(n.html)));
110
109
  const j = {
111
- preselectedDynamicContentList: I,
110
+ preselectedDynamicContentList: L,
112
111
  onReady: () => {
113
112
  console.debug("guido:ready"), r("ready");
114
113
  }
115
114
  };
116
- await E(n, p(), j), u.selectedDynamicContentList = I;
115
+ await E(n, p(), j), u.selectedDynamicContentList = L;
117
116
  } catch (e) {
118
117
  console.error("Failed to initialize Stripo editor:", e);
119
118
  }
120
119
  };
121
120
  return Q(async () => {
122
121
  var e;
123
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ae().$reset(), P().$reset(), be().$reset(), v();
122
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ie().$reset(), x().$reset(), Se().$reset(), v();
124
123
  const o = (e = l.value) == null ? void 0 : e.parentElement;
125
- if (o && (i = new ResizeObserver(v), i.observe(o)), w(), a.ready)
124
+ if (o && (a = new ResizeObserver(v), a.observe(o)), w(), i.ready)
126
125
  await y();
127
126
  else {
128
- const s = _(() => a.ready, (d) => {
127
+ const s = N(() => i.ready, (d) => {
129
128
  d && (s(), y());
130
129
  });
131
130
  }
132
131
  document.addEventListener("dynamic-content:open", f);
133
132
  }), X(() => {
134
- i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", f);
135
- try {
136
- window.UIEditor.removeEditor();
137
- } catch {
138
- console.debug("Failed to remove Stripo editor: No editor found");
139
- }
140
- t.reset();
141
- }), x({
133
+ a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", f), k(async () => {
134
+ try {
135
+ window.UIEditor.removeEditor();
136
+ } catch {
137
+ console.debug("Failed to remove Stripo editor: No editor found");
138
+ }
139
+ }), t.reset();
140
+ }), G({
142
141
  dynamicContent: {
143
- insert: T,
144
- close: F
142
+ insert: F,
143
+ close: I
145
144
  },
146
145
  hasChanges: m,
147
- saveSilent: b,
148
- setLoading: g
149
- }), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, headerWrapperRef: S, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: h, props: a, configStore: t, editorStore: c, previewStore: V, hasChanges: m, isTestPartner: $, isSaveValidationEnabled: z, saveSilent: b, setLoading: g, emit: r, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: D, cloneTimersOnSave: C, hasTimerBlocks: k, noHeader: q, insertDynamicContent: T, closeDynamicContent: F, handleDynamicContentOpen: f, ribbonObserver: i, updateRibbonOffset: v, startEditor: y, AutoSaveController: ie, Toaster: ce, FilterSelectionDrawer: de, HeaderWrapper: me, LoadingWrapper: le, SaveAsTemplateDrawer: ue, UnsubscribeWrapper: pe, ValidationErrorDrawer: fe };
146
+ saveSilent: g,
147
+ setLoading: b
148
+ }), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: $, headerWrapperRef: h, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: t, editorStore: c, previewStore: z, hasChanges: m, isTestPartner: q, saveSilent: g, setLoading: b, emit: r, buildMetadata: p, initPlugin: E, preloadRuntime: w, runExclusive: k, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: T, noHeader: K, insertDynamicContent: F, closeDynamicContent: I, handleDynamicContentOpen: f, ribbonObserver: a, updateRibbonOffset: v, startEditor: y, AutoSaveController: ae, Toaster: ce, FilterSelectionDrawer: de, HeaderWrapper: me, LoadingWrapper: le, SaveAsTemplateDrawer: ue, UnsubscribeWrapper: pe };
150
149
  }
151
150
  });
152
151
  export {
153
- Je as default
152
+ Ve as default
154
153
  };
@@ -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
- "eedf7416"
18
+ "fa75f9c3"
19
19
  );
20
20
  const v = c.exports;
21
21
  export {
@@ -1,97 +1,74 @@
1
- import { defineComponent as R, computed as l, ref as m } from "vue";
2
- import { useActionsApi as D } from "../../../composables/useActionsApi.js";
3
- import { useConfig as F } from "../../../composables/useConfig.js";
4
- import { useExport as z } from "../../../composables/useExport.js";
5
- import { useTestEmailClick as I } from "../../../composables/useGuidoActions.js";
6
- import { useHtmlCompiler as P } from "../../../composables/useHtmlCompiler.js";
7
- import { useSave as W } from "../../../composables/useSave.js";
8
- import { useSaveValidation as j } from "../../../composables/useSaveValidation.js";
9
- import { useSaveValidationRollout as G } from "../../../composables/useSaveValidationRollout.js";
10
- import { useToaster as J } from "../../../composables/useToaster.js";
11
- import { useTranslations as K } from "../../../composables/useTranslations.js";
12
- import { useVersionHistoryApi as N } from "../../../composables/useVersionHistoryApi.js";
13
- import { useLiquidValidator as Q } from "../../../composables/validators/useLiquidValidator.js";
14
- import { ToasterTypeOptions as U } from "../../../enums/toaster.js";
15
- import { useConfigStore as X } from "../../../stores/config.js";
16
- import { useEditorStore as Y } from "../../../stores/editor.js";
17
- import { useSaveValidationStore as Z } from "../../../stores/save-validation.js";
18
- import { useTemplateStore as $ } from "../../../stores/template.js";
19
- import { getTooltipOptions as tt } from "../../../utils/tooltipUtils.js";
20
- import { InButtonV2 as ot } from "@useinsider/design-system-vue";
21
- import { storeToRefs as et } from "pinia";
22
- import rt from "./MigrationConfirmModal.vue.js";
23
- const At = /* @__PURE__ */ R({
1
+ import { defineComponent as F, ref as a, computed as x } 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__ */ F({
24
19
  __name: "EditorActions",
25
- setup(it, { expose: A }) {
26
- const { config: u, isFeatureEnabled: c } = F(), { exportHtml: f } = z(), { save: p } = W(), { validateCurrentTemplate: d } = j(), { isEnabled: i } = G(), { showToaster: v } = J(), { openVersionHistory: S, closeVersionHistory: y } = N(), { getCompiledEmail: g } = D(), { compileHtml: h } = P(), { validateLiquidSyntax: V } = Q(), T = X(), e = Y(), w = Z(), H = $(), { hasMigrations: E } = et(H), r = K(), O = l(() => i.value && T.allowSaveWithErrors ? r("email-editor.save-and-continue") : "Save"), s = m(!1), a = m(!1), x = m(), n = I(), M = () => {
20
+ setup(W, { expose: w }) {
21
+ const { config: n, isFeatureEnabled: l } = k(), { exportHtml: m } = B(), { save: u } = R(), { openVersionHistory: c, closeVersionHistory: p } = P(), { getCompiledEmail: f } = b(), { compileHtml: d } = L(), { validateLiquidSyntax: v } = j(), { handleError: y } = z(), e = G(), g = J(), { hasMigrations: S } = Q(g), r = I(), s = a(!1), i = a(!1), H = a(), V = D(), _ = () => {
27
22
  if (e.isVersionHistoryOpen) {
28
- y();
23
+ p();
29
24
  return;
30
25
  }
31
- S();
32
- }, b = async () => {
33
- s.value = !0, await f(), s.value = !1;
34
- }, k = () => {
26
+ c();
27
+ }, C = async () => {
28
+ s.value = !0, await m(), s.value = !1;
29
+ }, A = () => {
35
30
  e.isSaveAsTemplateDrawerOpen = !0;
36
- }, q = l(() => e.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), B = l(
31
+ }, M = x(() => e.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), O = x(
37
32
  () => {
38
33
  var t, o;
39
- return ((o = (t = u.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
34
+ return ((o = (t = n.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
40
35
  }
41
- ), C = async (t) => {
42
- a.value = !0, t || (e.loadingStatus = !0);
43
- const o = await p(t);
44
- return a.value = !1, !t && !o && (e.loadingStatus = !1), o;
45
- }, _ = (t) => {
46
- var o;
47
- if (!t && E.value) {
48
- (o = x.value) == null || o.open();
49
- return;
36
+ ), h = async (t) => {
37
+ i.value = !0, t || (e.loadingStatus = !0);
38
+ let o;
39
+ try {
40
+ o = await u(t);
41
+ } catch (T) {
42
+ y(T, "Failed to save template");
43
+ } finally {
44
+ i.value = !1, !t && !o && (e.loadingStatus = !1);
50
45
  }
51
- return C(t);
52
- }, L = async () => {
53
- if (i.value) {
54
- e.loadingStatus = !0;
55
- let t = [];
56
- try {
57
- t = await d();
58
- } catch (o) {
59
- console.warn("Test-path validation failed; sending without the drawer.", o);
60
- } finally {
61
- e.loadingStatus = !1;
62
- }
63
- if (t.length) {
64
- v({
65
- type: U.Error,
66
- message: r("email-editor.validation-errors-found"),
67
- actionButton: {
68
- text: r("email-editor.check-errors"),
69
- onClick: () => w.open(t, "test")
70
- },
71
- autoHide: !1
72
- });
73
- return;
74
- }
75
- n();
46
+ return o;
47
+ }, E = (t) => {
48
+ var o;
49
+ if (!t && S.value) {
50
+ (o = H.value) == null || o.open();
76
51
  return;
77
52
  }
78
- if (c("liquidSyntax")) {
53
+ return h(t);
54
+ }, q = async () => {
55
+ if (l("liquidSyntax")) {
79
56
  e.loadingStatus = !0;
80
57
  try {
81
- const { html: t } = await g({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = h(t);
82
- if (!await V(o))
58
+ const { html: t } = await f({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = d(t);
59
+ if (!await v(o))
83
60
  return;
84
61
  } finally {
85
62
  e.loadingStatus = !1;
86
63
  }
87
64
  }
88
- n();
65
+ V();
89
66
  };
90
- return A({
91
- handleSave: _
92
- }), { __sfc: !0, config: u, isFeatureEnabled: c, exportHtml: f, save: p, validateCurrentTemplate: d, isEnabled: i, showToaster: v, openVersionHistory: S, closeVersionHistory: y, getCompiledEmail: g, compileHtml: h, validateLiquidSyntax: V, configStore: T, editorStore: e, saveValidationStore: w, templateStore: H, hasMigrations: E, trans: r, saveLabel: O, isExporting: s, isSaving: a, migrationModalRef: x, testEmailClick: n, handleVersionHistory: M, handleExport: b, handleSaveAs: k, versionHistoryTooltipText: q, isVersionHistoryButtonVisible: B, executeSave: C, handleSave: _, handleTestEmail: L, getTooltipOptions: tt, InButtonV2: ot, MigrationConfirmModal: rt };
67
+ return w({
68
+ handleSave: E
69
+ }), { __sfc: !0, config: n, isFeatureEnabled: l, exportHtml: m, save: u, openVersionHistory: c, closeVersionHistory: p, getCompiledEmail: f, compileHtml: d, validateLiquidSyntax: v, handleError: y, editorStore: e, templateStore: g, hasMigrations: S, trans: r, isExporting: s, isSaving: i, migrationModalRef: H, testEmailClick: V, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: h, handleSave: E, handleTestEmail: q, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
93
70
  }
94
71
  });
95
72
  export {
96
- At as default
73
+ ft as default
97
74
  };