@useinsider/guido 3.22.0-beta.91802bb → 3.22.0-beta.cca3c2e
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/config/compiler/utils/recommendationCompilerUtils.js +22 -22
- package/dist/config/migrator/recommendation/compositionMapper.js +56 -49
- package/dist/config/migrator/recommendation/extractors.js +100 -40
- package/dist/config/migrator/recommendation/htmlBuilder.js +285 -207
- package/dist/config/migrator/recommendation/settingsMapper.js +37 -36
- package/dist/config/migrator/recommendation/themeMapper.js +53 -41
- package/dist/config/migrator/recommendationMigrator.js +68 -61
- package/dist/extensions/Blocks/Recommendation/block.js +33 -24
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +20 -19
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +148 -163
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +23 -22
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +19 -18
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +82 -91
- package/dist/extensions/Blocks/Recommendation/utils/inlinePriceOrder.js +12 -0
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +3 -2
- package/dist/package.json.js +2 -2
- package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +3 -1
- package/dist/src/config/migrator/recommendation/extractors.d.ts +35 -6
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +3 -1
- package/dist/src/config/migrator/recommendation/themeMapper.d.ts +3 -1
- package/dist/src/config/migrator/recommendation/types.d.ts +11 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -8
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +1 -13
- package/dist/src/extensions/Blocks/Recommendation/utils/inlinePriceOrder.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +2 -19
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CurrencyConfig } from '../types/nodeConfig';
|
|
2
2
|
import type { FiltersResponse, RecommendationProduct } from '@@/Types/recommendation';
|
|
3
3
|
import { ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON } from '../constants';
|
|
4
|
+
export { resolveInlinePriceOrder } from '../utils/inlinePriceOrder';
|
|
4
5
|
type PriceKey = 'price' | 'original_price' | 'discount';
|
|
5
6
|
/**
|
|
6
7
|
* Current currency configuration from the store, in CurrencyConfig shape.
|
|
@@ -22,18 +23,6 @@ export declare function isSamePrice(product: RecommendationProduct): boolean;
|
|
|
22
23
|
* e.g., "rating_star" → "Rating Star"
|
|
23
24
|
*/
|
|
24
25
|
export declare function toDisplayName(attrName: string): string;
|
|
25
|
-
/**
|
|
26
|
-
* Resolves the inline (side-by-side) price layout from the composition order so
|
|
27
|
-
* it matches the stacked order. `anchor` is whichever of price / original price
|
|
28
|
-
* comes first in the composition (the merged cell renders there); `skip` is the
|
|
29
|
-
* other (dropped, since it's merged in); `originalFirst` puts the original price
|
|
30
|
-
* on the left when it precedes the sale price (the default composition order).
|
|
31
|
-
*/
|
|
32
|
-
export declare function resolveInlinePriceOrder(composition: string[]): {
|
|
33
|
-
originalFirst: boolean;
|
|
34
|
-
anchor: string;
|
|
35
|
-
skip: string;
|
|
36
|
-
};
|
|
37
26
|
/**
|
|
38
27
|
* Reduces a raw product-attribute value to a displayable scalar string.
|
|
39
28
|
* Array-type attributes (filter types `Strings`/`Numbers`) are substituted with
|
|
@@ -328,4 +317,3 @@ export declare function getDefaultProducts(count?: number): RecommendationProduc
|
|
|
328
317
|
* @returns HTML template string with {-{-TITLE-}-}, {-{-PRODUCT_ROWS-}-}, and {-{-MOBILE_PRODUCT_ROWS-}-} (grid only) placeholders
|
|
329
318
|
*/
|
|
330
319
|
export declare function createBlockTemplate(layout?: Orientation, instanceClass?: string): string;
|
|
331
|
-
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves the inline price layout from the composition order: `anchor` is whichever price comes first (the merged
|
|
3
|
+
* cell renders there), `skip` is the other; `originalFirst` puts the original price on the left.
|
|
4
|
+
*/
|
|
5
|
+
export declare function resolveInlinePriceOrder(composition: string[]): {
|
|
6
|
+
originalFirst: boolean;
|
|
7
|
+
anchor: string;
|
|
8
|
+
skip: string;
|
|
9
|
+
};
|
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Maps legacy
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Renames are matched by feed-source id:
|
|
6
|
-
* - `viewedTogether` → `similarViewed` (id 11, path `viewed-together`)
|
|
7
|
-
* - `purchasedTogether` → `similarBought` (id 12, path `purchased-together`)
|
|
8
|
-
* - `trending` → `trendingProducts` (id 40, path `trending`)
|
|
9
|
-
* - `mostValuable` → `mostValuableOfPartner` (id 46, path `most-valuable`)
|
|
10
|
-
* - `topSellers` → `mostPurchased` (id 62, path `top-sellers`)
|
|
11
|
-
* - `mostViewed` → `mostPopular` (id 61, path `most-popular`)
|
|
12
|
-
*
|
|
13
|
-
* Used at two boundaries:
|
|
14
|
-
* 1. The migrator (`settingsMapper`), so freshly migrated node configs carry
|
|
15
|
-
* the new key.
|
|
16
|
-
* 2. The algorithm dropdown control, so already-saved blocks that still carry
|
|
17
|
-
* a legacy key resolve to a matching dropdown option.
|
|
18
|
-
*
|
|
19
|
-
* Unknown values pass through untouched so a future-added algorithm doesn't
|
|
20
|
-
* silently default.
|
|
2
|
+
* Maps legacy strategy keys to `RecommendationFeedSourceMaps` keys; product-bound ones (ids 11, 12, excluded from the
|
|
3
|
+
* dropdown) become `mostPopular`. Unknown keys pass through so a future algorithm is not silently defaulted.
|
|
21
4
|
*/
|
|
22
5
|
export declare function mapLegacyStrategy(legacy: string | undefined): string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.22.0-beta.
|
|
3
|
+
"version": "3.22.0-beta.cca3c2e",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|