@useinsider/guido 3.19.0-beta.7d287ab → 3.19.0-beta.84c97db

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 (79) hide show
  1. package/dist/@types/config/schemas.js +9 -8
  2. package/dist/components/Guido.vue.js +2 -2
  3. package/dist/components/Guido.vue2.js +80 -67
  4. package/dist/components/organisms/AutoSaveController.vue2.js +18 -8
  5. package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
  6. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +25 -0
  7. package/dist/components/organisms/header/EditorActions.vue.js +13 -13
  8. package/dist/components/organisms/header/EditorActions.vue2.js +37 -52
  9. package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
  10. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +98 -0
  11. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  12. package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -17
  13. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  14. package/dist/components/organisms/header/LeftSlot.vue2.js +32 -23
  15. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  16. package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
  17. package/dist/components/organisms/header/RightSlot.vue.js +9 -8
  18. package/dist/components/organisms/header/RightSlot.vue2.js +13 -18
  19. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
  20. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
  21. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +22 -0
  22. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
  23. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +19 -0
  24. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +90 -0
  25. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
  26. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +56 -38
  27. package/dist/composables/useAccessibilityApi.js +45 -0
  28. package/dist/composables/useCortexBlueprintBridge.js +122 -54
  29. package/dist/composables/useCustomInterfaceAppearance.js +42 -41
  30. package/dist/composables/useEmailTemplateApplier.js +111 -50
  31. package/dist/config/i18n/en/labels.json.js +36 -4
  32. package/dist/config/i18n/en/tooltips.json.js +2 -1
  33. package/dist/config/migrator/itemsBlockMigrator.js +236 -248
  34. package/dist/extensions/Blocks/Items/constants/cardLayout.js +20 -0
  35. package/dist/extensions/Blocks/Items/controls/name/trimming.js +18 -17
  36. package/dist/extensions/Blocks/Items/controls/settingsControl.js +114 -105
  37. package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
  38. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +11 -9
  39. package/dist/extensions/Blocks/Items/template.js +219 -204
  40. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +189 -226
  41. package/dist/guido.css +1 -1
  42. package/dist/sprite.svg +10 -0
  43. package/dist/src/@types/config/schemas.d.ts +2 -0
  44. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +3 -1
  45. package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
  46. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -3
  47. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -3
  48. package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
  49. package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
  50. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
  51. package/dist/src/composables/useAccessibilityApi.d.ts +13 -0
  52. package/dist/src/composables/useActionsApi.d.ts +2 -2
  53. package/dist/src/composables/useConfig.d.ts +2 -0
  54. package/dist/src/composables/useCortexBlueprintBridge.d.ts +2 -3
  55. package/dist/src/composables/useEmailTemplateApplier.d.ts +18 -5
  56. package/dist/src/extensions/Blocks/Items/constants/cardLayout.d.ts +44 -0
  57. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +3 -0
  58. package/dist/src/extensions/Blocks/Items/template.d.ts +19 -0
  59. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -8
  60. package/dist/src/stores/autosave.d.ts +73 -1
  61. package/dist/src/stores/config.d.ts +20 -0
  62. package/dist/src/stores/editor.d.ts +109 -0
  63. package/dist/src/stores/guido-email-editor.d.ts +20 -10
  64. package/dist/src/stores/onboarding.d.ts +952 -21
  65. package/dist/src/stores/version-history.d.ts +1 -1
  66. package/dist/src/utils/timeUtil.d.ts +5 -0
  67. package/dist/static/styles/components/accessibility.css.js +234 -0
  68. package/dist/static/styles/components/version-history.css.js +2 -6
  69. package/dist/static/styles/variables.css.js +2 -0
  70. package/dist/stores/autosave.js +12 -7
  71. package/dist/stores/editor.js +7 -4
  72. package/dist/stores/guido-email-editor.js +3 -1
  73. package/dist/stores/onboarding.js +43 -21
  74. package/dist/utils/pairProductVariables.js +71 -71
  75. package/dist/utils/timeUtil.js +6 -17
  76. package/package.json +1 -1
  77. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  78. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  79. /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → AutoSaveStatus.vue.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
