@useinsider/guido 3.30.1-beta.f98f0f8 → 3.30.2-beta.08f1c78
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/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +56 -56
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +1 -1
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +54 -48
- package/dist/config/migrator/index.js +17 -17
- 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/guido.css +1 -1
- package/dist/package.json.js +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/package.json +1 -1
|
@@ -1,43 +1,43 @@
|
|
|
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,
|
|
@@ -45,7 +45,7 @@ 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: r }) {
|
|
48
|
-
const d = j, s =
|
|
48
|
+
const d = j, s = Te(), Q = i(
|
|
49
49
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
50
50
|
), X = i(
|
|
51
51
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
@@ -63,13 +63,13 @@ const $t = /* @__PURE__ */ he({
|
|
|
63
63
|
() => import("./organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue.js")
|
|
64
64
|
), re = i(
|
|
65
65
|
() => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
|
|
66
|
-
), y = W(), b =
|
|
66
|
+
), y = W(), b = Ze(), k = rt(), se = q(), o = Ye();
|
|
67
67
|
d.ready && o.init(d.config);
|
|
68
|
-
const m = C(), ie =
|
|
68
|
+
const m = C(), ie = tt(), p = c(() => m.hasChanges), { isTestPartner: ae } = Ue(), { isEnabled: ce, loadRollout: w } = Ie(), { showToaster: F } = Ae(), T = Ne(), L = () => {
|
|
69
69
|
var t;
|
|
70
70
|
if (m.isVersionHistoryOpen) {
|
|
71
71
|
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), F({
|
|
72
|
-
type:
|
|
72
|
+
type: Pe.Warning,
|
|
73
73
|
message: T("email-editor.save-blocked-outside-editor")
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
@@ -78,7 +78,7 @@ const $t = /* @__PURE__ */ he({
|
|
|
78
78
|
}, M = (t) => {
|
|
79
79
|
m.loadingStatus = t;
|
|
80
80
|
};
|
|
81
|
-
|
|
81
|
+
we(), Me();
|
|
82
82
|
const g = () => {
|
|
83
83
|
var t, e;
|
|
84
84
|
return {
|
|
@@ -89,9 +89,9 @@ const $t = /* @__PURE__ */ he({
|
|
|
89
89
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
|
|
90
90
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
|
|
91
91
|
};
|
|
92
|
-
}, { initPlugin: U, preloadRuntime: I } =
|
|
92
|
+
}, { initPlugin: U, preloadRuntime: I } = Re(s), { runExclusive: R, beginMount: O, isCurrentMount: v } = Fe();
|
|
93
93
|
let f = 0;
|
|
94
|
-
const { getDefaultTemplate: A } =
|
|
94
|
+
const { getDefaultTemplate: A } = Xe(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Oe(), de = c(() => {
|
|
95
95
|
var t;
|
|
96
96
|
return !((t = o.ui) != null && t.showHeader);
|
|
97
97
|
}), me = c(() => o.isFeatureEnabled("reusableRecommendationStrategy")), le = c(() => o.externalDisplayConditions), ue = c(
|
|
@@ -99,7 +99,7 @@ const $t = /* @__PURE__ */ he({
|
|
|
99
99
|
), pe = c(() => o.isFeatureEnabled("blockUnsubscribeLinks")), fe = c(
|
|
100
100
|
() => !!z().recommendationConfigs.strategyId
|
|
101
101
|
);
|
|
102
|
-
|
|
102
|
+
Le({
|
|
103
103
|
onBack: () => {
|
|
104
104
|
console.debug("guido:back"), r("back");
|
|
105
105
|
},
|
|
@@ -129,7 +129,7 @@ const $t = /* @__PURE__ */ he({
|
|
|
129
129
|
let l = null;
|
|
130
130
|
const E = () => {
|
|
131
131
|
var e;
|
|
132
|
-
const t = document.querySelector(
|
|
132
|
+
const t = document.querySelector(Be);
|
|
133
133
|
(e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
134
134
|
}, h = async () => {
|
|
135
135
|
var t;
|
|
@@ -149,15 +149,15 @@ const $t = /* @__PURE__ */ he({
|
|
|
149
149
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
150
150
|
}, ge = {
|
|
151
151
|
itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
|
|
152
|
-
}, V = (Ee) => s.timed(
|
|
152
|
+
}, V = (Ee, he) => s.timed(
|
|
153
153
|
"migration",
|
|
154
|
-
() =>
|
|
154
|
+
() => _e(Ee, ye, be, ge, he)
|
|
155
155
|
);
|
|
156
156
|
let n = {
|
|
157
|
-
html: a && await V(a),
|
|
157
|
+
html: a && await V(a, u),
|
|
158
158
|
css: u
|
|
159
159
|
};
|
|
160
|
-
n.html || (n = await s.timed("default_template", () => A()), n.html = await V(n.html));
|
|
160
|
+
n.html || (n = await s.timed("default_template", () => A()), n.html = await V(n.html, n.css));
|
|
161
161
|
const ve = H ? K(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
162
162
|
_(n.html) && (n.html = await s.timed("timer_clone", () => N(n.html))), H && (m.trackIdSessionFloor = Math.max(ve, K(n.html)));
|
|
163
163
|
const Se = {
|
|
@@ -175,9 +175,9 @@ const $t = /* @__PURE__ */ he({
|
|
|
175
175
|
console.error("Failed to initialize Stripo editor:", e), s.markFailed();
|
|
176
176
|
}
|
|
177
177
|
};
|
|
178
|
-
return
|
|
178
|
+
return De(async () => {
|
|
179
179
|
var e;
|
|
180
|
-
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();
|
|
181
181
|
const t = (e = y.value) == null ? void 0 : e.parentElement;
|
|
182
182
|
if (t && (l = new ResizeObserver(E), l.observe(t)), I(), d.ready)
|
|
183
183
|
await h();
|
|
@@ -187,9 +187,9 @@ const $t = /* @__PURE__ */ he({
|
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
document.addEventListener("dynamic-content:open", S);
|
|
190
|
-
}),
|
|
191
|
-
if (
|
|
192
|
-
|
|
190
|
+
}), ke(() => {
|
|
191
|
+
if (He(), xe(), s.dispose(), l == null || l.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
|
|
192
|
+
Ve();
|
|
193
193
|
try {
|
|
194
194
|
const t = C();
|
|
195
195
|
t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
|
|
@@ -213,9 +213,9 @@ const $t = /* @__PURE__ */ he({
|
|
|
213
213
|
hasChanges: p,
|
|
214
214
|
saveSilent: L,
|
|
215
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:
|
|
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 };
|
|
217
217
|
}
|
|
218
218
|
});
|
|
219
219
|
export {
|
|
220
|
-
|
|
220
|
+
Gt as default
|
|
221
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
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { migrateCheckbox as
|
|
2
|
-
import { migrateCouponBlock as
|
|
3
|
-
import { migrateFullStoryScripts as
|
|
4
|
-
import { migrateItemsBlock as
|
|
5
|
-
import { migrateItemsPriceFormat as
|
|
6
|
-
import { migrateLegacyUnsubscribeText as
|
|
7
|
-
import { migrateProductNameLink as
|
|
8
|
-
import { migrateRadioButton as
|
|
9
|
-
import { migrateRecommendation as
|
|
10
|
-
import { migrateRecommendationPartnerScope as
|
|
11
|
-
import { migrateRecommendationTitle as
|
|
12
|
-
import { migrateSfmcUnsubscribeText as
|
|
13
|
-
import { migrateSocialIcons as
|
|
14
|
-
import { migrateUnsubscribe as
|
|
15
|
-
const
|
|
1
|
+
import { migrateCheckbox as a } from "./checkboxMigrator.js";
|
|
2
|
+
import { migrateCouponBlock as c } from "./couponBlockMigrator.js";
|
|
3
|
+
import { migrateFullStoryScripts as g } from "./fullStoryScriptMigrator.js";
|
|
4
|
+
import { migrateItemsBlock as n } from "./itemsBlockMigrator.js";
|
|
5
|
+
import { migrateItemsPriceFormat as p } from "./itemsPriceFormatMigrator.js";
|
|
6
|
+
import { migrateLegacyUnsubscribeText as f } from "./legacyUnsubscribeTextMigrator.js";
|
|
7
|
+
import { migrateProductNameLink as s } from "./productNameLinkMigrator.js";
|
|
8
|
+
import { migrateRadioButton as l } from "./radioButtonMigrator.js";
|
|
9
|
+
import { migrateRecommendation as b } from "./recommendationMigrator.js";
|
|
10
|
+
import { migrateRecommendationPartnerScope as d } from "./recommendationPartnerMigrator.js";
|
|
11
|
+
import { migrateRecommendationTitle as k } from "./recommendationTitleMigrator.js";
|
|
12
|
+
import { migrateSfmcUnsubscribeText as u } from "./sfmcUnsubscribeTextMigrator.js";
|
|
13
|
+
import { migrateSocialIcons as x } from "./socialIconMigrator.js";
|
|
14
|
+
import { migrateUnsubscribe as P } from "./unsubscribeMigrator.js";
|
|
15
|
+
const j = async (t, i = {}, o, r, e = "") => {
|
|
16
16
|
let m = t;
|
|
17
|
-
return m =
|
|
17
|
+
return m = a(m), m = l(m), m = u(m), m = f(m), m = await P(m), m = c(m), m = b(m, i, e), o && (m = d(m, o)), m = k(m), m = n(m), r != null && r.itemsPriceFormatting && (m = p(m)), m = s(m), m = x(m), m = g(m), m;
|
|
18
18
|
};
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
j as migrate
|
|
21
21
|
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const f = /\s*!important\s*$/i, g = /\/\*[\s\S]*?\*\//g, a = /#[\w-]+/g, p = /\.[\w-]+|\[[^\]]*\]|:(?!:)[\w-]+(?:\([^)]*\))?/g, d = /::[\w-]+/g, E = /(?:^|[\s>+~])([a-z][\w-]*)/gi;
|
|
2
|
+
function h(o) {
|
|
3
|
+
return o.split(";").flatMap((r) => {
|
|
4
|
+
const s = r.indexOf(":");
|
|
5
|
+
if (s < 0)
|
|
6
|
+
return [];
|
|
7
|
+
const e = r.slice(0, s).trim().toLowerCase(), t = r.slice(s + 1), n = t.replace(f, "").trim();
|
|
8
|
+
return e && n ? [{ prop: e, value: n, important: f.test(t) }] : [];
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function w(o, r) {
|
|
12
|
+
let s = 0;
|
|
13
|
+
for (let e = r; e < o.length; e += 1)
|
|
14
|
+
if (o[e] === "{")
|
|
15
|
+
s += 1;
|
|
16
|
+
else if (o[e] === "}" && (s -= 1, s === 0))
|
|
17
|
+
return e;
|
|
18
|
+
return o.length;
|
|
19
|
+
}
|
|
20
|
+
function m(o) {
|
|
21
|
+
let r = 0;
|
|
22
|
+
return Array.from(o).reduce((e, t) => (t === "(" || t === "[" ? r += 1 : (t === ")" || t === "]") && r > 0 && (r -= 1), t === "," && r === 0 ? e.push("") : e[e.length - 1] += t, e), [""]).map((e) => e.trim()).filter(Boolean);
|
|
23
|
+
}
|
|
24
|
+
function v(o) {
|
|
25
|
+
const r = o.replace(g, ""), s = [];
|
|
26
|
+
let e = 0;
|
|
27
|
+
for (; e < r.length; ) {
|
|
28
|
+
const t = r.indexOf("{", e);
|
|
29
|
+
if (t < 0)
|
|
30
|
+
break;
|
|
31
|
+
const n = r.slice(e, t), i = n.slice(n.lastIndexOf(";") + 1).trim(), c = w(r, t);
|
|
32
|
+
if (i && !i.startsWith("@")) {
|
|
33
|
+
const l = m(i), u = h(r.slice(t + 1, c));
|
|
34
|
+
l.length > 0 && u.length > 0 && s.push({ selectors: l, declarations: u });
|
|
35
|
+
}
|
|
36
|
+
e = c + 1;
|
|
37
|
+
}
|
|
38
|
+
return s;
|
|
39
|
+
}
|
|
40
|
+
function S(o) {
|
|
41
|
+
var i, c;
|
|
42
|
+
const r = o.replace(d, " "), s = ((i = r.match(a)) == null ? void 0 : i.length) ?? 0, e = r.replace(a, " "), t = ((c = e.match(p)) == null ? void 0 : c.length) ?? 0, n = Array.from(e.replace(p, " ").matchAll(E)).length;
|
|
43
|
+
return s * 1e6 + t * 1e3 + n;
|
|
44
|
+
}
|
|
45
|
+
function O(o, r) {
|
|
46
|
+
return r.reduce((s, e) => {
|
|
47
|
+
let t = !1;
|
|
48
|
+
try {
|
|
49
|
+
t = o.matches(e);
|
|
50
|
+
} catch {
|
|
51
|
+
t = !1;
|
|
52
|
+
}
|
|
53
|
+
if (!t)
|
|
54
|
+
return s;
|
|
55
|
+
const n = S(e);
|
|
56
|
+
return s === void 0 || n > s ? n : s;
|
|
57
|
+
}, void 0);
|
|
58
|
+
}
|
|
59
|
+
function y(o, r) {
|
|
60
|
+
const s = /* @__PURE__ */ new Map();
|
|
61
|
+
if (!o)
|
|
62
|
+
return s;
|
|
63
|
+
const e = [];
|
|
64
|
+
return r.forEach((t, n) => {
|
|
65
|
+
const i = O(o, t.selectors);
|
|
66
|
+
i !== void 0 && t.declarations.forEach((c, l) => {
|
|
67
|
+
e.push({
|
|
68
|
+
...c,
|
|
69
|
+
tier: c.important ? 2 : 0,
|
|
70
|
+
weight: i,
|
|
71
|
+
order: n * 1e3 + l
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}), h(o.getAttribute("style") ?? "").forEach((t, n) => {
|
|
75
|
+
e.push({ ...t, tier: t.important ? 3 : 1, weight: 0, order: n });
|
|
76
|
+
}), e.sort((t, n) => t.tier - n.tier || t.weight - n.weight || t.order - n.order).forEach((t, n) => {
|
|
77
|
+
s.set(t.prop, { value: t.value, position: n });
|
|
78
|
+
}), s;
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
v as parseCssRules,
|
|
82
|
+
h as parseDeclarations,
|
|
83
|
+
y as resolveDeclaredStyle
|
|
84
|
+
};
|