@useinsider/guido 3.20.1-beta.8dc88d5 → 3.20.1-beta.a9397b3

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 (71) hide show
  1. package/README.md +8 -0
  2. package/dist/@types/config/schemas.js +32 -31
  3. package/dist/components/Guido.vue.js +7 -7
  4. package/dist/components/Guido.vue2.js +84 -87
  5. package/dist/components/organisms/AutoSaveController.vue2.js +9 -19
  6. package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
  7. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
  8. package/dist/components/organisms/header/EditorActions.vue.js +13 -13
  9. package/dist/components/organisms/header/EditorActions.vue2.js +72 -57
  10. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  11. package/dist/components/organisms/header/HeaderWrapper.vue2.js +17 -9
  12. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  13. package/dist/components/organisms/header/LeftSlot.vue2.js +23 -28
  14. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  15. package/dist/components/organisms/header/MiddleSlot.vue2.js +7 -8
  16. package/dist/components/organisms/header/RightSlot.vue.js +8 -9
  17. package/dist/components/organisms/header/RightSlot.vue2.js +18 -13
  18. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
  19. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +38 -56
  20. package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js +17 -0
  21. package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue2.js +35 -0
  22. package/dist/composables/useCustomInterfaceAppearance.js +41 -42
  23. package/dist/composables/useModuleRepair.js +40 -24
  24. package/dist/config/i18n/en/labels.json.js +4 -36
  25. package/dist/config/i18n/en/tooltips.json.js +1 -2
  26. package/dist/config/migrator/index.js +12 -11
  27. package/dist/config/migrator/legacyUnsubscribeTextMigrator.js +16 -0
  28. package/dist/enums/academy.js +2 -1
  29. package/dist/guido.css +1 -1
  30. package/dist/sprite.svg +0 -10
  31. package/dist/src/@types/config/schemas.d.ts +4 -2
  32. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +1 -19
  33. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +19 -1
  34. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +19 -1
  35. package/dist/src/composables/useActionsApi.d.ts +2 -2
  36. package/dist/src/composables/useConfig.d.ts +2 -2
  37. package/dist/src/composables/useModuleRepair.d.ts +2 -11
  38. package/dist/src/config/migrator/legacyUnsubscribeTextMigrator.d.ts +1 -0
  39. package/dist/src/enums/academy.d.ts +1 -0
  40. package/dist/src/stores/autosave.d.ts +1 -73
  41. package/dist/src/stores/config.d.ts +20 -20
  42. package/dist/src/stores/editor.d.ts +25 -109
  43. package/dist/src/stores/onboarding.d.ts +21 -952
  44. package/dist/src/stores/version-history.d.ts +1 -1
  45. package/dist/src/utils/legacyUnsubscribeConversion.d.ts +9 -0
  46. package/dist/src/utils/timeUtil.d.ts +0 -5
  47. package/dist/static/styles/variables.css.js +0 -2
  48. package/dist/stores/autosave.js +7 -12
  49. package/dist/stores/editor.js +17 -19
  50. package/dist/stores/onboarding.js +21 -43
  51. package/dist/utils/legacyUnsubscribeConversion.js +86 -0
  52. package/dist/utils/timeUtil.js +17 -6
  53. package/package.json +1 -1
  54. package/dist/components/organisms/header/AutoSaveStatus.vue.js +0 -17
  55. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +0 -25
  56. package/dist/components/organisms/header/EditorActionsMenu.vue.js +0 -20
  57. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +0 -98
  58. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +0 -18
  59. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +0 -37
  60. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +0 -22
  61. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +0 -48
  62. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +0 -19
  63. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +0 -90
  64. package/dist/composables/useAccessibilityApi.js +0 -45
  65. package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +0 -2
  66. package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +0 -2
  67. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +0 -2
  68. package/dist/src/composables/useAccessibilityApi.d.ts +0 -13
  69. package/dist/static/styles/components/accessibility.css.js +0 -234
  70. /package/dist/src/components/organisms/header/{AutoSaveStatus.vue.d.ts → AutoSaveToggle.vue.d.ts} +0 -0
  71. /package/dist/src/components/organisms/{header/EditorActionsMenu.vue.d.ts → unsubscribe/LegacyUnsubscribeConvertedModal.vue.d.ts} +0 -0
