@useinsider/guido 3.30.0-beta.c0e9c5a → 3.30.0-beta.d4ab5c4

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.
package/README.md CHANGED
@@ -176,7 +176,7 @@ const config: GuidoConfigInput = {
176
176
  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.
177
177
  accessibilityTesting?: boolean, // Default: false - Show the Accessibility Test entry in the header kebab menu (Stripo's checker: contrast, image alternatives, colour-vision simulation) and the tab-bar onboarding tour that points at it.
178
178
  itemsPriceFormatting?: boolean, // Default: false - Items block price formatting: thousand/decimal separator + decimal count on the block root, raw price tags in the export (formatted at send time).
179
- blockUnsubscribeLinks?: boolean, // Default: false - Warn on save when the design carries an Insider unsubscribe link or code ({{ins-*-unsubscribe-link}}, <%asm_*_raw_url%>, <%unsub%>): the legacy save is rejected with a warning toaster; with the validation drawer on it is a warning row that "Save and Continue" can skip. Launch blocking is up to the host. Set true for accounts whose unsubscribes are managed outside Insider (SFMC).
179
+ blockUnsubscribeLinks?: boolean, // Default: false - Warn on save when the design carries an Insider unsubscribe link or code ({{ins-*-unsubscribe-link}}, <%asm_*_raw_url%>, <%unsub%>): the legacy save is rejected with a warning toaster; with the validation drawer on it is a warning row that "Save and Continue" can skip. Launch blocking is up to the host. It also converts every unsubscribe block (v2 or legacy, linked or not) into a text block on template load and on module drop/copy, removes the Insider unsubscribe/preferences links inside it (their text stays), and shows an SFMC info modal. Set true for accounts whose unsubscribes are managed outside Insider (SFMC).
180
180
  },
181
181
 
182
182
  // Optional: Callbacks
@@ -721,6 +721,17 @@ keys host-side: `email-editor.legacy-unsubscribe-converted-modal-title`,
721
721
  `email-editor.legacy-unsubscribe-converted-modal-message` and
722
722
  `email-editor.legacy-unsubscribe-converted-modal-visit-academy` (OK reuses `action-builder.ok`).
723
723
 
724
+ With `features.blockUnsubscribeLinks: true`, every unsubscribe block (v2 or legacy, with or
725
+ without a link) becomes a plain text block when a template is opened and when a module is
726
+ dropped or copied. Inside a converted block, a link to an Insider unsubscribe or preferences
727
+ merge tag or code, or an unsubscribe link left with an empty href, is removed and
728
+ keeps its visible text; other links keep their URL and text and only lose the unsubscribe link markers. One info
729
+ modal is shown per template open or per drop that converted a block, and a load-time conversion
730
+ marks the editor as changed so the next save or autosave stores it.
731
+ Register these keys host-side: `email-editor.sfmc-unsubscribe-converted-modal-title`
732
+ and `email-editor.sfmc-unsubscribe-converted-modal-message` (Visit Academy reuses
733
+ `email-editor.legacy-unsubscribe-converted-modal-visit-academy`, OK reuses `action-builder.ok`).
734
+
724
735
  ---
725
736
 
726
737
  ## Development
@@ -3,18 +3,18 @@ import o from "./Guido.vue2.js";
3
3
  import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var n = 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(), e.isLegacyUnsubscribeConversionEnabled ? r(e.LegacyUnsubscribeConvertedModal) : a._e(), e.moduleDynamicContentStore.queue.length > 0 ? r(e.AmbiguousDynamicContentModal) : 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(l) {
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(), e.isLegacyUnsubscribeConversionEnabled ? r(e.LegacyUnsubscribeConvertedModal) : a._e(), e.isBlockUnsubscribeLinksEnabled ? r(e.SfmcUnsubscribeConvertedModal) : a._e(), e.moduleDynamicContentStore.queue.length > 0 ? r(e.AmbiguousDynamicContentModal) : 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(l) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
- }, t = [], s = /* @__PURE__ */ i(
9
+ }, s = [], t = /* @__PURE__ */ i(
10
10
  o,
11
11
  n,
12
- t,
12
+ s,
13
13
  !1,
14
14
  null,
15
- "0c5f11a1"
15
+ "e3abc4e4"
16
16
  );
