@useinsider/guido 3.17.0-beta.6255bfc → 3.17.0-beta.bdc7d25
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 +2 -2
- package/dist/components/Guido.vue2.js +57 -56
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -10
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +30 -27
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +13 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +61 -61
- package/dist/guido.css +1 -1
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +17 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/utils/strategyInfoBox.d.ts +17 -4
- package/dist/utils/strategyInfoBox.js +53 -22
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ import i from "./Guido.vue2.js";
|
|
|
3
3
|
import a from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
5
|
var o = this, r = o._self._c, e = o._self._setupProxy;
|
|
6
|
-
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._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.FilterSelectionDrawer), r(e.AssignStrategyDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
|
|
6
|
+
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._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.FilterSelectionDrawer), e.isRrsEnabled ? r(e.AssignStrategyDrawer) : o._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
9
|
}, n = [], s = /* @__PURE__ */ a(
|
|
@@ -12,7 +12,7 @@ var t = function() {
|
|
|
12
12
|
n,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"b13f0cfc"
|
|
16
16
|
);
|
|
17
17
|
const l = s.exports;
|
|
18
18
|
export {
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { provideGuidoActions as
|
|
4
|
-
import { useGuidoStateBridge as
|
|
5
|
-
import { usePartner as
|
|
6
|
-
import { useStripo as
|
|
7
|
-
import { useTimerClone as
|
|
1
|
+
import { defineComponent as Q, defineAsyncComponent as g, ref as U, computed as S, watch as _, onMounted as X, onUnmounted as Y } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as Z } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as ee } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as te } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as oe } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as ne } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as re } from "../composables/useTimerClone.js";
|
|
8
8
|
import { migrate as A } from "../config/migrator/index.js";
|
|
9
9
|
import { ModuleFolderDefaults as N } from "../enums/defaults.js";
|
|
10
|
-
import { RIBBON_SELECTOR as
|
|
11
|
-
import { useRecommendationExtensionStore as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { useDynamicContentStore as ye } from "../stores/dynamic-content.js";
|
|
10
|
+
import { RIBBON_SELECTOR as se } from "../enums/onboarding.js";
|
|
11
|
+
import { useRecommendationExtensionStore as ae } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
|
+
import ie from "./organisms/AutoSaveController.vue.js";
|
|
13
|
+
import ce from "./organisms/base/Toaster.vue.js";
|
|
14
|
+
import de from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
+
import me from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import le from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import ue from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import pe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as fe } from "../services/stripoApi.js";
|
|
20
|
+
import { useConfigStore as ye } from "../stores/config.js";
|
|
21
|
+
import { useDynamicContentStore as ve } from "../stores/dynamic-content.js";
|
|
23
22
|
import { useEditorStore as O } from "../stores/editor.js";
|
|
24
|
-
import { usePreviewStore as
|
|
25
|
-
import { useTemplateStore as
|
|
26
|
-
import { useUnsubscribeStore as
|
|
23
|
+
import { usePreviewStore as ge } from "../stores/preview.js";
|
|
24
|
+
import { useTemplateStore as Se } from "../stores/template.js";
|
|
25
|
+
import { useUnsubscribeStore as be } from "../stores/unsubscribe.js";
|
|
27
26
|
import { readTrackFloor as P } from "../utils/linkTrackingIds.js";
|
|
28
|
-
const Ke = /* @__PURE__ */
|
|
27
|
+
const Ke = /* @__PURE__ */ Q({
|
|
29
28
|
__name: "Guido",
|
|
30
29
|
props: {
|
|
31
30
|
config: null,
|
|
@@ -33,19 +32,21 @@ const Ke = /* @__PURE__ */ j({
|
|
|
33
32
|
},
|
|
34
33
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
35
34
|
setup(W, { expose: x, emit: r }) {
|
|
36
|
-
const a = W, G =
|
|
35
|
+
const a = W, G = g(
|
|
37
36
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
38
|
-
), H =
|
|
37
|
+
), H = g(
|
|
39
38
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
40
|
-
),
|
|
39
|
+
), $ = g(
|
|
40
|
+
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
41
|
+
), b = U(), l = U(), u = ve(), h = be(), o = ye();
|
|
41
42
|
a.ready && o.init(a.config);
|
|
42
|
-
const c = O(),
|
|
43
|
+
const c = O(), z = ge(), m = S(() => c.hasChanges), { isTestPartner: q } = oe(), E = () => {
|
|
43
44
|
var t;
|
|
44
|
-
return (t =
|
|
45
|
-
},
|
|
45
|
+
return (t = b.value) == null ? void 0 : t.handleSave(!0);
|
|
46
|
+
}, w = (t) => {
|
|
46
47
|
c.loadingStatus = t;
|
|
47
48
|
};
|
|
48
|
-
|
|
49
|
+
Z(), te();
|
|
49
50
|
const p = () => {
|
|
50
51
|
var t, e;
|
|
51
52
|
return {
|
|
@@ -56,11 +57,11 @@ const Ke = /* @__PURE__ */ j({
|
|
|
56
57
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
|
|
57
58
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
|
|
58
59
|
};
|
|
59
|
-
}, { initPlugin:
|
|
60
|
+
}, { initPlugin: D, preloadRuntime: C } = ne(), { getDefaultTemplate: k } = fe(), { cloneTimersOnSave: T, hasTimerBlocks: F } = re(), K = S(() => {
|
|
60
61
|
var t;
|
|
61
62
|
return !((t = o.ui) != null && t.showHeader);
|
|
62
|
-
});
|
|
63
|
-
|
|
63
|
+
}), V = S(() => o.isFeatureEnabled("reusableRecommendationStrategy"));
|
|
64
|
+
ee({
|
|
64
65
|
onBack: () => {
|
|
65
66
|
console.debug("guido:back"), r("back");
|
|
66
67
|
},
|
|
@@ -75,9 +76,9 @@ const Ke = /* @__PURE__ */ j({
|
|
|
75
76
|
console.debug("guido:test-email:click"), r("test-email:click");
|
|
76
77
|
}
|
|
77
78
|
});
|
|
78
|
-
const
|
|
79
|
+
const I = (t) => {
|
|
79
80
|
console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
80
|
-
},
|
|
81
|
+
}, R = () => {
|
|
81
82
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
82
83
|
};
|
|
83
84
|
_(() => m.value, () => {
|
|
@@ -90,38 +91,38 @@ const Ke = /* @__PURE__ */ j({
|
|
|
90
91
|
let i = null;
|
|
91
92
|
const y = () => {
|
|
92
93
|
var e;
|
|
93
|
-
const t = document.querySelector(
|
|
94
|
+
const t = document.querySelector(se);
|
|
94
95
|
(e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
95
96
|
}, v = async () => {
|
|
96
97
|
var t;
|
|
97
98
|
try {
|
|
98
99
|
o.initialized || o.init(a.config), c.templateId = o.templateId;
|
|
99
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "",
|
|
100
|
-
|
|
101
|
-
const
|
|
100
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", L = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
101
|
+
h.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
102
|
+
const M = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, B = o.isFeatureEnabled("linkTrackingIds");
|
|
102
103
|
let n = {
|
|
103
|
-
html: s && await A(s,
|
|
104
|
+
html: s && await A(s, M),
|
|
104
105
|
css: d
|
|
105
106
|
};
|
|
106
|
-
n.html || (n = await
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
preselectedDynamicContentList:
|
|
107
|
+
n.html || (n = await k(), n.html = await A(n.html, M));
|
|
108
|
+
const j = B ? P(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
109
|
+
F(n.html) && (n.html = await T(n.html)), B && (c.trackIdSessionFloor = Math.max(j, P(n.html)));
|
|
110
|
+
const J = {
|
|
111
|
+
preselectedDynamicContentList: L,
|
|
111
112
|
onReady: () => {
|
|
112
113
|
console.debug("guido:ready"), r("ready");
|
|
113
114
|
}
|
|
114
115
|
};
|
|
115
|
-
await
|
|
116
|
+
await D(n, p(), J), u.selectedDynamicContentList = L;
|
|
116
117
|
} catch (e) {
|
|
117
118
|
console.error("Failed to initialize Stripo editor:", e);
|
|
118
119
|
}
|
|
119
120
|
};
|
|
120
|
-
return
|
|
121
|
+
return X(async () => {
|
|
121
122
|
var e;
|
|
122
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
123
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ae().$reset(), O().$reset(), Se().$reset(), y();
|
|
123
124
|
const t = (e = l.value) == null ? void 0 : e.parentElement;
|
|
124
|
-
if (t && (i = new ResizeObserver(y), i.observe(t)),
|
|
125
|
+
if (t && (i = new ResizeObserver(y), i.observe(t)), C(), a.ready)
|
|
125
126
|
await v();
|
|
126
127
|
else {
|
|
127
128
|
const s = _(() => a.ready, (d) => {
|
|
@@ -129,7 +130,7 @@ const Ke = /* @__PURE__ */ j({
|
|
|
129
130
|
});
|
|
130
131
|
}
|
|
131
132
|
document.addEventListener("dynamic-content:open", f);
|
|
132
|
-
}),
|
|
133
|
+
}), Y(() => {
|
|
133
134
|
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", f);
|
|
134
135
|
try {
|
|
135
136
|
window.UIEditor.removeEditor();
|
|
@@ -139,13 +140,13 @@ const Ke = /* @__PURE__ */ j({
|
|
|
139
140
|
o.reset();
|
|
140
141
|
}), x({
|
|
141
142
|
dynamicContent: {
|
|
142
|
-
insert:
|
|
143
|
-
close:
|
|
143
|
+
insert: I,
|
|
144
|
+
close: R
|
|
144
145
|
},
|
|
145
146
|
hasChanges: m,
|
|
146
|
-
saveSilent:
|
|
147
|
-
setLoading:
|
|
148
|
-
}), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, headerWrapperRef:
|
|
147
|
+
saveSilent: E,
|
|
148
|
+
setLoading: w
|
|
149
|
+
}), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, AssignStrategyDrawer: $, headerWrapperRef: b, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: h, props: a, configStore: o, editorStore: c, previewStore: z, hasChanges: m, isTestPartner: q, saveSilent: E, setLoading: w, emit: r, buildMetadata: p, initPlugin: D, preloadRuntime: C, getDefaultTemplate: k, cloneTimersOnSave: T, hasTimerBlocks: F, noHeader: K, isRrsEnabled: V, insertDynamicContent: I, closeDynamicContent: R, handleDynamicContentOpen: f, ribbonObserver: i, updateRibbonOffset: y, startEditor: v, AutoSaveController: ie, Toaster: ce, FilterSelectionDrawer: de, HeaderWrapper: me, LoadingWrapper: le, SaveAsTemplateDrawer: ue, UnsubscribeWrapper: pe };
|
|
149
150
|
}
|
|
150
151
|
});
|
|
151
152
|
export {
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from "./AssignStrategyDrawer.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
},
|
|
3
|
+
/* empty css */
|
|
4
|
+
import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
5
|
+
var a = function() {
|
|
6
|
+
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
7
|
+
return t.store.assignStrategyDrawerStatus ? s(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", show: "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, 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() {
|
|
8
|
+
return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "info-box-position": "bottom right", "create-button-visible": !1, loading: t.store.strategiesLoading, "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: { select: t.onSelect } })], 1)];
|
|
9
|
+
}, proxy: !0 }], null, !1, 5799417) }) : e._e();
|
|
10
|
+
}, n = [], i = /* @__PURE__ */ o(
|
|
11
|
+
r,
|
|
8
12
|
a,
|
|
9
|
-
o,
|
|
10
13
|
n,
|
|
11
14
|
!1,
|
|
12
15
|
null,
|
|
13
|
-
"
|
|
16
|
+
"43e684f6"
|
|
14
17
|
);
|
|
15
|
-
const
|
|
18
|
+
const y = i.exports;
|
|
16
19
|
export {
|
|
17
|
-
|
|
20
|
+
y as default
|
|
18
21
|
};
|
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as f, defineAsyncComponent as g, ref as l, computed as a, watch as w } from "vue";
|
|
2
2
|
import "@useinsider/design-system-organisms/style";
|
|
3
|
-
import _ from "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import { buildStrategyInfoBoxProps as
|
|
10
|
-
|
|
11
|
-
const V = /* @__PURE__ */ S({
|
|
3
|
+
import { useToaster as _ } from "../../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as D } from "../../../../composables/useTranslations.js";
|
|
5
|
+
import { URLS as v } from "../../../../enums/extensions/recommendationBlock.js";
|
|
6
|
+
import { ToasterTypeOptions as p } from "../../../../enums/toaster.js";
|
|
7
|
+
import { useRecommendationExtensionStore as T } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
8
|
+
import O from "./StrategyInfoBoxContent.vue.js";
|
|
9
|
+
import { buildStrategyInfoBoxProps as x } from "../../../../utils/strategyInfoBox.js";
|
|
10
|
+
const L = /* @__PURE__ */ f({
|
|
12
11
|
__name: "AssignStrategyDrawer",
|
|
13
|
-
setup(
|
|
14
|
-
const
|
|
12
|
+
setup(A) {
|
|
13
|
+
const m = g(
|
|
15
14
|
async () => (await import("@useinsider/design-system-organisms")).OrgStrategyDetailModal
|
|
16
|
-
),
|
|
17
|
-
|
|
15
|
+
), y = g(
|
|
16
|
+
async () => (await import("@useinsider/design-system-organisms")).OrgStrategyDropdown
|
|
17
|
+
), r = D(), e = T(), { showToaster: n } = _(), s = l(null), o = l(!1), u = a(() => e.assignStrategyDrawerStatus ? r("email-editor.assign-strategy-description", { url: v.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
|
|
18
|
+
w(() => e.assignStrategyDrawerStatus, (t) => {
|
|
18
19
|
if (!t)
|
|
19
20
|
return;
|
|
20
21
|
const { strategyId: i } = e.recommendationConfigs;
|
|
21
|
-
s.value = i || null,
|
|
22
|
+
s.value = i || null, o.value = !1, e.fetchStrategies().catch(() => {
|
|
22
23
|
n({
|
|
23
|
-
type:
|
|
24
|
+
type: p.Error,
|
|
24
25
|
message: r("discovery-strategy.error-description")
|
|
25
26
|
});
|
|
26
27
|
});
|
|
27
28
|
});
|
|
28
|
-
const
|
|
29
|
+
const d = a(() => e.strategies.map((t) => ({
|
|
29
30
|
text: t.name,
|
|
30
31
|
value: t.strategy_id,
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
// `slot` lives here, not in the util: the design system renders it with
|
|
33
|
+
// `<component :is>` inside its own info box, and a util must not import one.
|
|
34
|
+
infoBoxProps: { ...x(t, r), slot: O }
|
|
35
|
+
}))), c = a(() => {
|
|
33
36
|
const t = e.strategies.find((i) => String(i.strategy_id) === String(s.value ?? ""));
|
|
34
37
|
return t ? { ...t, fallback_config: null } : null;
|
|
35
|
-
}),
|
|
38
|
+
}), S = a(() => ({
|
|
36
39
|
primaryButton: {
|
|
37
40
|
styling: "solid",
|
|
38
41
|
type: "primary",
|
|
@@ -44,23 +47,23 @@ const V = /* @__PURE__ */ S({
|
|
|
44
47
|
labelText: r("products.cancel")
|
|
45
48
|
}
|
|
46
49
|
}));
|
|
47
|
-
return { __sfc: !0, OrgStrategyDetailModal:
|
|
50
|
+
return { __sfc: !0, OrgStrategyDetailModal: m, OrgStrategyDropdown: y, trans: r, store: e, showToaster: n, selectedStrategyId: s, showSelectionError: o, drawerDescription: u, strategyOptions: d, selectedStrategy: c, footerButtonGroupOptions: S, closeDrawer: () => {
|
|
48
51
|
e.closeAssignStrategyDrawer();
|
|
49
52
|
}, assignStrategy: () => {
|
|
50
|
-
const t =
|
|
53
|
+
const t = c.value;
|
|
51
54
|
if (!t) {
|
|
52
|
-
|
|
55
|
+
o.value = !0;
|
|
53
56
|
return;
|
|
54
57
|
}
|
|
55
58
|
e.assignStrategy(t), n({
|
|
56
|
-
type:
|
|
59
|
+
type: p.Success,
|
|
57
60
|
message: r("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
58
61
|
}), e.closeAssignStrategyDrawer();
|
|
59
62
|
}, onSelect: (t) => {
|
|
60
|
-
s.value = t.value,
|
|
61
|
-
}
|
|
63
|
+
s.value = t.value, o.value = !1;
|
|
64
|
+
} };
|
|
62
65
|
}
|
|
63
66
|
});
|
|
64
67
|
export {
|
|
65
|
-
|
|
68
|
+
L as default
|
|
66
69
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import a from "./StrategyInfoBoxContent.vue2.js";
|
|
2
|
+
import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var _ = function() {
|
|
4
|
+
var t = this, s = t._self._c;
|
|
5
|
+
return t._self._setupProxy, s("div", { staticClass: "d-f f-d-c mt-3" }, t._l(t.details, function(n, e) {
|
|
6
|
+
return s("div", { key: n.title, staticClass: "d-f f-d-c", class: { "mt-2": e > 0 } }, [s("span", { staticClass: "f-s-1 f-w-600 l-h-1 t-c-52 mb-12" }, [t._v(t._s(n.title))]), s("span", { staticClass: "f-s-1 l-h-6 t-c-55 w-b-b-w" }, [t._v(t._s(n.value))])]);
|
|
7
|
+
}), 0);
|
|
8
|
+
}, c = [], f = /* @__PURE__ */ r(
|
|
9
|
+
a,
|
|
10
|
+
_,
|
|
11
|
+
c,
|
|
12
|
+
!1,
|
|
13
|
+
null,
|
|
14
|
+
null
|
|
15
|
+
);
|
|
16
|
+
const m = f.exports;
|
|
17
|
+
export {
|
|
18
|
+
m as default
|
|
19
|
+
};
|
|
@@ -141,11 +141,11 @@ const z = () => ({
|
|
|
141
141
|
},
|
|
142
142
|
getActivePredictiveAlgorithms: (t) => {
|
|
143
143
|
const e = y(), r = [];
|
|
144
|
-
return t.activePredictiveAlgorithms.filter((
|
|
145
|
-
r.push(...e.filter((s) => s.id ===
|
|
146
|
-
}), r.map((
|
|
147
|
-
text:
|
|
148
|
-
value:
|
|
144
|
+
return t.activePredictiveAlgorithms.filter((n) => !N.includes(n)).forEach((n) => {
|
|
145
|
+
r.push(...e.filter((s) => s.id === n));
|
|
146
|
+
}), r.map((n) => ({
|
|
147
|
+
text: n.name,
|
|
148
|
+
value: n.key
|
|
149
149
|
}));
|
|
150
150
|
},
|
|
151
151
|
getLanguages: (t) => Object.entries(t.languages).map(([e, r]) => ({
|
|
@@ -191,13 +191,13 @@ const z = () => ({
|
|
|
191
191
|
removeBlockState(t) {
|
|
192
192
|
const e = t.toString();
|
|
193
193
|
if (this.recommendationCampaignUrls[e]) {
|
|
194
|
-
const
|
|
195
|
-
delete
|
|
194
|
+
const n = { ...this.recommendationCampaignUrls };
|
|
195
|
+
delete n[e], this.recommendationCampaignUrls = n;
|
|
196
196
|
}
|
|
197
197
|
const r = { ...this.blockStates };
|
|
198
198
|
if (delete r[t], this.blockStates = r, this.currentRecommendationId === t) {
|
|
199
|
-
const
|
|
200
|
-
this.currentRecommendationId =
|
|
199
|
+
const n = Object.keys(this.blockStates).map(Number);
|
|
200
|
+
this.currentRecommendationId = n.length > 0 ? n[0] : null;
|
|
201
201
|
}
|
|
202
202
|
},
|
|
203
203
|
/**
|
|
@@ -213,10 +213,10 @@ const z = () => ({
|
|
|
213
213
|
[e]: o
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
|
-
const
|
|
217
|
-
|
|
216
|
+
const n = t.toString(), s = e.toString(), i = this.recommendationCampaignUrls[n];
|
|
217
|
+
i && (this.recommendationCampaignUrls = {
|
|
218
218
|
...this.recommendationCampaignUrls,
|
|
219
|
-
[s]:
|
|
219
|
+
[s]: i
|
|
220
220
|
});
|
|
221
221
|
},
|
|
222
222
|
/**
|
|
@@ -241,7 +241,7 @@ const z = () => ({
|
|
|
241
241
|
* `isInitialized`) alone.
|
|
242
242
|
*/
|
|
243
243
|
seedBlockUrlConfig(t, e) {
|
|
244
|
-
const r = (o, a) => o === "." || o === "," || o === " " ? o : a,
|
|
244
|
+
const r = (o, a) => o === "." || o === "," || o === " " ? o : a, n = {
|
|
245
245
|
name: e.currencyCode,
|
|
246
246
|
value: e.currencyCode,
|
|
247
247
|
symbol: e.currencyCode,
|
|
@@ -249,9 +249,9 @@ const z = () => ({
|
|
|
249
249
|
decimalCount: String(e.currencyDecimalCount),
|
|
250
250
|
decimalSeparator: r(e.currencyDecimalSeparator, ","),
|
|
251
251
|
thousandSeparator: r(e.currencyThousandSeparator, ".")
|
|
252
|
-
}, s = !this.blockStates[t],
|
|
253
|
-
|
|
254
|
-
...
|
|
252
|
+
}, s = !this.blockStates[t], i = s ? k() : this.blockStates[t];
|
|
253
|
+
i.recommendationConfigs = {
|
|
254
|
+
...i.recommendationConfigs,
|
|
255
255
|
strategy: e.strategy,
|
|
256
256
|
strategyId: e.strategyId,
|
|
257
257
|
language: e.language,
|
|
@@ -259,10 +259,10 @@ const z = () => ({
|
|
|
259
259
|
productIds: e.productIds,
|
|
260
260
|
filters: e.filters,
|
|
261
261
|
shuffleProducts: e.shuffleProducts,
|
|
262
|
-
currencySettings:
|
|
262
|
+
currencySettings: n
|
|
263
263
|
}, s && (this.blockStates = {
|
|
264
264
|
...this.blockStates,
|
|
265
|
-
[t]:
|
|
265
|
+
[t]: i
|
|
266
266
|
});
|
|
267
267
|
},
|
|
268
268
|
/**
|
|
@@ -281,18 +281,18 @@ const z = () => ({
|
|
|
281
281
|
...t.currencySettings || {}
|
|
282
282
|
}
|
|
283
283
|
};
|
|
284
|
-
const { triggerRefetch:
|
|
285
|
-
|
|
284
|
+
const { triggerRefetch: n = !0 } = e;
|
|
285
|
+
n && this.configVersion++;
|
|
286
286
|
},
|
|
287
287
|
/**
|
|
288
288
|
* Creates a filter with the first available attribute and operator pre-selected.
|
|
289
289
|
*/
|
|
290
290
|
createDefaultFilter(t, e) {
|
|
291
|
-
const [r] = this.getFilterList, [
|
|
291
|
+
const [r] = this.getFilterList, [n] = w(r == null ? void 0 : r.type);
|
|
292
292
|
return {
|
|
293
293
|
type: "standardFilter",
|
|
294
294
|
attribute: (r == null ? void 0 : r.value) ?? "",
|
|
295
|
-
operator: (
|
|
295
|
+
operator: (n == null ? void 0 : n.value) ?? "",
|
|
296
296
|
innerGroupOperator: "*",
|
|
297
297
|
outerGroupOperator: "*",
|
|
298
298
|
filterNumber: e,
|
|
@@ -385,14 +385,14 @@ const z = () => ({
|
|
|
385
385
|
* currencies can resolve to different paths for the same revision.
|
|
386
386
|
*/
|
|
387
387
|
async resolveStrategyUrlTemplate(t, e) {
|
|
388
|
-
const r = typeof t.updated_at == "string" ? t.updated_at : "",
|
|
388
|
+
const r = typeof t.updated_at == "string" ? t.updated_at : "", n = r ? `${t.strategy_id}:${r}:${e}` : "", s = n ? this.strategyUrlTemplates[n] : void 0;
|
|
389
389
|
if (s)
|
|
390
390
|
return s;
|
|
391
|
-
const { full_path:
|
|
392
|
-
return
|
|
391
|
+
const { full_path: i } = await d.generateStrategyEndpoint(t, e);
|
|
392
|
+
return n && (this.strategyUrlTemplates = {
|
|
393
393
|
...this.strategyUrlTemplates,
|
|
394
|
-
[
|
|
395
|
-
}),
|
|
394
|
+
[n]: i
|
|
395
|
+
}), i;
|
|
396
396
|
},
|
|
397
397
|
/**
|
|
398
398
|
* Assigns a strategy to the current block. The config write is
|
|
@@ -433,8 +433,8 @@ const z = () => ({
|
|
|
433
433
|
currencies: r
|
|
434
434
|
} = await d.fetchRecommendationCreateData();
|
|
435
435
|
if (this.activePredictiveAlgorithms = t, this.languages = e, this.currentRecommendationId !== null && this.blockStates[this.currentRecommendationId]) {
|
|
436
|
-
const
|
|
437
|
-
|
|
436
|
+
const n = this.blockStates[this.currentRecommendationId];
|
|
437
|
+
n.filterStatus = !!n.recommendationConfigs.filters.length;
|
|
438
438
|
}
|
|
439
439
|
this.currencyList = r;
|
|
440
440
|
})();
|
|
@@ -473,41 +473,41 @@ const z = () => ({
|
|
|
473
473
|
deleteFilterGroup(t) {
|
|
474
474
|
if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
|
|
475
475
|
return;
|
|
476
|
-
const e = this.blockStates[this.currentRecommendationId], r = e.recommendationConfigs.filters.filter((
|
|
477
|
-
e.recommendationConfigs.filters = r.map((
|
|
478
|
-
...
|
|
479
|
-
filterGroup: s.get(
|
|
476
|
+
const e = this.blockStates[this.currentRecommendationId], r = e.recommendationConfigs.filters.filter((i) => i.filterGroup !== t), n = [...new Set(r.map((i) => i.filterGroup))].sort((i, o) => i - o), s = new Map(n.map((i, o) => [i, o + 1]));
|
|
477
|
+
e.recommendationConfigs.filters = r.map((i) => ({
|
|
478
|
+
...i,
|
|
479
|
+
filterGroup: s.get(i.filterGroup) ?? i.filterGroup
|
|
480
480
|
}));
|
|
481
481
|
},
|
|
482
482
|
updateFilter(t) {
|
|
483
483
|
if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
|
|
484
484
|
return;
|
|
485
|
-
const e = this.blockStates[this.currentRecommendationId], r = e.recommendationConfigs.filters.findIndex((
|
|
485
|
+
const e = this.blockStates[this.currentRecommendationId], r = e.recommendationConfigs.filters.findIndex((n) => n.filterNumber === t.filterNumber && n.filterGroup === t.filterGroup);
|
|
486
486
|
if (r !== -1) {
|
|
487
|
-
const
|
|
488
|
-
|
|
487
|
+
const n = [...e.recommendationConfigs.filters];
|
|
488
|
+
n[r] = {
|
|
489
489
|
...t,
|
|
490
490
|
isValid: A(t)
|
|
491
|
-
}, e.recommendationConfigs.filters =
|
|
491
|
+
}, e.recommendationConfigs.filters = n;
|
|
492
492
|
}
|
|
493
493
|
},
|
|
494
494
|
deleteFilter(t) {
|
|
495
495
|
if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
|
|
496
496
|
return;
|
|
497
|
-
const e = this.blockStates[this.currentRecommendationId], r = [...e.recommendationConfigs.filters].findIndex((
|
|
497
|
+
const e = this.blockStates[this.currentRecommendationId], r = [...e.recommendationConfigs.filters].findIndex((n) => n.filterNumber === t.filterNumber && n.filterGroup === t.filterGroup);
|
|
498
498
|
if (r !== -1) {
|
|
499
|
-
let
|
|
500
|
-
if (
|
|
501
|
-
let
|
|
502
|
-
|
|
499
|
+
let n = [...e.recommendationConfigs.filters];
|
|
500
|
+
if (n.splice(r, 1), n.some((i) => i.filterGroup === t.filterGroup)) {
|
|
501
|
+
let i = 1;
|
|
502
|
+
n = n.map((o) => o.filterGroup === t.filterGroup ? { ...o, filterNumber: i++ } : o);
|
|
503
503
|
} else {
|
|
504
|
-
const
|
|
505
|
-
|
|
504
|
+
const i = [...new Set(n.map((a) => a.filterGroup))].sort((a, c) => a - c), o = new Map(i.map((a, c) => [a, c + 1]));
|
|
505
|
+
n = n.map((a) => ({
|
|
506
506
|
...a,
|
|
507
507
|
filterGroup: o.get(a.filterGroup) ?? a.filterGroup
|
|
508
508
|
}));
|
|
509
509
|
}
|
|
510
|
-
e.recommendationConfigs.filters =
|
|
510
|
+
e.recommendationConfigs.filters = n;
|
|
511
511
|
}
|
|
512
512
|
},
|
|
513
513
|
addFilter(t) {
|
|
@@ -515,8 +515,8 @@ const z = () => ({
|
|
|
515
515
|
return;
|
|
516
516
|
const e = this.blockStates[this.currentRecommendationId], r = [...e.recommendationConfigs.filters], s = r.filter(
|
|
517
517
|
(o) => o.filterGroup === t.filterGroup
|
|
518
|
-
).length + 1,
|
|
519
|
-
|
|
518
|
+
).length + 1, i = r.findLastIndex((o) => o.filterGroup === t.filterGroup);
|
|
519
|
+
i !== -1 ? r.splice(i + 1, 0, {
|
|
520
520
|
...t,
|
|
521
521
|
filterNumber: s
|
|
522
522
|
}) : r.push({
|
|
@@ -554,22 +554,22 @@ const z = () => ({
|
|
|
554
554
|
},
|
|
555
555
|
async _doFetchProducts() {
|
|
556
556
|
var p;
|
|
557
|
-
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e,
|
|
557
|
+
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = P(), { isFeatureEnabled: s } = C();
|
|
558
558
|
if (s("reusableRecommendationStrategy") && r.strategyId) {
|
|
559
559
|
await this._doFetchStrategyProducts(t);
|
|
560
560
|
return;
|
|
561
561
|
}
|
|
562
|
-
const
|
|
562
|
+
const i = r.filters.filter((u) => u.isValid), o = I(i), a = ((p = y().find((u) => u.key === r.strategy)) == null ? void 0 : p.path) || "", c = parseInt(r.size) || 6, l = {
|
|
563
563
|
locale: r.language,
|
|
564
564
|
currency: r.currencySettings.value,
|
|
565
|
-
partnerName:
|
|
565
|
+
partnerName: n.partnerName,
|
|
566
566
|
size: r.size,
|
|
567
567
|
details: !0,
|
|
568
|
-
campaignId:
|
|
568
|
+
campaignId: n.variationId
|
|
569
569
|
};
|
|
570
570
|
r.strategy === "manualMerchandising" ? l.productId = x(r.productIds) : r.strategy === "similarViewed" && (l.productId = "{itemId}"), r.strategy === "userBased" && (l.userId = "{user_id}"), o && (l.filter = o), r.shuffleProducts && (l.shuffle = !0), Object.assign(
|
|
571
571
|
l,
|
|
572
|
-
L(
|
|
572
|
+
L(n.partnerName, r.strategy)
|
|
573
573
|
);
|
|
574
574
|
let m;
|
|
575
575
|
try {
|
|
@@ -587,21 +587,21 @@ const z = () => ({
|
|
|
587
587
|
*/
|
|
588
588
|
async _doFetchStrategyProducts(t) {
|
|
589
589
|
const { recommendationConfigs: e } = this.blockStates[t];
|
|
590
|
-
let r = [],
|
|
590
|
+
let r = [], n = parseInt(e.size) || 6;
|
|
591
591
|
try {
|
|
592
|
-
|
|
592
|
+
await this.fetchStrategies();
|
|
593
593
|
const s = this.strategies.find(
|
|
594
|
-
(
|
|
594
|
+
(i) => String(i.strategy_id) === e.strategyId
|
|
595
595
|
);
|
|
596
596
|
if (s) {
|
|
597
|
-
|
|
598
|
-
const
|
|
597
|
+
n = parseInt(String(s.size ?? "")) || n;
|
|
598
|
+
const i = e.currencySettings.value, a = (await this.resolveStrategyUrlTemplate(s, i)).replaceAll("{locale}", e.language).replaceAll("{currency}", i), c = a.indexOf("?"), l = c === -1 ? a : a.slice(0, c), m = (c === -1 ? "" : a.slice(c + 1)).split("&").filter((u) => u && !u.startsWith("user_id=")), p = m.length ? `${l}?${m.join("&")}` : l;
|
|
599
599
|
r = await d.fetchRecommendationProductsByUrl(p);
|
|
600
600
|
}
|
|
601
601
|
} catch {
|
|
602
602
|
r = [];
|
|
603
603
|
}
|
|
604
|
-
this._setBlockProducts(t, r,
|
|
604
|
+
this._setBlockProducts(t, r, n);
|
|
605
605
|
},
|
|
606
606
|
/**
|
|
607
607
|
* Writes products to a block's state, padded/clipped to exactly `size`:
|
|
@@ -612,10 +612,10 @@ const z = () => ({
|
|
|
612
612
|
_setBlockProducts(t, e, r) {
|
|
613
613
|
if (!this.blockStates[t])
|
|
614
614
|
return;
|
|
615
|
-
const
|
|
615
|
+
const n = e.length > 0 ? e : b(r);
|
|
616
616
|
this.blockStates[t].recommendationProducts = [
|
|
617
|
-
...
|
|
618
|
-
...b(Math.max(0, r -
|
|
617
|
+
...n.slice(0, r),
|
|
618
|
+
...b(Math.max(0, r - n.length))
|
|
619
619
|
];
|
|
620
620
|
}
|
|
621
621
|
}
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.gap-16[data-v-
|
|
1
|
+
@charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-6e711fd7]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-b13f0cfc]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-b13f0cfc]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-b13f0cfc]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-43e684f6]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-43e684f6] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}
|
package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
details: {
|
|
3
|
+
title: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}[];
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
10
|
+
type __VLS_TypePropsToOption<T> = {
|
|
11
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
12
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
13
|
+
} : {
|
|
14
|
+
type: import('vue').PropType<T[K]>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -35,9 +35,9 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
35
35
|
size: "X-small" | "small" | "medium" | "large";
|
|
36
36
|
description: string;
|
|
37
37
|
closeOnOutsideClick: boolean;
|
|
38
|
-
footerStatus: boolean;
|
|
39
38
|
footerButtonOptions: FooterButtonGroup;
|
|
40
39
|
closeButtonStatus: boolean;
|
|
40
|
+
footerStatus: boolean;
|
|
41
41
|
}>;
|
|
42
42
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
43
43
|
export default _default;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import type { RrsStrategy } from '@@/Types/recommendation';
|
|
2
2
|
import { useTranslations } from '@@/Composables/useTranslations';
|
|
3
|
-
|
|
3
|
+
interface StrategyInfoBoxDetail {
|
|
4
|
+
title: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
interface StrategyInfoBoxContent {
|
|
8
|
+
details: StrategyInfoBoxDetail[];
|
|
9
|
+
}
|
|
4
10
|
/**
|
|
5
11
|
* Props for the design system info box that previews a strategy on hover.
|
|
6
12
|
*
|
|
7
13
|
* The box is InSelect's own per-option feature: the dropdown v-binds this whole
|
|
8
|
-
* object onto `<in-info-box
|
|
9
|
-
*
|
|
10
|
-
*
|
|
14
|
+
* object onto `<in-info-box>` and, when `slot` is set, renders that component
|
|
15
|
+
* inside it with `slotProps`. `slot` is added by the caller — a util must not
|
|
16
|
+
* import a component.
|
|
17
|
+
*
|
|
18
|
+
* `titleText` still reaches the design system's sanitizer as markup, so the
|
|
19
|
+
* partner-supplied name is escaped here; the rows go through the component's
|
|
20
|
+
* text interpolation and need no escaping.
|
|
11
21
|
*
|
|
12
22
|
* `trans` is injectable because callers map this over a whole listing, and
|
|
13
23
|
* `useTranslations()` rebuilds its dictionary and memo cache on every call.
|
|
@@ -18,5 +28,8 @@ export declare const buildStrategyInfoBoxProps: (strategy: RrsStrategy, trans?:
|
|
|
18
28
|
variant: string;
|
|
19
29
|
className: string;
|
|
20
30
|
titleText: string;
|
|
31
|
+
descriptionStatus: boolean;
|
|
21
32
|
descriptionText: string;
|
|
33
|
+
slotProps: StrategyInfoBoxContent;
|
|
22
34
|
};
|
|
35
|
+
export {};
|
|
@@ -1,37 +1,68 @@
|
|
|
1
|
-
import { useTranslations as
|
|
2
|
-
import { formatShortDate as
|
|
3
|
-
import { escapeHtml as
|
|
4
|
-
const
|
|
5
|
-
const r =
|
|
6
|
-
return
|
|
7
|
-
},
|
|
1
|
+
import { useTranslations as a } from "../composables/useTranslations.js";
|
|
2
|
+
import { formatShortDate as c } from "./dateUtil.js";
|
|
3
|
+
import { escapeHtml as l } from "./htmlEscape.js";
|
|
4
|
+
const d = "assign-strategy-info-box", o = (e) => typeof e == "string" ? e : typeof e == "number" ? String(e) : "", u = (e, t) => {
|
|
5
|
+
const r = o(e.algorithm) === "MIXED" ? t("discovery-strategy.mixed-algorithm") : t("discovery-strategy.single-algorithm"), n = o(e.algorithm_used).split(",").map((i) => i.trim()).filter(Boolean).map((i) => t(`recommendation-algorithm-names.${i.replaceAll("_", "-").toLowerCase()}`));
|
|
6
|
+
return n.length ? `${r} · ${n.join(", ")}` : r;
|
|
7
|
+
}, m = (e, t) => [
|
|
8
8
|
[e.exclude_view, "discovery-strategy.exclude-recently-view-items"],
|
|
9
9
|
[e.exclude_purchase, "discovery-strategy.exclude-recently-purchased-items"],
|
|
10
10
|
[e.exclude_cart, "discovery-strategy.exclude-recently-added-cart-items"]
|
|
11
|
-
].filter(([r]) => Number(r) === 1).map(([, r]) => t(r)).join(", "),
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
].filter(([r]) => Number(r) === 1).map(([, r]) => t(r)).join(", "), s = (e) => {
|
|
12
|
+
const t = o(e).trim();
|
|
13
|
+
if (!t)
|
|
14
|
+
return "";
|
|
15
|
+
let r;
|
|
16
|
+
try {
|
|
17
|
+
r = JSON.parse(t);
|
|
18
|
+
} catch {
|
|
19
|
+
return t;
|
|
20
|
+
}
|
|
21
|
+
if (Array.isArray(r))
|
|
22
|
+
return r.length ? String(r.length) : "";
|
|
23
|
+
if (r && typeof r == "object") {
|
|
24
|
+
const n = Object.keys(r).length;
|
|
25
|
+
return n ? String(n) : "";
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
}, p = (e) => s(e.manual_merchandising) || s(e.manual_merchandising_products), g = (e) => {
|
|
29
|
+
if (Array.isArray(e))
|
|
30
|
+
return e.length;
|
|
31
|
+
const { conditionList: t } = e ?? {};
|
|
32
|
+
return Array.isArray(t) ? t.length : 1;
|
|
33
|
+
}, h = (e) => {
|
|
14
34
|
const t = e.filters;
|
|
15
35
|
if (!t)
|
|
16
36
|
return 0;
|
|
17
37
|
try {
|
|
18
38
|
const r = typeof t == "string" ? JSON.parse(t) : t;
|
|
19
|
-
return
|
|
39
|
+
return !r || typeof r != "object" ? 0 : Object.values(r).reduce((n, i) => n + g(i), 0);
|
|
20
40
|
} catch {
|
|
21
41
|
return 0;
|
|
22
42
|
}
|
|
23
|
-
},
|
|
24
|
-
const r =
|
|
43
|
+
}, f = (e, t) => {
|
|
44
|
+
const r = o(e.updated_at || e.created_at);
|
|
45
|
+
return r ? t("recommendation-strategy.last-updated-on", { value: c(r) }) : "";
|
|
46
|
+
}, y = (e, t = a()) => {
|
|
47
|
+
const r = t("recommendation-strategy.none"), n = h(e);
|
|
25
48
|
return {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
49
|
+
details: [
|
|
50
|
+
{ title: t("gpt-app-builder.algorithms-and-method"), value: u(e, t) },
|
|
51
|
+
{ title: t("gpt-app-builder.exclusions"), value: m(e, t) || r },
|
|
52
|
+
{ title: t("discovery-strategy.filters"), value: n ? String(n) : r },
|
|
53
|
+
{ title: t("action-builder.manual-merchandising"), value: p(e) || r }
|
|
54
|
+
]
|
|
32
55
|
};
|
|
33
|
-
}
|
|
56
|
+
}, b = (e, t = a()) => ({
|
|
57
|
+
id: `strategy-info-${e.strategy_id}`,
|
|
58
|
+
theme: "light",
|
|
59
|
+
variant: "information",
|
|
60
|
+
className: d,
|
|
61
|
+
titleText: l(o(e.name)),
|
|
62
|
+
descriptionStatus: !0,
|
|
63
|
+
descriptionText: f(e, t),
|
|
64
|
+
slotProps: y(e, t)
|
|
65
|
+
});
|
|
34
66
|
export {
|
|
35
|
-
|
|
36
|
-
v as buildStrategyInfoBoxProps
|
|
67
|
+
b as buildStrategyInfoBoxProps
|
|
37
68
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.17.0-beta.
|
|
3
|
+
"version": "3.17.0-beta.bdc7d25",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"license": "ISC",
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@stripoinc/ui-editor-extensions": "3.9.0",
|
|
51
|
-
"@useinsider/design-system-organisms": "0.0.3-beta.
|
|
51
|
+
"@useinsider/design-system-organisms": "0.0.3-beta.791d412",
|
|
52
52
|
"@useinsider/design-system-vue": "1.5.0",
|
|
53
53
|
"@vueuse/core": "11.3.0",
|
|
54
54
|
"lodash-es": "4.17.21",
|