@useinsider/guido 3.18.1-beta.12053dd → 3.18.1-beta.178a3ec
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/components/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +30 -30
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +11 -13
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +53 -65
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -20
- package/dist/composables/useCustomInterfaceAppearance.js +46 -56
- package/dist/composables/useHtmlValidator.js +79 -84
- package/dist/composables/useRecommendation.js +35 -40
- package/dist/composables/useStripo.js +30 -30
- package/dist/config/migrator/itemsBlockMigrator.js +225 -163
- package/dist/enums/extensions/recommendationBlock.js +31 -38
- package/dist/extensions/Blocks/Items/constants/cardLayout.js +20 -0
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +18 -17
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +114 -105
- package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +11 -9
- package/dist/extensions/Blocks/Items/template.js +212 -201
- package/dist/extensions/Blocks/Recommendation/block.js +39 -43
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +20 -21
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +58 -63
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -84
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +130 -222
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -21
- package/dist/guido.css +1 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/constants/cardLayout.d.ts +44 -0
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +19 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -9
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -75
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -4
- package/dist/src/stores/onboarding.d.ts +0 -377
- package/dist/static/styles/components/recommendation-strategy.css.js +4 -34
- package/dist/stores/onboarding.js +36 -41
- package/dist/utils/pairProductVariables.js +71 -71
- package/dist/utils/templatePreparation.js +49 -49
- package/package.json +1 -1
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +0 -47
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +0 -2
- package/dist/static/styles/components/skeleton.css.js +0 -23
|
@@ -1,43 +1,34 @@
|
|
|
1
|
-
const
|
|
1
|
+
const l = [
|
|
2
2
|
{
|
|
3
3
|
key: "locale",
|
|
4
4
|
getValue: (e) => e.language,
|
|
5
5
|
getAvailableOptions: (e) => Object.keys(e.languages)
|
|
6
6
|
},
|
|
7
|
-
{
|
|
8
|
-
// A block feeds from either an assigned strategy (RRS) or an algorithm (legacy).
|
|
9
|
-
// Only a fresh RRS block has neither, and its feed URL would otherwise be built
|
|
10
|
-
// from an empty algorithm path.
|
|
11
|
-
key: o,
|
|
12
|
-
getValue: (e) => e.strategyId || e.strategy
|
|
13
|
-
},
|
|
14
7
|
{
|
|
15
8
|
key: "currency",
|
|
16
9
|
getValue: (e) => e.currencySettings.value,
|
|
17
10
|
getAvailableOptions: (e) => e.currencyList.map((n) => n.text),
|
|
18
11
|
canBeEmpty: !0
|
|
19
12
|
}
|
|
20
|
-
],
|
|
21
|
-
function c(e, n, i =
|
|
13
|
+
], o = "newsletter.recommendation-fill-required-fields";
|
|
14
|
+
function c(e, n, i = l) {
|
|
22
15
|
return i.filter((t) => {
|
|
23
|
-
var
|
|
16
|
+
var u;
|
|
24
17
|
if (t.condition && !t.condition(e))
|
|
25
18
|
return !1;
|
|
26
|
-
const
|
|
27
|
-
if (t.canBeEmpty && (
|
|
19
|
+
const r = (u = t.getAvailableOptions) == null ? void 0 : u.call(t, n);
|
|
20
|
+
if (t.canBeEmpty && (r == null ? void 0 : r.length) === 0)
|
|
28
21
|
return !1;
|
|
29
|
-
const
|
|
30
|
-
return
|
|
22
|
+
const a = t.getValue(e);
|
|
23
|
+
return a ? r !== void 0 && !r.includes(a) : !0;
|
|
31
24
|
}).map((t) => t.key);
|
|
32
25
|
}
|
|
33
|
-
function
|
|
26
|
+
function s(e, n) {
|
|
34
27
|
return c(e, n).length === 0;
|
|
35
28
|
}
|
|
36
29
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
l as RecommendationRequiredFieldsKey,
|
|
40
|
-
o as STRATEGY_FIELD_KEY,
|
|
30
|
+
l as REQUIRED_RECOMMENDATION_FIELDS,
|
|
31
|
+
o as RecommendationRequiredFieldsKey,
|
|
41
32
|
c as getInvalidFields,
|
|
42
|
-
|
|
33
|
+
s as isConfigValid
|
|
43
34
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-1ca6baf0]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-
|
|
1
|
+
@charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-1ca6baf0]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-050dfa52]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-050dfa52]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-050dfa52]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}
|
|
@@ -5,9 +5,7 @@ export declare const URLS: {
|
|
|
5
5
|
PRODUCT_ATTRIBUTES_PATH: string;
|
|
6
6
|
RECOMMENDATION_STRATEGIES_PATH: string;
|
|
7
7
|
RECOMMENDATION_STRATEGIES_PANEL_PATH: string;
|
|
8
|
-
RECOMMENDATION_STRATEGY_CREATE_PATH: string;
|
|
9
8
|
};
|
|
10
|
-
export declare const strategyEditPath: (strategyId: string | number) => string;
|
|
11
9
|
export declare const QUERY_PARAMS: {
|
|
12
10
|
CLIENT_ID: string;
|
|
13
11
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single owner for the Items card orientation-dependent layout contract (SD-149368).
|
|
3
|
+
*
|
|
4
|
+
* Two things depend on a card's orientation and are written across several layers:
|
|
5
|
+
*
|
|
6
|
+
* 1. Name column width — a horizontal card lays the name in a narrow side-by-side
|
|
7
|
+
* column, so it is capped; a vertical card gives it a full-width row.
|
|
8
|
+
* 2. Block-cell padding — the collapsible price / original-price block-cell carries its
|
|
9
|
+
* own inter-cell spacing (horizontal cards pad left/right, vertical cards pad
|
|
10
|
+
* top/bottom) so a hidden element removes its own spacing instead of leaving a gap.
|
|
11
|
+
*
|
|
12
|
+
* Every layer that writes these — template render, layouts/horizontal.html,
|
|
13
|
+
* NameTrimmingControl (trimming toggle) and settingsControl (orientation change) — MUST
|
|
14
|
+
* derive them here, or a migrated / re-toggled card silently drifts out of sync with
|
|
15
|
+
* freshly generated markup (convention B1: cross-layer literals live in one module).
|
|
16
|
+
*/
|
|
17
|
+
export declare const NAME_HORIZONTAL_MAX_WIDTH = "130px";
|
|
18
|
+
export declare const NAME_VERTICAL_MAX_WIDTH = "100%";
|
|
19
|
+
/** Name max-width for a card orientation. Non-horizontal (incl. undefined) → full width. */
|
|
20
|
+
export declare const nameMaxWidthFor: (orientation?: string) => string;
|
|
21
|
+
/** Orientation-dependent inter-cell padding classes for a collapsible block-cell. */
|
|
22
|
+
export declare const BLOCK_CELL_PADDING: {
|
|
23
|
+
readonly VERTICAL: "es-p5b es-p5t";
|
|
24
|
+
readonly HORIZONTAL: "es-p5l es-p5r";
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Attribute the block-cell carries to mark its LAYOUT-owned padding orientation ('v'|'h').
|
|
28
|
+
* The orientation toggle keys off this marker so it only ever rewrites the padding the
|
|
29
|
+
* layout itself baked — a user's own es-p* padding classes are never matched or clobbered
|
|
30
|
+
* (SD-149368 F1), and a cell without the marker is left untouched rather than mis-swapped.
|
|
31
|
+
*/
|
|
32
|
+
export declare const BLOCK_CELL_PAD_ATTR = "data-items-cell-pad";
|
|
33
|
+
/** Marker attribute (`data-items-cell-pad="v|h"`) for a block-cell in the given orientation. */
|
|
34
|
+
export declare const blockCellPadMarker: (isVertical: boolean) => string;
|
|
35
|
+
/** Padding classes (leading space included) for a block-cell in the given orientation. */
|
|
36
|
+
export declare const blockCellPaddingFor: (isVertical: boolean) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Rewrites a block-cell's LAYOUT-owned padding classes to the target orientation, keyed off
|
|
39
|
+
* the BLOCK_CELL_PAD_ATTR marker. The orientation-change rebuild re-injects existing cells
|
|
40
|
+
* via getOuterHTML(), which still carry the previous orientation's padding — swap only the
|
|
41
|
+
* layout pair (and flip the marker) so price/original-price cells stay padded after a toggle
|
|
42
|
+
* (SD-149368 F3), while a user's own padding and any unmarked cell are left alone (F1).
|
|
43
|
+
*/
|
|
44
|
+
export declare const reorientBlockCellPadding: (html: string, toVertical: boolean) => string;
|
|
@@ -39,14 +39,17 @@ export declare const productPairs: {
|
|
|
39
39
|
CART_ITEMS: {
|
|
40
40
|
ATTR: string;
|
|
41
41
|
DEFAULT: string;
|
|
42
|
+
LEGACY_DEFAULTS: readonly string[];
|
|
42
43
|
};
|
|
43
44
|
BROWSED_ITEMS: {
|
|
44
45
|
ATTR: string;
|
|
45
46
|
DEFAULT: string;
|
|
47
|
+
LEGACY_DEFAULTS: readonly string[];
|
|
46
48
|
};
|
|
47
49
|
PURCHASED_ITEMS: {
|
|
48
50
|
ATTR: string;
|
|
49
51
|
DEFAULT: string;
|
|
52
|
+
LEGACY_DEFAULTS: readonly string[];
|
|
50
53
|
};
|
|
51
54
|
};
|
|
52
55
|
price: {
|
|
@@ -37,6 +37,25 @@ type TemplateParameters = {
|
|
|
37
37
|
/** Price orientation within the card ('vertical' = stacked, 'horizontal' = side-by-side) */
|
|
38
38
|
priceOrientation?: PriceOrientationType;
|
|
39
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* Applies price orientation styles to the generated HTML template.
|
|
42
|
+
*
|
|
43
|
+
* For Vertical Layout:
|
|
44
|
+
* - vertical price orientation: both cells 100% (stacked)
|
|
45
|
+
* - horizontal price orientation with both visible: both cells 50% (side-by-side)
|
|
46
|
+
* - horizontal price orientation with one hidden: visible cell 100%
|
|
47
|
+
*
|
|
48
|
+
* For Horizontal Layout:
|
|
49
|
+
* - horizontal price orientation: .horizontal-price visible, .vertical-price hidden
|
|
50
|
+
* - vertical price orientation: .horizontal-price hidden, .vertical-price visible
|
|
51
|
+
* @param html - The HTML template string with placeholders replaced
|
|
52
|
+
* @param layoutOrientation - The card layout orientation ('vertical' or 'horizontal')
|
|
53
|
+
* @param priceOrientation - The price orientation within the card ('vertical' or 'horizontal')
|
|
54
|
+
* @param isPriceVisible - Whether the price element is visible
|
|
55
|
+
* @param isOriginalPriceVisible - Whether the original price element is visible
|
|
56
|
+
* @returns HTML string with price orientation styles applied
|
|
57
|
+
*/
|
|
58
|
+
export declare const applyPriceOrientationStyles: (html: string, layoutOrientation: OrientationType, priceOrientation: PriceOrientationType, isPriceVisible?: boolean, isOriginalPriceVisible?: boolean) => string;
|
|
40
59
|
/**
|
|
41
60
|
* Generates the default template for the Items Block.
|
|
42
61
|
* @param params - Template parameters including orientation, items type, item ID, and formatting options
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
import type { RecommendationNodeConfig, CurrencyConfig, OmnibusTextConfig } from '../types/nodeConfig';
|
|
11
11
|
export declare const PRE_RRS_CONFIG_VERSION = 1;
|
|
12
12
|
export declare const CURRENT_CONFIG_VERSION = 2;
|
|
13
|
-
export declare const RRS_CONFIG_VERSION = 2;
|
|
14
13
|
/**
|
|
15
14
|
* Default currency configuration
|
|
16
15
|
* Uses USD as the base currency with standard formatting
|
|
@@ -10,4 +10,4 @@ export { RecommendationBlockId } from './blockIds';
|
|
|
10
10
|
export { RecommendationControlId } from './controlIds';
|
|
11
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_RECOMMENDATION_TITLE, SELECTOR_TITLE_CELL, ATTR_CUSTOM_PREFIX, ATTR_DATA_CARD_COMPOSITION, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, CSS_CLASS_ATTRIBUTE_ROW, CSS_CLASS_SPACER, SELECTOR_ATTRIBUTE_ROW, ATTR_DATA_ATTRIBUTE_TYPE, ATTR_DATA_VISIBILITY, PRODUCT_ATTRIBUTE_PREFIX, 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
|
-
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, PRE_RRS_CONFIG_VERSION,
|
|
13
|
+
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, PRE_RRS_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
@@ -66,8 +66,6 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
66
66
|
* edits are never clobbered (SD-141049).
|
|
67
67
|
*/
|
|
68
68
|
private _syncNodeConfigIfChanged;
|
|
69
|
-
/** Whether the deferred write would move the node's strategyId — see the caller (SD-149916). */
|
|
70
|
-
private _isPendingStrategyIdChange;
|
|
71
69
|
private _capturePendingNodeConfigWrite;
|
|
72
70
|
/**
|
|
73
71
|
* Accumulates the pending write into `documentModifier` without applying, so the
|
|
@@ -2,7 +2,6 @@ import { CommonControl } from '../../../common-control';
|
|
|
2
2
|
export declare const STRATEGY_CONTROL_ID = "recommendation-strategy-control";
|
|
3
3
|
export declare class StrategyControl extends CommonControl {
|
|
4
4
|
private store;
|
|
5
|
-
private onboardingStore;
|
|
6
5
|
private storeUnsubscription;
|
|
7
6
|
private listeners;
|
|
8
7
|
private lastPaintedState;
|
|
@@ -10,14 +9,6 @@ export declare class StrategyControl extends CommonControl {
|
|
|
10
9
|
getTemplate(): string;
|
|
11
10
|
private _strategyAction;
|
|
12
11
|
onRender(): void;
|
|
13
|
-
/**
|
|
14
|
-
* Whether the document itself says this block has no strategy.
|
|
15
|
-
*
|
|
16
|
-
* Read the node, not the store: when the main control cannot resolve the block id off the
|
|
17
|
-
* node it never syncs the persisted config, so the store still holds defaults (empty
|
|
18
|
-
* strategyId) for an assigned block.
|
|
19
|
-
*/
|
|
20
|
-
private _isNodeUnassigned;
|
|
21
12
|
onDestroy(): void;
|
|
22
13
|
private _teardown;
|
|
23
14
|
private _setupButtonListeners;
|
|
@@ -71,11 +71,8 @@ interface StoreState {
|
|
|
71
71
|
strategies: RrsStrategy[];
|
|
72
72
|
strategiesLoading: boolean;
|
|
73
73
|
strategyUrlTemplates: Record<string, string>;
|
|
74
|
-
strategiesFetched: boolean;
|
|
75
|
-
strategiesSettled: boolean;
|
|
76
74
|
blockStates: Record<number, PerBlockState>;
|
|
77
75
|
currentRecommendationId: number | null;
|
|
78
|
-
strategyPanelOpen: boolean;
|
|
79
76
|
configVersion: number;
|
|
80
77
|
}
|
|
81
78
|
export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"guidoRecommendationExtension", StoreState, {
|
|
@@ -102,11 +99,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
102
99
|
}[];
|
|
103
100
|
strategiesLoading: boolean;
|
|
104
101
|
strategyUrlTemplates: Record<string, string>;
|
|
105
|
-
strategiesFetched: boolean;
|
|
106
|
-
strategiesSettled: boolean;
|
|
107
102
|
blockStates: Record<number, PerBlockState>;
|
|
108
103
|
currentRecommendationId: number | null;
|
|
109
|
-
strategyPanelOpen: boolean;
|
|
110
104
|
configVersion: number;
|
|
111
105
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): PerBlockConfigs;
|
|
112
106
|
/**
|
|
@@ -131,11 +125,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
131
125
|
}[];
|
|
132
126
|
strategiesLoading: boolean;
|
|
133
127
|
strategyUrlTemplates: Record<string, string>;
|
|
134
|
-
strategiesFetched: boolean;
|
|
135
|
-
strategiesSettled: boolean;
|
|
136
128
|
blockStates: Record<number, PerBlockState>;
|
|
137
129
|
currentRecommendationId: number | null;
|
|
138
|
-
strategyPanelOpen: boolean;
|
|
139
130
|
configVersion: number;
|
|
140
131
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): RecommendationProduct[];
|
|
141
132
|
/**
|
|
@@ -160,11 +151,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
160
151
|
}[];
|
|
161
152
|
strategiesLoading: boolean;
|
|
162
153
|
strategyUrlTemplates: Record<string, string>;
|
|
163
|
-
strategiesFetched: boolean;
|
|
164
|
-
strategiesSettled: boolean;
|
|
165
154
|
blockStates: Record<number, PerBlockState>;
|
|
166
155
|
currentRecommendationId: number | null;
|
|
167
|
-
strategyPanelOpen: boolean;
|
|
168
156
|
configVersion: number;
|
|
169
157
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
170
158
|
assignStrategyDrawerStatus(state: {
|
|
@@ -186,11 +174,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
186
174
|
}[];
|
|
187
175
|
strategiesLoading: boolean;
|
|
188
176
|
strategyUrlTemplates: Record<string, string>;
|
|
189
|
-
strategiesFetched: boolean;
|
|
190
|
-
strategiesSettled: boolean;
|
|
191
177
|
blockStates: Record<number, PerBlockState>;
|
|
192
178
|
currentRecommendationId: number | null;
|
|
193
|
-
strategyPanelOpen: boolean;
|
|
194
179
|
configVersion: number;
|
|
195
180
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
196
181
|
removeStrategyModalStatus(state: {
|
|
@@ -212,11 +197,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
212
197
|
}[];
|
|
213
198
|
strategiesLoading: boolean;
|
|
214
199
|
strategyUrlTemplates: Record<string, string>;
|
|
215
|
-
strategiesFetched: boolean;
|
|
216
|
-
strategiesSettled: boolean;
|
|
217
200
|
blockStates: Record<number, PerBlockState>;
|
|
218
201
|
currentRecommendationId: number | null;
|
|
219
|
-
strategyPanelOpen: boolean;
|
|
220
202
|
configVersion: number;
|
|
221
203
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
222
204
|
assignedStrategy(state: {
|
|
@@ -238,11 +220,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
238
220
|
}[];
|
|
239
221
|
strategiesLoading: boolean;
|
|
240
222
|
strategyUrlTemplates: Record<string, string>;
|
|
241
|
-
strategiesFetched: boolean;
|
|
242
|
-
strategiesSettled: boolean;
|
|
243
223
|
blockStates: Record<number, PerBlockState>;
|
|
244
224
|
currentRecommendationId: number | null;
|
|
245
|
-
strategyPanelOpen: boolean;
|
|
246
225
|
configVersion: number;
|
|
247
226
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): RrsStrategy | null;
|
|
248
227
|
/**
|
|
@@ -267,11 +246,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
267
246
|
}[];
|
|
268
247
|
strategiesLoading: boolean;
|
|
269
248
|
strategyUrlTemplates: Record<string, string>;
|
|
270
|
-
strategiesFetched: boolean;
|
|
271
|
-
strategiesSettled: boolean;
|
|
272
249
|
blockStates: Record<number, PerBlockState>;
|
|
273
250
|
currentRecommendationId: number | null;
|
|
274
|
-
strategyPanelOpen: boolean;
|
|
275
251
|
configVersion: number;
|
|
276
252
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
277
253
|
/**
|
|
@@ -296,11 +272,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
296
272
|
}[];
|
|
297
273
|
strategiesLoading: boolean;
|
|
298
274
|
strategyUrlTemplates: Record<string, string>;
|
|
299
|
-
strategiesFetched: boolean;
|
|
300
|
-
strategiesSettled: boolean;
|
|
301
275
|
blockStates: Record<number, PerBlockState>;
|
|
302
276
|
currentRecommendationId: number | null;
|
|
303
|
-
strategyPanelOpen: boolean;
|
|
304
277
|
configVersion: number;
|
|
305
278
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): number;
|
|
306
279
|
hasFilters(): boolean;
|
|
@@ -326,11 +299,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
326
299
|
}[];
|
|
327
300
|
strategiesLoading: boolean;
|
|
328
301
|
strategyUrlTemplates: Record<string, string>;
|
|
329
|
-
strategiesFetched: boolean;
|
|
330
|
-
strategiesSettled: boolean;
|
|
331
302
|
blockStates: Record<number, PerBlockState>;
|
|
332
303
|
currentRecommendationId: number | null;
|
|
333
|
-
strategyPanelOpen: boolean;
|
|
334
304
|
configVersion: number;
|
|
335
305
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
336
306
|
text: string;
|
|
@@ -355,11 +325,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
355
325
|
}[];
|
|
356
326
|
strategiesLoading: boolean;
|
|
357
327
|
strategyUrlTemplates: Record<string, string>;
|
|
358
|
-
strategiesFetched: boolean;
|
|
359
|
-
strategiesSettled: boolean;
|
|
360
328
|
blockStates: Record<number, PerBlockState>;
|
|
361
329
|
currentRecommendationId: number | null;
|
|
362
|
-
strategyPanelOpen: boolean;
|
|
363
330
|
configVersion: number;
|
|
364
331
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
365
332
|
text: string;
|
|
@@ -384,11 +351,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
384
351
|
}[];
|
|
385
352
|
strategiesLoading: boolean;
|
|
386
353
|
strategyUrlTemplates: Record<string, string>;
|
|
387
|
-
strategiesFetched: boolean;
|
|
388
|
-
strategiesSettled: boolean;
|
|
389
354
|
blockStates: Record<number, PerBlockState>;
|
|
390
355
|
currentRecommendationId: number | null;
|
|
391
|
-
strategyPanelOpen: boolean;
|
|
392
356
|
configVersion: number;
|
|
393
357
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
394
358
|
text: string;
|
|
@@ -469,40 +433,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
469
433
|
openRemoveStrategyModal(): void;
|
|
470
434
|
closeRemoveStrategyModal(): void;
|
|
471
435
|
fetchStrategies(): Promise<void>;
|
|
472
|
-
invalidateStrategies(): void;
|
|
473
|
-
/**
|
|
474
|
-
* Opens a Smart Recommender strategy page in a new tab and refreshes the list every time
|
|
475
|
-
* the user comes back. `visibilitychange` only: a `focus` listener would also fire when
|
|
476
|
-
* focus merely returns from the Stripo canvas iframe to the panel, refetching and
|
|
477
|
-
* regenerating the canvas while the user never left the editor (SD-149916).
|
|
478
|
-
*
|
|
479
|
-
* Deliberately NOT one-shot: the strategy tab stays open, so a user can create a second
|
|
480
|
-
* strategy in it and come back again — a listener that disarmed on the first return would
|
|
481
|
-
* leave that one missing from the list. It disarms on the first return AFTER that tab is
|
|
482
|
-
* closed instead, so an ordinary alt-tab later in the session costs nothing. Armed only
|
|
483
|
-
* once the user actually opens a strategy page, so anyone who never does pays nothing.
|
|
484
|
-
*/
|
|
485
|
-
_armStrategyPageReturn(url: string): void;
|
|
486
|
-
/**
|
|
487
|
-
* Reloads the products of the block the user is on, so an edit made in the strategy tab
|
|
488
|
-
* lands on the canvas instead of waiting for the assign drawer to be reopened.
|
|
489
|
-
*
|
|
490
|
-
* Only the selected block: the canvas regeneration is driven off the active block's
|
|
491
|
-
* product array, so refreshing an unselected block would fetch without redrawing it.
|
|
492
|
-
*/
|
|
493
|
-
_refreshAssignedStrategyProducts(): Promise<void>;
|
|
494
|
-
/** Lets the editor tear the return listeners down when it unmounts. */
|
|
495
|
-
disposeStrategyPageReturn(): void;
|
|
496
|
-
/**
|
|
497
|
-
* Opens Smart Recommender's strategy creation page. Every return refreshes the list so the
|
|
498
|
-
* new strategy is offered; the user picks it themselves.
|
|
499
|
-
*/
|
|
500
|
-
openStrategyCreation(): void;
|
|
501
|
-
/**
|
|
502
|
-
* Opens the strategy's edit page. Every return refreshes the list so the block reflects the
|
|
503
|
-
* edited configuration.
|
|
504
|
-
*/
|
|
505
|
-
openStrategyEdit(strategyId: string | number): void;
|
|
506
436
|
resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
|
|
507
437
|
assignStrategy(strategy: RrsStrategy): void;
|
|
508
438
|
removeStrategy(): void;
|
|
@@ -520,11 +450,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
520
450
|
* every block's recommendationConfigs across user edits.
|
|
521
451
|
*/
|
|
522
452
|
hasInvalidBlock(): boolean;
|
|
523
|
-
/**
|
|
524
|
-
* Which required fields are missing across the design's blocks, so the save
|
|
525
|
-
* toaster can name the cause instead of always showing the generic message.
|
|
526
|
-
*/
|
|
527
|
-
invalidBlockFields(): string[];
|
|
528
453
|
fetchRecommendationProducts(): Promise<void>;
|
|
529
454
|
_doFetchProducts(): Promise<void>;
|
|
530
455
|
_doFetchStrategyProducts(blockId: number): Promise<void>;
|
|
@@ -15,11 +15,7 @@ export interface RequiredField {
|
|
|
15
15
|
getAvailableOptions?: (store: ExtensionStoreSlice) => string[];
|
|
16
16
|
condition?: (config: PerBlockConfigs) => boolean;
|
|
17
17
|
}
|
|
18
|
-
/** Field key of the strategy/algorithm descriptor, used to pick the toaster message. */
|
|
19
|
-
export declare const STRATEGY_FIELD_KEY = "strategy";
|
|
20
18
|
export declare const REQUIRED_RECOMMENDATION_FIELDS: RequiredField[];
|
|
21
19
|
export declare const RecommendationRequiredFieldsKey = "newsletter.recommendation-fill-required-fields";
|
|
22
|
-
/** Shown instead of the generic message when the only thing missing is the strategy. */
|
|
23
|
-
export declare const RecommendationAssignStrategyKey = "newsletter.recommendation-assign-strategy";
|
|
24
20
|
export declare function getInvalidFields(config: PerBlockConfigs, store: ExtensionStoreSlice, fields?: RequiredField[]): string[];
|
|
25
21
|
export declare function isConfigValid(config: PerBlockConfigs, store: ExtensionStoreSlice): boolean;
|