- import { ModuleFolderDefaults as S } from "../../enums/defaults.js";
2
- import { object as a, number as s, optional as e, string as t, picklist as m, pipe as i, minLength as b, custom as k, boolean as o, array as c, transform as y, unknown as r, record as g, fallback as R, literal as u, looseObject as C, variant as I, union as h, lazy as T } from "../../node_modules/valibot/dist/index.js";
1
+ import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
2
+ import { object as a, number as s, optional as e, string as t, picklist as m, pipe as i, minLength as b, custom as k, boolean as o, array as c, transform as S, unknown as r, record as g, fallback as R, literal as u, looseObject as C, variant as T, union as h, lazy as I } from "../../node_modules/valibot/dist/index.js";
3
3
  const p = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -76,7 +76,7 @@ const p = {
76
76
  value: t()
77
77
  })
78
78
  )
79
- }), f = T(() => C({
79
+ }), f = I(() => C({
80
80
  text: e(t()),
81
81
  // eslint-disable-next-line camelcase -- backend field name
82
82
  tag_text: e(t()),
@@ -176,7 +176,7 @@ const p = {
176
176
  trackIdCounter: e(
177
177
  i(
178
178
  s(),
179
- y((n) => Number.isFinite(n) ? Math.max(0, Math.floor(n)) : 0)
179
+ S((n) => Number.isFinite(n) ? Math.max(0, Math.floor(n)) : 0)
180
180
  ),
181
181
  0
182
182
  ),
@@ -190,7 +190,7 @@ const p = {
190
190
  recommendationCampaignUrls: e(
191
191
  i(
192
192
  r(),
193
- y((n) => n && typeof n == "object" ? { ...n } : void 0)
193
+ S((n) => n && typeof n == "object" ? { ...n } : void 0)
194
194
  )
195
195
  ),
196
196
  /** Migration-only inputs (legacy block configs) */
@@ -210,9 +210,9 @@ const p = {
210
210
  /** Email header settings */
211
211
  emailHeader: e(O, { senderName: "", subject: "" }),
212
212
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
213
- savedModulesFolderName: e(t(), S.SAVED_MODULES),
213
+ savedModulesFolderName: e(t(), y.SAVED_MODULES),
214
214
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
215
- defaultModulesFolderName: e(t(), S.DEFAULT_MODULES)
215
+ defaultModulesFolderName: e(t(), y.DEFAULT_MODULES)
216
216
  }), F = a({
217
217
  /** Whether to show the header bar */
218
218
  showHeader: e(o(), !0),
@@ -237,6 +237,7 @@ const p = {
237
237
  liquidSyntax: e(o(), !1),
238
238
  /** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
239
239
  autosave: e(o(), !1),
240
+ accessibilityTesting: e(o(), !1),
240
241
  /** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
241
242
  allowlistEnabled: e(o(), !1),
242
243
  /** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
@@ -313,7 +314,7 @@ const p = {
313
314
  (n) => typeof n == "function",
314
315
  "processor must be a function"
315
316
  )
316
- }), V = I("type", [
317
+ }), V = T("type", [
317
318
  H,
318
319
  _,
319
320
  q,
@@ -3,7 +3,7 @@ import o from "./Guido.vue2.js";
3
3
  import t from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var i = function() {
5
5
  var a = this, r = a._self._c, e = a._self._setupProxy;
6
- return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.AuthErrorModal), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(), r(e.SaveAsTemplateDrawer), e.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), r(e.AutoSaveController, { ref: "autoSaveControllerRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.AuthErrorModal), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(), r(e.SaveAsTemplateDrawer), e.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
9
  }, s = [], n = /* @__PURE__ */ t(
@@ -12,7 +12,7 @@ var i = function() {
12
12
  s,
13
13
  !1,
14
14
  null,
15
- "926b01f5"
15
+ "ecfaf815"
16
16
  );
17
17
  const f = n.exports;
18
18
  export {
@@ -1,4 +1,4 @@
1
- import { defineComponent as ae, defineAsyncComponent as m, ref as x, computed as u, watch as W, onMounted as se, onUnmounted as ie } from "vue";
1
+ import { defineComponent as se, defineAsyncComponent as m, ref as H, computed as p, watch as W, onMounted as ie, onUnmounted as ae } from "vue";
2
2
  import { useCortexBlueprintBridge as ce } from "../composables/useCortexBlueprintBridge.js";
3
3
  import { useEditorLock as de } from "../composables/useEditorLock.js";
4
4
  import { provideGuidoActions as me } from "../composables/useGuidoActions.js";
@@ -7,34 +7,34 @@ import { usePartner as ue } from "../composables/usePartner.js";
7
7
  import { useStripo as pe } from "../composables/useStripo.js";
8
8
  import { useTimerClone as fe } from "../composables/useTimerClone.js";
9
9
  import { migrate as G } from "../config/migrator/index.js";
10
- import { ModuleFolderDefaults as H } from "../enums/defaults.js";
10
+ import { ModuleFolderDefaults as z } from "../enums/defaults.js";
11
11
  import { RIBBON_SELECTOR as ye } from "../enums/onboarding.js";
12
- import { useRecommendationExtensionStore as h } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
+ import { useRecommendationExtensionStore as E } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
13
  import ge from "./organisms/AutoSaveController.vue.js";
14
- import Se from "./organisms/base/AuthErrorModal.vue.js";
15
- import ve from "./organisms/base/Toaster.vue.js";
14
+ import ve from "./organisms/base/AuthErrorModal.vue.js";
15
+ import Se from "./organisms/base/Toaster.vue.js";
16
16
  import be from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
17
17
  import he from "./organisms/header/HeaderWrapper.vue.js";
18
18
  import Ee from "./organisms/LoadingWrapper.vue.js";
19
19
  import we from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
20
20
  import Ce from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
21
- import { useStripoApi as De } from "../services/stripoApi.js";
22
- import { useConfigStore as ke } from "../stores/config.js";
23
- import { useDynamicContentStore as Fe } from "../stores/dynamic-content.js";
24
- import { useEditorStore as $ } from "../stores/editor.js";
25
- import { usePreviewStore as Me } from "../stores/preview.js";
26
- import { useTemplateStore as Re } from "../stores/template.js";
27
- import { useUnsubscribeStore as Te } from "../stores/unsubscribe.js";
28
- import { readTrackFloor as z } from "../utils/linkTrackingIds.js";
29
- const rt = /* @__PURE__ */ ae({
21
+ import { useStripoApi as ke } from "../services/stripoApi.js";
22
+ import { useConfigStore as De } from "../stores/config.js";
23
+ import { useDynamicContentStore as Te } from "../stores/dynamic-content.js";
24
+ import { useEditorStore as w } from "../stores/editor.js";
25
+ import { usePreviewStore as Fe } from "../stores/preview.js";
26
+ import { useTemplateStore as Me } from "../stores/template.js";
27
+ import { useUnsubscribeStore as Re } from "../stores/unsubscribe.js";
28
+ import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
29
+ const rt = /* @__PURE__ */ se({
30
30
  __name: "Guido",
31
31
  props: {
32
32
  config: null,
33
33
  ready: { type: Boolean, default: !0 }
34
34
  },
35
35
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
36
- setup(q, { expose: K, emit: r }) {
37
- const s = q, V = m(
36
+ setup(V, { expose: q, emit: r }) {
37
+ const a = V, K = m(
38
38
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
39
39
  ), j = m(
40
40
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
@@ -42,34 +42,41 @@ const rt = /* @__PURE__ */ ae({
42
42
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
43
43
  ), Q = m(
44
44
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
45
- ), X = m(
45
+ ), C = H(), X = m(
46
46
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
47
- ), E = x(), p = x(), f = Fe(), w = Te(), o = ke();
48
- s.ready && o.init(s.config);
49
- const c = $(), Y = Me(), l = u(() => c.hasChanges), { isTestPartner: Z } = ue(), C = () => {
47
+ ), f = H(), y = Te(), k = Re(), o = De();
48
+ a.ready && o.init(a.config);
49
+ const s = w(), Y = Fe(), l = p(() => s.hasChanges), { isTestPartner: Z } = ue(), D = () => {
50
50
  var t;
51
- return (t = E.value) == null ? void 0 : t.handleSave(!0);
52
- }, D = (t) => {
53
- c.loadingStatus = t;
51
+ if (!s.isNormalMode) {
52
+ console.debug("guido:save:silent:blocked", {
53
+ isVersionHistoryOpen: s.isVersionHistoryOpen,
54
+ isAccessibilityTestingOpen: s.isAccessibilityTestingOpen
55
+ });
56
+ return;
57
+ }
58
+ return (t = C.value) == null ? void 0 : t.saveSilent();
59
+ }, T = (t) => {
60
+ s.loadingStatus = t;
54
61
  };
55
62
  ce(), le();
56
- const y = () => {
63
+ const g = () => {
57
64
  var t, e;
58
65
  return {
59
66
  emailId: o.templateId,
60
67
  userId: o.userId,
61
68
  username: o.username,
62
69
  partnerName: o.partnerName,
63
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || H.SAVED_MODULES,
64
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || H.DEFAULT_MODULES
70
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || z.SAVED_MODULES,
71
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || z.DEFAULT_MODULES
65
72
  };
66
- }, { initPlugin: k, preloadRuntime: F } = pe(), { runExclusive: M, beginMount: R, isCurrentMount: T } = de();
67
- let g = 0;
68
- const { getDefaultTemplate: I } = De(), { cloneTimersOnSave: L, hasTimerBlocks: U } = fe(), ee = u(() => {
73
+ }, { initPlugin: F, preloadRuntime: M } = pe(), { runExclusive: R, beginMount: I, isCurrentMount: v } = de();
74
+ let u = 0;
75
+ const { getDefaultTemplate: L } = ke(), { cloneTimersOnSave: A, hasTimerBlocks: O } = fe(), ee = p(() => {
69
76
  var t;
70
77
  return !((t = o.ui) != null && t.showHeader);
71
- }), te = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), oe = u(
72
- () => !!h().recommendationConfigs.strategyId
78
+ }), te = p(() => o.isFeatureEnabled("reusableRecommendationStrategy")), oe = p(
79
+ () => !!E().recommendationConfigs.strategyId
73
80
  );
74
81
  me({
75
82
  onBack: () => {
@@ -79,89 +86,95 @@ const rt = /* @__PURE__ */ ae({
79
86
  console.debug("guido:save:start"), r("save:start");
80
87
  },
81
88
  onSaveComplete: (t) => {
82
- const e = { ...t, metadata: y() };
89
+ const e = { ...t, metadata: g() };
83
90
  console.debug("guido:save:complete", e), r("save:complete", e);
84
91
  },
85
92
  onTestEmailClick: () => {
86
93
  console.debug("guido:test-email:click"), r("test-email:click");
87
94
  }
88
95
  });
89
- const A = (t) => {
90
- console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
91
- }, B = () => {
96
+ const U = (t) => {
97
+ console.debug("dynamic-content:close", t), y.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
98
+ }, N = () => {
92
99
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
93
100
  };
94
101
  W(() => l.value, () => {
95
102
  r("on-change", l.value);
96
103
  });
97
104
  const S = (t) => {
98
- const e = t, { attribute: a, position: d } = e.detail;
99
- console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", a, d);
105
+ const e = t, { attribute: i, position: d } = e.detail;
106
+ console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", i, d);
100
107
  };
101
- let i = null;
102
- const v = () => {
108
+ let c = null;
109
+ const b = () => {
103
110
  var e;
104
111
  const t = document.querySelector(ye);
105
- (e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
106
- }, b = async () => {
112
+ (e = f.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
113
+ }, h = async () => {
107
114
  var t;
108
115
  try {
109
- o.initialized || o.init(s.config), c.templateId = o.templateId;
110
- const e = o.template, a = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", N = (e == null ? void 0 : e.preselectedDynamicContent) || [];
111
- w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
112
- const P = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, _ = o.isFeatureEnabled("linkTrackingIds"), O = {
116
+ o.initialized || o.init(a.config), s.templateId = o.templateId;
117
+ const e = o.template, i = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
118
+ k.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
119
+ const P = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, _ = o.isFeatureEnabled("linkTrackingIds"), x = {
113
120
  partnerName: o.partnerName,
114
121
  campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
115
122
  rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
116
123
  };
117
124
  let n = {
118
- html: a && await G(a, P, O),
125
+ html: i && await G(i, P, x),
119
126
  css: d
120
127
  };
121
- n.html || (n = await I(), n.html = await G(n.html, P, O));
122
- const ne = _ ? z(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
123
- U(n.html) && (n.html = await L(n.html)), _ && (c.trackIdSessionFloor = Math.max(ne, z(n.html)));
128
+ n.html || (n = await L(), n.html = await G(n.html, P, x));
129
+ const ne = _ ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
130
+ O(n.html) && (n.html = await A(n.html)), _ && (s.trackIdSessionFloor = Math.max(ne, $(n.html)));
124
131
  const re = {
125
- preselectedDynamicContentList: N,
132
+ preselectedDynamicContentList: B,
126
133
  onReady: () => {
127
134
  console.debug("guido:ready"), r("ready");
128
135
  }
129
136
  };
130
- g = R(), await k(n, y(), re), f.selectedDynamicContentList = N;
137
+ u = I(), await F(n, g(), re), y.selectedDynamicContentList = B;
131
138
  } catch (e) {
132
139
  console.error("Failed to initialize Stripo editor:", e);
133
140
  }
134
141
  };
135
- return se(async () => {
142
+ return ie(async () => {
136
143
  var e;
137
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h().$reset(), $().$reset(), Re().$reset(), v();
138
- const t = (e = p.value) == null ? void 0 : e.parentElement;
139
- if (t && (i = new ResizeObserver(v), i.observe(t)), F(), s.ready)
140
- await b();
144
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), E().$reset(), w().$reset(), Me().$reset(), b();
145
+ const t = (e = f.value) == null ? void 0 : e.parentElement;
146
+ if (t && (c = new ResizeObserver(b), c.observe(t)), M(), a.ready)
147
+ await h();
141
148
  else {
142
- const a = W(() => s.ready, (d) => {
143
- d && (a(), b());
149
+ const i = W(() => a.ready, (d) => {
150
+ d && (i(), h());
144
151
  });
145
152
  }
146
153
  document.addEventListener("dynamic-content:open", S);
147
- }), ie(() => {
148
- i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", S), h().disposeStrategyPageReturn(), M(async () => {
149
- if (T(g))
154
+ }), ae(() => {
155
+ if (c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", S), E().disposeStrategyPageReturn(), v(u))
156
+ try {
157
+ w().isStripoInitialized = !1;
158
+ } catch (t) {
159
+ console.debug("Failed to close the editor readiness gate on unmount", t);
160
+ }
161
+ R(async () => {
162
+ if (v(u))
150
163
  try {
151
164
  window.UIEditor.removeEditor();
152
165
  } catch {
153
166
  console.debug("Failed to remove Stripo editor: No editor found");
154
167
  }
155
168
  }), o.reset();
156
- }), K({
169
+ }), q({
157
170
  dynamicContent: {
158
- insert: A,
159
- close: B
171
+ insert: U,
172
+ close: N
160
173
  },
161
174
  hasChanges: l,
162
- saveSilent: C,
163
- setLoading: D
164
- }), { __sfc: !0, PreviewContainer: V, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, LegacyStrategyUpdatedModal: X, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: s, configStore: o, editorStore: c, previewStore: Y, hasChanges: l, isTestPartner: Z, saveSilent: C, setLoading: D, emit: r, buildMetadata: y, initPlugin: k, preloadRuntime: F, runExclusive: M, beginMount: R, isCurrentMount: T, mountGeneration: g, getDefaultTemplate: I, cloneTimersOnSave: L, hasTimerBlocks: U, noHeader: ee, isRrsEnabled: te, hasAssignedStrategy: oe, insertDynamicContent: A, closeDynamicContent: B, handleDynamicContentOpen: S, ribbonObserver: i, updateRibbonOffset: v, startEditor: b, AutoSaveController: ge, AuthErrorModal: Se, Toaster: ve, FilterSelectionDrawer: be, HeaderWrapper: he, LoadingWrapper: Ee, SaveAsTemplateDrawer: we, UnsubscribeWrapper: Ce };
175
+ saveSilent: D,
176
+ setLoading: T
177
+ }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, autoSaveControllerRef: C, LegacyStrategyUpdatedModal: X, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: k, props: a, configStore: o, editorStore: s, previewStore: Y, hasChanges: l, isTestPartner: Z, saveSilent: D, setLoading: T, emit: r, buildMetadata: g, initPlugin: F, preloadRuntime: M, runExclusive: R, beginMount: I, isCurrentMount: v, mountGeneration: u, getDefaultTemplate: L, cloneTimersOnSave: A, hasTimerBlocks: O, noHeader: ee, isRrsEnabled: te, hasAssignedStrategy: oe, insertDynamicContent: U, closeDynamicContent: N, handleDynamicContentOpen: S, ribbonObserver: c, updateRibbonOffset: b, startEditor: h, AutoSaveController: ge, AuthErrorModal: ve, Toaster: Se, FilterSelectionDrawer: be, HeaderWrapper: he, LoadingWrapper: Ee, SaveAsTemplateDrawer: we, UnsubscribeWrapper: Ce };
165
178
  }
166
179
  });
167
180
  export {
@@ -1,13 +1,23 @@
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 n } from "vue";
2
+ import { useAutoSave as u } from "../../composables/useAutoSave.js";
3
+ import { useSave as m } from "../../composables/useSave.js";
4
+ import { useToaster as c } from "../../composables/useToaster.js";
5
+ const _ = /* @__PURE__ */ n({
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(i, { expose: a }) {
8
+ const { save: e } = m(), { handleError: r } = c(), t = () => e(!1, !0);
9
+ u(t);
10
+ const o = async () => {
11
+ try {
12
+ return await e(!0);
13
+ } catch (s) {
14
+ r(s, "Failed to save template");
15
+ return;
16
+ }
17
+ };
18
+ return a({ saveSilent: o }), { __sfc: !0, save: e, handleError: r, backgroundSave: t, saveSilent: o };
9
19
  }
10
20
  });
11
21
  export {
12
- f as default
22
+ _ as default
13
23
  };
@@ -0,0 +1,17 @@
1
+ import t from "./AutoSaveStatus.vue2.js";
2
+ import r from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var _ = function() {
4
+ var s = this, e = s._self._c, a = s._self._setupProxy;
5
+ return a.isFeatureEnabled("autosave") ? e("div", { staticClass: "d-f a-i-c auto-save-status" }, [a.autosaveStore.status === a.AUTOSAVE_STATUS.SAVING ? e("span", { staticClass: "d-f a-i-c f-s-1" }, [e(a.InLoading, { attrs: { "color-class": "i-c-53", size: "16" } }), e("span", { staticClass: "ml-1 t-c-53" }, [s._v(s._s(a.trans("newsletter.saving")))])], 1) : a.savedLabel ? e("span", { staticClass: "f-s-1 t-c-53" }, [s._v(s._s(a.savedLabel.before)), a.savedLabel.word ? e("span", { staticClass: "f-w-600" }, [s._v(s._s(a.savedLabel.word))]) : s._e(), s._v(s._s(a.savedLabel.after))]) : s._e()]) : s._e();
6
+ }, n = [], o = /* @__PURE__ */ r(
7
+ t,
8
+ _,
9
+ n,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const v = o.exports;
15
+ export {
16
+ v as default
17
+ };
@@ -0,0 +1,25 @@
1
+ import { defineComponent as p, computed as S } from "vue";
2
+ import { useConfig as A } from "../../../composables/useConfig.js";
3
+ import { useTranslations as T } from "../../../composables/useTranslations.js";
4
+ import { useAutosaveStore as v, AUTOSAVE_STATUS as m } from "../../../stores/autosave.js";
5
+ import { autoSaveTimestamp as b } from "../../../utils/timeUtil.js";
6
+ import { InLoading as D } from "@useinsider/design-system-vue";
7
+ const j = /* @__PURE__ */ p({
8
+ __name: "AutoSaveStatus",
9
+ setup(O) {
10
+ const { isFeatureEnabled: u } = A(), a = v(), n = T(), t = "__BOLD_START__", o = "__BOLD_END__", s = (i) => i.split(t).join("").split(o).join(""), _ = S(() => {
11
+ if (a.status !== m.SAVED || !a.lastSavedAt)
12
+ return null;
13
+ const { isToday: i, time: c, date: f } = b(a.lastSavedAt), l = { boldStart: t, boldEnd: o }, e = i ? n("email-editor.autosaved-at-today", { ...l, time: c }) : n("email-editor.autosaved-at-date", { ...l, date: f }), r = e.indexOf(t), d = e.indexOf(o, r + t.length);
14
+ return r === -1 || d === -1 ? { before: s(e), word: "", after: "" } : {
15
+ before: s(e.slice(0, r)),
16
+ word: s(e.slice(r + t.length, d)),
17
+ after: s(e.slice(d + o.length))
18
+ };
19
+ });
20
+ return { __sfc: !0, isFeatureEnabled: u, autosaveStore: a, trans: n, BOLD_START: t, BOLD_END: o, stripMarkers: s, savedLabel: _, AUTOSAVE_STATUS: m, InLoading: D };
21
+ }
22
+ });
23
+ export {
24
+ j as default
25
+ };
@@ -1,23 +1,23 @@
1
- import l from "./EditorActions.vue2.js";
1
+ import a from "./EditorActions.vue2.js";
2
2
  /* empty css */
3
- import d from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var u = function() {
5
- var s, i, n, a;
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) {
3
+ import r from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var d = function() {
5
+ var o, s;
6
+ var i = this, e = i._self._c, t = i._self._setupProxy;
7
+ return e("div", { staticClass: "d-f a-i-c editor-actions" }, [!t.editorStore.isPreviewModeOpen && t.hasContentOnTheLeft ? e("div", { staticClass: "editor-actions__divider" }) : i._e(), (s = (o = t.config) == null ? void 0 : o.features) != null && s.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 } }) : i._e(), e(t.EditorActionsMenu), t.editorStore.isPreviewModeOpen ? i._e() : e("div", { staticClass: "editor-actions__divider" }), t.editorStore.isPreviewModeOpen ? i._e() : e(t.InButtonV2, { attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(n) {
8
8
  return t.handleSave(!1);
9
- } } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
9
+ } } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(n) {
10
10
  return t.executeSave(!1);
11
11
  } } })], 1);
12
- }, c = [], p = /* @__PURE__ */ d(
12
+ }, l = [], c = /* @__PURE__ */ r(
13
+ a,
14
+ d,
13
15
  l,
14
- u,
15
- c,
16
16
  !1,
17
17
  null,
18
- "c61cc8ea"
18
+ "23b54db0"
19
19
  );
20
- const v = p.exports;
20
+ const p = c.exports;
21
21
  export {
22
- v as default
22
+ p as default
23
23
  };
@@ -1,62 +1,47 @@
1
- import { defineComponent as q, ref as n, 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";
1
+ import { defineComponent as x, computed as A, ref as h } from "vue";
2
+ import { useActionsApi as M } from "../../../composables/useActionsApi.js";
3
+ import { useConfig as q } from "../../../composables/useConfig.js";
4
+ import { useTestEmailClick as F } from "../../../composables/useGuidoActions.js";
6
5
  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({
6
+ import { useSave as V } from "../../../composables/useSave.js";
7
+ import { useToaster as w } from "../../../composables/useToaster.js";
8
+ import { useTranslations as H } from "../../../composables/useTranslations.js";
9
+ import { useLiquidValidator as b } from "../../../composables/validators/useLiquidValidator.js";
10
+ import { useAutosaveStore as k } from "../../../stores/autosave.js";
11
+ import { useEditorStore as O } from "../../../stores/editor.js";
12
+ import { useTemplateStore as R } from "../../../stores/template.js";
13
+ import { getTooltipOptions as z } from "../../../utils/tooltipUtils.js";
14
+ import { InButtonV2 as B } from "@useinsider/design-system-vue";
15
+ import { storeToRefs as D } from "pinia";
16
+ import I from "./EditorActionsMenu.vue.js";
17
+ import j from "./MigrationConfirmModal.vue.js";
18
+ const st = /* @__PURE__ */ x({
19
19
  __name: "EditorActions",
20
- setup(W, { expose: w }) {
21
- const { config: l, isFeatureEnabled: m } = k(), { exportHtml: c } = B(), { save: p } = R(), { openVersionHistory: u, closeVersionHistory: f } = P(), { getCompiledEmail: d } = b(), { compileHtml: v } = L(), { validateLiquidSyntax: y } = j(), { handleError: r } = z(), e = G(), g = J(), { hasMigrations: S } = Q(g), s = I(), i = n(!1), a = n(!1), H = n(), h = D(), _ = () => {
22
- if (e.isVersionHistoryOpen) {
23
- f();
24
- return;
25
- }
26
- u();
27
- }, C = async () => {
28
- i.value = !0, await c(), i.value = !1;
29
- }, A = () => {
30
- e.isSaveAsTemplateDrawerOpen = !0;
31
- }, M = x(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), O = x(
32
- () => {
33
- var t, o;
34
- return ((o = (t = l.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
35
- }
36
- ), V = async (t) => {
37
- a.value = !0, t || (e.loadingStatus = !0);
20
+ setup(G, { expose: y }) {
21
+ const { config: E, isFeatureEnabled: a } = q(), { save: s } = V(), { getCompiledEmail: n } = M(), { compileHtml: m } = L(), { validateLiquidSyntax: l } = b(), { handleError: r } = w(), e = O(), u = R(), c = k(), { hasMigrations: f } = D(u), C = A(() => a("liquidSyntax") || a("autosave") && c.hasStatusLabel), T = H(), i = h(!1), p = h(), d = F(), v = async (t) => {
22
+ i.value = !0, t || (e.loadingStatus = !0);
38
23
  let o;
39
24
  try {
40
- o = await p(t);
41
- } catch (T) {
42
- r(T, "Failed to save template");
25
+ o = await s(t);
26
+ } catch (g) {
27
+ r(g, "Failed to save template");
43
28
  } finally {
44
- a.value = !1, !t && !o && (e.loadingStatus = !1);
29
+ i.value = !1, !t && !o && (e.loadingStatus = !1);
45
30
  }
46
31
  return o;
47
- }, E = (t) => {
32
+ }, S = (t) => {
48
33
  var o;
49
- if (!t && S.value) {
50
- (o = H.value) == null || o.open();
34
+ if (!t && f.value) {
35
+ (o = p.value) == null || o.open();
51
36
  return;
52
37
  }
53
- return V(t);
54
- }, F = async () => {
55
- if (m("liquidSyntax")) {
38
+ return v(t);
39
+ }, _ = async () => {
40
+ if (a("liquidSyntax")) {
56
41
  e.loadingStatus = !0;
57
42
  try {
58
- const { html: t } = await d({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = v(t);
59
- if (!await y(o))
43
+ const { html: t } = await n({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = m(t);
44
+ if (!await l(o))
60
45
  return;
61
46
  } catch (t) {
62
47
  r(t, "Failed to prepare test email");
@@ -65,13 +50,13 @@ const ft = /* @__PURE__ */ q({
65
50
  e.loadingStatus = !1;
66
51
  }
67
52
  }
68
- h();
53
+ d();
69
54
  };
70
- return w({
71
- handleSave: E
72
- }), { __sfc: !0, config: l, isFeatureEnabled: m, exportHtml: c, save: p, openVersionHistory: u, closeVersionHistory: f, getCompiledEmail: d, compileHtml: v, validateLiquidSyntax: y, handleError: r, editorStore: e, templateStore: g, hasMigrations: S, trans: s, isExporting: i, isSaving: a, migrationModalRef: H, testEmailClick: h, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: V, handleSave: E, handleTestEmail: F, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
55
+ return y({
56
+ handleSave: S
57
+ }), { __sfc: !0, config: E, isFeatureEnabled: a, save: s, getCompiledEmail: n, compileHtml: m, validateLiquidSyntax: l, handleError: r, editorStore: e, templateStore: u, autosaveStore: c, hasMigrations: f, hasContentOnTheLeft: C, trans: T, isSaving: i, migrationModalRef: p, testEmailClick: d, executeSave: v, handleSave: S, handleTestEmail: _, getTooltipOptions: z, InButtonV2: B, EditorActionsMenu: I, MigrationConfirmModal: j };
73
58
  }
74
59
  });
75
60
  export {
76
- ft as default
61
+ st as default
77
62
  };
@@ -0,0 +1,20 @@
1
+ import i from "./EditorActionsMenu.vue2.js";
2
+ /* empty css */
3
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
+ var e = this, o = e._self._c, t = e._self._setupProxy;
6
+ return o("div", { staticClass: "editor-actions-menu p-r" }, [o(t.InButtonV2, { attrs: { id: "guido__kebab-button", "data-testid": "Editor Actions Menu", "left-icon": "line-more-vertical", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.loadingStatus, "label-text-status": !1, "selected-status": t.isPanelOpen, "tooltip-options": t.getTooltipOptions("guido__kebab-button"), "tooltip-text": t.trans("email-editor.more-actions") }, on: { click: function(d) {
7
+ t.isOpen = !t.isOpen;
8
+ } } }), o(t.InDropdownMenu, { staticClass: "editor-actions-menu__dropdown", attrs: { id: "guido__kebab-menu", "box-width": "basedOnLongestItem", "static-position": "bottom right", "dynamic-position": !1, "max-height": 400, options: t.options, "select-all-option-status": !1, status: t.isPanelOpen }, on: { clickOutside: t.close, optionClick: t.handleOptionClick } })], 1);
9
+ }, a = [], r = /* @__PURE__ */ s(
10
+ i,
11
+ n,
12
+ a,
13
+ !1,
14
+ null,
15
+ "d0e6b57a"
16
+ );
17
+ const _ = r.exports;
18
+ export {
19
+ _ as default
20
+ };