@useinsider/guido 3.21.2-beta.cfc5be2 → 3.21.2-beta.d9d48aa

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 (69) hide show
  1. package/README.md +9 -1
  2. package/dist/@types/config/schemas.js +19 -19
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +76 -74
  5. package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js +17 -0
  6. package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue2.js +30 -0
  7. package/dist/composables/useBlocksConfig.js +24 -32
  8. package/dist/composables/useModuleRepair.js +32 -23
  9. package/dist/config/migrator/index.js +10 -9
  10. package/dist/config/migrator/legacyUnsubscribeTextMigrator.js +16 -0
  11. package/dist/enums/academy.js +2 -2
  12. package/dist/guido.css +1 -1
  13. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +92 -93
  14. package/dist/node_modules/valibot/dist/index.js +261 -297
  15. package/dist/src/@types/config/schemas.d.ts +4 -4
  16. package/dist/src/composables/useConfig.d.ts +2 -2
  17. package/dist/src/composables/useModuleRepair.d.ts +2 -11
  18. package/dist/src/config/migrator/legacyUnsubscribeTextMigrator.d.ts +1 -0
  19. package/dist/src/enums/academy.d.ts +1 -1
  20. package/dist/src/stores/config.d.ts +20 -166
  21. package/dist/src/stores/editor.d.ts +25 -0
  22. package/dist/src/utils/legacyUnsubscribeConversion.d.ts +10 -0
  23. package/dist/stores/config.js +6 -13
  24. package/dist/stores/editor.js +15 -14
  25. package/dist/utils/legacyUnsubscribeConversion.js +49 -0
  26. package/dist/utils/pairProductVariables.js +14 -15
  27. package/package.json +1 -1
  28. package/dist/@types/display-condition.js +0 -25
  29. package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +0 -20
  30. package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +0 -30
  31. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +0 -30
  32. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +0 -71
  33. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +0 -34
  34. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +0 -57
  35. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +0 -17
  36. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +0 -22
  37. package/dist/composables/useDisplayConditions.js +0 -102
  38. package/dist/enums/display-condition.js +0 -12
  39. package/dist/extensions/DisplayConditions/bridge.js +0 -17
  40. package/dist/extensions/DisplayConditions/constants.js +0 -17
  41. package/dist/extensions/DisplayConditions/control.js +0 -178
  42. package/dist/extensions/DisplayConditions/display-conditions.css.js +0 -201
  43. package/dist/extensions/DisplayConditions/extension.js +0 -28
  44. package/dist/extensions/DisplayConditions/iconsRegistry.js +0 -20
  45. package/dist/extensions/DisplayConditions/library.js +0 -27
  46. package/dist/extensions/DisplayConditions/settingsPanel.js +0 -17
  47. package/dist/services/displayConditionApi.js +0 -39
  48. package/dist/src/@types/display-condition.d.ts +0 -59
  49. package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +0 -43
  50. package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +0 -2
  51. package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +0 -2
  52. package/dist/src/composables/useDisplayConditions.d.ts +0 -16
  53. package/dist/src/enums/display-condition.d.ts +0 -15
  54. package/dist/src/extensions/DisplayConditions/bridge.d.ts +0 -6
  55. package/dist/src/extensions/DisplayConditions/constants.d.ts +0 -14
  56. package/dist/src/extensions/DisplayConditions/control.d.ts +0 -23
  57. package/dist/src/extensions/DisplayConditions/extension.d.ts +0 -2
  58. package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +0 -4
  59. package/dist/src/extensions/DisplayConditions/library.d.ts +0 -8
  60. package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +0 -5
  61. package/dist/src/mock/api/display-conditions.d.ts +0 -2
  62. package/dist/src/services/displayConditionApi.d.ts +0 -8
  63. package/dist/src/stores/display-condition.d.ts +0 -81
  64. package/dist/src/utils/displayCondition.d.ts +0 -10
  65. package/dist/src/utils/protectTableText.d.ts +0 -2
  66. package/dist/stores/display-condition.js +0 -28
  67. package/dist/utils/displayCondition.js +0 -26
  68. package/dist/utils/protectTableText.js +0 -22
  69. /package/dist/src/components/organisms/{display-conditions/DisplayConditionCreateDrawer.vue.d.ts → unsubscribe/LegacyUnsubscribeConvertedModal.vue.d.ts} +0 -0
