@useinsider/guido 3.2.0-beta.066130b → 3.2.0-beta.080341b
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 +117 -1
- package/dist/@types/config/schemas.js +153 -95
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +90 -88
- package/dist/components/organisms/AutoSaveController.vue.js +17 -0
- package/dist/components/organisms/AutoSaveController.vue2.js +13 -0
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
- package/dist/components/organisms/header/RightSlot.vue.js +8 -8
- package/dist/components/organisms/header/RightSlot.vue2.js +9 -8
- package/dist/composables/useAutoSave.js +71 -0
- package/dist/composables/useRecommendation.js +46 -26
- package/dist/composables/useSave.js +19 -16
- package/dist/composables/useStripo.js +14 -16
- package/dist/composables/validators/useCouponBlockValidator.js +24 -0
- package/dist/config/compiler/recommendationCompilerRules.js +25 -25
- package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +107 -71
- package/dist/config/migrator/index.js +9 -9
- package/dist/config/migrator/radioButtonMigrator.js +64 -44
- package/dist/config/migrator/recommendation/compositionMapper.js +98 -0
- package/dist/config/migrator/recommendation/extractors.js +27 -0
- package/dist/config/migrator/recommendation/htmlBuilder.js +496 -0
- package/dist/config/migrator/recommendation/parseLegacyConfig.js +33 -0
- package/dist/config/migrator/recommendation/settingsMapper.js +70 -0
- package/dist/config/migrator/recommendation/themeMapper.js +93 -0
- package/dist/config/migrator/recommendationMigrator.js +74 -290
- package/dist/enums/extensions/recommendationBlock.js +2 -1
- package/dist/enums/unsubscribe.js +34 -27
- package/dist/extensions/Blocks/RadioButton/template.js +1 -1
- package/dist/extensions/Blocks/Recommendation/block.js +60 -50
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +21 -18
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +27 -26
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +3 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +228 -181
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
- package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
- package/dist/extensions/Blocks/Recommendation/services/configService.js +76 -33
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -17
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +123 -79
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +19 -10
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +8 -8
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +25 -15
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +11 -11
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +21 -0
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +13 -22
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +393 -264
- package/dist/node_modules/valibot/dist/index.js +450 -235
- package/dist/package.json.js +1 -1
- package/dist/services/templateLibraryApi.js +5 -4
- package/dist/src/@types/config/defaults.d.ts +5 -1
- package/dist/src/@types/config/index.d.ts +3 -3
- package/dist/src/@types/config/schemas.d.ts +217 -0
- package/dist/src/@types/config/types.d.ts +9 -1
- package/dist/src/components/Guido.vue.d.ts +1 -1
- package/dist/src/components/organisms/AutoSaveController.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useAutoSave.d.ts +3 -0
- package/dist/src/composables/useConfig.d.ts +58 -0
- package/dist/src/composables/useRecommendation.d.ts +10 -1
- package/dist/src/composables/useRecommendation.test.d.ts +1 -0
- package/dist/src/composables/useSave.d.ts +1 -1
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/config/migrator/index.d.ts +2 -1
- package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +2 -0
- package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +7 -0
- package/dist/src/config/migrator/recommendation/extractors.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +11 -0
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +15 -0
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +7 -0
- package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/themeMapper.d.ts +5 -0
- package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/types.d.ts +205 -0
- package/dist/src/config/migrator/recommendationMigrator.d.ts +13 -1
- package/dist/src/config/migrator/recommendationMigrator.test.d.ts +1 -0
- package/dist/src/enums/unsubscribe.d.ts +5 -0
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
- package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +21 -3
- package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +21 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -3
- package/dist/src/library.d.ts +1 -1
- package/dist/src/stores/autosave.d.ts +12 -0
- package/dist/src/stores/config.d.ts +522 -0
- package/dist/src/stores/editor.d.ts +23 -0
- package/dist/src/utils/htmlEscape.d.ts +5 -0
- package/dist/src/utils/htmlEscape.test.d.ts +1 -0
- package/dist/src/utils/timeUtil.d.ts +8 -0
- package/dist/static/styles/components/button.css.js +16 -9
- package/dist/static/styles/components/loader.css.js +4 -0
- package/dist/static/styles/components/narrow-panel.css.js +52 -0
- package/dist/stores/autosave.js +17 -0
- package/dist/stores/editor.js +3 -1
- package/dist/utils/htmlEscape.js +13 -0
- package/dist/utils/pairProductVariables.js +89 -88
- package/dist/utils/templatePreparation.js +72 -32
- package/dist/utils/timeUtil.js +19 -0
- package/package.json +7 -3
- package/dist/enums/displayConditions.js +0 -80
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
- package/dist/src/enums/displayConditions.d.ts +0 -2
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
var k = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
2
|
+
var _ = (r, n, t) => n in r ? k(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
|
|
3
|
+
var g = (r, n, t) => _(r, typeof n != "symbol" ? n + "" : n, t);
|
|
4
4
|
import { BlockId as B } from "../../../enums/block.js";
|
|
5
|
-
import { getMigrationBannerHtml as
|
|
6
|
-
import { Block as
|
|
7
|
-
import { regenerateMobileProductRows as
|
|
8
|
-
import { ensureMobileCssRulesExist as
|
|
9
|
-
import { RecommendationConfigService as
|
|
10
|
-
import { useRecommendationExtensionStore as
|
|
5
|
+
import { getMigrationBannerHtml as b } from "../../../utils/migrationBannerHtml.js";
|
|
6
|
+
import { Block as R, BlockCompositionType as y, ModificationDescription as C } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
import { regenerateMobileProductRows as A } from "./controls/main/utils.js";
|
|
8
|
+
import { ensureMobileCssRulesExist as d, setMobileLayoutOptOut as p, hasMobileLayoutOptOut as D } from "./controls/mobileLayout/cssRules.js";
|
|
9
|
+
import { RecommendationConfigService as s } from "./services/configService.js";
|
|
10
|
+
import { useRecommendationExtensionStore as f } from "./store/recommendation.js";
|
|
11
11
|
import { getDefaultTemplate as E } from "./templates/grid/template.js";
|
|
12
|
-
const
|
|
13
|
-
let
|
|
14
|
-
class
|
|
12
|
+
const h = B.Recommendation, l = "recommendation-block-v2", m = "recommendation-id";
|
|
13
|
+
let I = !1;
|
|
14
|
+
class v extends R {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
/**
|
|
18
18
|
* Stores the ID generated in getTemplate() so onCreated() can reuse it.
|
|
19
19
|
* This avoids generating a new (different) ID in onCreated().
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
g(this, "_pendingBlockId", null);
|
|
22
22
|
}
|
|
23
23
|
getId() {
|
|
24
|
-
return
|
|
24
|
+
return h;
|
|
25
25
|
}
|
|
26
26
|
getIcon() {
|
|
27
27
|
return "recommendation-icon";
|
|
28
28
|
}
|
|
29
29
|
getBlockCompositionType() {
|
|
30
|
-
return
|
|
30
|
+
return y.CONTAINER;
|
|
31
31
|
}
|
|
32
32
|
getName() {
|
|
33
33
|
return this.api.translate("Recommendation Block");
|
|
@@ -38,8 +38,8 @@ class q extends b {
|
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
getSettingsPanelTitleHtml() {
|
|
41
|
-
return
|
|
42
|
-
|
|
41
|
+
return b(
|
|
42
|
+
h,
|
|
43
43
|
this.api.translate("Recommendation Block"),
|
|
44
44
|
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.")
|
|
45
45
|
);
|
|
@@ -66,15 +66,25 @@ class q extends b {
|
|
|
66
66
|
* @param node - The newly created block node
|
|
67
67
|
*/
|
|
68
68
|
onCreated(t) {
|
|
69
|
-
const e = this.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
i.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
const e = this._getRecommendationId(t);
|
|
70
|
+
if (e !== null && e > 0)
|
|
71
|
+
return;
|
|
72
|
+
const i = this._pendingBlockId ?? this._generateNextId();
|
|
73
|
+
this._pendingBlockId = null, this._assignRecommendationId(t, i);
|
|
74
|
+
const { config: o, wasFreshDrop: c } = s.initializeConfig(
|
|
75
|
+
this.api,
|
|
76
|
+
t,
|
|
77
|
+
{ recommendationId: i }
|
|
78
|
+
), a = f();
|
|
79
|
+
if (a.setCurrentBlock(i), c) {
|
|
80
|
+
d(this.api);
|
|
81
|
+
const u = this._getBlockElement(t);
|
|
82
|
+
u && (p(this.api, u, !0), A({
|
|
83
|
+
currentNode: t,
|
|
84
|
+
documentModifier: this.api.getDocumentModifier()
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
a.patchCurrentBlockConfig({ language: o.language }, { triggerRefetch: !1 });
|
|
78
88
|
}
|
|
79
89
|
/**
|
|
80
90
|
* Called when the document changes or template is loaded
|
|
@@ -87,20 +97,20 @@ class q extends b {
|
|
|
87
97
|
if (!(!t || !("getNodeConfig" in t))) {
|
|
88
98
|
if (!this._getRecommendationId(t)) {
|
|
89
99
|
const e = this._generateNextId();
|
|
90
|
-
this._assignRecommendationId(t, e),
|
|
100
|
+
this._assignRecommendationId(t, e), s.hasConfig(t) && s.updateConfig(
|
|
91
101
|
this.api,
|
|
92
102
|
t,
|
|
93
103
|
{ recommendationId: e },
|
|
94
104
|
"Assign recommendation ID to legacy block"
|
|
95
105
|
);
|
|
96
106
|
}
|
|
97
|
-
|
|
107
|
+
s.needsMigration(t) && this._migrateFromLegacy(t);
|
|
98
108
|
try {
|
|
99
|
-
|
|
100
|
-
const e =
|
|
101
|
-
if (
|
|
102
|
-
const
|
|
103
|
-
|
|
109
|
+
I || (d(this.api), I = !0);
|
|
110
|
+
const e = s.getConfig(t), i = this._getBlockElement(t);
|
|
111
|
+
if (i) {
|
|
112
|
+
const o = !e.mobileLayoutEnabled;
|
|
113
|
+
D(i) !== o && p(this.api, i, o);
|
|
104
114
|
}
|
|
105
115
|
} catch {
|
|
106
116
|
}
|
|
@@ -114,7 +124,7 @@ class q extends b {
|
|
|
114
124
|
*/
|
|
115
125
|
onDelete(t) {
|
|
116
126
|
const e = this._getRecommendationId(t);
|
|
117
|
-
e &&
|
|
127
|
+
e && f().removeBlockState(e);
|
|
118
128
|
}
|
|
119
129
|
/**
|
|
120
130
|
* Generates the next unique recommendation ID by scanning all existing blocks
|
|
@@ -124,10 +134,10 @@ class q extends b {
|
|
|
124
134
|
let t = 0;
|
|
125
135
|
try {
|
|
126
136
|
const e = this.api.getDocumentRoot();
|
|
127
|
-
e && "querySelectorAll" in e && e.querySelectorAll(`.${
|
|
128
|
-
if ("getAttribute" in
|
|
129
|
-
const
|
|
130
|
-
|
|
137
|
+
e && "querySelectorAll" in e && e.querySelectorAll(`.${l}`).forEach((o) => {
|
|
138
|
+
if ("getAttribute" in o) {
|
|
139
|
+
const c = o.getAttribute(m), a = c ? parseInt(c) : 0;
|
|
140
|
+
a > t && (t = a);
|
|
131
141
|
}
|
|
132
142
|
});
|
|
133
143
|
} catch {
|
|
@@ -141,11 +151,11 @@ class q extends b {
|
|
|
141
151
|
* added classes via setAttribute.
|
|
142
152
|
*/
|
|
143
153
|
_assignRecommendationId(t, e) {
|
|
144
|
-
const
|
|
145
|
-
if (!
|
|
154
|
+
const i = this._getBlockElement(t);
|
|
155
|
+
if (!i)
|
|
146
156
|
return;
|
|
147
|
-
const
|
|
148
|
-
|
|
157
|
+
const o = this.api.getDocumentModifier();
|
|
158
|
+
o.modifyHtml(i).setAttribute(m, e.toString()), o.apply(new C(`Assign recommendation ID ${e}`));
|
|
149
159
|
}
|
|
150
160
|
/**
|
|
151
161
|
* Gets the recommendation-id from a block node
|
|
@@ -154,11 +164,11 @@ class q extends b {
|
|
|
154
164
|
const e = this._getBlockElement(t);
|
|
155
165
|
if (!e || !("getAttribute" in e))
|
|
156
166
|
return null;
|
|
157
|
-
const
|
|
158
|
-
if (!
|
|
167
|
+
const i = e.getAttribute(m);
|
|
168
|
+
if (!i)
|
|
159
169
|
return null;
|
|
160
|
-
const
|
|
161
|
-
return Number.isNaN(
|
|
170
|
+
const o = parseInt(i);
|
|
171
|
+
return Number.isNaN(o) ? null : o;
|
|
162
172
|
}
|
|
163
173
|
/**
|
|
164
174
|
* Gets the block element (the element with BLOCK_CLASS)
|
|
@@ -166,19 +176,19 @@ class q extends b {
|
|
|
166
176
|
_getBlockElement(t) {
|
|
167
177
|
if ("getAttribute" in t) {
|
|
168
178
|
const e = t.getAttribute("class");
|
|
169
|
-
if (e && e.includes(
|
|
179
|
+
if (e && e.includes(l))
|
|
170
180
|
return t;
|
|
171
181
|
}
|
|
172
|
-
return "querySelector" in t ? t.querySelector(`.${
|
|
182
|
+
return "querySelector" in t ? t.querySelector(`.${l}`) ?? null : null;
|
|
173
183
|
}
|
|
174
184
|
/**
|
|
175
185
|
* Migrate configuration from legacy format
|
|
176
186
|
*/
|
|
177
187
|
_migrateFromLegacy(t) {
|
|
178
|
-
|
|
188
|
+
s.migrateFromDataAttributes(this.api, t);
|
|
179
189
|
}
|
|
180
190
|
}
|
|
181
191
|
export {
|
|
182
|
-
|
|
183
|
-
|
|
192
|
+
h as BLOCK_ID,
|
|
193
|
+
v as RecommendationBlock
|
|
184
194
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var o = /* @__PURE__ */ ((c) => (c.BUTTON_ALIGN = "recommendation-block-button-align-control", c.BUTTON_BORDER = "recommendation-block-button-border-control", c.BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control", c.BUTTON_COLOR = "recommendation-block-button-color-control", c.BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control", c.BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control", c.BUTTON_MARGINS = "recommendation-block-button-margins-control", c.BUTTON_PADDINGS = "recommendation-block-button-paddings-control", c.BUTTON_TEXT = "recommendation-block-button-text-control", c.BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control", c.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control", c.NAME_ALIGN = "recommendation-block-name-align-control", c.NAME_BACKGROUND = "recommendation-block-name-background-control", c.NAME_COLOR = "recommendation-block-name-color-control", c.NAME_FONT_FAMILY = "recommendation-block-name-font-family-control", c.NAME_PADDINGS = "recommendation-block-name-paddings-control", c.NAME_SIZE = "recommendation-block-name-size-control", c.NAME_STYLE = "recommendation-block-name-style-control", c.NAME_TEXT_TRIM = "recommendation-block-name-text-trim-control", c.PRICE_ALIGN = "recommendation-block-price-align-control", c.PRICE_BACKGROUND = "recommendation-block-price-background-control", c.PRICE_COLOR = "recommendation-block-price-color-control", c.PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control", c.PRICE_PADDINGS = "recommendation-block-price-paddings-control", c.PRICE_SIZE = "recommendation-block-price-size-control", c.PRICE_STYLE = "recommendation-block-price-style-control", c.OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control", c.OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control", c.OLD_PRICE_COLOR = "recommendation-block-old-price-color-control", c.OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control", c.OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control", c.OLD_PRICE_SIZE = "recommendation-block-old-price-size-control", c.OLD_PRICE_STYLE = "recommendation-block-old-price-style-control", c.OMNIBUS_PRICE_ALIGN = "recommendation-block-omnibus-price-align-control", c.OMNIBUS_PRICE_BACKGROUND = "recommendation-block-omnibus-price-background-control", c.OMNIBUS_PRICE_COLOR = "recommendation-block-omnibus-price-color-control", c.OMNIBUS_PRICE_FONT_FAMILY = "recommendation-block-omnibus-price-font-family-control", c.OMNIBUS_PRICE_PADDINGS = "recommendation-block-omnibus-price-paddings-control", c.OMNIBUS_PRICE_SIZE = "recommendation-block-omnibus-price-size-control", c.OMNIBUS_PRICE_STYLE = "recommendation-block-omnibus-price-style-control", c.OMNIBUS_PRICE_TEXT_BEFORE = "recommendation-block-omnibus-price-text-before-control", c.OMNIBUS_PRICE_TEXT_AFTER = "recommendation-block-omnibus-price-text-after-control", c.OMNIBUS_DISCOUNT_ALIGN = "recommendation-block-omnibus-discount-align-control", c.OMNIBUS_DISCOUNT_BACKGROUND = "recommendation-block-omnibus-discount-background-control", c.OMNIBUS_DISCOUNT_COLOR = "recommendation-block-omnibus-discount-color-control", c.OMNIBUS_DISCOUNT_FONT_FAMILY = "recommendation-block-omnibus-discount-font-family-control", c.OMNIBUS_DISCOUNT_PADDINGS = "recommendation-block-omnibus-discount-paddings-control", c.OMNIBUS_DISCOUNT_SIZE = "recommendation-block-omnibus-discount-size-control", c.OMNIBUS_DISCOUNT_STYLE = "recommendation-block-omnibus-discount-style-control", c.OMNIBUS_DISCOUNT_TEXT_BEFORE = "recommendation-block-omnibus-discount-text-before-control", c.OMNIBUS_DISCOUNT_TEXT_AFTER = "recommendation-block-omnibus-discount-text-after-control", c.IMAGE_SIZE = "recommendation-block-image-size-control", c.IMAGE_MARGINS = "recommendation-block-image-margins-control", c.CUSTOM_ATTR_ALIGN = "recommendation-block-custom-attr-align-control", c.CUSTOM_ATTR_BACKGROUND = "recommendation-block-custom-attr-background-control", c.CUSTOM_ATTR_COLOR = "recommendation-block-custom-attr-color-control", c.CUSTOM_ATTR_FONT_FAMILY = "recommendation-block-custom-attr-font-family-control", c.CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control", c.CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control", c.CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control", c.SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message", c))(o || {});
|
|
1
|
+
var o = /* @__PURE__ */ ((c) => (c.BUTTON_ALIGN = "recommendation-block-button-align-control", c.BUTTON_BORDER = "recommendation-block-button-border-control", c.BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control", c.BUTTON_COLOR = "recommendation-block-button-color-control", c.BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control", c.BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control", c.BUTTON_MARGINS = "recommendation-block-button-margins-control", c.BUTTON_PADDINGS = "recommendation-block-button-paddings-control", c.BUTTON_TEXT = "recommendation-block-button-text-control", c.BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control", c.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control", c.NAME_ALIGN = "recommendation-block-name-align-control", c.NAME_BACKGROUND = "recommendation-block-name-background-control", c.NAME_COLOR = "recommendation-block-name-color-control", c.NAME_FONT_FAMILY = "recommendation-block-name-font-family-control", c.NAME_PADDINGS = "recommendation-block-name-paddings-control", c.NAME_SIZE = "recommendation-block-name-size-control", c.NAME_STYLE = "recommendation-block-name-style-control", c.NAME_TEXT_TRIM = "recommendation-block-name-text-trim-control", c.PRICE_ALIGN = "recommendation-block-price-align-control", c.PRICE_BACKGROUND = "recommendation-block-price-background-control", c.PRICE_COLOR = "recommendation-block-price-color-control", c.PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control", c.PRICE_PADDINGS = "recommendation-block-price-paddings-control", c.PRICE_SIZE = "recommendation-block-price-size-control", c.PRICE_STYLE = "recommendation-block-price-style-control", c.OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control", c.OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control", c.OLD_PRICE_COLOR = "recommendation-block-old-price-color-control", c.OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control", c.OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control", c.OLD_PRICE_SIZE = "recommendation-block-old-price-size-control", c.OLD_PRICE_STYLE = "recommendation-block-old-price-style-control", c.OMNIBUS_PRICE_ALIGN = "recommendation-block-omnibus-price-align-control", c.OMNIBUS_PRICE_BACKGROUND = "recommendation-block-omnibus-price-background-control", c.OMNIBUS_PRICE_COLOR = "recommendation-block-omnibus-price-color-control", c.OMNIBUS_PRICE_FONT_FAMILY = "recommendation-block-omnibus-price-font-family-control", c.OMNIBUS_PRICE_PADDINGS = "recommendation-block-omnibus-price-paddings-control", c.OMNIBUS_PRICE_SIZE = "recommendation-block-omnibus-price-size-control", c.OMNIBUS_PRICE_STYLE = "recommendation-block-omnibus-price-style-control", c.OMNIBUS_PRICE_TEXT_BEFORE = "recommendation-block-omnibus-price-text-before-control", c.OMNIBUS_PRICE_TEXT_AFTER = "recommendation-block-omnibus-price-text-after-control", c.OMNIBUS_DISCOUNT_ALIGN = "recommendation-block-omnibus-discount-align-control", c.OMNIBUS_DISCOUNT_BACKGROUND = "recommendation-block-omnibus-discount-background-control", c.OMNIBUS_DISCOUNT_COLOR = "recommendation-block-omnibus-discount-color-control", c.OMNIBUS_DISCOUNT_FONT_FAMILY = "recommendation-block-omnibus-discount-font-family-control", c.OMNIBUS_DISCOUNT_PADDINGS = "recommendation-block-omnibus-discount-paddings-control", c.OMNIBUS_DISCOUNT_SIZE = "recommendation-block-omnibus-discount-size-control", c.OMNIBUS_DISCOUNT_STYLE = "recommendation-block-omnibus-discount-style-control", c.OMNIBUS_DISCOUNT_TEXT_BEFORE = "recommendation-block-omnibus-discount-text-before-control", c.OMNIBUS_DISCOUNT_TEXT_AFTER = "recommendation-block-omnibus-discount-text-after-control", c.IMAGE_SIZE = "recommendation-block-image-size-control", c.IMAGE_MARGINS = "recommendation-block-image-margins-control", c.CUSTOM_ATTR_ALIGN = "recommendation-block-custom-attr-align-control", c.CUSTOM_ATTR_BACKGROUND = "recommendation-block-custom-attr-background-control", c.CUSTOM_ATTR_COLOR = "recommendation-block-custom-attr-color-control", c.CUSTOM_ATTR_FONT_FAMILY = "recommendation-block-custom-attr-font-family-control", c.CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control", c.CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control", c.CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control", c.CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control", c.SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message", c))(o || {});
|
|
2
2
|
export {
|
|
3
3
|
o as RecommendationControlId
|
|
4
4
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DEFAULT_COLUMN_SPACING as R, DEFAULT_ROW_SPACING as U, DEFAULT_MOBILE_ROW_SPACING as i, DEFAULT_MOBILE_COLUMN_SPACING as s, DEFAULT_MOBILE_CARDS_IN_ROW as o, DEFAULT_CARDS_IN_ROW as C } from "./layout.js";
|
|
2
2
|
import { ATTR_PRODUCT_IMAGE as _, ATTR_PRODUCT_NAME as e, ATTR_PRODUCT_OLD_PRICE as t, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as r, ATTR_PRODUCT_OMNIBUS_DISCOUNT as I, ATTR_PRODUCT_BUTTON as n } from "./selectors.js";
|
|
3
3
|
const O = {
|
|
4
4
|
code: "USD",
|
|
@@ -44,10 +44,10 @@ const O = {
|
|
|
44
44
|
mobileCardsInRow: o,
|
|
45
45
|
mobileLayoutEnabled: !1,
|
|
46
46
|
previousMobileCardsInRow: o,
|
|
47
|
-
columnSpacing:
|
|
48
|
-
rowSpacing:
|
|
49
|
-
mobileColumnSpacing:
|
|
50
|
-
mobileRowSpacing:
|
|
47
|
+
columnSpacing: R,
|
|
48
|
+
rowSpacing: U,
|
|
49
|
+
mobileColumnSpacing: s,
|
|
50
|
+
mobileRowSpacing: i,
|
|
51
51
|
// Composition
|
|
52
52
|
composition: a,
|
|
53
53
|
visibility: E,
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { TextPaddingsBuiltInControl as d, ButtonBackgroundColorBuiltInControl as
|
|
1
|
+
import { TextPaddingsBuiltInControl as d, ButtonBackgroundColorBuiltInControl as i, TextFontFamilyBuiltInControl as u, TextStyleBuiltInControl as c, TextSizeBuiltInControl as C, TextColorBuiltInControl as g, TextAlignBuiltInControl as a } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { RecommendationBlockId as l } from "../../constants/blockIds.js";
|
|
3
3
|
import { RecommendationControlId as e } from "../../constants/controlIds.js";
|
|
4
|
-
import { BLOCK_ROOT_SELECTOR as
|
|
4
|
+
import { BLOCK_ROOT_SELECTOR as A, ATTR_PRODUCT_ATTR as s } from "../../constants/selectors.js";
|
|
5
|
+
import { CustomAttributeTextTrimControl as I } from "./textTrim.js";
|
|
5
6
|
function o(t) {
|
|
6
|
-
const
|
|
7
|
-
if (!
|
|
7
|
+
const r = t.closest(A);
|
|
8
|
+
if (!r)
|
|
8
9
|
return [];
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
const T = `[esd-extension-block-id="${l.CUSTOM_ATTRIBUTE}"][${s}="${
|
|
12
|
-
return
|
|
10
|
+
const n = t.asElement().getAttribute(s);
|
|
11
|
+
if (n) {
|
|
12
|
+
const T = `[esd-extension-block-id="${l.CUSTOM_ATTRIBUTE}"][${s}="${n}"]`;
|
|
13
|
+
return r.querySelectorAll(T);
|
|
13
14
|
}
|
|
14
|
-
return
|
|
15
|
+
return r.querySelectorAll(
|
|
15
16
|
`[esd-extension-block-id="${l.CUSTOM_ATTRIBUTE}"]`
|
|
16
17
|
);
|
|
17
18
|
}
|
|
18
|
-
const
|
|
19
|
+
const m = class extends a {
|
|
19
20
|
getId() {
|
|
20
21
|
return e.CUSTOM_ATTR_ALIGN;
|
|
21
22
|
}
|
|
@@ -36,7 +37,7 @@ const A = class extends a {
|
|
|
36
37
|
getTargetNodes(t) {
|
|
37
38
|
return o(t);
|
|
38
39
|
}
|
|
39
|
-
},
|
|
40
|
+
}, x = class extends c {
|
|
40
41
|
getId() {
|
|
41
42
|
return e.CUSTOM_ATTR_STYLE;
|
|
42
43
|
}
|
|
@@ -50,29 +51,31 @@ const A = class extends a {
|
|
|
50
51
|
getTargetNodes(t) {
|
|
51
52
|
return o(t);
|
|
52
53
|
}
|
|
53
|
-
}, R = class extends
|
|
54
|
+
}, R = class extends i {
|
|
54
55
|
getId() {
|
|
55
56
|
return e.CUSTOM_ATTR_BACKGROUND;
|
|
56
57
|
}
|
|
57
58
|
getTargetNodes(t) {
|
|
58
59
|
return o(t);
|
|
59
60
|
}
|
|
60
|
-
},
|
|
61
|
+
}, B = class extends d {
|
|
61
62
|
getId() {
|
|
62
63
|
return e.CUSTOM_ATTR_PADDINGS;
|
|
63
64
|
}
|
|
64
65
|
getTargetNodes(t) {
|
|
65
66
|
return o(t);
|
|
66
67
|
}
|
|
67
|
-
},
|
|
68
|
-
align:
|
|
68
|
+
}, p = {
|
|
69
|
+
align: m,
|
|
69
70
|
color: _,
|
|
70
71
|
size: S,
|
|
71
|
-
style:
|
|
72
|
+
style: x,
|
|
72
73
|
fontFamily: O,
|
|
73
74
|
background: R,
|
|
74
|
-
paddings:
|
|
75
|
+
paddings: B,
|
|
76
|
+
textTrim: I
|
|
75
77
|
};
|
|
76
78
|
export {
|
|
77
|
-
|
|
79
|
+
p as CustomAttributeControls,
|
|
80
|
+
I as CustomAttributeTextTrimControl
|
|
78
81
|
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ModificationDescription as T } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { CommonControl as m } from "../../../common-control.js";
|
|
3
|
+
import { RecommendationBlockId as n } from "../../constants/blockIds.js";
|
|
4
|
+
import { RecommendationControlId as l } from "../../constants/controlIds.js";
|
|
5
|
+
import { BLOCK_ROOT_SELECTOR as u, ATTR_PRODUCT_ATTR as a } from "../../constants/selectors.js";
|
|
6
|
+
import { CSS_CLASS_TEXT_TRIM as o, ensureTextTrimCssRulesExist as c } from "../shared/textTrimCssRules.js";
|
|
7
|
+
const i = {
|
|
8
|
+
TEXT_TRIM_ENABLED: "customAttrTextTrimEnabled"
|
|
9
|
+
};
|
|
10
|
+
class g extends m {
|
|
11
|
+
getId() {
|
|
12
|
+
return l.CUSTOM_ATTR_TEXT_TRIM;
|
|
13
|
+
}
|
|
14
|
+
getTemplate() {
|
|
15
|
+
return `
|
|
16
|
+
<hr style="margin: 0; border: none; border-top: 1px solid #e0e0e0;" />
|
|
17
|
+
<div class="custom-attr-text-trim-control-container">
|
|
18
|
+
${this._GuTwoColumns([
|
|
19
|
+
this._GuLabel({ text: this.api.translate("Trim Long Text") }),
|
|
20
|
+
this._GuToggle(i.TEXT_TRIM_ENABLED)
|
|
21
|
+
])}
|
|
22
|
+
</div>
|
|
23
|
+
`;
|
|
24
|
+
}
|
|
25
|
+
onRender() {
|
|
26
|
+
this._setFormValues(), this._listenToFormUpdates();
|
|
27
|
+
}
|
|
28
|
+
onTemplateNodeUpdated(t) {
|
|
29
|
+
super.onTemplateNodeUpdated(t), this._setFormValues();
|
|
30
|
+
}
|
|
31
|
+
// ========================================================================
|
|
32
|
+
// State Reading
|
|
33
|
+
// ========================================================================
|
|
34
|
+
_setFormValues() {
|
|
35
|
+
this.api.updateValues({
|
|
36
|
+
[i.TEXT_TRIM_ENABLED]: this._getCurrentTrimState()
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
_getCurrentTrimState() {
|
|
40
|
+
if (!this.currentNode || !("hasClass" in this.currentNode))
|
|
41
|
+
return !1;
|
|
42
|
+
if (this.currentNode.hasClass(o))
|
|
43
|
+
return !0;
|
|
44
|
+
const t = this._getTargetElements();
|
|
45
|
+
return t.length > 0 && "hasClass" in t[0] ? t[0].hasClass(o) : !1;
|
|
46
|
+
}
|
|
47
|
+
// ========================================================================
|
|
48
|
+
// Target Element Discovery (per-attribute scoping)
|
|
49
|
+
// ========================================================================
|
|
50
|
+
/**
|
|
51
|
+
* Finds all custom attribute elements of the same type as the current node.
|
|
52
|
+
*
|
|
53
|
+
* Similar to getCustomAttrTargetNodes in customAttribute/index.ts, but adapted
|
|
54
|
+
* for CommonControl lifecycle where currentNode is a class property (not a
|
|
55
|
+
* parameter from Stripo's getTargetNodes override).
|
|
56
|
+
*/
|
|
57
|
+
_getTargetElements() {
|
|
58
|
+
if (!this.currentNode || !("closest" in this.currentNode))
|
|
59
|
+
return [];
|
|
60
|
+
const t = this.currentNode.closest(u);
|
|
61
|
+
if (!t)
|
|
62
|
+
return [];
|
|
63
|
+
const e = "asElement" in this.currentNode ? this.currentNode.asElement().getAttribute(a) : null;
|
|
64
|
+
if (e) {
|
|
65
|
+
const s = `[esd-extension-block-id="${n.CUSTOM_ATTRIBUTE}"][${a}="${e}"]`;
|
|
66
|
+
return Array.from(t.querySelectorAll(s));
|
|
67
|
+
}
|
|
68
|
+
return Array.from(
|
|
69
|
+
t.querySelectorAll(
|
|
70
|
+
`[esd-extension-block-id="${n.CUSTOM_ATTRIBUTE}"]`
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
// ========================================================================
|
|
75
|
+
// Toggle Handler
|
|
76
|
+
// ========================================================================
|
|
77
|
+
_onTextTrimChange(t) {
|
|
78
|
+
const e = this._getTargetElements();
|
|
79
|
+
if (!e.length)
|
|
80
|
+
return;
|
|
81
|
+
t && c(this.api);
|
|
82
|
+
const r = this.api.getDocumentModifier();
|
|
83
|
+
e.forEach((s) => {
|
|
84
|
+
t ? r.modifyHtml(s).setClass(o) : r.modifyHtml(s).removeClass(o);
|
|
85
|
+
}), r.apply(
|
|
86
|
+
new T(
|
|
87
|
+
t ? "Enable custom attribute text trimming" : "Disable custom attribute text trimming"
|
|
88
|
+
)
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
_listenToFormUpdates() {
|
|
92
|
+
this.api.onValueChanged(i.TEXT_TRIM_ENABLED, (t) => {
|
|
93
|
+
this._onTextTrimChange(t);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
g as CustomAttributeTextTrimControl
|
|
99
|
+
};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
var c = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var a = (s,
|
|
4
|
-
import { UEAttr as
|
|
2
|
+
var l = (s, o, t) => o in s ? c(s, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[o] = t;
|
|
3
|
+
var a = (s, o, t) => l(s, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { UEAttr as h } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
5
|
import { CommonControl as d } from "../../../common-control.js";
|
|
6
6
|
import { RecommendationConfigService as n } from "../../services/configService.js";
|
|
7
7
|
import { useRecommendationExtensionStore as m } from "../../store/recommendation.js";
|
|
8
|
-
|
|
8
|
+
import { mapLegacyStrategy as g } from "../../utils/legacyStrategyMap.js";
|
|
9
|
+
const u = "recommendation-algorithm-control", i = {
|
|
9
10
|
ALGORITHM: "strategy",
|
|
10
11
|
PRODUCT_IDS: "productIds"
|
|
11
12
|
};
|
|
12
|
-
class
|
|
13
|
+
class R extends d {
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
15
16
|
// Store is used ONLY for API-fetched data (algorithms list), not for config
|
|
16
17
|
a(this, "store", m());
|
|
17
18
|
}
|
|
18
19
|
getId() {
|
|
19
|
-
return
|
|
20
|
+
return u;
|
|
20
21
|
}
|
|
21
22
|
getTemplate() {
|
|
22
23
|
return `
|
|
@@ -24,13 +25,13 @@ class T extends d {
|
|
|
24
25
|
${this._GuTwoColumns([
|
|
25
26
|
this._GuLabel({ text: this.api.translate("Recommendation Algorithm") }),
|
|
26
27
|
this._GuSelect({
|
|
27
|
-
name:
|
|
28
|
+
name: i.ALGORITHM,
|
|
28
29
|
placeholder: this.api.translate("Select Recommendation Algorithm"),
|
|
29
30
|
options: this.store.getActivePredictiveAlgorithms
|
|
30
31
|
}),
|
|
31
|
-
this._GuLabel({ text: this.api.translate("Product Ids"), name: `${
|
|
32
|
+
this._GuLabel({ text: this.api.translate("Product Ids"), name: `${i.PRODUCT_IDS}_label` }),
|
|
32
33
|
this._GuTextInput({
|
|
33
|
-
name:
|
|
34
|
+
name: i.PRODUCT_IDS,
|
|
34
35
|
placeholder: this.api.translate("Enter Product Ids"),
|
|
35
36
|
className: "es-180w"
|
|
36
37
|
})
|
|
@@ -42,23 +43,23 @@ class T extends d {
|
|
|
42
43
|
this._initializeSelectItems(), this._setFormValues(), this._listenToFormUpdates();
|
|
43
44
|
}
|
|
44
45
|
onTemplateNodeUpdated(t) {
|
|
45
|
-
super.onTemplateNodeUpdated(t), this._setFormValues();
|
|
46
|
+
super.onTemplateNodeUpdated(t), this._initializeSelectItems(), this._setFormValues();
|
|
46
47
|
}
|
|
47
48
|
_setFormValues() {
|
|
48
|
-
const t = n.getConfig(this.currentNode);
|
|
49
|
-
this._setProductIdsVisibility(
|
|
50
|
-
[
|
|
51
|
-
[
|
|
49
|
+
const t = n.getConfig(this.currentNode), e = g(t.strategy) ?? t.strategy;
|
|
50
|
+
this._setProductIdsVisibility(e), this.api.updateValues({
|
|
51
|
+
[i.ALGORITHM]: e,
|
|
52
|
+
[i.PRODUCT_IDS]: t.productIds.join(",")
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
_initializeSelectItems() {
|
|
55
|
-
var
|
|
56
|
-
const t = (
|
|
56
|
+
var e;
|
|
57
|
+
const t = (e = this.store) == null ? void 0 : e.getActivePredictiveAlgorithms;
|
|
57
58
|
if (t != null && t.length)
|
|
58
59
|
try {
|
|
59
60
|
this.api.setUIEAttribute(
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
i.ALGORITHM,
|
|
62
|
+
h.SELECTPICKER.items,
|
|
62
63
|
t
|
|
63
64
|
);
|
|
64
65
|
} catch (r) {
|
|
@@ -67,7 +68,7 @@ class T extends d {
|
|
|
67
68
|
}
|
|
68
69
|
_setProductIdsVisibility(t) {
|
|
69
70
|
const r = (t ?? n.getConfig(this.currentNode).strategy) === "manualMerchandising";
|
|
70
|
-
this.api.setVisibility(
|
|
71
|
+
this.api.setVisibility(i.PRODUCT_IDS, r), this.api.setVisibility(`${i.PRODUCT_IDS}_label`, r);
|
|
71
72
|
}
|
|
72
73
|
_onAlgorithmChange(t) {
|
|
73
74
|
!this.currentNode || n.getConfig(this.currentNode).strategy === t || (n.updateConfig(
|
|
@@ -80,23 +81,23 @@ class T extends d {
|
|
|
80
81
|
_onProductIdsChange(t) {
|
|
81
82
|
if (!this.currentNode)
|
|
82
83
|
return;
|
|
83
|
-
const
|
|
84
|
+
const e = t.split(",").map((r) => r.trim()).filter(Boolean);
|
|
84
85
|
n.updateConfig(
|
|
85
86
|
this.api,
|
|
86
87
|
this.currentNode,
|
|
87
|
-
{ productIds:
|
|
88
|
+
{ productIds: e },
|
|
88
89
|
"Updated product IDs"
|
|
89
|
-
), this.store.patchCurrentBlockConfig({ productIds:
|
|
90
|
+
), this.store.patchCurrentBlockConfig({ productIds: e });
|
|
90
91
|
}
|
|
91
92
|
_listenToFormUpdates() {
|
|
92
|
-
this.api.onValueChanged(
|
|
93
|
+
this.api.onValueChanged(i.ALGORITHM, (t) => {
|
|
93
94
|
this._onAlgorithmChange(t);
|
|
94
|
-
}), this.api.onValueChanged(
|
|
95
|
+
}), this.api.onValueChanged(i.PRODUCT_IDS, (t) => {
|
|
95
96
|
this._onProductIdsChange(t);
|
|
96
97
|
});
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
u as ALGORITHM_CONTROL_ID,
|
|
102
|
+
R as AlgorithmControl
|
|
102
103
|
};
|
|
@@ -114,7 +114,9 @@ class H extends g {
|
|
|
114
114
|
var r;
|
|
115
115
|
super.onTemplateNodeUpdated(t);
|
|
116
116
|
const e = this._getRecommendationIdFromNode(t);
|
|
117
|
-
e !== null && e !== this.store.currentRecommendationId && this.store.setCurrentBlock(e), this._syncNodeConfigToStore(), e !== null && !((r = this.store.blockStates[e]) != null && r.isInitialized) && this._fetchBlockData(e)
|
|
117
|
+
e !== null && e !== this.store.currentRecommendationId && this.store.setCurrentBlock(e), e !== null && this._syncNodeConfigToStore(), e !== null && !((r = this.store.blockStates[e]) != null && r.isInitialized) && this._fetchBlockData(e).then(() => {
|
|
118
|
+
this._initializeSubControls();
|
|
119
|
+
}), [
|
|
118
120
|
this.layoutOrientationControl,
|
|
119
121
|
this.productCountControl,
|
|
120
122
|
this.algorithmControl,
|