@useinsider/guido 3.30.0-beta.d4ab5c4 → 3.30.0-beta.da531c5
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 +1 -12
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +95 -97
- package/dist/composables/useModuleRepair.js +50 -56
- package/dist/composables/useStripo.js +63 -67
- package/dist/config/migrator/index.js +14 -15
- 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/enums/academy.js +1 -2
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- 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/enums/academy.d.ts +0 -1
- package/dist/src/stores/editor.d.ts +0 -54
- package/dist/src/utils/legacyUnsubscribeConversion.d.ts +0 -3
- package/dist/stores/editor.js +0 -2
- package/dist/utils/legacyUnsubscribeConversion.js +28 -69
- package/package.json +1 -1
- package/dist/components/organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue.js +0 -17
- package/dist/components/organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue2.js +0 -30
- package/dist/config/migrator/sfmcUnsubscribeTextMigrator.js +0 -20
- package/dist/src/components/organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue.d.ts +0 -2
- package/dist/src/config/migrator/sfmcUnsubscribeTextMigrator.d.ts +0 -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.
|
|
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).
|
|
180
180
|
},
|
|
181
181
|
|
|
182
182
|
// Optional: Callbacks
|
|
@@ -721,17 +721,6 @@ 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
|
-
|
|
735
724
|
---
|
|
736
725
|
|
|
737
726
|
## 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.
|
|
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) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
|
-
},
|
|
9
|
+
}, t = [], s = /* @__PURE__ */ i(
|
|
10
10
|
o,
|
|
11
11
|
n,
|
|
12
|
-
|
|
12
|
+
t,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"4eea8564"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const c = s.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
c as default
|
|
20
20
|
};
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { defineComponent as he, defineAsyncComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
1
|
+
import { defineComponent as he, defineAsyncComponent as a, ref as W, computed as u, watch as $, onMounted as Ee, onUnmounted as Ce } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as De } from "../composables/useCortexBlueprintBridge.js";
|
|
3
3
|
import { useEditorLock as we } from "../composables/useEditorLock.js";
|
|
4
|
-
import { startEditorOpenMetrics as
|
|
5
|
-
import { provideGuidoActions as
|
|
6
|
-
import { useGuidoStateBridge as
|
|
7
|
-
import { usePartner as
|
|
8
|
-
import { useSaveValidationRollout as
|
|
9
|
-
import { useStripo as
|
|
4
|
+
import { startEditorOpenMetrics as Te } from "../composables/useEditorOpenMetrics.js";
|
|
5
|
+
import { provideGuidoActions as ke } from "../composables/useGuidoActions.js";
|
|
6
|
+
import { useGuidoStateBridge as Fe } from "../composables/useGuidoStateBridge.js";
|
|
7
|
+
import { usePartner as Me } from "../composables/usePartner.js";
|
|
8
|
+
import { useSaveValidationRollout as Ie } from "../composables/useSaveValidationRollout.js";
|
|
9
|
+
import { useStripo as Le } from "../composables/useStripo.js";
|
|
10
10
|
import { useTimerClone as Re } from "../composables/useTimerClone.js";
|
|
11
11
|
import { useToaster as Oe } from "../composables/useToaster.js";
|
|
12
|
-
import { useTranslations as
|
|
13
|
-
import { migrate as
|
|
12
|
+
import { useTranslations as Ue } from "../composables/useTranslations.js";
|
|
13
|
+
import { migrate as Ae } from "../config/migrator/index.js";
|
|
14
14
|
import { ModuleFolderDefaults as G } from "../enums/defaults.js";
|
|
15
|
-
import { RIBBON_SELECTOR as
|
|
16
|
-
import { ToasterTypeOptions as
|
|
15
|
+
import { RIBBON_SELECTOR as Ne } from "../enums/onboarding.js";
|
|
16
|
+
import { ToasterTypeOptions as _e } from "../enums/toaster.js";
|
|
17
17
|
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Pe } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
18
18
|
import { disposeUnsubscribeListeners as xe } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
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
|
|
19
|
+
import { disposeDisplayConditionRequest as Be } from "../extensions/DisplayConditions/bridge.js";
|
|
20
|
+
import He from "./organisms/AutoSaveController.vue.js";
|
|
21
|
+
import Ve from "./organisms/base/AuthErrorModal.vue.js";
|
|
22
|
+
import We from "./organisms/base/Toaster.vue.js";
|
|
23
|
+
import $e from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
24
|
+
import Ge from "./organisms/header/HeaderWrapper.vue.js";
|
|
25
|
+
import ze from "./organisms/LoadingWrapper.vue.js";
|
|
26
|
+
import qe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
27
|
+
import Ke from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
28
|
+
import je from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
29
|
+
import { useStripoApi as Je } from "../services/stripoApi.js";
|
|
30
|
+
import { useConfigStore as Qe } from "../stores/config.js";
|
|
31
|
+
import { useDynamicContentStore as Xe } 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 Ye } from "../stores/onboarding.js";
|
|
35
|
+
import { usePreviewStore as Ze } from "../stores/preview.js";
|
|
36
|
+
import { useSaveValidationStore as et } from "../stores/save-validation.js";
|
|
37
|
+
import { useTemplateStore as tt } from "../stores/template.js";
|
|
38
|
+
import { useUnsubscribeStore as ot } from "../stores/unsubscribe.js";
|
|
39
39
|
import { readTrackFloor as K } from "../utils/linkTrackingIds.js";
|
|
40
|
-
const
|
|
40
|
+
const Wt = /* @__PURE__ */ he({
|
|
41
41
|
__name: "Guido",
|
|
42
42
|
props: {
|
|
43
43
|
config: null,
|
|
@@ -45,41 +45,39 @@ const $t = /* @__PURE__ */ he({
|
|
|
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
|
|
48
|
+
const c = j, r = Te(), Q = a(
|
|
49
49
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
50
|
-
), X =
|
|
50
|
+
), X = a(
|
|
51
51
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
52
|
-
), Y =
|
|
52
|
+
), Y = a(
|
|
53
53
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
54
|
-
), Z =
|
|
54
|
+
), Z = a(
|
|
55
55
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
56
|
-
), ee =
|
|
56
|
+
), ee = a(
|
|
57
57
|
() => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
|
|
58
|
-
), D = W(), te =
|
|
58
|
+
), D = W(), te = a(
|
|
59
59
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
60
|
-
), oe =
|
|
60
|
+
), oe = a(
|
|
61
61
|
() => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
|
|
62
|
-
), ne =
|
|
63
|
-
() => import("./organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue.js")
|
|
64
|
-
), re = s(
|
|
62
|
+
), ne = a(
|
|
65
63
|
() => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
|
|
66
|
-
), y = W(),
|
|
67
|
-
|
|
68
|
-
const
|
|
64
|
+
), y = W(), g = Xe(), w = ot(), re = q(), o = Qe();
|
|
65
|
+
c.ready && o.init(c.config);
|
|
66
|
+
const d = C(), ie = Ze(), p = u(() => d.hasChanges), { isTestPartner: se } = Me(), { isEnabled: ae, loadRollout: T } = Ie(), { showToaster: k } = Oe(), F = Ue(), M = () => {
|
|
69
67
|
var t;
|
|
70
|
-
if (
|
|
71
|
-
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }),
|
|
72
|
-
type:
|
|
73
|
-
message:
|
|
68
|
+
if (d.isVersionHistoryOpen) {
|
|
69
|
+
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), k({
|
|
70
|
+
type: _e.Warning,
|
|
71
|
+
message: F("email-editor.save-blocked-outside-editor")
|
|
74
72
|
});
|
|
75
73
|
return;
|
|
76
74
|
}
|
|
77
75
|
return (t = D.value) == null ? void 0 : t.saveSilent();
|
|
78
|
-
},
|
|
79
|
-
|
|
76
|
+
}, I = (t) => {
|
|
77
|
+
d.loadingStatus = t;
|
|
80
78
|
};
|
|
81
|
-
|
|
82
|
-
const
|
|
79
|
+
De(), Fe();
|
|
80
|
+
const b = () => {
|
|
83
81
|
var t, e;
|
|
84
82
|
return {
|
|
85
83
|
emailId: o.templateId,
|
|
@@ -89,17 +87,17 @@ const $t = /* @__PURE__ */ he({
|
|
|
89
87
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
|
|
90
88
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
|
|
91
89
|
};
|
|
92
|
-
}, { initPlugin:
|
|
90
|
+
}, { initPlugin: L, preloadRuntime: R } = Le(r), { runExclusive: O, beginMount: U, isCurrentMount: v } = we();
|
|
93
91
|
let f = 0;
|
|
94
|
-
const { getDefaultTemplate: A } =
|
|
92
|
+
const { getDefaultTemplate: A } = Je(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Re(), ce = u(() => {
|
|
95
93
|
var t;
|
|
96
94
|
return !((t = o.ui) != null && t.showHeader);
|
|
97
|
-
}),
|
|
95
|
+
}), de = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), me = u(() => o.externalDisplayConditions), le = u(
|
|
98
96
|
() => o.isFeatureEnabled("legacyUnsubscribeConversion")
|
|
99
|
-
),
|
|
97
|
+
), ue = u(
|
|
100
98
|
() => !!z().recommendationConfigs.strategyId
|
|
101
99
|
);
|
|
102
|
-
|
|
100
|
+
ke({
|
|
103
101
|
onBack: () => {
|
|
104
102
|
console.debug("guido:back"), i("back");
|
|
105
103
|
},
|
|
@@ -107,85 +105,85 @@ const $t = /* @__PURE__ */ he({
|
|
|
107
105
|
console.debug("guido:save:start"), i("save:start");
|
|
108
106
|
},
|
|
109
107
|
onSaveComplete: (t) => {
|
|
110
|
-
const e = { ...t, metadata:
|
|
108
|
+
const e = { ...t, metadata: b() };
|
|
111
109
|
console.debug("guido:save:complete", e), i("save:complete", e);
|
|
112
110
|
},
|
|
113
111
|
onTestEmailClick: () => {
|
|
114
112
|
console.debug("guido:test-email:click"), i("test-email:click");
|
|
115
113
|
}
|
|
116
114
|
});
|
|
117
|
-
const
|
|
118
|
-
console.debug("dynamic-content:close", t),
|
|
119
|
-
},
|
|
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 = () => {
|
|
120
118
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
121
119
|
};
|
|
122
120
|
$(() => p.value, () => {
|
|
123
121
|
i("on-change", p.value);
|
|
124
122
|
});
|
|
125
123
|
const S = (t) => {
|
|
126
|
-
const e = t, { attribute:
|
|
127
|
-
console.debug("dynamic-content:open", e.detail), i("dynamic-content:open",
|
|
124
|
+
const e = t, { attribute: s, position: l } = e.detail;
|
|
125
|
+
console.debug("dynamic-content:open", e.detail), i("dynamic-content:open", s, l);
|
|
128
126
|
};
|
|
129
|
-
let
|
|
130
|
-
const
|
|
127
|
+
let m = null;
|
|
128
|
+
const h = () => {
|
|
131
129
|
var e;
|
|
132
|
-
const t = document.querySelector(
|
|
130
|
+
const t = document.querySelector(Ne);
|
|
133
131
|
(e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
134
|
-
},
|
|
132
|
+
}, E = async () => {
|
|
135
133
|
var t;
|
|
136
134
|
r.mark("host_ready");
|
|
137
135
|
try {
|
|
138
|
-
o.initialized || o.init(
|
|
136
|
+
o.initialized || o.init(c.config), d.templateId = o.templateId, r.setContext({
|
|
139
137
|
partnerName: o.partnerName,
|
|
140
138
|
productType: o.productType,
|
|
141
139
|
templateId: o.templateId,
|
|
142
140
|
variationId: o.variationId
|
|
143
141
|
});
|
|
144
|
-
const e = o.template,
|
|
145
|
-
|
|
146
|
-
const
|
|
142
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", l = (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 = {
|
|
147
145
|
partnerName: o.partnerName,
|
|
148
146
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
149
147
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
150
|
-
},
|
|
148
|
+
}, ye = {
|
|
151
149
|
itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
|
|
152
|
-
}, V = (
|
|
150
|
+
}, V = (ve, Se) => r.timed(
|
|
153
151
|
"migration",
|
|
154
|
-
() =>
|
|
152
|
+
() => Ae(ve, pe, fe, ye, Se)
|
|
155
153
|
);
|
|
156
154
|
let n = {
|
|
157
|
-
html:
|
|
158
|
-
css:
|
|
155
|
+
html: s && await V(s, l),
|
|
156
|
+
css: l
|
|
159
157
|
};
|
|
160
|
-
n.html || (n = await r.timed("default_template", () => A()), n.html = await V(n.html));
|
|
161
|
-
const
|
|
162
|
-
_(n.html) && (n.html = await r.timed("timer_clone", () => N(n.html))), H && (
|
|
163
|
-
const
|
|
164
|
-
preselectedDynamicContentList:
|
|
158
|
+
n.html || (n = await r.timed("default_template", () => A()), n.html = await V(n.html, n.css));
|
|
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,
|
|
165
163
|
onReady: () => {
|
|
166
164
|
console.debug("guido:ready"), i("ready");
|
|
167
165
|
}
|
|
168
166
|
};
|
|
169
|
-
f =
|
|
167
|
+
f = U(), await L(n, b(), be, n.html !== s), g.selectedDynamicContentList = B;
|
|
170
168
|
} catch (e) {
|
|
171
169
|
console.error("Failed to initialize Stripo editor:", e), r.markFailed();
|
|
172
170
|
}
|
|
173
171
|
};
|
|
174
|
-
return
|
|
172
|
+
return Ee(async () => {
|
|
175
173
|
var e;
|
|
176
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(),
|
|
174
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), tt().$reset(), et().$reset(), q().$reset(), Ye().resetOnboarding("recommendationLegacyStrategyOnboarding"), T(), h();
|
|
177
175
|
const t = (e = y.value) == null ? void 0 : e.parentElement;
|
|
178
|
-
if (t && (
|
|
179
|
-
await
|
|
176
|
+
if (t && (m = new ResizeObserver(h), m.observe(t)), R(), c.ready)
|
|
177
|
+
await E();
|
|
180
178
|
else {
|
|
181
|
-
const
|
|
182
|
-
|
|
179
|
+
const s = $(() => c.ready, (l) => {
|
|
180
|
+
l && (s(), E());
|
|
183
181
|
});
|
|
184
182
|
}
|
|
185
183
|
document.addEventListener("dynamic-content:open", S);
|
|
186
|
-
}),
|
|
187
|
-
if (xe(), Pe(), r.dispose(),
|
|
188
|
-
|
|
184
|
+
}), Ce(() => {
|
|
185
|
+
if (xe(), Pe(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
|
|
186
|
+
Be();
|
|
189
187
|
try {
|
|
190
188
|
const t = C();
|
|
191
189
|
t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
|
|
@@ -193,7 +191,7 @@ const $t = /* @__PURE__ */ he({
|
|
|
193
191
|
console.debug("Failed to close the editor readiness gate on unmount", t);
|
|
194
192
|
}
|
|
195
193
|
}
|
|
196
|
-
|
|
194
|
+
O(async () => {
|
|
197
195
|
if (v(f))
|
|
198
196
|
try {
|
|
199
197
|
window.UIEditor.removeEditor();
|
|
@@ -203,15 +201,15 @@ const $t = /* @__PURE__ */ he({
|
|
|
203
201
|
}), o.reset();
|
|
204
202
|
}), J({
|
|
205
203
|
dynamicContent: {
|
|
206
|
-
insert:
|
|
207
|
-
close:
|
|
204
|
+
insert: P,
|
|
205
|
+
close: x
|
|
208
206
|
},
|
|
209
207
|
hasChanges: p,
|
|
210
208
|
saveSilent: M,
|
|
211
|
-
setLoading:
|
|
212
|
-
}), { __sfc: !0, openMetrics: r, PreviewContainer: Q, OnboardingWrapper: X, AssignStrategyDrawer: Y, RemoveStrategyModal: Z, DisplayConditionsHost: ee, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: te, LegacyUnsubscribeConvertedModal: oe,
|
|
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: He, AuthErrorModal: Ve, Toaster: We, FilterSelectionDrawer: $e, HeaderWrapper: Ge, LoadingWrapper: ze, SaveAsTemplateDrawer: qe, UnsubscribeWrapper: Ke, ValidationErrorDrawer: je };
|
|
213
211
|
}
|
|
214
212
|
});
|
|
215
213
|
export {
|
|
216
|
-
|
|
214
|
+
Wt as default
|
|
217
215
|
};
|
|
@@ -1,81 +1,75 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { useTranslations as
|
|
4
|
-
import { ModuleDynamicContentAttribute as
|
|
5
|
-
import { ToasterTypeOptions as
|
|
6
|
-
import { itemsBlockDynamicVariables as
|
|
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";
|
|
7
7
|
import { useDynamicContentStore as E } from "../stores/dynamic-content.js";
|
|
8
|
-
import { useEditorStore as
|
|
9
|
-
import { useModuleDynamicContentStore as
|
|
10
|
-
import { buildDynamicContentLookup as
|
|
11
|
-
import { stripPendingMarker as
|
|
12
|
-
import { flattenDynamicContentCandidates as
|
|
13
|
-
import { repairItemsCurrencyAttributes as
|
|
14
|
-
import {
|
|
15
|
-
import { extractUsedDynamicContent as
|
|
16
|
-
const
|
|
17
|
-
let
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
return { html: s.replace(
|
|
22
|
-
},
|
|
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) => {
|
|
23
23
|
try {
|
|
24
|
-
const i =
|
|
24
|
+
const i = k(s, o.map(({ text: a, value: m }) => ({ text: a, value: m })));
|
|
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
|
-
},
|
|
30
|
-
const { template: s, isFeatureEnabled:
|
|
29
|
+
}, re = () => {
|
|
30
|
+
const { template: s, isFeatureEnabled: o } = h(), { showToaster: i } = v(), a = M(), m = (r) => {
|
|
31
31
|
var u, e;
|
|
32
|
-
const
|
|
33
|
-
return c.size === 0 ? { html:
|
|
34
|
-
...
|
|
35
|
-
|
|
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,
|
|
36
36
|
c,
|
|
37
|
-
[...((e = s.value) == null ? void 0 : e.customFieldAttributes) ?? [], ...
|
|
37
|
+
[...((e = s.value) == null ? void 0 : e.customFieldAttributes) ?? [], ...O]
|
|
38
38
|
),
|
|
39
|
-
candidates:
|
|
39
|
+
candidates: t
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
|
-
return { handleModuleAdd: (
|
|
42
|
+
return { handleModuleAdd: (r, t) => {
|
|
43
43
|
var c, u;
|
|
44
44
|
try {
|
|
45
|
-
if ((
|
|
45
|
+
if ((r == null ? void 0 : r.action) !== "ADD" && (r == null ? void 0 : r.action) !== "COPY")
|
|
46
46
|
return;
|
|
47
|
-
const e = (c =
|
|
48
|
-
if (!e || typeof
|
|
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")
|
|
49
49
|
return;
|
|
50
|
-
let
|
|
51
|
-
convertToPriceFormat:
|
|
52
|
-
})),
|
|
53
|
-
|
|
54
|
-
const { html:
|
|
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);
|
|
55
55
|
let d = null;
|
|
56
|
-
if (
|
|
56
|
+
if (n = f, g.length > 0 && ({ html: n, id: d } = $(n)), n !== l && t.modifyHtml(e).replaceWith(n), I(n, C), p)
|
|
57
57
|
try {
|
|
58
|
-
|
|
59
|
-
} catch (
|
|
60
|
-
console.error("Failed to request the legacy unsubscribe modal:",
|
|
58
|
+
L().isLegacyUnsubscribeModalRequested = !0;
|
|
59
|
+
} catch (D) {
|
|
60
|
+
console.error("Failed to request the legacy unsubscribe modal:", D);
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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)
|
|
62
|
+
d && U().enqueue({ id: d, items: g }), b.length > 0 && i({
|
|
63
|
+
type: A.Warning,
|
|
64
|
+
message: a(q)
|
|
71
65
|
});
|
|
72
66
|
} catch (e) {
|
|
73
67
|
console.error("Failed to repair module on add:", e);
|
|
74
68
|
}
|
|
75
|
-
}, convertDynamicContent:
|
|
69
|
+
}, convertDynamicContent: m };
|
|
76
70
|
};
|
|
77
71
|
export {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
q as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
|
|
73
|
+
I as registerUsedAttributes,
|
|
74
|
+
re as useModuleRepair
|
|
81
75
|
};
|