@useinsider/guido 3.6.0-beta.3eeb930 → 3.6.0-beta.7ac8612
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/composables/useHtmlValidator.js +131 -102
- package/dist/composables/useRecommendation.js +33 -34
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +28 -27
- package/dist/config/compiler/utils/recommendationIgnoreUtils.js +15 -0
- package/dist/config/migrator/recommendation/extractors.js +44 -22
- package/dist/config/migrator/recommendation/htmlBuilder.js +175 -169
- package/dist/config/migrator/recommendationMigrator.js +30 -31
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +21 -15
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +38 -24
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +57 -52
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +45 -34
- package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +3 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +62 -52
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -67
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +7 -6
- package/dist/extensions/Blocks/Recommendation/extension.js +6 -5
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +3 -2
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +10 -13
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -2
- package/dist/extensions/Blocks/Recommendation/templates/index.js +5 -4
- package/dist/src/composables/useHtmlValidator.d.ts +9 -0
- package/dist/src/composables/useHtmlValidator.test.d.ts +1 -0
- package/dist/src/config/compiler/utils/recommendationIgnoreUtils.d.ts +17 -0
- package/dist/src/config/compiler/utils/recommendationIgnoreUtils.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +15 -0
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +8 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +21 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +9 -0
- package/package.json +1 -1
- package/dist/extensions/Blocks/Recommendation/utils/partnerCustomizations.js +0 -21
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerCustomizations.d.ts +0 -7
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export { RecommendationBlockId } from './blockIds';
|
|
10
10
|
export { RecommendationControlId } from './controlIds';
|
|
11
|
-
export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_CUSTOM_PREFIX, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
|
|
11
|
+
export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON, CSS_CLASS_SKIP_COMPILE, RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_CUSTOM_PREFIX, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
|
|
12
12
|
export { LAYOUT_VALUES, LAYOUT_OPTIONS, DEFAULT_PRODUCTS_PER_ROW, DEFAULT_CARDS_IN_ROW, DEFAULT_MOBILE_CARDS_IN_ROW, MAX_PRODUCT_COUNT, MIN_PRODUCT_COUNT, MAX_PRODUCTS_PER_ROW, MIN_PRODUCTS_PER_ROW, MAX_MOBILE_PRODUCTS_PER_ROW, MIN_MOBILE_PRODUCTS_PER_ROW, DEFAULT_COLUMN_SPACING, DEFAULT_ROW_SPACING, DEFAULT_MOBILE_COLUMN_SPACING, DEFAULT_MOBILE_ROW_SPACING, MIN_SPACING, MAX_SPACING, SPACING_STEP, } from './layout';
|
|
13
13
|
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
@@ -23,6 +23,18 @@ export declare const MOBILE_ROW_SELECTOR = ".ins-recommendation-mobile-row";
|
|
|
23
23
|
* `{{cId_pIdx_url}}` template variable.
|
|
24
24
|
*/
|
|
25
25
|
export declare const CSS_CLASS_RECO_BUTTON = "reco-v3-button";
|
|
26
|
+
/**
|
|
27
|
+
* Opt-out class for partners who want to inject their own template variables
|
|
28
|
+
* into a recommendation block. When present on `.recommendation-block-v2`,
|
|
29
|
+
* Guido skips ONLY its product-data → template-variable substitution
|
|
30
|
+
* (`replaceProductAttributes`) for that block — partners author their own
|
|
31
|
+
* `{{recoId_index_attribute}}` variables. Everything else (campaign URL
|
|
32
|
+
* building, hidden-row removal, Outlook image widths, text-trim CSS, discount
|
|
33
|
+
* conditions, store hydration, store-level config validation, and general HTML
|
|
34
|
+
* optimizations) still applies. The class is preserved in the final compiled
|
|
35
|
+
* output so partners may use it for their own styling.
|
|
36
|
+
*/
|
|
37
|
+
export declare const CSS_CLASS_SKIP_COMPILE = "ins-skip-compile";
|
|
26
38
|
/**
|
|
27
39
|
* Currency HTML attributes set on the block element
|
|
28
40
|
* These are read by the HTML compiler at runtime to format prices
|
|
@@ -61,3 +73,12 @@ export declare const ATTR_PRODUCT_ATTR = "product-attr";
|
|
|
61
73
|
* Used to exclude these from the custom attribute dropdown to prevent duplication with toggles.
|
|
62
74
|
*/
|
|
63
75
|
export declare const BUILT_IN_DEFAULT_ATTRIBUTES: Set<string>;
|
|
76
|
+
/**
|
|
77
|
+
* Attribute names valid inside a `{{recoId_index_attributeName}}` template
|
|
78
|
+
* variable regardless of the account's custom attribute list. Every built-in
|
|
79
|
+
* composition attribute is valid, plus `currency` and `discount` which the
|
|
80
|
+
* compiler emits but are not composition toggles. Custom attributes are
|
|
81
|
+
* validated separately against the account's fetched attribute list
|
|
82
|
+
* (`stripo/email-recommendation-attributes`).
|
|
83
|
+
*/
|
|
84
|
+
export declare const RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES: Set<string>;
|
|
@@ -17,6 +17,13 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
17
17
|
getId(): string;
|
|
18
18
|
getTemplate(): string;
|
|
19
19
|
onRender(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Card composition restructures the block (toggles/reorders/adds attribute
|
|
22
|
+
* cells), which would corrupt a partner-managed (`ins-skip-compile`) block's
|
|
23
|
+
* preserved markup. There is no native tab-disable API, so the whole control
|
|
24
|
+
* container is rendered inert (greyed + non-interactive) instead.
|
|
25
|
+
*/
|
|
26
|
+
_syncDisabledState(): void;
|
|
20
27
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
21
28
|
onDestroy(): void;
|
|
22
29
|
private _initializeComposition;
|
|
@@ -21,6 +21,11 @@ export declare class LayoutOrientationControl extends CommonControl {
|
|
|
21
21
|
getTemplate(): string;
|
|
22
22
|
onRender(): void;
|
|
23
23
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
24
|
+
/**
|
|
25
|
+
* Layout orientation restructures the whole block, which is meaningless for
|
|
26
|
+
* partner-managed (`ins-skip-compile`) blocks — disable the control there.
|
|
27
|
+
*/
|
|
28
|
+
_syncDisabledState(): void;
|
|
24
29
|
_setFormValues(): void;
|
|
25
30
|
/**
|
|
26
31
|
* Handles layout change
|
|
@@ -30,6 +30,12 @@ export declare class ProductLayoutControl extends CommonControl {
|
|
|
30
30
|
getTemplate(): string;
|
|
31
31
|
onRender(): void;
|
|
32
32
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
33
|
+
/**
|
|
34
|
+
* Products-per-row and mobile-layout restructure the block, which is
|
|
35
|
+
* meaningless for partner-managed (`ins-skip-compile`) blocks — disable
|
|
36
|
+
* these inputs there. Disabling coexists with the visibility logic above.
|
|
37
|
+
*/
|
|
38
|
+
_syncDisabledState(): void;
|
|
33
39
|
onDestroy(): void;
|
|
34
40
|
_setFormValues(): void;
|
|
35
41
|
/**
|
|
@@ -35,6 +35,15 @@ interface DocumentModifier {
|
|
|
35
35
|
* @returns The block element or null if not found
|
|
36
36
|
*/
|
|
37
37
|
export declare function getBlockElement(currentNode: ImmutableHtmlNode | null | undefined): ImmutableHtmlNode | null;
|
|
38
|
+
/**
|
|
39
|
+
* True when the recommendation block has opted out of Guido's content
|
|
40
|
+
* regeneration via the `ins-skip-compile` class. Partner-managed blocks carry
|
|
41
|
+
* hand-authored `{{...}}` variables in their cells, so Guido must never
|
|
42
|
+
* overwrite their content with product data (regenerate / in-place update).
|
|
43
|
+
* @param currentNode - The current template node
|
|
44
|
+
* @returns True if the block opted out of content regeneration
|
|
45
|
+
*/
|
|
46
|
+
export declare function isPartnerManagedBlock(currentNode: ImmutableHtmlNode | null | undefined): boolean;
|
|
38
47
|
/**
|
|
39
48
|
* Gets the current layout orientation from the block's data attribute
|
|
40
49
|
* Supports both old (horizontal/vertical) and new (list/grid) values for backward compatibility
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.6.0-beta.
|
|
3
|
+
"version": "3.6.0-beta.7ac8612",
|
|
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",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const i = [
|
|
2
|
-
"ozonebg",
|
|
3
|
-
"ozonehr",
|
|
4
|
-
"ozonero",
|
|
5
|
-
"ozoneinfo",
|
|
6
|
-
"babybg",
|
|
7
|
-
"ozongr",
|
|
8
|
-
"iboodat",
|
|
9
|
-
"iboodbe",
|
|
10
|
-
"iboodde",
|
|
11
|
-
"iboodfr",
|
|
12
|
-
"iboodnl",
|
|
13
|
-
"iboodpl"
|
|
14
|
-
], r = ["interencheres", "interencherespreprod"], d = ["lodenfrey", "lodenfreyuat"], c = "manualMerchandising";
|
|
15
|
-
function s(e, n) {
|
|
16
|
-
const o = {};
|
|
17
|
-
return i.includes(e) && (o.excludePurchaseDay = "30", o.userId = "{user_id}"), r.includes(e) && (o.hp = "1"), d.includes(e) && n === c && (o.includeOutOfStockItems = "true"), o;
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
s as getPartnerRecommendationParams
|
|
21
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the extra recommendation feed query params for an account, if any.
|
|
3
|
-
* Accounts without customizations get an empty object.
|
|
4
|
-
* @param partnerName Account subdomain (`config.partner.name`)
|
|
5
|
-
* @param strategy Recommendation strategy key of the block
|
|
6
|
-
*/
|
|
7
|
-
export declare function getPartnerRecommendationParams(partnerName: string, strategy: string): Record<string, string>;
|