package/README.md CHANGED
@@ -166,6 +166,7 @@ const config: GuidoConfigInput = {
166
166
  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).
167
167
  allowSaveWithErrors?: boolean, // Default: true - Allow the validation drawer's "Save and Continue" soft-save. Set false to hard-block invalid saves (transactional + unsubscribe pages).
168
168
  reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
169
+ legacyUnsubscribeConversion?: boolean, // Default: false - Convert legacy unsubscribe blocks that have no unsubscribe link into text blocks (on load and on module drop/copy) and show a warning modal.
169
170
  },
170
171
 
171
172
  // Optional: Callbacks
@@ -667,6 +668,13 @@ multiple partners (e.g. architect) should key by partner and place the active pa
667
668
  first. Omit the prop and the repair is a safe no-op — nothing is rewritten and no
668
669
  toaster fires (useful before the host has wired the catalog).
669
670
 
671
+ With `features.legacyUnsubscribeConversion: true`, a dropped or copied module's legacy
672
+ unsubscribe block that has no unsubscribe link (the old editor reused it as plain text,
673
+ e.g. a company address) becomes a plain text block that keeps its content, and a warning
674
+ modal explains it. The same conversion runs when a template is opened. Register these
675
+ keys host-side: `email-editor.legacy-unsubscribe-converted-modal-title` and
676
+ `email-editor.legacy-unsubscribe-converted-modal-message`.
677
+
670
678
  ---
671
679
 
672
680
  ## Development
@@ -1,5 +1,5 @@
1
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 T, union as h, lazy as I } from "../../node_modules/valibot/dist/index.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 n, 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";
3
3
  const p = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -76,30 +76,30 @@ const p = {
76
76
  value: t()
77
77
  })
78
78
  )
