@useinsider/guido 3.30.1 → 3.30.2-beta.779a6a4
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 +12 -1
- package/dist/components/Guido.vue.js +5 -5
- package/dist/components/Guido.vue2.js +115 -109
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +1 -1
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +54 -48
- package/dist/components/organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue.js +17 -0
- package/dist/components/organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue2.js +30 -0
- package/dist/composables/useModuleRepair.js +56 -50
- package/dist/composables/useStripo.js +87 -79
- package/dist/config/migrator/index.js +14 -13
- package/dist/config/migrator/recommendation/cssCascade.js +84 -0
- package/dist/config/migrator/recommendation/extractors.js +195 -89
- package/dist/config/migrator/recommendation/themeMapper.js +33 -21
- package/dist/config/migrator/recommendationMigrator.js +70 -63
- package/dist/config/migrator/sfmcUnsubscribeTextMigrator.js +20 -0
- package/dist/enums/academy.js +2 -1
- package/dist/guido.css +1 -1
- package/dist/package.json.js +2 -2
- package/dist/src/components/organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue.d.ts +2 -0
- package/dist/src/composables/useModuleRepair.d.ts +1 -1
- package/dist/src/config/migrator/index.d.ts +1 -1
- package/dist/src/config/migrator/recommendation/cssCascade.d.ts +24 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +18 -1
- package/dist/src/config/migrator/recommendationMigrator.d.ts +2 -1
- package/dist/src/config/migrator/sfmcUnsubscribeTextMigrator.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/stores/editor.d.ts +54 -0
- package/dist/src/utils/legacyUnsubscribeConversion.d.ts +3 -0
- package/dist/stores/editor.js +2 -0
- package/dist/utils/legacyUnsubscribeConversion.js +69 -28
- package/package.json +1 -1
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
|
-
},
|
|
9
|
+
}, s = [], t = /* @__PURE__ */ i(
|
|
10
10
|
o,
|
|
11
11
|
n,
|
|
12
|
-
|
|
12
|
+
s,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"b0036f48"
|
|
16
16
|
);
|
|
17
|
-
const u =
|
|
17
|
+
const u = t.exports;
|
|
18
18
|
export {
|
|
19
19
|
u as default
|
|
20
20
|
};
|
|
@@ -1,83 +1,85 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import { startEditorOpenMetrics as
|
|
5
|
-
import { provideGuidoActions as
|
|
6
|
-
import { useGuidoStateBridge as
|
|
7
|
-
import { usePartner as
|
|
8
|
-
import { useSaveValidationRollout as
|
|
9
|
-
import { useStripo as
|
|
10
|
-
import { useTimerClone as
|
|
11
|
-
import { useToaster as
|
|
12
|
-
import { useTranslations as
|
|
13
|
-
import { migrate as
|
|
1
|
+
import { defineComponent as Ce, defineAsyncComponent as i, ref as W, computed as c, watch as $, onMounted as De, onUnmounted as ke } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as we } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { useEditorLock as Fe } from "../composables/useEditorLock.js";
|
|
4
|
+
import { startEditorOpenMetrics as Te } from "../composables/useEditorOpenMetrics.js";
|
|
5
|
+
import { provideGuidoActions as Le } from "../composables/useGuidoActions.js";
|
|
6
|
+
import { useGuidoStateBridge as Me } from "../composables/useGuidoStateBridge.js";
|
|
7
|
+
import { usePartner as Ue } from "../composables/usePartner.js";
|
|
8
|
+
import { useSaveValidationRollout as Ie } from "../composables/useSaveValidationRollout.js";
|
|
9
|
+
import { useStripo as Re } from "../composables/useStripo.js";
|
|
10
|
+
import { useTimerClone as Oe } from "../composables/useTimerClone.js";
|
|
11
|
+
import { useToaster as Ae } from "../composables/useToaster.js";
|
|
12
|
+
import { useTranslations as Ne } from "../composables/useTranslations.js";
|
|
13
|
+
import { migrate as _e } from "../config/migrator/index.js";
|
|
14
14
|
import { ModuleFolderDefaults as G } from "../enums/defaults.js";
|
|
15
|
-
import { RIBBON_SELECTOR as
|
|
16
|
-
import { ToasterTypeOptions as
|
|
17
|
-
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as
|
|
18
|
-
import { disposeUnsubscribeListeners as
|
|
19
|
-
import { disposeDisplayConditionRequest as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import { useStripoApi as
|
|
30
|
-
import { useConfigStore as
|
|
31
|
-
import { useDynamicContentStore as
|
|
15
|
+
import { RIBBON_SELECTOR as Be } from "../enums/onboarding.js";
|
|
16
|
+
import { ToasterTypeOptions as Pe } from "../enums/toaster.js";
|
|
17
|
+
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as xe } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
18
|
+
import { disposeUnsubscribeListeners as He } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
19
|
+
import { disposeDisplayConditionRequest as Ve } from "../extensions/DisplayConditions/bridge.js";
|
|
20
|
+
import We from "./organisms/AutoSaveController.vue.js";
|
|
21
|
+
import $e from "./organisms/base/AuthErrorModal.vue.js";
|
|
22
|
+
import Ge from "./organisms/base/Toaster.vue.js";
|
|
23
|
+
import ze from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
24
|
+
import qe from "./organisms/header/HeaderWrapper.vue.js";
|
|
25
|
+
import Ke from "./organisms/LoadingWrapper.vue.js";
|
|
26
|
+
import je from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
27
|
+
import Je from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
28
|
+
import Qe from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
29
|
+
import { useStripoApi as Xe } from "../services/stripoApi.js";
|
|
30
|
+
import { useConfigStore as Ye } from "../stores/config.js";
|
|
31
|
+
import { useDynamicContentStore as Ze } 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
|
|
35
|
-
import { usePreviewStore as
|
|
36
|
-
import { useSaveValidationStore as
|
|
37
|
-
import { useTemplateStore as
|
|
38
|
-
import { useUnsubscribeStore as
|
|
34
|
+
import { useOnboardingStore as et } from "../stores/onboarding.js";
|
|
35
|
+
import { usePreviewStore as tt } from "../stores/preview.js";
|
|
36
|
+
import { useSaveValidationStore as ot } from "../stores/save-validation.js";
|
|
37
|
+
import { useTemplateStore as nt } from "../stores/template.js";
|
|
38
|
+
import { useUnsubscribeStore as rt } from "../stores/unsubscribe.js";
|
|
39
39
|
import { readTrackFloor as K } from "../utils/linkTrackingIds.js";
|
|
40
|
-
const
|
|
40
|
+
const Gt = /* @__PURE__ */ Ce({
|
|
41
41
|
__name: "Guido",
|
|
42
42
|
props: {
|
|
43
43
|
config: null,
|
|
44
44
|
ready: { type: Boolean, default: !0 }
|
|
45
45
|
},
|
|
46
46
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
47
|
-
setup(j, { expose: J, emit:
|
|
48
|
-
const
|
|
47
|
+
setup(j, { expose: J, emit: r }) {
|
|
48
|
+
const d = j, s = Te(), Q = i(
|
|
49
49
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
50
|
-
), X =
|
|
50
|
+
), X = i(
|
|
51
51
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
52
|
-
), Y =
|
|
52
|
+
), Y = i(
|
|
53
53
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
54
|
-
), Z =
|
|
54
|
+
), Z = i(
|
|
55
55
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
56
|
-
), ee =
|
|
56
|
+
), ee = i(
|
|
57
57
|
() => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
|
|
58
|
-
), D = W(), te =
|
|
58
|
+
), D = W(), te = i(
|
|
59
59
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
60
|
-
), oe =
|
|
60
|
+
), oe = i(
|
|
61
61
|
() => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
|
|
62
|
-
), ne =
|
|
62
|
+
), ne = i(
|
|
63
|
+
() => import("./organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue.js")
|
|
64
|
+
), re = i(
|
|
63
65
|
() => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
|
|
64
|
-
), y = W(),
|
|
65
|
-
|
|
66
|
-
const
|
|
66
|
+
), y = W(), b = Ze(), k = rt(), se = q(), o = Ye();
|
|
67
|
+
d.ready && o.init(d.config);
|
|
68
|
+
const m = C(), ie = tt(), p = c(() => m.hasChanges), { isTestPartner: ae } = Ue(), { isEnabled: ce, loadRollout: w } = Ie(), { showToaster: F } = Ae(), T = Ne(), L = () => {
|
|
67
69
|
var t;
|
|
68
|
-
if (
|
|
69
|
-
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }),
|
|
70
|
-
type:
|
|
71
|
-
message:
|
|
70
|
+
if (m.isVersionHistoryOpen) {
|
|
71
|
+
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), F({
|
|
72
|
+
type: Pe.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
|
-
},
|
|
77
|
-
|
|
78
|
+
}, M = (t) => {
|
|
79
|
+
m.loadingStatus = t;
|
|
78
80
|
};
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
+
we(), Me();
|
|
82
|
+
const g = () => {
|
|
81
83
|
var t, e;
|
|
82
84
|
return {
|
|
83
85
|
emailId: o.templateId,
|
|
@@ -87,103 +89,107 @@ 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:
|
|
92
|
+
}, { initPlugin: U, preloadRuntime: I } = Re(s), { runExclusive: R, beginMount: O, isCurrentMount: v } = Fe();
|
|
91
93
|
let f = 0;
|
|
92
|
-
const { getDefaultTemplate: A } =
|
|
94
|
+
const { getDefaultTemplate: A } = Xe(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Oe(), de = c(() => {
|
|
93
95
|
var t;
|
|
94
96
|
return !((t = o.ui) != null && t.showHeader);
|
|
95
|
-
}),
|
|
97
|
+
}), me = c(() => o.isFeatureEnabled("reusableRecommendationStrategy")), le = c(() => o.externalDisplayConditions), ue = c(
|
|
96
98
|
() => o.isFeatureEnabled("legacyUnsubscribeConversion")
|
|
97
|
-
),
|
|
99
|
+
), pe = c(() => o.isFeatureEnabled("blockUnsubscribeLinks")), fe = c(
|
|
98
100
|
() => !!z().recommendationConfigs.strategyId
|
|
99
101
|
);
|
|
100
|
-
|
|
102
|
+
Le({
|
|
101
103
|
onBack: () => {
|
|
102
|
-
console.debug("guido:back"),
|
|
104
|
+
console.debug("guido:back"), r("back");
|
|
103
105
|
},
|
|
104
106
|
onSaveStart: () => {
|
|
105
|
-
console.debug("guido:save:start"),
|
|
107
|
+
console.debug("guido:save:start"), r("save:start");
|
|
106
108
|
},
|
|
107
109
|
onSaveComplete: (t) => {
|
|
108
|
-
const e = { ...t, metadata:
|
|
109
|
-
console.debug("guido:save:complete", e),
|
|
110
|
+
const e = { ...t, metadata: g() };
|
|
111
|
+
console.debug("guido:save:complete", e), r("save:complete", e);
|
|
110
112
|
},
|
|
111
113
|
onTestEmailClick: () => {
|
|
112
|
-
console.debug("guido:test-email:click"),
|
|
114
|
+
console.debug("guido:test-email:click"), r("test-email:click");
|
|
113
115
|
}
|
|
114
116
|
});
|
|
115
|
-
const
|
|
116
|
-
console.debug("dynamic-content:close", t),
|
|
117
|
-
},
|
|
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
|
+
r("on-change", p.value);
|
|
122
124
|
});
|
|
123
125
|
const S = (t) => {
|
|
124
|
-
const e = t, { attribute:
|
|
125
|
-
console.debug("dynamic-content:open", e.detail),
|
|
126
|
+
const e = t, { attribute: a, position: u } = e.detail;
|
|
127
|
+
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", a, u);
|
|
126
128
|
};
|
|
127
|
-
let
|
|
128
|
-
const
|
|
129
|
+
let l = null;
|
|
130
|
+
const E = () => {
|
|
129
131
|
var e;
|
|
130
|
-
const t = document.querySelector(
|
|
132
|
+
const t = document.querySelector(Be);
|
|
131
133
|
(e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
132
|
-
},
|
|
134
|
+
}, h = async () => {
|
|
133
135
|
var t;
|
|
134
|
-
|
|
136
|
+
s.mark("host_ready");
|
|
135
137
|
try {
|
|
136
|
-
o.initialized || o.init(
|
|
138
|
+
o.initialized || o.init(d.config), m.templateId = o.templateId, s.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,
|
|
143
|
-
|
|
144
|
-
const
|
|
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
|
-
},
|
|
150
|
+
}, ge = {
|
|
149
151
|
itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
|
|
150
|
-
}, V = (
|
|
152
|
+
}, V = (Ee, he) => s.timed(
|
|
151
153
|
"migration",
|
|
152
|
-
() =>
|
|
154
|
+
() => _e(Ee, ye, be, ge, he)
|
|
153
155
|
);
|
|
154
156
|
let n = {
|
|
155
|
-
html:
|
|
157
|
+
html: a && await V(a, u),
|
|
156
158
|
css: u
|
|
157
159
|
};
|
|
158
|
-
n.html || (n = await
|
|
159
|
-
const
|
|
160
|
-
_(n.html) && (n.html = await
|
|
161
|
-
const
|
|
162
|
-
preselectedDynamicContentList:
|
|
160
|
+
n.html || (n = await s.timed("default_template", () => A()), n.html = await V(n.html, n.css));
|
|
161
|
+
const ve = H ? K(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
162
|
+
_(n.html) && (n.html = await s.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
|
-
console.debug("guido:ready"),
|
|
166
|
+
console.debug("guido:ready"), r("ready");
|
|
167
|
+
},
|
|
168
|
+
// The host clears its unsaved flag on ready; a load-time edit may already have set hasChanges, so the watcher stays silent.
|
|
169
|
+
onLoadConversionSettled: () => {
|
|
170
|
+
r("on-change", !0);
|
|
165
171
|
}
|
|
166
172
|
};
|
|
167
|
-
f =
|
|
173
|
+
f = O(), await U(n, g(), Se, n.html !== a), b.selectedDynamicContentList = x;
|
|
168
174
|
} catch (e) {
|
|
169
|
-
console.error("Failed to initialize Stripo editor:", e),
|
|
175
|
+
console.error("Failed to initialize Stripo editor:", e), s.markFailed();
|
|
170
176
|
}
|
|
171
177
|
};
|
|
172
|
-
return
|
|
178
|
+
return De(async () => {
|
|
173
179
|
var e;
|
|
174
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(),
|
|
180
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), nt().$reset(), ot().$reset(), q().$reset(), et().resetOnboarding("recommendationLegacyStrategyOnboarding"), w(), E();
|
|
175
181
|
const t = (e = y.value) == null ? void 0 : e.parentElement;
|
|
176
|
-
if (t && (
|
|
177
|
-
await
|
|
182
|
+
if (t && (l = new ResizeObserver(E), l.observe(t)), I(), d.ready)
|
|
183
|
+
await h();
|
|
178
184
|
else {
|
|
179
|
-
const
|
|
180
|
-
u && (
|
|
185
|
+
const a = $(() => d.ready, (u) => {
|
|
186
|
+
u && (a(), h());
|
|
181
187
|
});
|
|
182
188
|
}
|
|
183
189
|
document.addEventListener("dynamic-content:open", S);
|
|
184
|
-
}),
|
|
185
|
-
if (
|
|
186
|
-
|
|
190
|
+
}), ke(() => {
|
|
191
|
+
if (He(), xe(), s.dispose(), l == null || l.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
|
|
192
|
+
Ve();
|
|
187
193
|
try {
|
|
188
194
|
const t = C();
|
|
189
195
|
t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
|
|
@@ -191,7 +197,7 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
191
197
|
console.debug("Failed to close the editor readiness gate on unmount", t);
|
|
192
198
|
}
|
|
193
199
|
}
|
|
194
|
-
|
|
200
|
+
R(async () => {
|
|
195
201
|
if (v(f))
|
|
196
202
|
try {
|
|
197
203
|
window.UIEditor.removeEditor();
|
|
@@ -201,15 +207,15 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
201
207
|
}), o.reset();
|
|
202
208
|
}), J({
|
|
203
209
|
dynamicContent: {
|
|
204
|
-
insert:
|
|
205
|
-
close:
|
|
210
|
+
insert: B,
|
|
211
|
+
close: P
|
|
206
212
|
},
|
|
207
213
|
hasChanges: p,
|
|
208
|
-
saveSilent:
|
|
209
|
-
setLoading:
|
|
210
|
-
}), { __sfc: !0, openMetrics:
|
|
214
|
+
saveSilent: L,
|
|
215
|
+
setLoading: M
|
|
216
|
+
}), { __sfc: !0, openMetrics: s, 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: L, setLoading: M, emit: r, 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: We, AuthErrorModal: $e, Toaster: Ge, FilterSelectionDrawer: ze, HeaderWrapper: qe, LoadingWrapper: Ke, SaveAsTemplateDrawer: je, UnsubscribeWrapper: Je, ValidationErrorDrawer: Qe };
|
|
211
217
|
}
|
|
212
218
|
});
|
|
213
219
|
export {
|
|
214
|
-
|
|
220
|
+
Gt as default
|
|
215
221
|
};
|
|
@@ -3,7 +3,7 @@ import r from "./AssignStrategyDrawer.vue2.js";
|
|
|
3
3
|
import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var a = function() {
|
|
5
5
|
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
6
|
-
return t.
|
|
6
|
+
return t.isRendered ? s(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, show: t.store.assignStrategyDrawerStatus, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
|
|
7
7
|
return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [t.strategiesLoading ? s(t.InSkeleton, { staticClass: "assign-strategy-select-skeleton", attrs: { sizing: t.SELECT_SKELETON_SIZING } }) : s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select w-23-s", attrs: { id: "assign-strategy-select", "create-button-visible": "", "info-box-position": "bottom right", "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { create: function(c) {
|
|
8
8
|
return t.store.openStrategyCreation();
|
|
9
9
|
}, infoBoxButtonClick: t.onInfoBoxButtonClick, select: t.onSelect } })], 1)];
|
|
@@ -1,47 +1,53 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as R, defineAsyncComponent as O, ref as f, computed as o, watch as P, nextTick as U } from "vue";
|
|
2
2
|
import "@useinsider/design-system-organisms/style";
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import { DOTTED_DATE_LOCALE as
|
|
6
|
-
import { URLS as
|
|
7
|
-
import { ToasterTypeOptions as
|
|
8
|
-
import { useRecommendationExtensionStore as
|
|
9
|
-
import { commitStrategyChange as
|
|
10
|
-
import
|
|
11
|
-
import { formatShortDate as
|
|
3
|
+
import { useToaster as G } from "../../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as M } from "../../../../composables/useTranslations.js";
|
|
5
|
+
import { DOTTED_DATE_LOCALE as $ } from "../../../../enums/date.js";
|
|
6
|
+
import { URLS as z } from "../../../../enums/extensions/recommendationBlock.js";
|
|
7
|
+
import { ToasterTypeOptions as S } from "../../../../enums/toaster.js";
|
|
8
|
+
import { useRecommendationExtensionStore as H } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import { commitStrategyChange as I } from "../../../../extensions/Blocks/Recommendation/utils/strategyCommit.js";
|
|
10
|
+
import F from "./StrategyInfoBoxContent.vue.js";
|
|
11
|
+
import { formatShortDate as K } from "../../../../utils/dateUtil.js";
|
|
12
12
|
import { asText as g } from "../../../../utils/genericUtil.js";
|
|
13
|
-
import { escapeHtml as
|
|
14
|
-
import { InSkeleton as
|
|
15
|
-
const
|
|
13
|
+
import { escapeHtml as v } from "../../../../utils/htmlEscape.js";
|
|
14
|
+
import { InSkeleton as h } from "@useinsider/design-system-vue";
|
|
15
|
+
const lt = /* @__PURE__ */ R({
|
|
16
16
|
__name: "AssignStrategyDrawer",
|
|
17
|
-
setup(
|
|
18
|
-
const d = () => import("@useinsider/design-system-organisms"),
|
|
19
|
-
render: (s) => s(
|
|
20
|
-
}),
|
|
17
|
+
setup(V) {
|
|
18
|
+
const d = () => import("@useinsider/design-system-organisms"), T = (t, r) => ({
|
|
19
|
+
render: (s) => s(h, { props: { sizing: { width: t, height: r } } })
|
|
20
|
+
}), x = O({
|
|
21
21
|
loader: async () => (await d()).OrgStrategyDetailModal,
|
|
22
|
-
loadingComponent:
|
|
22
|
+
loadingComponent: T(480, 240),
|
|
23
23
|
delay: 0
|
|
24
|
-
}),
|
|
24
|
+
}), A = O({
|
|
25
25
|
loader: async () => (await d()).OrgStrategyDropdown
|
|
26
|
-
}), i = "guido-edit-strategy-",
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
}), i = "guido-edit-strategy-", C = { width: 480, height: 42 }, a = M(), e = H(), { showToaster: c } = G(), n = f(null), m = "legacy", l = f(!1), u = f(!1), L = o(() => e.strategiesLoading || e.legacyConversionLoading), k = o(() => a(
|
|
27
|
+
"email-editor.assign-strategy-description",
|
|
28
|
+
{ url: z.RECOMMENDATION_STRATEGIES_PANEL_PATH }
|
|
29
|
+
));
|
|
30
|
+
P(() => e.assignStrategyDrawerStatus, async (t) => {
|
|
31
|
+
if (!t) {
|
|
32
|
+
await U(), u.value = e.assignStrategyDrawerStatus;
|
|
29
33
|
return;
|
|
34
|
+
}
|
|
35
|
+
u.value = !0;
|
|
30
36
|
const { strategyId: r } = e.recommendationConfigs;
|
|
31
37
|
n.value = r || (e.isLegacyStrategyBlock ? m : null), l.value = !1, e.invalidateStrategies(), e.fetchStrategies().catch(() => {
|
|
32
38
|
c({
|
|
33
|
-
type:
|
|
39
|
+
type: S.Error,
|
|
34
40
|
message: a("discovery-strategy.error-description")
|
|
35
41
|
});
|
|
36
42
|
});
|
|
37
|
-
});
|
|
38
|
-
const
|
|
43
|
+
}, { immediate: !0 });
|
|
44
|
+
const _ = (t) => {
|
|
39
45
|
const r = g(t.updated_at || t.created_at);
|
|
40
46
|
if (!r)
|
|
41
47
|
return "";
|
|
42
|
-
const s =
|
|
48
|
+
const s = K(r, $);
|
|
43
49
|
return a("recommendation-strategy.last-updated-on", { value: s });
|
|
44
|
-
},
|
|
50
|
+
}, w = o(() => ({
|
|
45
51
|
text: a("ds-steps.legacy-strategy"),
|
|
46
52
|
value: m,
|
|
47
53
|
hidden: !0
|
|
@@ -54,10 +60,10 @@ const it = /* @__PURE__ */ N({
|
|
|
54
60
|
variant: "information",
|
|
55
61
|
size: "small",
|
|
56
62
|
class: "assign-strategy-info-box",
|
|
57
|
-
titleText:
|
|
63
|
+
titleText: v(g(t.name)),
|
|
58
64
|
descriptionStatus: !0,
|
|
59
|
-
descriptionText:
|
|
60
|
-
slot:
|
|
65
|
+
descriptionText: _(t),
|
|
66
|
+
slot: F,
|
|
61
67
|
slotProps: { strategy: t },
|
|
62
68
|
// The info box drops the option's value/text, so the id is the only channel
|
|
63
69
|
// that can carry the strategy back to the click handler.
|
|
@@ -70,17 +76,17 @@ const it = /* @__PURE__ */ N({
|
|
|
70
76
|
icon: "line-open-website"
|
|
71
77
|
}]
|
|
72
78
|
}
|
|
73
|
-
}))), B = o(() => e.isLegacyStrategyBlock ? [
|
|
74
|
-
var
|
|
75
|
-
const r = (
|
|
79
|
+
}))), B = o(() => e.isLegacyStrategyBlock ? [w.value, ...y.value] : y.value), b = (t) => {
|
|
80
|
+
var D;
|
|
81
|
+
const r = (D = t == null ? void 0 : t.id) != null && D.startsWith(i) ? t.id.slice(i.length) : "";
|
|
76
82
|
if (!r)
|
|
77
83
|
return;
|
|
78
|
-
const s = e.currentRecommendationId,
|
|
79
|
-
e.openStrategyEdit(r) && (String(n.value ?? "") === r && (n.value = null),
|
|
80
|
-
},
|
|
84
|
+
const s = e.currentRecommendationId, p = e.recommendationConfigs.strategyId === r;
|
|
85
|
+
e.openStrategyEdit(r) && (String(n.value ?? "") === r && (n.value = null), p && (e.removeStrategy(), s !== null && I(s, "Removed recommendation strategy")));
|
|
86
|
+
}, E = o(() => {
|
|
81
87
|
const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
|
|
82
88
|
return t ? { ...t, fallback_config: null } : null;
|
|
83
|
-
}),
|
|
89
|
+
}), N = o(() => ({
|
|
84
90
|
primaryButton: {
|
|
85
91
|
styling: "solid",
|
|
86
92
|
type: "primary",
|
|
@@ -92,10 +98,10 @@ const it = /* @__PURE__ */ N({
|
|
|
92
98
|
labelText: a("products.cancel")
|
|
93
99
|
}
|
|
94
100
|
}));
|
|
95
|
-
return { __sfc: !0, loadOrganisms: d, skeleton:
|
|
101
|
+
return { __sfc: !0, loadOrganisms: d, skeleton: T, OrgStrategyDetailModal: x, OrgStrategyDropdown: A, EDIT_BUTTON_ID_PREFIX: i, SELECT_SKELETON_SIZING: C, trans: a, store: e, showToaster: c, selectedStrategyId: n, LEGACY_OPTION_VALUE: m, showSelectionError: l, isRendered: u, strategiesLoading: L, drawerDescription: k, lastUpdatedText: _, legacyStrategyOption: w, remoteStrategyOptions: y, strategyOptions: B, onInfoBoxButtonClick: b, selectedStrategy: E, footerButtonGroupOptions: N, closeDrawer: () => {
|
|
96
102
|
e.closeAssignStrategyDrawer();
|
|
97
103
|
}, assignStrategy: async () => {
|
|
98
|
-
const t =
|
|
104
|
+
const t = E.value;
|
|
99
105
|
if (!t) {
|
|
100
106
|
l.value = !0;
|
|
101
107
|
return;
|
|
@@ -103,26 +109,26 @@ const it = /* @__PURE__ */ N({
|
|
|
103
109
|
let r = "";
|
|
104
110
|
try {
|
|
105
111
|
r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
|
|
106
|
-
} catch (
|
|
107
|
-
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed",
|
|
112
|
+
} catch (p) {
|
|
113
|
+
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", p);
|
|
108
114
|
}
|
|
109
115
|
if (!r) {
|
|
110
116
|
c({
|
|
111
|
-
type:
|
|
112
|
-
message: a("email-editor.strategy-assign-failed", { strategyName:
|
|
117
|
+
type: S.Error,
|
|
118
|
+
message: a("email-editor.strategy-assign-failed", { strategyName: v(g(t.name)) })
|
|
113
119
|
});
|
|
114
120
|
return;
|
|
115
121
|
}
|
|
116
122
|
const s = e.currentRecommendationId;
|
|
117
123
|
e.assignStrategy(t), c({
|
|
118
|
-
type:
|
|
119
|
-
message: a("email-editor.strategy-assigned-success", { strategyName:
|
|
120
|
-
}), e.closeAssignStrategyDrawer(), s !== null && await
|
|
124
|
+
type: S.Success,
|
|
125
|
+
message: a("email-editor.strategy-assigned-success", { strategyName: v(g(t.name)) })
|
|
126
|
+
}), e.closeAssignStrategyDrawer(), s !== null && await I(s, "Assigned recommendation strategy");
|
|
121
127
|
}, onSelect: (t) => {
|
|
122
128
|
n.value = t.value, l.value = !1;
|
|
123
|
-
}, InSkeleton:
|
|
129
|
+
}, InSkeleton: h };
|
|
124
130
|
}
|
|
125
131
|
});
|
|
126
132
|
export {
|
|
127
|
-
|
|
133
|
+
lt as default
|
|
128
134
|
};
|
|
@@ -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
|
+
};
|