@useinsider/guido 3.16.0 → 3.17.0-beta.24a776b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/@types/config/schemas.js +12 -6
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +66 -63
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +65 -0
- package/dist/composables/useConfig.js +37 -30
- package/dist/composables/useCustomInterfaceAppearance.js +52 -38
- package/dist/composables/useRecommendation.js +51 -42
- package/dist/composables/useStripo.js +30 -29
- package/dist/config/migrator/itemsBlockMigrator.js +1 -1
- package/dist/config/migrator/recommendation/settingsMapper.js +19 -17
- package/dist/config/migrator/recommendationMigrator.js +56 -37
- package/dist/enums/academy.js +2 -1
- package/dist/enums/date.js +4 -3
- package/dist/enums/extensions/recommendationBlock.js +4 -1
- package/dist/enums/recommendation.js +17 -17
- package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -45
- package/dist/extensions/Blocks/Recommendation/block.js +26 -21
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +36 -34
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +96 -95
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +37 -26
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +147 -150
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +136 -0
- package/dist/extensions/Blocks/Recommendation/services/configService.js +35 -35
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +247 -107
- package/dist/extensions/Blocks/Recommendation/utils/productIds.js +6 -0
- package/dist/extensions/Blocks/common-control.js +22 -19
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +72 -30
- package/dist/src/@types/config/schemas.d.ts +12 -0
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
- package/dist/src/composables/useConfig.d.ts +3 -0
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +7 -6
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +9 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +204 -10
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/productIds.d.ts +6 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
- package/dist/src/mock/api/recommendation-strategies.d.ts +63 -0
- package/dist/src/services/recommendationApi.d.ts +4 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/stores/template.d.ts +14 -0
- package/dist/src/utils/strategyInfoBox.d.ts +18 -0
- package/dist/static/assets/icons/line-change.svg.js +5 -0
- package/dist/static/assets/icons/line-delete.svg.js +5 -0
- package/dist/static/assets/icons/line-plus.svg.js +5 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +172 -0
- package/dist/stores/template.js +13 -8
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/strategyInfoBox.js +37 -0
- package/dist/utils/templatePreparation.js +37 -34
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -162,6 +162,7 @@ const config: GuidoConfigInput = {
|
|
|
162
162
|
liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
|
|
163
163
|
autosave?: boolean, // Default: false - Show the Auto Save toggle in the header. See wiki/AUTOSAVE.md.
|
|
164
164
|
allowlistEnabled?: boolean, // Default: false - Pre-save domain-allowlist check (opt-in). Guido self-serves the block toaster (role lookup, deep-link, copy from window.trans).
|
|
165
|
+
reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
|
|
165
166
|
},
|
|
166
167
|
|
|
167
168
|
// Optional: Callbacks
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleFolderDefaults as f } from "../../enums/defaults.js";
|
|
2
|
-
import { object as a, number as n, optional as e, string as t, picklist as i, pipe as m, minLength as b, custom as
|
|
2
|
+
import { object as a, number as n, optional as e, string as t, picklist as i, pipe as m, minLength as b, custom as y, boolean as o, array as c, transform as C, record as k, fallback as R, literal as u, looseObject as g, variant as T, union as h, unknown as r, lazy as I } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const p = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -76,7 +76,7 @@ const p = {
|
|
|
76
76
|
children: e(c(S)),
|
|
77
77
|
// eslint-disable-next-line camelcase -- backend field name
|
|
78
78
|
select_items: e(c(S))
|
|
79
|
-
})), N =
|
|
79
|
+
})), N = k(
|
|
80
80
|
t(),
|
|
81
81
|
R(c(S), [])
|
|
82
82
|
), P = g({
|
|
@@ -132,7 +132,7 @@ const p = {
|
|
|
132
132
|
* strategy, currency, locale, and layout data.
|
|
133
133
|
*/
|
|
134
134
|
recommendationConfigs: e(
|
|
135
|
-
|
|
135
|
+
k(t(), P),
|
|
136
136
|
{}
|
|
137
137
|
)
|
|
138
138
|
}), x = a({
|
|
@@ -219,7 +219,13 @@ const p = {
|
|
|
219
219
|
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
220
220
|
allowlistEnabled: e(o(), !1),
|
|
221
221
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
222
|
-
linkTrackingIds: e(o(), !1)
|
|
222
|
+
linkTrackingIds: e(o(), !1),
|
|
223
|
+
/**
|
|
224
|
+
* Assign a Reusable Recommendation Strategy (RRS) to recommendation blocks instead of
|
|
225
|
+
* per-block algorithm settings. Hides Algorithm, Filters, Shuffle and Number of Products
|
|
226
|
+
* (they live on the strategy) and adds the Assign Strategy flow.
|
|
227
|
+
*/
|
|
228
|
+
reusableRecommendationStrategy: e(o(), !1)
|
|
223
229
|
}), B = i([
|
|
224
230
|
"amp-accordion",
|
|
225
231
|
"amp-carousel",
|
|
@@ -287,7 +293,7 @@ const p = {
|
|
|
287
293
|
...d.entries,
|
|
288
294
|
type: u("custom"),
|
|
289
295
|
/** Custom processor function */
|
|
290
|
-
processor:
|
|
296
|
+
processor: y(
|
|
291
297
|
(s) => typeof s == "function",
|
|
292
298
|
"processor must be a function"
|
|
293
299
|
)
|
|
@@ -307,7 +313,7 @@ const p = {
|
|
|
307
313
|
* Return false to cancel the save operation.
|
|
308
314
|
*/
|
|
309
315
|
externalValidation: e(
|
|
310
|
-
|
|
316
|
+
y(
|
|
311
317
|
(s) => typeof s == "function",
|
|
312
318
|
"externalValidation must be a function"
|
|
313
319
|
)
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
3
|
+
import i 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.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
|
-
}, n = [], s = /* @__PURE__ */
|
|
10
|
-
|
|
9
|
+
}, n = [], s = /* @__PURE__ */ i(
|
|
10
|
+
a,
|
|
11
11
|
t,
|
|
12
12
|
n,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"f51a116f"
|
|
16
16
|
);
|
|
17
17
|
const l = s.exports;
|
|
18
18
|
export {
|
|
@@ -1,50 +1,53 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { defineComponent as X, defineAsyncComponent as g, ref as U, computed as S, watch as _, onMounted as Y, onUnmounted as Z } from "vue";
|
|
2
|
+
import { useConfig as ee } from "../composables/useConfig.js";
|
|
3
|
+
import { useCortexBlueprintBridge as te } from "../composables/useCortexBlueprintBridge.js";
|
|
4
|
+
import { provideGuidoActions as oe } from "../composables/useGuidoActions.js";
|
|
5
|
+
import { useGuidoStateBridge as ne } from "../composables/useGuidoStateBridge.js";
|
|
6
|
+
import { usePartner as re } from "../composables/usePartner.js";
|
|
7
|
+
import { useStripo as se } from "../composables/useStripo.js";
|
|
8
|
+
import { useTimerClone as ie } from "../composables/useTimerClone.js";
|
|
8
9
|
import { migrate as N } from "../config/migrator/index.js";
|
|
9
10
|
import { ModuleFolderDefaults as O } 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 { useStripoApi as
|
|
20
|
-
import { useConfigStore as
|
|
21
|
-
import { useDynamicContentStore as
|
|
11
|
+
import { RIBBON_SELECTOR as ae } from "../enums/onboarding.js";
|
|
12
|
+
import { useRecommendationExtensionStore as ce } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
13
|
+
import de from "./organisms/AutoSaveController.vue.js";
|
|
14
|
+
import me from "./organisms/base/Toaster.vue.js";
|
|
15
|
+
import le from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
16
|
+
import ue from "./organisms/header/HeaderWrapper.vue.js";
|
|
17
|
+
import pe from "./organisms/LoadingWrapper.vue.js";
|
|
18
|
+
import fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
19
|
+
import ye from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
20
|
+
import { useStripoApi as ve } from "../services/stripoApi.js";
|
|
21
|
+
import { useConfigStore as ge } from "../stores/config.js";
|
|
22
|
+
import { useDynamicContentStore as Se } from "../stores/dynamic-content.js";
|
|
22
23
|
import { useEditorStore as P } from "../stores/editor.js";
|
|
23
|
-
import { usePreviewStore as
|
|
24
|
-
import { useTemplateStore as
|
|
25
|
-
import { useUnsubscribeStore as
|
|
26
|
-
import { readTrackFloor as
|
|
27
|
-
const
|
|
24
|
+
import { usePreviewStore as he } from "../stores/preview.js";
|
|
25
|
+
import { useTemplateStore as be } from "../stores/template.js";
|
|
26
|
+
import { useUnsubscribeStore as Ee } from "../stores/unsubscribe.js";
|
|
27
|
+
import { readTrackFloor as W } from "../utils/linkTrackingIds.js";
|
|
28
|
+
const Je = /* @__PURE__ */ X({
|
|
28
29
|
__name: "Guido",
|
|
29
30
|
props: {
|
|
30
31
|
config: null,
|
|
31
32
|
ready: { type: Boolean, default: !0 }
|
|
32
33
|
},
|
|
33
34
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
34
|
-
setup(
|
|
35
|
-
const
|
|
35
|
+
setup(x, { expose: G, emit: r }) {
|
|
36
|
+
const i = x, H = g(
|
|
36
37
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
37
|
-
),
|
|
38
|
+
), $ = g(
|
|
38
39
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
39
|
-
),
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
), z = g(
|
|
41
|
+
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
42
|
+
), h = U(), l = U(), u = Se(), b = Ee(), o = ge();
|
|
43
|
+
i.ready && o.init(i.config);
|
|
44
|
+
const c = P(), q = he(), m = S(() => c.hasChanges), { isTestPartner: K } = re(), E = () => {
|
|
42
45
|
var t;
|
|
43
46
|
return (t = h.value) == null ? void 0 : t.handleSave(!0);
|
|
44
|
-
},
|
|
47
|
+
}, w = (t) => {
|
|
45
48
|
c.loadingStatus = t;
|
|
46
49
|
};
|
|
47
|
-
|
|
50
|
+
te(), ne();
|
|
48
51
|
const p = () => {
|
|
49
52
|
var t, e;
|
|
50
53
|
return {
|
|
@@ -55,11 +58,11 @@ const ze = /* @__PURE__ */ j({
|
|
|
55
58
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || O.SAVED_MODULES,
|
|
56
59
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || O.DEFAULT_MODULES
|
|
57
60
|
};
|
|
58
|
-
}, { initPlugin:
|
|
61
|
+
}, { initPlugin: C, preloadRuntime: D } = se(), { getDefaultTemplate: k } = ve(), { cloneTimersOnSave: T, hasTimerBlocks: F } = ie(), V = S(() => {
|
|
59
62
|
var t;
|
|
60
63
|
return !((t = o.ui) != null && t.showHeader);
|
|
61
|
-
});
|
|
62
|
-
|
|
64
|
+
}), { isRrsSessionActive: I } = ee(), j = S(() => I());
|
|
65
|
+
oe({
|
|
63
66
|
onBack: () => {
|
|
64
67
|
console.debug("guido:back"), r("back");
|
|
65
68
|
},
|
|
@@ -74,9 +77,9 @@ const ze = /* @__PURE__ */ j({
|
|
|
74
77
|
console.debug("guido:test-email:click"), r("test-email:click");
|
|
75
78
|
}
|
|
76
79
|
});
|
|
77
|
-
const
|
|
80
|
+
const R = (t) => {
|
|
78
81
|
console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
79
|
-
},
|
|
82
|
+
}, L = () => {
|
|
80
83
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
81
84
|
};
|
|
82
85
|
_(() => m.value, () => {
|
|
@@ -86,67 +89,67 @@ const ze = /* @__PURE__ */ j({
|
|
|
86
89
|
const e = t, { attribute: s, position: d } = e.detail;
|
|
87
90
|
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
|
|
88
91
|
};
|
|
89
|
-
let
|
|
92
|
+
let a = null;
|
|
90
93
|
const y = () => {
|
|
91
94
|
var e;
|
|
92
|
-
const t = document.querySelector(
|
|
95
|
+
const t = document.querySelector(ae);
|
|
93
96
|
(e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
94
97
|
}, v = async () => {
|
|
95
98
|
var t;
|
|
96
99
|
try {
|
|
97
|
-
o.initialized || o.init(
|
|
98
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "",
|
|
99
|
-
|
|
100
|
-
const
|
|
100
|
+
o.initialized || o.init(i.config), c.templateId = o.templateId;
|
|
101
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", M = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
102
|
+
b.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
103
|
+
const A = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, B = o.isFeatureEnabled("linkTrackingIds");
|
|
101
104
|
let n = {
|
|
102
|
-
html: s && await N(s,
|
|
105
|
+
html: s && await N(s, A),
|
|
103
106
|
css: d
|
|
104
107
|
};
|
|
105
|
-
n.html || (n = await
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
preselectedDynamicContentList:
|
|
108
|
+
n.html || (n = await k(), n.html = await N(n.html, A));
|
|
109
|
+
const J = B ? W(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
110
|
+
F(n.html) && (n.html = await T(n.html)), B && (c.trackIdSessionFloor = Math.max(J, W(n.html)));
|
|
111
|
+
const Q = {
|
|
112
|
+
preselectedDynamicContentList: M,
|
|
110
113
|
onReady: () => {
|
|
111
114
|
console.debug("guido:ready"), r("ready");
|
|
112
115
|
}
|
|
113
116
|
};
|
|
114
|
-
await
|
|
117
|
+
await C(n, p(), Q), u.selectedDynamicContentList = M;
|
|
115
118
|
} catch (e) {
|
|
116
119
|
console.error("Failed to initialize Stripo editor:", e);
|
|
117
120
|
}
|
|
118
121
|
};
|
|
119
|
-
return
|
|
122
|
+
return Y(async () => {
|
|
120
123
|
var e;
|
|
121
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
124
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ce().$reset(), P().$reset(), be().$reset(), y();
|
|
122
125
|
const t = (e = l.value) == null ? void 0 : e.parentElement;
|
|
123
|
-
if (t && (
|
|
126
|
+
if (t && (a = new ResizeObserver(y), a.observe(t)), D(), i.ready)
|
|
124
127
|
await v();
|
|
125
128
|
else {
|
|
126
|
-
const s = _(() =>
|
|
129
|
+
const s = _(() => i.ready, (d) => {
|
|
127
130
|
d && (s(), v());
|
|
128
131
|
});
|
|
129
132
|
}
|
|
130
133
|
document.addEventListener("dynamic-content:open", f);
|
|
131
|
-
}),
|
|
132
|
-
|
|
134
|
+
}), Z(() => {
|
|
135
|
+
a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", f);
|
|
133
136
|
try {
|
|
134
137
|
window.UIEditor.removeEditor();
|
|
135
138
|
} catch {
|
|
136
139
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
137
140
|
}
|
|
138
141
|
o.reset();
|
|
139
|
-
}),
|
|
142
|
+
}), G({
|
|
140
143
|
dynamicContent: {
|
|
141
|
-
insert:
|
|
142
|
-
close:
|
|
144
|
+
insert: R,
|
|
145
|
+
close: L
|
|
143
146
|
},
|
|
144
147
|
hasChanges: m,
|
|
145
|
-
saveSilent:
|
|
146
|
-
setLoading:
|
|
147
|
-
}), { __sfc: !0, PreviewContainer:
|
|
148
|
+
saveSilent: E,
|
|
149
|
+
setLoading: w
|
|
150
|
+
}), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: $, AssignStrategyDrawer: z, headerWrapperRef: h, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: b, props: i, configStore: o, editorStore: c, previewStore: q, hasChanges: m, isTestPartner: K, saveSilent: E, setLoading: w, emit: r, buildMetadata: p, initPlugin: C, preloadRuntime: D, getDefaultTemplate: k, cloneTimersOnSave: T, hasTimerBlocks: F, noHeader: V, isRrsSessionActive: I, isRrsEnabled: j, insertDynamicContent: R, closeDynamicContent: L, handleDynamicContentOpen: f, ribbonObserver: a, updateRibbonOffset: y, startEditor: v, AutoSaveController: de, Toaster: me, FilterSelectionDrawer: le, HeaderWrapper: ue, LoadingWrapper: pe, SaveAsTemplateDrawer: fe, UnsubscribeWrapper: ye };
|
|
148
151
|
}
|
|
149
152
|
});
|
|
150
153
|
export {
|
|
151
|
-
|
|
154
|
+
Je as default
|
|
152
155
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import a from "./AssignStrategyDrawer.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var o = function() {
|
|
5
|
+
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
6
|
+
return e(t.WpDrawer, { attrs: { id: "assign-strategy-drawer", "description-status": "", size: "medium", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.assignStrategyDrawerStatus, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { cancelOrBackButtonEvent: t.closeDrawer, onCloseEvent: t.closeDrawer, primaryButtonEvent: t.assignStrategy } }, [t.store.assignStrategyDrawerStatus ? e("div", { staticClass: "assign-strategy-drawer-content d-f f-d-c gap-16" }, [e(t.InSelect, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "search-status": "", "static-child-position": "bottom right", "button-status": !1, "dynamic-child-position": !1, "label-text": t.trans("ds-steps.recommendation-strategy"), options: t.strategyOptions, "placeholder-text": t.trans("ds-steps.select-strategy"), "skeleton-sizing": { width: 240, height: 42 }, "skeleton-status": t.store.strategiesLoading, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", value: t.selectValue }, on: { select: t.onSelect } }), t.selectedStrategy ? e("div", { key: String(t.selectedStrategy.strategy_id), staticClass: "assign-strategy-detail" }, [e(t.OrgStrategyDetailModal, { attrs: { show: "", "campaign-details-tab-status": t.campaignTabSupported, "footer-status": !1, strategy: t.selectedStrategy } })], 1) : s._e()], 1) : s._e()]);
|
|
7
|
+
}, n = [], i = /* @__PURE__ */ r(
|
|
8
|
+
a,
|
|
9
|
+
o,
|
|
10
|
+
n,
|
|
11
|
+
!1,
|
|
12
|
+
null,
|
|
13
|
+
"baee7af0"
|
|
14
|
+
);
|
|
15
|
+
const p = i.exports;
|
|
16
|
+
export {
|
|
17
|
+
p as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { defineComponent as d, ref as c, computed as o, watch as S } from "vue";
|
|
2
|
+
import "@useinsider/design-system-organisms/style";
|
|
3
|
+
import v from "../../../wrappers/WpDrawer.vue.js";
|
|
4
|
+
import { useToaster as w } from "../../../../composables/useToaster.js";
|
|
5
|
+
import { useTranslations as _ } from "../../../../composables/useTranslations.js";
|
|
6
|
+
import { URLS as T } from "../../../../enums/extensions/recommendationBlock.js";
|
|
7
|
+
import { ToasterTypeOptions as u } from "../../../../enums/toaster.js";
|
|
8
|
+
import { useRecommendationExtensionStore as D } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import { buildStrategyInfoBoxProps as E } from "../../../../utils/strategyInfoBox.js";
|
|
10
|
+
import { OrgStrategyDetailModal as x } from "@useinsider/design-system-organisms";
|
|
11
|
+
import { InSelect as A } from "@useinsider/design-system-vue";
|
|
12
|
+
const V = /* @__PURE__ */ d({
|
|
13
|
+
__name: "AssignStrategyDrawer",
|
|
14
|
+
setup(B) {
|
|
15
|
+
const r = _(), e = D(), { showToaster: n } = w(), s = c(null), a = c(!1), l = c(!1), m = o(() => e.assignStrategyDrawerStatus ? r("email-editor.assign-strategy-description", { url: T.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
|
|
16
|
+
S(() => e.assignStrategyDrawerStatus, (t) => {
|
|
17
|
+
if (!t)
|
|
18
|
+
return;
|
|
19
|
+
const { strategyId: i } = e.recommendationConfigs;
|
|
20
|
+
s.value = i || null, a.value = !1, l.value = !!window.l10n, e.fetchStrategies().catch(() => {
|
|
21
|
+
n({
|
|
22
|
+
type: u.Error,
|
|
23
|
+
message: r("discovery-strategy.error-description")
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
const p = o(() => e.strategies.map((t) => ({
|
|
28
|
+
text: t.name,
|
|
29
|
+
value: t.strategy_id,
|
|
30
|
+
infoBoxProps: E(t)
|
|
31
|
+
}))), y = o(() => [{ value: s.value }]), g = o(() => {
|
|
32
|
+
const t = e.strategies.find((i) => String(i.strategy_id) === String(s.value ?? ""));
|
|
33
|
+
return t ? { ...t, fallback_config: null } : null;
|
|
34
|
+
}), f = o(() => ({
|
|
35
|
+
primaryButton: {
|
|
36
|
+
styling: "solid",
|
|
37
|
+
type: "primary",
|
|
38
|
+
labelText: r("products.assign-btn")
|
|
39
|
+
},
|
|
40
|
+
cancelOrBackButton: {
|
|
41
|
+
styling: "ghost",
|
|
42
|
+
type: "secondary",
|
|
43
|
+
labelText: r("products.cancel")
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
return { __sfc: !0, trans: r, store: e, showToaster: n, selectedStrategyId: s, showSelectionError: a, campaignTabSupported: l, drawerDescription: m, strategyOptions: p, selectValue: y, selectedStrategy: g, footerButtonGroupOptions: f, closeDrawer: () => {
|
|
47
|
+
e.closeAssignStrategyDrawer();
|
|
48
|
+
}, assignStrategy: () => {
|
|
49
|
+
const t = g.value;
|
|
50
|
+
if (!t) {
|
|
51
|
+
a.value = !0;
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
e.assignStrategy(t), n({
|
|
55
|
+
type: u.Success,
|
|
56
|
+
message: r("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
57
|
+
}), e.closeAssignStrategyDrawer();
|
|
58
|
+
}, onSelect: (t) => {
|
|
59
|
+
s.value = t.value, a.value = !1;
|
|
60
|
+
}, WpDrawer: v, OrgStrategyDetailModal: x, InSelect: A };
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
export {
|
|
64
|
+
V as default
|
|
65
|
+
};
|
|
@@ -1,53 +1,60 @@
|
|
|
1
|
-
import { useConfigStore as
|
|
2
|
-
import {
|
|
1
|
+
import { useConfigStore as v } from "../stores/config.js";
|
|
2
|
+
import { useTemplateStore as C } from "../stores/template.js";
|
|
3
|
+
import { storeToRefs as E } from "pinia";
|
|
3
4
|
const w = () => {
|
|
4
|
-
const
|
|
5
|
-
config:
|
|
6
|
-
initialized:
|
|
7
|
-
identity:
|
|
5
|
+
const t = v(), {
|
|
6
|
+
config: r,
|
|
7
|
+
initialized: s,
|
|
8
|
+
identity: o,
|
|
8
9
|
partner: i,
|
|
9
10
|
template: a,
|
|
10
11
|
editor: n,
|
|
11
|
-
ui:
|
|
12
|
-
features:
|
|
13
|
-
blocks:
|
|
14
|
-
compiler:
|
|
15
|
-
callbacks:
|
|
12
|
+
ui: c,
|
|
13
|
+
features: l,
|
|
14
|
+
blocks: m,
|
|
15
|
+
compiler: u,
|
|
16
|
+
callbacks: d,
|
|
16
17
|
templateId: p,
|
|
17
18
|
userId: f,
|
|
18
|
-
variationId:
|
|
19
|
-
partnerName:
|
|
19
|
+
variationId: g,
|
|
20
|
+
partnerName: S,
|
|
20
21
|
productType: b,
|
|
21
|
-
messageType:
|
|
22
|
+
messageType: R,
|
|
22
23
|
username: y,
|
|
23
|
-
showHeader:
|
|
24
|
-
} =
|
|
24
|
+
showHeader: k
|
|
25
|
+
} = E(t);
|
|
25
26
|
return {
|
|
26
27
|
// State refs
|
|
27
|
-
config:
|
|
28
|
-
initialized:
|
|
28
|
+
config: r,
|
|
29
|
+
initialized: s,
|
|
29
30
|
// Section refs
|
|
30
|
-
identity:
|
|
31
|
+
identity: o,
|
|
31
32
|
partner: i,
|
|
32
33
|
template: a,
|
|
33
34
|
editor: n,
|
|
34
|
-
ui:
|
|
35
|
-
features:
|
|
36
|
-
blocks:
|
|
37
|
-
compiler:
|
|
38
|
-
callbacks:
|
|
35
|
+
ui: c,
|
|
36
|
+
features: l,
|
|
37
|
+
blocks: m,
|
|
38
|
+
compiler: u,
|
|
39
|
+
callbacks: d,
|
|
39
40
|
// Convenience refs
|
|
40
41
|
templateId: p,
|
|
41
42
|
userId: f,
|
|
42
|
-
variationId:
|
|
43
|
-
partnerName:
|
|
43
|
+
variationId: g,
|
|
44
|
+
partnerName: S,
|
|
44
45
|
productType: b,
|
|
45
|
-
messageType:
|
|
46
|
+
messageType: R,
|
|
46
47
|
username: y,
|
|
47
|
-
showHeader:
|
|
48
|
+
showHeader: k,
|
|
48
49
|
// Methods
|
|
49
|
-
getConfig: () =>
|
|
50
|
-
isFeatureEnabled: (
|
|
50
|
+
getConfig: () => r.value,
|
|
51
|
+
isFeatureEnabled: (e) => t.isFeatureEnabled(e),
|
|
52
|
+
isRrsSessionActive: () => {
|
|
53
|
+
if (!t.isFeatureEnabled("reusableRecommendationStrategy"))
|
|
54
|
+
return !1;
|
|
55
|
+
const e = C();
|
|
56
|
+
return e.hasAssignedStrategyBlocks || !e.hasPreRrsRecommendationBlocks;
|
|
57
|
+
}
|
|
51
58
|
};
|
|
52
59
|
};
|
|
53
60
|
export {
|
|
@@ -1,53 +1,67 @@
|
|
|
1
|
-
import S from "../static/
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import w from "../static/styles/components/
|
|
17
|
-
import y from "../static/styles/components/
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import S from "../static/assets/icons/line-change.svg.js";
|
|
2
|
+
import i from "../static/assets/icons/line-delete.svg.js";
|
|
3
|
+
import n from "../static/assets/icons/line-plus.svg.js";
|
|
4
|
+
import p from "../static/styles/base.css.js";
|
|
5
|
+
import s from "../static/styles/components/alert-message.css.js";
|
|
6
|
+
import C from "../static/styles/components/amp-block.css.js";
|
|
7
|
+
import a from "../static/styles/components/base-input.css.js";
|
|
8
|
+
import f from "../static/styles/components/button-group.css.js";
|
|
9
|
+
import c from "../static/styles/components/button.css.js";
|
|
10
|
+
import u from "../static/styles/components/combobox.css.js";
|
|
11
|
+
import l from "../static/styles/components/counter.css.js";
|
|
12
|
+
import d from "../static/styles/components/dropdown-menu.css.js";
|
|
13
|
+
import h from "../static/styles/components/loader.css.js";
|
|
14
|
+
import g from "../static/styles/components/narrow-panel.css.js";
|
|
15
|
+
import I from "../static/styles/components/popup.css.js";
|
|
16
|
+
import w from "../static/styles/components/recommendation-strategy.css.js";
|
|
17
|
+
import y from "../static/styles/components/switcher.css.js";
|
|
18
|
+
import b from "../static/styles/components/tabs.css.js";
|
|
19
|
+
import B from "../static/styles/components/tools.css.js";
|
|
20
|
+
import $ from "../static/styles/components/version-history.css.js";
|
|
21
|
+
import P from "../static/styles/components/wide-panel.css.js";
|
|
22
|
+
import x from "../static/styles/variables.css.js";
|
|
23
|
+
function r(t, o) {
|
|
24
|
+
return `--guido-icon-${t}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
|
|
25
|
+
}
|
|
26
|
+
const A = `:host {
|
|
27
|
+
${r("line-change", S)}
|
|
28
|
+
${r("line-delete", i)}
|
|
29
|
+
${r("line-plus", n)}
|
|
30
|
+
}`, R = [
|
|
31
|
+
x,
|
|
23
32
|
// Must be on top
|
|
24
|
-
|
|
25
|
-
e,
|
|
26
|
-
i,
|
|
33
|
+
A,
|
|
27
34
|
p,
|
|
28
|
-
|
|
35
|
+
// Must be on top
|
|
29
36
|
s,
|
|
30
37
|
C,
|
|
31
|
-
f,
|
|
32
38
|
a,
|
|
33
|
-
|
|
39
|
+
f,
|
|
34
40
|
c,
|
|
35
|
-
|
|
41
|
+
u,
|
|
36
42
|
l,
|
|
43
|
+
d,
|
|
37
44
|
h,
|
|
38
|
-
|
|
39
|
-
|
|
45
|
+
g,
|
|
46
|
+
I,
|
|
47
|
+
y,
|
|
48
|
+
b,
|
|
49
|
+
B,
|
|
50
|
+
$,
|
|
51
|
+
P,
|
|
52
|
+
w
|
|
53
|
+
// Last: overrides button.css / wide-panel.css defaults
|
|
40
54
|
].join(`
|
|
41
55
|
|
|
42
|
-
`),
|
|
56
|
+
`), Y = () => ({ importCss: () => {
|
|
43
57
|
const o = new CSSStyleSheet();
|
|
44
|
-
o.replaceSync(
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
58
|
+
o.replaceSync(R);
|
|
59
|
+
const e = document.querySelector("ui-editor");
|
|
60
|
+
if (!e)
|
|
47
61
|
return;
|
|
48
|
-
const
|
|
49
|
-
|
|
62
|
+
const m = e.shadowRoot;
|
|
63
|
+
m && (m.adoptedStyleSheets = [o]);
|
|
50
64
|
} });
|
|
51
65
|
export {
|
|
52
|
-
|
|
66
|
+
Y as useCustomInterfaceAppearance
|
|
53
67
|
};
|