17
- const u = s.exports;
17
+ const u = t.exports;
18
18
  export {
19
19
  u as default
20
20
  };
@@ -1,43 +1,43 @@
1
- import { defineComponent as Se, defineAsyncComponent as a, ref as W, computed as l, watch as $, onMounted as he, onUnmounted as Ee } from "vue";
2
- import { useCortexBlueprintBridge as Ce } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as De } from "../composables/useEditorLock.js";
4
- import { startEditorOpenMetrics as we } from "../composables/useEditorOpenMetrics.js";
1
+ import { defineComponent as he, defineAsyncComponent as s, ref as W, computed as c, watch as $, onMounted as Ce, onUnmounted as De } from "vue";
2
+ import { useCortexBlueprintBridge as ke } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useEditorLock as we } from "../composables/useEditorLock.js";
4
+ import { startEditorOpenMetrics as Fe } from "../composables/useEditorOpenMetrics.js";
5
5
  import { provideGuidoActions as Te } from "../composables/useGuidoActions.js";
6
- import { useGuidoStateBridge as ke } from "../composables/useGuidoStateBridge.js";
7
- import { usePartner as Fe } from "../composables/usePartner.js";
8
- import { useSaveValidationRollout as Me } from "../composables/useSaveValidationRollout.js";
6
+ import { useGuidoStateBridge as Me } from "../composables/useGuidoStateBridge.js";
7
+ import { usePartner as Le } from "../composables/usePartner.js";
8
+ import { useSaveValidationRollout as Ue } from "../composables/useSaveValidationRollout.js";
9
9
  import { useStripo as Ie } from "../composables/useStripo.js";
10
- import { useTimerClone as Le } from "../composables/useTimerClone.js";
11
- import { useToaster as Re } from "../composables/useToaster.js";
12
- import { useTranslations as Oe } from "../composables/useTranslations.js";
13
- import { migrate as Ue } from "../config/migrator/index.js";
10
+ import { useTimerClone as Re } from "../composables/useTimerClone.js";
11
+ import { useToaster as Oe } from "../composables/useToaster.js";
12
+ import { useTranslations as Ae } from "../composables/useTranslations.js";
13
+ import { migrate as Ne } from "../config/migrator/index.js";
14
14
  import { ModuleFolderDefaults as G } from "../enums/defaults.js";
15
- import { RIBBON_SELECTOR as Ae } from "../enums/onboarding.js";
16
- import { ToasterTypeOptions as Ne } from "../enums/toaster.js";
17
- import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as _e } from "../extensions/Blocks/Recommendation/store/recommendation.js";
18
- import { disposeUnsubscribeListeners as Pe } from "../extensions/Blocks/Unsubscribe/block.js";
19
- import { disposeDisplayConditionRequest as xe } from "../extensions/DisplayConditions/bridge.js";
20
- import Be from "./organisms/AutoSaveController.vue.js";
21
- import He from "./organisms/base/AuthErrorModal.vue.js";
22
- import Ve from "./organisms/base/Toaster.vue.js";
23
- import We from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
24
- import $e from "./organisms/header/HeaderWrapper.vue.js";
25
- import Ge from "./organisms/LoadingWrapper.vue.js";
26
- import ze from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
27
- import qe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
28
- import Ke from "./organisms/validation/ValidationErrorDrawer.vue.js";
29
- import { useStripoApi as je } from "../services/stripoApi.js";
30
- import { useConfigStore as Je } from "../stores/config.js";
31
- import { useDynamicContentStore as Qe } from "../stores/dynamic-content.js";
15
+ import { RIBBON_SELECTOR as _e } from "../enums/onboarding.js";
16
+ import { ToasterTypeOptions as Be } from "../enums/toaster.js";
17
+ import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Pe } from "../extensions/Blocks/Recommendation/store/recommendation.js";
18
+ import { disposeUnsubscribeListeners as xe } from "../extensions/Blocks/Unsubscribe/block.js";
19
+ import { disposeDisplayConditionRequest as He } from "../extensions/DisplayConditions/bridge.js";
20
+ import Ve from "./organisms/AutoSaveController.vue.js";
21
+ import We from "./organisms/base/AuthErrorModal.vue.js";
22
+ import $e from "./organisms/base/Toaster.vue.js";
23
+ import Ge from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
24
+ import ze from "./organisms/header/HeaderWrapper.vue.js";
25
+ import qe from "./organisms/LoadingWrapper.vue.js";
26
+ import Ke from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
27
+ import je from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
28
+ import Je from "./organisms/validation/ValidationErrorDrawer.vue.js";
29
+ import { useStripoApi as Qe } from "../services/stripoApi.js";
30
+ import { useConfigStore as Xe } from "../stores/config.js";
31
+ import { useDynamicContentStore as Ye } from "../stores/dynamic-content.js";
32
32
  import { useEditorStore as C } from "../stores/editor.js";
