@useinsider/guido 3.12.0-beta.840207a → 3.12.0-beta.841bb6a
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/@types/config/schemas.js +8 -13
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +49 -50
- package/dist/composables/useRecommendation.js +51 -82
- package/dist/config/migrator/recommendationMigrator.js +4 -7
- package/dist/enums/date.js +3 -4
- package/dist/enums/extensions/recommendationBlock.js +22 -28
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +11 -12
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +109 -123
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +1 -1
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +102 -256
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -24
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +29 -72
- package/dist/src/@types/config/schemas.d.ts +0 -10
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useRecommendation.d.ts +0 -2
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -3
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -606
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +1 -3
- package/dist/src/services/recommendationApi.d.ts +1 -7
- package/dist/src/stores/config.d.ts +0 -18
- package/dist/src/utils/genericUtil.d.ts +0 -9
- package/dist/static/styles/base.css.js +0 -15
- package/dist/utils/dateUtil.js +10 -23
- package/dist/utils/genericUtil.js +1 -10
- package/dist/utils/pairProductVariables.js +44 -43
- package/dist/utils/templatePreparation.js +58 -62
- package/package.json +1 -1
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +0 -36
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +0 -244
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.js +0 -18
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue2.js +0 -42
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.js +0 -20
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue2.js +0 -18
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.js +0 -20
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue2.js +0 -60
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.js +0 -19
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue2.js +0 -19
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.js +0 -22
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue2.js +0 -29
- package/dist/composables/useStrategyFilters.js +0 -16
- package/dist/enums/extensions/filteringV2.js +0 -8
- package/dist/enums/extensions/strategyDetail.js +0 -148
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -146
- package/dist/extensions/Blocks/Recommendation/utils/strategyHumanizer.js +0 -97
- package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +0 -10
- package/dist/src/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.d.ts +0 -2
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.d.ts +0 -43
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.d.ts +0 -29
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.d.ts +0 -40
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.d.ts +0 -38
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.d.ts +0 -51
- package/dist/src/composables/useStrategyFilters.d.ts +0 -24
- package/dist/src/enums/extensions/filteringV2.d.ts +0 -72
- package/dist/src/enums/extensions/strategyDetail.d.ts +0 -90
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -61
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyHumanizer.d.ts +0 -50
- package/dist/src/extensions/Blocks/Recommendation/utils/strategySummary.d.ts +0 -34
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
|
|
2
|
-
import { object as a, number as n, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as
|
|
2
|
+
import { object as a, number as n, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as f, boolean as o, array as c, record as k, fallback as C, literal as i, looseObject as g, variant as R, union as h, unknown as s, lazy as T } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const d = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -78,12 +78,12 @@ const d = {
|
|
|
78
78
|
select_items: e(c(S))
|
|
79
79
|
})), P = k(
|
|
80
80
|
t(),
|
|
81
|
-
|
|
81
|
+
C(c(S), [])
|
|
82
82
|
), D = g({
|
|
83
83
|
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
84
84
|
id: e(n()),
|
|
85
85
|
/** Decimal places for price display (legacy data may use string or number) */
|
|
86
|
-
decimalCount: e(
|
|
86
|
+
decimalCount: e(h([t(), n()])),
|
|
87
87
|
/** Pinned product IDs (empty array when filter-driven) */
|
|
88
88
|
productIds: e(c(s())),
|
|
89
89
|
/** Whether the block requested live products at send time */
|
|
@@ -117,7 +117,7 @@ const d = {
|
|
|
117
117
|
/** Block type marker used by some legacy variants */
|
|
118
118
|
blockType: e(t()),
|
|
119
119
|
/** Size variant marker (legacy data may use string or number) */
|
|
120
|
-
size: e(
|
|
120
|
+
size: e(h([t(), n()])),
|
|
121
121
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
122
122
|
verticalResponsiveness: e(o()),
|
|
123
123
|
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
@@ -201,12 +201,7 @@ const d = {
|
|
|
201
201
|
/** Enable Liquid template syntax */
|
|
202
202
|
liquidSyntax: e(o(), !1),
|
|
203
203
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
204
|
-
autosave: e(o(), !1)
|
|
205
|
-
/**
|
|
206
|
-
* Select a Reusable Recommendation Strategy (RRS) instead of a per-block algorithm.
|
|
207
|
-
* Replaces the algorithm dropdown with a strategy dropdown fed from Smart Recommender.
|
|
208
|
-
*/
|
|
209
|
-
reusableRecommendationStrategy: e(o(), !1)
|
|
204
|
+
autosave: e(o(), !1)
|
|
210
205
|
}), U = l([
|
|
211
206
|
"amp-accordion",
|
|
212
207
|
"amp-carousel",
|
|
@@ -274,11 +269,11 @@ const d = {
|
|
|
274
269
|
...m.entries,
|
|
275
270
|
type: i("custom"),
|
|
276
271
|
/** Custom processor function */
|
|
277
|
-
processor:
|
|
272
|
+
processor: f(
|
|
278
273
|
(u) => typeof u == "function",
|
|
279
274
|
"processor must be a function"
|
|
280
275
|
)
|
|
281
|
-
}), G =
|
|
276
|
+
}), G = R("type", [
|
|
282
277
|
H,
|
|
283
278
|
_,
|
|
284
279
|
j,
|
|
@@ -294,7 +289,7 @@ const d = {
|
|
|
294
289
|
* Return false to cancel the save operation.
|
|
295
290
|
*/
|
|
296
291
|
externalValidation: e(
|
|
297
|
-
|
|
292
|
+
f(
|
|
298
293
|
(u) => typeof u == "function",
|
|
299
294
|
"externalValidation must be a function"
|
|
300
295
|
)
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
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.
|
|
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) {
|
|
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__ */ a(
|
|
10
|
+
i,
|
|
11
11
|
t,
|
|
12
12
|
n,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"50dac6de"
|
|
16
16
|
);
|
|
17
17
|
const l = s.exports;
|
|
18
18
|
export {
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
import { defineComponent as X, defineAsyncComponent as I, ref as W, computed as x, watch as Y, onMounted as Z, onUnmounted as ee } from "vue";
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { provideGuidoActions as
|
|
2
|
+
import { useCortexBlueprintBridge as oe } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as te } from "../composables/useGuidoActions.js";
|
|
4
4
|
import { useGuidoStateBridge as ne } from "../composables/useGuidoStateBridge.js";
|
|
5
5
|
import { usePartner as re } from "../composables/usePartner.js";
|
|
6
6
|
import { useStripo as se } from "../composables/useStripo.js";
|
|
7
7
|
import { useTimerClone as ae } from "../composables/useTimerClone.js";
|
|
8
8
|
import { migrate as G } from "../config/migrator/index.js";
|
|
9
9
|
import { ModuleFolderDefaults as H } from "../enums/defaults.js";
|
|
10
|
-
import { RIBBON_SELECTOR as
|
|
11
|
-
import { useRecommendationExtensionStore as
|
|
10
|
+
import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
|
|
11
|
+
import { useRecommendationExtensionStore as ie } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
12
|
import me from "./organisms/AutoSaveController.vue.js";
|
|
13
13
|
import de from "./organisms/base/Toaster.vue.js";
|
|
14
14
|
import le from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
-
import ue from "./organisms/
|
|
16
|
-
import pe from "./organisms/
|
|
17
|
-
import fe from "./organisms/
|
|
18
|
-
import ve from "./organisms/
|
|
19
|
-
import Se from "
|
|
20
|
-
import {
|
|
21
|
-
import { useConfigStore as ge } from "../stores/config.js";
|
|
15
|
+
import ue from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import pe from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import ve from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as Se } from "../services/stripoApi.js";
|
|
20
|
+
import { useConfigStore as ye } from "../stores/config.js";
|
|
22
21
|
import { useDynamicContentStore as he } from "../stores/dynamic-content.js";
|
|
23
22
|
import { useEditorStore as $ } from "../stores/editor.js";
|
|
24
|
-
import { usePreviewStore as
|
|
25
|
-
import { useTemplateStore as
|
|
26
|
-
import { useUnsubscribeStore as
|
|
27
|
-
const
|
|
23
|
+
import { usePreviewStore as ge } from "../stores/preview.js";
|
|
24
|
+
import { useTemplateStore as be } from "../stores/template.js";
|
|
25
|
+
import { useUnsubscribeStore as Ee } from "../stores/unsubscribe.js";
|
|
26
|
+
const Ve = /* @__PURE__ */ X({
|
|
28
27
|
__name: "Guido",
|
|
29
28
|
props: {
|
|
30
29
|
config: null
|
|
@@ -35,11 +34,11 @@ const Je = /* @__PURE__ */ X({
|
|
|
35
34
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
36
35
|
), V = I(
|
|
37
36
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
38
|
-
),
|
|
39
|
-
|
|
40
|
-
const m = $(), j =
|
|
37
|
+
), E = W(), p = W(), f = he(), w = Ee(), i = ye();
|
|
38
|
+
i.init(b.config);
|
|
39
|
+
const m = $(), j = ge(), d = x(() => m.hasChanges), { isTestPartner: J } = re(), D = () => {
|
|
41
40
|
var e;
|
|
42
|
-
return (e =
|
|
41
|
+
return (e = E.value) == null ? void 0 : e.handleSave(!0);
|
|
43
42
|
}, C = (e) => {
|
|
44
43
|
m.loadingStatus = e;
|
|
45
44
|
}, {
|
|
@@ -47,10 +46,10 @@ const Je = /* @__PURE__ */ X({
|
|
|
47
46
|
userId: T,
|
|
48
47
|
partnerName: L,
|
|
49
48
|
username: k,
|
|
50
|
-
template:
|
|
49
|
+
template: o,
|
|
51
50
|
editor: s
|
|
52
|
-
} =
|
|
53
|
-
|
|
51
|
+
} = i, l = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", S = (o == null ? void 0 : o.preselectedDynamicContent) || [], U = (s == null ? void 0 : s.savedModulesFolderName) || H.SAVED_MODULES, _ = (s == null ? void 0 : s.defaultModulesFolderName) || H.DEFAULT_MODULES;
|
|
52
|
+
oe(), ne();
|
|
54
53
|
const y = {
|
|
55
54
|
emailId: v,
|
|
56
55
|
userId: T,
|
|
@@ -63,11 +62,11 @@ const Je = /* @__PURE__ */ X({
|
|
|
63
62
|
onReady: () => {
|
|
64
63
|
console.debug("guido:ready"), n("ready");
|
|
65
64
|
}
|
|
66
|
-
}, { initPlugin: O } = se(y, M), { getDefaultTemplate: P } =
|
|
65
|
+
}, { initPlugin: O } = se(y, M), { getDefaultTemplate: P } = Se(), { cloneTimersOnSave: R, hasTimerBlocks: A } = ae(), Q = x(() => {
|
|
67
66
|
var e;
|
|
68
|
-
return !((e =
|
|
67
|
+
return !((e = i.ui) != null && e.showHeader);
|
|
69
68
|
});
|
|
70
|
-
|
|
69
|
+
te({
|
|
71
70
|
onBack: () => {
|
|
72
71
|
console.debug("guido:back"), n("back");
|
|
73
72
|
},
|
|
@@ -75,8 +74,8 @@ const Je = /* @__PURE__ */ X({
|
|
|
75
74
|
console.debug("guido:save:start"), n("save:start");
|
|
76
75
|
},
|
|
77
76
|
onSaveComplete: (e) => {
|
|
78
|
-
const
|
|
79
|
-
console.debug("guido:save:complete",
|
|
77
|
+
const t = { ...e, metadata: y };
|
|
78
|
+
console.debug("guido:save:complete", t), n("save:complete", t);
|
|
80
79
|
},
|
|
81
80
|
onTestEmailClick: () => {
|
|
82
81
|
console.debug("guido:test-email:click"), n("test-email:click");
|
|
@@ -90,52 +89,52 @@ const Je = /* @__PURE__ */ X({
|
|
|
90
89
|
Y(() => d.value, () => {
|
|
91
90
|
n("on-change", d.value);
|
|
92
91
|
});
|
|
93
|
-
const
|
|
94
|
-
const
|
|
95
|
-
console.debug("dynamic-content:open",
|
|
92
|
+
const h = (e) => {
|
|
93
|
+
const t = e, { attribute: u, position: c } = t.detail;
|
|
94
|
+
console.debug("dynamic-content:open", t.detail), n("dynamic-content:open", u, c);
|
|
96
95
|
};
|
|
97
96
|
let a = null;
|
|
98
|
-
const
|
|
99
|
-
var
|
|
100
|
-
const e = document.querySelector(
|
|
101
|
-
(
|
|
97
|
+
const g = () => {
|
|
98
|
+
var t;
|
|
99
|
+
const e = document.querySelector(ce);
|
|
100
|
+
(t = p.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
|
|
102
101
|
};
|
|
103
102
|
return Z(async () => {
|
|
104
|
-
var
|
|
105
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
106
|
-
const e = (
|
|
107
|
-
e && (a = new ResizeObserver(
|
|
103
|
+
var t, u;
|
|
104
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ie().$reset(), $().$reset(), m.templateId = v, be().$reset(), g();
|
|
105
|
+
const e = (t = p.value) == null ? void 0 : t.parentElement;
|
|
106
|
+
e && (a = new ResizeObserver(g), a.observe(e));
|
|
108
107
|
try {
|
|
109
|
-
|
|
110
|
-
const
|
|
108
|
+
w.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
109
|
+
const c = ((u = o == null ? void 0 : o.migration) == null ? void 0 : u.recommendationConfigs) ?? {};
|
|
111
110
|
let r = {
|
|
112
|
-
html: l && await G(l,
|
|
111
|
+
html: l && await G(l, c),
|
|
113
112
|
css: F
|
|
114
113
|
};
|
|
115
|
-
r.html || (r = await P(), r.html = await G(r.html,
|
|
116
|
-
} catch (
|
|
117
|
-
console.error("Failed to initialize Stripo editor:",
|
|
114
|
+
r.html || (r = await P(), r.html = await G(r.html, c)), A(r.html) && (r.html = await R(r.html)), await O(r), f.selectedDynamicContentList = S;
|
|
115
|
+
} catch (c) {
|
|
116
|
+
console.error("Failed to initialize Stripo editor:", c);
|
|
118
117
|
}
|
|
119
|
-
document.addEventListener("dynamic-content:open",
|
|
118
|
+
document.addEventListener("dynamic-content:open", h);
|
|
120
119
|
}), ee(() => {
|
|
121
|
-
a == null || a.disconnect(), document.removeEventListener("dynamic-content:open",
|
|
120
|
+
a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", h);
|
|
122
121
|
try {
|
|
123
122
|
window.UIEditor.removeEditor();
|
|
124
123
|
} catch {
|
|
125
124
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
126
125
|
}
|
|
127
|
-
|
|
126
|
+
i.reset();
|
|
128
127
|
}), q({
|
|
129
128
|
dynamicContent: {
|
|
130
129
|
insert: B,
|
|
131
130
|
close: N
|
|
132
131
|
},
|
|
133
132
|
hasChanges: d,
|
|
134
|
-
saveSilent:
|
|
133
|
+
saveSilent: D,
|
|
135
134
|
setLoading: C
|
|
136
|
-
}), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, headerWrapperRef:
|
|
135
|
+
}), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: b, configStore: i, editorStore: m, previewStore: j, hasChanges: d, isTestPartner: J, saveSilent: D, setLoading: C, templateId: v, userId: T, partnerName: L, username: k, templateConfig: o, editorConfig: s, html: l, css: F, preselectedDynamicContentList: S, savedModulesFolderName: U, defaultModulesFolderName: _, emit: n, metadata: y, options: M, initPlugin: O, getDefaultTemplate: P, cloneTimersOnSave: R, hasTimerBlocks: A, noHeader: Q, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: h, ribbonObserver: a, updateRibbonOffset: g, AutoSaveController: me, Toaster: de, FilterSelectionDrawer: le, HeaderWrapper: ue, LoadingWrapper: pe, SaveAsTemplateDrawer: fe, UnsubscribeWrapper: ve };
|
|
137
136
|
}
|
|
138
137
|
});
|
|
139
138
|
export {
|
|
140
|
-
|
|
139
|
+
Ve as default
|
|
141
140
|
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { getRecommendationFeedSourceMaps as
|
|
2
|
-
import { MinDeviceViewport as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
4
|
-
import { generateCompleteFilterQuery as
|
|
5
|
-
import { getPartnerRecommendationParams as
|
|
6
|
-
import { useConfigStore as
|
|
7
|
-
const
|
|
8
|
-
|
|
1
|
+
import { getRecommendationFeedSourceMaps as I, URLS as R } from "../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { MinDeviceViewport as C, DefaultPadding as b } from "../enums/recommendation.js";
|
|
3
|
+
import { useRecommendationExtensionStore as l } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
|
+
import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
5
|
+
import { getPartnerRecommendationParams as y } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
|
|
6
|
+
import { useConfigStore as x } from "../stores/config.js";
|
|
7
|
+
const k = () => ({
|
|
8
|
+
calculateCardWidth: ({
|
|
9
9
|
mobileLeftPadding: a,
|
|
10
|
-
mobileRightPadding:
|
|
11
|
-
cardsInRow:
|
|
12
|
-
unresponsive:
|
|
10
|
+
mobileRightPadding: s,
|
|
11
|
+
cardsInRow: c,
|
|
12
|
+
unresponsive: o
|
|
13
13
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
return (
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const r = o ? c : 1, e = a + s + (r - 1) * b;
|
|
15
|
+
return (C - e) / r;
|
|
16
|
+
},
|
|
17
|
+
getRecommendationCampaignData: (a) => {
|
|
18
|
+
const s = l(), c = Number(a), o = s.blockStates[c];
|
|
19
|
+
if (!o)
|
|
19
20
|
return {
|
|
20
21
|
textTrimming: !1,
|
|
21
22
|
orientation: "vertical",
|
|
@@ -28,81 +29,49 @@ const M = () => {
|
|
|
28
29
|
discountBeforeTextValue: "",
|
|
29
30
|
discountAfterTextValue: ""
|
|
30
31
|
};
|
|
31
|
-
const { recommendationConfigs:
|
|
32
|
+
const { recommendationConfigs: r } = o, e = r.orientation === "grid" ? "vertical" : "horizontal";
|
|
32
33
|
return {
|
|
33
|
-
textTrimming:
|
|
34
|
+
textTrimming: r.textTrimming,
|
|
34
35
|
orientation: e,
|
|
35
36
|
mobileLeftPadding: 0,
|
|
36
37
|
mobileRightPadding: 0,
|
|
37
|
-
cardsInRow:
|
|
38
|
-
unresponsive:
|
|
38
|
+
cardsInRow: r.cardsInRow,
|
|
39
|
+
unresponsive: r.unresponsive,
|
|
39
40
|
priceBeforeTextValue: "",
|
|
40
41
|
priceAfterTextValue: "",
|
|
41
42
|
discountBeforeTextValue: "",
|
|
42
43
|
discountAfterTextValue: ""
|
|
43
44
|
};
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
let e;
|
|
66
|
-
if (c)
|
|
67
|
-
e = c;
|
|
68
|
-
else {
|
|
69
|
-
const o = s.blockStates[n];
|
|
70
|
-
if (!o)
|
|
71
|
-
return "";
|
|
72
|
-
const { recommendationConfigs: i } = o;
|
|
73
|
-
e = {
|
|
74
|
-
strategy: i.strategy,
|
|
75
|
-
strategyId: i.strategyId,
|
|
76
|
-
language: i.language,
|
|
77
|
-
currencyCode: i.currencySettings.value,
|
|
78
|
-
size: i.size,
|
|
79
|
-
productIds: i.productIds,
|
|
80
|
-
filters: i.filters,
|
|
81
|
-
shuffleProducts: i.shuffleProducts
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
const d = e.strategyId ? s.strategyUrlTemplates[e.strategyId] : "";
|
|
85
|
-
if (d) {
|
|
86
|
-
const o = y(d, {
|
|
87
|
-
LOCALE: e.language,
|
|
88
|
-
CURRENCY: e.currencyCode,
|
|
89
|
-
CAMPAIGN_ID: r.variationId,
|
|
90
|
-
STRATEGY_ID: e.strategyId,
|
|
91
|
-
CLIENT_ID: "6KcLM9TwheVB1mgK",
|
|
92
|
-
USER_ID: "{user_id}",
|
|
93
|
-
ITEM_ID: "{itemId}"
|
|
94
|
-
});
|
|
95
|
-
return s.recommendationCampaignUrls[a] = o, o;
|
|
96
|
-
}
|
|
97
|
-
const C = ((m = E().find((o) => o.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
|
|
98
|
-
t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", r.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", r.variationId), e.strategy === "manualMerchandising" ? t.set("productId", e.productIds.join(",")) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
99
|
-
const R = e.filters.filter((o) => o.isValid), l = _(R);
|
|
100
|
-
l && t.set("filter", l), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(b(r.partnerName, e.strategy)).forEach(([o, i]) => t.set(o, i));
|
|
101
|
-
const T = decodeURIComponent(t.toString()), u = `${S.RECOMMENDATION_API_URL}/v2/${C}?${T}`;
|
|
102
|
-
return s.recommendationCampaignUrls[a] = u, u;
|
|
45
|
+
},
|
|
46
|
+
buildCampaignUrl: (a, s) => {
|
|
47
|
+
var m;
|
|
48
|
+
const c = l(), o = x(), r = Number(a);
|
|
49
|
+
let e;
|
|
50
|
+
if (s)
|
|
51
|
+
e = s;
|
|
52
|
+
else {
|
|
53
|
+
const i = c.blockStates[r];
|
|
54
|
+
if (!i)
|
|
55
|
+
return "";
|
|
56
|
+
const { recommendationConfigs: n } = i;
|
|
57
|
+
e = {
|
|
58
|
+
strategy: n.strategy,
|
|
59
|
+
language: n.language,
|
|
60
|
+
currencyCode: n.currencySettings.value,
|
|
61
|
+
size: n.size,
|
|
62
|
+
productIds: n.productIds,
|
|
63
|
+
filters: n.filters,
|
|
64
|
+
shuffleProducts: n.shuffleProducts
|
|
65
|
+
};
|
|
103
66
|
}
|
|
104
|
-
|
|
105
|
-
};
|
|
67
|
+
const f = ((m = I().find((i) => i.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
|
|
68
|
+
t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", o.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", o.variationId), e.strategy === "manualMerchandising" ? t.set("productId", e.productIds.join(",")) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
69
|
+
const g = e.filters.filter((i) => i.isValid), d = h(g);
|
|
70
|
+
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(y(o.partnerName, e.strategy)).forEach(([i, n]) => t.set(i, n));
|
|
71
|
+
const p = decodeURIComponent(t.toString()), u = `${R.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
|
|
72
|
+
return c.recommendationCampaignUrls[a] = u, u;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
106
75
|
export {
|
|
107
|
-
|
|
76
|
+
k as useRecommendation
|
|
108
77
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockId as f } from "../../enums/block.js";
|
|
2
|
-
import { useTemplateStore as
|
|
3
|
-
import { mapComposition as
|
|
2
|
+
import { useTemplateStore as b } from "../../stores/template.js";
|
|
3
|
+
import { mapComposition as y } from "./recommendation/compositionMapper.js";
|
|
4
4
|
import { extractCurrencyFromBlock as v, extractTitleText as C, extractCardBgColor as M, isPartnerManagedBlock as S } from "./recommendation/extractors.js";
|
|
5
5
|
import { buildBlockHtml as w } from "./recommendation/htmlBuilder.js";
|
|
6
6
|
import { parseRecommendationId as x, parseLegacyConfig as R } from "./recommendation/parseLegacyConfig.js";
|
|
@@ -20,11 +20,8 @@ function B(i, t, a) {
|
|
|
20
20
|
), !1;
|
|
21
21
|
const n = a[String(o)] ?? {
|
|
22
22
|
currencySettings: v(t)
|
|
23
|
-
}, c = T(n, r, o), e =
|
|
23
|
+
}, c = T(n, r, o), e = y((d = r.composition) == null ? void 0 : d.variables), l = C(t), g = M(t), p = {
|
|
24
24
|
...c,
|
|
25
|
-
// Legacy blocks predate RRS and carry no strategy reference. Migrated
|
|
26
|
-
// blocks keep running on their algorithm until a strategy is assigned.
|
|
27
|
-
strategyId: "",
|
|
28
25
|
composition: e.composition,
|
|
29
26
|
visibility: e.visibility,
|
|
30
27
|
textTrimming: e.anyTextTrimming
|
|
@@ -59,7 +56,7 @@ function B(i, t, a) {
|
|
|
59
56
|
function q(i, t = {}) {
|
|
60
57
|
const a = new DOMParser(), o = a.parseFromString(i, "text/html"), r = Array.from(o.querySelectorAll(h));
|
|
61
58
|
try {
|
|
62
|
-
|
|
59
|
+
b().$patch((e) => {
|
|
63
60
|
e.migrations = {
|
|
64
61
|
...e.migrations,
|
|
65
62
|
[f.Recommendation]: r.length
|
package/dist/enums/date.js
CHANGED
|
@@ -2,15 +2,10 @@ import { useTranslations as r } from "../../composables/useTranslations.js";
|
|
|
2
2
|
const l = {
|
|
3
3
|
RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com",
|
|
4
4
|
// Relative path → same-origin as the embedding inone dashboard.
|
|
5
|
-
PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes"
|
|
6
|
-
// Reusable Recommendation Strategies (RRS), also same-origin on inone.
|
|
7
|
-
RECOMMENDATION_STRATEGIES_PATH: "/api/recommendation-strategies",
|
|
8
|
-
STRATEGY_RECOMMENDATION_URL_PATH: "/api/recommendation-strategies/strategy-recommendation-url"
|
|
5
|
+
PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes"
|
|
9
6
|
}, c = {
|
|
10
|
-
CLIENT_ID: "clientId"
|
|
11
|
-
|
|
12
|
-
FILTERS: "filters"
|
|
13
|
-
}, d = "[sr_strategies.status][=][active]*[sr_strategies.suitable_channels][~][EMAIL]", m = () => {
|
|
7
|
+
CLIENT_ID: "clientId"
|
|
8
|
+
}, d = () => {
|
|
14
9
|
const e = r();
|
|
15
10
|
return [
|
|
16
11
|
{
|
|
@@ -74,14 +69,14 @@ const l = {
|
|
|
74
69
|
path: "top-sellers"
|
|
75
70
|
}
|
|
76
71
|
];
|
|
77
|
-
},
|
|
72
|
+
}, m = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], p = [
|
|
78
73
|
{ text: "before the amount", value: "0" },
|
|
79
74
|
{ text: "after the amount", value: "1" }
|
|
80
|
-
],
|
|
75
|
+
], v = [
|
|
81
76
|
{ text: "dot(.)", value: "." },
|
|
82
77
|
{ text: "comma(,)", value: "," },
|
|
83
78
|
{ text: "space( )", value: " " }
|
|
84
|
-
],
|
|
79
|
+
], h = [
|
|
85
80
|
{ text: "0", value: "0" },
|
|
86
81
|
{ text: "1", value: "1" },
|
|
87
82
|
{ text: "2", value: "2" },
|
|
@@ -93,55 +88,54 @@ const l = {
|
|
|
93
88
|
{ text: "contains", value: "~" },
|
|
94
89
|
{ text: "does not contain", value: "!~" },
|
|
95
90
|
{ text: "any of", value: a }
|
|
96
|
-
],
|
|
91
|
+
], n = [
|
|
97
92
|
{ text: "is exactly", value: "=" },
|
|
98
93
|
{ text: "is not exactly", value: "!==" },
|
|
99
94
|
{ text: "contains", value: "~" },
|
|
100
95
|
{ text: "does not contain", value: "!~" },
|
|
101
96
|
{ text: "any of", value: a }
|
|
102
|
-
],
|
|
97
|
+
], o = [
|
|
103
98
|
{ text: "is equal to", value: "=" },
|
|
104
99
|
{ text: "is greater than", value: ">" },
|
|
105
100
|
{ text: "is less than", value: "<" }
|
|
106
|
-
],
|
|
101
|
+
], s = [
|
|
107
102
|
{ text: "is equal to", value: "=" },
|
|
108
103
|
{ text: "after", value: ">" },
|
|
109
104
|
{ text: "before", value: "<" }
|
|
110
105
|
], i = [
|
|
111
106
|
{ text: "true", value: "==" },
|
|
112
107
|
{ text: "false", value: "!=" }
|
|
113
|
-
],
|
|
108
|
+
], x = (e) => {
|
|
114
109
|
if (!e)
|
|
115
110
|
return t;
|
|
116
111
|
switch (e) {
|
|
117
112
|
case "Boolean":
|
|
118
113
|
return i;
|
|
119
114
|
case "Date":
|
|
120
|
-
return
|
|
115
|
+
return s;
|
|
121
116
|
case "Number":
|
|
122
|
-
return
|
|
117
|
+
return o;
|
|
123
118
|
case "String":
|
|
124
119
|
return t;
|
|
125
120
|
case "Strings":
|
|
126
|
-
return
|
|
121
|
+
return n;
|
|
127
122
|
default:
|
|
128
123
|
return t;
|
|
129
124
|
}
|
|
130
125
|
};
|
|
131
126
|
export {
|
|
132
127
|
a as OP_ANY_OF,
|
|
133
|
-
|
|
128
|
+
m as PriceAttributes,
|
|
134
129
|
c as QUERY_PARAMS,
|
|
135
|
-
d as RRS_EMAIL_ACTIVE_FILTER,
|
|
136
130
|
l as URLS,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
131
|
+
h as currencyDecimalCounts,
|
|
132
|
+
p as currencyLocationMaps,
|
|
133
|
+
v as currencyOperators,
|
|
134
|
+
x as getOperatorOptions,
|
|
135
|
+
d as getRecommendationFeedSourceMaps,
|
|
136
|
+
n as operatorOptionsForArrayOfStrings,
|
|
143
137
|
i as operatorOptionsForBooleans,
|
|
144
|
-
|
|
145
|
-
|
|
138
|
+
s as operatorOptionsForDates,
|
|
139
|
+
o as operatorOptionsForNumbers,
|
|
146
140
|
t as operatorOptionsForStrings
|
|
147
141
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { DEFAULT_COLUMN_SPACING as n, DEFAULT_ROW_SPACING as s, DEFAULT_MOBILE_ROW_SPACING as R, DEFAULT_MOBILE_COLUMN_SPACING as U, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as
|
|
1
|
+
import { DEFAULT_COLUMN_SPACING as n, DEFAULT_ROW_SPACING as s, DEFAULT_MOBILE_ROW_SPACING as R, DEFAULT_MOBILE_COLUMN_SPACING as U, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as C } from "./layout.js";
|
|
2
2
|
import { ATTR_PRODUCT_IMAGE as o, ATTR_PRODUCT_NAME as t, ATTR_PRODUCT_OLD_PRICE as _, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as r, ATTR_PRODUCT_OMNIBUS_DISCOUNT as i, ATTR_PRODUCT_BUTTON as I } from "./selectors.js";
|
|
3
|
-
const
|
|
3
|
+
const D = {
|
|
4
4
|
code: "USD",
|
|
5
5
|
symbol: "USD",
|
|
6
6
|
alignment: "after",
|
|
7
7
|
decimalCount: 2,
|
|
8
8
|
decimalSeparator: ".",
|
|
9
9
|
thousandSeparator: ","
|
|
10
|
-
},
|
|
10
|
+
}, O = {
|
|
11
11
|
textBefore: "",
|
|
12
12
|
textAfter: ""
|
|
13
|
-
},
|
|
13
|
+
}, a = {
|
|
14
14
|
textBefore: "",
|
|
15
15
|
textAfter: ""
|
|
16
16
|
}, A = [
|
|
@@ -32,16 +32,15 @@ const C = {
|
|
|
32
32
|
}, l = {
|
|
33
33
|
// Settings
|
|
34
34
|
strategy: "mostPopular",
|
|
35
|
-
strategyId: "",
|
|
36
35
|
productIds: [],
|
|
37
36
|
size: "6",
|
|
38
37
|
shuffleProducts: !1,
|
|
39
38
|
language: "en_US",
|
|
40
|
-
currency:
|
|
39
|
+
currency: D,
|
|
41
40
|
filters: [],
|
|
42
41
|
// Layout
|
|
43
42
|
layout: "grid",
|
|
44
|
-
cardsInRow:
|
|
43
|
+
cardsInRow: C,
|
|
45
44
|
mobileCardsInRow: e,
|
|
46
45
|
mobileLayoutEnabled: !1,
|
|
47
46
|
previousMobileCardsInRow: e,
|
|
@@ -53,8 +52,8 @@ const C = {
|
|
|
53
52
|
composition: A,
|
|
54
53
|
visibility: c,
|
|
55
54
|
// Element settings
|
|
56
|
-
omnibusPrice:
|
|
57
|
-
omnibusDiscount:
|
|
55
|
+
omnibusPrice: O,
|
|
56
|
+
omnibusDiscount: a,
|
|
58
57
|
textTrimming: !1,
|
|
59
58
|
// Price placement (block-level, affects all cards)
|
|
60
59
|
// Default ON = current stacked look, so existing templates are unaffected.
|
|
@@ -72,10 +71,10 @@ const C = {
|
|
|
72
71
|
export {
|
|
73
72
|
m as CURRENT_CONFIG_VERSION,
|
|
74
73
|
A as DEFAULT_COMPOSITION,
|
|
75
|
-
|
|
74
|
+
D as DEFAULT_CURRENCY,
|
|
76
75
|
l as DEFAULT_NODE_CONFIG,
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
a as DEFAULT_OMNIBUS_DISCOUNT,
|
|
77
|
+
O as DEFAULT_OMNIBUS_PRICE,
|
|
79
78
|
c as DEFAULT_VISIBILITY,
|
|
80
79
|
N as EXCLUDED_ALGORITHM_IDS
|
|
81
80
|
};
|