@useinsider/guido 3.17.0-beta.6cedc6c → 3.17.0-beta.6f780fd
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 +15 -13
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +6 -6
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +40 -35
- package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
- package/dist/components/organisms/header/AutoSaveStatus.vue2.js +21 -0
- package/dist/components/organisms/header/EditorActions.vue.js +13 -13
- package/dist/components/organisms/header/EditorActions.vue2.js +34 -50
- package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
- package/dist/components/organisms/header/EditorActionsMenu.vue2.js +39 -0
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
- package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
- package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
- package/dist/components/organisms/header/RightSlot.vue.js +7 -6
- package/dist/components/organisms/header/RightSlot.vue2.js +17 -15
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +24 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +18 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +74 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +43 -34
- package/dist/composables/useAccessibilityApi.js +31 -0
- package/dist/composables/useCustomInterfaceAppearance.js +31 -28
- package/dist/composables/useStripo.js +14 -14
- package/dist/config/i18n/en/labels.json.js +29 -5
- package/dist/config/migrator/index.js +9 -8
- package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
- package/dist/config/migrator/recommendation/extractors.js +29 -24
- package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
- package/dist/config/migrator/recommendationMigrator.js +30 -25
- package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
- package/dist/extensions/Blocks/Recommendation/block.js +12 -11
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +24 -22
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +329 -257
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +107 -105
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
- package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
- package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +9 -9
- package/dist/guido.css +1 -1
- package/dist/node_modules/@vueuse/core/index.js +102 -0
- package/dist/node_modules/@vueuse/shared/index.js +40 -28
- package/dist/sprite.svg +6 -0
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
- package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
- package/dist/src/composables/useAccessibilityApi.d.ts +15 -0
- package/dist/src/composables/useActionsApi.d.ts +2 -2
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
- package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/stores/editor.d.ts +76 -0
- package/dist/src/stores/onboarding.d.ts +377 -0
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/timeUtil.d.ts +10 -0
- package/dist/static/styles/components/accessibility.css.js +137 -0
- package/dist/static/styles/customEditorStyle.css.js +3 -1
- package/dist/static/styles/variables.css.js +1 -0
- package/dist/stores/editor.js +4 -1
- package/dist/stores/onboarding.js +16 -11
- package/dist/utils/timeUtil.js +7 -17
- package/package.json +1 -1
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
- /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → AutoSaveStatus.vue.d.ts} +0 -0
|
@@ -1,65 +1,66 @@
|
|
|
1
1
|
var m = Object.defineProperty;
|
|
2
2
|
var C = (h, l, t) => l in h ? m(h, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[l] = t;
|
|
3
|
-
var
|
|
3
|
+
var n = (h, l, t) => C(h, typeof l != "symbol" ? l + "" : l, t);
|
|
4
4
|
import { useConfig as p } from "../../../../../composables/useConfig.js";
|
|
5
5
|
import { ModificationDescription as y } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
6
|
import { CommonControl as N } from "../../../common-control.js";
|
|
7
7
|
import { CURRENT_CONFIG_VERSION as _, DEFAULT_NODE_CONFIG as a } from "../../constants/defaultConfig.js";
|
|
8
|
+
import { RECOMMENDATION_ID_ATTR as I } from "../../constants/selectors.js";
|
|
8
9
|
import { RecommendationConfigService as c } from "../../services/configService.js";
|
|
9
|
-
import { useRecommendationExtensionStore as
|
|
10
|
-
import { registerNodeConfigWriter as
|
|
11
|
-
import { AlgorithmControl as
|
|
12
|
-
import { ALGORITHM_CONTROL_ID as
|
|
13
|
-
import { CurrencyControl as
|
|
14
|
-
import { CURRENCY_CONTROL_ID as
|
|
15
|
-
import { FiltersControl as
|
|
16
|
-
import { FILTERS_CONTROL_ID as
|
|
17
|
-
import { LayoutOrientationControl as
|
|
18
|
-
import { LAYOUT_ORIENTATION_CONTROL_ID as
|
|
19
|
-
import { LocaleControl as
|
|
20
|
-
import { LOCALE_CONTROL_ID as
|
|
21
|
-
import { PricePlacementControl as
|
|
22
|
-
import { PRICE_PLACEMENT_CONTROL_ID as
|
|
23
|
-
import { ProductCountControl as
|
|
24
|
-
import { PRODUCT_COUNT_CONTROL_ID as
|
|
25
|
-
import { ProductLayoutControl as
|
|
26
|
-
import { PRODUCT_LAYOUT_CONTROL_ID as
|
|
27
|
-
import { ShuffleControl as
|
|
28
|
-
import { SHUFFLE_CONTROL_ID as
|
|
29
|
-
import { StrategyControl as
|
|
30
|
-
import { STRATEGY_CONTROL_ID as
|
|
31
|
-
import { setCurrencyAttributes as
|
|
32
|
-
import { adjustProductsToSize as
|
|
10
|
+
import { useRecommendationExtensionStore as R } from "../../store/recommendation.js";
|
|
11
|
+
import { registerNodeConfigWriter as b } from "../../utils/nodeConfigWriter.js";
|
|
12
|
+
import { AlgorithmControl as T } from "./algorithm.js";
|
|
13
|
+
import { ALGORITHM_CONTROL_ID as ut } from "./algorithm.js";
|
|
14
|
+
import { CurrencyControl as P } from "./currency.js";
|
|
15
|
+
import { CURRENCY_CONTROL_ID as ht } from "./currency.js";
|
|
16
|
+
import { FiltersControl as S } from "./filters.js";
|
|
17
|
+
import { FILTERS_CONTROL_ID as gt } from "./filters.js";
|
|
18
|
+
import { LayoutOrientationControl as O } from "./layoutOrientation.js";
|
|
19
|
+
import { LAYOUT_ORIENTATION_CONTROL_ID as Ct } from "./layoutOrientation.js";
|
|
20
|
+
import { LocaleControl as L } from "./locale.js";
|
|
21
|
+
import { LOCALE_CONTROL_ID as yt } from "./locale.js";
|
|
22
|
+
import { PricePlacementControl as E } from "./pricePlacement.js";
|
|
23
|
+
import { PRICE_PLACEMENT_CONTROL_ID as _t } from "./pricePlacement.js";
|
|
24
|
+
import { ProductCountControl as k } from "./productCount.js";
|
|
25
|
+
import { PRODUCT_COUNT_CONTROL_ID as Rt } from "./productCount.js";
|
|
26
|
+
import { ProductLayoutControl as D } from "./productLayout.js";
|
|
27
|
+
import { PRODUCT_LAYOUT_CONTROL_ID as Tt } from "./productLayout.js";
|
|
28
|
+
import { ShuffleControl as F } from "./shuffle.js";
|
|
29
|
+
import { SHUFFLE_CONTROL_ID as St } from "./shuffle.js";
|
|
30
|
+
import { StrategyControl as w } from "./strategy.js";
|
|
31
|
+
import { STRATEGY_CONTROL_ID as Lt } from "./strategy.js";
|
|
32
|
+
import { setCurrencyAttributes as A, getBlockElement as v, isPartnerManagedBlock as x, updateProductContentInPlace as B, regenerateProductRowsWithStyles as U } from "./utils.js";
|
|
33
|
+
import { adjustProductsToSize as kt, formatProductPrice as Dt, getCardComposition as Ft, getCurrentLayout as wt, getMainContainerTbody as At, regenerateMobileProductRows as vt, updatePricesInPlace as xt, updateSingleProductContent as Bt } from "./utils.js";
|
|
33
34
|
import { useDebounceFn as f } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
34
|
-
const
|
|
35
|
-
class
|
|
35
|
+
const $ = "ui-elements-recommendation-block";
|
|
36
|
+
class at extends N {
|
|
36
37
|
constructor() {
|
|
37
38
|
super(...arguments);
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
n(this, "store", R());
|
|
40
|
+
n(this, "storeUnsubscription", () => {
|
|
40
41
|
});
|
|
41
42
|
// blockId -> fingerprint of the node config as it looked at the last sync.
|
|
42
|
-
|
|
43
|
+
n(this, "syncedConfigs", /* @__PURE__ */ new Map());
|
|
43
44
|
// A config change waiting to reach the node config. Deferred so it can ride the
|
|
44
45
|
// re-render's single apply() — one user action must cost one undo press.
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
n(this, "pendingNodeConfigWrite", null);
|
|
47
|
+
n(this, "pendingConfigFlushTimer", null);
|
|
47
48
|
// Sub-control instances for lifecycle management
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
n(this, "algorithmControl", null);
|
|
50
|
+
n(this, "localeControl", null);
|
|
51
|
+
n(this, "currencyControl", null);
|
|
52
|
+
n(this, "productCountControl", null);
|
|
53
|
+
n(this, "productLayoutControl", null);
|
|
54
|
+
n(this, "filtersControl", null);
|
|
55
|
+
n(this, "shuffleControl", null);
|
|
56
|
+
n(this, "pricePlacementControl", null);
|
|
57
|
+
n(this, "layoutOrientationControl", null);
|
|
58
|
+
n(this, "strategyControl", null);
|
|
59
|
+
n(this, "rrsEnabled", !1);
|
|
59
60
|
/**
|
|
60
61
|
* Debounced product fetch to prevent rapid API calls during config changes
|
|
61
62
|
*/
|
|
62
|
-
|
|
63
|
+
n(this, "_debouncedFetchProducts", f(async () => {
|
|
63
64
|
try {
|
|
64
65
|
await this.store.fetchRecommendationProducts();
|
|
65
66
|
} finally {
|
|
@@ -77,20 +78,20 @@ class st extends N {
|
|
|
77
78
|
* count. The store pads products to the configured size, so in-place only
|
|
78
79
|
* fails when the size actually changed.
|
|
79
80
|
*/
|
|
80
|
-
|
|
81
|
+
n(this, "_debouncedRegenerateWithProducts", f(() => {
|
|
81
82
|
const t = this.store.recommendationProducts;
|
|
82
83
|
if (!this.currentNode || !this.api)
|
|
83
84
|
return;
|
|
84
85
|
const e = this.api.getDocumentModifier(), o = this._stagePendingNodeConfig(e);
|
|
85
|
-
if (
|
|
86
|
+
if (x(this.currentNode)) {
|
|
86
87
|
o && (e.apply(new y("Update recommendation configuration")), this.pendingNodeConfigWrite = null, this._clearConfigFlush());
|
|
87
88
|
return;
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
+
B({
|
|
90
91
|
currentNode: this.currentNode,
|
|
91
92
|
documentModifier: e,
|
|
92
93
|
products: t
|
|
93
|
-
}) ||
|
|
94
|
+
}) || U({
|
|
94
95
|
currentNode: this.currentNode,
|
|
95
96
|
documentModifier: e,
|
|
96
97
|
products: t
|
|
@@ -119,7 +120,7 @@ class st extends N {
|
|
|
119
120
|
return this.rrsEnabled = p().isFeatureEnabled("reusableRecommendationStrategy"), this._subControls.forEach((e) => {
|
|
120
121
|
var o;
|
|
121
122
|
return (o = e == null ? void 0 : e.onDestroy) == null ? void 0 : o.call(e);
|
|
122
|
-
}), this.algorithmControl = new
|
|
123
|
+
}), this.algorithmControl = new T(), this.localeControl = new L(), this.currencyControl = new P(), this.productCountControl = new k(), this.productLayoutControl = new D(), this.filtersControl = new S(), this.shuffleControl = new F(), this.pricePlacementControl = new E(), this.layoutOrientationControl = new O(), this.strategyControl = this.rrsEnabled ? new w() : null, this._subControls.forEach((e) => {
|
|
123
124
|
e && (e.api = this.api);
|
|
124
125
|
}), `
|
|
125
126
|
<div class="recommendation-controls-container">
|
|
@@ -141,12 +142,12 @@ class st extends N {
|
|
|
141
142
|
const e = (i = this.getContainer()) == null ? void 0 : i.querySelector(".recommendation-controls-container");
|
|
142
143
|
if (!e)
|
|
143
144
|
return;
|
|
144
|
-
const o = this._getRecommendationIdFromNode(t) === null ? null : c.getConfig(t),
|
|
145
|
-
e.classList.toggle("strategy-block",
|
|
145
|
+
const o = this._getRecommendationIdFromNode(t) === null ? null : c.getConfig(t), r = this.rrsEnabled && !!o && (!!(o != null && o.strategyId) || ((o == null ? void 0 : o.configVersion) ?? 0) >= _);
|
|
146
|
+
e.classList.toggle("strategy-block", r);
|
|
146
147
|
}
|
|
147
148
|
async onRender() {
|
|
148
149
|
var o;
|
|
149
|
-
|
|
150
|
+
b(this.api);
|
|
150
151
|
const t = this._getRecommendationIdFromNode(this.currentNode), e = t ?? this.store.currentRecommendationId;
|
|
151
152
|
if (e !== null && this.store.setCurrentBlock(e), t !== null && this._syncNodeConfigIfChanged(t), this._listenStateUpdates(), this._showControlsForBlock(this.currentNode), e !== null && ((o = this.store.blockStates[e]) != null && o.isInitialized)) {
|
|
152
153
|
this._initializeSubControls();
|
|
@@ -160,9 +161,9 @@ class st extends N {
|
|
|
160
161
|
const e = this._getRecommendationIdFromNode(t);
|
|
161
162
|
e !== null && e !== this.store.currentRecommendationId && this.store.setCurrentBlock(e), e !== null && this._syncNodeConfigIfChanged(e), this._showControlsForBlock(t), e !== null && !((o = this.store.blockStates[e]) != null && o.isInitialized) && this._fetchBlockData(e).then(() => {
|
|
162
163
|
this._initializeSubControls();
|
|
163
|
-
}), this._subControls.forEach((
|
|
164
|
+
}), this._subControls.forEach((r) => {
|
|
164
165
|
var i;
|
|
165
|
-
|
|
166
|
+
r != null && r.api && (r.currentNode = t, (i = r.onTemplateNodeUpdated) == null || i.call(r, t));
|
|
166
167
|
});
|
|
167
168
|
}
|
|
168
169
|
onDestroy() {
|
|
@@ -209,11 +210,11 @@ class st extends N {
|
|
|
209
210
|
const t = this.store.currentRecommendationId;
|
|
210
211
|
if (!this.currentNode || !this.api || t === null)
|
|
211
212
|
return;
|
|
212
|
-
const { filters: e, strategyId: o, size:
|
|
213
|
+
const { filters: e, strategyId: o, size: r } = this.store.recommendationConfigs;
|
|
213
214
|
this.pendingNodeConfigWrite = {
|
|
214
215
|
blockId: t,
|
|
215
216
|
node: this.currentNode,
|
|
216
|
-
updates: { filters: e, strategyId: o, size:
|
|
217
|
+
updates: { filters: e, strategyId: o, size: r }
|
|
217
218
|
};
|
|
218
219
|
}
|
|
219
220
|
/**
|
|
@@ -256,8 +257,8 @@ class st extends N {
|
|
|
256
257
|
JSON.stringify(o.filters) === JSON.stringify(t.updates.filters) && o.strategyId === t.updates.strategyId && o.size === t.updates.size || c.updateConfig(this.api, e, t.updates, "Update recommendation filters");
|
|
257
258
|
}
|
|
258
259
|
_syncNodeConfigToStore() {
|
|
259
|
-
var
|
|
260
|
-
const t = c.getConfig(this.currentNode), e = this.store.currentRecommendationId, o = e !== null && ((
|
|
260
|
+
var r;
|
|
261
|
+
const t = c.getConfig(this.currentNode), e = this.store.currentRecommendationId, o = e !== null && ((r = this.store.blockStates[e]) == null ? void 0 : r.isInitialized);
|
|
261
262
|
this.store.patchCurrentBlockConfig({
|
|
262
263
|
strategy: t.strategy,
|
|
263
264
|
strategyId: t.strategyId,
|
|
@@ -299,8 +300,8 @@ class st extends N {
|
|
|
299
300
|
t !== null && this.store.markBlockInitialized(t), (await Promise.allSettled([
|
|
300
301
|
this.store.fetchRecommendationCreateData(),
|
|
301
302
|
this.store.fetchRecommendationFilters()
|
|
302
|
-
])).forEach((o,
|
|
303
|
-
o.status === "rejected" && console.warn(`Recommendation block: ${["fetchRecommendationCreateData", "fetchRecommendationFilters"][
|
|
303
|
+
])).forEach((o, r) => {
|
|
304
|
+
o.status === "rejected" && console.warn(`Recommendation block: ${["fetchRecommendationCreateData", "fetchRecommendationFilters"][r]} failed`, o.reason);
|
|
304
305
|
}), this._applySmartDefaults();
|
|
305
306
|
try {
|
|
306
307
|
await this.store.fetchRecommendationProducts();
|
|
@@ -322,7 +323,7 @@ class st extends N {
|
|
|
322
323
|
if (!this.currentNode || !this.api)
|
|
323
324
|
return;
|
|
324
325
|
const t = c.getConfig(this.currentNode), e = {};
|
|
325
|
-
let o = null,
|
|
326
|
+
let o = null, r = null, i = null;
|
|
326
327
|
if (t.currency.code === a.currency.code) {
|
|
327
328
|
const { currencyList: s } = this.store;
|
|
328
329
|
s.length > 0 && (s.some(
|
|
@@ -337,7 +338,7 @@ class st extends N {
|
|
|
337
338
|
const s = this.store.getActivePredictiveAlgorithms;
|
|
338
339
|
s.length > 0 && (s.some(
|
|
339
340
|
(d) => d.value === a.strategy
|
|
340
|
-
) || (
|
|
341
|
+
) || (r = s[0].value, e.strategy = r));
|
|
341
342
|
}
|
|
342
343
|
if (t.language === a.language) {
|
|
343
344
|
const s = this.store.getLanguages;
|
|
@@ -345,12 +346,12 @@ class st extends N {
|
|
|
345
346
|
(d) => d.value === a.language
|
|
346
347
|
) || (i = s[0].value, e.language = i));
|
|
347
348
|
}
|
|
348
|
-
!o && !
|
|
349
|
+
!o && !r && !i || (c.updateConfig(
|
|
349
350
|
this.api,
|
|
350
351
|
this.currentNode,
|
|
351
352
|
e,
|
|
352
353
|
"Applied smart defaults"
|
|
353
|
-
), o && e.currency &&
|
|
354
|
+
), o && e.currency && A({
|
|
354
355
|
currentNode: this.currentNode,
|
|
355
356
|
documentModifier: this.api.getDocumentModifier(),
|
|
356
357
|
currency: e.currency
|
|
@@ -366,7 +367,7 @@ class st extends N {
|
|
|
366
367
|
thousandSeparator: a.currency.thousandSeparator
|
|
367
368
|
}
|
|
368
369
|
} : {},
|
|
369
|
-
...
|
|
370
|
+
...r ? { strategy: r } : {},
|
|
370
371
|
...i ? { language: i } : {}
|
|
371
372
|
}, { triggerRefetch: !1 }));
|
|
372
373
|
}
|
|
@@ -374,14 +375,14 @@ class st extends N {
|
|
|
374
375
|
* Reads the recommendation-id attribute from the block element within the node
|
|
375
376
|
*/
|
|
376
377
|
_getRecommendationIdFromNode(t) {
|
|
377
|
-
const e =
|
|
378
|
+
const e = v(t);
|
|
378
379
|
if (!e || !("getAttribute" in e))
|
|
379
380
|
return null;
|
|
380
|
-
const o = e.getAttribute(
|
|
381
|
+
const o = e.getAttribute(I);
|
|
381
382
|
if (!o)
|
|
382
383
|
return null;
|
|
383
|
-
const
|
|
384
|
-
return Number.isNaN(
|
|
384
|
+
const r = parseInt(o);
|
|
385
|
+
return Number.isNaN(r) ? null : r;
|
|
385
386
|
}
|
|
386
387
|
/**
|
|
387
388
|
* Listen to store changes that require product refresh or regeneration.
|
|
@@ -398,11 +399,11 @@ class st extends N {
|
|
|
398
399
|
*/
|
|
399
400
|
_listenStateUpdates() {
|
|
400
401
|
const { store: t } = this;
|
|
401
|
-
let e = t.recommendationProducts, o = t.$state.configVersion,
|
|
402
|
+
let e = t.recommendationProducts, o = t.$state.configVersion, r = t.currentRecommendationId;
|
|
402
403
|
this.storeUnsubscription = t.$subscribe(() => {
|
|
403
404
|
const i = t.currentRecommendationId;
|
|
404
|
-
if (i !==
|
|
405
|
-
|
|
405
|
+
if (i !== r) {
|
|
406
|
+
r = i, e = t.recommendationProducts, o = t.$state.configVersion;
|
|
406
407
|
return;
|
|
407
408
|
}
|
|
408
409
|
const s = t.$state.configVersion;
|
|
@@ -413,38 +414,39 @@ class st extends N {
|
|
|
413
414
|
}
|
|
414
415
|
}
|
|
415
416
|
export {
|
|
416
|
-
|
|
417
|
-
|
|
417
|
+
ut as ALGORITHM_CONTROL_ID,
|
|
418
|
+
T as AlgorithmControl,
|
|
418
419
|
$ as CONTROL_BLOCK_ID,
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
420
|
+
ht as CURRENCY_CONTROL_ID,
|
|
421
|
+
P as CurrencyControl,
|
|
422
|
+
gt as FILTERS_CONTROL_ID,
|
|
423
|
+
S as FiltersControl,
|
|
424
|
+
Ct as LAYOUT_ORIENTATION_CONTROL_ID,
|
|
425
|
+
yt as LOCALE_CONTROL_ID,
|
|
426
|
+
O as LayoutOrientationControl,
|
|
427
|
+
L as LocaleControl,
|
|
428
|
+
_t as PRICE_PLACEMENT_CONTROL_ID,
|
|
429
|
+
Rt as PRODUCT_COUNT_CONTROL_ID,
|
|
430
|
+
Tt as PRODUCT_LAYOUT_CONTROL_ID,
|
|
431
|
+
E as PricePlacementControl,
|
|
432
|
+
k as ProductCountControl,
|
|
433
|
+
D as ProductLayoutControl,
|
|
434
|
+
at as RecommendationBlockControl,
|
|
435
|
+
St as SHUFFLE_CONTROL_ID,
|
|
436
|
+
Lt as STRATEGY_CONTROL_ID,
|
|
437
|
+
F as ShuffleControl,
|
|
438
|
+
w as StrategyControl,
|
|
439
|
+
kt as adjustProductsToSize,
|
|
440
|
+
Dt as formatProductPrice,
|
|
441
|
+
v as getBlockElement,
|
|
442
|
+
Ft as getCardComposition,
|
|
443
|
+
wt as getCurrentLayout,
|
|
444
|
+
At as getMainContainerTbody,
|
|
445
|
+
x as isPartnerManagedBlock,
|
|
446
|
+
vt as regenerateMobileProductRows,
|
|
447
|
+
U as regenerateProductRowsWithStyles,
|
|
448
|
+
A as setCurrencyAttributes,
|
|
449
|
+
xt as updatePricesInPlace,
|
|
450
|
+
B as updateProductContentInPlace,
|
|
451
|
+
Bt as updateSingleProductContent
|
|
450
452
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createPaddingsControl as r, createTextBackgroundColorControl as T, createTextFontFamilyControl as e, createTextStyleControl as l, createTextSizeControl as C, createTextColorControl as c, createTextAlignControl as I } from "../../../controlFactories.js";
|
|
2
|
+
import { RecommendationBlockId as o } from "../../constants/blockIds.js";
|
|
3
|
+
import { RecommendationControlId as t } from "../../constants/controlIds.js";
|
|
4
|
+
import { BLOCK_ROOT_SELECTOR as n } from "../../constants/selectors.js";
|
|
5
|
+
const L = I(
|
|
6
|
+
t.TITLE_ALIGN,
|
|
7
|
+
o.TITLE,
|
|
8
|
+
n
|
|
9
|
+
), a = c(
|
|
10
|
+
t.TITLE_COLOR,
|
|
11
|
+
o.TITLE,
|
|
12
|
+
n
|
|
13
|
+
), i = C(
|
|
14
|
+
t.TITLE_SIZE,
|
|
15
|
+
o.TITLE,
|
|
16
|
+
n
|
|
17
|
+
), E = l(
|
|
18
|
+
t.TITLE_STYLE,
|
|
19
|
+
o.TITLE,
|
|
20
|
+
n
|
|
21
|
+
), m = e(
|
|
22
|
+
t.TITLE_FONT_FAMILY,
|
|
23
|
+
o.TITLE,
|
|
24
|
+
n
|
|
25
|
+
), s = T(
|
|
26
|
+
t.TITLE_BACKGROUND,
|
|
27
|
+
o.TITLE,
|
|
28
|
+
n
|
|
29
|
+
), d = r(
|
|
30
|
+
t.TITLE_PADDINGS,
|
|
31
|
+
o.TITLE,
|
|
32
|
+
n
|
|
33
|
+
), x = {
|
|
34
|
+
align: L,
|
|
35
|
+
color: a,
|
|
36
|
+
size: i,
|
|
37
|
+
style: E,
|
|
38
|
+
fontFamily: m,
|
|
39
|
+
background: s,
|
|
40
|
+
paddings: d
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
x as TitleControls
|
|
44
|
+
};
|
|
@@ -5,23 +5,24 @@ import { RecommendationBlockControl as i } from "./controls/main/index.js";
|
|
|
5
5
|
import "./constants/selectors.js";
|
|
6
6
|
import "./store/recommendation.js";
|
|
7
7
|
import "./utils/captureStyleTemplates.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import R from "./
|
|
23
|
-
import
|
|
24
|
-
|
|
8
|
+
import { TitleControls as e } from "./controls/title/index.js";
|
|
9
|
+
import { NameControls as l } from "./controls/name/index.js";
|
|
10
|
+
import { PriceControls as s } from "./controls/price/index.js";
|
|
11
|
+
import { OldPriceControls as p } from "./controls/oldPrice/index.js";
|
|
12
|
+
import { OmnibusPriceControls as a } from "./controls/omnibusPrice/index.js";
|
|
13
|
+
import { OmnibusDiscountControls as c } from "./controls/omnibusDiscount/index.js";
|
|
14
|
+
import { ButtonControls as C } from "./controls/button/index.js";
|
|
15
|
+
import { ImageControls as f } from "./controls/image/index.js";
|
|
16
|
+
import { CustomAttributeControls as d } from "./controls/customAttribute/index.js";
|
|
17
|
+
import { SpacingControl as u } from "./controls/spacing/index.js";
|
|
18
|
+
import { BlockBackgroundColorControl as g } from "./controls/blockBackground/index.js";
|
|
19
|
+
import { CardBackgroundColorControl as y } from "./controls/cardBackground/index.js";
|
|
20
|
+
import { RecommendationCardCompositionControl as B } from "./controls/cardComposition/index.js";
|
|
21
|
+
import { SyncInfoMessageControl as P } from "./controls/syncInfoMessage.js";
|
|
22
|
+
import { RecommendationIconsRegistry as R } from "./iconsRegistry.js";
|
|
23
|
+
import S from "./recommendation.css.js";
|
|
24
|
+
import { SettingsPanel as k } from "./settingsPanel.js";
|
|
25
|
+
const w = [
|
|
25
26
|
e,
|
|
26
27
|
l,
|
|
27
28
|
s,
|
|
@@ -29,21 +30,22 @@ const k = [
|
|
|
29
30
|
a,
|
|
30
31
|
c,
|
|
31
32
|
C,
|
|
32
|
-
f
|
|
33
|
-
|
|
33
|
+
f,
|
|
34
|
+
d
|
|
35
|
+
], b = [
|
|
34
36
|
i,
|
|
35
|
-
u,
|
|
36
37
|
g,
|
|
37
|
-
d,
|
|
38
38
|
y,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
u,
|
|
40
|
+
B,
|
|
41
|
+
P
|
|
42
|
+
], v = [
|
|
43
|
+
...b,
|
|
44
|
+
...w.flatMap((o) => Object.values(o))
|
|
45
|
+
], Y = v.reduce(
|
|
44
46
|
(o, r) => o.addControl(r),
|
|
45
|
-
new t().addBlock(m).withSettingsPanelRegistry(
|
|
46
|
-
).addStyles(
|
|
47
|
+
new t().addBlock(m).withSettingsPanelRegistry(k)
|
|
48
|
+
).addStyles(S).withPreviewStyles(n).withIconsRegistry(R).build();
|
|
47
49
|
export {
|
|
48
|
-
|
|
50
|
+
Y as default
|
|
49
51
|
};
|
|
@@ -3,9 +3,10 @@ import { BLOCK_ID as R } from "./block.js";
|
|
|
3
3
|
import { RecommendationBlockId as S } from "./constants/blockIds.js";
|
|
4
4
|
import { RecommendationControlId as T } from "./constants/controlIds.js";
|
|
5
5
|
import "./constants/selectors.js";
|
|
6
|
-
import { CONTROL_BLOCK_ID as
|
|
6
|
+
import { CONTROL_BLOCK_ID as L } from "./controls/main/index.js";
|
|
7
7
|
import "./store/recommendation.js";
|
|
8
8
|
import "./utils/captureStyleTemplates.js";
|
|
9
|
+
import "./controls/title/index.js";
|
|
9
10
|
import "./controls/name/index.js";
|
|
10
11
|
import "./controls/price/index.js";
|
|
11
12
|
import "./controls/oldPrice/index.js";
|
|
@@ -15,7 +16,7 @@ import "./controls/button/index.js";
|
|
|
15
16
|
import "./controls/image/index.js";
|
|
16
17
|
import { SPACING_CONTROL_ID as A } from "./controls/spacing/index.js";
|
|
17
18
|
import "./controls/blockBackground/index.js";
|
|
18
|
-
import { CARD_BACKGROUND_COLOR_CONTROL_ID as
|
|
19
|
+
import { CARD_BACKGROUND_COLOR_CONTROL_ID as U } from "./controls/cardBackground/index.js";
|
|
19
20
|
import { COMPOSITION_CONTROL_BLOCK_ID as D } from "./controls/cardComposition/index.js";
|
|
20
21
|
import { SYNC_INFO_MESSAGE_CONTROL_ID as N } from "./controls/syncInfoMessage.js";
|
|
21
22
|
class s extends E {
|
|
@@ -24,7 +25,7 @@ class s extends E {
|
|
|
24
25
|
new _(
|
|
25
26
|
I.SETTINGS,
|
|
26
27
|
[
|
|
27
|
-
|
|
28
|
+
L,
|
|
28
29
|
C.EXTERNAL_INDENTS
|
|
29
30
|
]
|
|
30
31
|
),
|
|
@@ -32,7 +33,7 @@ class s extends E {
|
|
|
32
33
|
I.STYLES,
|
|
33
34
|
[
|
|
34
35
|
T.BLOCK_BACKGROUND,
|
|
35
|
-
|
|
36
|
+
U,
|
|
36
37
|
A
|
|
37
38
|
]
|
|
38
39
|
),
|
|
@@ -42,6 +43,24 @@ class s extends E {
|
|
|
42
43
|
D
|
|
43
44
|
]
|
|
44
45
|
).withLabel(this.api.translate("Card Composition"))
|
|
46
|
+
], O[S.TITLE] = [
|
|
47
|
+
new _(
|
|
48
|
+
I.SETTINGS,
|
|
49
|
+
[
|
|
50
|
+
T.TITLE_STYLE,
|
|
51
|
+
T.TITLE_ALIGN,
|
|
52
|
+
T.TITLE_PADDINGS
|
|
53
|
+
]
|
|
54
|
+
),
|
|
55
|
+
new _(
|
|
56
|
+
I.STYLES,
|
|
57
|
+
[
|
|
58
|
+
T.TITLE_BACKGROUND,
|
|
59
|
+
T.TITLE_FONT_FAMILY,
|
|
60
|
+
T.TITLE_SIZE,
|
|
61
|
+
T.TITLE_COLOR
|
|
62
|
+
]
|
|
63
|
+
)
|
|
45
64
|
], O[S.NAME] = [
|
|
46
65
|
new _(
|
|
47
66
|
I.SETTINGS,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ATTR_PRODUCT_PRICE as f, ATTR_PRODUCT_OLD_PRICE as O } from "../../constants/selectors.js";
|
|
2
2
|
import { DEFAULT_PRODUCTS_PER_ROW as w } from "../../constants/layout.js";
|
|
3
|
-
import {
|
|
3
|
+
import { createBlockTemplate as A, getDefaultProducts as g, DEFAULTS as U, buildSpacer as h, DEFAULT_CARD_COMPOSITION as Y, buildElementRenderer as B, resolveInlinePriceOrder as F, buildCellOptions as I, DEFAULT_CARD_VISIBILITY as W } from "../utils.js";
|
|
4
4
|
import { DEFAULT_CELL_PADDING as k, renderInlineGridPriceCell as H, buildFillerCell as x, gridElementRenderer as y } from "./elementRenderer.js";
|
|
5
5
|
const G = `
|
|
6
6
|
<tr class="recommendation-product-row">
|
|
@@ -69,8 +69,8 @@ function M(t, r, o, e = {}, c = {}) {
|
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
function Q(t) {
|
|
72
|
-
const r = t ? `ins-recommendation-v3-block-${t}` : void 0, o =
|
|
73
|
-
return o.replace("{-{-TITLE-}-}",
|
|
72
|
+
const r = t ? `ins-recommendation-v3-block-${t}` : void 0, o = A("grid", r), e = g(), c = M(e, w);
|
|
73
|
+
return o.replace("{-{-TITLE-}-}", U.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
|
|
74
74
|
}
|
|
75
75
|
export {
|
|
76
76
|
Q as getDefaultTemplate,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RecommendationBlockId as r } from "../constants/blockIds.js";
|
|
2
|
+
import { DEFAULT_ROW_SPACING as l } from "../constants/layout.js";
|
|
3
|
+
import { CSS_CLASS_ATTRIBUTE_ROW as d, ATTR_RECOMMENDATION_TITLE as n, ATTR_DATA_VISIBILITY as A, CSS_CLASS_TITLE_CELL as _, CSS_CLASS_SPACER as c } from "../constants/selectors.js";
|
|
4
|
+
const a = "You May Also Like!", i = '<p style="font-size: 28px; color: #333333;"><strong>{-{-TITLE-}-}</strong></p>';
|
|
5
|
+
function E(s = i, t = !0, T = l) {
|
|
6
|
+
const e = `class="${d}" data-attribute-type="${n}" ${A}="${t ? "1" : "0"}"`, o = t ? "" : ' style="display: none;"';
|
|
7
|
+
return `
|
|
8
|
+
<tr ${e}${o}>
|
|
9
|
+
<td>
|
|
10
|
+
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
|
11
|
+
<tbody>
|
|
12
|
+
<tr>
|
|
13
|
+
<td
|
|
14
|
+
class="esd-block-text ${_} es-p10t es-p10b es-p20l es-p20r"
|
|
15
|
+
align="center"
|
|
16
|
+
esd-extension-block-id="${r.TITLE}">
|
|
17
|
+
${s}
|
|
18
|
+
</td>
|
|
19
|
+
</tr>
|
|
20
|
+
</tbody>
|
|
21
|
+
</table>
|
|
22
|
+
</td>
|
|
23
|
+
</tr>
|
|
24
|
+
<tr ${e}${o}>
|
|
25
|
+
<td class="${c}" style="height: ${T}px;"></td>
|
|
26
|
+
</tr>
|
|
27
|
+
`;
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
i as DEFAULT_TITLE_PARAGRAPH,
|
|
31
|
+
a as DEFAULT_TITLE_TEXT,
|
|
32
|
+
E as buildTitleRows
|
|
33
|
+
};
|