33
33
  import { useModuleDynamicContentStore as q } from "../stores/module-dynamic-content.js";
34
- import { useOnboardingStore as Xe } from "../stores/onboarding.js";
35
- import { usePreviewStore as Ye } from "../stores/preview.js";
36
- import { useSaveValidationStore as Ze } from "../stores/save-validation.js";
37
- import { useTemplateStore as et } from "../stores/template.js";
38
- import { useUnsubscribeStore as tt } from "../stores/unsubscribe.js";
34
+ import { useOnboardingStore as Ze } from "../stores/onboarding.js";
35
+ import { usePreviewStore as et } from "../stores/preview.js";
36
+ import { useSaveValidationStore as tt } from "../stores/save-validation.js";
37
+ import { useTemplateStore as ot } from "../stores/template.js";
38
+ import { useUnsubscribeStore as nt } from "../stores/unsubscribe.js";
39
39
  import { readTrackFloor as K } from "../utils/linkTrackingIds.js";
40
- const Vt = /* @__PURE__ */ Se({
40
+ const $t = /* @__PURE__ */ he({
41
41
  __name: "Guido",
42
42
  props: {
43
43
  config: null,
@@ -45,39 +45,41 @@ const Vt = /* @__PURE__ */ Se({
45
45
  },
46
46
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
47
47
  setup(j, { expose: J, emit: i }) {
48
- const c = j, r = we(), Q = a(
48
+ const d = j, r = Fe(), Q = s(
49
49
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
50
- ), X = a(
50
+ ), X = s(
51
51
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
52
- ), Y = a(
52
+ ), Y = s(
53
53
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
54
- ), Z = a(
54
+ ), Z = s(
55
55
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
56
- ), ee = a(
56
+ ), ee = s(
57
57
  () => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
58
- ), D = W(), te = a(
58
+ ), D = W(), te = s(
59
59
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
60
- ), oe = a(
60
+ ), oe = s(
61
61
  () => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
62
- ), ne = a(
62
+ ), ne = s(
63
+ () => import("./organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue.js")
64
+ ), re = s(
63
65
  () => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
64
- ), y = W(), g = Qe(), w = tt(), re = q(), o = Je();
65
- c.ready && o.init(c.config);
66
- const d = C(), ie = Ye(), p = l(() => d.hasChanges), { isTestPartner: se } = Fe(), { isEnabled: ae, loadRollout: T } = Me(), { showToaster: k } = Re(), F = Oe(), M = () => {
66
+ ), y = W(), b = Ye(), k = nt(), se = q(), o = Xe();
67
+ d.ready && o.init(d.config);
68
+ const m = C(), ie = et(), p = c(() => m.hasChanges), { isTestPartner: ae } = Le(), { isEnabled: ce, loadRollout: w } = Ue(), { showToaster: F } = Oe(), T = Ae(), M = () => {
67
69
  var t;
68
- if (d.isVersionHistoryOpen) {
69
- console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), k({
70
- type: Ne.Warning,
71
- message: F("email-editor.save-blocked-outside-editor")
70
+ if (m.isVersionHistoryOpen) {
71
+ console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), F({
72
+ type: Be.Warning,
73
+ message: T("email-editor.save-blocked-outside-editor")
72
74
  });
73
75
  return;
74
76
  }
75
77
  return (t = D.value) == null ? void 0 : t.saveSilent();
76
- }, I = (t) => {
77
- d.loadingStatus = t;
78
+ }, L = (t) => {
79
+ m.loadingStatus = t;
78
80
  };
79
- Ce(), ke();
80
- const b = () => {
81
+ ke(), Me();
82
+ const g = () => {
81
83
  var t, e;
82
84
  return {
83
85
  emailId: o.templateId,
@@ -87,14 +89,14 @@ const Vt = /* @__PURE__ */ Se({
87
89
  savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
88
90
  defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
89
91
  };
90
- }, { initPlugin: L, preloadRuntime: R } = Ie(r), { runExclusive: O, beginMount: U, isCurrentMount: v } = De();
92
+ }, { initPlugin: U, preloadRuntime: I } = Ie(r), { runExclusive: R, beginMount: O, isCurrentMount: v } = we();
91
93
  let f = 0;
92
- const { getDefaultTemplate: A } = je(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Le(), ce = l(() => {
94
+ const { getDefaultTemplate: A } = Qe(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Re(), de = c(() => {
93
95
  var t;
94
96
  return !((t = o.ui) != null && t.showHeader);
95
- }), de = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), me = l(() => o.externalDisplayConditions), le = l(
97
+ }), me = c(() => o.isFeatureEnabled("reusableRecommendationStrategy")), le = c(() => o.externalDisplayConditions), ue = c(
96
98
  () => o.isFeatureEnabled("legacyUnsubscribeConversion")
97
- ), ue = l(
99
+ ), pe = c(() => o.isFeatureEnabled("blockUnsubscribeLinks")), fe = c(
98
100
  () => !!z().recommendationConfigs.strategyId
99
101
  );
100
102
  Te({
@@ -105,85 +107,85 @@ const Vt = /* @__PURE__ */ Se({
105
107
  console.debug("guido:save:start"), i("save:start");
106
108
  },
107
109
  onSaveComplete: (t) => {
108
- const e = { ...t, metadata: b() };
110
+ const e = { ...t, metadata: g() };
109
111
  console.debug("guido:save:complete", e), i("save:complete", e);
110
112
  },
111
113
  onTestEmailClick: () => {
112
114
  console.debug("guido:test-email:click"), i("test-email:click");
113
115
  }
114
116
  });
115
- const P = (t) => {
116
- console.debug("dynamic-content:close", t), g.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
117
- }, x = () => {
117
+ const B = (t) => {
118
+ console.debug("dynamic-content:close", t), b.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
119
+ }, P = () => {
118
120
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
119
121
  };
120
122
  $(() => p.value, () => {
121
123
  i("on-change", p.value);
122
124
  });
123
125
  const S = (t) => {
124
- const e = t, { attribute: s, position: u } = e.detail;
125
- console.debug("dynamic-content:open", e.detail), i("dynamic-content:open", s, u);
126
+ const e = t, { attribute: a, position: u } = e.detail;
127
+ console.debug("dynamic-content:open", e.detail), i("dynamic-content:open", a, u);
126
128
  };
127
- let m = null;
128
- const h = () => {
129
+ let l = null;
130
+ const E = () => {
129
131
  var e;
130
- const t = document.querySelector(Ae);
132
+ const t = document.querySelector(_e);
131
133
  (e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
132
- }, E = async () => {
134
+ }, h = async () => {
133
135
  var t;
134
136
  r.mark("host_ready");
135
137
  try {
136
- o.initialized || o.init(c.config), d.templateId = o.templateId, r.setContext({
138
+ o.initialized || o.init(d.config), m.templateId = o.templateId, r.setContext({
137
139
  partnerName: o.partnerName,
138
140
  productType: o.productType,
139
141
  templateId: o.templateId,
140
142
  variationId: o.variationId
141
143
  });
142
- const e = o.template, s = (e == null ? void 0 : e.html) || "", u = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
143
- w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
144
- const pe = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), fe = {
144
+ const e = o.template, a = (e == null ? void 0 : e.html) || "", u = (e == null ? void 0 : e.css) || "", x = (e == null ? void 0 : e.preselectedDynamicContent) || [];
145
+ k.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
146
+ const ye = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), be = {
145
147
  partnerName: o.partnerName,
146
148
  campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
147
149
  rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
148
- }, ye = {
150
+ }, ge = {
149
151
  itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
150
- }, V = (ve) => r.timed(
152
+ }, V = (Ee) => r.timed(
151
153
  "migration",
152
- () => Ue(ve, pe, fe, ye)
154
+ () => Ne(Ee, ye, be, ge)
153
155
  );
154
156
  let n = {
155
- html: s && await V(s),
157
+ html: a && await V(a),
156
158
  css: u
157
159
  };
158
160
  n.html || (n = await r.timed("default_template", () => A()), n.html = await V(n.html));
159
- const ge = H ? K(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
160
- _(n.html) && (n.html = await r.timed("timer_clone", () => N(n.html))), H && (d.trackIdSessionFloor = Math.max(ge, K(n.html)));
161
- const be = {
162
- preselectedDynamicContentList: B,
161
+ const ve = H ? K(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
162
+ _(n.html) && (n.html = await r.timed("timer_clone", () => N(n.html))), H && (m.trackIdSessionFloor = Math.max(ve, K(n.html)));
163
+ const Se = {
164
+ preselectedDynamicContentList: x,
163
165
  onReady: () => {
164
166
  console.debug("guido:ready"), i("ready");
165
167
  }
166
168
  };
167
- f = U(), await L(n, b(), be, n.html !== s), g.selectedDynamicContentList = B;
169
+ f = O(), await U(n, g(), Se, n.html !== a), b.selectedDynamicContentList = x;
168
170
  } catch (e) {
169
171
  console.error("Failed to initialize Stripo editor:", e), r.markFailed();
170
172
  }
171
173
  };
172
- return he(async () => {
174
+ return Ce(async () => {
173
175
  var e;
174
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), et().$reset(), Ze().$reset(), q().$reset(), Xe().resetOnboarding("recommendationLegacyStrategyOnboarding"), T(), h();
176
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), ot().$reset(), tt().$reset(), q().$reset(), Ze().resetOnboarding("recommendationLegacyStrategyOnboarding"), w(), E();
175
177
  const t = (e = y.value) == null ? void 0 : e.parentElement;
176
- if (t && (m = new ResizeObserver(h), m.observe(t)), R(), c.ready)
177
- await E();
178
+ if (t && (l = new ResizeObserver(E), l.observe(t)), I(), d.ready)
179
+ await h();
178
180
  else {
179
- const s = $(() => c.ready, (u) => {
180
- u && (s(), E());
181
+ const a = $(() => d.ready, (u) => {
182
+ u && (a(), h());
181
183
  });
182
184
  }
183
185
  document.addEventListener("dynamic-content:open", S);
184
- }), Ee(() => {
185
- if (Pe(), _e(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
186
- xe();
186
+ }), De(() => {
187
+ if (xe(), Pe(), r.dispose(), l == null || l.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
188
+ He();
187
189
  try {
188
190
  const t = C();
189
191
  t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
@@ -191,7 +193,7 @@ const Vt = /* @__PURE__ */ Se({
191
193
  console.debug("Failed to close the editor readiness gate on unmount", t);
192
194
  }
193
195
  }
194
- O(async () => {
196
+ R(async () => {
195
197
  if (v(f))
196
198
  try {
197
199
  window.UIEditor.removeEditor();
@@ -201,15 +203,15 @@ const Vt = /* @__PURE__ */ Se({
201
203
  }), o.reset();
202
204
  }), J({
203
205
  dynamicContent: {
204
- insert: P,
205
- close: x
206
+ insert: B,
207
+ close: P
206
208
  },
207
209
  hasChanges: p,
208
210
  saveSilent: M,
209
- setLoading: I
210
- }), { __sfc: !0, openMetrics: r, PreviewContainer: Q, OnboardingWrapper: X, AssignStrategyDrawer: Y, RemoveStrategyModal: Z, DisplayConditionsHost: ee, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: te, LegacyUnsubscribeConvertedModal: oe, AmbiguousDynamicContentModal: ne, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: w, moduleDynamicContentStore: re, props: c, configStore: o, editorStore: d, previewStore: ie, hasChanges: p, isTestPartner: se, isSaveValidationEnabled: ae, loadRollout: T, showToaster: k, trans: F, saveSilent: M, setLoading: I, emit: i, buildMetadata: b, initPlugin: L, preloadRuntime: R, runExclusive: O, beginMount: U, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: A, cloneTimersOnSave: N, hasTimerBlocks: _, noHeader: ce, isRrsEnabled: de, isExternalDisplayConditionsEnabled: me, isLegacyUnsubscribeConversionEnabled: le, hasAssignedStrategy: ue, insertDynamicContent: P, closeDynamicContent: x, handleDynamicContentOpen: S, ribbonObserver: m, updateRibbonOffset: h, startEditor: E, AutoSaveController: Be, AuthErrorModal: He, Toaster: Ve, FilterSelectionDrawer: We, HeaderWrapper: $e, LoadingWrapper: Ge, SaveAsTemplateDrawer: ze, UnsubscribeWrapper: qe, ValidationErrorDrawer: Ke };
211
+ setLoading: L
212
+ }), { __sfc: !0, openMetrics: r, PreviewContainer: Q, OnboardingWrapper: X, AssignStrategyDrawer: Y, RemoveStrategyModal: Z, DisplayConditionsHost: ee, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: te, LegacyUnsubscribeConvertedModal: oe, SfmcUnsubscribeConvertedModal: ne, AmbiguousDynamicContentModal: re, wrapperRef: y, dynamicContentStore: b, unsubscribeStore: k, moduleDynamicContentStore: se, props: d, configStore: o, editorStore: m, previewStore: ie, hasChanges: p, isTestPartner: ae, isSaveValidationEnabled: ce, loadRollout: w, showToaster: F, trans: T, saveSilent: M, setLoading: L, emit: i, buildMetadata: g, initPlugin: U, preloadRuntime: I, runExclusive: R, beginMount: O, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: A, cloneTimersOnSave: N, hasTimerBlocks: _, noHeader: de, isRrsEnabled: me, isExternalDisplayConditionsEnabled: le, isLegacyUnsubscribeConversionEnabled: ue, isBlockUnsubscribeLinksEnabled: pe, hasAssignedStrategy: fe, insertDynamicContent: B, closeDynamicContent: P, handleDynamicContentOpen: S, ribbonObserver: l, updateRibbonOffset: E, startEditor: h, AutoSaveController: Ve, AuthErrorModal: We, Toaster: $e, FilterSelectionDrawer: Ge, HeaderWrapper: ze, LoadingWrapper: qe, SaveAsTemplateDrawer: Ke, UnsubscribeWrapper: je, ValidationErrorDrawer: Je };
211
213
  }
212
214
  });
213
215
  export {
214
- Vt as default
216
+ $t as default
215
217
  };
@@ -0,0 +1,17 @@
1
+ import t from "./SfmcUnsubscribeConvertedModal.vue2.js";
2
+ import r from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var n = function() {
4
+ var o = this, s = o._self._c, e = o._self._setupProxy;
5
+ return e.isVisible ? s(e.WpModal, { attrs: { id: "guido__sfmc-unsubscribe-converted-modal", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("email-editor.sfmc-unsubscribe-converted-modal-title") }, on: { close: e.close, "primary-action": e.close, "secondary-action": e.openAcademy } }, [s("p", [o._v(o._s(e.trans("email-editor.sfmc-unsubscribe-converted-modal-message")))])]) : o._e();
6
+ }, c = [], i = /* @__PURE__ */ r(
7
+ t,
8
+ n,
9
+ c,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const m = i.exports;
15
+ export {
16
+ m 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 m } from "../../../stores/editor.js";
6
+ const S = /* @__PURE__ */ n({
7
+ __name: "SfmcUnsubscribeConvertedModal",
8
+ setup(p) {
9
+ const o = a(), e = m(), r = t(
10
+ () => e.isSfmcUnsubscribeModalRequested && 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.isSfmcUnsubscribeModalRequested = !1;
23
+ }, openAcademy: () => {
24
+ window.open(c.SFMC_RELAY, "_blank", "noopener,noreferrer");
25
+ }, WpModal: i };
26
+ }
27
+ });
28
+ export {
29
+ S as default
30
+ };
@@ -1,75 +1,81 @@
1
- import { useConfig as h } from "./useConfig.js";
2
- import { useToaster as v } from "./useToaster.js";
3
- import { useTranslations as M } from "./useTranslations.js";
4
- import { ModuleDynamicContentAttribute as T } from "../enums/dynamic-content.js";
5
- import { ToasterTypeOptions as A } from "../enums/toaster.js";
6
- import { itemsBlockDynamicVariables as O } from "../extensions/Blocks/Items/enums/productEnums.js";
1
+ import { useConfig as M } from "./useConfig.js";
2
+ import { useToaster as A } from "./useToaster.js";
3
+ import { useTranslations as T } from "./useTranslations.js";
4
+ import { ModuleDynamicContentAttribute as U } from "../enums/dynamic-content.js";
5
+ import { ToasterTypeOptions as O } from "../enums/toaster.js";
6
+ import { itemsBlockDynamicVariables as S } from "../extensions/Blocks/Items/enums/productEnums.js";
7
7
  import { useDynamicContentStore as E } from "../stores/dynamic-content.js";
8
- import { useEditorStore as L } from "../stores/editor.js";
9
- import { useModuleDynamicContentStore as U } from "../stores/module-dynamic-content.js";
10
- import { buildDynamicContentLookup as _, convertModuleDynamicContent as F } from "../utils/dynamicContentConverter.js";
11
- import { stripPendingMarker as P } from "../utils/dynamicContentPendingMarker.js";
12
- import { flattenDynamicContentCandidates as S } from "../utils/genericUtil.js";
13
- import { repairItemsCurrencyAttributes as N } from "../utils/itemsCurrencyRepair.js";
14
- import { convertLegacyUnsubscribeInModuleHtml as R } from "../utils/legacyUnsubscribeConversion.js";
15
- import { extractUsedDynamicContent as k } from "../utils/registerUsedDynamicContent.js";
16
- const q = "dynamic-content.unresolved-attributes-on-drop", H = /^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/;
17
- let y = 0;
18
- const $ = (s) => {
19
- y += 1;
20
- const o = `${Date.now().toString(36)}-${y}`;
21
- return { html: s.replace(H, `$1 ${T.Pending}="${o}"`), id: o };
22
- }, I = (s, o) => {
8
+ import { useEditorStore as f } from "../stores/editor.js";
9
+ import { useModuleDynamicContentStore as F } from "../stores/module-dynamic-content.js";
10
+ import { buildDynamicContentLookup as L, convertModuleDynamicContent as _ } from "../utils/dynamicContentConverter.js";
11
+ import { stripPendingMarker as k } from "../utils/dynamicContentPendingMarker.js";
12
+ import { flattenDynamicContentCandidates as q } from "../utils/genericUtil.js";
13
+ import { repairItemsCurrencyAttributes as P } from "../utils/itemsCurrencyRepair.js";
14
+ import { convertAllUnsubscribeInModuleHtml as R, convertLegacyUnsubscribeInModuleHtml as H } from "../utils/legacyUnsubscribeConversion.js";
15
+ import { extractUsedDynamicContent as N } from "../utils/registerUsedDynamicContent.js";
16
+ const I = "dynamic-content.unresolved-attributes-on-drop", $ = /^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/;
17
+ let C = 0;
18
+ const x = (s) => {
19
+ C += 1;
20
+ const n = `${Date.now().toString(36)}-${C}`;
21
+ return { html: s.replace($, `$1 ${U.Pending}="${n}"`), id: n };
22
+ }, z = (s, n) => {
23
23
  try {
24
- const i = k(s, o.map(({ text: a, value: m }) => ({ text: a, value: m })));
24
+ const i = N(s, n.map(({ text: m, value: l }) => ({ text: m, value: l })));
25
25
  i.length > 0 && E().registerDynamicContent(i);
26
26
  } catch (i) {
27
27
  console.error("Failed to register module dynamic content:", i);
28
28
  }
29
- }, re = () => {
30
- const { template: s, isFeatureEnabled: o } = h(), { showToaster: i } = v(), a = M(), m = (r) => {
29
+ }, oe = () => {
30
+ const { template: s, isFeatureEnabled: n } = M(), { showToaster: i } = A(), m = T(), l = (o) => {
31
31
  var u, e;
32
- const t = o("liquidSyntax") ? [] : S((u = s.value) == null ? void 0 : u.dynamicContentList), c = _(t);
33
- return c.size === 0 ? { html: r, unresolved: [], ambiguous: [], candidates: t } : {
34
- ...F(
35
- r,
32
+ const r = n("liquidSyntax") ? [] : q((u = s.value) == null ? void 0 : u.dynamicContentList), c = L(r);
33
+ return c.size === 0 ? { html: o, unresolved: [], ambiguous: [], candidates: r } : {
34
+ ..._(
35
+ o,
36
36
  c,
37
- [...((e = s.value) == null ? void 0 : e.customFieldAttributes) ?? [], ...O]
37
+ [...((e = s.value) == null ? void 0 : e.customFieldAttributes) ?? [], ...S]
38
38
  ),
39
- candidates: t
39
+ candidates: r
40
40
  };
41
41
  };
42
- return { handleModuleAdd: (r, t) => {
42
+ return { handleModuleAdd: (o, r) => {
43
43
  var c, u;
44
44
  try {
45
- if ((r == null ? void 0 : r.action) !== "ADD" && (r == null ? void 0 : r.action) !== "COPY")
45
+ if ((o == null ? void 0 : o.action) !== "ADD" && (o == null ? void 0 : o.action) !== "COPY")
46
46
  return;
47
- const e = (c = t == null ? void 0 : t.getTargetNode) == null ? void 0 : c.call(t), l = (u = e == null ? void 0 : e.getOuterHTML) == null ? void 0 : u.call(e);
48
- if (!e || typeof l != "string")
47
+ const e = (c = r == null ? void 0 : r.getTargetNode) == null ? void 0 : c.call(r), a = (u = e == null ? void 0 : e.getOuterHTML) == null ? void 0 : u.call(e);
48
+ if (!e || typeof a != "string")
49
49
  return;
50
- let n = P(N(l, {
51
- convertToPriceFormat: o("itemsPriceFormatting")
52
- })), p = !1;
53
- o("legacyUnsubscribeConversion") && ({ html: n, converted: p } = R(n));
54
- const { html: f, unresolved: b, ambiguous: g, candidates: C } = m(n);
50
+ let t = k(P(a, {
51
+ convertToPriceFormat: n("itemsPriceFormatting")
52
+ })), b = !1, y = !1;
53
+ n("blockUnsubscribeLinks") ? { html: t, converted: y } = R(t) : n("legacyUnsubscribeConversion") && ({ html: t, converted: b } = H(t));
54
+ const { html: D, unresolved: v, ambiguous: g, candidates: h } = l(t);
55
55
  let d = null;
56
- if (n = f, g.length > 0 && ({ html: n, id: d } = $(n)), n !== l && t.modifyHtml(e).replaceWith(n), I(n, C), p)
56
+ if (t = D, g.length > 0 && ({ html: t, id: d } = x(t)), t !== a && r.modifyHtml(e).replaceWith(t), z(t, h), b)
57
57
  try {
58
- L().isLegacyUnsubscribeModalRequested = !0;
59
- } catch (D) {
60
- console.error("Failed to request the legacy unsubscribe modal:", D);
58
+ f().isLegacyUnsubscribeModalRequested = !0;
59
+ } catch (p) {
60
+ console.error("Failed to request the legacy unsubscribe modal:", p);
61
61
  }
62
- d && U().enqueue({ id: d, items: g }), b.length > 0 && i({
63
- type: A.Warning,
64
- message: a(q)
62
+ if (y)
63
+ try {
64
+ f().isSfmcUnsubscribeModalRequested = !0;
65
+ } catch (p) {
66
+ console.error("Failed to request the SFMC unsubscribe modal:", p);
67
+ }
68
+ d && F().enqueue({ id: d, items: g }), v.length > 0 && i({
69
+ type: O.Warning,
70
+ message: m(I)
65
71
  });
66
72
  } catch (e) {
67
73
  console.error("Failed to repair module on add:", e);
68
74
  }
69
- }, convertDynamicContent: m };
75
+ }, convertDynamicContent: l };
70
76
  };
71
77
  export {
72
- q as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
73
- I as registerUsedAttributes,
74
- re as useModuleRepair
78
+ I as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
79
+ z as registerUsedAttributes,
80
+ oe as useModuleRepair
75
81
  };