79
- }), f = I(() => C({
79
+ }), f = T(() => C({
80
80
  text: e(t()),
81
81
  // eslint-disable-next-line camelcase -- backend field name
82
82
  tag_text: e(t()),
83
83
  value: e(t()),
84
- children: e(c(f)),
84
+ children: e(n(f)),
85
85
  // eslint-disable-next-line camelcase -- backend field name
86
- select_items: e(c(f))
87
- })), N = g(
86
+ select_items: e(n(f))
87
+ })), v = g(
88
88
  t(),
89
- R(c(f), [])
90
- ), P = C({
89
+ R(n(f), [])
90
+ ), N = C({
91
91
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
92
92
  id: e(s()),
93
93
  /** Decimal places for price display (legacy data may use string or number) */
94
94
  decimalCount: e(h([t(), s()])),
95
95
  /** Pinned product IDs (empty array when filter-driven) */
96
- productIds: e(c(r())),
96
+ productIds: e(n(r())),
97
97
  /** Whether the block requested live products at send time */
98
98
  sendProductRequestFlag: e(o()),
99
99
  /** Whether to randomize product order */
100
100
  shuffleProducts: e(o()),
101
101
  /** Filter rules driving product selection */
102
- filters: e(c(r())),
102
+ filters: e(n(r())),
103
103
  /** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
104
104
  currency: e(t()),
105
105
  /** Currency display settings (separators, alignment, decimals) */
@@ -109,7 +109,7 @@ const p = {
109
109
  /** Recommendation strategy key (e.g. 'newArrivals') */
110
110
  strategy: e(t()),
111
111
  /** Snapshot of products as rendered by the legacy block */
112
- recommendedProducts: e(c(r())),
112
+ recommendedProducts: e(n(r())),
113
113
  /** Number of product cards per row */
114
114
  cardsInRow: e(s()),
115
115
  /** Mobile-only padding (right) */
@@ -132,7 +132,7 @@ const p = {
132
132
  isPriceMovedToNextLine: e(o()),
133
133
  /** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
134
134
  isPriceDeletedForZeroSale: e(o())
135
- }), v = a({
135
+ }), P = a({
136
136
  /**
137
137
  * Legacy recommendation block configs keyed by block ID.
138
138
  * Pass this when loading a template authored with the v1
@@ -140,7 +140,7 @@ const p = {
140
140
  * strategy, currency, locale, and layout data.
141
141
  */
142
142
  recommendationConfigs: e(
143
- g(t(), P),
143
+ g(t(), N),
144
144
  {}
145
145
  )
146
146
  }), x = a({
@@ -150,7 +150,7 @@ const p = {
150
150
  css: e(t(), ""),
151
151
  /** Preselected dynamic content items */
152
152
  preselectedDynamicContent: e(
153
- c(M),
153
+ n(M),
154
154
  []
155
155
  ),
156
156
  /**
@@ -159,11 +159,11 @@ const p = {
159
159
  * (first) partner's leaf attributes into the label→token map that repairs
160
160
  * label-form placeholders (`{{ Phone Number }}`) in dropped saved modules.
161
161
  */
162
- dynamicContentList: e(N, {}),
162
+ dynamicContentList: e(v, {}),
163
163
  /** Valid custom field attribute names from the partner's categorized fields */
164
- customFieldAttributes: e(c(t()), []),
164
+ customFieldAttributes: e(n(t()), []),
165
165
  /** Selected unsubscribe page IDs */
166
- selectedUnsubscribePages: e(c(s()), []),
166
+ selectedUnsubscribePages: e(n(s()), []),
167
167
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
168
168
  forceRecreate: e(o(), !1),
169
169
  /**
@@ -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
+ y((c) => Number.isFinite(c) ? Math.max(0, Math.floor(c)) : 0)
180
180
  ),
181
181
  0
182
182
  ),
@@ -190,11 +190,11 @@ const p = {
190
190
  recommendationCampaignUrls: e(
191
191
  i(
192
192
  r(),
193
- y((n) => n && typeof n == "object" ? { ...n } : void 0)
193
+ y((c) => c && typeof c == "object" ? { ...c } : void 0)
194
194
  )
195
195
  ),
196
196
  /** Migration-only inputs (legacy block configs) */
197
- migration: e(v, {})
197
+ migration: e(P, {})
198
198
  }), D = a({
199
199
  /** Sender display name */
200
200
  senderName: e(t(), ""),
@@ -237,14 +237,15 @@ 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),
241
240
  /** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
242
241
  allowlistEnabled: e(o(), !1),
243
242
  /** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
244
243
  linkTrackingIds: e(o(), !1),
245
244
  /** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
246
245
  allowSaveWithErrors: e(o(), !0),
247
- reusableRecommendationStrategy: e(o(), !1)
246
+ reusableRecommendationStrategy: e(o(), !1),
247
+ /** Convert linkless legacy unsubscribe blocks to text blocks and warn, on load and on module drop/copy (opt-in) */
248
+ legacyUnsubscribeConversion: e(o(), !1)
248
249
  }), w = m([
249
250
  "amp-accordion",
250
251
  "amp-carousel",
@@ -270,12 +271,12 @@ const p = {
270
271
  ]), j = a({
271
272
  /** Default blocks to exclude from the editor */
272
273
  excludeDefaults: e(
273
- c(w),
274
+ n(w),
274
275
  []
275
276
  ),
276
277
  /** Custom blocks to include in the editor */
277
278
  includeCustoms: e(
278
- c(B),
279
+ n(B),
279
280
  []
280
281
  )
281
282
  }), d = a({
@@ -307,23 +308,23 @@ const p = {
307
308
  ...d.entries,
308
309
  type: u("remove"),
309
310
  /** Strings or patterns to remove */
310
- targets: c(t())
311
+ targets: n(t())
311
312
  }), G = a({
312
313
  ...d.entries,
313
314
  type: u("custom"),
314
315
  /** Custom processor function */
315
316
  processor: k(
316
- (n) => typeof n == "function",
317
+ (c) => typeof c == "function",
317
318
  "processor must be a function"
318
319
  )
319
- }), V = T("type", [
320
+ }), V = I("type", [
320
321
  H,
321
322
  _,
322
323
  q,
323
324
  G
324
325
  ]), z = a({
325
326
  /** Custom compiler rules to apply */
326
- customRules: e(c(V), []),
327
+ customRules: e(n(V), []),
327
328
  /** Skip default compiler rules */
328
329
  ignoreDefaultRules: e(o(), !1)
329
330
  }), W = a({
@@ -333,7 +334,7 @@ const p = {
333
334
  */
334
335
  externalValidation: e(
335
336
  k(
336
- (n) => typeof n == "function",
337
+ (c) => typeof c == "function",
337
338
  "externalValidation must be a function"
338
339
  )
339
340
  )
@@ -367,7 +368,7 @@ export {
367
368
  B as CustomBlockTypeSchema,
368
369
  G as CustomRuleSchema,
369
370
  w as DefaultBlockTypeSchema,
370
- N as DynamicContentListSchema,
371
+ v as DynamicContentListSchema,
371
372
  f as DynamicContentNodeSchema,
372
373
  M as DynamicContentSchema,
373
374
  O as EditorSchema,
@@ -376,14 +377,14 @@ export {
376
377
  U as FeaturesSchema,
377
378
  K as GuidoConfigSchema,
378
379
  A as IdentitySchema,
379
- P as LegacyRecommendationConfigSchema,
380
+ N as LegacyRecommendationConfigSchema,
380
381
  p as MessageType,
381
382
  E as PartnerSchema,
382
383
  l as ProductType,
383
384
  _ as RegexRuleSchema,
384
385
  q as RemoveRuleSchema,
385
386
  H as ReplaceRuleSchema,
386
- v as TemplateMigrationSchema,
387
+ P as TemplateMigrationSchema,
387
388
  x as TemplateSchema,
388
389
  F as UISchema
389
390
  };
@@ -1,20 +1,20 @@
1
1
  import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
3
  import i from "../_virtual/_plugin-vue2_normalizer.js";
4
- var t = function() {
4
+ var s = 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), 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.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.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(), e.isLegacyUnsubscribeConversionEnabled ? r(e.LegacyUnsubscribeConvertedModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
- }, s = [], n = /* @__PURE__ */ i(
9
+ }, t = [], n = /* @__PURE__ */ i(
10
10
  o,
11
- t,
12
11
  s,
12
+ t,
13
13
  !1,
14
14
  null,
15
- "6a54dbe6"
15
+ "34bee5bb"
16
16
  );
17
- const c = n.exports;
17
+ const v = n.exports;
18
18
  export {
19
- c as default
19
+ v as default
20
20
  };
@@ -1,68 +1,63 @@
1
- import { defineComponent as ie, defineAsyncComponent as m, ref as V, computed as p, watch as H, onMounted as ae, onUnmounted as ce } from "vue";
2
- import { useCortexBlueprintBridge as de } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as me } from "../composables/useEditorLock.js";
4
- import { provideGuidoActions as le } from "../composables/useGuidoActions.js";
5
- import { useGuidoStateBridge as ue } from "../composables/useGuidoStateBridge.js";
6
- import { usePartner as pe } from "../composables/usePartner.js";
7
- import { useSaveValidationRollout as fe } from "../composables/useSaveValidationRollout.js";
8
- import { useStripo as ye } from "../composables/useStripo.js";
9
- import { useTimerClone as ge } from "../composables/useTimerClone.js";
10
- import { migrate as W } from "../config/migrator/index.js";
11
- import { ModuleFolderDefaults as G } from "../enums/defaults.js";
1
+ import { defineComponent as ce, defineAsyncComponent as c, ref as W, computed as l, watch as G, onMounted as de, onUnmounted as me } from "vue";
2
+ import { useCortexBlueprintBridge as le } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useEditorLock as ue } from "../composables/useEditorLock.js";
4
+ import { provideGuidoActions as pe } from "../composables/useGuidoActions.js";
5
+ import { useGuidoStateBridge as fe } from "../composables/useGuidoStateBridge.js";
6
+ import { usePartner as ye } from "../composables/usePartner.js";
7
+ import { useSaveValidationRollout as ge } from "../composables/useSaveValidationRollout.js";
8
+ import { useStripo as be } from "../composables/useStripo.js";
9
+ import { useTimerClone as ve } from "../composables/useTimerClone.js";
10
+ import { migrate as V } from "../config/migrator/index.js";
11
+ import { ModuleFolderDefaults as $ } from "../enums/defaults.js";
12
12
  import { RIBBON_SELECTOR as Se } from "../enums/onboarding.js";
13
13
  import { useRecommendationExtensionStore as E } from "../extensions/Blocks/Recommendation/store/recommendation.js";
14
- import ve from "./organisms/AutoSaveController.vue.js";
15
- import be from "./organisms/base/AuthErrorModal.vue.js";
16
- import he from "./organisms/base/Toaster.vue.js";
17
- import Ee from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
18
- import we from "./organisms/header/HeaderWrapper.vue.js";
19
- import Ce from "./organisms/LoadingWrapper.vue.js";
20
- import De from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
21
- import ke from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
22
- import Te from "./organisms/validation/ValidationErrorDrawer.vue.js";
23
- import { useStripoApi as Fe } from "../services/stripoApi.js";
24
- import { useConfigStore as Me } from "../stores/config.js";
25
- import { useDynamicContentStore as Re } from "../stores/dynamic-content.js";
14
+ import he from "./organisms/AutoSaveController.vue.js";
15
+ import Ee from "./organisms/base/AuthErrorModal.vue.js";
16
+ import we from "./organisms/base/Toaster.vue.js";
17
+ import Ce from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
18
+ import De from "./organisms/header/HeaderWrapper.vue.js";
19
+ import ke from "./organisms/LoadingWrapper.vue.js";
20
+ import Fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
21
+ import Me from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
22
+ import Re from "./organisms/validation/ValidationErrorDrawer.vue.js";
23
+ import { useStripoApi as Le } from "../services/stripoApi.js";
24
+ import { useConfigStore as Te } from "../stores/config.js";
25
+ import { useDynamicContentStore as Ue } from "../stores/dynamic-content.js";
26
26
  import { useEditorStore as w } from "../stores/editor.js";
27
27
  import { usePreviewStore as Ie } from "../stores/preview.js";
28
- import { useSaveValidationStore as Le } from "../stores/save-validation.js";
29
- import { useTemplateStore as Ae } from "../stores/template.js";
30
- import { useUnsubscribeStore as Oe } from "../stores/unsubscribe.js";
31
- import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
32
- const lt = /* @__PURE__ */ ie({
28
+ import { useSaveValidationStore as Ae } from "../stores/save-validation.js";
29
+ import { useTemplateStore as Be } from "../stores/template.js";
30
+ import { useUnsubscribeStore as Ne } from "../stores/unsubscribe.js";
31
+ import { readTrackFloor as z } from "../utils/linkTrackingIds.js";
32
+ const pt = /* @__PURE__ */ ce({
33
33
  __name: "Guido",
34
34
  props: {
35
35
  config: null,
36
36
  ready: { type: Boolean, default: !0 }
37
37
  },
38
38
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
39
- setup(z, { expose: q, emit: r }) {
40
- const a = z, K = m(
39
+ setup(H, { expose: q, emit: r }) {
40
+ const s = H, K = c(
41
41
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
42
- ), j = m(
42
+ ), j = c(
43
43
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
44
- ), J = m(
44
+ ), J = c(
45
45
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
46
- ), Q = m(
46
+ ), Q = c(
47
47
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
48
- ), C = V(), X = m(
48
+ ), X = c(
49
49
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
50
- ), f = V(), y = Re(), D = Oe(), o = Me();
51
- a.ready && o.init(a.config);
52
- const s = w(), Y = Ie(), l = p(() => s.hasChanges), { isTestPartner: Z } = pe(), { isEnabled: ee } = fe(), k = () => {
50
+ ), Y = c(
51
+ () => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
52
+ ), C = W(), f = W(), y = Ue(), D = Ne(), o = Te();
53
+ s.ready && o.init(s.config);
54
+ const d = w(), Z = Ie(), u = l(() => d.hasChanges), { isTestPartner: ee } = ye(), { isEnabled: te } = ge(), k = () => {
53
55
  var t;
54
- if (!s.isNormalMode) {
55
- console.debug("guido:save:silent:blocked", {
56
- isVersionHistoryOpen: s.isVersionHistoryOpen,
57
- isAccessibilityTestingOpen: s.isAccessibilityTestingOpen
58
- });
59
- return;
60
- }
61
- return (t = C.value) == null ? void 0 : t.saveSilent();
62
- }, T = (t) => {
63
- s.loadingStatus = t;
56
+ return (t = C.value) == null ? void 0 : t.handleSave(!0);
57
+ }, F = (t) => {
58
+ d.loadingStatus = t;
64
59
  };
65
- de(), ue();
60
+ le(), fe();
66
61
  const g = () => {
67
62
  var t, e;
68
63
  return {
@@ -70,18 +65,20 @@ const lt = /* @__PURE__ */ ie({
70
65
  userId: o.userId,
71
66
  username: o.username,
72
67
  partnerName: o.partnerName,
73
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
74
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
68
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
69
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
75
70
  };
76
- }, { initPlugin: F, preloadRuntime: M } = ye(), { runExclusive: R, beginMount: I, isCurrentMount: S } = me();
77
- let u = 0;
78
- const { getDefaultTemplate: L } = Fe(), { cloneTimersOnSave: A, hasTimerBlocks: O } = ge(), te = p(() => {
71
+ }, { initPlugin: M, preloadRuntime: R } = be(), { runExclusive: L, beginMount: T, isCurrentMount: b } = ue();
72
+ let p = 0;
73
+ const { getDefaultTemplate: U } = Le(), { cloneTimersOnSave: I, hasTimerBlocks: A } = ve(), oe = l(() => {
79
74
  var t;
80
75
  return !((t = o.ui) != null && t.showHeader);
81
- }), oe = p(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ne = p(
76
+ }), ne = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), re = l(
77
+ () => o.isFeatureEnabled("legacyUnsubscribeConversion")
78
+ ), ae = l(
82
79
  () => !!E().recommendationConfigs.strategyId
83
80
  );
84
- le({
81
+ pe({
85
82
  onBack: () => {
86
83
  console.debug("guido:back"), r("back");
87
84
  },
@@ -96,73 +93,73 @@ const lt = /* @__PURE__ */ ie({
96
93
  console.debug("guido:test-email:click"), r("test-email:click");
97
94
  }
98
95
  });
99
- const U = (t) => {
96
+ const B = (t) => {
100
97
  console.debug("dynamic-content:close", t), y.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
101
98
  }, N = () => {
102
99
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
103
100
  };
104
- H(() => l.value, () => {
105
- r("on-change", l.value);
101
+ G(() => u.value, () => {
102
+ r("on-change", u.value);
106
103
  });
107
104
  const v = (t) => {
108
- const e = t, { attribute: i, position: d } = e.detail;
109
- console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", i, d);
105
+ const e = t, { attribute: a, position: m } = e.detail;
106
+ console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", a, m);
110
107
  };
111
- let c = null;
112
- const b = () => {
108
+ let i = null;
109
+ const S = () => {
113
110
  var e;
114
111
  const t = document.querySelector(Se);
115
112
  (e = f.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
116
113
  }, h = async () => {
117
114
  var t;
118
115
  try {
119
- o.initialized || o.init(a.config), s.templateId = o.templateId;
120
- 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) || [];
116
+ o.initialized || o.init(s.config), d.templateId = o.templateId;
117
+ const e = o.template, a = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "", P = (e == null ? void 0 : e.preselectedDynamicContent) || [];
121
118
  D.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
122
- const P = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, _ = o.isFeatureEnabled("linkTrackingIds"), x = {
119
+ const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, O = o.isFeatureEnabled("linkTrackingIds"), x = {
123
120
  partnerName: o.partnerName,
124
121
  campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
125
122
  rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
126
123
  };
127
124
  let n = {
128
- html: i && await W(i, P, x),
129
- css: d
125
+ html: a && await V(a, _, x),
126
+ css: m
130
127
  };
131
- n.html || (n = await L(), n.html = await W(n.html, P, x));
132
- const re = _ ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
133
- O(n.html) && (n.html = await A(n.html)), _ && (s.trackIdSessionFloor = Math.max(re, $(n.html)));
134
- const se = {
135
- preselectedDynamicContentList: B,
128
+ n.html || (n = await U(), n.html = await V(n.html, _, x));
129
+ const se = O ? z(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
130
+ A(n.html) && (n.html = await I(n.html)), O && (d.trackIdSessionFloor = Math.max(se, z(n.html)));
131
+ const ie = {
132
+ preselectedDynamicContentList: P,
136
133
  onReady: () => {
137
134
  console.debug("guido:ready"), r("ready");
138
135
  }
139
136
  };
140
- u = I(), await F(n, g(), se), y.selectedDynamicContentList = B;
137
+ p = T(), await M(n, g(), ie), y.selectedDynamicContentList = P;
141
138
  } catch (e) {
142
139
  console.error("Failed to initialize Stripo editor:", e);
143
140
  }
144
141
  };
145
- return ae(async () => {
142
+ return de(async () => {
146
143
  var e;
147
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), E().$reset(), w().$reset(), Ae().$reset(), Le().$reset(), b();
144
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), E().$reset(), w().$reset(), Be().$reset(), Ae().$reset(), S();
148
145
  const t = (e = f.value) == null ? void 0 : e.parentElement;
149
- if (t && (c = new ResizeObserver(b), c.observe(t)), M(), a.ready)
146
+ if (t && (i = new ResizeObserver(S), i.observe(t)), R(), s.ready)
150
147
  await h();
151
148
  else {
152
- const i = H(() => a.ready, (d) => {
153
- d && (i(), h());
149
+ const a = G(() => s.ready, (m) => {
150
+ m && (a(), h());
154
151
  });
155
152
  }
156
153
  document.addEventListener("dynamic-content:open", v);
157
- }), ce(() => {
158
- if (c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", v), E().disposeStrategyPageReturn(), S(u))
154
+ }), me(() => {
155
+ if (i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), E().disposeStrategyPageReturn(), b(p))
159
156
  try {
160
157
  w().isStripoInitialized = !1;
161
158
  } catch (t) {
162
159
  console.debug("Failed to close the editor readiness gate on unmount", t);
163
160
  }
164
- R(async () => {
165
- if (S(u))
161
+ L(async () => {
162
+ if (b(p))
166
163
  try {
167
164
  window.UIEditor.removeEditor();
168
165
  } catch {
@@ -171,15 +168,15 @@ const lt = /* @__PURE__ */ ie({
171
168
  }), o.reset();
172
169
  }), q({
173
170
  dynamicContent: {
174
- insert: U,
171
+ insert: B,
175
172
  close: N
176
173
  },
177
- hasChanges: l,
174
+ hasChanges: u,
178
175
  saveSilent: k,
179
- setLoading: T
180
- }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, autoSaveControllerRef: C, LegacyStrategyUpdatedModal: X, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: D, props: a, configStore: o, editorStore: s, previewStore: Y, hasChanges: l, isTestPartner: Z, isSaveValidationEnabled: ee, saveSilent: k, setLoading: T, emit: r, buildMetadata: g, initPlugin: F, preloadRuntime: M, runExclusive: R, beginMount: I, isCurrentMount: S, mountGeneration: u, getDefaultTemplate: L, cloneTimersOnSave: A, hasTimerBlocks: O, noHeader: te, isRrsEnabled: oe, hasAssignedStrategy: ne, insertDynamicContent: U, closeDynamicContent: N, handleDynamicContentOpen: v, ribbonObserver: c, updateRibbonOffset: b, startEditor: h, AutoSaveController: ve, AuthErrorModal: be, Toaster: he, FilterSelectionDrawer: Ee, HeaderWrapper: we, LoadingWrapper: Ce, SaveAsTemplateDrawer: De, UnsubscribeWrapper: ke, ValidationErrorDrawer: Te };
176
+ setLoading: F
177
+ }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, LegacyStrategyUpdatedModal: X, LegacyUnsubscribeConvertedModal: Y, headerWrapperRef: C, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: D, props: s, configStore: o, editorStore: d, previewStore: Z, hasChanges: u, isTestPartner: ee, isSaveValidationEnabled: te, saveSilent: k, setLoading: F, emit: r, buildMetadata: g, initPlugin: M, preloadRuntime: R, runExclusive: L, beginMount: T, isCurrentMount: b, mountGeneration: p, getDefaultTemplate: U, cloneTimersOnSave: I, hasTimerBlocks: A, noHeader: oe, isRrsEnabled: ne, isLegacyUnsubscribeConversionEnabled: re, hasAssignedStrategy: ae, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: S, startEditor: h, AutoSaveController: he, AuthErrorModal: Ee, Toaster: we, FilterSelectionDrawer: Ce, HeaderWrapper: De, LoadingWrapper: ke, SaveAsTemplateDrawer: Fe, UnsubscribeWrapper: Me, ValidationErrorDrawer: Re };
181
178
  }
182
179
  });
183
180
  export {
184
- lt as default
181
+ pt as default
185
182
  };
@@ -1,24 +1,14 @@
1
- import { defineComponent as i } from "vue";
2
- import { useAutoSave as l } from "../../composables/useAutoSave.js";
3
- import { useSave as m } from "../../composables/useSave.js";
4
- import { useSaveValidationRollout as c } from "../../composables/useSaveValidationRollout.js";
5
- import { useToaster as p } from "../../composables/useToaster.js";
6
- const b = /* @__PURE__ */ i({
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({
7
6
  __name: "AutoSaveController",
8
- setup(v, { expose: n }) {
9
- const { save: e, saveRawOnly: t } = m(), { isEnabled: o } = c(), { handleError: r } = p(), a = () => o.value ? t() : e(!1, !0);
10
- l(a);
11
- const s = async () => {
12
- try {
13
- return await e(!0);
14
- } catch (u) {
15
- r(u, "Failed to save template");
16
- return;
17
- }
18
- };
19
- return n({ saveSilent: s }), { __sfc: !0, save: e, saveRawOnly: t, isEnabled: o, handleError: r, backgroundSave: a, saveSilent: s };
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 };
20
10
  }
21
11
  });
22
12
  export {
23
- b as default
13
+ v as default
24
14
  };
@@ -0,0 +1,22 @@
1
+ import o from "./AutoSaveToggle.vue2.js";
2
+ /* empty css */
3
+ import i from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
+ var e = this, a = e._self._c, t = e._self._setupProxy;
6
+ return t.isFeatureEnabled("autosave") ? a("div", { staticClass: "d-f a-i-c mr-3 auto-save-toggle", on: { mouseenter: function(s) {
7
+ t.isHovered = !0;
8
+ }, mouseleave: function(s) {
9
+ t.isHovered = !1;
10
+ } } }, [a(t.InToggle, { attrs: { id: "guido__autosave-toggle", name: "guido-autosave-toggle", checked: t.autosaveStore.isOn, disable: t.editorStore.loadingStatus }, on: { click: t.toggle } }), a("span", { staticClass: "ml-2 auto-save-toggle__label t-c-55" }, [e._v(" " + e._s(t.trans("email-editor.auto-save")) + " ")]), t.autosaveStore.status === t.AUTOSAVE_STATUS.SAVING ? a("span", { staticClass: "ml-2 d-f a-i-c f-s-1" }, [a(t.InLoading, { attrs: { "color-class": "i-c-53", size: "16" } }), a("span", { staticClass: "ml-1 t-c-53" }, [e._v(" " + e._s(t.trans("newsletter.saving")) + " ")])], 1) : t.lastSavedLabel ? a("span", { staticClass: "ml-2 f-s-1 t-c-53" }, [e._v(" " + e._s(t.lastSavedLabel) + " ")]) : e._e(), t.isHovered ? a(t.InInfoBox, { staticClass: "auto-save-toggle__info-box", attrs: { id: "guido__autosave-info-box", size: "small", variant: "information", "description-text": t.trans("email-editor.auto-save-description"), "title-text": t.trans("email-editor.auto-save-title") } }) : e._e()], 1) : e._e();
11
+ }, l = [], r = /* @__PURE__ */ i(
12
+ o,
13
+ n,
14
+ l,
15
+ !1,
16
+ null,
17
+ "2c964af4"
18
+ );
19
+ const d = r.exports;
20
+ export {
21
+ d as default
22
+ };
@@ -0,0 +1,19 @@
1
+ import { defineComponent as i, ref as f, computed as u } from "vue";
2
+ import { useConfig as l } from "../../../composables/useConfig.js";
3
+ import { useTranslations as p } from "../../../composables/useTranslations.js";
4
+ import { useAutosaveStore as c, AUTOSAVE_STATUS as t } from "../../../stores/autosave.js";
5
+ import { useEditorStore as S } from "../../../stores/editor.js";
6
+ import { formatLocalTime as d } from "../../../utils/timeUtil.js";
7
+ import { InToggle as g, InLoading as _, InInfoBox as A } from "@useinsider/design-system-vue";
8
+ const U = /* @__PURE__ */ i({
9
+ __name: "AutoSaveToggle",
10
+ setup(v) {
11
+ const { isFeatureEnabled: e } = l(), r = S(), o = c(), s = p(), n = f(!1), a = u(() => o.status !== t.SAVED || !o.lastSavedAt ? "" : d(o.lastSavedAt));
12
+ return { __sfc: !0, isFeatureEnabled: e, editorStore: r, autosaveStore: o, trans: s, isHovered: n, lastSavedLabel: a, toggle: (m) => {
13
+ o.isOn = m;
14
+ }, AUTOSAVE_STATUS: t, InInfoBox: A, InLoading: _, InToggle: g };
15
+ }
16
+ });
17
+ export {
18
+ U as default
19
+ };