@useinsider/guido 3.19.0-beta.76f392b → 3.19.0-beta.7d287ab
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 +104 -91
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +79 -74
- package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
- package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
- package/dist/components/wrappers/WpModal.vue.js +1 -1
- package/dist/components/wrappers/WpModal.vue2.js +4 -3
- package/dist/composables/useAuthError.js +52 -0
- package/dist/composables/useAutoSave.js +11 -11
- package/dist/composables/useHttp.js +64 -54
- package/dist/composables/useLegacyStrategyConversion.js +23 -19
- package/dist/composables/useStripo.js +24 -20
- package/dist/composables/useToaster.js +17 -15
- package/dist/composables/validators/useLiquidValidator.js +15 -15
- package/dist/config/migrator/index.js +14 -13
- package/dist/config/migrator/itemsBlockMigrator.js +248 -236
- package/dist/config/migrator/recommendationMigrator.js +28 -21
- package/dist/config/migrator/recommendationPartnerMigrator.js +56 -0
- package/dist/enums/extensions/recommendationBlock.js +30 -29
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +17 -18
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +105 -114
- package/dist/extensions/Blocks/Items/enums/productEnums.js +9 -14
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +9 -11
- package/dist/extensions/Blocks/Items/template.js +204 -219
- package/dist/extensions/Blocks/Recommendation/block.js +15 -14
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +233 -189
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +72 -49
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +30 -29
- package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +25 -0
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/schemas.d.ts +16 -0
- package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
- package/dist/src/composables/useAuthError.d.ts +12 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useGuidoActions.d.ts +2 -0
- package/dist/src/composables/useHttp.d.ts +2 -0
- package/dist/src/config/migrator/index.d.ts +2 -1
- package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +0 -3
- package/dist/src/extensions/Blocks/Items/template.d.ts +0 -19
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +8 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +33 -0
- package/dist/src/mock/cortexChatStore.d.ts +12 -0
- package/dist/src/stores/config.d.ts +20 -0
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/src/stores/recommendation.d.ts +5 -0
- package/dist/src/utils/dateUtil.d.ts +10 -0
- package/dist/src/utils/genericUtil.d.ts +3 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +9 -0
- package/dist/stores/onboarding.js +4 -0
- package/dist/utils/pairProductVariables.js +71 -71
- package/package.json +1 -1
- package/dist/extensions/Blocks/Items/constants/cardLayout.js +0 -20
- package/dist/src/extensions/Blocks/Items/constants/cardLayout.d.ts +0 -44
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var y = Object.defineProperty;
|
|
2
2
|
var A = (l, c, t) => c in l ? y(l, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[c] = t;
|
|
3
|
-
var
|
|
4
|
-
import { useConfig as
|
|
3
|
+
var h = (l, c, t) => A(l, typeof c != "symbol" ? c + "" : c, t);
|
|
4
|
+
import { useConfig as d } from "../../../composables/useConfig.js";
|
|
5
5
|
import { BlockId as D } from "../../../enums/block.js";
|
|
6
6
|
import { getMigrationBannerHtml as C } from "../../../utils/migrationBannerHtml.js";
|
|
7
7
|
import { Block as E, BlockCompositionType as S, ModificationDescription as p } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
@@ -10,9 +10,9 @@ import { RECOMMENDATION_ID_ATTR as m } from "./constants/selectors.js";
|
|
|
10
10
|
import { regenerateMobileProductRows as M } from "./controls/main/utils.js";
|
|
11
11
|
import { ensureMobileCssRulesExist as I, setMobileLayoutOptOut as R, hasMobileLayoutOptOut as w } from "./controls/mobileLayout/cssRules.js";
|
|
12
12
|
import { RecommendationConfigService as s } from "./services/configService.js";
|
|
13
|
-
import { useRecommendationExtensionStore as
|
|
13
|
+
import { useRecommendationExtensionStore as g } from "./store/recommendation.js";
|
|
14
14
|
import { getDefaultTemplate as T } from "./templates/grid/template.js";
|
|
15
|
-
import { useRecommendationBlockWarning as
|
|
15
|
+
import { useRecommendationBlockWarning as v } from "./useRecommendationBlockWarning.js";
|
|
16
16
|
const k = D.Recommendation, u = "recommendation-block-v2", B = "hide-price";
|
|
17
17
|
let b = !1;
|
|
18
18
|
class j extends E {
|
|
@@ -22,9 +22,9 @@ class j extends E {
|
|
|
22
22
|
* Stores the ID generated in getTemplate() so onCreated() can reuse it.
|
|
23
23
|
* This avoids generating a new (different) ID in onCreated().
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
h(this, "_pendingBlockId", null);
|
|
26
26
|
/** Ids already reset under their new name, so the deferred pass skips their stale snapshot. */
|
|
27
|
-
|
|
27
|
+
h(this, "_resetSourceIds", /* @__PURE__ */ new Set());
|
|
28
28
|
}
|
|
29
29
|
getId() {
|
|
30
30
|
return k;
|
|
@@ -91,18 +91,19 @@ class j extends E {
|
|
|
91
91
|
}
|
|
92
92
|
const i = this._pendingBlockId ?? this._generateNextId();
|
|
93
93
|
this._pendingBlockId = null, this._assignRecommendationId(t, i);
|
|
94
|
-
const n =
|
|
94
|
+
const n = d().isFeatureEnabled("reusableRecommendationStrategy"), o = n && !s.hasConfig(t), { config: r, wasFreshDrop: a } = s.initializeConfig(
|
|
95
95
|
this.api,
|
|
96
96
|
t,
|
|
97
97
|
{
|
|
98
98
|
recommendationId: i,
|
|
99
99
|
configVersion: n ? N : O,
|
|
100
|
+
...o ? { partnerName: d().partnerName.value } : {},
|
|
100
101
|
// An RRS block picks a strategy, not an algorithm, and its algorithm control is
|
|
101
102
|
// hidden. Keeping the `mostPopular` default would bake a most-popular feed URL
|
|
102
103
|
// at save for a block the user never configured.
|
|
103
104
|
...o ? { strategy: "" } : {}
|
|
104
105
|
}
|
|
105
|
-
), f =
|
|
106
|
+
), f = g();
|
|
106
107
|
if (f.setCurrentBlock(i), this._stampHidePrice(t, r.priceHideIfSameAsDiscounted), a) {
|
|
107
108
|
I(this.api);
|
|
108
109
|
const _ = this._getBlockElement(t);
|
|
@@ -151,7 +152,7 @@ class j extends E {
|
|
|
151
152
|
*/
|
|
152
153
|
onDelete(t) {
|
|
153
154
|
const e = this._getRecommendationId(t);
|
|
154
|
-
e &&
|
|
155
|
+
e && g().removeBlockState(e);
|
|
155
156
|
}
|
|
156
157
|
/**
|
|
157
158
|
* Warns (dark advisory toaster) when the design holds more than one live
|
|
@@ -167,7 +168,7 @@ class j extends E {
|
|
|
167
168
|
*/
|
|
168
169
|
_warnIfMultipleBlocks() {
|
|
169
170
|
try {
|
|
170
|
-
|
|
171
|
+
v().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
|
|
171
172
|
} catch {
|
|
172
173
|
}
|
|
173
174
|
}
|
|
@@ -197,9 +198,9 @@ class j extends E {
|
|
|
197
198
|
* the renamed one depending on where the module was dropped (SD-149916).
|
|
198
199
|
*/
|
|
199
200
|
_scheduleArrivalReset(t) {
|
|
200
|
-
|
|
201
|
+
d().isFeatureEnabled("reusableRecommendationStrategy") && setTimeout(() => {
|
|
201
202
|
const e = this._getRecommendationId(t);
|
|
202
|
-
e !== null && e > 0 && !this._resetSourceIds.delete(e) &&
|
|
203
|
+
e !== null && e > 0 && !this._resetSourceIds.delete(e) && g().resetArrivedBlock(e);
|
|
203
204
|
}, 0);
|
|
204
205
|
}
|
|
205
206
|
/**
|
|
@@ -255,8 +256,8 @@ class j extends E {
|
|
|
255
256
|
}
|
|
256
257
|
/** Assigns a fresh id to a duplicated block and syncs DOM, node config and store. */
|
|
257
258
|
_handleDuplicate(t, e) {
|
|
258
|
-
const i = this._reassignDuplicateId(t, e), n =
|
|
259
|
-
n.cloneBlockState(e, i), n.setCurrentBlock(i),
|
|
259
|
+
const i = this._reassignDuplicateId(t, e), n = g();
|
|
260
|
+
n.cloneBlockState(e, i), n.setCurrentBlock(i), d().isFeatureEnabled("reusableRecommendationStrategy") && (this._resetSourceIds.add(e), n.resetArrivedBlock(i)), this._warnIfMultipleBlocks();
|
|
260
261
|
}
|
|
261
262
|
/**
|
|
262
263
|
* Core id-reassignment for a duplicated block: rewrites the DOM
|