@useinsider/guido 3.16.0-beta.ff4f1bd → 3.16.1-beta.626490d
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 +0 -1
- package/dist/@types/config/schemas.js +6 -12
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +30 -31
- package/dist/composables/useRecommendation.js +36 -43
- package/dist/config/migrator/recommendationMigrator.js +4 -6
- package/dist/enums/extensions/recommendationBlock.js +23 -25
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +11 -13
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +90 -112
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +53 -188
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +28 -77
- package/dist/src/@types/config/schemas.d.ts +0 -12
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useRecommendation.d.ts +0 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -6
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +10 -199
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -6
- package/dist/src/services/recommendationApi.d.ts +1 -4
- package/dist/src/stores/config.d.ts +0 -18
- package/dist/utils/templatePreparation.js +34 -37
- package/package.json +1 -2
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +0 -18
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +0 -61
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -106
- package/dist/node_modules/@useinsider/design-system-organisms/dist/index-5JHlb8rM.js +0 -524
- package/dist/node_modules/@useinsider/design-system-organisms/dist/index.js +0 -8450
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InAccordion.js +0 -174
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBasicTextInput.js +0 -381
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBox.js +0 -236
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBulkActions.js +0 -70
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButton.js +0 -350
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButtonV2.js +0 -371
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCheckBox.js +0 -152
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InChips.js +0 -141
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCustomDropDown.js +0 -1047
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDataTableV2.js +0 -96050
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDatePicker.js +0 -2042
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDrawer.js +0 -166
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDropDown.js +0 -1098
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InIcons.js +0 -55
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InInfoBox.js +0 -265
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLinks.js +0 -184
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLoading.js +0 -50
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InModals.js +0 -453
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InNoData.js +0 -145
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InOnPageMessage.js +0 -176
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InProgress.js +0 -266
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InRadioButton.js +0 -114
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSegments.js +0 -200
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSelect.js +0 -451
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSkeleton.js +0 -49
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InStatusText.js +0 -119
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTabs.js +0 -4309
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTagsText.js +0 -129
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTextInput.js +0 -503
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToasts.js +0 -253
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToggle.js +0 -107
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltip.js +0 -134
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltipV2.js +0 -464
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_commonjsHelpers.BItOPCY9.js +0 -28
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_plugin-vue2_normalizer.WQT2Fc8L.js +0 -23
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/clickOutside.qP9M0QCm.js +0 -29
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/helpers.CgHNyjAJ.js +0 -109
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/index.Bw_06igr.js +0 -2339
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/localLocalesMixin.DYMhydo2.js +0 -16
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/useLocalLocales.Ckuhy7d-.js +0 -17
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/vue-property-decorator.BtlM7Epa.js +0 -188
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -26
- package/dist/src/mock/api/recommendation-strategies.d.ts +0 -41
package/README.md
CHANGED
|
@@ -162,7 +162,6 @@ 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.
|
|
166
165
|
},
|
|
167
166
|
|
|
168
167
|
// 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 k, boolean as o, array as c, transform as C, record as y, 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 = y(
|
|
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
|
+
y(t(), P),
|
|
136
136
|
{}
|
|
137
137
|
)
|
|
138
138
|
}), x = a({
|
|
@@ -219,13 +219,7 @@ 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)
|
|
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)
|
|
222
|
+
linkTrackingIds: e(o(), !1)
|
|
229
223
|
}), B = i([
|
|
230
224
|
"amp-accordion",
|
|
231
225
|
"amp-carousel",
|
|
@@ -293,7 +287,7 @@ const p = {
|
|
|
293
287
|
...d.entries,
|
|
294
288
|
type: u("custom"),
|
|
295
289
|
/** Custom processor function */
|
|
296
|
-
processor:
|
|
290
|
+
processor: k(
|
|
297
291
|
(s) => typeof s == "function",
|
|
298
292
|
"processor must be a function"
|
|
299
293
|
)
|
|
@@ -313,7 +307,7 @@ const p = {
|
|
|
313
307
|
* Return false to cancel the save operation.
|
|
314
308
|
*/
|
|
315
309
|
externalValidation: e(
|
|
316
|
-
|
|
310
|
+
k(
|
|
317
311
|
(s) => typeof s == "function",
|
|
318
312
|
"externalValidation must be a function"
|
|
319
313
|
)
|
|
@@ -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),
|
|
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
|
+
"b0d3b445"
|
|
16
16
|
);
|
|
17
17
|
const l = s.exports;
|
|
18
18
|
export {
|
|
@@ -5,27 +5,26 @@ import { useGuidoStateBridge as Z } from "../composables/useGuidoStateBridge.js"
|
|
|
5
5
|
import { usePartner as ee } from "../composables/usePartner.js";
|
|
6
6
|
import { useStripo as te } from "../composables/useStripo.js";
|
|
7
7
|
import { useTimerClone as oe } from "../composables/useTimerClone.js";
|
|
8
|
-
import { migrate as
|
|
9
|
-
import { ModuleFolderDefaults as
|
|
8
|
+
import { migrate as N } from "../config/migrator/index.js";
|
|
9
|
+
import { ModuleFolderDefaults as O } from "../enums/defaults.js";
|
|
10
10
|
import { RIBBON_SELECTOR as ne } from "../enums/onboarding.js";
|
|
11
11
|
import { useRecommendationExtensionStore as re } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
12
|
import se from "./organisms/AutoSaveController.vue.js";
|
|
13
13
|
import ae from "./organisms/base/Toaster.vue.js";
|
|
14
|
-
import ie from "./organisms/extensions/recommendation/
|
|
15
|
-
import ce from "./organisms/
|
|
16
|
-
import de from "./organisms/
|
|
17
|
-
import me from "./organisms/
|
|
18
|
-
import le from "./organisms/
|
|
19
|
-
import ue from "
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
const Ke = /* @__PURE__ */ j({
|
|
14
|
+
import ie from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
+
import ce from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import de from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import me from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import le from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as ue } from "../services/stripoApi.js";
|
|
20
|
+
import { useConfigStore as pe } from "../stores/config.js";
|
|
21
|
+
import { useDynamicContentStore as fe } from "../stores/dynamic-content.js";
|
|
22
|
+
import { useEditorStore as P } from "../stores/editor.js";
|
|
23
|
+
import { usePreviewStore as ye } from "../stores/preview.js";
|
|
24
|
+
import { useTemplateStore as ve } from "../stores/template.js";
|
|
25
|
+
import { useUnsubscribeStore as he } from "../stores/unsubscribe.js";
|
|
26
|
+
import { readTrackFloor as A } from "../utils/linkTrackingIds.js";
|
|
27
|
+
const ze = /* @__PURE__ */ j({
|
|
29
28
|
__name: "Guido",
|
|
30
29
|
props: {
|
|
31
30
|
config: null,
|
|
@@ -37,11 +36,11 @@ const Ke = /* @__PURE__ */ j({
|
|
|
37
36
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
38
37
|
), H = R(
|
|
39
38
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
40
|
-
),
|
|
39
|
+
), h = B(), l = B(), u = fe(), S = he(), o = pe();
|
|
41
40
|
a.ready && o.init(a.config);
|
|
42
|
-
const c =
|
|
41
|
+
const c = P(), $ = ye(), m = U(() => c.hasChanges), { isTestPartner: z } = ee(), g = () => {
|
|
43
42
|
var t;
|
|
44
|
-
return (t =
|
|
43
|
+
return (t = h.value) == null ? void 0 : t.handleSave(!0);
|
|
45
44
|
}, b = (t) => {
|
|
46
45
|
c.loadingStatus = t;
|
|
47
46
|
};
|
|
@@ -53,10 +52,10 @@ const Ke = /* @__PURE__ */ j({
|
|
|
53
52
|
userId: o.userId,
|
|
54
53
|
username: o.username,
|
|
55
54
|
partnerName: o.partnerName,
|
|
56
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
57
|
-
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
55
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || O.SAVED_MODULES,
|
|
56
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || O.DEFAULT_MODULES
|
|
58
57
|
};
|
|
59
|
-
}, { initPlugin: E, preloadRuntime: w } = te(), { getDefaultTemplate:
|
|
58
|
+
}, { initPlugin: E, preloadRuntime: w } = te(), { getDefaultTemplate: C } = ue(), { cloneTimersOnSave: D, hasTimerBlocks: k } = oe(), q = U(() => {
|
|
60
59
|
var t;
|
|
61
60
|
return !((t = o.ui) != null && t.showHeader);
|
|
62
61
|
});
|
|
@@ -100,12 +99,12 @@ const Ke = /* @__PURE__ */ j({
|
|
|
100
99
|
S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
101
100
|
const L = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, M = o.isFeatureEnabled("linkTrackingIds");
|
|
102
101
|
let n = {
|
|
103
|
-
html: s && await
|
|
102
|
+
html: s && await N(s, L),
|
|
104
103
|
css: d
|
|
105
104
|
};
|
|
106
|
-
n.html || (n = await
|
|
107
|
-
const K = M ?
|
|
108
|
-
k(n.html) && (n.html = await
|
|
105
|
+
n.html || (n = await C(), n.html = await N(n.html, L));
|
|
106
|
+
const K = M ? A(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
107
|
+
k(n.html) && (n.html = await D(n.html)), M && (c.trackIdSessionFloor = Math.max(K, A(n.html)));
|
|
109
108
|
const V = {
|
|
110
109
|
preselectedDynamicContentList: I,
|
|
111
110
|
onReady: () => {
|
|
@@ -119,7 +118,7 @@ const Ke = /* @__PURE__ */ j({
|
|
|
119
118
|
};
|
|
120
119
|
return J(async () => {
|
|
121
120
|
var e;
|
|
122
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), re().$reset(),
|
|
121
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), re().$reset(), P().$reset(), ve().$reset(), y();
|
|
123
122
|
const t = (e = l.value) == null ? void 0 : e.parentElement;
|
|
124
123
|
if (t && (i = new ResizeObserver(y), i.observe(t)), w(), a.ready)
|
|
125
124
|
await v();
|
|
@@ -143,11 +142,11 @@ const Ke = /* @__PURE__ */ j({
|
|
|
143
142
|
close: F
|
|
144
143
|
},
|
|
145
144
|
hasChanges: m,
|
|
146
|
-
saveSilent:
|
|
145
|
+
saveSilent: g,
|
|
147
146
|
setLoading: b
|
|
148
|
-
}), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, headerWrapperRef:
|
|
147
|
+
}), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, headerWrapperRef: h, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: a, configStore: o, editorStore: c, previewStore: $, hasChanges: m, isTestPartner: z, saveSilent: g, setLoading: b, emit: r, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: k, noHeader: q, insertDynamicContent: T, closeDynamicContent: F, handleDynamicContentOpen: f, ribbonObserver: i, updateRibbonOffset: y, startEditor: v, AutoSaveController: se, Toaster: ae, FilterSelectionDrawer: ie, HeaderWrapper: ce, LoadingWrapper: de, SaveAsTemplateDrawer: me, UnsubscribeWrapper: le };
|
|
149
148
|
}
|
|
150
149
|
});
|
|
151
150
|
export {
|
|
152
|
-
|
|
151
|
+
ze as default
|
|
153
152
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { getRecommendationFeedSourceMaps as
|
|
2
|
-
import { MinDeviceViewport as C, DefaultPadding as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
4
|
-
import { generateCompleteFilterQuery as
|
|
5
|
-
import { getPartnerRecommendationParams as
|
|
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
6
|
import { useConfigStore as x } from "../stores/config.js";
|
|
7
7
|
const k = () => ({
|
|
8
8
|
calculateCardWidth: ({
|
|
9
|
-
mobileLeftPadding:
|
|
10
|
-
mobileRightPadding:
|
|
11
|
-
cardsInRow:
|
|
9
|
+
mobileLeftPadding: a,
|
|
10
|
+
mobileRightPadding: s,
|
|
11
|
+
cardsInRow: c,
|
|
12
12
|
unresponsive: o
|
|
13
13
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
return (C - e) /
|
|
14
|
+
const r = o ? c : 1, e = a + s + (r - 1) * b;
|
|
15
|
+
return (C - e) / r;
|
|
16
16
|
},
|
|
17
|
-
getRecommendationCampaignData: (
|
|
18
|
-
const
|
|
17
|
+
getRecommendationCampaignData: (a) => {
|
|
18
|
+
const s = l(), c = Number(a), o = s.blockStates[c];
|
|
19
19
|
if (!o)
|
|
20
20
|
return {
|
|
21
21
|
textTrimming: !1,
|
|
@@ -29,54 +29,47 @@ const k = () => ({
|
|
|
29
29
|
discountBeforeTextValue: "",
|
|
30
30
|
discountAfterTextValue: ""
|
|
31
31
|
};
|
|
32
|
-
const { recommendationConfigs:
|
|
32
|
+
const { recommendationConfigs: r } = o, e = r.orientation === "grid" ? "vertical" : "horizontal";
|
|
33
33
|
return {
|
|
34
|
-
textTrimming:
|
|
34
|
+
textTrimming: r.textTrimming,
|
|
35
35
|
orientation: e,
|
|
36
36
|
mobileLeftPadding: 0,
|
|
37
37
|
mobileRightPadding: 0,
|
|
38
|
-
cardsInRow:
|
|
39
|
-
unresponsive:
|
|
38
|
+
cardsInRow: r.cardsInRow,
|
|
39
|
+
unresponsive: r.unresponsive,
|
|
40
40
|
priceBeforeTextValue: "",
|
|
41
41
|
priceAfterTextValue: "",
|
|
42
42
|
discountBeforeTextValue: "",
|
|
43
43
|
discountAfterTextValue: ""
|
|
44
44
|
};
|
|
45
45
|
},
|
|
46
|
-
buildCampaignUrl: (
|
|
47
|
-
var
|
|
48
|
-
const
|
|
46
|
+
buildCampaignUrl: (a, s) => {
|
|
47
|
+
var m;
|
|
48
|
+
const c = l(), o = x(), r = Number(a);
|
|
49
49
|
let e;
|
|
50
|
-
if (
|
|
51
|
-
e =
|
|
50
|
+
if (s)
|
|
51
|
+
e = s;
|
|
52
52
|
else {
|
|
53
|
-
const
|
|
54
|
-
if (!
|
|
53
|
+
const i = c.blockStates[r];
|
|
54
|
+
if (!i)
|
|
55
55
|
return "";
|
|
56
|
-
const { recommendationConfigs:
|
|
56
|
+
const { recommendationConfigs: n } = i;
|
|
57
57
|
e = {
|
|
58
|
-
strategy:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
shuffleProducts: r.shuffleProducts
|
|
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
|
|
66
65
|
};
|
|
67
66
|
}
|
|
68
|
-
|
|
69
|
-
return s.recommendationCampaignUrls[i] = {
|
|
70
|
-
strategyId: e.strategyId,
|
|
71
|
-
locale: e.language,
|
|
72
|
-
currency: e.currencyCode
|
|
73
|
-
}, "";
|
|
74
|
-
const g = ((l = y().find((a) => a.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
|
|
67
|
+
const f = ((m = I().find((i) => i.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
|
|
75
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}");
|
|
76
|
-
const
|
|
77
|
-
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(
|
|
78
|
-
const p = decodeURIComponent(t.toString()), u = `${
|
|
79
|
-
return
|
|
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;
|
|
80
73
|
}
|
|
81
74
|
});
|
|
82
75
|
export {
|
|
@@ -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,10 +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 — never strategy-backed.
|
|
26
|
-
strategyId: "",
|
|
27
25
|
composition: e.composition,
|
|
28
26
|
visibility: e.visibility,
|
|
29
27
|
textTrimming: e.anyTextTrimming
|
|
@@ -58,7 +56,7 @@ function B(i, t, a) {
|
|
|
58
56
|
function q(i, t = {}) {
|
|
59
57
|
const a = new DOMParser(), o = a.parseFromString(i, "text/html"), r = Array.from(o.querySelectorAll(h));
|
|
60
58
|
try {
|
|
61
|
-
|
|
59
|
+
b().$patch((e) => {
|
|
62
60
|
e.migrations = {
|
|
63
61
|
...e.migrations,
|
|
64
62
|
[f.Recommendation]: r.length
|
|
@@ -2,11 +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
|
-
|
|
7
|
-
}, c = "[sr_strategies.status][=][active]*[sr_strategies.suitable_channels][~][EMAIL]", d = {
|
|
5
|
+
PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes"
|
|
6
|
+
}, c = {
|
|
8
7
|
CLIENT_ID: "clientId"
|
|
9
|
-
},
|
|
8
|
+
}, d = () => {
|
|
10
9
|
const e = r();
|
|
11
10
|
return [
|
|
12
11
|
{
|
|
@@ -70,14 +69,14 @@ const l = {
|
|
|
70
69
|
path: "top-sellers"
|
|
71
70
|
}
|
|
72
71
|
];
|
|
73
|
-
},
|
|
72
|
+
}, m = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], p = [
|
|
74
73
|
{ text: "before the amount", value: "0" },
|
|
75
74
|
{ text: "after the amount", value: "1" }
|
|
76
|
-
],
|
|
75
|
+
], v = [
|
|
77
76
|
{ text: "dot(.)", value: "." },
|
|
78
77
|
{ text: "comma(,)", value: "," },
|
|
79
78
|
{ text: "space( )", value: " " }
|
|
80
|
-
],
|
|
79
|
+
], h = [
|
|
81
80
|
{ text: "0", value: "0" },
|
|
82
81
|
{ text: "1", value: "1" },
|
|
83
82
|
{ text: "2", value: "2" },
|
|
@@ -89,55 +88,54 @@ const l = {
|
|
|
89
88
|
{ text: "contains", value: "~" },
|
|
90
89
|
{ text: "does not contain", value: "!~" },
|
|
91
90
|
{ text: "any of", value: a }
|
|
92
|
-
],
|
|
91
|
+
], n = [
|
|
93
92
|
{ text: "is exactly", value: "=" },
|
|
94
93
|
{ text: "is not exactly", value: "!==" },
|
|
95
94
|
{ text: "contains", value: "~" },
|
|
96
95
|
{ text: "does not contain", value: "!~" },
|
|
97
96
|
{ text: "any of", value: a }
|
|
98
|
-
],
|
|
97
|
+
], o = [
|
|
99
98
|
{ text: "is equal to", value: "=" },
|
|
100
99
|
{ text: "is greater than", value: ">" },
|
|
101
100
|
{ text: "is less than", value: "<" }
|
|
102
|
-
],
|
|
101
|
+
], s = [
|
|
103
102
|
{ text: "is equal to", value: "=" },
|
|
104
103
|
{ text: "after", value: ">" },
|
|
105
104
|
{ text: "before", value: "<" }
|
|
106
105
|
], i = [
|
|
107
106
|
{ text: "true", value: "==" },
|
|
108
107
|
{ text: "false", value: "!=" }
|
|
109
|
-
],
|
|
108
|
+
], x = (e) => {
|
|
110
109
|
if (!e)
|
|
111
110
|
return t;
|
|
112
111
|
switch (e) {
|
|
113
112
|
case "Boolean":
|
|
114
113
|
return i;
|
|
115
114
|
case "Date":
|
|
116
|
-
return
|
|
115
|
+
return s;
|
|
117
116
|
case "Number":
|
|
118
|
-
return
|
|
117
|
+
return o;
|
|
119
118
|
case "String":
|
|
120
119
|
return t;
|
|
121
120
|
case "Strings":
|
|
122
|
-
return
|
|
121
|
+
return n;
|
|
123
122
|
default:
|
|
124
123
|
return t;
|
|
125
124
|
}
|
|
126
125
|
};
|
|
127
126
|
export {
|
|
128
127
|
a as OP_ANY_OF,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
c as RRS_ACTIVE_EMAIL_FILTER,
|
|
128
|
+
m as PriceAttributes,
|
|
129
|
+
c as QUERY_PARAMS,
|
|
132
130
|
l as URLS,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
131
|
+
h as currencyDecimalCounts,
|
|
132
|
+
p as currencyLocationMaps,
|
|
133
|
+
v as currencyOperators,
|
|
134
|
+
x as getOperatorOptions,
|
|
135
|
+
d as getRecommendationFeedSourceMaps,
|
|
136
|
+
n as operatorOptionsForArrayOfStrings,
|
|
139
137
|
i as operatorOptionsForBooleans,
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
s as operatorOptionsForDates,
|
|
139
|
+
o as operatorOptionsForNumbers,
|
|
142
140
|
t as operatorOptionsForStrings
|
|
143
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 = [
|
|
@@ -36,13 +36,11 @@ const C = {
|
|
|
36
36
|
size: "6",
|
|
37
37
|
shuffleProducts: !1,
|
|
38
38
|
language: "en_US",
|
|
39
|
-
currency:
|
|
39
|
+
currency: D,
|
|
40
40
|
filters: [],
|
|
41
|
-
// Version NOT bumped: mergeWithDefaults() backfills '' for older configs.
|
|
42
|
-
strategyId: "",
|
|
43
41
|
// Layout
|
|
44
42
|
layout: "grid",
|
|
45
|
-
cardsInRow:
|
|
43
|
+
cardsInRow: C,
|
|
46
44
|
mobileCardsInRow: e,
|
|
47
45
|
mobileLayoutEnabled: !1,
|
|
48
46
|
previousMobileCardsInRow: e,
|
|
@@ -54,8 +52,8 @@ const C = {
|
|
|
54
52
|
composition: A,
|
|
55
53
|
visibility: c,
|
|
56
54
|
// Element settings
|
|
57
|
-
omnibusPrice:
|
|
58
|
-
omnibusDiscount:
|
|
55
|
+
omnibusPrice: O,
|
|
56
|
+
omnibusDiscount: a,
|
|
59
57
|
textTrimming: !1,
|
|
60
58
|
// Price placement (block-level, affects all cards)
|
|
61
59
|
// Default ON = current stacked look, so existing templates are unaffected.
|
|
@@ -73,10 +71,10 @@ const C = {
|
|
|
73
71
|
export {
|
|
74
72
|
m as CURRENT_CONFIG_VERSION,
|
|
75
73
|
A as DEFAULT_COMPOSITION,
|
|
76
|
-
|
|
74
|
+
D as DEFAULT_CURRENCY,
|
|
77
75
|
l as DEFAULT_NODE_CONFIG,
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
a as DEFAULT_OMNIBUS_DISCOUNT,
|
|
77
|
+
O as DEFAULT_OMNIBUS_PRICE,
|
|
80
78
|
c as DEFAULT_VISIBILITY,
|
|
81
79
|
N as EXCLUDED_ALGORITHM_IDS
|
|
82
80
|
};
|