@useinsider/guido 3.17.0-beta.24a776b → 3.17.0-beta.3a4c221
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 +63 -66
- package/dist/composables/useConfig.js +30 -37
- package/dist/composables/useCustomInterfaceAppearance.js +38 -52
- package/dist/composables/useRecommendation.js +41 -49
- package/dist/config/migrator/recommendation/settingsMapper.js +17 -19
- package/dist/config/migrator/recommendationMigrator.js +37 -56
- package/dist/enums/academy.js +1 -2
- package/dist/enums/date.js +3 -4
- package/dist/enums/extensions/recommendationBlock.js +1 -4
- package/dist/extensions/Blocks/Recommendation/block.js +21 -26
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -36
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +95 -96
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +154 -151
- package/dist/extensions/Blocks/Recommendation/services/configService.js +35 -35
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +109 -248
- package/dist/extensions/Blocks/common-control.js +19 -22
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +30 -72
- package/dist/src/@types/config/schemas.d.ts +0 -12
- package/dist/src/composables/useConfig.d.ts +0 -3
- package/dist/src/composables/useRecommendation.d.ts +0 -1
- package/dist/src/enums/academy.d.ts +0 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +6 -7
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -9
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +10 -204
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -6
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -4
- package/dist/src/services/recommendationApi.d.ts +1 -4
- package/dist/src/stores/config.d.ts +0 -18
- package/dist/src/stores/template.d.ts +0 -14
- package/dist/src/utils/dynamicContentFormat.d.ts +26 -0
- package/dist/stores/template.js +8 -13
- package/dist/utils/dateUtil.js +10 -23
- package/dist/utils/dynamicContentFormat.js +37 -0
- package/dist/utils/genericUtil.js +45 -54
- 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 -65
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -136
- 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 -29
- package/dist/src/mock/api/recommendation-strategies.d.ts +0 -63
- package/dist/src/utils/strategyInfoBox.d.ts +0 -18
- package/dist/static/assets/icons/line-change.svg.js +0 -5
- package/dist/static/assets/icons/line-delete.svg.js +0 -5
- package/dist/static/assets/icons/line-plus.svg.js +0 -5
- package/dist/static/styles/components/recommendation-strategy.css.js +0 -172
- package/dist/utils/strategyInfoBox.js +0 -37
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 {
|
|
@@ -1,53 +1,50 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { useTimerClone as ie } from "../composables/useTimerClone.js";
|
|
1
|
+
import { defineComponent as j, defineAsyncComponent as R, ref as B, computed as U, watch as _, onMounted as J, onUnmounted as Q } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as X } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as Y } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as Z } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as ee } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as te } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as oe } from "../composables/useTimerClone.js";
|
|
9
8
|
import { migrate as N } from "../config/migrator/index.js";
|
|
10
9
|
import { ModuleFolderDefaults as O } from "../enums/defaults.js";
|
|
11
|
-
import { RIBBON_SELECTOR as
|
|
12
|
-
import { useRecommendationExtensionStore as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { useStripoApi as
|
|
21
|
-
import { useConfigStore as
|
|
22
|
-
import { useDynamicContentStore as
|
|
10
|
+
import { RIBBON_SELECTOR as ne } from "../enums/onboarding.js";
|
|
11
|
+
import { useRecommendationExtensionStore as re } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
|
+
import se from "./organisms/AutoSaveController.vue.js";
|
|
13
|
+
import ae from "./organisms/base/Toaster.vue.js";
|
|
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";
|
|
23
22
|
import { useEditorStore as P } from "../stores/editor.js";
|
|
24
|
-
import { usePreviewStore as
|
|
25
|
-
import { useTemplateStore as
|
|
26
|
-
import { useUnsubscribeStore as
|
|
27
|
-
import { readTrackFloor as
|
|
28
|
-
const
|
|
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,
|
|
32
31
|
ready: { type: Boolean, default: !0 }
|
|
33
32
|
},
|
|
34
33
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
35
|
-
setup(
|
|
36
|
-
const
|
|
34
|
+
setup(W, { expose: x, emit: r }) {
|
|
35
|
+
const a = W, G = R(
|
|
37
36
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
38
|
-
),
|
|
37
|
+
), H = R(
|
|
39
38
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
40
|
-
),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
i.ready && o.init(i.config);
|
|
44
|
-
const c = P(), q = he(), m = S(() => c.hasChanges), { isTestPartner: K } = re(), E = () => {
|
|
39
|
+
), h = B(), l = B(), u = fe(), S = he(), o = pe();
|
|
40
|
+
a.ready && o.init(a.config);
|
|
41
|
+
const c = P(), $ = ye(), m = U(() => c.hasChanges), { isTestPartner: z } = ee(), g = () => {
|
|
45
42
|
var t;
|
|
46
43
|
return (t = h.value) == null ? void 0 : t.handleSave(!0);
|
|
47
|
-
},
|
|
44
|
+
}, b = (t) => {
|
|
48
45
|
c.loadingStatus = t;
|
|
49
46
|
};
|
|
50
|
-
|
|
47
|
+
X(), Z();
|
|
51
48
|
const p = () => {
|
|
52
49
|
var t, e;
|
|
53
50
|
return {
|
|
@@ -58,11 +55,11 @@ const Je = /* @__PURE__ */ X({
|
|
|
58
55
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || O.SAVED_MODULES,
|
|
59
56
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || O.DEFAULT_MODULES
|
|
60
57
|
};
|
|
61
|
-
}, { initPlugin:
|
|
58
|
+
}, { initPlugin: E, preloadRuntime: w } = te(), { getDefaultTemplate: C } = ue(), { cloneTimersOnSave: D, hasTimerBlocks: k } = oe(), q = U(() => {
|
|
62
59
|
var t;
|
|
63
60
|
return !((t = o.ui) != null && t.showHeader);
|
|
64
|
-
})
|
|
65
|
-
|
|
61
|
+
});
|
|
62
|
+
Y({
|
|
66
63
|
onBack: () => {
|
|
67
64
|
console.debug("guido:back"), r("back");
|
|
68
65
|
},
|
|
@@ -77,9 +74,9 @@ const Je = /* @__PURE__ */ X({
|
|
|
77
74
|
console.debug("guido:test-email:click"), r("test-email:click");
|
|
78
75
|
}
|
|
79
76
|
});
|
|
80
|
-
const
|
|
77
|
+
const T = (t) => {
|
|
81
78
|
console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
82
|
-
},
|
|
79
|
+
}, F = () => {
|
|
83
80
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
84
81
|
};
|
|
85
82
|
_(() => m.value, () => {
|
|
@@ -89,67 +86,67 @@ const Je = /* @__PURE__ */ X({
|
|
|
89
86
|
const e = t, { attribute: s, position: d } = e.detail;
|
|
90
87
|
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
|
|
91
88
|
};
|
|
92
|
-
let
|
|
89
|
+
let i = null;
|
|
93
90
|
const y = () => {
|
|
94
91
|
var e;
|
|
95
|
-
const t = document.querySelector(
|
|
92
|
+
const t = document.querySelector(ne);
|
|
96
93
|
(e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
97
94
|
}, v = async () => {
|
|
98
95
|
var t;
|
|
99
96
|
try {
|
|
100
|
-
o.initialized || o.init(
|
|
101
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "",
|
|
102
|
-
|
|
103
|
-
const
|
|
97
|
+
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) || "", I = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
99
|
+
S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
100
|
+
const L = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, M = o.isFeatureEnabled("linkTrackingIds");
|
|
104
101
|
let n = {
|
|
105
|
-
html: s && await N(s,
|
|
102
|
+
html: s && await N(s, L),
|
|
106
103
|
css: d
|
|
107
104
|
};
|
|
108
|
-
n.html || (n = await
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
preselectedDynamicContentList:
|
|
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)));
|
|
108
|
+
const V = {
|
|
109
|
+
preselectedDynamicContentList: I,
|
|
113
110
|
onReady: () => {
|
|
114
111
|
console.debug("guido:ready"), r("ready");
|
|
115
112
|
}
|
|
116
113
|
};
|
|
117
|
-
await
|
|
114
|
+
await E(n, p(), V), u.selectedDynamicContentList = I;
|
|
118
115
|
} catch (e) {
|
|
119
116
|
console.error("Failed to initialize Stripo editor:", e);
|
|
120
117
|
}
|
|
121
118
|
};
|
|
122
|
-
return
|
|
119
|
+
return J(async () => {
|
|
123
120
|
var e;
|
|
124
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
121
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), re().$reset(), P().$reset(), ve().$reset(), y();
|
|
125
122
|
const t = (e = l.value) == null ? void 0 : e.parentElement;
|
|
126
|
-
if (t && (
|
|
123
|
+
if (t && (i = new ResizeObserver(y), i.observe(t)), w(), a.ready)
|
|
127
124
|
await v();
|
|
128
125
|
else {
|
|
129
|
-
const s = _(() =>
|
|
126
|
+
const s = _(() => a.ready, (d) => {
|
|
130
127
|
d && (s(), v());
|
|
131
128
|
});
|
|
132
129
|
}
|
|
133
130
|
document.addEventListener("dynamic-content:open", f);
|
|
134
|
-
}),
|
|
135
|
-
|
|
131
|
+
}), Q(() => {
|
|
132
|
+
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", f);
|
|
136
133
|
try {
|
|
137
134
|
window.UIEditor.removeEditor();
|
|
138
135
|
} catch {
|
|
139
136
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
140
137
|
}
|
|
141
138
|
o.reset();
|
|
142
|
-
}),
|
|
139
|
+
}), x({
|
|
143
140
|
dynamicContent: {
|
|
144
|
-
insert:
|
|
145
|
-
close:
|
|
141
|
+
insert: T,
|
|
142
|
+
close: F
|
|
146
143
|
},
|
|
147
144
|
hasChanges: m,
|
|
148
|
-
saveSilent:
|
|
149
|
-
setLoading:
|
|
150
|
-
}), { __sfc: !0, PreviewContainer:
|
|
145
|
+
saveSilent: g,
|
|
146
|
+
setLoading: b
|
|
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 };
|
|
151
148
|
}
|
|
152
149
|
});
|
|
153
150
|
export {
|
|
154
|
-
|
|
151
|
+
ze as default
|
|
155
152
|
};
|
|
@@ -1,60 +1,53 @@
|
|
|
1
|
-
import { useConfigStore as
|
|
2
|
-
import {
|
|
3
|
-
import { storeToRefs as E } from "pinia";
|
|
1
|
+
import { useConfigStore as I } from "../stores/config.js";
|
|
2
|
+
import { storeToRefs as T } from "pinia";
|
|
4
3
|
const w = () => {
|
|
5
|
-
const
|
|
6
|
-
config:
|
|
7
|
-
initialized:
|
|
8
|
-
identity:
|
|
4
|
+
const e = I(), {
|
|
5
|
+
config: t,
|
|
6
|
+
initialized: o,
|
|
7
|
+
identity: r,
|
|
9
8
|
partner: i,
|
|
10
9
|
template: a,
|
|
11
10
|
editor: n,
|
|
12
|
-
ui:
|
|
13
|
-
features:
|
|
14
|
-
blocks:
|
|
15
|
-
compiler:
|
|
16
|
-
callbacks:
|
|
11
|
+
ui: s,
|
|
12
|
+
features: c,
|
|
13
|
+
blocks: u,
|
|
14
|
+
compiler: d,
|
|
15
|
+
callbacks: l,
|
|
17
16
|
templateId: p,
|
|
18
17
|
userId: f,
|
|
19
|
-
variationId:
|
|
20
|
-
partnerName:
|
|
18
|
+
variationId: m,
|
|
19
|
+
partnerName: g,
|
|
21
20
|
productType: b,
|
|
22
|
-
messageType:
|
|
21
|
+
messageType: C,
|
|
23
22
|
username: y,
|
|
24
|
-
showHeader:
|
|
25
|
-
} =
|
|
23
|
+
showHeader: E
|
|
24
|
+
} = T(e);
|
|
26
25
|
return {
|
|
27
26
|
// State refs
|
|
28
|
-
config:
|
|
29
|
-
initialized:
|
|
27
|
+
config: t,
|
|
28
|
+
initialized: o,
|
|
30
29
|
// Section refs
|
|
31
|
-
identity:
|
|
30
|
+
identity: r,
|
|
32
31
|
partner: i,
|
|
33
32
|
template: a,
|
|
34
33
|
editor: n,
|
|
35
|
-
ui:
|
|
36
|
-
features:
|
|
37
|
-
blocks:
|
|
38
|
-
compiler:
|
|
39
|
-
callbacks:
|
|
34
|
+
ui: s,
|
|
35
|
+
features: c,
|
|
36
|
+
blocks: u,
|
|
37
|
+
compiler: d,
|
|
38
|
+
callbacks: l,
|
|
40
39
|
// Convenience refs
|
|
41
40
|
templateId: p,
|
|
42
41
|
userId: f,
|
|
43
|
-
variationId:
|
|
44
|
-
partnerName:
|
|
42
|
+
variationId: m,
|
|
43
|
+
partnerName: g,
|
|
45
44
|
productType: b,
|
|
46
|
-
messageType:
|
|
45
|
+
messageType: C,
|
|
47
46
|
username: y,
|
|
48
|
-
showHeader:
|
|
47
|
+
showHeader: E,
|
|
49
48
|
// Methods
|
|
50
|
-
getConfig: () =>
|
|
51
|
-
isFeatureEnabled: (
|
|
52
|
-
isRrsSessionActive: () => {
|
|
53
|
-
if (!t.isFeatureEnabled("reusableRecommendationStrategy"))
|
|
54
|
-
return !1;
|
|
55
|
-
const e = C();
|
|
56
|
-
return e.hasAssignedStrategyBlocks || !e.hasPreRrsRecommendationBlocks;
|
|
57
|
-
}
|
|
49
|
+
getConfig: () => t.value,
|
|
50
|
+
isFeatureEnabled: (F) => e.isFeatureEnabled(F)
|
|
58
51
|
};
|
|
59
52
|
};
|
|
60
53
|
export {
|
|
@@ -1,67 +1,53 @@
|
|
|
1
|
-
import S from "../static/
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import w from "../static/styles/components/
|
|
17
|
-
import y from "../static/styles/components/
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import P from "../static/styles/components/wide-panel.css.js";
|
|
22
|
-
import x from "../static/styles/variables.css.js";
|
|
23
|
-
function r(t, o) {
|
|
24
|
-
return `--guido-icon-${t}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
|
|
25
|
-
}
|
|
26
|
-
const A = `:host {
|
|
27
|
-
${r("line-change", S)}
|
|
28
|
-
${r("line-delete", i)}
|
|
29
|
-
${r("line-plus", n)}
|
|
30
|
-
}`, R = [
|
|
31
|
-
x,
|
|
1
|
+
import S from "../static/styles/base.css.js";
|
|
2
|
+
import m from "../static/styles/components/alert-message.css.js";
|
|
3
|
+
import e from "../static/styles/components/amp-block.css.js";
|
|
4
|
+
import i from "../static/styles/components/base-input.css.js";
|
|
5
|
+
import p from "../static/styles/components/button-group.css.js";
|
|
6
|
+
import n from "../static/styles/components/button.css.js";
|
|
7
|
+
import s from "../static/styles/components/combobox.css.js";
|
|
8
|
+
import C from "../static/styles/components/counter.css.js";
|
|
9
|
+
import f from "../static/styles/components/dropdown-menu.css.js";
|
|
10
|
+
import a from "../static/styles/components/loader.css.js";
|
|
11
|
+
import u from "../static/styles/components/narrow-panel.css.js";
|
|
12
|
+
import c from "../static/styles/components/popup.css.js";
|
|
13
|
+
import d from "../static/styles/components/switcher.css.js";
|
|
14
|
+
import l from "../static/styles/components/tabs.css.js";
|
|
15
|
+
import h from "../static/styles/components/tools.css.js";
|
|
16
|
+
import w from "../static/styles/components/version-history.css.js";
|
|
17
|
+
import y from "../static/styles/components/wide-panel.css.js";
|
|
18
|
+
import B from "../static/styles/variables.css.js";
|
|
19
|
+
const b = [
|
|
20
|
+
B,
|
|
32
21
|
// Must be on top
|
|
33
|
-
|
|
34
|
-
p,
|
|
22
|
+
S,
|
|
35
23
|
// Must be on top
|
|
24
|
+
m,
|
|
25
|
+
e,
|
|
26
|
+
i,
|
|
27
|
+
p,
|
|
28
|
+
n,
|
|
36
29
|
s,
|
|
37
30
|
C,
|
|
38
|
-
a,
|
|
39
31
|
f,
|
|
40
|
-
|
|
32
|
+
a,
|
|
41
33
|
u,
|
|
42
|
-
|
|
34
|
+
c,
|
|
43
35
|
d,
|
|
36
|
+
l,
|
|
44
37
|
h,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
y,
|
|
48
|
-
b,
|
|
49
|
-
B,
|
|
50
|
-
$,
|
|
51
|
-
P,
|
|
52
|
-
w
|
|
53
|
-
// Last: overrides button.css / wide-panel.css defaults
|
|
38
|
+
w,
|
|
39
|
+
y
|
|
54
40
|
].join(`
|
|
55
41
|
|
|
56
|
-
`),
|
|
42
|
+
`), v = () => ({ importCss: () => {
|
|
57
43
|
const o = new CSSStyleSheet();
|
|
58
|
-
o.replaceSync(
|
|
59
|
-
const
|
|
60
|
-
if (!
|
|
44
|
+
o.replaceSync(b);
|
|
45
|
+
const r = document.querySelector("ui-editor");
|
|
46
|
+
if (!r)
|
|
61
47
|
return;
|
|
62
|
-
const
|
|
63
|
-
|
|
48
|
+
const t = r.shadowRoot;
|
|
49
|
+
t && (t.adoptedStyleSheets = [o]);
|
|
64
50
|
} });
|
|
65
51
|
export {
|
|
66
|
-
|
|
52
|
+
v as useCustomInterfaceAppearance
|
|
67
53
|
};
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
const M = () => ({
|
|
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 { sanitizeProductIds as x } from "../extensions/Blocks/Recommendation/utils/productIds.js";
|
|
7
|
+
import { useConfigStore as P } from "../stores/config.js";
|
|
8
|
+
const B = () => ({
|
|
10
9
|
calculateCardWidth: ({
|
|
11
|
-
mobileLeftPadding:
|
|
12
|
-
mobileRightPadding:
|
|
13
|
-
cardsInRow:
|
|
10
|
+
mobileLeftPadding: a,
|
|
11
|
+
mobileRightPadding: s,
|
|
12
|
+
cardsInRow: c,
|
|
14
13
|
unresponsive: n
|
|
15
14
|
}) => {
|
|
16
|
-
const
|
|
17
|
-
return (
|
|
15
|
+
const r = n ? c : 1, e = a + s + (r - 1) * b;
|
|
16
|
+
return (C - e) / r;
|
|
18
17
|
},
|
|
19
|
-
getRecommendationCampaignData: (
|
|
20
|
-
const
|
|
18
|
+
getRecommendationCampaignData: (a) => {
|
|
19
|
+
const s = l(), c = Number(a), n = s.blockStates[c];
|
|
21
20
|
if (!n)
|
|
22
21
|
return {
|
|
23
22
|
textTrimming: !1,
|
|
@@ -31,56 +30,49 @@ const M = () => ({
|
|
|
31
30
|
discountBeforeTextValue: "",
|
|
32
31
|
discountAfterTextValue: ""
|
|
33
32
|
};
|
|
34
|
-
const { recommendationConfigs:
|
|
33
|
+
const { recommendationConfigs: r } = n, e = r.orientation === "grid" ? "vertical" : "horizontal";
|
|
35
34
|
return {
|
|
36
|
-
textTrimming:
|
|
37
|
-
orientation:
|
|
35
|
+
textTrimming: r.textTrimming,
|
|
36
|
+
orientation: e,
|
|
38
37
|
mobileLeftPadding: 0,
|
|
39
38
|
mobileRightPadding: 0,
|
|
40
|
-
cardsInRow:
|
|
41
|
-
unresponsive:
|
|
39
|
+
cardsInRow: r.cardsInRow,
|
|
40
|
+
unresponsive: r.unresponsive,
|
|
42
41
|
priceBeforeTextValue: "",
|
|
43
42
|
priceAfterTextValue: "",
|
|
44
43
|
discountBeforeTextValue: "",
|
|
45
44
|
discountAfterTextValue: ""
|
|
46
45
|
};
|
|
47
46
|
},
|
|
48
|
-
buildCampaignUrl: (
|
|
49
|
-
var
|
|
50
|
-
const
|
|
47
|
+
buildCampaignUrl: (a, s) => {
|
|
48
|
+
var m;
|
|
49
|
+
const c = l(), n = P(), r = Number(a);
|
|
51
50
|
let e;
|
|
52
|
-
if (
|
|
53
|
-
e =
|
|
51
|
+
if (s)
|
|
52
|
+
e = s;
|
|
54
53
|
else {
|
|
55
|
-
const i =
|
|
54
|
+
const i = c.blockStates[r];
|
|
56
55
|
if (!i)
|
|
57
56
|
return "";
|
|
58
|
-
const { recommendationConfigs:
|
|
57
|
+
const { recommendationConfigs: o } = i;
|
|
59
58
|
e = {
|
|
60
|
-
strategy:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
shuffleProducts: r.shuffleProducts
|
|
59
|
+
strategy: o.strategy,
|
|
60
|
+
language: o.language,
|
|
61
|
+
currencyCode: o.currencySettings.value,
|
|
62
|
+
size: o.size,
|
|
63
|
+
productIds: o.productIds,
|
|
64
|
+
filters: o.filters,
|
|
65
|
+
shuffleProducts: o.shuffleProducts
|
|
68
66
|
};
|
|
69
67
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const g = ((l = C().find((i) => i.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
|
|
77
|
-
t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", n.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", n.variationId), e.strategy === "manualMerchandising" ? t.set("productId", S(e.productIds)) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
78
|
-
const p = e.filters.filter((i) => i.isValid), u = x(p);
|
|
79
|
-
u && t.set("filter", u), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(P(n.partnerName, e.strategy)).forEach(([i, r]) => t.set(i, r));
|
|
80
|
-
const y = decodeURIComponent(t.toString()), m = `${R.RECOMMENDATION_API_URL}/v2/${g}?${y}`;
|
|
81
|
-
return a.recommendationCampaignUrls[s] = m, m;
|
|
68
|
+
const f = ((m = I().find((i) => i.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
|
|
69
|
+
t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", n.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", n.variationId), e.strategy === "manualMerchandising" ? t.set("productId", x(e.productIds)) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
70
|
+
const g = e.filters.filter((i) => i.isValid), d = h(g);
|
|
71
|
+
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(y(n.partnerName, e.strategy)).forEach(([i, o]) => t.set(i, o));
|
|
72
|
+
const p = decodeURIComponent(t.toString()), u = `${R.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
|
|
73
|
+
return c.recommendationCampaignUrls[a] = u, u;
|
|
82
74
|
}
|
|
83
75
|
});
|
|
84
76
|
export {
|
|
85
|
-
|
|
77
|
+
B as useRecommendation
|
|
86
78
|
};
|