package/README.md CHANGED
@@ -150,7 +150,6 @@ const config: GuidoConfigInput = {
150
150
  ui?: {
151
151
  showHeader?: boolean, // Default: true
152
152
  backButtonLabel?: string,
153
- externalDisplayConditions?: boolean, // Default: false - Replace Stripo's display-condition UI with a Conditions tab in the settings panel and create/select drawers for reusable Liquid/Pongo display conditions.
154
153
  },
155
154
 
156
155
  // Optional: Feature toggles (defaults apply once initialized — see `ready` prop below)
@@ -167,6 +166,7 @@ const config: GuidoConfigInput = {
167
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).
168
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).
169
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.
170
170
  },
171
171
 
172
172
  // Optional: Callbacks
@@ -668,6 +668,14 @@ multiple partners (e.g. architect) should key by partner and place the active pa
668
668
  first. Omit the prop and the repair is a safe no-op — nothing is rewritten and no
669
669
  toaster fires (useful before the host has wired the catalog).
670
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`,
676
+ `email-editor.legacy-unsubscribe-converted-modal-message` and
677
+ `email-editor.legacy-unsubscribe-converted-modal-visit-academy` (OK reuses `action-builder.ok`).
678
+
671
679
  ---
672
680
 
673
681
  ## Development
@@ -84,10 +84,10 @@ const p = {
84
84
  children: e(n(f)),
85
85
  // eslint-disable-next-line camelcase -- backend field name
86
86
  select_items: e(n(f))
87
- })), x = g(
87
+ })), v = g(
88
88
  t(),
89
89
  R(n(f), [])
90
- ), D = C({
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) */
@@ -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
- }), N = 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,10 +140,10 @@ const p = {
140
140
  * strategy, currency, locale, and layout data.
141
141
  */
142
142
  recommendationConfigs: e(
143
- g(t(), D),
143
+ g(t(), N),
144
144
  {}
145
145
  )
146
- }), P = a({
146
+ }), x = a({
147
147
  /** Initial HTML content */
148
148
  html: e(t(), ""),
149
149
  /** Initial CSS content */
@@ -159,7 +159,7 @@ 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(x, {}),
162
+ dynamicContentList: e(v, {}),
163
163
  /** Valid custom field attribute names from the partner's categorized fields */
164
164
  customFieldAttributes: e(n(t()), []),
165
165
  /** Selected unsubscribe page IDs */
@@ -194,8 +194,8 @@ const p = {
194
194
  )
195
195
  ),
196
196
  /** Migration-only inputs (legacy block configs) */
197
- migration: e(N, {})
198
- }), v = a({
197
+ migration: e(P, {})
198
+ }), D = a({
199
199
  /** Sender display name */
200
200
  senderName: e(t(), ""),
201
201
  /** Email subject line */
@@ -208,7 +208,7 @@ const p = {
208
208
  /** Migration date for template compatibility */
209
209
  migrationDate: e(s(), 1759696858),
210
210
  /** Email header settings */
211
- emailHeader: e(v, { senderName: "", subject: "" }),
211
+ emailHeader: e(D, { senderName: "", subject: "" }),
212
212
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
213
213
  savedModulesFolderName: e(t(), S.SAVED_MODULES),
214
214
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
@@ -217,9 +217,7 @@ const p = {
217
217
  /** Whether to show the header bar */
218
218
  showHeader: e(o(), !0),
219
219
  /** Custom label for back button (if shown) */
220
- backButtonLabel: e(t()),
221
- /** Replace Stripo's display-condition UI with the Conditions tab and create/select drawers */
222
- externalDisplayConditions: e(o(), !1)
220
+ backButtonLabel: e(t())
223
221
  }), U = a({
224
222
  /** Enable dynamic content insertion */
225
223
  dynamicContent: e(o(), !0),
@@ -245,7 +243,9 @@ const p = {
245
243
  linkTrackingIds: e(o(), !1),
246
244
  /** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
247
245
  allowSaveWithErrors: e(o(), !0),
248
- reusableRecommendationStrategy: e(o(), !1)
246
+ reusableRecommendationStrategy: e(o(), !1),
247
+ /** Convert linkless legacy unsubscribe blocks into text blocks and warn with a modal (opt-in) */
248
+ legacyUnsubscribeConversion: e(o(), !1)
249
249
  }), w = m([
250
250
  "amp-accordion",
251
251
  "amp-carousel",
@@ -346,7 +346,7 @@ const p = {
346
346
  partner: E,
347
347
  // Optional sections (with defaults)
348
348
  /** Template content and presets */
349
- template: e(P, {}),
349
+ template: e(x, {}),
350
350
  /** Editor settings */
351
351
  editor: e(O, {}),
352
352
  /** UI configuration */
@@ -368,23 +368,23 @@ export {
368
368
  B as CustomBlockTypeSchema,
369
369
  G as CustomRuleSchema,
370
370
  w as DefaultBlockTypeSchema,
371
- x as DynamicContentListSchema,
371
+ v as DynamicContentListSchema,
372
372
  f as DynamicContentNodeSchema,
373
373
  M as DynamicContentSchema,
374
374
  O as EditorSchema,
375
- v as EmailHeaderSchema,
375
+ D as EmailHeaderSchema,
376
376
  L as FallbackFontSchema,
377
377
  U as FeaturesSchema,
378
378
  K as GuidoConfigSchema,
379
379
  A as IdentitySchema,
380
- D as LegacyRecommendationConfigSchema,
380
+ N as LegacyRecommendationConfigSchema,
381
381
  p as MessageType,
382
382
  E as PartnerSchema,
383
383
  l as ProductType,
384
384
  _ as RegexRuleSchema,
385
385
  q as RemoveRuleSchema,
386
386
  H as ReplaceRuleSchema,
387
- N as TemplateMigrationSchema,
388
- P as TemplateSchema,
387
+ P as TemplateMigrationSchema,
388
+ x as TemplateSchema,
389
389
  F as UISchema
390
390
  };
@@ -1,18 +1,18 @@
1
- import i from "./Guido.vue2.js";
1
+ import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import o from "../_virtual/_plugin-vue2_normalizer.js";
4
- var t = function() {
3
+ import i from "../_virtual/_plugin-vue2_normalizer.js";
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, { 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.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), e.isExternalDisplayConditionsEnabled ? r(e.DisplayConditionsHost) : 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__ */ o(
10
- i,
11
- t,
9
+ }, t = [], n = /* @__PURE__ */ i(
10
+ o,
12
11
  s,
12
+ t,
13
13
  !1,
14
14
  null,
15
- "5d5e32de"
15
+ "6cdd5182"
16
16
  );
17
17
  const v = n.exports;
18
18
  export {
@@ -4,33 +4,33 @@ import { useEditorLock as pe } from "../composables/useEditorLock.js";
4
4
  import { provideGuidoActions as fe } from "../composables/useGuidoActions.js";
5
5
  import { useGuidoStateBridge as ye } from "../composables/useGuidoStateBridge.js";
6
6
  import { usePartner as ge } from "../composables/usePartner.js";
7
- import { useSaveValidationRollout as Se } from "../composables/useSaveValidationRollout.js";
7
+ import { useSaveValidationRollout as be } from "../composables/useSaveValidationRollout.js";
8
8
  import { useStripo as ve } from "../composables/useStripo.js";
9
- import { useTimerClone as be } from "../composables/useTimerClone.js";
10
- import { migrate as H } from "../config/migrator/index.js";
11
- import { ModuleFolderDefaults as V } from "../enums/defaults.js";
9
+ import { useTimerClone as Se } 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 he } from "../enums/onboarding.js";
13
- import { useRecommendationExtensionStore as $, disposeStrategyPageReturnListeners as Ee } from "../extensions/Blocks/Recommendation/store/recommendation.js";
14
- import { disposeUnsubscribeListeners as De } from "../extensions/Blocks/Unsubscribe/block.js";
15
- import we from "./organisms/AutoSaveController.vue.js";
16
- import Ce from "./organisms/base/AuthErrorModal.vue.js";
13
+ import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Ee } from "../extensions/Blocks/Recommendation/store/recommendation.js";
14
+ import { disposeUnsubscribeListeners as we } from "../extensions/Blocks/Unsubscribe/block.js";
15
+ import Ce from "./organisms/AutoSaveController.vue.js";
16
+ import De from "./organisms/base/AuthErrorModal.vue.js";
17
17
  import ke from "./organisms/base/Toaster.vue.js";
18
- import Re from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
19
- import Fe from "./organisms/header/HeaderWrapper.vue.js";
20
- import Le from "./organisms/LoadingWrapper.vue.js";
18
+ import Fe from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
19
+ import Le from "./organisms/header/HeaderWrapper.vue.js";
20
+ import Re from "./organisms/LoadingWrapper.vue.js";
21
21
  import Me from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
22
- import Te from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
23
- import Ie from "./organisms/validation/ValidationErrorDrawer.vue.js";
24
- import { useStripoApi as Ue } from "../services/stripoApi.js";
22
+ import Ue from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
23
+ import Te from "./organisms/validation/ValidationErrorDrawer.vue.js";
24
+ import { useStripoApi as Ie } from "../services/stripoApi.js";
25
25
  import { useConfigStore as Ae } from "../stores/config.js";
26
26
  import { useDynamicContentStore as Be } from "../stores/dynamic-content.js";
27
27
  import { useEditorStore as E } from "../stores/editor.js";
28
28
  import { usePreviewStore as Ne } from "../stores/preview.js";
29
- import { useSaveValidationStore as xe } from "../stores/save-validation.js";
30
- import { useTemplateStore as Pe } from "../stores/template.js";
31
- import { useUnsubscribeStore as _e } from "../stores/unsubscribe.js";
32
- import { readTrackFloor as z } from "../utils/linkTrackingIds.js";
33
- const St = /* @__PURE__ */ de({
29
+ import { useSaveValidationStore as Pe } from "../stores/save-validation.js";
30
+ import { useTemplateStore as _e } from "../stores/template.js";
31
+ import { useUnsubscribeStore as Oe } from "../stores/unsubscribe.js";
32
+ import { readTrackFloor as H } from "../utils/linkTrackingIds.js";
33
+ const vo = /* @__PURE__ */ de({
34
34
  __name: "Guido",
35
35
  props: {
36
36
  config: null,
@@ -47,35 +47,37 @@ const St = /* @__PURE__ */ de({
47
47
  ), X = c(
48
48
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
49
49
  ), Y = c(
50
- () => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
51
- ), Z = c(
52
50
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
53
- ), D = W(), f = W(), y = Be(), w = _e(), o = Ae();
54
- a.ready && o.init(a.config);
55
- const d = E(), ee = Ne(), u = l(() => d.hasChanges), { isTestPartner: te } = ge(), { isEnabled: oe, loadRollout: C } = Se(), k = () => {
56
- var t;
57
- return (t = D.value) == null ? void 0 : t.handleSave(!0);
58
- }, R = (t) => {
59
- d.loadingStatus = t;
51
+ ), Z = c(
52
+ () => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
53
+ ), w = W(), f = W(), y = Be(), C = Oe(), t = Ae();
54
+ a.ready && t.init(a.config);
55
+ const d = E(), ee = Ne(), u = l(() => d.hasChanges), { isTestPartner: oe } = ge(), { isEnabled: te, loadRollout: D } = be(), k = () => {
56
+ var o;
57
+ return (o = w.value) == null ? void 0 : o.handleSave(!0);
58
+ }, F = (o) => {
59
+ d.loadingStatus = o;
60
60
  };
61
61
  ue(), ye();
62
62
  const g = () => {
63
- var t, e;
63
+ var o, e;
64
64
  return {
65
- emailId: o.templateId,
66
- userId: o.userId,
67
- username: o.username,
68
- partnerName: o.partnerName,
69
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || V.SAVED_MODULES,
70
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || V.DEFAULT_MODULES
65
+ emailId: t.templateId,
66
+ userId: t.userId,
67
+ username: t.username,
68
+ partnerName: t.partnerName,
69
+ savedModulesFolderName: ((o = t.editor) == null ? void 0 : o.savedModulesFolderName) || $.SAVED_MODULES,
70
+ defaultModulesFolderName: ((e = t.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
71
71
  };
72
- }, { initPlugin: F, preloadRuntime: L } = ve(), { runExclusive: M, beginMount: T, isCurrentMount: S } = pe();
72
+ }, { initPlugin: L, preloadRuntime: R } = ve(), { runExclusive: M, beginMount: U, isCurrentMount: b } = pe();
73
73
  let p = 0;
74
- const { getDefaultTemplate: I } = Ue(), { cloneTimersOnSave: U, hasTimerBlocks: A } = be(), ne = l(() => {
75
- var t;
76
- return !((t = o.ui) != null && t.showHeader);
77
- }), re = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), se = l(() => o.externalDisplayConditions), ae = l(
78
- () => !!$().recommendationConfigs.strategyId
74
+ const { getDefaultTemplate: T } = Ie(), { cloneTimersOnSave: I, hasTimerBlocks: A } = Se(), ne = l(() => {
75
+ var o;
76
+ return !((o = t.ui) != null && o.showHeader);
77
+ }), re = l(() => t.isFeatureEnabled("reusableRecommendationStrategy")), se = l(
78
+ () => t.isFeatureEnabled("legacyUnsubscribeConversion")
79
+ ), ae = l(
80
+ () => !!z().recommendationConfigs.strategyId
79
81
  );
80
82
  fe({
81
83
  onBack: () => {
@@ -84,65 +86,65 @@ const St = /* @__PURE__ */ de({
84
86
  onSaveStart: () => {
85
87
  console.debug("guido:save:start"), r("save:start");
86
88
  },
87
- onSaveComplete: (t) => {
88
- const e = { ...t, metadata: g() };
89
+ onSaveComplete: (o) => {
90
+ const e = { ...o, metadata: g() };
89
91
  console.debug("guido:save:complete", e), r("save:complete", e);
90
92
  },
91
93
  onTestEmailClick: () => {
92
94
  console.debug("guido:test-email:click"), r("test-email:click");
93
95
  }
94
96
  });
95
- const B = (t) => {
96
- console.debug("dynamic-content:close", t), y.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
97
+ const B = (o) => {
98
+ console.debug("dynamic-content:close", o), y.setSelectedDynamicContent(o), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: o }));
97
99
  }, N = () => {
98
100
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
99
101
  };
100
102
  G(() => u.value, () => {
101
103
  r("on-change", u.value);
102
104
  });
103
- const v = (t) => {
104
- const e = t, { attribute: s, position: m } = e.detail;
105
+ const v = (o) => {
106
+ const e = o, { attribute: s, position: m } = e.detail;
105
107
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, m);
106
108
  };
107
109
  let i = null;
108
- const b = () => {
110
+ const S = () => {
109
111
  var e;
110
- const t = document.querySelector(he);
111
- (e = f.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
112
+ const o = document.querySelector(he);
113
+ (e = f.value) == null || e.style.setProperty("--ribbon-offset", `${(o == null ? void 0 : o.offsetHeight) ?? 0}px`);
112
114
  }, h = async () => {
113
- var t;
115
+ var o;
114
116
  try {
115
- o.initialized || o.init(a.config), d.templateId = o.templateId;
116
- const e = o.template, s = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "", x = (e == null ? void 0 : e.preselectedDynamicContent) || [];
117
- w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
118
- const P = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, _ = o.isFeatureEnabled("linkTrackingIds"), O = {
119
- partnerName: o.partnerName,
117
+ t.initialized || t.init(a.config), d.templateId = t.templateId;
118
+ const e = t.template, s = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "", P = (e == null ? void 0 : e.preselectedDynamicContent) || [];
119
+ C.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
120
+ const _ = ((o = e == null ? void 0 : e.migration) == null ? void 0 : o.recommendationConfigs) ?? {}, O = t.isFeatureEnabled("linkTrackingIds"), x = {
121
+ partnerName: t.partnerName,
120
122
  campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
121
- rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
123
+ rrsEnabled: t.isFeatureEnabled("reusableRecommendationStrategy")
122
124
  };
123
125
  let n = {
124
- html: s && await H(s, P, O),
126
+ html: s && await V(s, _, x),
125
127
  css: m
126
128
  };
127
- n.html || (n = await I(), n.html = await H(n.html, P, O));
128
- const ie = _ ? z(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
129
- A(n.html) && (n.html = await U(n.html)), _ && (d.trackIdSessionFloor = Math.max(ie, z(n.html)));
129
+ n.html || (n = await T(), n.html = await V(n.html, _, x));
130
+ const ie = O ? H(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
131
+ A(n.html) && (n.html = await I(n.html)), O && (d.trackIdSessionFloor = Math.max(ie, H(n.html)));
130
132
  const ce = {
131
- preselectedDynamicContentList: x,
133
+ preselectedDynamicContentList: P,
132
134
  onReady: () => {
133
135
  console.debug("guido:ready"), r("ready");
134
136
  }
135
137
  };
136
- p = T(), await F(n, g(), ce), y.selectedDynamicContentList = x;
138
+ p = U(), await L(n, g(), ce), y.selectedDynamicContentList = P;
137
139
  } catch (e) {
138
140
  console.error("Failed to initialize Stripo editor:", e);
139
141
  }
140
142
  };
141
143
  return me(async () => {
142
144
  var e;
143
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), $().$reset(), E().$reset(), Pe().$reset(), xe().$reset(), C(), b();
144
- const t = (e = f.value) == null ? void 0 : e.parentElement;
145
- if (t && (i = new ResizeObserver(b), i.observe(t)), L(), a.ready)
145
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), E().$reset(), _e().$reset(), Pe().$reset(), D(), S();
146
+ const o = (e = f.value) == null ? void 0 : e.parentElement;
147
+ if (o && (i = new ResizeObserver(S), i.observe(o)), R(), a.ready)
146
148
  await h();
147
149
  else {
148
150
  const s = G(() => a.ready, (m) => {
@@ -151,20 +153,20 @@ const St = /* @__PURE__ */ de({
151
153
  }
152
154
  document.addEventListener("dynamic-content:open", v);
153
155
  }), le(() => {
154
- if (De(), Ee(), i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), S(p))
156
+ if (we(), Ee(), i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), b(p))
155
157
  try {
156
158
  E().isStripoInitialized = !1;
157
- } catch (t) {
158
- console.debug("Failed to close the editor readiness gate on unmount", t);
159
+ } catch (o) {
160
+ console.debug("Failed to close the editor readiness gate on unmount", o);
159
161
  }
160
162
  M(async () => {
161
- if (S(p))
163
+ if (b(p))
162
164
  try {
163
165
  window.UIEditor.removeEditor();
164
166
  } catch {
165
167
  console.debug("Failed to remove Stripo editor: No editor found");
166
168
  }
167
- }), o.reset();
169
+ }), t.reset();
168
170
  }), K({
169
171
  dynamicContent: {
170
172
  insert: B,
@@ -172,10 +174,10 @@ const St = /* @__PURE__ */ de({
172
174
  },
173
175
  hasChanges: u,
174
176
  saveSilent: k,
175
- setLoading: R
176
- }), { __sfc: !0, PreviewContainer: j, OnboardingWrapper: J, AssignStrategyDrawer: Q, RemoveStrategyModal: X, DisplayConditionsHost: Y, LegacyStrategyUpdatedModal: Z, headerWrapperRef: D, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: w, props: a, configStore: o, editorStore: d, previewStore: ee, hasChanges: u, isTestPartner: te, isSaveValidationEnabled: oe, loadRollout: C, saveSilent: k, setLoading: R, emit: r, buildMetadata: g, initPlugin: F, preloadRuntime: L, runExclusive: M, beginMount: T, isCurrentMount: S, mountGeneration: p, getDefaultTemplate: I, cloneTimersOnSave: U, hasTimerBlocks: A, noHeader: ne, isRrsEnabled: re, isExternalDisplayConditionsEnabled: se, hasAssignedStrategy: ae, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: b, startEditor: h, AutoSaveController: we, AuthErrorModal: Ce, Toaster: ke, FilterSelectionDrawer: Re, HeaderWrapper: Fe, LoadingWrapper: Le, SaveAsTemplateDrawer: Me, UnsubscribeWrapper: Te, ValidationErrorDrawer: Ie };
177
+ setLoading: F
178
+ }), { __sfc: !0, PreviewContainer: j, OnboardingWrapper: J, AssignStrategyDrawer: Q, RemoveStrategyModal: X, LegacyStrategyUpdatedModal: Y, LegacyUnsubscribeConvertedModal: Z, headerWrapperRef: w, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: C, props: a, configStore: t, editorStore: d, previewStore: ee, hasChanges: u, isTestPartner: oe, isSaveValidationEnabled: te, loadRollout: D, saveSilent: k, setLoading: F, emit: r, buildMetadata: g, initPlugin: L, preloadRuntime: R, runExclusive: M, beginMount: U, isCurrentMount: b, mountGeneration: p, getDefaultTemplate: T, cloneTimersOnSave: I, hasTimerBlocks: A, noHeader: ne, isRrsEnabled: re, isLegacyUnsubscribeConversionEnabled: se, hasAssignedStrategy: ae, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: S, startEditor: h, AutoSaveController: Ce, AuthErrorModal: De, Toaster: ke, FilterSelectionDrawer: Fe, HeaderWrapper: Le, LoadingWrapper: Re, SaveAsTemplateDrawer: Me, UnsubscribeWrapper: Ue, ValidationErrorDrawer: Te };
177
179
  }
178
180
  });
179
181
  export {
180
- St as default
182
+ vo as default
181
183
  };
@@ -0,0 +1,17 @@
1
+ import s from "./LegacyUnsubscribeConvertedModal.vue2.js";
2
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var r = function() {
4
+ var o = this, t = o._self._c, e = o._self._setupProxy;
5
+ return e.isVisible ? t(e.WpModal, { attrs: { id: "guido__legacy-unsubscribe-converted-modal", state: "warning", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("email-editor.legacy-unsubscribe-converted-modal-title") }, on: { close: e.close, "primary-action": e.close, "secondary-action": e.openAcademy } }, [t("p", [o._v(o._s(e.trans("email-editor.legacy-unsubscribe-converted-modal-message")))])]) : o._e();
6
+ }, a = [], c = /* @__PURE__ */ n(
7
+ s,
8
+ r,
9
+ a,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const d = c.exports;
15
+ export {
16
+ d as default
17
+ };
@@ -0,0 +1,30 @@
1
+ import { defineComponent as n, computed as t } from "vue";
2
+ import i from "../../wrappers/WpModal.vue.js";
3
+ import { useTranslations as a } from "../../../composables/useTranslations.js";
4
+ import { ACADEMY_LINKS as c } from "../../../enums/academy.js";
5
+ import { useEditorStore as p } from "../../../stores/editor.js";
6
+ const L = /* @__PURE__ */ n({
7
+ __name: "LegacyUnsubscribeConvertedModal",
8
+ setup(d) {
9
+ const o = a(), e = p(), r = t(
10
+ () => e.isLegacyUnsubscribeModalRequested && e.isStripoInitialized
11
+ ), s = t(() => ({
12
+ secondaryButton: {
13
+ type: "subtle-primary",
14
+ labelText: o("email-editor.legacy-unsubscribe-converted-modal-visit-academy")
15
+ },
16
+ primaryButton: {
17
+ type: "primary",
18
+ labelText: o("action-builder.ok")
19
+ }
20
+ }));
21
+ return { __sfc: !0, trans: o, editorStore: e, isVisible: r, footerButtonOptions: s, close: () => {
22
+ e.isLegacyUnsubscribeModalRequested = !1;
23
+ }, openAcademy: () => {
24
+ window.open(c.LEGACY_UNSUBSCRIBE_MODULE, "_blank", "noopener,noreferrer");
25
+ }, WpModal: i };
26
+ }
27
+ });
28
+ export {
29
+ L as default
30
+ };
@@ -1,6 +1,6 @@
1
- import l from "../extensions/ModulesTabIcons/extension.js";
2
- import { useConfigStore as c } from "../stores/config.js";
3
- const s = {
1
+ import r from "../extensions/ModulesTabIcons/extension.js";
2
+ import { useConfigStore as l } from "../stores/config.js";
3
+ const a = {
4
4
  "amp-accordion": "ampAccordionEnabled",
5
5
  "amp-carousel": "ampCarouselEnabled",
6
6
  "amp-form-controls": "ampFormControlsEnabled",
@@ -14,7 +14,7 @@ const s = {
14
14
  "text-block": "textEnabled",
15
15
  "timer-block": "timerEnabled",
16
16
  "video-block": "videoEnabled"
17
- }, i = {
17
+ }, s = {
18
18
  "dynamic-content": () => import("../extensions/DynamicContent/extension.js"),
19
19
  "checkbox-block": () => import("../extensions/Blocks/Checkbox/extension.js"),
20
20
  "radio-button-block": () => import("../extensions/Blocks/RadioButton/extension.js"),
@@ -22,48 +22,40 @@ const s = {
22
22
  "unsubscribe-block": () => import("../extensions/Blocks/Unsubscribe/extension.js"),
23
23
  "coupon-block": () => import("../extensions/Blocks/CouponBlock/extension.js"),
24
24
  "items-block": () => import("../extensions/Blocks/Items/extension.js")
25
- }, b = (o) => {
26
- if (!o || !o.length)
25
+ }, i = (n) => {
26
+ if (!n || !n.length)
27
27
  return {};
28
28
  const t = {};
29
- return o.forEach((n) => {
30
- const e = s[n];
29
+ return n.forEach((o) => {
30
+ const e = a[o];
31
31
  e && (t[e] = !1);
32
32
  }), t;
33
- }, m = async (o) => {
34
- if (!o)
35
- return [l];
36
- const t = await import("../extensions/DisplayConditions/extension.js");
37
- return [l, t.default];
38
- }, d = async (o, t = !1) => {
39
- const n = await m(t);
40
- if (!o || !o.length)
41
- return n;
42
- const e = await Promise.all(
43
- o.map(async (r) => {
44
- const a = i[r];
45
- return a ? (await a()).default : null;
33
+ }, b = () => [r], m = async (n) => {
34
+ const t = b();
35
+ if (!n || !n.length)
36
+ return t;
37
+ const o = await Promise.all(
38
+ n.map(async (e) => {
39
+ const c = s[e];
40
+ return c ? (await c()).default : null;
46
41
  })
47
42
  );
48
43
  return [
49
- ...n,
50
- ...e.filter((r) => r !== null)
44
+ ...t,
45
+ ...o.filter((e) => e !== null)
51
46
  ];
52
- }, k = () => {
53
- const o = c();
47
+ }, E = () => {
48
+ const n = l();
54
49
  return {
55
50
  getStripoBlocksConfig: async () => {
56
- const n = o.blocks;
51
+ const o = n.blocks;
57
52
  return {
58
- baseBlocks: b(n == null ? void 0 : n.excludeDefaults),
59
- extensions: await d(
60
- n == null ? void 0 : n.includeCustoms,
61
- o.externalDisplayConditions
62
- )
53
+ baseBlocks: i(o == null ? void 0 : o.excludeDefaults),
54
+ extensions: await m(o == null ? void 0 : o.includeCustoms)
63
55
  };
64
56
  }
65
57
  };
66
58
  };
67
59
  export {
68
- k as useBlocksConfig
60
+ E as useBlocksConfig
69
61
  };
@@ -1,33 +1,42 @@
1
- import { useConfig as C } from "./useConfig.js";
2
- import { useToaster as T } from "./useToaster.js";
3
- import { useTranslations as g } from "./useTranslations.js";
4
- import { ToasterTypeOptions as D } from "../enums/toaster.js";
5
- import { buildDynamicContentLookup as f, convertModuleDynamicContent as h } from "../utils/dynamicContentConverter.js";
6
- import { flattenDynamicContentList as O } from "../utils/genericUtil.js";
1
+ import { useConfig as f } from "./useConfig.js";
2
+ import { useToaster as d } from "./useToaster.js";
3
+ import { useTranslations as C } from "./useTranslations.js";
4
+ import { ToasterTypeOptions as h } from "../enums/toaster.js";
5
+ import { useEditorStore as T } from "../stores/editor.js";
6
+ import { buildDynamicContentLookup as v, convertModuleDynamicContent as D } from "../utils/dynamicContentConverter.js";
7
+ import { flattenDynamicContentList as L } from "../utils/genericUtil.js";
7
8
  import { repairItemsCurrencyAttributes as M } from "../utils/itemsCurrencyRepair.js";
8
- const N = "dynamic-content.unresolved-attributes-on-drop", R = () => {
9
- const { template: p, isFeatureEnabled: m } = C(), { showToaster: a } = T(), y = g();
10
- return { handleModuleAdd: (e, o) => {
11
- var s, l, u;
9
+ import { convertLegacyUnsubscribeInModuleHtml as O } from "../utils/legacyUnsubscribeConversion.js";
10
+ const E = "dynamic-content.unresolved-attributes-on-drop", Y = () => {
11
+ const { template: p, isFeatureEnabled: s } = f(), { showToaster: y } = d(), b = C();
12
+ return { handleModuleAdd: (t, r) => {
13
+ var c, l, u;
12
14
  try {
13
- if ((e == null ? void 0 : e.action) !== "ADD" && (e == null ? void 0 : e.action) !== "COPY")
15
+ if ((t == null ? void 0 : t.action) !== "ADD" && (t == null ? void 0 : t.action) !== "COPY")
14
16
  return;
15
- const t = (s = o == null ? void 0 : o.getTargetNode) == null ? void 0 : s.call(o), r = (l = t == null ? void 0 : t.getOuterHTML) == null ? void 0 : l.call(t);
16
- if (!t || typeof r != "string")
17
+ const e = (c = r == null ? void 0 : r.getTargetNode) == null ? void 0 : c.call(r), n = (l = e == null ? void 0 : e.getOuterHTML) == null ? void 0 : l.call(e);
18
+ if (!e || typeof n != "string")
17
19
  return;
18
- let n = M(r);
19
- const c = f(O((u = p.value) == null ? void 0 : u.dynamicContentList));
20
- let i = [];
21
- c.size > 0 && ({ html: n, unresolved: i } = h(n, c, m("liquidSyntax"))), n !== r && o.modifyHtml(t).replaceWith(n), i.length > 0 && a({
22
- type: D.Warning,
23
- message: y(N)
20
+ let o = M(n), i = !1;
21
+ s("legacyUnsubscribeConversion") && ({ html: o, converted: i } = O(o));
22
+ const a = v(L((u = p.value) == null ? void 0 : u.dynamicContentList));
23
+ let m = [];
24
+ if (a.size > 0 && ({ html: o, unresolved: m } = D(o, a, s("liquidSyntax"))), o !== n && r.modifyHtml(e).replaceWith(o), i)
25
+ try {
26
+ T().isLegacyUnsubscribeModalRequested = !0;
27
+ } catch (g) {
28
+ console.error("Failed to request the legacy unsubscribe modal:", g);
29
+ }
30
+ m.length > 0 && y({
31
+ type: h.Warning,
32
+ message: b(E)
24
33
  });
25
- } catch (t) {
26
- console.error("Failed to repair module on add:", t);
34
+ } catch (e) {
35
+ console.error("Failed to repair module on add:", e);
27
36
  }
28
37
  } };
29
38
  };
30
39
  export {
31
- N as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
32
- R as useModuleRepair
40
+ E as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
41
+ Y as useModuleRepair
33
42
  };