@useinsider/guido 3.17.0-beta.db80c84 → 3.17.0-beta.e6704da
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 +63 -61
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +70 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue2.js +55 -0
- package/dist/composables/useCustomInterfaceAppearance.js +19 -16
- package/dist/composables/useRecommendation.js +41 -34
- package/dist/composables/useStripo.js +14 -14
- package/dist/config/migrator/index.js +8 -9
- package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
- package/dist/config/migrator/recommendation/extractors.js +24 -29
- package/dist/config/migrator/recommendation/htmlBuilder.js +130 -116
- package/dist/config/migrator/recommendationMigrator.js +15 -16
- package/dist/enums/academy.js +2 -1
- package/dist/enums/date.js +4 -3
- package/dist/enums/extensions/recommendationBlock.js +25 -23
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +28 -34
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +256 -323
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +158 -157
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +141 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +0 -1
- package/dist/extensions/Blocks/Recommendation/extension.js +29 -31
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +4 -23
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +216 -68
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +107 -85
- package/dist/extensions/Blocks/common-control.js +22 -19
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +78 -29
- 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/components/organisms/extensions/recommendation/StrategyInfoBox.vue.d.ts +24 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +0 -8
- 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/blockIds.d.ts +1 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +14 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +214 -10
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
- package/dist/src/mock/api/recommendation-strategies.d.ts +43 -0
- package/dist/src/services/recommendationApi.d.ts +4 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +171 -0
- package/dist/static/styles/customEditorStyle.css.js +1 -3
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/templatePreparation.js +37 -34
- package/package.json +2 -1
- package/dist/config/migrator/recommendationTitleMigrator.js +0 -119
- package/dist/extensions/Blocks/Recommendation/controls/title/index.js +0 -44
- package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +0 -33
- package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +0 -86
- package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +0 -13
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.configStore.isFeatureEnabled("reusableRecommendationStrategy") ? 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
|
+
"f258bc9e"
|
|
16
16
|
);
|
|
17
17
|
const l = s.exports;
|
|
18
18
|
export {
|
|
@@ -1,30 +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
|
|
8
|
-
import { migrate as
|
|
9
|
-
import { ModuleFolderDefaults as
|
|
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
|
|
22
|
-
import { useEditorStore as
|
|
23
|
-
import { usePreviewStore as
|
|
24
|
-
import { useTemplateStore as
|
|
25
|
-
import { useUnsubscribeStore as
|
|
26
|
-
import { readTrackFloor as
|
|
27
|
-
const
|
|
1
|
+
import { defineComponent as J, defineAsyncComponent as g, ref as B, computed as U, watch as _, onMounted as Q, onUnmounted as X } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as Y } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as Z } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as ee } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as te } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as oe } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as ne } from "../composables/useTimerClone.js";
|
|
8
|
+
import { migrate as A } from "../config/migrator/index.js";
|
|
9
|
+
import { ModuleFolderDefaults as N } from "../enums/defaults.js";
|
|
10
|
+
import { RIBBON_SELECTOR as re } from "../enums/onboarding.js";
|
|
11
|
+
import { useRecommendationExtensionStore as se } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
|
+
import ae from "./organisms/AutoSaveController.vue.js";
|
|
13
|
+
import ie from "./organisms/base/Toaster.vue.js";
|
|
14
|
+
import ce from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
+
import de from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import me from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import le from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import ue from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as pe } from "../services/stripoApi.js";
|
|
20
|
+
import { useConfigStore as fe } from "../stores/config.js";
|
|
21
|
+
import { useDynamicContentStore as ye } from "../stores/dynamic-content.js";
|
|
22
|
+
import { useEditorStore as O } from "../stores/editor.js";
|
|
23
|
+
import { usePreviewStore as ve } from "../stores/preview.js";
|
|
24
|
+
import { useTemplateStore as ge } from "../stores/template.js";
|
|
25
|
+
import { useUnsubscribeStore as Se } from "../stores/unsubscribe.js";
|
|
26
|
+
import { readTrackFloor as P } from "../utils/linkTrackingIds.js";
|
|
27
|
+
const qe = /* @__PURE__ */ J({
|
|
28
28
|
__name: "Guido",
|
|
29
29
|
props: {
|
|
30
30
|
config: null,
|
|
@@ -32,19 +32,21 @@ const ze = /* @__PURE__ */ j({
|
|
|
32
32
|
},
|
|
33
33
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
34
34
|
setup(W, { expose: x, emit: r }) {
|
|
35
|
-
const a = W, G =
|
|
35
|
+
const a = W, G = g(
|
|
36
36
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
37
|
-
), H =
|
|
37
|
+
), H = g(
|
|
38
38
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
39
|
-
),
|
|
39
|
+
), $ = g(
|
|
40
|
+
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
41
|
+
), S = B(), l = B(), u = ye(), h = Se(), o = fe();
|
|
40
42
|
a.ready && o.init(a.config);
|
|
41
|
-
const c =
|
|
43
|
+
const c = O(), z = ve(), m = U(() => c.hasChanges), { isTestPartner: q } = te(), b = () => {
|
|
42
44
|
var t;
|
|
43
|
-
return (t =
|
|
44
|
-
},
|
|
45
|
+
return (t = S.value) == null ? void 0 : t.handleSave(!0);
|
|
46
|
+
}, E = (t) => {
|
|
45
47
|
c.loadingStatus = t;
|
|
46
48
|
};
|
|
47
|
-
|
|
49
|
+
Y(), ee();
|
|
48
50
|
const p = () => {
|
|
49
51
|
var t, e;
|
|
50
52
|
return {
|
|
@@ -52,14 +54,14 @@ const ze = /* @__PURE__ */ j({
|
|
|
52
54
|
userId: o.userId,
|
|
53
55
|
username: o.username,
|
|
54
56
|
partnerName: o.partnerName,
|
|
55
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
56
|
-
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
57
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
|
|
58
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
|
|
57
59
|
};
|
|
58
|
-
}, { initPlugin:
|
|
60
|
+
}, { initPlugin: w, preloadRuntime: D } = oe(), { getDefaultTemplate: C } = pe(), { cloneTimersOnSave: k, hasTimerBlocks: T } = ne(), K = U(() => {
|
|
59
61
|
var t;
|
|
60
62
|
return !((t = o.ui) != null && t.showHeader);
|
|
61
63
|
});
|
|
62
|
-
|
|
64
|
+
Z({
|
|
63
65
|
onBack: () => {
|
|
64
66
|
console.debug("guido:back"), r("back");
|
|
65
67
|
},
|
|
@@ -74,9 +76,9 @@ const ze = /* @__PURE__ */ j({
|
|
|
74
76
|
console.debug("guido:test-email:click"), r("test-email:click");
|
|
75
77
|
}
|
|
76
78
|
});
|
|
77
|
-
const
|
|
79
|
+
const F = (t) => {
|
|
78
80
|
console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
79
|
-
},
|
|
81
|
+
}, I = () => {
|
|
80
82
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
81
83
|
};
|
|
82
84
|
_(() => m.value, () => {
|
|
@@ -89,38 +91,38 @@ const ze = /* @__PURE__ */ j({
|
|
|
89
91
|
let i = null;
|
|
90
92
|
const y = () => {
|
|
91
93
|
var e;
|
|
92
|
-
const t = document.querySelector(
|
|
94
|
+
const t = document.querySelector(re);
|
|
93
95
|
(e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
94
96
|
}, v = async () => {
|
|
95
97
|
var t;
|
|
96
98
|
try {
|
|
97
99
|
o.initialized || o.init(a.config), c.templateId = o.templateId;
|
|
98
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "",
|
|
99
|
-
|
|
100
|
-
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) ?? {}, R = o.isFeatureEnabled("linkTrackingIds");
|
|
101
103
|
let n = {
|
|
102
|
-
html: s && await
|
|
104
|
+
html: s && await A(s, M),
|
|
103
105
|
css: d
|
|
104
106
|
};
|
|
105
|
-
n.html || (n = await C(), n.html = await
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
preselectedDynamicContentList:
|
|
107
|
+
n.html || (n = await C(), n.html = await A(n.html, M));
|
|
108
|
+
const V = R ? P(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
109
|
+
T(n.html) && (n.html = await k(n.html)), R && (c.trackIdSessionFloor = Math.max(V, P(n.html)));
|
|
110
|
+
const j = {
|
|
111
|
+
preselectedDynamicContentList: L,
|
|
110
112
|
onReady: () => {
|
|
111
113
|
console.debug("guido:ready"), r("ready");
|
|
112
114
|
}
|
|
113
115
|
};
|
|
114
|
-
await
|
|
116
|
+
await w(n, p(), j), u.selectedDynamicContentList = L;
|
|
115
117
|
} catch (e) {
|
|
116
118
|
console.error("Failed to initialize Stripo editor:", e);
|
|
117
119
|
}
|
|
118
120
|
};
|
|
119
|
-
return
|
|
121
|
+
return Q(async () => {
|
|
120
122
|
var e;
|
|
121
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
123
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), se().$reset(), O().$reset(), ge().$reset(), y();
|
|
122
124
|
const t = (e = l.value) == null ? void 0 : e.parentElement;
|
|
123
|
-
if (t && (i = new ResizeObserver(y), i.observe(t)),
|
|
125
|
+
if (t && (i = new ResizeObserver(y), i.observe(t)), D(), a.ready)
|
|
124
126
|
await v();
|
|
125
127
|
else {
|
|
126
128
|
const s = _(() => a.ready, (d) => {
|
|
@@ -128,7 +130,7 @@ const ze = /* @__PURE__ */ j({
|
|
|
128
130
|
});
|
|
129
131
|
}
|
|
130
132
|
document.addEventListener("dynamic-content:open", f);
|
|
131
|
-
}),
|
|
133
|
+
}), X(() => {
|
|
132
134
|
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", f);
|
|
133
135
|
try {
|
|
134
136
|
window.UIEditor.removeEditor();
|
|
@@ -138,15 +140,15 @@ const ze = /* @__PURE__ */ j({
|
|
|
138
140
|
o.reset();
|
|
139
141
|
}), x({
|
|
140
142
|
dynamicContent: {
|
|
141
|
-
insert:
|
|
142
|
-
close:
|
|
143
|
+
insert: F,
|
|
144
|
+
close: I
|
|
143
145
|
},
|
|
144
146
|
hasChanges: m,
|
|
145
|
-
saveSilent:
|
|
146
|
-
setLoading:
|
|
147
|
-
}), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, headerWrapperRef:
|
|
147
|
+
saveSilent: b,
|
|
148
|
+
setLoading: E
|
|
149
|
+
}), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, AssignStrategyDrawer: $, headerWrapperRef: S, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: h, props: a, configStore: o, editorStore: c, previewStore: z, hasChanges: m, isTestPartner: q, saveSilent: b, setLoading: E, emit: r, buildMetadata: p, initPlugin: w, preloadRuntime: D, getDefaultTemplate: C, cloneTimersOnSave: k, hasTimerBlocks: T, noHeader: K, insertDynamicContent: F, closeDynamicContent: I, handleDynamicContentOpen: f, ribbonObserver: i, updateRibbonOffset: y, startEditor: v, AutoSaveController: ae, Toaster: ie, FilterSelectionDrawer: ce, HeaderWrapper: de, LoadingWrapper: me, SaveAsTemplateDrawer: le, UnsubscribeWrapper: ue };
|
|
148
150
|
}
|
|
149
151
|
});
|
|
150
152
|
export {
|
|
151
|
-
|
|
153
|
+
qe as default
|
|
152
154
|
};
|
|
@@ -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 n = 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" }, [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, 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
|
+
}, o = [], i = /* @__PURE__ */ r(
|
|
8
|
+
a,
|
|
9
|
+
n,
|
|
10
|
+
o,
|
|
11
|
+
!1,
|
|
12
|
+
null,
|
|
13
|
+
"710137fe"
|
|
14
|
+
);
|
|
15
|
+
const p = i.exports;
|
|
16
|
+
export {
|
|
17
|
+
p as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { defineComponent as v, ref as c, computed as o, watch as _ } from "vue";
|
|
2
|
+
import "@useinsider/design-system-organisms/style";
|
|
3
|
+
import w from "../../../wrappers/WpDrawer.vue.js";
|
|
4
|
+
import { useToaster as D } from "../../../../composables/useToaster.js";
|
|
5
|
+
import { useTranslations as T } from "../../../../composables/useTranslations.js";
|
|
6
|
+
import { ToasterTypeOptions as m } from "../../../../enums/toaster.js";
|
|
7
|
+
import { useRecommendationExtensionStore as b } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
8
|
+
import { OrgStrategyDetailModal as h } from "@useinsider/design-system-organisms";
|
|
9
|
+
import { InSelect as x } from "@useinsider/design-system-vue";
|
|
10
|
+
import B from "./StrategyInfoBox.vue.js";
|
|
11
|
+
const W = /* @__PURE__ */ v({
|
|
12
|
+
__name: "AssignStrategyDrawer",
|
|
13
|
+
setup(A) {
|
|
14
|
+
const g = "/discovery/recommendation-strategies", s = T(), e = b(), { showToaster: n } = D(), r = c(null), a = c(!1), u = c(!1), p = o(() => e.assignStrategyDrawerStatus ? s("email-editor.assign-strategy-description", { url: g }) : "");
|
|
15
|
+
_(() => e.assignStrategyDrawerStatus, (t) => {
|
|
16
|
+
if (!t)
|
|
17
|
+
return;
|
|
18
|
+
const { strategyId: l } = e.recommendationConfigs;
|
|
19
|
+
r.value = l || null, u.value = !!window.l10n, e.fetchStrategies().catch((S) => {
|
|
20
|
+
console.error("fetchStrategies error:", S), n({
|
|
21
|
+
type: m.Error,
|
|
22
|
+
message: s("discovery-strategy.error-description")
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
const d = o(() => e.strategies.map((t) => ({
|
|
27
|
+
text: t.name,
|
|
28
|
+
value: t.strategy_id,
|
|
29
|
+
infoBoxProps: {
|
|
30
|
+
id: `strategy-info-${t.strategy_id}`,
|
|
31
|
+
theme: "light",
|
|
32
|
+
variant: "information",
|
|
33
|
+
className: "assign-strategy-info-box",
|
|
34
|
+
slot: B,
|
|
35
|
+
slotProps: { strategy: t }
|
|
36
|
+
}
|
|
37
|
+
}))), y = o(() => [{ value: r.value }]), i = o(() => {
|
|
38
|
+
const t = e.strategies.find((l) => String(l.strategy_id) === String(r.value ?? ""));
|
|
39
|
+
return t ? { ...t, fallback_config: null } : null;
|
|
40
|
+
}), f = o(() => ({
|
|
41
|
+
primaryButton: {
|
|
42
|
+
styling: "solid",
|
|
43
|
+
type: "primary",
|
|
44
|
+
labelText: s("products.assign-btn"),
|
|
45
|
+
loadingStatus: a.value,
|
|
46
|
+
disabledStatus: !i.value
|
|
47
|
+
},
|
|
48
|
+
cancelOrBackButton: {
|
|
49
|
+
styling: "ghost",
|
|
50
|
+
type: "secondary",
|
|
51
|
+
labelText: s("products.cancel"),
|
|
52
|
+
disabledStatus: a.value
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
55
|
+
return { __sfc: !0, RRS_PANEL_PATH: g, trans: s, store: e, showToaster: n, selectedStrategyId: r, isAssigning: a, campaignTabSupported: u, drawerDescription: p, strategyOptions: d, selectValue: y, selectedStrategy: i, footerButtonGroupOptions: f, closeDrawer: () => {
|
|
56
|
+
e.closeAssignStrategyDrawer();
|
|
57
|
+
}, assignStrategy: () => {
|
|
58
|
+
const t = i.value;
|
|
59
|
+
t && (a.value = !0, e.assignStrategy(t), n({
|
|
60
|
+
type: m.Success,
|
|
61
|
+
message: s("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
62
|
+
}), e.closeAssignStrategyDrawer(), a.value = !1);
|
|
63
|
+
}, onSelect: (t) => {
|
|
64
|
+
r.value = t.value;
|
|
65
|
+
}, WpDrawer: w, OrgStrategyDetailModal: h, InSelect: x };
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
export {
|
|
69
|
+
W as default
|
|
70
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import _ from "./StrategyInfoBox.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var r = function() {
|
|
5
|
+
var t = this, s = t._self._c, a = t._self._setupProxy;
|
|
6
|
+
return s("div", { staticClass: "strategy-info-box" }, [s("div", { staticClass: "strategy-info-box__name" }, [t._v(" " + t._s(t.strategy.name) + " ")]), a.lastUpdated ? s("div", { staticClass: "strategy-info-box__updated" }, [t._v(" " + t._s(a.lastUpdated) + " ")]) : t._e(), s("div", { staticClass: "strategy-info-box__rows" }, t._l(a.rows, function(e) {
|
|
7
|
+
return s("div", { key: e.label, staticClass: "strategy-info-box__row" }, [s("div", { staticClass: "strategy-info-box__label" }, [t._v(" " + t._s(e.label) + " ")]), s("div", { staticClass: "strategy-info-box__value" }, [t._v(" " + t._s(e.value) + " ")])]);
|
|
8
|
+
}), 0)]);
|
|
9
|
+
}, i = [], n = /* @__PURE__ */ o(
|
|
10
|
+
_,
|
|
11
|
+
r,
|
|
12
|
+
i,
|
|
13
|
+
!1,
|
|
14
|
+
null,
|
|
15
|
+
"fe4491e6"
|
|
16
|
+
);
|
|
17
|
+
const d = n.exports;
|
|
18
|
+
export {
|
|
19
|
+
d as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { defineComponent as v, computed as s } from "vue";
|
|
2
|
+
import { useTranslations as h } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { formatShortDate as f } from "../../../../utils/dateUtil.js";
|
|
4
|
+
const A = /* @__PURE__ */ v({
|
|
5
|
+
__name: "StrategyInfoBox",
|
|
6
|
+
props: {
|
|
7
|
+
strategy: null
|
|
8
|
+
},
|
|
9
|
+
setup(g) {
|
|
10
|
+
const t = g, r = h(), n = (e) => e == null ? "" : String(e), y = s(() => {
|
|
11
|
+
const e = n(t.strategy.updated_at || t.strategy.created_at);
|
|
12
|
+
return e ? r("recommendation-strategy.last-updated-on", { value: f(e) }) : "";
|
|
13
|
+
}), c = s(() => {
|
|
14
|
+
const e = n(t.strategy.algorithm) === "MIXED" ? r("discovery-strategy.mixed-algorithm") : r("discovery-strategy.single-algorithm"), a = n(t.strategy.algorithm_used).split(",").map((o) => o.trim()).filter(Boolean).map((o) => r(`recommendation-algorithm-names.${o.replaceAll("_", "-").toLowerCase()}`));
|
|
15
|
+
return a.length ? `${e} · ${a.join(", ")}` : e;
|
|
16
|
+
}), u = s(() => [
|
|
17
|
+
[t.strategy.exclude_view, "discovery-strategy.exclude-recently-view-items"],
|
|
18
|
+
[t.strategy.exclude_purchase, "discovery-strategy.exclude-recently-purchased-items"],
|
|
19
|
+
[t.strategy.exclude_cart, "discovery-strategy.exclude-recently-added-cart-items"]
|
|
20
|
+
].filter(([a]) => Number(a) === 1).map(([, a]) => r(a)).join(", ")), d = s(() => n(
|
|
21
|
+
t.strategy.manual_merchandising || t.strategy.manual_merchandising_products
|
|
22
|
+
).trim()), i = s(() => {
|
|
23
|
+
const e = t.strategy.filters;
|
|
24
|
+
if (!e)
|
|
25
|
+
return 0;
|
|
26
|
+
try {
|
|
27
|
+
const a = typeof e == "string" ? JSON.parse(e) : e;
|
|
28
|
+
return Array.isArray(a) ? a.reduce((o, m) => o + (Array.isArray(m) ? m.length : 1), 0) : 0;
|
|
29
|
+
} catch {
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
}), l = s(() => r("recommendation-strategy.none")), p = s(() => [
|
|
33
|
+
{
|
|
34
|
+
label: r("gpt-app-builder.algorithms-and-method"),
|
|
35
|
+
value: c.value
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: r("gpt-app-builder.exclusions"),
|
|
39
|
+
value: u.value || l.value
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: r("discovery-strategy.filters"),
|
|
43
|
+
value: i.value ? String(i.value) : l.value
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: r("action-builder.manual-merchandising"),
|
|
47
|
+
value: d.value || l.value
|
|
48
|
+
}
|
|
49
|
+
]);
|
|
50
|
+
return { __sfc: !0, props: t, trans: r, asText: n, lastUpdated: y, algorithmsAndMethod: c, exclusions: u, manualMerchandising: d, filterCount: i, none: l, rows: p };
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
export {
|
|
54
|
+
A as default
|
|
55
|
+
};
|
|
@@ -4,20 +4,21 @@ import e from "../static/styles/components/amp-block.css.js";
|
|
|
4
4
|
import i from "../static/styles/components/base-input.css.js";
|
|
5
5
|
import p from "../static/styles/components/button-group.css.js";
|
|
6
6
|
import n from "../static/styles/components/button.css.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import C from "../static/styles/components/combobox.css.js";
|
|
8
|
+
import s from "../static/styles/components/counter.css.js";
|
|
9
9
|
import f from "../static/styles/components/dropdown-menu.css.js";
|
|
10
10
|
import a from "../static/styles/components/loader.css.js";
|
|
11
11
|
import u from "../static/styles/components/narrow-panel.css.js";
|
|
12
12
|
import c from "../static/styles/components/popup.css.js";
|
|
13
|
-
import d from "../static/styles/components/
|
|
14
|
-
import l from "../static/styles/components/
|
|
15
|
-
import h from "../static/styles/components/
|
|
16
|
-
import w from "../static/styles/components/
|
|
17
|
-
import y from "../static/styles/components/
|
|
18
|
-
import B from "../static/styles/
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
import d from "../static/styles/components/recommendation-strategy.css.js";
|
|
14
|
+
import l from "../static/styles/components/switcher.css.js";
|
|
15
|
+
import h from "../static/styles/components/tabs.css.js";
|
|
16
|
+
import w from "../static/styles/components/tools.css.js";
|
|
17
|
+
import y from "../static/styles/components/version-history.css.js";
|
|
18
|
+
import B from "../static/styles/components/wide-panel.css.js";
|
|
19
|
+
import b from "../static/styles/variables.css.js";
|
|
20
|
+
const A = [
|
|
21
|
+
b,
|
|
21
22
|
// Must be on top
|
|
22
23
|
S,
|
|
23
24
|
// Must be on top
|
|
@@ -26,22 +27,24 @@ const b = [
|
|
|
26
27
|
i,
|
|
27
28
|
p,
|
|
28
29
|
n,
|
|
29
|
-
s,
|
|
30
30
|
C,
|
|
31
|
+
s,
|
|
31
32
|
f,
|
|
32
33
|
a,
|
|
33
34
|
u,
|
|
34
35
|
c,
|
|
35
|
-
d,
|
|
36
36
|
l,
|
|
37
37
|
h,
|
|
38
38
|
w,
|
|
39
|
-
y
|
|
39
|
+
y,
|
|
40
|
+
B,
|
|
41
|
+
d
|
|
42
|
+
// Last: overrides button.css / wide-panel.css defaults
|
|
40
43
|
].join(`
|
|
41
44
|
|
|
42
|
-
`),
|
|
45
|
+
`), F = () => ({ importCss: () => {
|
|
43
46
|
const o = new CSSStyleSheet();
|
|
44
|
-
o.replaceSync(
|
|
47
|
+
o.replaceSync(A);
|
|
45
48
|
const r = document.querySelector("ui-editor");
|
|
46
49
|
if (!r)
|
|
47
50
|
return;
|
|
@@ -49,5 +52,5 @@ const b = [
|
|
|
49
52
|
t && (t.adoptedStyleSheets = [o]);
|
|
50
53
|
} });
|
|
51
54
|
export {
|
|
52
|
-
|
|
55
|
+
F as useCustomInterfaceAppearance
|
|
53
56
|
};
|