@useinsider/guido 3.17.0-beta.17c2940 → 3.17.0-beta.211abaf
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/config/i18n/en/labels.json.js +29 -5
- package/dist/config/i18n/en/tooltips.json.js +2 -1
- package/dist/extensions/Blocks/Recommendation/block.js +12 -11
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +14 -13
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +107 -106
- 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/extensions/Blocks/Recommendation/constants/selectors.d.ts +2 -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 +140 -0
- 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
|
@@ -6,15 +6,16 @@ import { BlockId as y } from "../../../enums/block.js";
|
|
|
6
6
|
import { getMigrationBannerHtml as C } from "../../../utils/migrationBannerHtml.js";
|
|
7
7
|
import { Block as b, BlockCompositionType as A, ModificationDescription as g } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
8
8
|
import { CURRENT_CONFIG_VERSION as E, PRE_RRS_CONFIG_VERSION as S } from "./constants/defaultConfig.js";
|
|
9
|
+
import { RECOMMENDATION_ID_ATTR as m } from "./constants/selectors.js";
|
|
9
10
|
import { regenerateMobileProductRows as N } from "./controls/main/utils.js";
|
|
10
11
|
import { ensureMobileCssRulesExist as h, setMobileLayoutOptOut as f, hasMobileLayoutOptOut as O } from "./controls/mobileLayout/cssRules.js";
|
|
11
12
|
import { RecommendationConfigService as s } from "./services/configService.js";
|
|
12
13
|
import { useRecommendationExtensionStore as d } from "./store/recommendation.js";
|
|
13
14
|
import { getDefaultTemplate as M } from "./templates/grid/template.js";
|
|
14
15
|
import { useRecommendationBlockWarning as w } from "./useRecommendationBlockWarning.js";
|
|
15
|
-
const _ = y.Recommendation,
|
|
16
|
+
const _ = y.Recommendation, u = "recommendation-block-v2", I = "hide-price";
|
|
16
17
|
let k = !1;
|
|
17
|
-
class
|
|
18
|
+
class W extends b {
|
|
18
19
|
constructor() {
|
|
19
20
|
super();
|
|
20
21
|
/**
|
|
@@ -172,9 +173,9 @@ class K extends b {
|
|
|
172
173
|
let t = 0;
|
|
173
174
|
try {
|
|
174
175
|
const e = this.api.getDocumentRoot();
|
|
175
|
-
e && "querySelectorAll" in e && e.querySelectorAll(`.${
|
|
176
|
+
e && "querySelectorAll" in e && e.querySelectorAll(`.${u}`).forEach((n) => {
|
|
176
177
|
if ("getAttribute" in n) {
|
|
177
|
-
const o = n.getAttribute(
|
|
178
|
+
const o = n.getAttribute(m), r = o ? parseInt(o) : 0;
|
|
178
179
|
r > t && (t = r);
|
|
179
180
|
}
|
|
180
181
|
});
|
|
@@ -202,7 +203,7 @@ class K extends b {
|
|
|
202
203
|
if (!i || !("querySelectorAll" in i))
|
|
203
204
|
return;
|
|
204
205
|
const n = i.querySelectorAll(
|
|
205
|
-
`.${
|
|
206
|
+
`.${u}[${m}="${e}"]`
|
|
206
207
|
);
|
|
207
208
|
if (n.length <= 1)
|
|
208
209
|
return;
|
|
@@ -227,7 +228,7 @@ class K extends b {
|
|
|
227
228
|
const e = this.api.getDocumentRoot();
|
|
228
229
|
if (e && "querySelectorAll" in e)
|
|
229
230
|
return e.querySelectorAll(
|
|
230
|
-
`.${
|
|
231
|
+
`.${u}[${m}="${t}"]`
|
|
231
232
|
).length > 1;
|
|
232
233
|
} catch {
|
|
233
234
|
}
|
|
@@ -284,7 +285,7 @@ class K extends b {
|
|
|
284
285
|
if (!i)
|
|
285
286
|
return;
|
|
286
287
|
const n = this.api.getDocumentModifier();
|
|
287
|
-
n.modifyHtml(i).setAttribute(
|
|
288
|
+
n.modifyHtml(i).setAttribute(m, e.toString()), n.apply(new g(`Assign recommendation ID ${e}`));
|
|
288
289
|
}
|
|
289
290
|
/**
|
|
290
291
|
* Stamps the `hide-price` attribute (read by email-service at send time) on
|
|
@@ -312,7 +313,7 @@ class K extends b {
|
|
|
312
313
|
const e = this._getBlockElement(t);
|
|
313
314
|
if (!e || !("getAttribute" in e))
|
|
314
315
|
return null;
|
|
315
|
-
const i = e.getAttribute(
|
|
316
|
+
const i = e.getAttribute(m);
|
|
316
317
|
if (!i)
|
|
317
318
|
return null;
|
|
318
319
|
const n = parseInt(i);
|
|
@@ -324,10 +325,10 @@ class K extends b {
|
|
|
324
325
|
_getBlockElement(t) {
|
|
325
326
|
if ("getAttribute" in t) {
|
|
326
327
|
const e = t.getAttribute("class");
|
|
327
|
-
if (e && e.includes(
|
|
328
|
+
if (e && e.includes(u))
|
|
328
329
|
return t;
|
|
329
330
|
}
|
|
330
|
-
return "querySelector" in t ? t.querySelector(`.${
|
|
331
|
+
return "querySelector" in t ? t.querySelector(`.${u}`) ?? null : null;
|
|
331
332
|
}
|
|
332
333
|
/**
|
|
333
334
|
* Migrate configuration from legacy format
|
|
@@ -338,5 +339,5 @@ class K extends b {
|
|
|
338
339
|
}
|
|
339
340
|
export {
|
|
340
341
|
_ as BLOCK_ID,
|
|
341
|
-
|
|
342
|
+
W as RecommendationBlock
|
|
342
343
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const c = ".recommendation-block-v2", n = ".ins-recommendation-product-container", _ = ".ins-recommendation-desktop-container", R = ".ins-recommendation-mobile-container",
|
|
1
|
+
const c = ".recommendation-block-v2", n = ".ins-recommendation-product-container", _ = ".ins-recommendation-desktop-container", R = ".ins-recommendation-mobile-container", e = ".ins-recommendation-mobile-row", r = "reco-v3-button", A = "ins-skip-compile", E = {
|
|
2
2
|
CURRENCY: "currency",
|
|
3
3
|
SYMBOL: "currency-symbol",
|
|
4
4
|
ALIGNMENT: "currency-alignment",
|
|
5
5
|
THOUSAND_SEPARATOR: "currency-thousand-separator",
|
|
6
6
|
DECIMAL_SEPARATOR: "currency-decimal-separator",
|
|
7
7
|
DECIMAL_COUNT: "currency-decimal-count"
|
|
8
|
-
}, s = "productImage", O = "productName", i = "productPrice", C = "productOldPrice", S = "productOmnibusPrice", I = "productOmnibusDiscount", a = "productButton",
|
|
8
|
+
}, s = "productImage", O = "productName", i = "productPrice", C = "productOldPrice", S = "productOmnibusPrice", I = "productOmnibusDiscount", a = "productButton", m = "recommendationTitle", T = "ins-recommendation-title", u = `.${T}`, L = "customAttr:", d = "data-custom-attributes", U = "data-card-composition", N = "recommendation-id", D = "product-attr", t = "recommendation-attribute-row", P = `.${t}`, p = "data-attribute-type", B = "data-visibility", M = "spacer", l = "product_attribute.", o = /* @__PURE__ */ new Set([
|
|
9
9
|
"name",
|
|
10
10
|
// productName
|
|
11
11
|
"price",
|
|
@@ -20,18 +20,18 @@ const c = ".recommendation-block-v2", n = ".ins-recommendation-product-container
|
|
|
20
20
|
// productOmnibusPrice
|
|
21
21
|
"omnibus_discount"
|
|
22
22
|
// productOmnibusDiscount
|
|
23
|
-
]),
|
|
23
|
+
]), b = /* @__PURE__ */ new Set([
|
|
24
24
|
...o,
|
|
25
25
|
"currency",
|
|
26
26
|
"discount"
|
|
27
27
|
]);
|
|
28
28
|
export {
|
|
29
29
|
L as ATTR_CUSTOM_PREFIX,
|
|
30
|
-
|
|
30
|
+
p as ATTR_DATA_ATTRIBUTE_TYPE,
|
|
31
31
|
U as ATTR_DATA_CARD_COMPOSITION,
|
|
32
32
|
d as ATTR_DATA_CUSTOM_ATTRIBUTES,
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
B as ATTR_DATA_VISIBILITY,
|
|
34
|
+
D as ATTR_PRODUCT_ATTR,
|
|
35
35
|
a as ATTR_PRODUCT_BUTTON,
|
|
36
36
|
s as ATTR_PRODUCT_IMAGE,
|
|
37
37
|
O as ATTR_PRODUCT_NAME,
|
|
@@ -39,21 +39,22 @@ export {
|
|
|
39
39
|
I as ATTR_PRODUCT_OMNIBUS_DISCOUNT,
|
|
40
40
|
S as ATTR_PRODUCT_OMNIBUS_PRICE,
|
|
41
41
|
i as ATTR_PRODUCT_PRICE,
|
|
42
|
-
|
|
42
|
+
m as ATTR_RECOMMENDATION_TITLE,
|
|
43
43
|
c as BLOCK_ROOT_SELECTOR,
|
|
44
44
|
o as BUILT_IN_DEFAULT_ATTRIBUTES,
|
|
45
45
|
n as CONTAINER_SELECTOR,
|
|
46
46
|
t as CSS_CLASS_ATTRIBUTE_ROW,
|
|
47
|
-
|
|
47
|
+
r as CSS_CLASS_RECO_BUTTON,
|
|
48
48
|
A as CSS_CLASS_SKIP_COMPILE,
|
|
49
|
-
|
|
49
|
+
M as CSS_CLASS_SPACER,
|
|
50
50
|
T as CSS_CLASS_TITLE_CELL,
|
|
51
51
|
E as CURRENCY_ATTR,
|
|
52
52
|
_ as DESKTOP_CONTAINER_SELECTOR,
|
|
53
53
|
R as MOBILE_CONTAINER_SELECTOR,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
e as MOBILE_ROW_SELECTOR,
|
|
55
|
+
l as PRODUCT_ATTRIBUTE_PREFIX,
|
|
56
|
+
N as RECOMMENDATION_ID_ATTR,
|
|
57
|
+
b as RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES,
|
|
57
58
|
P as SELECTOR_ATTRIBUTE_ROW,
|
|
58
|
-
|
|
59
|
+
u as SELECTOR_TITLE_CELL
|
|
59
60
|
};
|
|
@@ -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,39 +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
|
-
|
|
450
|
-
|
|
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
|
|
451
452
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { ModificationDescription as f } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { RECOMMENDATION_ID_ATTR as m } from "../constants/selectors.js";
|
|
3
|
+
import { isPartnerManagedBlock as a, updateProductContentInPlace as d, regenerateProductRowsWithStyles as l } from "../controls/main/utils.js";
|
|
4
|
+
import { RecommendationConfigService as s } from "../services/configService.js";
|
|
5
5
|
let e = null;
|
|
6
|
-
function
|
|
6
|
+
function N(r) {
|
|
7
7
|
e = r;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function D(r, c, i, u) {
|
|
10
10
|
const n = e == null ? void 0 : e.getDocumentRootHtmlNode();
|
|
11
11
|
if (!e || !n || !("querySelector" in n))
|
|
12
12
|
return !1;
|
|
13
|
-
const t = n.querySelector(`[${
|
|
13
|
+
const t = n.querySelector(`[${m}="${r}"]`);
|
|
14
14
|
if (!t)
|
|
15
15
|
return !1;
|
|
16
16
|
const o = e.getDocumentModifier();
|
|
17
|
-
return
|
|
17
|
+
return s.stageConfig(o, t, c), a(t) ? (o.apply(new f(u)), !0) : (d({ currentNode: t, documentModifier: o, products: i }) || l({ currentNode: t, documentModifier: o, products: i }), !0);
|
|
18
18
|
}
|
|
19
19
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
D as commitBlockChangeOutsidePanel,
|
|
21
|
+
N as registerNodeConfigWriter
|
|
22
22
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-
|
|
1
|
+
@charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-2f127fb6] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.color-vision-select__menu[data-v-869e2871]{top:calc(100% + 4px);left:0;z-index:20;width:387px;padding:8px 0;border-radius:8px;background-color:#fff;box-shadow:0 4px 12px #39393926}.color-vision-select__option[data-v-869e2871]{width:100%;padding:4px 12px;border:none;background-color:transparent;text-align:left;cursor:pointer}.color-vision-select__option[data-v-869e2871]:hover,.color-vision-select__option_selected[data-v-869e2871]{background-color:#f1f3fe}.color-vision-select__option_selected .color-vision-select__option-label[data-v-869e2871],.color-vision-select__option_selected .color-vision-select__option-description[data-v-869e2871]{color:#0a2ecc}.color-vision-select__option-label[data-v-869e2871]{line-height:24px}.color-vision-select__option-description[data-v-869e2871]{line-height:16px}.accessibility-toolbar[data-v-4e1e854b]{gap:16px}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-actions-menu__panel[data-v-cf4435fc]{top:calc(100% + 4px);right:0;z-index:20;width:222px;padding:8px 0;border-radius:8px;background-color:#fff;box-shadow:0 4px 12px #39393926}.editor-actions-menu__section[data-v-cf4435fc]{padding:8px 12px 4px;text-transform:uppercase;letter-spacing:.4px}.editor-actions-menu__icon[data-v-cf4435fc]{color:#666;fill:currentColor}.editor-actions-menu__row[data-v-cf4435fc]{width:100%;padding:4px 12px;border:none;background-color:transparent;color:#292929;line-height:24px;text-align:left;cursor:pointer}.editor-actions-menu__row[data-v-cf4435fc]:not(.editor-actions-menu__row_static):hover{background-color:#f1f3fe}.editor-actions-menu__row_static[data-v-cf4435fc]{cursor:default}.editor-actions-menu__row[data-v-cf4435fc]:disabled{cursor:not-allowed;opacity:.6}.editor-actions-menu__divider[data-v-cf4435fc]{height:1px;margin:4px 0;background-color:#e1e1e1}.editor-actions[data-v-8aa5b2ca]{gap:16px}.editor-actions__divider[data-v-8aa5b2ca]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-1ad38e93]{gap:16px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-5c588dc5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-5c588dc5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-5c588dc5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}
|