@useinsider/guido 3.17.0-beta.ad62b51 → 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/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +12 -9
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +28 -25
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +13 -0
- package/dist/guido.css +1 -1
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +17 -0
- package/dist/src/utils/strategyInfoBox.d.ts +17 -4
- package/dist/utils/strategyInfoBox.js +53 -22
- package/package.json +2 -2
|
@@ -1,18 +1,21 @@
|
|
|
1
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(
|
|
8
11
|
r,
|
|
9
|
-
|
|
12
|
+
a,
|
|
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 f, defineAsyncComponent 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
|
|
4
|
-
import { useToaster as w } from "../../../../composables/useToaster.js";
|
|
3
|
+
import { useToaster as _ } from "../../../../composables/useToaster.js";
|
|
5
4
|
import { useTranslations as D } from "../../../../composables/useTranslations.js";
|
|
6
|
-
import { URLS as
|
|
7
|
-
import { ToasterTypeOptions as
|
|
8
|
-
import { useRecommendationExtensionStore as
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
const
|
|
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 U = /* @__PURE__ */ f({
|
|
|
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
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
|
+
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
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}.
|
|
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
|
+
};
|
|
@@ -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",
|