@useinsider/guido 3.17.0-beta.ddd4dde → 3.17.0-beta.e23d5cd
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 +1 -0
- package/dist/@types/config/schemas.js +7 -6
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +77 -73
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +106 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
- package/dist/composables/useCustomInterfaceAppearance.js +52 -38
- package/dist/composables/useRecommendation.js +41 -34
- package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
- package/dist/config/migrator/recommendationMigrator.js +5 -4
- package/dist/enums/academy.js +2 -1
- package/dist/enums/date.js +5 -3
- package/dist/enums/extensions/recommendationBlock.js +3 -1
- package/dist/extensions/Blocks/Items/block.js +49 -98
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +24 -25
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +11 -12
- package/dist/extensions/Blocks/Items/template.js +152 -153
- package/dist/extensions/Blocks/Recommendation/block.js +26 -21
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -34
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +96 -95
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +238 -185
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +124 -0
- package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +165 -79
- package/dist/extensions/Blocks/common-control.js +22 -19
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +69 -30
- package/dist/src/@types/config/schemas.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/date.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +0 -21
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +2 -6
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +150 -10
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
- package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +4 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/stores/save-as-template.d.ts +4 -3
- package/dist/src/utils/genericUtil.d.ts +5 -0
- package/dist/static/assets/icons/line-change.svg.js +5 -0
- package/dist/static/assets/icons/line-delete.svg.js +5 -0
- package/dist/static/assets/icons/line-plus.svg.js +5 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +155 -0
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/genericUtil.js +28 -27
- package/dist/utils/pairProductVariables.js +59 -60
- package/dist/utils/templatePreparation.js +35 -34
- package/package.json +2 -1
- package/dist/extensions/Blocks/Items/constants/currency.js +0 -11
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +0 -19
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
var R = Object.defineProperty;
|
|
2
|
+
var B = (a, c, t) => c in a ? R(a, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[c] = t;
|
|
3
|
+
var p = (a, c, t) => B(a, typeof c != "symbol" ? c + "" : c, t);
|
|
4
|
+
import { useConfig as D } from "../../../composables/useConfig.js";
|
|
5
|
+
import { BlockId as y } from "../../../enums/block.js";
|
|
6
|
+
import { getMigrationBannerHtml as C } from "../../../utils/migrationBannerHtml.js";
|
|
6
7
|
import { Block as b, BlockCompositionType as A, ModificationDescription as g } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
8
|
+
import { CURRENT_CONFIG_VERSION as E, PRE_RRS_CONFIG_VERSION as S } from "./constants/defaultConfig.js";
|
|
9
|
+
import { regenerateMobileProductRows as N } from "./controls/main/utils.js";
|
|
10
|
+
import { ensureMobileCssRulesExist as h, setMobileLayoutOptOut as f, hasMobileLayoutOptOut as O } from "./controls/mobileLayout/cssRules.js";
|
|
9
11
|
import { RecommendationConfigService as s } from "./services/configService.js";
|
|
10
12
|
import { useRecommendationExtensionStore as d } from "./store/recommendation.js";
|
|
11
|
-
import { getDefaultTemplate as
|
|
12
|
-
import { useRecommendationBlockWarning as
|
|
13
|
-
const _ =
|
|
13
|
+
import { getDefaultTemplate as M } from "./templates/grid/template.js";
|
|
14
|
+
import { useRecommendationBlockWarning as w } from "./useRecommendationBlockWarning.js";
|
|
15
|
+
const _ = y.Recommendation, m = "recommendation-block-v2", u = "recommendation-id", I = "hide-price";
|
|
14
16
|
let k = !1;
|
|
15
|
-
class
|
|
17
|
+
class K extends b {
|
|
16
18
|
constructor() {
|
|
17
19
|
super();
|
|
18
20
|
/**
|
|
19
21
|
* Stores the ID generated in getTemplate() so onCreated() can reuse it.
|
|
20
22
|
* This avoids generating a new (different) ID in onCreated().
|
|
21
23
|
*/
|
|
22
|
-
|
|
24
|
+
p(this, "_pendingBlockId", null);
|
|
23
25
|
}
|
|
24
26
|
getId() {
|
|
25
27
|
return _;
|
|
@@ -39,7 +41,7 @@ class P extends b {
|
|
|
39
41
|
);
|
|
40
42
|
}
|
|
41
43
|
getSettingsPanelTitleHtml() {
|
|
42
|
-
return
|
|
44
|
+
return C(
|
|
43
45
|
_,
|
|
44
46
|
this.api.translate("Recommendation Block"),
|
|
45
47
|
this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.")
|
|
@@ -63,7 +65,7 @@ class P extends b {
|
|
|
63
65
|
*/
|
|
64
66
|
getTemplate() {
|
|
65
67
|
const t = this._generateNextId();
|
|
66
|
-
return this._pendingBlockId = t,
|
|
68
|
+
return this._pendingBlockId = t, M(t);
|
|
67
69
|
}
|
|
68
70
|
/**
|
|
69
71
|
* Called when a new block is dropped into the template
|
|
@@ -89,12 +91,15 @@ class P extends b {
|
|
|
89
91
|
const { config: n, wasFreshDrop: o } = s.initializeConfig(
|
|
90
92
|
this.api,
|
|
91
93
|
t,
|
|
92
|
-
{
|
|
94
|
+
{
|
|
95
|
+
recommendationId: i,
|
|
96
|
+
configVersion: D().isFeatureEnabled("reusableRecommendationStrategy") ? E : S
|
|
97
|
+
}
|
|
93
98
|
), r = d();
|
|
94
99
|
if (r.setCurrentBlock(i), this._stampHidePrice(t, n.priceHideIfSameAsDiscounted), o) {
|
|
95
|
-
|
|
100
|
+
h(this.api);
|
|
96
101
|
const l = this._getBlockElement(t);
|
|
97
|
-
l && (f(this.api, l, !0),
|
|
102
|
+
l && (f(this.api, l, !0), N({
|
|
98
103
|
currentNode: t,
|
|
99
104
|
documentModifier: this.api.getDocumentModifier()
|
|
100
105
|
}));
|
|
@@ -121,11 +126,11 @@ class P extends b {
|
|
|
121
126
|
}
|
|
122
127
|
this._healLingeringDuplicate(t), s.needsMigration(t) && this._migrateFromLegacy(t), this._healHidePriceAttr(t);
|
|
123
128
|
try {
|
|
124
|
-
k || (
|
|
129
|
+
k || (h(this.api), k = !0);
|
|
125
130
|
const e = s.getConfig(t), i = this._getBlockElement(t);
|
|
126
131
|
if (i) {
|
|
127
132
|
const n = !e.mobileLayoutEnabled;
|
|
128
|
-
|
|
133
|
+
O(i) !== n && f(this.api, i, n);
|
|
129
134
|
}
|
|
130
135
|
} catch {
|
|
131
136
|
}
|
|
@@ -155,7 +160,7 @@ class P extends b {
|
|
|
155
160
|
*/
|
|
156
161
|
_warnIfMultipleBlocks() {
|
|
157
162
|
try {
|
|
158
|
-
|
|
163
|
+
w().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
|
|
159
164
|
} catch {
|
|
160
165
|
}
|
|
161
166
|
}
|
|
@@ -333,5 +338,5 @@ class P extends b {
|
|
|
333
338
|
}
|
|
334
339
|
export {
|
|
335
340
|
_ as BLOCK_ID,
|
|
336
|
-
|
|
341
|
+
K as RecommendationBlock
|
|
337
342
|
};
|
|
@@ -1,59 +1,60 @@
|
|
|
1
|
-
import { DEFAULT_COLUMN_SPACING as
|
|
2
|
-
import { ATTR_PRODUCT_IMAGE as o, ATTR_PRODUCT_NAME as t, ATTR_PRODUCT_OLD_PRICE as _, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as r, ATTR_PRODUCT_OMNIBUS_DISCOUNT as
|
|
3
|
-
const
|
|
1
|
+
import { DEFAULT_COLUMN_SPACING as R, DEFAULT_ROW_SPACING as n, DEFAULT_MOBILE_ROW_SPACING as s, DEFAULT_MOBILE_COLUMN_SPACING as O, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as U } from "./layout.js";
|
|
2
|
+
import { ATTR_PRODUCT_IMAGE as o, ATTR_PRODUCT_NAME as t, ATTR_PRODUCT_OLD_PRICE as _, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as r, ATTR_PRODUCT_OMNIBUS_DISCOUNT as I, ATTR_PRODUCT_BUTTON as i } from "./selectors.js";
|
|
3
|
+
const C = 1, l = 2, a = {
|
|
4
4
|
code: "USD",
|
|
5
5
|
symbol: "USD",
|
|
6
6
|
alignment: "after",
|
|
7
7
|
decimalCount: 2,
|
|
8
8
|
decimalSeparator: ".",
|
|
9
9
|
thousandSeparator: ","
|
|
10
|
-
},
|
|
10
|
+
}, D = {
|
|
11
11
|
textBefore: "",
|
|
12
12
|
textAfter: ""
|
|
13
|
-
},
|
|
13
|
+
}, A = {
|
|
14
14
|
textBefore: "",
|
|
15
15
|
textAfter: ""
|
|
16
|
-
},
|
|
16
|
+
}, c = [
|
|
17
17
|
o,
|
|
18
18
|
t,
|
|
19
19
|
_,
|
|
20
20
|
T,
|
|
21
21
|
r,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
],
|
|
22
|
+
I,
|
|
23
|
+
i
|
|
24
|
+
], E = {
|
|
25
25
|
[o]: !0,
|
|
26
26
|
[t]: !0,
|
|
27
27
|
[T]: !0,
|
|
28
28
|
[_]: !0,
|
|
29
29
|
[r]: !1,
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
},
|
|
30
|
+
[I]: !1,
|
|
31
|
+
[i]: !0
|
|
32
|
+
}, m = {
|
|
33
33
|
// Settings
|
|
34
34
|
strategy: "mostPopular",
|
|
35
35
|
productIds: [],
|
|
36
36
|
size: "6",
|
|
37
37
|
shuffleProducts: !1,
|
|
38
38
|
language: "en_US",
|
|
39
|
-
currency:
|
|
39
|
+
currency: a,
|
|
40
40
|
filters: [],
|
|
41
|
+
strategyId: "",
|
|
41
42
|
// Layout
|
|
42
43
|
layout: "grid",
|
|
43
|
-
cardsInRow:
|
|
44
|
+
cardsInRow: U,
|
|
44
45
|
mobileCardsInRow: e,
|
|
45
46
|
mobileLayoutEnabled: !1,
|
|
46
47
|
previousMobileCardsInRow: e,
|
|
47
|
-
columnSpacing:
|
|
48
|
-
rowSpacing:
|
|
49
|
-
mobileColumnSpacing:
|
|
50
|
-
mobileRowSpacing:
|
|
48
|
+
columnSpacing: R,
|
|
49
|
+
rowSpacing: n,
|
|
50
|
+
mobileColumnSpacing: O,
|
|
51
|
+
mobileRowSpacing: s,
|
|
51
52
|
// Composition
|
|
52
|
-
composition:
|
|
53
|
-
visibility:
|
|
53
|
+
composition: c,
|
|
54
|
+
visibility: E,
|
|
54
55
|
// Element settings
|
|
55
|
-
omnibusPrice:
|
|
56
|
-
omnibusDiscount:
|
|
56
|
+
omnibusPrice: D,
|
|
57
|
+
omnibusDiscount: A,
|
|
57
58
|
textTrimming: !1,
|
|
58
59
|
// Price placement (block-level, affects all cards)
|
|
59
60
|
// Default ON = current stacked look, so existing templates are unaffected.
|
|
@@ -63,18 +64,17 @@ const D = {
|
|
|
63
64
|
// of "false" (the actual hiding happens server-side at send).
|
|
64
65
|
priceHideIfSameAsDiscounted: !1,
|
|
65
66
|
// Meta
|
|
66
|
-
|
|
67
|
-
// defaults, so no data transform (and no needsMigration trigger) is required.
|
|
68
|
-
configVersion: 1,
|
|
67
|
+
configVersion: C,
|
|
69
68
|
recommendationId: 0
|
|
70
|
-
},
|
|
69
|
+
}, u = [11, 12];
|
|
71
70
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
l as CURRENT_CONFIG_VERSION,
|
|
72
|
+
c as DEFAULT_COMPOSITION,
|
|
73
|
+
a as DEFAULT_CURRENCY,
|
|
74
|
+
m as DEFAULT_NODE_CONFIG,
|
|
75
|
+
A as DEFAULT_OMNIBUS_DISCOUNT,
|
|
76
|
+
D as DEFAULT_OMNIBUS_PRICE,
|
|
77
|
+
E as DEFAULT_VISIBILITY,
|
|
78
|
+
u as EXCLUDED_ALGORITHM_IDS,
|
|
79
|
+
C as PRE_RRS_CONFIG_VERSION
|
|
80
80
|
};
|