@useinsider/guido 3.30.0-beta.578752b → 3.30.0-beta.6333231
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 +3 -3
- package/dist/components/Guido.vue2.js +64 -64
- package/dist/config/migrator/index.js +16 -16
- package/dist/config/migrator/itemsBlockMigrator.js +163 -160
- 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 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
|
+
import { useEditorLock as we } from "../composables/useEditorLock.js";
|
|
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
|
+
import { useTimerClone as Re } from "../composables/useTimerClone.js";
|
|
11
|
+
import { useToaster as Oe } from "../composables/useToaster.js";
|
|
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
|
|
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 Ne } from "../enums/onboarding.js";
|
|
16
|
+
import { ToasterTypeOptions as _e } from "../enums/toaster.js";
|
|
17
|
+
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Pe } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
18
|
+
import { disposeUnsubscribeListeners as xe } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
19
|
+
import { disposeDisplayConditionRequest as 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,7 +45,7 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
45
45
|
},
|
|
46
46
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
47
47
|
setup(j, { expose: J, emit: i }) {
|
|
48
|
-
const c = j, r =
|
|
48
|
+
const c = j, r = Te(), Q = a(
|
|
49
49
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
50
50
|
), X = a(
|
|
51
51
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
@@ -61,13 +61,13 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
61
61
|
() => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
|
|
62
62
|
), ne = a(
|
|
63
63
|
() => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
|
|
64
|
-
), y = W(), g =
|
|
64
|
+
), y = W(), g = Xe(), w = ot(), re = q(), o = Qe();
|
|
65
65
|
c.ready && o.init(c.config);
|
|
66
|
-
const d = C(), ie =
|
|
66
|
+
const d = C(), ie = Ze(), p = u(() => d.hasChanges), { isTestPartner: se } = Me(), { isEnabled: ae, loadRollout: T } = Ie(), { showToaster: k } = Oe(), F = Ue(), M = () => {
|
|
67
67
|
var t;
|
|
68
68
|
if (d.isVersionHistoryOpen) {
|
|
69
69
|
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), k({
|
|
70
|
-
type:
|
|
70
|
+
type: _e.Warning,
|
|
71
71
|
message: F("email-editor.save-blocked-outside-editor")
|
|
72
72
|
});
|
|
73
73
|
return;
|
|
@@ -76,7 +76,7 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
76
76
|
}, I = (t) => {
|
|
77
77
|
d.loadingStatus = t;
|
|
78
78
|
};
|
|
79
|
-
|
|
79
|
+
De(), Fe();
|
|
80
80
|
const b = () => {
|
|
81
81
|
var t, e;
|
|
82
82
|
return {
|
|
@@ -87,17 +87,17 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
87
87
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
|
|
88
88
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
|
|
89
89
|
};
|
|
90
|
-
}, { initPlugin: L, preloadRuntime: R } =
|
|
90
|
+
}, { initPlugin: L, preloadRuntime: R } = Le(r), { runExclusive: O, beginMount: U, isCurrentMount: v } = we();
|
|
91
91
|
let f = 0;
|
|
92
|
-
const { getDefaultTemplate: A } =
|
|
92
|
+
const { getDefaultTemplate: A } = Je(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Re(), ce = u(() => {
|
|
93
93
|
var t;
|
|
94
94
|
return !((t = o.ui) != null && t.showHeader);
|
|
95
|
-
}), de =
|
|
95
|
+
}), de = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), me = u(() => o.externalDisplayConditions), le = u(
|
|
96
96
|
() => o.isFeatureEnabled("legacyUnsubscribeConversion")
|
|
97
|
-
), ue =
|
|
97
|
+
), ue = u(
|
|
98
98
|
() => !!z().recommendationConfigs.strategyId
|
|
99
99
|
);
|
|
100
|
-
|
|
100
|
+
ke({
|
|
101
101
|
onBack: () => {
|
|
102
102
|
console.debug("guido:back"), i("back");
|
|
103
103
|
},
|
|
@@ -121,13 +121,13 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
121
121
|
i("on-change", p.value);
|
|
122
122
|
});
|
|
123
123
|
const S = (t) => {
|
|
124
|
-
const e = t, { attribute: s, position:
|
|
125
|
-
console.debug("dynamic-content:open", e.detail), i("dynamic-content:open", s,
|
|
124
|
+
const e = t, { attribute: s, position: l } = e.detail;
|
|
125
|
+
console.debug("dynamic-content:open", e.detail), i("dynamic-content:open", s, l);
|
|
126
126
|
};
|
|
127
127
|
let m = null;
|
|
128
128
|
const h = () => {
|
|
129
129
|
var e;
|
|
130
|
-
const t = document.querySelector(
|
|
130
|
+
const t = document.querySelector(Ne);
|
|
131
131
|
(e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
132
132
|
}, E = async () => {
|
|
133
133
|
var t;
|
|
@@ -139,7 +139,7 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
139
139
|
templateId: o.templateId,
|
|
140
140
|
variationId: o.variationId
|
|
141
141
|
});
|
|
142
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "",
|
|
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
143
|
w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
144
144
|
const pe = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), fe = {
|
|
145
145
|
partnerName: o.partnerName,
|
|
@@ -147,15 +147,15 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
147
147
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
148
148
|
}, ye = {
|
|
149
149
|
itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
|
|
150
|
-
}, V = (ve) => r.timed(
|
|
150
|
+
}, V = (ve, Se) => r.timed(
|
|
151
151
|
"migration",
|
|
152
|
-
() =>
|
|
152
|
+
() => Ae(ve, pe, fe, ye, Se)
|
|
153
153
|
);
|
|
154
154
|
let n = {
|
|
155
|
-
html: s && await V(s),
|
|
156
|
-
css:
|
|
155
|
+
html: s && await V(s, l),
|
|
156
|
+
css: l
|
|
157
157
|
};
|
|
158
|
-
n.html || (n = await r.timed("default_template", () => A()), n.html = await V(n.html));
|
|
158
|
+
n.html || (n = await r.timed("default_template", () => A()), n.html = await V(n.html, n.css));
|
|
159
159
|
const ge = H ? K(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
160
160
|
_(n.html) && (n.html = await r.timed("timer_clone", () => N(n.html))), H && (d.trackIdSessionFloor = Math.max(ge, K(n.html)));
|
|
161
161
|
const be = {
|
|
@@ -169,21 +169,21 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
169
169
|
console.error("Failed to initialize Stripo editor:", e), r.markFailed();
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
|
-
return
|
|
172
|
+
return Ee(async () => {
|
|
173
173
|
var e;
|
|
174
|
-
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();
|
|
175
175
|
const t = (e = y.value) == null ? void 0 : e.parentElement;
|
|
176
176
|
if (t && (m = new ResizeObserver(h), m.observe(t)), R(), c.ready)
|
|
177
177
|
await E();
|
|
178
178
|
else {
|
|
179
|
-
const s = $(() => c.ready, (
|
|
180
|
-
|
|
179
|
+
const s = $(() => c.ready, (l) => {
|
|
180
|
+
l && (s(), E());
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
183
|
document.addEventListener("dynamic-content:open", S);
|
|
184
|
-
}),
|
|
185
|
-
if (
|
|
186
|
-
|
|
184
|
+
}), Ce(() => {
|
|
185
|
+
if (xe(), Pe(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
|
|
186
|
+
Be();
|
|
187
187
|
try {
|
|
188
188
|
const t = C();
|
|
189
189
|
t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
|
|
@@ -207,9 +207,9 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
207
207
|
hasChanges: p,
|
|
208
208
|
saveSilent: M,
|
|
209
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:
|
|
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 };
|
|
211
211
|
}
|
|
212
212
|
});
|
|
213
213
|
export {
|
|
214
|
-
|
|
214
|
+
Wt as default
|
|
215
215
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
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 { migrateSocialIcons as
|
|
13
|
-
import { migrateUnsubscribe as
|
|
14
|
-
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 l } from "./productNameLinkMigrator.js";
|
|
8
|
+
import { migrateRadioButton as s } from "./radioButtonMigrator.js";
|
|
9
|
+
import { migrateRecommendation as d } from "./recommendationMigrator.js";
|
|
10
|
+
import { migrateRecommendationPartnerScope as b } from "./recommendationPartnerMigrator.js";
|
|
11
|
+
import { migrateRecommendationTitle as k } from "./recommendationTitleMigrator.js";
|
|
12
|
+
import { migrateSocialIcons as P } from "./socialIconMigrator.js";
|
|
13
|
+
import { migrateUnsubscribe as R } from "./unsubscribeMigrator.js";
|
|
14
|
+
const H = async (t, i = {}, o, r, e = "") => {
|
|
15
15
|
let m = t;
|
|
16
|
-
return m =
|
|
16
|
+
return m = a(m), m = s(m), m = f(m), m = await R(m), m = c(m), m = d(m, i, e), o && (m = b(m, o)), m = k(m), m = n(m), r != null && r.itemsPriceFormatting && (m = p(m)), m = l(m), m = P(m), m = g(m), m;
|
|
17
17
|
};
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
H as migrate
|
|
20
20
|
};
|